#include "icon_legend.h"
#include "colorlabel.h"
#include "textview.h"
+#include "imap.h"
+#include "socket.h"
#define AC_LABEL_WIDTH 240
guint action,
GtkWidget *widget);
+static void hide_quotes_cb(MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+
static void move_to_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
static void next_labeled_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static void last_read_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+static void parent_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void goto_folder_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static void goto_unread_folder_cb(MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void copy_cb (MainWindow *mainwin,
guint action,
{N_("/_View/_Go to/Next la_beled message"),
NULL, next_labeled_cb, 0, NULL},
{N_("/_View/_Go to/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_View/_Go to/Other _folder..."), "G", goto_folder_cb, 0, NULL},
+ {N_("/_View/_Go to/Last read message"),
+ NULL, last_read_cb, 0, NULL},
+ {N_("/_View/_Go to/Parent message"),
+ "<control>Up", parent_cb, 0, NULL},
+ {N_("/_View/_Go to/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Go to/Next unread _folder"), "<shift>G", goto_unread_folder_cb, 0, NULL},
+ {N_("/_View/_Go to/_Other folder..."), "G", goto_folder_cb, 0, NULL},
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
#define ENC_SEPARATOR \
{N_("/_View/Open in new _window"), "<control><alt>N", open_msg_cb, 0, NULL},
{N_("/_View/Mess_age source"), "<control>U", view_source_cb, 0, NULL},
{N_("/_View/Show all headers"), "<control>H", show_all_header_cb, 0, "<ToggleItem>"},
+ {N_("/_View/Quotes"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_View/Quotes/_Fold all"), "<control><shift>Q", hide_quotes_cb, 1, "<ToggleItem>"},
+ {N_("/_View/Quotes/Fold from level _2"),NULL, hide_quotes_cb, 2, "<ToggleItem>"},
+ {N_("/_View/Quotes/Fold from level _3"),NULL, hide_quotes_cb, 3, "<ToggleItem>"},
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_View/_Update summary"), "<control><alt>U", update_summary_cb, 0, NULL},
return FALSE;
}
+void main_window_reflect_prefs_all_now(void)
+{
+ reflect_prefs_timeout_cb(GINT_TO_POINTER(FALSE));
+}
+
void main_window_reflect_prefs_custom_colors(MainWindow *mainwin)
{
GtkMenuShell *menu;
if ((selection == SUMMARY_NONE && item->hide_read_msgs)
|| selection != SUMMARY_NONE)
- state |= M_HIDE_READ_MSG;
+ state |= M_HIDE_READ_MSG;
}
if (mainwin->summaryview->threaded)
state |= M_THREADED;
state |= M_NEWS;
else
state |= M_NOT_NEWS;
+ if (prefs_common.actions_list && g_slist_length(prefs_common.actions_list))
+ state |= M_ACTIONS_EXIST;
+
+ if (procmsg_have_queued_mails_fast() && !procmsg_is_sending())
+ state |= M_HAVE_QUEUED_MAILS;
+
if (selection == SUMMARY_SELECTED_SINGLE &&
(item &&
(folder_has_parent_of_type(item, F_DRAFT) ||
{"/View/Go to/Previous unread message" , M_MSG_EXIST},
{"/View/Go to/Previous new message" , M_MSG_EXIST},
{"/View/Go to/Previous marked message" , M_MSG_EXIST},
- {"/View/Go to/Next marked message" , M_MSG_EXIST},
{"/View/Go to/Previous labeled message", M_MSG_EXIST},
{"/View/Go to/Next labeled message", M_MSG_EXIST},
+ {"/View/Go to/Last read message" , M_SINGLE_TARGET_EXIST},
+ {"/View/Go to/Parent message" , M_SINGLE_TARGET_EXIST},
{"/View/Open in new window" , M_SINGLE_TARGET_EXIST},
{"/View/Show all headers" , M_SINGLE_TARGET_EXIST},
+ {"/View/Quotes" , M_SINGLE_TARGET_EXIST},
{"/View/Message source" , M_SINGLE_TARGET_EXIST},
{"/Message/Receive/Get from current account"
, M_HAVE_ACCOUNT|M_UNLOCKED},
{"/Message/Receive/Cancel receiving"
, M_INC_ACTIVE},
-
+ {"/Message/Send queued messages" , M_HAVE_ACCOUNT|M_HAVE_QUEUED_MAILS},
{"/Message/Compose a news message", M_HAVE_NEWS_ACCOUNT},
{"/Message/Reply" , M_HAVE_ACCOUNT|M_TARGET_EXIST},
{"/Message/Reply to" , M_HAVE_ACCOUNT|M_TARGET_EXIST},
{"/Tools/Filter selected messages" , M_TARGET_EXIST|M_EXEC},
{"/Tools/Create filter rule" , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
{"/Tools/Create processing rule" , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
- {"/Tools/Actions" , M_TARGET_EXIST},
+ {"/Tools/Actions" , M_TARGET_EXIST|M_ACTIONS_EXIST},
{"/Tools/Execute" , M_DELAY_EXEC},
{"/Tools/Delete duplicated messages/In selected folder" , M_MSG_EXIST|M_ALLOW_DELETE},
SET_CHECK_MENU_ACTIVE("/View/Show all headers",
mainwin->messageview->mimeview->textview->show_all_headers);
SET_CHECK_MENU_ACTIVE("/View/Thread view", (state & M_THREADED) != 0);
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold all", FALSE);
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold from level 2", FALSE);
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold from level 3", FALSE);
+ if (prefs_common.hide_quotes == 1)
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold all", TRUE);
+ if (prefs_common.hide_quotes == 2)
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold from level 2", TRUE);
+ if (prefs_common.hide_quotes == 3)
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold from level 3", TRUE);
#undef SET_CHECK_MENU_ACTIVE
buf = *buffer;
if (buf == 0x00) {
- url_decoded = NULL;
+ *url_decoded = '\0';
*buffer = NULL;
return;
}
}
else {
*buffer = NULL;
- *url_decoded = NULL;
+ *url_decoded = '\0';
return;
}
tmp[i] = 0x00;
- *url_decoded = NULL;
+ *url_decoded = '\0';
*buffer = NULL;
if (i == maxlen) {
mainwin->messageview->handlebox,
prefs_common.toolbar_style);
+ /* remove headerview if not in prefs */
+ headerview_set_visibility(mainwin->messageview->headerview,
+ prefs_common.display_header_pane);
+
break;
case SEPARATE_BOTH:
messageview_add_toolbar(mainwin->messageview, messagewin);
mainwin->messageview->handlebox,
prefs_common.toolbar_style);
+ /* remove headerview if not in prefs */
+ headerview_set_visibility(mainwin->messageview->headerview,
+ prefs_common.display_header_pane);
+
break;
}
g_return_if_fail(menuitem != NULL);
if (btn == GTK_BUTTON(mainwin->online_switch)) {
- /* go offline */
- mainwindow_check_synchronise(mainwin, TRUE);
gtk_widget_hide (mainwin->online_switch);
gtk_widget_show (mainwin->offline_switch);
menuitem->active = TRUE;
+ inc_autocheck_timer_remove();
+
+ /* go offline */
+ if (prefs_common.work_offline)
+ return;
prefs_common.work_offline = TRUE;
- inc_autocheck_timer_remove();
+ mainwindow_check_synchronise(mainwin, TRUE);
+ imap_disconnect_all();
} else {
/*go online */
+ if (!prefs_common.work_offline)
+ return;
gtk_widget_hide (mainwin->offline_switch);
gtk_widget_show (mainwin->online_switch);
menuitem->active = FALSE;
prefs_common.work_offline = FALSE;
inc_autocheck_timer_set();
+ refresh_resolvers();
}
}
GTK_CHECK_MENU_ITEM(widget)->active);
}
+#define SET_CHECK_MENU_ACTIVE(path, active) \
+{ \
+ menuitem = gtk_item_factory_get_widget(ifactory, path); \
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), active); \
+}
+
+static void hide_quotes_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ GtkWidget *menuitem;
+ GtkItemFactory *ifactory = mainwin->menu_factory;
+
+ if (mainwin->menu_lock_count) return;
+
+ prefs_common.hide_quotes =
+ GTK_CHECK_MENU_ITEM(widget)->active ? action : 0;
+
+ mainwin->menu_lock_count++;
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold all", FALSE);
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold from level 2", FALSE);
+ SET_CHECK_MENU_ACTIVE("/View/Quotes/Fold from level 3", FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), prefs_common.hide_quotes > 0);
+ mainwin->menu_lock_count--;
+
+ summary_redisplay_msg(mainwin->summaryview);
+}
+
+#undef SET_CHECK_MENU_ACTIVE
static void mark_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
summary_mark(mainwin->summaryview);
summary_select_next_labeled(mainwin->summaryview);
}
+static void last_read_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_select_last_read(mainwin->summaryview);
+}
+
+static void parent_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_select_parent(mainwin->summaryview);
+}
+
static void goto_folder_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
folderview_select(mainwin->folderview, to_folder);
}
+static void goto_unread_folder_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ folderview_select_next_unread(mainwin->folderview);
+}
+
static void copy_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
messageview_copy_clipboard(mainwin->messageview);
{
prefs_filtering_open(&pre_global_processing,
_("Processing rules to apply before folder rules"),
- NULL, NULL);
+ MANUAL_ANCHOR_PROCESSING,
+ NULL, NULL, FALSE);
}
static void prefs_post_processing_open_cb(MainWindow *mainwin, guint action,
{
prefs_filtering_open(&post_global_processing,
_("Processing rules to apply after folder rules"),
- NULL, NULL);
+ MANUAL_ANCHOR_PROCESSING,
+ NULL, NULL, FALSE);
}
static void prefs_filtering_open_cb(MainWindow *mainwin, guint action,
{
prefs_filtering_open(&filtering_rules,
_("Filtering configuration"),
- NULL, NULL);
+ MANUAL_ANCHOR_FILTERING,
+ NULL, NULL, TRUE);
}
static void prefs_template_open_cb(MainWindow *mainwin, guint action,
static void manual_open_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- manual_open((ManualType)action);
+ manual_open((ManualType)action, NULL);
}
static void legend_open_cb(GtkMenuItem *menuitem, gpointer data)
SummaryView *summary;
g_return_val_if_fail(data, FALSE);
+ if (!g_list_find(mainwin_list, data))
+ return TRUE;
summary = ((MainWindow *)data)->summaryview;
g_return_val_if_fail(summary, FALSE);