it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "prefs_template.h"
#include "action.h"
#include "account.h"
-#include "addressbook.h"
+#ifndef USE_NEW_ADDRBOOK
+ #include "addressbook.h"
+#else
+ #include "addressbook-dbus.h"
+#endif
#include "logwindow.h"
#include "manage_window.h"
#include "alertpanel.h"
gpointer data);
static void next_labeled_cb (GtkAction *action,
gpointer data);
-static void last_read_cb (GtkAction *action,
+static void prev_history_cb (GtkAction *action,
+ gpointer data);
+static void next_history_cb (GtkAction *action,
gpointer data);
static void parent_cb (GtkAction *action,
gpointer data);
{"View/Goto/PrevLabeled", NULL, N_("Previous _labeled message"), NULL, NULL, G_CALLBACK(prev_labeled_cb) },
{"View/Goto/NextLabeled", NULL, N_("Next la_beled message"), NULL, NULL, G_CALLBACK(next_labeled_cb) },
/* {"View/Goto/---", NULL, "---", NULL, NULL, NULL }, */
- {"View/Goto/LastRead", NULL, N_("Last read message"), NULL, NULL, G_CALLBACK(last_read_cb) },
+ {"View/Goto/PrevHistory", NULL, N_("Previous opened message"), "<alt>Left", NULL, G_CALLBACK(prev_history_cb) },
+ {"View/Goto/NextHistory", NULL, N_("Next opened message"), "<alt>Right", NULL, G_CALLBACK(next_history_cb) },
+ /* {"View/Goto/---", NULL, "---", NULL, NULL, NULL }, */
{"View/Goto/ParentMessage", NULL, N_("Parent message"), "<control>Up", NULL, G_CALLBACK(parent_cb) },
/* {"View/Goto/---", NULL, "---", NULL, NULL, NULL }, */
{"View/Goto/NextUnreadFolder", NULL, N_("Next unread _folder"), "<shift>G", NULL, G_CALLBACK(goto_unread_folder_cb) },
for (; sel != NULL; sel = sel->next) {
MsgInfo *msginfo;
GSList *tags = NULL;
- gint id;
GtkCheckMenuItem *item;
msginfo = (MsgInfo *)sel->data;
sel_len++;
for (; tags; tags = tags->next) {
gint num_checked = GPOINTER_TO_INT(g_hash_table_lookup(menu_allsel_table, tags->data));
- id = GPOINTER_TO_INT(tags->data);
item = g_hash_table_lookup(menu_table, GINT_TO_POINTER(tags->data));
if (item && !gtk_check_menu_item_get_active(item)) {
gtk_check_menu_item_set_active
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevLabeled", "View/Goto/PrevLabeled", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextLabeled", "View/Goto/NextLabeled", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator5", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "LastRead", "View/Goto/LastRead", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "ParentMessage", "View/Goto/ParentMessage", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevHistory", "View/Goto/PrevHistory", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextHistory", "View/Goto/NextHistory", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator6", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "ParentMessage", "View/Goto/ParentMessage", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator7", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextUnreadFolder", "View/Goto/NextUnreadFolder", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "OtherFolder", "View/Goto/OtherFolder", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Scroll", "View/Scroll", GTK_UI_MANAGER_MENU)
folderview_reinit_fonts(mainwin->folderview);
summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
foldersel_reflect_prefs_pixmap_theme();
+#ifndef USE_NEW_ADDRBOOK
addressbook_reflect_prefs_pixmap_theme();
+#endif
#ifndef GENERIC_UMPC
pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_ONLINE);
gtk_container_remove(GTK_CONTAINER(mainwin->online_switch),
if (cur_account)
state |= M_HAVE_ACCOUNT;
+ if (cur_account && cur_account->protocol != A_NONE)
+ state |= M_HAVE_RETRIEVABLE_ACCOUNT;
+
if (any_folder_want_synchronise())
state |= M_WANT_SYNC;
if (g_list_length(account_list) > 1)
state |= M_HAVE_MULTI_ACCOUNT;
+ for ( ; account_list != NULL; account_list = account_list->next) {
+ if (((PrefsAccount*)account_list->data)->protocol != A_NONE) {
+ state |= M_HAVE_ANY_RETRIEVABLE_ACCOUNT;
+ break;
+ }
+ }
+
for ( ; account_list != NULL; account_list = account_list->next) {
if (((PrefsAccount*)account_list->data)->protocol == A_NNTP) {
state |= M_HAVE_NEWS_ACCOUNT;
{"Menu/View/Goto/PrevMarked" , M_MSG_EXIST},
{"Menu/View/Goto/PrevLabeled", M_MSG_EXIST},
{"Menu/View/Goto/NextLabeled", M_MSG_EXIST},
- {"Menu/View/Goto/LastRead" , M_SINGLE_TARGET_EXIST},
{"Menu/View/Goto/ParentMessage" , M_SINGLE_TARGET_EXIST},
{"Menu/View/OpenNewWindow" , M_SINGLE_TARGET_EXIST},
{"Menu/View/MessageSource" , M_SINGLE_TARGET_EXIST},
{"Menu/View/Quotes" , M_SINGLE_TARGET_EXIST},
{"Menu/Message/Receive/CurrentAccount"
- , M_HAVE_ACCOUNT|M_UNLOCKED},
+ , M_HAVE_ACCOUNT|M_UNLOCKED|M_HAVE_RETRIEVABLE_ACCOUNT},
{"Menu/Message/Receive/AllAccounts"
- , M_HAVE_ACCOUNT|M_UNLOCKED},
+ , M_HAVE_ACCOUNT|M_UNLOCKED|M_HAVE_ANY_RETRIEVABLE_ACCOUNT},
{"Menu/Message/Receive/CancelReceiving"
, M_INC_ACTIVE},
{"Menu/Message/SendQueue" , M_HAVE_ACCOUNT|M_HAVE_QUEUED_MAILS},
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/HideReadThreads", FALSE);
if (mainwin->summaryview->folder_item && mainwin->summaryview->folder_item->hide_read_threads)
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/HideReadMessages", FALSE);
-
+
+ cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Goto/PrevHistory",
+ messageview_nav_has_prev(mainwin->messageview));
+ cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Goto/NextHistory",
+ messageview_nav_has_next(mainwin->messageview));
+
main_window_menu_callback_unblock(mainwin);
}
if (messageview_is_visible(mainwin->messageview)) {
gtk_paned_add2(GTK_PANED(hpaned), vpaned);
- gtk_paned_add1(GTK_PANED(vpaned),
- GTK_WIDGET_PTR(mainwin->summaryview));
+ gtk_paned_pack1(GTK_PANED(vpaned),
+ GTK_WIDGET_PTR(mainwin->summaryview), TRUE, TRUE);
} else {
gtk_paned_add2(GTK_PANED(hpaned),
GTK_WIDGET_PTR(mainwin->summaryview));
{
while (mainwin_list != NULL) {
MainWindow *mainwin = (MainWindow*)mainwin_list->data;
-
+
/* free toolbar stuff */
toolbar_clear_list(TOOLBAR_MAIN);
TOOLBAR_DESTROY_ACTIONS(mainwin->toolbar->action_list);
static void addressbook_open_cb(GtkAction *action, gpointer data)
{
+#ifndef USE_NEW_ADDRBOOK
addressbook_open(NULL);
+#else
+ GError* error = NULL;
+
+ addressbook_dbus_open(FALSE, &error);
+ if (error) {
+ g_warning("Failed to open address book");
+ g_warning("%s", error->message);
+ g_error_free(error);
+ }
+#endif
}
static void log_window_show_cb(GtkAction *action, gpointer data)
summary_select_next_labeled(mainwin->summaryview);
}
-static void last_read_cb(GtkAction *action, gpointer data)
+static void prev_history_cb(GtkAction *action, gpointer data)
+{
+ MainWindow *mainwin = (MainWindow *)data;
+ MsgInfo *info = messageview_nav_get_prev(mainwin->messageview);
+ if (info) {
+ if (info->folder != mainwin->summaryview->folder_item)
+ folderview_select(mainwin->folderview, info->folder);
+ summary_display_by_msgnum(mainwin->summaryview, info->msgnum);
+ summary_display_msg_selected(mainwin->summaryview, FALSE);
+ procmsg_msginfo_free(info);
+ main_window_set_menu_sensitive(mainwindow_get_mainwindow());
+ toolbar_main_set_sensitive(mainwindow_get_mainwindow());
+ }
+}
+
+static void next_history_cb(GtkAction *action, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
- summary_select_last_read(mainwin->summaryview);
+ MsgInfo *info = messageview_nav_get_next(mainwin->messageview);
+ if (info) {
+ if (info->folder != mainwin->summaryview->folder_item)
+ folderview_select(mainwin->folderview, info->folder);
+ summary_display_by_msgnum(mainwin->summaryview, info->msgnum);
+ procmsg_msginfo_free(info);
+ main_window_set_menu_sensitive(mainwindow_get_mainwindow());
+ toolbar_main_set_sensitive(mainwindow_get_mainwindow());
+ }
}
static void parent_cb(GtkAction *action, gpointer data)
static void addr_harvest_cb( GtkAction *action, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
+
addressbook_harvest( mainwin->summaryview->folder_item, FALSE, NULL );
}