/*
* 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
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},
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)
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},
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);
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;
/* see if there are synchronised folders */
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)
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);
}
}
{
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 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,
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);
}