/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "stock_pixmap.h"
#include "folder.h"
#include "inc.h"
+#include "log.h"
#include "compose.h"
#include "procmsg.h"
#include "import.h"
static GList *mainwin_list = NULL;
static GdkCursor *watch_cursor = NULL;
+static GdkCursor *hand_cursor = NULL;
static void main_window_menu_callback_block (MainWindow *mainwin);
static void main_window_menu_callback_unblock (MainWindow *mainwin);
guint action,
GtkWidget *widget);
+static void ignore_thread_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+static void unignore_thread_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+static void lock_msgs_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+static void unlock_msgs_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+
static void reedit_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
static void select_thread_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static void delete_thread_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void create_filter_cb (MainWindow *mainwin,
guint action,
static void mainwindow_quicksearch (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static gboolean any_folder_want_synchronise(void);
static GtkItemFactoryEntry mainwin_entries[] =
{
{N_("/_Edit/_Copy"), "<control>C", copy_cb, 0, NULL},
{N_("/_Edit/Select _all"), "<control>A", allsel_cb, 0, NULL},
{N_("/_Edit/Select _thread"), NULL, select_thread_cb, 0, NULL},
+ {N_("/_Edit/_Delete thread"), NULL, delete_thread_cb, 0, NULL},
{N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Edit/_Find in current message..."),
"<control>F", search_cb, 0, NULL},
{N_("/_View/---"), NULL, NULL, 0, "<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/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_("/_Message/_Mark/Mark as unr_ead"), "<shift>exclam", mark_as_unread_cb, 0, NULL},
{N_("/_Message/_Mark/Mark as rea_d"), NULL, mark_as_read_cb, 0, NULL},
{N_("/_Message/_Mark/Mark all _read"), NULL, mark_all_read_cb, 0, NULL},
+ {N_("/_Message/_Mark/Ignore thread"), NULL, ignore_thread_cb, 0, NULL},
+ {N_("/_Message/_Mark/Unignore thread"), NULL, unignore_thread_cb, 0, NULL},
{N_("/_Message/_Mark/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Mark/Mark as _spam"), NULL, mark_as_spam_cb, 1, NULL},
{N_("/_Message/_Mark/Mark as _ham"), NULL, mark_as_spam_cb, 0, NULL},
+ {N_("/_Message/_Mark/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Message/_Mark/Lock"), NULL, lock_msgs_cb, 0, NULL},
+ {N_("/_Message/_Mark/Unlock"), NULL, unlock_msgs_cb, 0, NULL},
{N_("/_Message/Color la_bel"), NULL, NULL, 0, NULL},
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/Re-_edit"), NULL, reedit_cb, 0, NULL},
GtkMenuShell *menu;
GtkCheckMenuItem **items;
gint n;
- GList *cur, *sel;
+ GList *cur;
+ GSList *sel;
mainwin = (MainWindow *)data;
g_return_if_fail(mainwin != NULL);
- sel = GTK_CLIST(mainwin->summaryview->ctree)->selection;
+ sel = summary_get_selection(mainwin->summaryview);
if (!sel) return;
menu = GTK_MENU_SHELL(mainwin->colorlabel_menu);
MsgInfo *msginfo;
gint clabel;
- msginfo = gtk_ctree_node_get_row_data
- (GTK_CTREE(mainwin->summaryview->ctree),
- GTK_CTREE_NODE(sel->data));
+ msginfo = (MsgInfo *)sel->data;
if (msginfo) {
clabel = MSG_GET_COLORLABEL_VALUE(msginfo->flags);
if (!items[clabel]->active)
mainwin->colorlabel_menu = menu;
}
+static gboolean warning_icon_pressed(GtkWidget *widget, GdkEventButton *evt,
+ MainWindow *mainwindow)
+{
+ if (evt && evt->button == 1) {
+ log_window_show_error(mainwindow->logwin);
+ gtk_widget_hide(mainwindow->warning_btn);
+ }
+ return FALSE;
+}
+
+static gboolean warning_visi_notify(GtkWidget *widget,
+ GdkEventVisibility *event,
+ MainWindow *mainwindow)
+{
+ gdk_window_set_cursor(mainwindow->warning_btn->window, hand_cursor);
+ return FALSE;
+}
+
+static gboolean warning_leave_notify(GtkWidget *widget,
+ GdkEventCrossing *event,
+ MainWindow *mainwindow)
+{
+ gdk_window_set_cursor(mainwindow->warning_btn->window, NULL);
+ return FALSE;
+}
+
+static gboolean warning_enter_notify(GtkWidget *widget,
+ GdkEventCrossing *event,
+ MainWindow *mainwindow)
+{
+ gdk_window_set_cursor(mainwindow->warning_btn->window, hand_cursor);
+ return FALSE;
+}
+
+void mainwindow_show_error(void)
+{
+ MainWindow *mainwin = mainwindow_get_mainwindow();
+ gtk_widget_show(mainwin->warning_btn);
+}
+
+void mainwindow_clear_error(MainWindow *mainwin)
+{
+ gtk_widget_hide(mainwin->warning_btn);
+}
MainWindow *main_window_create(SeparateType type)
{
GtkWidget *offline_pixmap;
GtkWidget *online_switch;
GtkWidget *offline_switch;
- GtkTooltips *offline_tip;
- GtkTooltips *online_tip;
- GtkTooltips *sel_ac_tip;
+ GtkTooltips *tips;
+ GtkWidget *warning_icon;
+ GtkWidget *warning_btn;
FolderView *folderview;
SummaryView *summaryview;
hbox_stat = gtk_hbox_new(FALSE, 2);
gtk_box_pack_end(GTK_BOX(vbox_body), hbox_stat, FALSE, FALSE, 0);
+ tips = gtk_tooltips_new();
+
+ warning_icon = gtk_image_new_from_stock
+ (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ warning_btn = gtk_event_box_new();
+ gtk_event_box_set_visible_window(GTK_EVENT_BOX(warning_btn), FALSE);
+
+ mainwin->warning_btn = warning_btn;
+
+ g_signal_connect(G_OBJECT(warning_btn), "button-press-event",
+ G_CALLBACK(warning_icon_pressed),
+ (gpointer) mainwin);
+ g_signal_connect(G_OBJECT(warning_btn), "visibility-notify-event",
+ G_CALLBACK(warning_visi_notify), mainwin);
+ g_signal_connect(G_OBJECT(warning_btn), "motion-notify-event",
+ G_CALLBACK(warning_visi_notify), mainwin);
+ g_signal_connect(G_OBJECT(warning_btn), "leave-notify-event",
+ G_CALLBACK(warning_leave_notify), mainwin);
+ g_signal_connect(G_OBJECT(warning_btn), "enter-notify-event",
+ G_CALLBACK(warning_enter_notify), mainwin);
+
+ gtk_container_add (GTK_CONTAINER(warning_btn), warning_icon);
+
+ gtk_tooltips_set_tip(GTK_TOOLTIPS(tips),warning_btn,
+ _("Some error(s) happened. Click here to view log."), NULL);
+ gtk_box_pack_start(GTK_BOX(hbox_stat), warning_btn, FALSE, FALSE, 0);
+
statusbar = statusbar_create();
gtk_box_pack_start(GTK_BOX(hbox_stat), statusbar, TRUE, TRUE, 0);
online_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_ONLINE);
offline_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_OFFLINE);
- online_tip = gtk_tooltips_new();
online_switch = gtk_button_new ();
- gtk_tooltips_set_tip(GTK_TOOLTIPS(online_tip),online_switch,
+ gtk_tooltips_set_tip(GTK_TOOLTIPS(tips),online_switch,
_("You are online. Click the icon to go offline"), NULL);
- offline_tip = gtk_tooltips_new();
offline_switch = gtk_button_new ();
- gtk_tooltips_set_tip(GTK_TOOLTIPS(offline_tip),offline_switch,
+ gtk_tooltips_set_tip(GTK_TOOLTIPS(tips),offline_switch,
_("You are offline. Click the icon to go online"),
NULL);
gtk_container_add (GTK_CONTAINER(online_switch), online_pixmap);
statuslabel = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(hbox_stat), statuslabel, FALSE, FALSE, 0);
- sel_ac_tip = gtk_tooltips_new();
ac_button = gtk_button_new();
- gtk_tooltips_set_tip(GTK_TOOLTIPS(sel_ac_tip),
+ gtk_tooltips_set_tip(GTK_TOOLTIPS(tips),
ac_button, _("Select account"), NULL);
GTK_WIDGET_UNSET_FLAGS(ac_button, GTK_CAN_FOCUS);
gtk_widget_set_size_request(ac_button, -1, 0);
gtk_widget_show_all(hbox_stat);
gtk_widget_hide(offline_switch);
+ gtk_widget_hide(warning_btn);
/* create views */
mainwin->folderview = folderview = folderview_create();
mainwin->summaryview = summaryview = summary_create();
mainwin->messageview = messageview = messageview_create(mainwin);
mainwin->logwin = log_window_create();
+ log_window_init(mainwin->logwin);
+ log_window_set_clipping(mainwin->logwin, prefs_common.cliplog,
+ prefs_common.loglength);
+
folderview->mainwin = mainwin;
folderview->summaryview = summaryview;
folderview_init(folderview);
summary_init(summaryview);
messageview_init(messageview);
- log_window_init(mainwin->logwin);
- log_window_set_clipping(mainwin->logwin, prefs_common.cliplog,
- prefs_common.loglength);
#ifdef USE_OPENSSL
sslcertwindow_register_hook();
#endif
if (!watch_cursor)
watch_cursor = gdk_cursor_new(GDK_WATCH);
+ if (!hand_cursor)
+ hand_cursor = gdk_cursor_new(GDK_HAND2);
mainwin_list = g_list_append(mainwin_list, mainwin);
main_window_set_toolbar_combo_receive_menu(mainwin, account_list);
main_window_set_toolbar_combo_compose_menu(mainwin, account_list);
}
+ hooks_invoke(ACCOUNT_LIST_CHANGED_HOOKLIST, NULL);
}
void main_window_set_account_menu_only_toolbar(GList *account_list)
prefs_common.msgview_visible = mainwin->messageview->visible;
- gtk_widget_grab_focus(summaryview->ctree);
+ summary_grab_focus(summaryview);
}
void main_window_get_size(MainWindow *mainwin)
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;
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) ||
if (cur_account)
state |= M_HAVE_ACCOUNT;
+ if (any_folder_want_synchronise())
+ state |= M_WANT_SYNC;
+
for ( ; account_list != NULL; account_list = account_list->next) {
if (((PrefsAccount*)account_list->data)->protocol == A_NNTP) {
state |= M_HAVE_NEWS_ACCOUNT;
} entry[] = {
{"/File/Save as...", M_TARGET_EXIST},
{"/File/Print..." , M_TARGET_EXIST},
+ {"/File/Synchronise folders", M_WANT_SYNC},
{"/File/Exit" , M_UNLOCKED},
{"/Edit/Select thread" , M_SINGLE_TARGET_EXIST},
+ {"/Edit/Delete thread" , M_SINGLE_TARGET_EXIST},
+ {"/Edit/Find in current message...", M_SINGLE_TARGET_EXIST},
+ {"/View/Set displayed columns/in Folder list..."
+ , M_UNLOCKED},
{"/View/Sort" , M_EXEC},
{"/View/Thread view" , M_EXEC},
{"/View/Expand all threads" , 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},
+ {"/View/All headers" , M_SINGLE_TARGET_EXIST},
+ {"/View/Quotes" , M_SINGLE_TARGET_EXIST},
{"/Message/Receive/Get from current account"
, M_HAVE_ACCOUNT|M_UNLOCKED},
, 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},
{"/Message/Mark" , M_TARGET_EXIST},
{"/Message/Mark/Mark as spam" , M_TARGET_EXIST|M_CAN_LEARN_SPAM},
{"/Message/Mark/Mark as ham" , M_TARGET_EXIST|M_CAN_LEARN_SPAM},
+ {"/Message/Mark/Ignore thread" , M_TARGET_EXIST},
+ {"/Message/Mark/Unignore thread" , M_TARGET_EXIST},
+ {"/Message/Mark/Lock" , M_TARGET_EXIST},
+ {"/Message/Mark/Unlock" , M_TARGET_EXIST},
{"/Message/Color label" , M_TARGET_EXIST},
{"/Message/Re-edit" , M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
if (mainwin->messageview
&& mainwin->messageview->mimeview
&& mainwin->messageview->mimeview->textview)
- SET_CHECK_MENU_ACTIVE("/View/Show all headers",
+ SET_CHECK_MENU_ACTIVE("/View/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);
{
gint menu_nb = 0;
GtkWidget *menuitem;
-
+
+ if (!msginfo || !msginfo->extradata) {
+ menu_set_sensitive(ifactory, "/Message/Mailing-List/Post", FALSE);
+ menu_set_sensitive(ifactory, "/Message/Mailing-List/Help", FALSE);
+ menu_set_sensitive(ifactory, "/Message/Mailing-List/Subscribe", FALSE);
+ menu_set_sensitive(ifactory, "/Message/Mailing-List/Unsubscribe", FALSE);
+ menu_set_sensitive(ifactory, "/Message/Mailing-List/View archive", FALSE);
+ menu_set_sensitive(ifactory, "/Message/Mailing-List/Contact owner", FALSE);
+ return 0;
+ }
+
/* Mailing list post */
- if (msginfo && !strcmp2 (msginfo->list_post, "NO")) {
- msginfo->list_post = g_strdup (_("No posting allowed"));
+ if (!strcmp2 (msginfo->extradata->list_post, "NO")) {
+ g_free(msginfo->extradata->list_post);
+ msginfo->extradata->list_post = g_strdup (_("No posting allowed"));
}
menuitem = gtk_item_factory_get_item (ifactory, "/Message/Mailing-List/Post");
- menu_nb += mailing_list_populate_submenu (menuitem, msginfo->list_post);
+ menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_post);
/* Mailing list help */
menuitem = gtk_item_factory_get_item (ifactory, "/Message/Mailing-List/Help");
- menu_nb += mailing_list_populate_submenu (menuitem, msginfo->list_help);
+ menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_help);
/* Mailing list subscribe */
menuitem = gtk_item_factory_get_item (ifactory, "/Message/Mailing-List/Subscribe");
- menu_nb += mailing_list_populate_submenu (menuitem, msginfo->list_subscribe);
+ menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_subscribe);
/* Mailing list unsubscribe */
menuitem = gtk_item_factory_get_item (ifactory, "/Message/Mailing-List/Unsubscribe");
- menu_nb += mailing_list_populate_submenu (menuitem, msginfo->list_unsubscribe);
+ menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_unsubscribe);
/* Mailing list view archive */
menuitem = gtk_item_factory_get_item (ifactory, "/Message/Mailing-List/View archive");
- menu_nb += mailing_list_populate_submenu (menuitem, msginfo->list_archive);
+ menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_archive);
/* Mailing list contact owner */
menuitem = gtk_item_factory_get_item (ifactory, "/Message/Mailing-List/Contact owner");
- menu_nb += mailing_list_populate_submenu (menuitem, msginfo->list_owner);
+ menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_owner);
return menu_nb;
}
item = NULL;
if (!g_strncasecmp(url_decoded, "mailto:", 7)) {
item = gtk_menu_item_new_with_label ((url_decoded));
- gtk_signal_connect (GTK_OBJECT(item), "activate",
- GTK_SIGNAL_FUNC(mailing_list_compose), NULL);
+ g_signal_connect(G_OBJECT(item), "activate",
+ G_CALLBACK(mailing_list_compose),
+ NULL);
}
else if (!g_strncasecmp (url_decoded, "http:", 5) ||
!g_strncasecmp (url_decoded, "https:",6)) {
item = gtk_menu_item_new_with_label ((url_decoded));
- gtk_signal_connect (GTK_OBJECT(item), "activate",
- GTK_SIGNAL_FUNC(mailing_list_open_uri), NULL);
+ g_signal_connect(G_OBJECT(item), "activate",
+ G_CALLBACK(mailing_list_open_uri),
+ NULL);
}
if (item) {
gtk_menu_append (GTK_MENU(menu), item);
void main_window_popup(MainWindow *mainwin)
{
+ if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window)))
+ main_window_show(mainwin);
+
gtkut_window_popup(mainwin->window);
switch (mainwin->type) {
folderwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(folderwin),
- _("Sylpheed-Claws - Folder View"));
+ _("Claws Mail - Folder View"));
gtk_window_move(GTK_WINDOW(folderwin),
prefs_common.folderwin_x,
messagewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(messagewin),
- _("Sylpheed-Claws - Message View"));
+ _("Claws Mail - Message View"));
gtk_window_move(GTK_WINDOW(messagewin),
prefs_common.main_msgwin_x,
static void app_exit_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
if (prefs_common.confirm_on_exit) {
- if (alertpanel(_("Exit"), _("Exit Sylpheed-Claws?"),
+ if (alertpanel(_("Exit"), _("Exit Claws Mail?"),
GTK_STOCK_CANCEL, GTK_STOCK_QUIT, NULL)
!= G_ALERTALTERNATE)
return;
static void mainwindow_quicksearch(MainWindow *mainwin, guint action, GtkWidget *widget)
{
- prefs_common.show_searchbar = TRUE;
- summaryview_activate_quicksearch(mainwin->summaryview);
+ summaryview_activate_quicksearch(mainwin->summaryview, TRUE);
}
static void toggle_folder_cb(MainWindow *mainwin, guint action,
main_window_toggle_work_offline(mainwin, GTK_CHECK_MENU_ITEM(widget)->active, TRUE);
}
-static void mainwindow_check_synchronise(MainWindow *mainwin, gboolean ask)
+static gboolean any_folder_want_synchronise(void)
{
GList *folderlist = folder_get_list();
gboolean found = FALSE;
for (; folderlist; folderlist = folderlist->next) {
Folder *folder = (Folder *)folderlist->data;
if (folder_want_synchronise(folder)) {
- found = TRUE;
- break;
+ return TRUE;
}
}
- if (!found)
+ return FALSE;
+
+}
+
+static void mainwindow_check_synchronise(MainWindow *mainwin, gboolean ask)
+{
+
+ if (!any_folder_want_synchronise())
return;
-
+
if (offline_ask_sync && ask && alertpanel(_("Folder synchronisation"),
_("Do you want to synchronise your folders now?"),
GTK_STOCK_CANCEL, _("+_Synchronise"), NULL) != G_ALERTALTERNATE)
/* go offline */
if (prefs_common.work_offline)
return;
- prefs_common.work_offline = TRUE;
mainwindow_check_synchronise(mainwin, TRUE);
+ prefs_common.work_offline = TRUE;
imap_disconnect_all();
+ hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
} else {
/*go online */
if (!prefs_common.work_offline)
prefs_common.work_offline = FALSE;
inc_autocheck_timer_set();
refresh_resolvers();
+ hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
}
}
summary_mark_as_spam(mainwin->summaryview, action, NULL);
}
+static void ignore_thread_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_ignore_thread(mainwin->summaryview);
+}
+
+static void unignore_thread_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_unignore_thread(mainwin->summaryview);
+}
+
+static void lock_msgs_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_msgs_lock(mainwin->summaryview);
+}
+
+static void unlock_msgs_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_msgs_unlock(mainwin->summaryview);
+}
+
+
static void reedit_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
summary_reedit(mainwin->summaryview);
{
struct DelDupsData data = {0, 0};
+ main_window_cursor_wait(mainwin);
folder_func_to_all_folders(deldup_all, &data);
+ main_window_cursor_normal(mainwin);
+
alertpanel_notice(ngettext("Deleted %d duplicate message in %d folders.\n",
"Deleted %d duplicate messages in %d folders.\n",
data.dups),
static void goto_unread_folder_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- folderview_select_next_unread(mainwin->folderview);
+ folderview_select_next_unread(mainwin->folderview, FALSE);
}
static void copy_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
static void select_thread_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- summary_select_thread(mainwin->summaryview);
+ summary_select_thread(mainwin->summaryview, FALSE);
+}
+
+static void delete_thread_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_select_thread(mainwin->summaryview, TRUE);
}
static void create_filter_cb(MainWindow *mainwin, guint action,
PrefsAccount *account = (PrefsAccount *)data;
FolderItem *item = mainwin->summaryview->folder_item;
- compose_new_with_folderitem(account, item);
+ compose_new_with_folderitem(account, item, NULL);
}
static void prefs_open_cb(GtkMenuItem *menuitem, gpointer data)
&& mainwin->summaryview->folder_item->total_msgs == 0))) {
g_signal_stop_emission_by_name(G_OBJECT(widget),
"key_press_event");
- folderview_select_next_unread(mainwin->folderview);
+ folderview_select_next_unread(mainwin->folderview, TRUE);
}
break;
default:
return;
if (!mainwin) {
- printf(_("not initialized\n"));
+ printf("not initialized\n");
return;
}
*p = '\0';
if ((item = folder_find_item_from_identifier(tmp))) {
- printf(_("selecting folder '%s'\n"), tmp);
+ printf("selecting folder '%s'\n", tmp);
folderview_select(mainwin->folderview, item);
main_window_popup(mainwin);
g_free(tmp);
if (msg) {
*msg++ = '\0';
if ((item = folder_find_item_from_identifier(tmp))) {
- printf(_("selecting folder '%s'\n"), tmp);
+ printf("selecting folder '%s'\n", tmp);
folderview_select(mainwin->folderview, item);
- }
+ } else {
+ printf("'%s' not found\n", tmp);
+ }
if (item && msg && atoi(msg)) {
- printf(_("selecting message %d\n"), atoi(msg));
+ printf("selecting message %d\n", atoi(msg));
summary_select_by_msgnum(mainwin->summaryview, atoi(msg));
summary_display_msg_selected(mainwin->summaryview, FALSE);
main_window_popup(mainwin);
g_free(tmp);
return;
- }
+ } else if (item && msg[0] == '<' && msg[strlen(msg)-1] == '>') {
+ MsgInfo *msginfo = NULL;
+ msg++;
+ msg[strlen(msg)-1] = '\0';
+ msginfo = folder_item_get_msginfo_by_msgid(item, msg);
+ if (msginfo) {
+ printf("selecting message %s\n", msg);
+ summary_select_by_msgnum(mainwin->summaryview, msginfo->msgnum);
+ summary_display_msg_selected(mainwin->summaryview, FALSE);
+ main_window_popup(mainwin);
+ g_free(tmp);
+ procmsg_msginfo_free(msginfo);
+ return;
+ } else {
+ printf("'%s' not found\n", msg);
+ }
+ } else {
+ printf("'%s' not found\n", msg);
+ }
+ } else {
+ printf("'%s' not found\n", tmp);
}
- printf("'%s' not found\n", tmp);
-
g_free(tmp);
}