2001-04-19 14:21:46 +02:00
|
|
|
/*
|
2007-07-11 18:38:12 +02:00
|
|
|
Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
2008-03-12 07:22:29 +01:00
|
|
|
Copyright (C) 1999-2008 Hiroyuki Yamamoto and the Claws Mail team
|
2007-07-11 18:38:12 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
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/>.
|
2001-04-19 14:21:46 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
|
|
|
|
#include <glib.h>
|
2005-02-10 13:06:07 +01:00
|
|
|
#include <glib/gi18n.h>
|
2001-11-29 11:49:46 +01:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
2008-07-19 16:02:31 +02:00
|
|
|
#include <gtk/gtk.h>
|
2001-04-19 14:21:46 +02:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "folderview.h"
|
|
|
|
#include "foldersel.h"
|
|
|
|
#include "summaryview.h"
|
|
|
|
#include "summary_search.h"
|
|
|
|
#include "messageview.h"
|
2001-09-24 10:15:52 +02:00
|
|
|
#include "message_search.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "headerview.h"
|
|
|
|
#include "menu.h"
|
2001-12-22 01:30:32 +01:00
|
|
|
#include "stock_pixmap.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "folder.h"
|
|
|
|
#include "inc.h"
|
2006-08-31 19:27:03 +02:00
|
|
|
#include "log.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "compose.h"
|
|
|
|
#include "procmsg.h"
|
|
|
|
#include "import.h"
|
2001-04-21 01:24:31 +02:00
|
|
|
#include "export.h"
|
2007-07-02 18:35:40 +02:00
|
|
|
#include "edittags.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "prefs_common.h"
|
2002-02-06 12:15:31 +01:00
|
|
|
#include "prefs_actions.h"
|
2001-05-29 02:29:13 +02:00
|
|
|
#include "prefs_filtering.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "prefs_account.h"
|
2001-10-22 10:42:36 +02:00
|
|
|
#include "prefs_summary_column.h"
|
2005-08-05 21:57:42 +02:00
|
|
|
#include "prefs_folder_column.h"
|
2001-11-07 11:29:45 +01:00
|
|
|
#include "prefs_template.h"
|
2003-04-17 10:18:15 +02:00
|
|
|
#include "action.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "account.h"
|
|
|
|
#include "addressbook.h"
|
|
|
|
#include "logwindow.h"
|
|
|
|
#include "manage_window.h"
|
|
|
|
#include "alertpanel.h"
|
|
|
|
#include "statusbar.h"
|
|
|
|
#include "inputdialog.h"
|
|
|
|
#include "utils.h"
|
|
|
|
#include "gtkutils.h"
|
|
|
|
#include "codeconv.h"
|
|
|
|
#include "about.h"
|
|
|
|
#include "manual.h"
|
2001-09-02 17:07:05 +02:00
|
|
|
#include "version.h"
|
2002-11-25 16:21:47 +01:00
|
|
|
#include "ssl_manager.h"
|
2002-12-09 09:54:56 +01:00
|
|
|
#include "sslcertwindow.h"
|
2003-01-06 19:54:30 +01:00
|
|
|
#include "prefs_gtk.h"
|
2003-01-01 17:30:29 +01:00
|
|
|
#include "pluginwindow.h"
|
2003-03-03 21:45:57 +01:00
|
|
|
#include "hooks.h"
|
|
|
|
#include "progressindicator.h"
|
2004-01-12 22:28:31 +01:00
|
|
|
#include "localfolder.h"
|
|
|
|
#include "filtering.h"
|
2004-05-10 12:22:28 +02:00
|
|
|
#include "folderutils.h"
|
|
|
|
#include "foldersort.h"
|
2005-12-09 15:31:58 +01:00
|
|
|
#include "icon_legend.h"
|
2006-03-17 19:10:51 +01:00
|
|
|
#include "colorlabel.h"
|
2007-07-02 18:35:40 +02:00
|
|
|
#include "tags.h"
|
2006-03-18 20:16:07 +01:00
|
|
|
#include "textview.h"
|
2006-07-04 18:32:15 +02:00
|
|
|
#include "imap.h"
|
2006-07-25 10:44:31 +02:00
|
|
|
#include "socket.h"
|
2007-09-18 08:58:04 +02:00
|
|
|
#include "printing.h"
|
2002-08-06 16:22:44 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
#define AC_LABEL_WIDTH 240
|
|
|
|
|
|
|
|
/* list of all instantiated MainWindow */
|
|
|
|
static GList *mainwin_list = NULL;
|
|
|
|
|
2006-03-18 20:16:07 +01:00
|
|
|
static GdkCursor *watch_cursor = NULL;
|
2006-08-31 19:27:03 +02:00
|
|
|
static GdkCursor *hand_cursor = NULL;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-03-06 11:16:20 +01:00
|
|
|
static gint iconified_count = 0;
|
|
|
|
|
2002-02-14 16:28:02 +01:00
|
|
|
static void main_window_menu_callback_block (MainWindow *mainwin);
|
|
|
|
static void main_window_menu_callback_unblock (MainWindow *mainwin);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
static void main_window_show_cur_account (MainWindow *mainwin);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-01-19 19:16:09 +01:00
|
|
|
static void main_window_separation_change (MainWindow *mainwin,
|
|
|
|
LayoutType layout_mode);
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
static void main_window_set_widgets (MainWindow *mainwin,
|
2007-01-19 19:16:09 +01:00
|
|
|
LayoutType layout_mode);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
static void toolbar_child_attached (GtkWidget *widget,
|
|
|
|
GtkWidget *child,
|
|
|
|
gpointer data);
|
|
|
|
static void toolbar_child_detached (GtkWidget *widget,
|
|
|
|
GtkWidget *child,
|
|
|
|
gpointer data);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2004-07-20 15:31:12 +02:00
|
|
|
static gboolean ac_label_button_pressed (GtkWidget *widget,
|
2001-04-19 14:21:46 +02:00
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data);
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2003-08-21 10:45:43 +02:00
|
|
|
static gint main_window_close_cb (GtkWidget *widget,
|
|
|
|
GdkEventAny *event,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void main_window_size_allocate_cb (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
gpointer data);
|
|
|
|
static void folder_window_size_allocate_cb (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
gpointer data);
|
|
|
|
static void message_window_size_allocate_cb (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
gpointer data);
|
2003-08-09 08:26:27 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void update_folderview_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void add_mailbox_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void foldersort_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void import_mbox_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void export_mbox_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void export_list_mbox_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void empty_trash_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void save_as_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2007-09-18 08:58:04 +02:00
|
|
|
#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
|
2008-07-29 21:07:54 +02:00
|
|
|
static void page_setup_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2007-09-18 08:58:04 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
static void print_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void app_exit_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2007-09-18 08:58:04 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
|
|
|
|
static void search_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void search_folder_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void toggle_message_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void toggle_toolbar_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
|
|
|
|
static void toggle_col_headers_cb(GtkAction *action,
|
|
|
|
gpointer data);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2008-07-29 21:07:54 +02:00
|
|
|
static void toggle_statusbar_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void set_layout_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
|
2007-07-15 11:14:01 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
static void addressbook_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void log_window_show_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void filtering_debug_window_show_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void inc_cancel_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void open_msg_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void view_source_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void show_all_header_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void hide_quotes_cb(GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void move_to_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void copy_to_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void delete_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void delete_trash_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void cancel_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void mark_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void unmark_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void mark_as_unread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void mark_as_read_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void mark_all_read_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void mark_as_spam_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void mark_as_ham_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void ignore_thread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void unignore_thread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void watch_thread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void unwatch_thread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void lock_msgs_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void unlock_msgs_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void reedit_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void add_address_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void set_charset_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
|
|
|
|
|
|
|
|
static void set_decode_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
|
|
|
|
|
|
|
|
static void hide_read_messages (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void thread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void expand_threads_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void collapse_threads_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void set_summary_display_item_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void set_folder_display_item_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void sort_summary_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
|
|
|
|
static void sort_summary_type_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
|
|
|
|
static void attract_by_subject_cb(GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void delete_duplicated_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void delete_duplicated_all_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void filter_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void filter_list_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void process_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void execute_summary_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void update_summary_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prev_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void next_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void next_unread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void prev_unread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prev_new_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void next_new_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void prev_marked_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void next_marked_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void prev_labeled_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void next_labeled_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void last_read_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void parent_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void goto_folder_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void goto_unread_folder_cb(GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void copy_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void allsel_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void select_thread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void delete_thread_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void create_filter_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void create_processing_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void open_urls_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prefs_template_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_actions_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_tags_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_account_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prefs_pre_processing_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prefs_post_processing_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prefs_filtering_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2007-10-18 09:13:06 +02:00
|
|
|
#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
|
2008-07-29 21:07:54 +02:00
|
|
|
static void ssl_manager_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2002-11-25 16:21:47 +01:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
static void new_account_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
static void account_selector_menu_cb (GtkMenuItem *menuitem,
|
|
|
|
gpointer data);
|
|
|
|
static void account_receive_menu_cb (GtkMenuItem *menuitem,
|
|
|
|
gpointer data);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2006-05-12 19:42:48 +02:00
|
|
|
static void account_compose_menu_cb (GtkMenuItem *menuitem,
|
|
|
|
gpointer data);
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void plugins_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2002-12-31 15:43:41 +01:00
|
|
|
|
2002-04-21 14:11:43 +02:00
|
|
|
static void online_switch_clicked(GtkButton *btn,
|
|
|
|
gpointer data);
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void manual_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
|
|
|
static void manual_faq_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2002-03-05 17:30:04 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void legend_open_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2005-12-09 15:31:58 +01:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
static void scan_tree_func (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
gpointer data);
|
2001-06-24 13:45:04 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void toggle_work_offline_cb(GtkAction *action,
|
|
|
|
gpointer data);
|
2002-06-11 23:46:03 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void addr_harvest_cb ( GtkAction *action,
|
|
|
|
gpointer data );
|
2002-03-16 08:07:34 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void addr_harvest_msg_cb ( GtkAction *action,
|
|
|
|
gpointer data );
|
|
|
|
static void sync_cb ( GtkAction *action,
|
|
|
|
gpointer data );
|
2002-04-08 05:51:28 +02:00
|
|
|
|
2002-12-29 17:11:53 +01:00
|
|
|
static gboolean mainwindow_focus_in_event (GtkWidget *widget,
|
|
|
|
GdkEventFocus *focus,
|
|
|
|
gpointer data);
|
2007-01-28 13:05:08 +01:00
|
|
|
static gboolean mainwindow_visibility_event_cb (GtkWidget *widget,
|
|
|
|
GdkEventVisibility *state,
|
|
|
|
gpointer data);
|
2007-03-06 11:16:20 +01:00
|
|
|
static gboolean mainwindow_state_event_cb (GtkWidget *widget,
|
|
|
|
GdkEventWindowState *state,
|
|
|
|
gpointer data);
|
2008-07-29 21:07:54 +02:00
|
|
|
static void main_window_reply_cb (GtkAction *action,
|
|
|
|
gpointer data);
|
2007-01-20 20:54:05 +01:00
|
|
|
static gboolean mainwindow_progressindicator_hook (gpointer source,
|
2003-03-03 21:45:57 +01:00
|
|
|
gpointer userdata);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static gint mailing_list_create_submenu(MainWindow *mainwindow,
|
2006-05-12 19:42:48 +02:00
|
|
|
MsgInfo *msginfo);
|
|
|
|
|
|
|
|
static gint mailing_list_populate_submenu(GtkWidget *menu, const gchar * list_header);
|
|
|
|
|
|
|
|
static void get_url_part(const gchar **buf, gchar *url_decoded, gint maxlen);
|
|
|
|
|
|
|
|
static void mailing_list_compose(GtkWidget *w, gpointer *data);
|
|
|
|
|
|
|
|
static void mailing_list_open_uri(GtkWidget *w, gpointer *data);
|
2002-06-11 23:46:03 +02:00
|
|
|
#define SEPARATE_ACTION 500
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mainwindow_quicksearch (GtkAction *action,
|
|
|
|
gpointer data);
|
2007-01-06 18:57:16 +01:00
|
|
|
static gboolean any_folder_want_synchronise(void);
|
2001-05-26 21:04:41 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
#define DO_ACTION(name, act) { if (!strcmp(a_name, name)) action = act; }
|
|
|
|
|
|
|
|
static void mainwindow_nothing_cb (GtkAction *action, gpointer data)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void about_cb(GtkAction *gaction, gpointer data)
|
|
|
|
{
|
|
|
|
about_show();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mw_inc_mail_cb (GtkAction *gaction, gpointer data)
|
|
|
|
{
|
|
|
|
inc_mail_cb(data, 0, NULL);
|
|
|
|
}
|
|
|
|
static void mw_inc_all_account_mail_cb (GtkAction *gaction, gpointer data)
|
|
|
|
{
|
|
|
|
inc_all_account_mail_cb(data, 0, NULL);
|
|
|
|
}
|
|
|
|
static void mw_send_queue_cb (GtkAction *gaction, gpointer data)
|
|
|
|
{
|
|
|
|
send_queue_cb(data, 0, NULL);
|
|
|
|
}
|
|
|
|
static void mw_compose_mail_cb (GtkAction *gaction, gpointer data)
|
|
|
|
{
|
|
|
|
compose_mail_cb(data, 0, NULL);
|
|
|
|
}
|
|
|
|
static void mw_compose_news_cb (GtkAction *gaction, gpointer data)
|
|
|
|
{
|
|
|
|
compose_news_cb(data, 0, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkActionEntry mainwin_entries[] =
|
|
|
|
{
|
|
|
|
{"Menu", NULL, "Menu" },
|
|
|
|
/* menus */
|
|
|
|
{"File", NULL, N_("_File") },
|
|
|
|
{"Edit", NULL, N_("_Edit") },
|
|
|
|
{"View", NULL, N_("_View") },
|
|
|
|
{"Message", NULL, N_("_Message") },
|
|
|
|
{"Tools", NULL, N_("_Tools") },
|
|
|
|
{"Configuration", NULL, N_("_Configuration") },
|
|
|
|
{"Help", NULL, N_("_Help") },
|
|
|
|
|
|
|
|
/* File menu */
|
|
|
|
{"File/AddMailbox", NULL, N_("_Add mailbox") },
|
|
|
|
{"File/AddMailbox/MH", NULL, N_("MH..."), NULL, NULL, G_CALLBACK(add_mailbox_cb) },
|
|
|
|
{"File/---", NULL, "---" },
|
|
|
|
|
|
|
|
{"File/SortFolders", NULL, N_("Change folder order..."), NULL, NULL, G_CALLBACK(foldersort_cb) },
|
|
|
|
|
|
|
|
/* {"File/---", NULL, "---" }, */
|
|
|
|
{"File/ImportMbox", NULL, N_("_Import mbox file..."), NULL, NULL, G_CALLBACK(import_mbox_cb) },
|
|
|
|
{"File/ExportMbox", NULL, N_("_Export to mbox file..."), NULL, NULL, G_CALLBACK(export_mbox_cb) },
|
|
|
|
{"File/ExportSelMbox", NULL, N_("_Export selected to mbox file..."), NULL, NULL, G_CALLBACK(export_list_mbox_cb) },
|
|
|
|
/* {"File/---", NULL, "---" }, */
|
|
|
|
{"File/EmptyTrashes", NULL, N_("Empty all _Trash folders"), "<shift>D", NULL, G_CALLBACK(empty_trash_cb) },
|
|
|
|
/* {"File/---", NULL, "---" }, */
|
|
|
|
|
|
|
|
{"File/SaveAs", NULL, N_("_Save as..."), "<control>S", NULL, G_CALLBACK(save_as_cb) },
|
|
|
|
|
2007-09-18 08:58:04 +02:00
|
|
|
#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
|
2008-07-29 21:07:54 +02:00
|
|
|
{"File/PageSetup", NULL, N_("Page setup..."), NULL, NULL, G_CALLBACK(page_setup_cb) },
|
2007-09-18 08:58:04 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
{"File/Print", NULL, N_("_Print..."), "<control>P", NULL, G_CALLBACK(print_cb) },
|
|
|
|
/* {"File/---", NULL, "---" }, */
|
|
|
|
{"File/SynchroniseFolders", NULL, N_("Synchronise folders"), "<control><shift>S", NULL, G_CALLBACK(sync_cb) },
|
|
|
|
/* {"File/---", NULL, "---" }, */
|
|
|
|
{"File/Exit", NULL, N_("E_xit"), "<control>Q", NULL, G_CALLBACK(app_exit_cb) },
|
|
|
|
|
|
|
|
/* Edit menu */
|
|
|
|
{"Edit/Copy", NULL, N_("_Copy"), "<control>C", NULL, G_CALLBACK(copy_cb) },
|
|
|
|
{"Edit/SelectAll", NULL, N_("Select _all"), "<control>A", NULL, G_CALLBACK(allsel_cb) },
|
|
|
|
{"Edit/SelectThread", NULL, N_("Select _thread"), NULL, NULL, G_CALLBACK(select_thread_cb) },
|
|
|
|
{"Edit/DeleteThread", NULL, N_("_Delete thread"), NULL, NULL, G_CALLBACK(delete_thread_cb) },
|
|
|
|
{"Edit/---", NULL, "---" },
|
|
|
|
{"Edit/Find", NULL, N_("_Find in current message..."), "<control>F", NULL, G_CALLBACK(search_cb) },
|
|
|
|
{"Edit/SearchFolder", NULL, N_("_Search folder..."), "<shift><control>F", NULL, G_CALLBACK(search_folder_cb) },
|
|
|
|
{"Edit/QuickSearch", NULL, N_("_Quick search"), "slash", NULL, G_CALLBACK(mainwindow_quicksearch) },
|
|
|
|
|
|
|
|
/* View menu */
|
|
|
|
{"View/ShowHide", NULL, N_("Show or hi_de") },
|
|
|
|
{"View/ShowHide/Toolbar", NULL, N_("_Toolbar") },
|
|
|
|
|
|
|
|
{"View/SetColumns", NULL, N_("Set displayed _columns") },
|
|
|
|
{"View/SetColumns/Folderlist", NULL, N_("in _Folder list..."), NULL, NULL, G_CALLBACK(set_folder_display_item_cb) },
|
|
|
|
{"View/SetColumns/Messagelist", NULL, N_("in _Message list..."), NULL, NULL, G_CALLBACK(set_summary_display_item_cb) },
|
|
|
|
{"View/---", NULL, "---" },
|
|
|
|
|
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2008-07-29 21:07:54 +02:00
|
|
|
{"View/Layout", NULL, N_("La_yout") },
|
|
|
|
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
{"View/Sort", NULL, N_("_Sort") },
|
|
|
|
{"View/Sort/---", NULL, "---" },
|
|
|
|
{"View/Sort/AttractSubj", NULL, N_("_Attract by subject"), NULL, NULL, G_CALLBACK(attract_by_subject_cb) },
|
|
|
|
|
|
|
|
{"View/ExpandThreads", NULL, N_("E_xpand all threads"), NULL, NULL, G_CALLBACK(expand_threads_cb) },
|
|
|
|
{"View/CollapseThreads", NULL, N_("Co_llapse all threads"), NULL, NULL, G_CALLBACK(collapse_threads_cb) },
|
|
|
|
|
|
|
|
{"View/Goto", NULL, N_("_Go to") },
|
|
|
|
{"View/Goto/Prev", NULL, N_("_Previous message"), "P", NULL, G_CALLBACK(prev_cb) },
|
|
|
|
{"View/Goto/Next", NULL, N_("_Next message"), "N", NULL, G_CALLBACK(next_cb) },
|
|
|
|
{"View/Goto/---", NULL, "---", NULL, NULL, NULL },
|
|
|
|
{"View/Goto/PrevUnread", NULL, N_("P_revious unread message"), "<shift>P", NULL, G_CALLBACK(prev_unread_cb) },
|
|
|
|
{"View/Goto/NextUnread", NULL, N_("N_ext unread message"), "<shift>N", NULL, G_CALLBACK(next_unread_cb) },
|
|
|
|
/* {"View/Goto/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"View/Goto/PrevNew", NULL, N_("Previous ne_w message"), NULL, NULL, G_CALLBACK(prev_new_cb) },
|
|
|
|
{"View/Goto/NextNew", NULL, N_("Ne_xt new message"), NULL, NULL, G_CALLBACK(next_new_cb) },
|
|
|
|
/* {"View/Goto/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"View/Goto/PrevMarked", NULL, N_("Previous _marked message"), NULL, NULL, G_CALLBACK(prev_marked_cb) },
|
|
|
|
{"View/Goto/NextMarked", NULL, N_("Next m_arked message"), NULL, NULL, G_CALLBACK(next_marked_cb) },
|
|
|
|
/* {"View/Goto/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"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/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) },
|
|
|
|
{"View/Goto/OtherFolder", NULL, N_("_Other folder..."), "G", NULL, G_CALLBACK(goto_folder_cb) },
|
|
|
|
/* {"View/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
|
|
|
|
{"View/Encoding", NULL, N_("Character _encoding") }, /* set_charset_cb */
|
|
|
|
{"View/Encoding/---", NULL, "---" },
|
|
|
|
#define ENC_ACTION(cs_char,c_char,string) \
|
|
|
|
{ "View/Encoding/" cs_char, NULL, N_(string), NULL, NULL, c_char }
|
|
|
|
|
|
|
|
{"View/Encoding/Western", NULL, N_("Western European") },
|
|
|
|
{"View/Encoding/Baltic", NULL, N_("Baltic") },
|
|
|
|
{"View/Encoding/Hebrew", NULL, N_("Hebrew") },
|
|
|
|
{"View/Encoding/Arabic", NULL, N_("Arabic") },
|
|
|
|
{"View/Encoding/Cyrillic", NULL, N_("Cyrillic") },
|
|
|
|
{"View/Encoding/Japanese", NULL, N_("Japanese") },
|
|
|
|
{"View/Encoding/Chinese", NULL, N_("Chinese") },
|
|
|
|
{"View/Encoding/Korean", NULL, N_("Korean") },
|
|
|
|
{"View/Encoding/Thai", NULL, N_("Thai") },
|
|
|
|
|
|
|
|
{"View/Decode", NULL, N_("Decode") }, /* set_decode_cb */
|
|
|
|
{"View/Decode/---", NULL, "---" },
|
|
|
|
|
|
|
|
#define DEC_ACTION(cs_type,c_type,string) \
|
|
|
|
{ "View/Decode/" cs_type, NULL, N_(string), NULL, NULL, c_type }
|
|
|
|
|
|
|
|
/* {"View/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"View/OpenNewWindow", NULL, N_("Open in new _window"), "<control><alt>N", NULL, G_CALLBACK(open_msg_cb) },
|
|
|
|
{"View/MessageSource", NULL, N_("Mess_age source"), "<control>U", NULL, G_CALLBACK(view_source_cb) },
|
|
|
|
{"View/Quotes", NULL, N_("Quotes") },
|
|
|
|
/* {"View/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"View/UpdateSummary", NULL, N_("_Update summary"), "<control><alt>U", NULL, G_CALLBACK(update_summary_cb) },
|
|
|
|
|
|
|
|
/* Message menu */
|
|
|
|
{"Message/Receive", NULL, N_("Recei_ve") },
|
|
|
|
{"Message/Receive/CurrentAccount", NULL, N_("Get from _current account"), "<control>I", NULL, G_CALLBACK(mw_inc_mail_cb) },
|
|
|
|
{"Message/Receive/AllAccounts", NULL, N_("Get from _all accounts"), "<shift><control>I", NULL, G_CALLBACK(mw_inc_all_account_mail_cb) },
|
|
|
|
{"Message/Receive/CancelReceiving", NULL, N_("Cancel receivin_g"), NULL, NULL, G_CALLBACK(inc_cancel_cb) },
|
|
|
|
{"Message/Receive/---", NULL, "---" },
|
|
|
|
{"Message/Receive/PlaceHolder", NULL, "PlaceHolder,", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
{"Message/SendQueue", NULL, N_("_Send queued messages"), NULL, NULL, G_CALLBACK(mw_send_queue_cb) },
|
|
|
|
|
|
|
|
{"Message/---", NULL, "---" },
|
|
|
|
|
|
|
|
{"Message/ComposeEmail", NULL, N_("Compose a_n email message"), "<control>M", NULL, G_CALLBACK(mw_compose_mail_cb) },
|
|
|
|
{"Message/ComposeNews", NULL, N_("Compose a news message"), NULL, NULL, G_CALLBACK(mw_compose_news_cb) },
|
|
|
|
|
|
|
|
{"Message/Reply", NULL, N_("_Reply"), "<control>R", NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_REPLY */
|
|
|
|
{"Message/ReplyTo", NULL, N_("Repl_y to") },
|
|
|
|
{"Message/ReplyTo/All", NULL, N_("_all"), "<control><shift>R", NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_REPLY_TO_ALL */
|
|
|
|
{"Message/ReplyTo/Sender", NULL, N_("_sender"), NULL, NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_REPLY_TO_SENDER */
|
|
|
|
{"Message/ReplyTo/List", NULL, N_("mailing _list"), "<control>L", NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_REPLY_TO_LIST */
|
|
|
|
{"Message/FollowupReply", NULL, N_("Follow-up and reply to"), NULL, NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_FOLLOWUP_AND_REPLY_TO */
|
|
|
|
/*{"Message/---", NULL, "---" },*/
|
|
|
|
|
|
|
|
{"Message/Forward", NULL, N_("_Forward"), "<control><alt>F", NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_FORWARD_INLINE */
|
|
|
|
{"Message/ForwardAtt", NULL, N_("For_ward as attachment"), NULL, NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_FORWARD_AS_ATTACH */
|
|
|
|
{"Message/Redirect", NULL, N_("Redirec_t"), NULL, NULL, G_CALLBACK(main_window_reply_cb) }, /* COMPOSE_REDIRECT */
|
|
|
|
|
|
|
|
{"Message/MailingList", NULL, N_("Mailing-_List") },
|
|
|
|
{"Message/MailingList/Post", NULL, N_("Post") },
|
|
|
|
{"Message/MailingList/Post/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
{"Message/MailingList/Help", NULL, N_("Help") },
|
|
|
|
{"Message/MailingList/Help/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
{"Message/MailingList/Subscribe", NULL, N_("Subscribe") },
|
|
|
|
{"Message/MailingList/Subscribe/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
{"Message/MailingList/Unsubscribe", NULL, N_("Unsubscribe") },
|
|
|
|
{"Message/MailingList/Unsubscribe/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
{"Message/MailingList/ViewArchive", NULL, N_("View archive") },
|
|
|
|
{"Message/MailingList/ViewArchive/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
{"Message/MailingList/ContactOwner", NULL, N_("Contact owner") },
|
|
|
|
{"Message/MailingList/ContactOwner/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
/*{"Message/---", NULL, "---" },*/
|
|
|
|
|
|
|
|
{"Message/Move", NULL, N_("M_ove..."), "<control>O", NULL, G_CALLBACK(move_to_cb) },
|
|
|
|
{"Message/Copy", NULL, N_("_Copy..."), "<shift><control>O", NULL, G_CALLBACK(copy_to_cb) },
|
|
|
|
{"Message/Trash", NULL, N_("Move to _trash"), "<control>D", NULL, G_CALLBACK(delete_trash_cb) },
|
|
|
|
{"Message/Delete", NULL, N_("_Delete..."), NULL, NULL, G_CALLBACK(delete_cb) },
|
|
|
|
{"Message/CancelNews", NULL, N_("Cancel a news message"), NULL, NULL, G_CALLBACK(cancel_cb) },
|
|
|
|
/*{"Message/---", NULL, "---" },*/
|
|
|
|
|
|
|
|
{"Message/Mark", NULL, "_Mark" },
|
|
|
|
{"Message/Mark/Mark", NULL, N_("_Mark"), "<shift>asterisk", NULL, G_CALLBACK(mark_cb) },
|
|
|
|
{"Message/Mark/Unmark", NULL, N_("_Unmark"), "U", NULL, G_CALLBACK(unmark_cb) },
|
|
|
|
{"Message/Mark/---", NULL, "---", NULL, NULL, NULL },
|
|
|
|
|
|
|
|
{"Message/Mark/MarkUnread", NULL, N_("Mark as unr_ead"), "<shift>exclam", NULL, G_CALLBACK(mark_as_unread_cb) },
|
|
|
|
{"Message/Mark/MarkRead", NULL, N_("Mark as rea_d"), NULL, NULL, G_CALLBACK(mark_as_read_cb) },
|
|
|
|
{"Message/Mark/MarkAllRead", NULL, N_("Mark all read"), NULL, NULL, G_CALLBACK(mark_all_read_cb) },
|
|
|
|
{"Message/Mark/IgnoreThread", NULL, N_("Ignore thread"), NULL, NULL, G_CALLBACK(ignore_thread_cb) },
|
|
|
|
{"Message/Mark/UnignoreThread", NULL, N_("Unignore thread"), NULL, NULL, G_CALLBACK(unignore_thread_cb) },
|
|
|
|
{"Message/Mark/WatchThread", NULL, N_("Watch thread"), NULL, NULL, G_CALLBACK(watch_thread_cb) },
|
|
|
|
{"Message/Mark/UnwatchThread", NULL, N_("Unwatch thread"), NULL, NULL, G_CALLBACK(unwatch_thread_cb) },
|
|
|
|
/* separation */
|
|
|
|
|
|
|
|
{"Message/Mark/MarkSpam", NULL, N_("Mark as spam"), NULL, NULL, G_CALLBACK(mark_as_spam_cb) },
|
|
|
|
{"Message/Mark/MarkHam", NULL, N_("Mark as ham"), NULL, NULL, G_CALLBACK(mark_as_ham_cb) },
|
|
|
|
/* separation */
|
|
|
|
|
|
|
|
{"Message/Mark/Lock", NULL, N_("Lock"), NULL, NULL, G_CALLBACK(lock_msgs_cb) },
|
|
|
|
{"Message/Mark/Unlock", NULL, N_("Unlock"), NULL, NULL, G_CALLBACK(unlock_msgs_cb) },
|
|
|
|
|
|
|
|
{"Message/ColorLabel", NULL, "Color la_bel" },
|
|
|
|
{"Message/Tags", NULL, "Ta_gs" },
|
|
|
|
/*{"Message/---", NULL, "---" },*/
|
|
|
|
|
|
|
|
{"Message/Reedit", NULL, N_("Re-_edit"), NULL, NULL, G_CALLBACK(reedit_cb) },
|
|
|
|
|
|
|
|
/* Tools menu */
|
|
|
|
|
|
|
|
{"Tools/AddressBook", NULL, N_("_Address book"), "<control><shift>A", NULL, G_CALLBACK(addressbook_open_cb) },
|
|
|
|
{"Tools/AddSenderToAB", NULL, N_("Add sender to address boo_k"), NULL, NULL, G_CALLBACK(add_address_cb) },
|
|
|
|
|
|
|
|
{"Tools/CollectAddresses", NULL, N_("C_ollect addresses") },
|
|
|
|
{"Tools/CollectAddresses/FromFolder", NULL, N_("from Current _folder..."), NULL, NULL, G_CALLBACK(addr_harvest_cb) },
|
|
|
|
{"Tools/CollectAddresses/FromSelected", NULL, N_("from Selected _messages..."), NULL, NULL, G_CALLBACK(addr_harvest_msg_cb) },
|
|
|
|
{"Tools/---", NULL, "---", NULL, NULL, NULL },
|
|
|
|
|
|
|
|
{"Tools/FilterFolder", NULL, N_("_Filter all messages in folder"), NULL, NULL, G_CALLBACK(filter_cb) },
|
|
|
|
{"Tools/FilterSelected", NULL, N_("Filter _selected messages"), NULL, NULL, G_CALLBACK(filter_list_cb) },
|
|
|
|
{"Tools/RunProcessing", NULL, N_("Run folder pr_ocessing rules"), NULL, NULL, G_CALLBACK(process_cb) },
|
|
|
|
|
|
|
|
{"Tools/CreateFilterRule", NULL, N_("_Create filter rule") },
|
|
|
|
{"Tools/CreateFilterRule/Automatically",NULL, N_("_Automatically"), NULL, NULL, G_CALLBACK(create_filter_cb) }, /* FILTER_BY_AUTO */
|
|
|
|
{"Tools/CreateFilterRule/ByFrom", NULL, N_("By _From"), NULL, NULL, G_CALLBACK(create_filter_cb) }, /* FILTER_BY_FROM */
|
|
|
|
{"Tools/CreateFilterRule/ByTo", NULL, N_("By _To"), NULL, NULL, G_CALLBACK(create_filter_cb) }, /* FILTER_BY_TO */
|
|
|
|
{"Tools/CreateFilterRule/BySubject", NULL, N_("By _Subject"), NULL, NULL, G_CALLBACK(create_filter_cb) }, /* FILTER_BY_SUBJECT */
|
|
|
|
|
|
|
|
{"Tools/CreateProcessingRule", NULL, N_("Create processing rule") },
|
|
|
|
{"Tools/CreateProcessingRule/Automatically", NULL, N_("_Automatically"), NULL, NULL, G_CALLBACK(create_processing_cb) },
|
|
|
|
{"Tools/CreateProcessingRule/ByFrom", NULL, N_("By _From"), NULL, NULL, G_CALLBACK(create_processing_cb) },
|
|
|
|
{"Tools/CreateProcessingRule/ByTo", NULL, N_("By _To"), NULL, NULL, G_CALLBACK(create_processing_cb) },
|
|
|
|
{"Tools/CreateProcessingRule/BySubject",NULL, N_("By _Subject"), NULL, NULL, G_CALLBACK(create_processing_cb) },
|
|
|
|
/* {"Tools/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
|
|
|
|
{"Tools/ListUrls", NULL, N_("List _URLs..."), "<control><shift>U", NULL, G_CALLBACK(open_urls_cb) },
|
|
|
|
|
|
|
|
/* {"Tools/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"Tools/Actions", NULL, N_("Actio_ns") },
|
|
|
|
{"Tools/Actions/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
/* {"Tools/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
|
|
|
|
{"Tools/CheckNewMessages", NULL, N_("Ch_eck for new messages in all folders"), NULL, NULL, G_CALLBACK(update_folderview_cb) },
|
|
|
|
{"Tools/DeleteDuplicates", NULL, N_("Delete du_plicated messages") },
|
|
|
|
{"Tools/DeleteDuplicates/SelFolder", NULL, N_("In selected folder"), NULL, NULL, G_CALLBACK(delete_duplicated_cb) },
|
|
|
|
{"Tools/DeleteDuplicates/AllFolders", NULL, N_("In all folders"), NULL, NULL, G_CALLBACK(delete_duplicated_all_cb) },
|
|
|
|
/* {"Tools/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
|
|
|
|
{"Tools/Execute", NULL, N_("E_xecute"), "X", NULL, G_CALLBACK(execute_summary_cb) },
|
|
|
|
#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
|
|
|
|
/* {"Tools/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"Tools/SSLCertificates", NULL, N_("SSL cer_tificates"), NULL, NULL, G_CALLBACK(ssl_manager_open_cb) },
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
/* {"Tools/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"Tools/FilteringLog", NULL, N_("Filtering Lo_g"), NULL, NULL, G_CALLBACK(filtering_debug_window_show_cb) },
|
|
|
|
{"Tools/NetworkLog", NULL, N_("Network _Log"), "<shift><control>L", NULL, G_CALLBACK(log_window_show_cb) },
|
|
|
|
|
|
|
|
/* Configuration menu */
|
|
|
|
{"Configuration/ChangeAccount", NULL, N_("C_hange current account") },
|
|
|
|
{"Configuration/ChangeAccount/PlaceHolder", NULL, "Placeholder", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
|
|
|
|
{"Configuration/AccountPrefs", NULL, N_("_Preferences for current account..."), NULL, NULL, G_CALLBACK(prefs_account_open_cb) },
|
|
|
|
{"Configuration/CreateAccount", NULL, N_("Create _new account..."), NULL, NULL, G_CALLBACK(new_account_cb) },
|
|
|
|
{"Configuration/EditAccounts", NULL, N_("_Edit accounts..."), NULL, NULL, G_CALLBACK(account_edit_open) },
|
|
|
|
{"Configuration/---", NULL, "---", NULL, NULL, NULL },
|
|
|
|
|
|
|
|
{"Configuration/Preferences", NULL, N_("P_references..."), NULL, NULL, G_CALLBACK(prefs_open_cb) },
|
|
|
|
{"Configuration/PreProcessing", NULL, N_("Pre-pr_ocessing..."), NULL, NULL, G_CALLBACK(prefs_pre_processing_open_cb) },
|
|
|
|
{"Configuration/PostProcessing", NULL, N_("Post-pro_cessing..."), NULL, NULL, G_CALLBACK(prefs_post_processing_open_cb) },
|
|
|
|
{"Configuration/Filtering", NULL, N_("_Filtering..."), NULL, NULL, G_CALLBACK(prefs_filtering_open_cb) },
|
|
|
|
{"Configuration/Templates", NULL, N_("_Templates..."), NULL, NULL, G_CALLBACK(prefs_template_open_cb) },
|
|
|
|
{"Configuration/Actions", NULL, N_("_Actions..."), NULL, NULL, G_CALLBACK(prefs_actions_open_cb) },
|
|
|
|
{"Configuration/Tags", NULL, N_("Tag_s..."), NULL, NULL, G_CALLBACK(prefs_tags_open_cb) },
|
|
|
|
/*{"Configuration/---", NULL, "---", NULL, NULL, NULL }, */
|
|
|
|
{"Configuration/Plugins", NULL, N_("Plu_gins..."), NULL, NULL, G_CALLBACK(plugins_open_cb) },
|
|
|
|
|
|
|
|
/* Help menu */
|
|
|
|
{"Help/Manual", NULL, N_("_Manual"), NULL, NULL, G_CALLBACK(manual_open_cb) },
|
|
|
|
{"Help/FAQ", NULL, N_("_Online User-contributed FAQ"), NULL, NULL, G_CALLBACK(manual_faq_open_cb) },
|
|
|
|
{"Help/IconLegend", NULL, N_("Icon _Legend"), NULL, NULL, G_CALLBACK(legend_open_cb) },
|
|
|
|
{"Help/---", NULL, "---" },
|
|
|
|
{"Help/About", NULL, N_("_About"), NULL, NULL, G_CALLBACK(about_cb) },
|
|
|
|
};
|
2006-02-02 09:45:41 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static GtkToggleActionEntry mainwin_toggle_entries[] = {
|
|
|
|
{"File/OfflineMode", NULL, N_("Offline _mode"), "<control>W", NULL, G_CALLBACK(toggle_work_offline_cb) }, /*toggle*/
|
|
|
|
{"View/ShowHide/MessageView", NULL, N_("_Message view"), NULL, NULL, G_CALLBACK(toggle_message_cb) }, /* toggle */
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2008-07-29 21:07:54 +02:00
|
|
|
{"View/ShowHide/StatusBar", NULL, N_("Status _bar"), NULL, NULL, G_CALLBACK(toggle_statusbar_cb) }, /* toggle */
|
2007-07-15 11:14:01 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
{"View/ShowHide/ColumnHeaders", NULL, N_("Column headers"), NULL, NULL, G_CALLBACK(toggle_col_headers_cb) }, /* toggle */
|
|
|
|
{"View/ThreadView", NULL, N_("Th_read view"), "<control>T", NULL, G_CALLBACK(thread_cb) }, /* toggle */
|
|
|
|
{"View/HideReadMessages", NULL, N_("_Hide read messages"), NULL, NULL, G_CALLBACK(hide_read_messages) }, /* toggle */
|
|
|
|
{"View/AllHeaders", NULL, N_("Show all _headers"), "<control>H", NULL, G_CALLBACK(show_all_header_cb) }, /* toggle */
|
|
|
|
{"View/Quotes/FoldAll", NULL, N_("_Fold all"), "<control><shift>Q", NULL, G_CALLBACK(hide_quotes_cb) }, /* 1 toggle */
|
|
|
|
{"View/Quotes/Fold2", NULL, N_("Fold from level _2"), NULL, NULL, G_CALLBACK(hide_quotes_cb) }, /* 2 toggle */
|
|
|
|
{"View/Quotes/Fold3", NULL, N_("Fold from level _3"), NULL, NULL, G_CALLBACK(hide_quotes_cb) }, /* 3 toggle */
|
|
|
|
};
|
|
|
|
|
|
|
|
static GtkRadioActionEntry mainwin_showhide_radio_entries[] = { /* toggle_toolbar_cb */
|
|
|
|
{"View/ShowHide/Toolbar/TextBelowIcon", NULL, N_("Text _below icons"), NULL, NULL, TOOLBAR_BOTH }, /* radio TOOLBAR_BOTH */
|
|
|
|
{"View/ShowHide/Toolbar/TextBesideIcon",NULL, N_("Text be_side icons"), NULL, NULL, TOOLBAR_BOTH_HORIZ }, /* radio TOOLBAR_BOTH_HORIZ */
|
|
|
|
{"View/ShowHide/Toolbar/IconOnly", NULL, N_("_Icons only"), NULL, NULL, TOOLBAR_ICON }, /* radio TOOLBAR_ICON */
|
|
|
|
{"View/ShowHide/Toolbar/TextOnly", NULL, N_("_Text only"), NULL, NULL, TOOLBAR_TEXT }, /* radio TOOLBAR_TEXT */
|
|
|
|
#ifndef GENERIC_UMPC
|
|
|
|
{"View/ShowHide/Toolbar/Hide", NULL, N_("_Hide"), NULL, NULL, TOOLBAR_NONE }, /* radio TOOLBAR_NONE */
|
2002-11-25 16:21:47 +01:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static GtkRadioActionEntry mainwin_layout_radio_entries[] = { /* set_layout_cb */
|
|
|
|
{"View/Layout/Standard", NULL, N_("_Standard"), NULL, NULL, NORMAL_LAYOUT }, /* radio NORMAL_LAYOUT */
|
|
|
|
{"View/Layout/ThreeColumns", NULL, N_("_Three columns"), NULL, NULL, VERTICAL_LAYOUT }, /* radio VERTICAL_LAYOUT */
|
|
|
|
{"View/Layout/WideMessage", NULL, N_("_Wide message"), NULL, NULL, WIDE_LAYOUT }, /* radio WIDE_LAYOUT */
|
|
|
|
{"View/Layout/WideMessageList", NULL, N_("W_ide message list"), NULL, NULL, WIDE_MSGLIST_LAYOUT }, /* radio WIDE_MSGLIST_LAYOUT */
|
|
|
|
{"View/Layout/SmallScreen", NULL, N_("S_mall screen"), NULL, NULL, SMALL_LAYOUT }, /* radio SMALL_LAYOUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
static GtkRadioActionEntry mainwin_sort_radio_entries[] = { /* sort_summary_cb */
|
|
|
|
{"View/Sort/Number", NULL, N_("by _Number"), NULL, NULL, SORT_BY_NUMBER }, /* radio SORT_BY_NUMBER */
|
|
|
|
{"View/Sort/Size", NULL, N_("by S_ize"), NULL, NULL, SORT_BY_SIZE }, /* radio SORT_BY_SIZE */
|
|
|
|
{"View/Sort/Date", NULL, N_("by _Date"), NULL, NULL, SORT_BY_DATE }, /* radio SORT_BY_DATE */
|
|
|
|
{"View/Sort/ThreadDate", NULL, N_("by Thread date"), NULL, NULL, SORT_BY_THREAD_DATE }, /* radio SORT_BY_THREAD_DATE */
|
|
|
|
{"View/Sort/From", NULL, N_("by _From"), NULL, NULL, SORT_BY_FROM }, /* radio SORT_BY_FROM */
|
|
|
|
{"View/Sort/To", NULL, N_("by _To"), NULL, NULL, SORT_BY_TO }, /* radio SORT_BY_TO */
|
|
|
|
{"View/Sort/Subject", NULL, N_("by S_ubject"), NULL, NULL, SORT_BY_SUBJECT }, /* radio SORT_BY_SUBJECT */
|
|
|
|
{"View/Sort/Color", NULL, N_("by _Color label"), NULL, NULL, SORT_BY_LABEL }, /* radio SORT_BY_LABEL */
|
|
|
|
{"View/Sort/Tag", NULL, N_("by Tag"), NULL, NULL, SORT_BY_TAGS }, /* radio SORT_BY_TAGS */
|
|
|
|
{"View/Sort/Mark", NULL, N_("by _Mark"), NULL, NULL, SORT_BY_MARK }, /* radio SORT_BY_MARK */
|
|
|
|
{"View/Sort/Status", NULL, N_("by _Status"), NULL, NULL, SORT_BY_STATUS }, /* radio SORT_BY_STATUS */
|
|
|
|
{"View/Sort/Attachment", NULL, N_("by A_ttachment"), NULL, NULL, SORT_BY_MIME }, /* radio SORT_BY_MIME */
|
|
|
|
{"View/Sort/Score", NULL, N_("by Score"), NULL, NULL, SORT_BY_SCORE }, /* radio SORT_BY_SCORE */
|
|
|
|
{"View/Sort/Locked", NULL, N_("by Locked"), NULL, NULL, SORT_BY_LOCKED }, /* radio SORT_BY_LOCKED */
|
|
|
|
{"View/Sort/DontSort", NULL, N_("D_on't sort"), NULL, NULL, SORT_BY_NONE }, /* radio SORT_BY_NONE */
|
|
|
|
};
|
|
|
|
|
|
|
|
static GtkRadioActionEntry mainwin_sorttype_radio_entries[] = { /* sort_summary_type_cb */
|
|
|
|
{"View/Sort/Ascending", NULL, N_("Ascending"), NULL, NULL, SORT_ASCENDING }, /* radio SORT_ASCENDING */
|
|
|
|
{"View/Sort/Descending", NULL, N_("Descending"), NULL, NULL, SORT_DESCENDING }, /* radio SORT_DESCENDING */
|
|
|
|
};
|
|
|
|
|
|
|
|
static GtkRadioActionEntry mainwin_radio_enc_entries[] =
|
|
|
|
{
|
|
|
|
ENC_ACTION(CS_AUTO, C_AUTO, "_Automatic"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION(CS_US_ASCII, C_US_ASCII, "7bit ASCII (US-ASC_II)"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION(CS_UTF_8, C_UTF_8, "Unicode (_UTF-8)"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Western/"CS_ISO_8859_1, C_ISO_8859_1, "ISO-8859-_1"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Western/"CS_ISO_8859_15, C_ISO_8859_15, "ISO-8859-15"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Western/"CS_WINDOWS_1252, C_WINDOWS_1252, "Windows-1252"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION(CS_ISO_8859_2, C_ISO_8859_2, "Central European (ISO-8859-_2)"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Baltic/"CS_ISO_8859_13, C_ISO_8859_13, "ISO-8859-13"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Baltic/"CS_ISO_8859_4, C_ISO_8859_14, "ISO-8859-_4"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION(CS_ISO_8859_7, C_ISO_8859_7, "Greek (ISO-8859-_7)"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Hebrew/"CS_ISO_8859_8, C_ISO_8859_8, "ISO-8859-_8"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Hebrew/"CS_WINDOWS_1255, C_WINDOWS_1255, "Windows-1255"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Arabic/"CS_ISO_8859_6, C_ISO_8859_6, "ISO-8859-_6"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Arabic/"CS_WINDOWS_1256, C_WINDOWS_1256, "Windows-1256"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION(CS_ISO_8859_9, C_ISO_8859_9, "Turkish (ISO-8859-_9)"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Cyrillic/"CS_ISO_8859_5, C_ISO_8859_5, "ISO-8859-_5"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Cyrillic/"CS_KOI8_R, C_KOI8_R, "KOI8-_R"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Cyrillic/"CS_KOI8_U, C_KOI8_U, "KOI8-_U"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Cyrillic/"CS_WINDOWS_1251, C_WINDOWS_1251, "Windows-1251"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Japanese/"CS_ISO_2022_JP, C_ISO_2022_JP, "ISO-2022-_JP"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Japanese/"CS_ISO_2022_JP_2, C_ISO_2022_JP_2, "ISO-2022-JP-_2"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Japanese/"CS_EUC_JP, C_EUC_JP, "_EUC-JP"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Japanese/"CS_SHIFT_JIS, C_SHIFT_JIS, "_Shift-JIS"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Chinese/"CS_GB2312, C_GB2312, "_GB2312"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Chinese/"CS_GBK, C_GBK, "GB_K"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Chinese/"CS_BIG5, C_BIG5, "_Big5-JP"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Chinese/"CS_EUC_TW, C_EUC_TW, "EUC-_TW"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Korean/"CS_EUC_KR, C_EUC_KR, "_EUC-KR"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Korean/"CS_ISO_2022_KR, C_ISO_2022_KR, "_ISO-2022-KR"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Thai/"CS_TIS_620, C_TIS_620, "_TIS-620-KR"), /* RADIO set_charset_cb */
|
|
|
|
ENC_ACTION("Thai/"CS_WINDOWS_874, C_WINDOWS_874, "_Windows-874"), /* RADIO set_charset_cb */
|
|
|
|
};
|
|
|
|
|
|
|
|
static GtkRadioActionEntry mainwin_radio_dec_entries[] =
|
|
|
|
{
|
|
|
|
DEC_ACTION("AutoDetect", 0, "_Auto detect"), /* set_decode_cb */
|
|
|
|
/* --- */
|
|
|
|
DEC_ACTION("8bit", ENC_8BIT, "_8bit"),
|
|
|
|
DEC_ACTION("QP", ENC_QUOTED_PRINTABLE, "_Quoted printable"),
|
|
|
|
DEC_ACTION("B64", ENC_BASE64, "_Base64"),
|
|
|
|
DEC_ACTION("Uuencode", ENC_X_UUENCODE, "_Uuencode"),
|
2001-04-19 14:21:46 +02:00
|
|
|
};
|
2001-12-07 20:53:31 +01:00
|
|
|
|
2005-09-08 20:28:36 +02:00
|
|
|
static gboolean offline_ask_sync = TRUE;
|
2006-04-09 17:33:19 +02:00
|
|
|
static guint lastkey;
|
2007-01-28 13:05:08 +01:00
|
|
|
static gboolean is_obscured = FALSE;
|
2005-09-08 20:28:36 +02:00
|
|
|
|
2004-07-17 23:15:07 +02:00
|
|
|
static gboolean main_window_accel_activate (GtkAccelGroup *accelgroup,
|
|
|
|
GObject *arg1,
|
|
|
|
guint value,
|
|
|
|
GdkModifierType mod,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)user_data;
|
|
|
|
|
|
|
|
if (mainwin->summaryview &&
|
|
|
|
mainwin->summaryview->quicksearch &&
|
|
|
|
quicksearch_has_focus(mainwin->summaryview->quicksearch) &&
|
|
|
|
(mod == 0 || mod == GDK_SHIFT_MASK)) {
|
2006-04-09 17:33:19 +02:00
|
|
|
quicksearch_pass_key(mainwin->summaryview->quicksearch, lastkey, mod);
|
2004-07-17 23:15:07 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2006-03-17 19:10:51 +01:00
|
|
|
#define N_COLOR_LABELS colorlabel_get_color_count()
|
|
|
|
|
|
|
|
static void mainwindow_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin;
|
|
|
|
GtkMenuShell *menu;
|
|
|
|
GtkCheckMenuItem **items;
|
|
|
|
gint n;
|
2006-09-28 21:10:14 +02:00
|
|
|
GList *cur;
|
|
|
|
GSList *sel;
|
2006-03-17 19:10:51 +01:00
|
|
|
|
|
|
|
mainwin = (MainWindow *)data;
|
|
|
|
g_return_if_fail(mainwin != NULL);
|
|
|
|
|
2006-09-28 21:10:14 +02:00
|
|
|
sel = summary_get_selection(mainwin->summaryview);
|
2006-03-17 19:10:51 +01:00
|
|
|
if (!sel) return;
|
|
|
|
|
|
|
|
menu = GTK_MENU_SHELL(mainwin->colorlabel_menu);
|
|
|
|
g_return_if_fail(menu != NULL);
|
|
|
|
|
|
|
|
Xalloca(items, (N_COLOR_LABELS + 1) * sizeof(GtkWidget *), return);
|
|
|
|
|
|
|
|
/* NOTE: don't return prematurely because we set the "dont_toggle"
|
|
|
|
* state for check menu items */
|
|
|
|
g_object_set_data(G_OBJECT(menu), "dont_toggle",
|
|
|
|
GINT_TO_POINTER(1));
|
|
|
|
|
|
|
|
/* clear items. get item pointers. */
|
|
|
|
for (n = 0, cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
|
|
|
|
if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
|
|
|
|
gtk_check_menu_item_set_active
|
|
|
|
(GTK_CHECK_MENU_ITEM(cur->data), FALSE);
|
|
|
|
items[n] = GTK_CHECK_MENU_ITEM(cur->data);
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (n == (N_COLOR_LABELS + 1)) {
|
|
|
|
/* iterate all messages and set the state of the appropriate
|
|
|
|
* items */
|
|
|
|
for (; sel != NULL; sel = sel->next) {
|
|
|
|
MsgInfo *msginfo;
|
|
|
|
gint clabel;
|
|
|
|
|
2006-09-28 21:10:14 +02:00
|
|
|
msginfo = (MsgInfo *)sel->data;
|
2006-03-17 19:10:51 +01:00
|
|
|
if (msginfo) {
|
|
|
|
clabel = MSG_GET_COLORLABEL_VALUE(msginfo->flags);
|
|
|
|
if (!items[clabel]->active)
|
|
|
|
gtk_check_menu_item_set_active
|
|
|
|
(items[clabel], TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
g_warning("invalid number of color elements (%d)\n", n);
|
|
|
|
|
2007-07-02 18:35:40 +02:00
|
|
|
g_slist_free(sel);
|
2006-03-17 19:10:51 +01:00
|
|
|
/* reset "dont_toggle" state */
|
|
|
|
g_object_set_data(G_OBJECT(menu), "dont_toggle",
|
|
|
|
GINT_TO_POINTER(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mainwindow_colorlabel_menu_item_activate_cb(GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
guint color = GPOINTER_TO_UINT(data);
|
|
|
|
MainWindow *mainwin;
|
|
|
|
|
|
|
|
mainwin = g_object_get_data(G_OBJECT(widget), "mainwin");
|
|
|
|
g_return_if_fail(mainwin != NULL);
|
|
|
|
|
|
|
|
/* "dont_toggle" state set? */
|
|
|
|
if (g_object_get_data(G_OBJECT(mainwin->colorlabel_menu),
|
|
|
|
"dont_toggle"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
summary_set_colorlabel(mainwin->summaryview, color, NULL);
|
|
|
|
}
|
|
|
|
|
2007-07-02 18:35:40 +02:00
|
|
|
static void mainwindow_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin;
|
|
|
|
GtkMenuShell *menu;
|
|
|
|
GList *cur;
|
|
|
|
GSList *sel;
|
|
|
|
GHashTable *menu_table = g_hash_table_new_full(
|
|
|
|
g_direct_hash,
|
|
|
|
g_direct_equal,
|
|
|
|
NULL, NULL);
|
2007-07-16 19:13:43 +02:00
|
|
|
GHashTable *menu_allsel_table = g_hash_table_new_full(
|
|
|
|
g_direct_hash,
|
|
|
|
g_direct_equal,
|
|
|
|
NULL, NULL);
|
|
|
|
gint sel_len;
|
2007-07-02 18:35:40 +02:00
|
|
|
mainwin = (MainWindow *)data;
|
|
|
|
g_return_if_fail(mainwin != NULL);
|
|
|
|
|
|
|
|
sel = summary_get_selection(mainwin->summaryview);
|
|
|
|
if (!sel) return;
|
|
|
|
|
|
|
|
menu = GTK_MENU_SHELL(mainwin->tags_menu);
|
|
|
|
g_return_if_fail(menu != NULL);
|
|
|
|
|
|
|
|
/* NOTE: don't return prematurely because we set the "dont_toggle"
|
|
|
|
* state for check menu items */
|
|
|
|
g_object_set_data(G_OBJECT(menu), "dont_toggle",
|
|
|
|
GINT_TO_POINTER(1));
|
|
|
|
|
|
|
|
/* clear items. get item pointers. */
|
|
|
|
for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
|
|
|
|
if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
|
|
|
|
gint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cur->data),
|
|
|
|
"tag_id"));
|
|
|
|
gtk_check_menu_item_set_active
|
|
|
|
(GTK_CHECK_MENU_ITEM(cur->data), FALSE);
|
|
|
|
|
|
|
|
g_hash_table_insert(menu_table, GINT_TO_POINTER(id), GTK_CHECK_MENU_ITEM(cur->data));
|
2007-07-16 19:13:43 +02:00
|
|
|
g_hash_table_insert(menu_allsel_table, GINT_TO_POINTER(id), GINT_TO_POINTER(0));
|
2007-07-02 18:35:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* iterate all messages and set the state of the appropriate
|
|
|
|
* items */
|
2007-07-16 19:13:43 +02:00
|
|
|
sel_len = 0;
|
2007-07-02 18:35:40 +02:00
|
|
|
for (; sel != NULL; sel = sel->next) {
|
|
|
|
MsgInfo *msginfo;
|
|
|
|
GSList *tags = NULL;
|
|
|
|
gint id;
|
|
|
|
GtkCheckMenuItem *item;
|
|
|
|
msginfo = (MsgInfo *)sel->data;
|
2007-07-16 19:13:43 +02:00
|
|
|
sel_len++;
|
2007-07-02 18:35:40 +02:00
|
|
|
if (msginfo) {
|
|
|
|
tags = msginfo->tags;
|
|
|
|
if (!tags)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
for (; tags; tags = tags->next) {
|
2007-07-16 19:13:43 +02:00
|
|
|
gint num_checked = GPOINTER_TO_INT(g_hash_table_lookup(menu_allsel_table, tags->data));
|
2007-07-02 18:35:40 +02:00
|
|
|
id = GPOINTER_TO_INT(tags->data);
|
|
|
|
item = g_hash_table_lookup(menu_table, GINT_TO_POINTER(tags->data));
|
2007-07-16 19:13:43 +02:00
|
|
|
if (item && !item->active) {
|
2007-07-02 18:35:40 +02:00
|
|
|
gtk_check_menu_item_set_active
|
|
|
|
(item, TRUE);
|
2007-07-16 19:13:43 +02:00
|
|
|
}
|
|
|
|
num_checked++;
|
|
|
|
g_hash_table_replace(menu_allsel_table, tags->data, GINT_TO_POINTER(num_checked));
|
2007-07-02 18:35:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-16 19:13:43 +02:00
|
|
|
for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
|
|
|
|
if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
|
|
|
|
gint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cur->data),
|
|
|
|
"tag_id"));
|
|
|
|
gint num_checked = GPOINTER_TO_INT(g_hash_table_lookup(menu_allsel_table, GINT_TO_POINTER(id)));
|
|
|
|
if (num_checked < sel_len && num_checked > 0)
|
|
|
|
gtk_check_menu_item_set_inconsistent(GTK_CHECK_MENU_ITEM(cur->data), TRUE);
|
|
|
|
else
|
|
|
|
gtk_check_menu_item_set_inconsistent(GTK_CHECK_MENU_ITEM(cur->data), FALSE);
|
|
|
|
}
|
|
|
|
}
|
2007-07-02 18:35:40 +02:00
|
|
|
g_slist_free(sel);
|
|
|
|
g_hash_table_destroy(menu_table);
|
2007-07-16 19:13:43 +02:00
|
|
|
g_hash_table_destroy(menu_allsel_table);
|
2007-07-02 18:35:40 +02:00
|
|
|
/* reset "dont_toggle" state */
|
|
|
|
g_object_set_data(G_OBJECT(menu), "dont_toggle",
|
|
|
|
GINT_TO_POINTER(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mainwindow_tags_menu_item_activate_cb(GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gint id = GPOINTER_TO_INT(data);
|
|
|
|
gboolean set = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
|
|
|
|
MainWindow *mainwin;
|
|
|
|
|
|
|
|
mainwin = g_object_get_data(G_OBJECT(widget), "mainwin");
|
|
|
|
g_return_if_fail(mainwin != NULL);
|
|
|
|
|
|
|
|
/* "dont_toggle" state set? */
|
|
|
|
if (g_object_get_data(G_OBJECT(mainwin->tags_menu),
|
|
|
|
"dont_toggle"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!set)
|
|
|
|
id = -id;
|
|
|
|
summary_set_tag(mainwin->summaryview, id, NULL);
|
|
|
|
}
|
|
|
|
|
2006-03-17 19:10:51 +01:00
|
|
|
static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refresh)
|
|
|
|
{
|
|
|
|
GtkWidget *label_menuitem;
|
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *item;
|
|
|
|
gint i;
|
2008-07-29 21:07:54 +02:00
|
|
|
gchar *accel_path = NULL;
|
2006-03-17 19:10:51 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
label_menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/ColorLabel");
|
2006-03-17 19:10:51 +01:00
|
|
|
g_signal_connect(G_OBJECT(label_menuitem), "activate",
|
|
|
|
G_CALLBACK(mainwindow_colorlabel_menu_item_activate_item_cb),
|
|
|
|
mainwin);
|
|
|
|
gtk_widget_show(label_menuitem);
|
|
|
|
|
|
|
|
menu = gtk_menu_new();
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_menu_set_accel_group (GTK_MENU (menu),
|
|
|
|
gtk_ui_manager_get_accel_group(mainwin->ui_manager));
|
2006-03-17 19:10:51 +01:00
|
|
|
|
|
|
|
/* create sub items. for the menu item activation callback we pass the
|
|
|
|
* index of label_colors[] as data parameter. for the None color we
|
|
|
|
* pass an invalid (high) value. also we attach a data pointer so we
|
|
|
|
* can always get back the Mainwindow pointer. */
|
|
|
|
|
|
|
|
item = gtk_check_menu_item_new_with_label(_("None"));
|
|
|
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
|
|
|
g_signal_connect(G_OBJECT(item), "activate",
|
|
|
|
G_CALLBACK(mainwindow_colorlabel_menu_item_activate_cb),
|
|
|
|
GUINT_TO_POINTER(0));
|
|
|
|
g_object_set_data(G_OBJECT(item), "mainwin", mainwin);
|
|
|
|
gtk_widget_show(item);
|
|
|
|
|
|
|
|
gtk_widget_add_accelerator(item, "activate",
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_ui_manager_get_accel_group(mainwin->ui_manager),
|
2006-03-17 19:10:51 +01:00
|
|
|
GDK_0, GDK_CONTROL_MASK,
|
|
|
|
GTK_ACCEL_LOCKED | GTK_ACCEL_VISIBLE);
|
|
|
|
|
|
|
|
item = gtk_menu_item_new();
|
|
|
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
|
|
|
gtk_widget_show(item);
|
|
|
|
|
|
|
|
/* create pixmap/label menu items */
|
|
|
|
for (i = 0; i < N_COLOR_LABELS; i++) {
|
|
|
|
item = colorlabel_create_check_color_menu_item(
|
|
|
|
i, refresh, MAINWIN_COLORMENU);
|
|
|
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
|
|
|
g_signal_connect(G_OBJECT(item), "activate",
|
|
|
|
G_CALLBACK(mainwindow_colorlabel_menu_item_activate_cb),
|
|
|
|
GUINT_TO_POINTER(i + 1));
|
|
|
|
g_object_set_data(G_OBJECT(item), "mainwin",
|
|
|
|
mainwin);
|
|
|
|
gtk_widget_show(item);
|
2008-07-29 21:07:54 +02:00
|
|
|
accel_path = g_strdup_printf("<ClawsColorLabels>/%d", i);
|
|
|
|
gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
|
|
|
|
g_free(accel_path);
|
2007-02-28 19:24:49 +01:00
|
|
|
if (i < 9)
|
|
|
|
gtk_widget_add_accelerator(item, "activate",
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_ui_manager_get_accel_group(mainwin->ui_manager),
|
2006-03-17 19:10:51 +01:00
|
|
|
GDK_1+i, GDK_CONTROL_MASK,
|
|
|
|
GTK_ACCEL_LOCKED | GTK_ACCEL_VISIBLE);
|
|
|
|
}
|
|
|
|
gtk_widget_show(menu);
|
|
|
|
gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menuitem), menu);
|
|
|
|
mainwin->colorlabel_menu = menu;
|
|
|
|
}
|
|
|
|
|
2007-07-16 19:13:43 +02:00
|
|
|
static void mainwindow_tags_menu_item_apply_tags_activate_cb(GtkWidget *widget,
|
2007-07-02 18:35:40 +02:00
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin;
|
2007-07-16 19:13:43 +02:00
|
|
|
|
2007-07-02 18:35:40 +02:00
|
|
|
mainwin = g_object_get_data(G_OBJECT(widget), "mainwin");
|
|
|
|
g_return_if_fail(mainwin != NULL);
|
|
|
|
|
|
|
|
/* "dont_toggle" state set? */
|
|
|
|
if (g_object_get_data(G_OBJECT(mainwin->tags_menu),
|
|
|
|
"dont_toggle"))
|
|
|
|
return;
|
|
|
|
|
2007-07-16 19:13:43 +02:00
|
|
|
tag_apply_open(summary_get_selection(mainwin->summaryview));
|
2007-07-02 18:35:40 +02:00
|
|
|
}
|
|
|
|
|
2007-10-25 18:56:50 +02:00
|
|
|
static gint mainwin_tag_cmp_list(gconstpointer a, gconstpointer b)
|
2007-10-24 22:45:39 +02:00
|
|
|
{
|
|
|
|
gint id_a = GPOINTER_TO_INT(a);
|
|
|
|
gint id_b = GPOINTER_TO_INT(b);
|
|
|
|
const gchar *tag_a = tags_get_tag(id_a);
|
|
|
|
const gchar *tag_b = tags_get_tag(id_b);
|
|
|
|
|
2007-10-25 18:56:50 +02:00
|
|
|
|
|
|
|
if (tag_a == NULL)
|
|
|
|
return tag_b == NULL ? 0:1;
|
|
|
|
|
|
|
|
if (tag_b == NULL)
|
|
|
|
return tag_a == NULL ? 0:1;
|
|
|
|
|
|
|
|
return g_utf8_collate(tag_a, tag_b);
|
2007-10-24 22:45:39 +02:00
|
|
|
}
|
2007-10-25 18:56:50 +02:00
|
|
|
|
2007-07-02 18:35:40 +02:00
|
|
|
static void mainwindow_tags_menu_create(MainWindow *mainwin, gboolean refresh)
|
|
|
|
{
|
|
|
|
GtkWidget *label_menuitem;
|
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *item;
|
|
|
|
GSList *cur = tags_get_list();
|
2007-10-24 22:45:39 +02:00
|
|
|
GSList *orig = NULL;
|
2007-07-02 18:35:40 +02:00
|
|
|
gboolean existing_tags = FALSE;
|
2008-07-29 21:07:54 +02:00
|
|
|
gchar *accel_path;
|
2007-10-25 18:56:50 +02:00
|
|
|
cur = orig = g_slist_sort(cur, mainwin_tag_cmp_list);
|
2007-10-24 22:45:39 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
label_menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Tags");
|
2007-07-02 18:35:40 +02:00
|
|
|
g_signal_connect(G_OBJECT(label_menuitem), "activate",
|
|
|
|
G_CALLBACK(mainwindow_tags_menu_item_activate_item_cb),
|
|
|
|
mainwin);
|
|
|
|
|
|
|
|
gtk_widget_show(label_menuitem);
|
|
|
|
|
|
|
|
menu = gtk_menu_new();
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_menu_set_accel_group (GTK_MENU (menu),
|
|
|
|
gtk_ui_manager_get_accel_group(mainwin->ui_manager));
|
2007-07-02 18:35:40 +02:00
|
|
|
|
|
|
|
/* create tags menu items */
|
|
|
|
for (; cur; cur = cur->next) {
|
|
|
|
gint id = GPOINTER_TO_INT(cur->data);
|
|
|
|
const gchar *tag = tags_get_tag(id);
|
|
|
|
|
|
|
|
item = gtk_check_menu_item_new_with_label(tag);
|
|
|
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
|
|
|
g_signal_connect(G_OBJECT(item), "activate",
|
|
|
|
G_CALLBACK(mainwindow_tags_menu_item_activate_cb),
|
|
|
|
GINT_TO_POINTER(id));
|
|
|
|
g_object_set_data(G_OBJECT(item), "mainwin",
|
|
|
|
mainwin);
|
|
|
|
g_object_set_data(G_OBJECT(item), "tag_id",
|
|
|
|
GINT_TO_POINTER(id));
|
|
|
|
gtk_widget_show(item);
|
2008-07-29 21:07:54 +02:00
|
|
|
accel_path = g_strconcat("<ClawsTags>/",tag, NULL);
|
|
|
|
gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
|
|
|
|
g_free(accel_path);
|
2007-07-02 18:35:40 +02:00
|
|
|
existing_tags = TRUE;
|
|
|
|
}
|
|
|
|
if (existing_tags) {
|
|
|
|
/* separator */
|
|
|
|
item = gtk_menu_item_new();
|
|
|
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
|
|
|
gtk_widget_show(item);
|
|
|
|
}
|
2007-07-16 19:13:43 +02:00
|
|
|
|
|
|
|
item = gtk_menu_item_new_with_label(_("Apply tags..."));
|
|
|
|
gtk_widget_add_accelerator(item, "activate",
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_ui_manager_get_accel_group(mainwin->ui_manager),
|
2007-07-16 19:13:43 +02:00
|
|
|
GDK_T, GDK_CONTROL_MASK|GDK_SHIFT_MASK,
|
|
|
|
GTK_ACCEL_LOCKED | GTK_ACCEL_VISIBLE);
|
2007-07-02 18:35:40 +02:00
|
|
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
|
|
|
g_signal_connect(G_OBJECT(item), "activate",
|
2007-07-16 19:13:43 +02:00
|
|
|
G_CALLBACK(mainwindow_tags_menu_item_apply_tags_activate_cb),
|
2007-07-02 18:35:40 +02:00
|
|
|
NULL);
|
|
|
|
g_object_set_data(G_OBJECT(item), "mainwin",
|
|
|
|
mainwin);
|
|
|
|
gtk_widget_show(item);
|
2007-07-16 19:13:43 +02:00
|
|
|
|
2007-07-02 18:35:40 +02:00
|
|
|
g_slist_free(orig);
|
|
|
|
gtk_widget_show(menu);
|
|
|
|
gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menuitem), menu);
|
|
|
|
mainwin->tags_menu = menu;
|
|
|
|
}
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2006-08-31 19:27:03 +02:00
|
|
|
static gboolean warning_icon_pressed(GtkWidget *widget, GdkEventButton *evt,
|
|
|
|
MainWindow *mainwindow)
|
|
|
|
{
|
|
|
|
if (evt && evt->button == 1) {
|
2006-09-02 15:44:12 +02:00
|
|
|
log_window_show_error(mainwindow->logwin);
|
2006-08-31 19:27:03 +02:00
|
|
|
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;
|
|
|
|
}
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2006-09-02 15:13:03 +02:00
|
|
|
void mainwindow_show_error(void)
|
2006-08-31 19:27:03 +02:00
|
|
|
{
|
2006-09-02 15:13:03 +02:00
|
|
|
MainWindow *mainwin = mainwindow_get_mainwindow();
|
2006-08-31 19:27:03 +02:00
|
|
|
gtk_widget_show(mainwin->warning_btn);
|
|
|
|
}
|
2006-03-17 19:10:51 +01:00
|
|
|
|
2006-09-01 19:13:59 +02:00
|
|
|
void mainwindow_clear_error(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
gtk_widget_hide(mainwin->warning_btn);
|
|
|
|
}
|
|
|
|
|
2007-10-13 10:57:29 +02:00
|
|
|
#define BREAK_ON_MODIFIER_KEY() \
|
|
|
|
if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
|
|
|
|
|
|
|
|
static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow*) data;
|
|
|
|
|
|
|
|
if (!mainwin || !event)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (quicksearch_has_focus(mainwin->summaryview->quicksearch))
|
|
|
|
{
|
|
|
|
lastkey = event->keyval;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (event->keyval) {
|
|
|
|
case GDK_Q: /* Quit */
|
|
|
|
BREAK_ON_MODIFIER_KEY();
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
app_exit_cb(NULL, mainwin);
|
2007-10-13 10:57:29 +02:00
|
|
|
return FALSE;
|
|
|
|
case GDK_space:
|
2008-01-08 20:08:12 +01:00
|
|
|
if (gtk_window_is_active(GTK_WINDOW(mainwin->window))) {
|
|
|
|
if (mainwin->folderview && mainwin->summaryview
|
|
|
|
&& ((!mainwin->summaryview->displayed
|
|
|
|
&& !mainwin->summaryview->selected)
|
|
|
|
|| (mainwin->summaryview->folder_item
|
|
|
|
&& 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, TRUE);
|
|
|
|
}
|
2007-10-13 10:57:29 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
#ifdef MAEMO
|
|
|
|
case GDK_F6:
|
|
|
|
if (maemo_mainwindow_is_fullscreen(widget)) {
|
|
|
|
gtk_window_unfullscreen(GTK_WINDOW(widget));
|
|
|
|
} else {
|
|
|
|
gtk_window_fullscreen(GTK_WINDOW(widget));
|
|
|
|
}
|
|
|
|
break;
|
2008-07-05 17:38:37 +02:00
|
|
|
case GDK_F7:
|
|
|
|
{
|
|
|
|
PangoFontDescription *font_desc;
|
|
|
|
int size;
|
|
|
|
font_desc = pango_font_description_from_string(prefs_common.normalfont);
|
|
|
|
size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
|
|
|
|
if (size < 30) {
|
|
|
|
size++; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
|
|
|
|
g_free(prefs_common.normalfont);
|
|
|
|
prefs_common.normalfont = pango_font_description_to_string(font_desc);
|
|
|
|
main_window_reflect_prefs_all();
|
|
|
|
}
|
|
|
|
pango_font_description_free(font_desc);
|
|
|
|
font_desc = pango_font_description_from_string(prefs_common.textfont);
|
|
|
|
size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
|
|
|
|
if (size < 30) {
|
|
|
|
size++; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
|
|
|
|
g_free(prefs_common.textfont);
|
|
|
|
prefs_common.textfont = pango_font_description_to_string(font_desc);
|
|
|
|
main_window_reflect_prefs_all();
|
|
|
|
}
|
|
|
|
pango_font_description_free(font_desc);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_F8:
|
|
|
|
{
|
|
|
|
PangoFontDescription *font_desc;
|
|
|
|
int size;
|
|
|
|
font_desc = pango_font_description_from_string(prefs_common.normalfont);
|
|
|
|
size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
|
|
|
|
if (size > 5) {
|
|
|
|
size--; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
|
|
|
|
g_free(prefs_common.normalfont);
|
|
|
|
prefs_common.normalfont = pango_font_description_to_string(font_desc);
|
|
|
|
main_window_reflect_prefs_all();
|
|
|
|
}
|
|
|
|
pango_font_description_free(font_desc);
|
|
|
|
font_desc = pango_font_description_from_string(prefs_common.textfont);
|
|
|
|
size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
|
|
|
|
if (size > 5) {
|
|
|
|
size--; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
|
|
|
|
g_free(prefs_common.textfont);
|
|
|
|
prefs_common.textfont = pango_font_description_to_string(font_desc);
|
|
|
|
main_window_reflect_prefs_all();
|
|
|
|
}
|
|
|
|
pango_font_description_free(font_desc);
|
|
|
|
}
|
|
|
|
break;
|
2007-10-13 10:57:29 +02:00
|
|
|
case GDK_Escape:
|
|
|
|
if (mainwin->summaryview &&
|
|
|
|
mainwin->summaryview->ext_messageview &&
|
|
|
|
mainwin->summaryview->ext_messageview->window &&
|
|
|
|
widget == mainwin->summaryview->ext_messageview->window) {
|
|
|
|
messageview_destroy(mainwin->summaryview->ext_messageview);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef BREAK_ON_MODIFIER_KEY
|
|
|
|
|
2007-12-04 22:49:04 +01:00
|
|
|
#ifdef MAEMO
|
|
|
|
void mainwindow_maemo_led_set(gboolean state) {
|
|
|
|
static gint last_state = -1;
|
|
|
|
if (last_state == state)
|
|
|
|
return;
|
|
|
|
last_state = (gint)state;
|
|
|
|
if (prefs_common.maemo_show_led) {
|
|
|
|
if(state) {
|
|
|
|
execute_command_line("/usr/bin/dbus-send --system --type=method_call "
|
|
|
|
"--dest=com.nokia.mce "
|
|
|
|
"/com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate "
|
|
|
|
"string:PatternCommunicationEvent", TRUE);
|
2008-02-04 18:18:09 +01:00
|
|
|
execute_command_line("/usr/bin/dbus-send --system --type=method_call "
|
|
|
|
"--dest=com.nokia.mce "
|
|
|
|
"/com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate "
|
|
|
|
"string:PatternCommunicationEmail", TRUE);
|
2007-12-04 22:49:04 +01:00
|
|
|
} else {
|
|
|
|
execute_command_line("/usr/bin/dbus-send --system --type=method_call "
|
|
|
|
"--dest=com.nokia.mce "
|
|
|
|
"/com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate "
|
|
|
|
"string:PatternCommunicationEvent", TRUE);
|
2008-02-04 18:18:09 +01:00
|
|
|
execute_command_line("/usr/bin/dbus-send --system --type=method_call "
|
|
|
|
"--dest=com.nokia.mce "
|
|
|
|
"/com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate "
|
|
|
|
"string:PatternCommunicationEmail", TRUE);
|
2007-12-04 22:49:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void led_update(FolderItem *removed_item)
|
|
|
|
{
|
2008-03-12 07:22:29 +01:00
|
|
|
guint new, unread, unreadmarked, marked, total, replied;
|
|
|
|
guint forwarded, locked, ignored, watched;
|
2007-12-04 22:49:04 +01:00
|
|
|
|
2008-03-12 07:22:29 +01:00
|
|
|
folder_count_total_msgs(&new, &unread, &unreadmarked, &marked, &total,
|
|
|
|
&replied, &forwarded, &locked, &ignored,
|
|
|
|
&watched);
|
2007-12-04 22:49:04 +01:00
|
|
|
if (removed_item) {
|
|
|
|
total -= removed_item->total_msgs;
|
|
|
|
new -= removed_item->new_msgs;
|
|
|
|
unread -= removed_item->unread_msgs;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new > 0)
|
|
|
|
mainwindow_maemo_led_set(TRUE);
|
|
|
|
else
|
|
|
|
mainwindow_maemo_led_set(FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean maemo_folder_item_update_hook(gpointer source, gpointer data)
|
|
|
|
{
|
|
|
|
led_update(NULL);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean maemo_folder_update_hook(gpointer source, gpointer data)
|
|
|
|
{
|
|
|
|
FolderUpdateData *hookdata;
|
|
|
|
hookdata = source;
|
|
|
|
if (hookdata->update_flags & FOLDER_REMOVE_FOLDERITEM)
|
|
|
|
led_update(hookdata->item);
|
|
|
|
else
|
|
|
|
led_update(NULL);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void main_window_install_maemo_hooks(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
gint maemo_item_hook_id, maemo_folder_hook_id;
|
|
|
|
|
|
|
|
maemo_item_hook_id = hooks_register_hook (FOLDER_ITEM_UPDATE_HOOKLIST, maemo_folder_item_update_hook, NULL);
|
|
|
|
if (maemo_item_hook_id == -1) {
|
|
|
|
goto err_out_item;
|
|
|
|
}
|
|
|
|
|
|
|
|
maemo_folder_hook_id = hooks_register_hook (FOLDER_UPDATE_HOOKLIST, maemo_folder_update_hook, NULL);
|
|
|
|
if (maemo_folder_hook_id == -1) {
|
|
|
|
goto err_out_folder;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
err_out_folder:
|
|
|
|
hooks_unregister_hook(FOLDER_ITEM_UPDATE_HOOKLIST, maemo_item_hook_id);
|
|
|
|
err_out_item:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
MainWindow *main_window_create()
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
|
|
|
MainWindow *mainwin;
|
|
|
|
GtkWidget *window;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *menubar;
|
|
|
|
GtkWidget *handlebox;
|
|
|
|
GtkWidget *vbox_body;
|
2008-07-29 21:07:54 +02:00
|
|
|
GtkWidget *menuitem;
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *hbox_stat;
|
|
|
|
GtkWidget *statusbar;
|
2001-08-23 07:54:21 +02:00
|
|
|
GtkWidget *progressbar;
|
|
|
|
GtkWidget *statuslabel;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *ac_button;
|
|
|
|
GtkWidget *ac_label;
|
2002-09-29 23:46:05 +02:00
|
|
|
GtkWidget *online_pixmap;
|
|
|
|
GtkWidget *offline_pixmap;
|
2006-08-31 19:27:03 +02:00
|
|
|
GtkWidget *warning_icon;
|
|
|
|
GtkWidget *warning_btn;
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_TIP_DECL();
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
|
|
|
GtkWidget *online_switch;
|
|
|
|
GtkWidget *offline_switch;
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderView *folderview;
|
|
|
|
SummaryView *summaryview;
|
|
|
|
MessageView *messageview;
|
|
|
|
GdkColormap *colormap;
|
2001-08-17 01:29:37 +02:00
|
|
|
GdkColor color[4];
|
|
|
|
gboolean success[4];
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *ac_menu;
|
|
|
|
gint i;
|
|
|
|
|
2002-04-21 00:57:52 +02:00
|
|
|
static GdkGeometry geometry;
|
|
|
|
|
2002-08-15 09:38:17 +02:00
|
|
|
debug_print("Creating main window...\n");
|
2001-04-19 14:21:46 +02:00
|
|
|
mainwin = g_new0(MainWindow, 1);
|
|
|
|
|
|
|
|
/* main window */
|
2007-07-25 18:37:48 +02:00
|
|
|
window = GTK_WIDGET(gtkut_window_new(GTK_WINDOW_TOPLEVEL, "mainwindow"));
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_window_set_title(GTK_WINDOW(window), PROG_VERSION);
|
2004-07-28 09:57:21 +02:00
|
|
|
gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifdef GENERIC_UMPC
|
2007-07-15 11:14:01 +02:00
|
|
|
prefs_common.layout_mode = SMALL_LAYOUT;
|
|
|
|
#endif
|
2002-04-21 00:57:52 +02:00
|
|
|
if (!geometry.min_height) {
|
|
|
|
geometry.min_width = 320;
|
|
|
|
geometry.min_height = 200;
|
|
|
|
}
|
|
|
|
gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
|
|
|
|
GDK_HINT_MIN_SIZE);
|
|
|
|
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect(G_OBJECT(window), "delete_event",
|
|
|
|
G_CALLBACK(main_window_close_cb), mainwin);
|
2002-02-23 11:52:54 +01:00
|
|
|
MANAGE_WINDOW_SIGNALS_CONNECT(window);
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect(G_OBJECT(window), "focus_in_event",
|
|
|
|
G_CALLBACK(mainwindow_focus_in_event),
|
|
|
|
mainwin);
|
|
|
|
g_signal_connect(G_OBJECT(window), "key_press_event",
|
|
|
|
G_CALLBACK(mainwindow_key_pressed), mainwin);
|
2001-08-29 13:00:44 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_realize(window);
|
2001-11-29 11:49:46 +01:00
|
|
|
gtk_widget_add_events(window, GDK_KEY_PRESS_MASK|GDK_KEY_RELEASE_MASK);
|
2002-02-11 20:46:04 +01:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-08-29 13:00:44 +02:00
|
|
|
gtkut_widget_set_app_icon(window);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
vbox = gtk_vbox_new(FALSE, 0);
|
|
|
|
gtk_widget_show(vbox);
|
|
|
|
gtk_container_add(GTK_CONTAINER(window), vbox);
|
|
|
|
|
|
|
|
/* menu bar */
|
2008-07-29 21:07:54 +02:00
|
|
|
|
|
|
|
mainwin->ui_manager = gtk_ui_manager_new();
|
|
|
|
mainwin->action_group = cm_menu_create_action_group_full(mainwin->ui_manager,"Menu", mainwin_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_entries), (gpointer)mainwin);
|
|
|
|
gtk_action_group_add_toggle_actions(mainwin->action_group, mainwin_toggle_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_toggle_entries), (gpointer)mainwin);
|
|
|
|
gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_showhide_radio_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_showhide_radio_entries), C_AUTO, G_CALLBACK(toggle_toolbar_cb), (gpointer)mainwin);
|
|
|
|
gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_layout_radio_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_layout_radio_entries), C_AUTO, G_CALLBACK(set_layout_cb), (gpointer)mainwin);
|
|
|
|
gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_sort_radio_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_sort_radio_entries), C_AUTO, G_CALLBACK(sort_summary_cb), (gpointer)mainwin);
|
|
|
|
gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_sorttype_radio_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_sorttype_radio_entries), C_AUTO, G_CALLBACK(sort_summary_type_cb), (gpointer)mainwin);
|
|
|
|
gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_radio_enc_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_radio_enc_entries), C_AUTO, G_CALLBACK(set_charset_cb), (gpointer)mainwin);
|
|
|
|
gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_radio_dec_entries,
|
|
|
|
G_N_ELEMENTS(mainwin_radio_dec_entries), C_AUTO, G_CALLBACK(set_decode_cb), (gpointer)mainwin);
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menu", NULL, GTK_UI_MANAGER_MENUBAR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "File", "File", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "Edit", "Edit", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "View", "View", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "Message", "Message", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "Tools", "Tools", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "Configuration", "Configuration", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "Help", "Help", GTK_UI_MANAGER_MENU)
|
|
|
|
|
|
|
|
/* File menu */
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "AddMailbox", "File/AddMailbox", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File/AddMailbox", "MH", "File/AddMailbox/MH", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator1", "File/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "SortFolders", "File/SortFolders", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator2", "File/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "ImportMbox", "File/ImportMbox", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "ExportMbox", "File/ExportMbox", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "ExportSelMbox", "File/ExportSelMbox", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator3", "File/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "EmptyTrashes", "File/EmptyTrashes", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator4", "File/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "SaveAs", "File/SaveAs", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "PageSetup", "File/PageSetup", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#endif
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Print", "File/Print", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator5", "File/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "OfflineMode", "File/OfflineMode", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "SynchroniseFolders", "File/SynchroniseFolders", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator6", "File/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Exit", "File/Exit", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
/* Edit menu */
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "Copy", "Edit/Copy", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "SelectAll", "Edit/SelectAll", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "SelectThread", "Edit/SelectThread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "DeleteThread", "Edit/DeleteThread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "Separator1", "Edit/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "Find", "Edit/Find", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "SearchFolder", "Edit/SearchFolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Edit", "QuickSearch", "Edit/QuickSearch", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
/* View menu */
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "ShowHide", "View/ShowHide", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide", "Toolbar", "View/ShowHide/Toolbar", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar", "TextBelowIcon", "View/ShowHide/Toolbar/TextBelowIcon", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar", "TextBesideIcon", "View/ShowHide/Toolbar/TextBesideIcon", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar", "IconOnly", "View/ShowHide/Toolbar/IconOnly", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar", "TextOnly", "View/ShowHide/Toolbar/TextOnly", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#ifndef GENERIC_UMPC
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar", "Hide", "View/ShowHide/Toolbar/Hide", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#endif
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide", "MessageView", "View/ShowHide/MessageView", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#ifndef GENERIC_UMPC
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide", "StatusBar", "View/ShowHide/StatusBar", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#endif
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide", "ColumnHeaders", "View/ShowHide/ColumnHeaders", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "SetColumns", "View/SetColumns", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/SetColumns", "Folderlist", "View/SetColumns/Folderlist", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/SetColumns", "Messagelist", "View/SetColumns/Messagelist", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator1", "View/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
#ifndef GENERIC_UMPC
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Layout", "View/Layout", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "Standard", "View/Layout/Standard", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "ThreeColumns", "View/Layout/ThreeColumns", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "WideMessage", "View/Layout/WideMessage", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "WideMessageList", "View/Layout/WideMessageList", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "SmallScreen", "View/Layout/SmallScreen", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator2", "View/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Sort", "View/Sort", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Number", "View/Sort/Number", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Size", "View/Sort/Size", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Date", "View/Sort/Date", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "ThreadDate", "View/Sort/ThreadDate", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "From", "View/Sort/From", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "To", "View/Sort/To", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Subject", "View/Sort/Subject", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Color", "View/Sort/Color", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Tag", "View/Sort/Tag", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Mark", "View/Sort/Mark", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Status", "View/Sort/Status", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Attachment", "View/Sort/Attachment", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Score", "View/Sort/Score", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Locked", "View/Sort/Locked", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "DontSort", "View/Sort/DontSort", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Separator1", "View/Sort/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Ascending", "View/Sort/Ascending", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Descending", "View/Sort/Descending", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Separator2", "View/Sort/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "AttractSubj", "View/Sort/AttractSubj", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "ThreadView", "View/ThreadView", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "ExpandThreads", "View/ExpandThreads", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "CollapseThreads", "View/CollapseThreads", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "HideReadMessages", "View/HideReadMessages", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator3", "View/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Goto", "View/Goto", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Prev", "View/Goto/Prev", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Next", "View/Goto/Next", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator1", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevUnread", "View/Goto/PrevUnread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextUnread", "View/Goto/NextUnread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator2", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevNew", "View/Goto/PrevNew", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextNew", "View/Goto/NextNew", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator3", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevMarked", "View/Goto/PrevMarked", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextMarked", "View/Goto/NextMarked", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator4", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
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_MENUITEM)
|
|
|
|
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", "Separator6", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
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", "Separator4", "View/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Encoding", "View/Encoding", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", CS_AUTO, "View/Encoding/"CS_AUTO, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Separator1", "View/Encoding/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", CS_US_ASCII, "View/Encoding/"CS_US_ASCII, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", CS_UTF_8, "View/Encoding/"CS_UTF_8, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Separator2", "View/Encoding/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Western", "View/Encoding/Western", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Western", CS_ISO_8859_1, "View/Encoding/Western/"CS_ISO_8859_1, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Western", CS_ISO_8859_15, "View/Encoding/Western/"CS_ISO_8859_15, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Western", CS_WINDOWS_1252, "View/Encoding/Western/"CS_WINDOWS_1252, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", CS_ISO_8859_2, "View/Encoding/"CS_ISO_8859_2, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Baltic", "View/Encoding/Baltic", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Baltic", CS_ISO_8859_13, "View/Encoding/Baltic/"CS_ISO_8859_13, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Baltic", CS_ISO_8859_4, "View/Encoding/Baltic/"CS_ISO_8859_4, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", CS_ISO_8859_7, "View/Encoding/"CS_ISO_8859_7, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Hebrew", "View/Encoding/Hebrew", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Hebrew", CS_ISO_8859_8, "View/Encoding/Hebrew/"CS_ISO_8859_8, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Hebrew", CS_WINDOWS_1255, "View/Encoding/Hebrew/"CS_WINDOWS_1255, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Arabic", "View/Encoding/Arabic", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Arabic", CS_ISO_8859_6, "View/Encoding/Arabic/"CS_ISO_8859_6, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Arabic", CS_WINDOWS_1256, "View/Encoding/Arabic/"CS_WINDOWS_1256, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", CS_ISO_8859_9, "View/Encoding/"CS_ISO_8859_9, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Cyrillic", "View/Encoding/Cyrillic", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Cyrillic", CS_ISO_8859_5, "View/Encoding/Cyrillic/"CS_ISO_8859_5, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Cyrillic", CS_KOI8_R, "View/Encoding/Cyrillic/"CS_KOI8_R, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Cyrillic", CS_KOI8_U, "View/Encoding/Cyrillic/"CS_KOI8_U, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Cyrillic", CS_WINDOWS_1251, "View/Encoding/Cyrillic/"CS_WINDOWS_1251, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Japanese", "View/Encoding/Japanese", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Japanese", CS_ISO_2022_JP, "View/Encoding/Japanese/"CS_ISO_2022_JP, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Japanese", CS_ISO_2022_JP_2, "View/Encoding/Japanese/"CS_ISO_2022_JP_2, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Japanese", CS_EUC_JP, "View/Encoding/Japanese/"CS_EUC_JP, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Japanese", CS_SHIFT_JIS, "View/Encoding/Japanese/"CS_SHIFT_JIS, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Chinese", "View/Encoding/Chinese", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Chinese", CS_GB2312, "View/Encoding/Chinese/"CS_GB2312, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Chinese", CS_GBK, "View/Encoding/Chinese/"CS_GBK, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Chinese", CS_BIG5, "View/Encoding/Chinese/"CS_BIG5, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Chinese", CS_EUC_TW, "View/Encoding/Chinese/"CS_EUC_TW, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Korean", "View/Encoding/Korean", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Korean", CS_EUC_KR, "View/Encoding/Korean/"CS_EUC_KR, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Korean", CS_ISO_2022_KR, "View/Encoding/Korean/"CS_ISO_2022_KR, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding", "Thai", "View/Encoding/Thai", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Thai", CS_TIS_620, "View/Encoding/Thai/"CS_TIS_620, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Encoding/Thai", CS_WINDOWS_874, "View/Encoding/Thai/"CS_WINDOWS_874, GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Decode", "View/Decode", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Decode", "AutoDetect", "View/Decode/AutoDetect", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Decode", "Separator1", "View/Decode/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Decode", "8bit", "View/Decode/8bit", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Decode", "QP", "View/Decode/QP", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Decode", "B64", "View/Decode/B64", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Decode", "Uuencode", "View/Decode/Uuencode", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator5", "View/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "OpenNewWindow", "View/OpenNewWindow", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "MessageSource", "View/MessageSource", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "AllHeaders", "View/AllHeaders", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Quotes", "View/Quotes", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Quotes", "FoldAll", "View/Quotes/FoldAll", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Quotes", "Fold2", "View/Quotes/Fold2", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Quotes", "Fold3", "View/Quotes/Fold3", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator6", "View/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "UpdateSummary", "View/UpdateSummary", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
/* Message menu */
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Receive", "Message/Receive", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Receive", "CurrentAccount", "Message/Receive/CurrentAccount", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Receive", "AllAccounts", "Message/Receive/AllAccounts", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Receive", "CancelReceiving", "Message/Receive/CancelReceiving", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Receive", "Separator1", "Message/Receive/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Receive", "PlaceHolder", "Message/Receive/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "SendQueue", "Message/SendQueue", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator1", "Message/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "ComposeEmail", "Message/ComposeEmail", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "ComposeNews", "Message/ComposeNews", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Reply", "Message/Reply", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "ReplyTo", "Message/ReplyTo", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/ReplyTo", "All", "Message/ReplyTo/All", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/ReplyTo", "Sender", "Message/ReplyTo/Sender", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/ReplyTo", "List", "Message/ReplyTo/List", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "FollowupReply", "Message/FollowupReply", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator2", "Message/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Forward", "Message/Forward", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "ForwardAtt", "Message/ForwardAtt", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Redirect", "Message/Redirect", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "MailingList", "Message/MailingList", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList", "Post", "Message/MailingList/Post", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList", "Help", "Message/MailingList/Help", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList", "Subscribe", "Message/MailingList/Subscribe", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList", "Unsubscribe", "Message/MailingList/Unsubscribe", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList", "ViewArchive", "Message/MailingList/ViewArchive", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList", "ContactOwner", "Message/MailingList/ContactOwner", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList/Post", "PlaceHolder", "Message/MailingList/Post/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList/Help", "PlaceHolder", "Message/MailingList/Help/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList/Subscribe", "PlaceHolder", "Message/MailingList/Subscribe/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList/Unsubscribe", "PlaceHolder", "Message/MailingList/Unsubscribe/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList/ViewArchive", "PlaceHolder", "Message/MailingList/ViewArchive/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/MailingList/ContactOwner", "PlaceHolder", "Message/MailingList/ContactOwner/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator3", "Message/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Move", "Message/Move", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Copy", "Message/Copy", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Trash", "Message/Trash", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Delete", "Message/Delete", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "CancelNews", "Message/CancelNews", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator4", "Message/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Mark", "Message/Mark", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Mark", "Message/Mark/Mark", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Unmark", "Message/Mark/Unmark", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "---", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkUnread", "Message/Mark/MarkUnread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkRead", "Message/Mark/MarkRead", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkAllRead", "Message/Mark/MarkAllRead", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "IgnoreThread", "Message/Mark/IgnoreThread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "UnignoreThread", "Message/Mark/UnignoreThread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "WatchThread", "Message/Mark/WatchThread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "UnwatchThread", "Message/Mark/UnwatchThread", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "---", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkSpam", "Message/Mark/MarkSpam", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkHam", "Message/Mark/MarkHam", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "---", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Lock", "Message/Mark/Lock", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Unlock", "Message/Mark/Unlock", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "ColorLabel", "Message/ColorLabel", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Tags", "Message/Tags", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator5", "Message/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Reedit", "Message/Reedit", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator6", "Message/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
/* Tools menu */
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "AddressBook", "Tools/AddressBook", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "AddSenderToAB", "Tools/AddSenderToAB", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "CollectAddresses", "Tools/CollectAddresses", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CollectAddresses", "FromFolder", "Tools/CollectAddresses/FromFolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CollectAddresses", "FromSelected", "Tools/CollectAddresses/FromSelected", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator1", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "FilterFolder", "Tools/FilterFolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "FilterSelected", "Tools/FilterSelected", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "RunProcessing", "Tools/RunProcessing", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "CreateFilterRule", "Tools/CreateFilterRule", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateFilterRule", "Automatically", "Tools/CreateFilterRule/Automatically", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateFilterRule", "ByFrom", "Tools/CreateFilterRule/ByFrom", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateFilterRule", "ByTo", "Tools/CreateFilterRule/ByTo", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateFilterRule", "BySubject", "Tools/CreateFilterRule/BySubject", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "CreateProcessingRule", "Tools/CreateProcessingRule", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateProcessingRule", "Automatically", "Tools/CreateProcessingRule/Automatically", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateProcessingRule", "ByFrom", "Tools/CreateProcessingRule/ByFrom", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateProcessingRule", "ByTo", "Tools/CreateProcessingRule/ByTo", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/CreateProcessingRule", "BySubject", "Tools/CreateProcessingRule/BySubject", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator2", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "ListUrls", "Tools/ListUrls", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator3", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Actions", "Tools/Actions", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/Actions", "PlaceHolder", "Tools/Actions/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator4", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "CheckNewMessages", "Tools/CheckNewMessages", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "DeleteDuplicates", "Tools/DeleteDuplicates", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/DeleteDuplicates", "SelFolder", "Tools/DeleteDuplicates/SelFolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools/DeleteDuplicates", "AllFolders", "Tools/DeleteDuplicates/AllFolders", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator5", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Execute", "Tools/Execute", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator6", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "SSLCertificates", "Tools/SSLCertificates", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
#endif
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator7", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "FilteringLog", "Tools/FilteringLog", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "NetworkLog", "Tools/NetworkLog", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator8", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
/* Configuration menu */
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "ChangeAccount", "Configuration/ChangeAccount", GTK_UI_MANAGER_MENU)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration/ChangeAccount", "PlaceHolder", "Configuration/ChangeAccount/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "AccountPrefs", "Configuration/AccountPrefs", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "CreateAccount", "Configuration/CreateAccount", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "EditAccounts", "Configuration/EditAccounts", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Separator1", "Configuration/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Preferences", "Configuration/Preferences", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "PreProcessing", "Configuration/PreProcessing", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "PostProcessing", "Configuration/PostProcessing", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Filtering", "Configuration/Filtering", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Templates", "Configuration/Templates", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Actions", "Configuration/Actions", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Tags", "Configuration/Tags", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Separator2", "Configuration/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "Plugins", "Configuration/Plugins", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
/* Help menu */
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Help", "Manual", "Help/Manual", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Help", "FAQ", "Help/FAQ", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Help", "IconLegend", "Help/IconLegend", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Help", "Separator1", "Help/---", GTK_UI_MANAGER_SEPARATOR)
|
|
|
|
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Help", "About", "Help/About", GTK_UI_MANAGER_MENUITEM)
|
|
|
|
|
|
|
|
|
|
|
|
menubar = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu");
|
|
|
|
gtk_widget_show_all(menubar);
|
|
|
|
gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group(mainwin->ui_manager));
|
2007-07-13 18:47:36 +02:00
|
|
|
|
|
|
|
#ifndef MAEMO
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
|
2007-07-13 18:47:36 +02:00
|
|
|
#endif
|
|
|
|
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2005-08-06 00:54:48 +02:00
|
|
|
if (prefs_common.toolbar_detachable) {
|
|
|
|
handlebox = gtk_handle_box_new();
|
|
|
|
gtk_widget_show(handlebox);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), handlebox, FALSE, FALSE, 0);
|
|
|
|
g_signal_connect(G_OBJECT(handlebox), "child_attached",
|
|
|
|
G_CALLBACK(toolbar_child_attached), mainwin);
|
|
|
|
g_signal_connect(G_OBJECT(handlebox), "child_detached",
|
|
|
|
G_CALLBACK(toolbar_child_detached), mainwin);
|
|
|
|
} else {
|
|
|
|
handlebox = gtk_hbox_new(FALSE, 0);
|
|
|
|
gtk_widget_show(handlebox);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), handlebox, FALSE, FALSE, 0);
|
|
|
|
}
|
2002-08-22 17:27:07 +02:00
|
|
|
/* link window to mainwin->window to avoid gdk warnings */
|
|
|
|
mainwin->window = window;
|
2007-07-14 15:30:51 +02:00
|
|
|
mainwin_list = g_list_append(mainwin_list, mainwin);
|
2002-08-22 17:27:07 +02:00
|
|
|
|
2007-07-13 18:47:36 +02:00
|
|
|
#ifdef MAEMO
|
|
|
|
mainwin->toolbar = toolbar_create(TOOLBAR_MAIN,
|
|
|
|
window,
|
|
|
|
(gpointer)mainwin);
|
|
|
|
#else
|
2002-12-24 15:38:23 +01:00
|
|
|
mainwin->toolbar = toolbar_create(TOOLBAR_MAIN,
|
|
|
|
handlebox,
|
|
|
|
(gpointer)mainwin);
|
2007-07-13 18:47:36 +02:00
|
|
|
#endif
|
2006-02-27 18:47:53 +01:00
|
|
|
toolbar_set_learn_button
|
|
|
|
(mainwin->toolbar,
|
|
|
|
LEARN_SPAM);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
/* vbox that contains body */
|
|
|
|
vbox_body = gtk_vbox_new(FALSE, BORDER_WIDTH);
|
|
|
|
gtk_widget_show(vbox_body);
|
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(vbox_body), BORDER_WIDTH);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), vbox_body, TRUE, TRUE, 0);
|
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2001-04-19 14:21:46 +02:00
|
|
|
hbox_stat = gtk_hbox_new(FALSE, 2);
|
|
|
|
gtk_box_pack_end(GTK_BOX(vbox_body), hbox_stat, FALSE, FALSE, 0);
|
|
|
|
|
2006-08-31 19:27:03 +02:00
|
|
|
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);
|
|
|
|
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(warning_btn,
|
|
|
|
_("Some error(s) happened. Click here to view log."));
|
2006-08-31 19:27:03 +02:00
|
|
|
gtk_box_pack_start(GTK_BOX(hbox_stat), warning_btn, FALSE, FALSE, 0);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
statusbar = statusbar_create();
|
|
|
|
gtk_box_pack_start(GTK_BOX(hbox_stat), statusbar, TRUE, TRUE, 0);
|
|
|
|
|
2001-08-23 07:54:21 +02:00
|
|
|
progressbar = gtk_progress_bar_new();
|
2003-10-05 12:10:30 +02:00
|
|
|
gtk_widget_set_size_request(progressbar, 120, 1);
|
2001-08-23 07:54:21 +02:00
|
|
|
gtk_box_pack_start(GTK_BOX(hbox_stat), progressbar, FALSE, FALSE, 0);
|
2007-07-25 18:37:48 +02:00
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
online_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_ONLINE);
|
|
|
|
offline_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_OFFLINE);
|
2002-04-21 14:11:43 +02:00
|
|
|
online_switch = gtk_button_new ();
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(online_switch,
|
|
|
|
_("You are online. Click the icon to go offline"));
|
2002-04-21 14:11:43 +02:00
|
|
|
offline_switch = gtk_button_new ();
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(offline_switch,
|
|
|
|
_("You are offline. Click the icon to go online"));
|
2002-09-29 23:46:05 +02:00
|
|
|
gtk_container_add (GTK_CONTAINER(online_switch), online_pixmap);
|
2002-04-21 14:11:43 +02:00
|
|
|
gtk_button_set_relief (GTK_BUTTON(online_switch), GTK_RELIEF_NONE);
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect (G_OBJECT(online_switch), "clicked", G_CALLBACK(online_switch_clicked), mainwin);
|
2002-04-21 14:11:43 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX(hbox_stat), online_switch, FALSE, FALSE, 0);
|
2002-09-29 23:46:05 +02:00
|
|
|
gtk_container_add (GTK_CONTAINER(offline_switch), offline_pixmap);
|
2002-04-21 14:11:43 +02:00
|
|
|
gtk_button_set_relief (GTK_BUTTON(offline_switch), GTK_RELIEF_NONE);
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect (G_OBJECT(offline_switch), "clicked", G_CALLBACK(online_switch_clicked), mainwin);
|
2002-04-21 14:11:43 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX(hbox_stat), offline_switch, FALSE, FALSE, 0);
|
|
|
|
|
2001-08-23 07:54:21 +02:00
|
|
|
statuslabel = gtk_label_new("");
|
|
|
|
gtk_box_pack_start(GTK_BOX(hbox_stat), statuslabel, FALSE, FALSE, 0);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
ac_button = gtk_button_new();
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(ac_button, _("Select account"));
|
2001-04-19 14:21:46 +02:00
|
|
|
GTK_WIDGET_UNSET_FLAGS(ac_button, GTK_CAN_FOCUS);
|
2004-07-26 22:09:27 +02:00
|
|
|
gtk_widget_set_size_request(ac_button, -1, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_box_pack_end(GTK_BOX(hbox_stat), ac_button, FALSE, FALSE, 0);
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect(G_OBJECT(ac_button), "button_press_event",
|
|
|
|
G_CALLBACK(ac_label_button_pressed), mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
ac_label = gtk_label_new("");
|
|
|
|
gtk_container_add(GTK_CONTAINER(ac_button), ac_label);
|
|
|
|
|
|
|
|
gtk_widget_show_all(hbox_stat);
|
|
|
|
|
2002-04-21 14:11:43 +02:00
|
|
|
gtk_widget_hide(offline_switch);
|
2006-08-31 19:27:03 +02:00
|
|
|
gtk_widget_hide(warning_btn);
|
2007-07-25 18:37:48 +02:00
|
|
|
#else
|
|
|
|
online_switch = gtk_button_new ();
|
|
|
|
offline_switch = gtk_button_new ();
|
|
|
|
g_signal_connect (G_OBJECT(online_switch), "clicked", G_CALLBACK(online_switch_clicked), mainwin);
|
|
|
|
g_signal_connect (G_OBJECT(offline_switch), "clicked", G_CALLBACK(online_switch_clicked), mainwin);
|
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
/* create views */
|
|
|
|
mainwin->folderview = folderview = folderview_create();
|
|
|
|
mainwin->summaryview = summaryview = summary_create();
|
2002-08-23 08:52:15 +02:00
|
|
|
mainwin->messageview = messageview = messageview_create(mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-03-21 16:00:46 +01:00
|
|
|
/* init log instances data before creating log views */
|
2007-06-11 12:48:35 +02:00
|
|
|
set_log_title(LOG_PROTOCOL, _("Network log"));
|
2007-03-21 16:00:46 +01:00
|
|
|
set_log_prefs(LOG_PROTOCOL,
|
|
|
|
&prefs_common.logwin_width,
|
|
|
|
&prefs_common.logwin_height);
|
|
|
|
set_log_title(LOG_DEBUG_FILTERING, _("Filtering/processing debug log"));
|
|
|
|
set_log_prefs(LOG_DEBUG_FILTERING,
|
|
|
|
&prefs_common.filtering_debugwin_width,
|
|
|
|
&prefs_common.filtering_debugwin_height);
|
|
|
|
|
|
|
|
/* setup log windows */
|
|
|
|
mainwin->logwin = log_window_create(LOG_PROTOCOL);
|
2006-09-05 18:40:05 +02:00
|
|
|
log_window_init(mainwin->logwin);
|
2007-03-21 16:00:46 +01:00
|
|
|
|
|
|
|
mainwin->filtering_debugwin = log_window_create(LOG_DEBUG_FILTERING);
|
|
|
|
log_window_set_clipping(mainwin->logwin,
|
|
|
|
prefs_common.cliplog,
|
2006-09-05 18:40:05 +02:00
|
|
|
prefs_common.loglength);
|
|
|
|
|
2007-03-21 16:00:46 +01:00
|
|
|
log_window_init(mainwin->filtering_debugwin);
|
|
|
|
log_window_set_clipping(mainwin->filtering_debugwin,
|
|
|
|
prefs_common.filtering_debug_cliplog,
|
|
|
|
prefs_common.filtering_debug_loglength);
|
|
|
|
if (prefs_common.enable_filtering_debug)
|
2007-04-27 11:17:55 +02:00
|
|
|
log_message(LOG_DEBUG_FILTERING, _("filtering log enabled\n"));
|
2007-03-21 16:00:46 +01:00
|
|
|
else
|
2007-04-27 11:17:55 +02:00
|
|
|
log_message(LOG_DEBUG_FILTERING, _("filtering log disabled\n"));
|
2007-03-21 16:00:46 +01:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
folderview->mainwin = mainwin;
|
|
|
|
folderview->summaryview = summaryview;
|
|
|
|
|
|
|
|
summaryview->mainwin = mainwin;
|
|
|
|
summaryview->folderview = folderview;
|
|
|
|
summaryview->messageview = messageview;
|
|
|
|
summaryview->window = window;
|
|
|
|
|
2004-05-10 12:22:28 +02:00
|
|
|
mainwin->vbox = vbox;
|
|
|
|
mainwin->menubar = menubar;
|
|
|
|
mainwin->handlebox = handlebox;
|
|
|
|
mainwin->vbox_body = vbox_body;
|
2007-07-25 18:37:48 +02:00
|
|
|
mainwin->online_switch = online_switch;
|
|
|
|
mainwin->offline_switch = offline_switch;
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-07-25 18:37:48 +02:00
|
|
|
messageview->statusbar = statusbar;
|
|
|
|
mainwin->statusbar = statusbar;
|
|
|
|
mainwin->hbox_stat = hbox_stat;
|
2004-05-10 12:22:28 +02:00
|
|
|
mainwin->progressbar = progressbar;
|
|
|
|
mainwin->statuslabel = statuslabel;
|
|
|
|
mainwin->online_pixmap = online_pixmap;
|
|
|
|
mainwin->offline_pixmap = offline_pixmap;
|
|
|
|
mainwin->ac_button = ac_button;
|
|
|
|
mainwin->ac_label = ac_label;
|
2001-04-19 14:21:46 +02:00
|
|
|
/* set context IDs for status bar */
|
|
|
|
mainwin->mainwin_cid = gtk_statusbar_get_context_id
|
|
|
|
(GTK_STATUSBAR(statusbar), "Main Window");
|
|
|
|
mainwin->folderview_cid = gtk_statusbar_get_context_id
|
|
|
|
(GTK_STATUSBAR(statusbar), "Folder View");
|
|
|
|
mainwin->summaryview_cid = gtk_statusbar_get_context_id
|
|
|
|
(GTK_STATUSBAR(statusbar), "Summary View");
|
2004-02-21 12:01:01 +01:00
|
|
|
mainwin->messageview_cid = gtk_statusbar_get_context_id
|
|
|
|
(GTK_STATUSBAR(statusbar), "Message View");
|
2004-05-10 12:22:28 +02:00
|
|
|
messageview->statusbar_cid = mainwin->messageview_cid;
|
|
|
|
|
2007-07-25 18:37:48 +02:00
|
|
|
#else
|
|
|
|
messageview->statusbar = NULL;
|
|
|
|
mainwin->statusbar = NULL;
|
|
|
|
mainwin->hbox_stat = NULL;
|
|
|
|
/* mainwin->progressbar is set in toolbar.c */
|
|
|
|
mainwin->statuslabel = NULL;
|
|
|
|
mainwin->online_pixmap = NULL;
|
|
|
|
mainwin->offline_pixmap = NULL;
|
|
|
|
mainwin->ac_button = NULL;
|
|
|
|
mainwin->ac_label = NULL;
|
|
|
|
#endif
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
/* allocate colors for summary view and folder view */
|
|
|
|
summaryview->color_marked.red = summaryview->color_marked.green = 0;
|
|
|
|
summaryview->color_marked.blue = (guint16)65535;
|
|
|
|
|
|
|
|
summaryview->color_dim.red = summaryview->color_dim.green =
|
|
|
|
summaryview->color_dim.blue = COLOR_DIM;
|
|
|
|
|
2003-02-18 06:55:38 +01:00
|
|
|
gtkut_convert_int_to_gdk_color(prefs_common.color_new,
|
|
|
|
&folderview->color_new);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-07-31 08:17:48 +02:00
|
|
|
gtkut_convert_int_to_gdk_color(prefs_common.tgt_folder_col,
|
|
|
|
&folderview->color_op);
|
|
|
|
|
2001-06-01 13:06:33 +02:00
|
|
|
summaryview->color_important.red = 0;
|
2002-03-12 09:14:05 +01:00
|
|
|
summaryview->color_important.green = 0;
|
2001-06-01 13:06:33 +02:00
|
|
|
summaryview->color_important.blue = (guint16)65535;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
color[0] = summaryview->color_marked;
|
|
|
|
color[1] = summaryview->color_dim;
|
2001-07-05 10:47:25 +02:00
|
|
|
color[2] = folderview->color_new;
|
2001-07-31 08:17:48 +02:00
|
|
|
color[3] = folderview->color_op;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2005-08-18 21:09:53 +02:00
|
|
|
colormap = gdk_drawable_get_colormap(window->window);
|
2001-08-17 01:29:37 +02:00
|
|
|
gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success);
|
|
|
|
for (i = 0; i < 4; i++) {
|
2001-04-19 14:21:46 +02:00
|
|
|
if (success[i] == FALSE)
|
2002-12-10 19:42:29 +01:00
|
|
|
g_warning("MainWindow: color allocation %d failed\n", i);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2002-08-15 09:38:17 +02:00
|
|
|
debug_print("done.\n");
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2003-08-21 10:45:43 +02:00
|
|
|
messageview->visible = prefs_common.msgview_visible;
|
2005-08-06 12:12:38 +02:00
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
main_window_set_widgets(mainwin, prefs_common.layout_mode);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect(G_OBJECT(window), "size_allocate",
|
|
|
|
G_CALLBACK(main_window_size_allocate_cb),
|
|
|
|
mainwin);
|
2003-08-09 08:26:27 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
/* set menu items */
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Encoding/"CS_AUTO, TRUE);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = NULL;
|
2001-04-19 14:21:46 +02:00
|
|
|
switch (prefs_common.toolbar_style) {
|
|
|
|
case TOOLBAR_NONE:
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar/Hide");
|
2001-04-19 14:21:46 +02:00
|
|
|
break;
|
|
|
|
case TOOLBAR_ICON:
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar/IconOnly");
|
2001-04-19 14:21:46 +02:00
|
|
|
break;
|
|
|
|
case TOOLBAR_TEXT:
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar/TextOnly");
|
2001-04-19 14:21:46 +02:00
|
|
|
break;
|
|
|
|
case TOOLBAR_BOTH:
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar/TextBelowIcon");
|
2005-12-23 09:01:38 +01:00
|
|
|
break;
|
2005-12-22 11:43:40 +01:00
|
|
|
case TOOLBAR_BOTH_HORIZ:
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar/TextBesideIcon");
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
|
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_hide(mainwin->hbox_stat);
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/StatusBar");
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
|
|
|
|
prefs_common.show_statusbar);
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/ColumnHeaders");
|
2007-07-26 22:30:13 +02:00
|
|
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
|
|
|
|
prefs_common.show_col_headers);
|
2001-04-19 14:21:46 +02:00
|
|
|
/* set account selection menu */
|
2008-07-29 21:07:54 +02:00
|
|
|
ac_menu = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Configuration/ChangeAccount");
|
2001-04-19 14:21:46 +02:00
|
|
|
mainwin->ac_menu = ac_menu;
|
|
|
|
|
2002-12-24 15:38:23 +01:00
|
|
|
toolbar_main_set_sensitive(mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2002-07-05 09:49:10 +02:00
|
|
|
/* create actions menu */
|
2004-02-21 12:01:01 +01:00
|
|
|
main_window_update_actions_menu(mainwin);
|
2002-02-06 12:15:31 +01:00
|
|
|
|
2006-05-12 19:42:48 +02:00
|
|
|
main_create_mailing_list_menu (mainwin, NULL);
|
|
|
|
|
2003-01-05 13:28:18 +01:00
|
|
|
/* attach accel groups to main window */
|
2004-07-17 23:15:07 +02:00
|
|
|
#define ADD_MENU_ACCEL_GROUP_TO_WINDOW(menu,win) \
|
|
|
|
gtk_window_add_accel_group \
|
|
|
|
(GTK_WINDOW(win), \
|
2008-07-25 23:01:45 +02:00
|
|
|
gtk_ui_manager_get_accel_group(gtkut_ui_manager())); \
|
|
|
|
g_signal_connect(G_OBJECT(gtk_ui_manager_get_accel_group(gtkut_ui_manager())), \
|
2004-07-17 23:15:07 +02:00
|
|
|
"accel_activate", \
|
|
|
|
G_CALLBACK(main_window_accel_activate), mainwin);
|
2008-07-25 23:01:45 +02:00
|
|
|
|
|
|
|
ADD_MENU_ACCEL_GROUP_TO_WINDOW(summaryview->popupmenu, mainwin->window);
|
2003-01-05 13:28:18 +01:00
|
|
|
|
2008-07-25 23:01:45 +02:00
|
|
|
/* FIXME menu_connect_identical_items(); */
|
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2005-10-27 13:29:46 +02:00
|
|
|
gtk_window_iconify(GTK_WINDOW(mainwin->window));
|
2007-07-13 18:47:36 +02:00
|
|
|
#endif
|
2005-10-26 18:15:21 +02:00
|
|
|
|
2007-03-06 11:16:20 +01:00
|
|
|
g_signal_connect(G_OBJECT(window), "window_state_event",
|
|
|
|
G_CALLBACK(mainwindow_state_event_cb), mainwin);
|
2007-01-28 13:05:08 +01:00
|
|
|
g_signal_connect(G_OBJECT(window), "visibility_notify_event",
|
|
|
|
G_CALLBACK(mainwindow_visibility_event_cb), mainwin);
|
|
|
|
gtk_widget_add_events(GTK_WIDGET(window), GDK_VISIBILITY_NOTIFY_MASK);
|
|
|
|
|
2007-03-21 18:44:45 +01:00
|
|
|
if (prefs_common.layout_mode == VERTICAL_LAYOUT ||
|
2007-03-22 08:52:47 +01:00
|
|
|
prefs_common.layout_mode == SMALL_LAYOUT) {
|
2007-01-19 19:16:09 +01:00
|
|
|
summary_relayout(mainwin->summaryview);
|
2007-03-21 18:44:45 +01:00
|
|
|
}
|
2007-03-30 10:49:14 +02:00
|
|
|
summary_update_unread(mainwin->summaryview, NULL);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_show(mainwin->window);
|
|
|
|
|
|
|
|
/* initialize views */
|
|
|
|
folderview_init(folderview);
|
|
|
|
summary_init(summaryview);
|
|
|
|
messageview_init(messageview);
|
2007-10-18 09:13:06 +02:00
|
|
|
#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
|
2002-12-09 09:54:56 +01:00
|
|
|
sslcertwindow_register_hook();
|
|
|
|
#endif
|
2001-08-22 12:58:38 +02:00
|
|
|
mainwin->lock_count = 0;
|
2002-02-14 16:28:02 +01:00
|
|
|
mainwin->menu_lock_count = 0;
|
2001-04-19 14:21:46 +02:00
|
|
|
mainwin->cursor_count = 0;
|
|
|
|
|
2003-03-03 21:45:57 +01:00
|
|
|
mainwin->progressindicator_hook =
|
|
|
|
hooks_register_hook(PROGRESSINDICATOR_HOOKLIST, mainwindow_progressindicator_hook, mainwin);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
if (!watch_cursor)
|
|
|
|
watch_cursor = gdk_cursor_new(GDK_WATCH);
|
2006-08-31 19:27:03 +02:00
|
|
|
if (!hand_cursor)
|
|
|
|
hand_cursor = gdk_cursor_new(GDK_HAND2);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2002-04-21 14:11:43 +02:00
|
|
|
/* init work_offline */
|
|
|
|
if (prefs_common.work_offline)
|
|
|
|
online_switch_clicked (GTK_BUTTON(online_switch), mainwin);
|
|
|
|
|
2006-03-17 19:10:51 +01:00
|
|
|
mainwindow_colorlabel_menu_create(mainwin, FALSE);
|
2007-07-02 18:35:40 +02:00
|
|
|
mainwindow_tags_menu_create(mainwin, FALSE);
|
2007-12-04 22:49:04 +01:00
|
|
|
|
|
|
|
#ifdef MAEMO
|
|
|
|
main_window_install_maemo_hooks(mainwin);
|
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
return mainwin;
|
|
|
|
}
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
void main_window_update_actions_menu(MainWindow *mainwin)
|
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
action_update_mainwin_menu(mainwin->ui_manager, "/Menu/Tools/Actions", mainwin);
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
void main_window_cursor_wait(MainWindow *mainwin)
|
|
|
|
{
|
2001-08-22 12:58:38 +02:00
|
|
|
|
2006-03-18 20:16:07 +01:00
|
|
|
if (mainwin->cursor_count == 0) {
|
2001-04-19 14:21:46 +02:00
|
|
|
gdk_window_set_cursor(mainwin->window->window, watch_cursor);
|
2006-03-18 20:16:07 +01:00
|
|
|
textview_cursor_wait(mainwin->messageview->mimeview->textview);
|
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
mainwin->cursor_count++;
|
|
|
|
|
|
|
|
gdk_flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
void main_window_cursor_normal(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
if (mainwin->cursor_count)
|
|
|
|
mainwin->cursor_count--;
|
|
|
|
|
2006-03-18 20:16:07 +01:00
|
|
|
if (mainwin->cursor_count == 0) {
|
2001-04-19 14:21:46 +02:00
|
|
|
gdk_window_set_cursor(mainwin->window->window, NULL);
|
2006-03-18 20:16:07 +01:00
|
|
|
textview_cursor_normal(mainwin->messageview->mimeview->textview);
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
gdk_flush();
|
|
|
|
}
|
|
|
|
|
2001-08-22 12:58:38 +02:00
|
|
|
/* lock / unlock the user-interface */
|
|
|
|
void main_window_lock(MainWindow *mainwin)
|
|
|
|
{
|
2007-07-25 18:37:48 +02:00
|
|
|
if (mainwin->lock_count == 0 && mainwin->ac_button)
|
2001-08-22 12:58:38 +02:00
|
|
|
gtk_widget_set_sensitive(mainwin->ac_button, FALSE);
|
|
|
|
|
|
|
|
mainwin->lock_count++;
|
|
|
|
|
|
|
|
main_window_set_menu_sensitive(mainwin);
|
2002-12-24 15:38:23 +01:00
|
|
|
toolbar_main_set_sensitive(mainwin);
|
2001-08-22 12:58:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void main_window_unlock(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
if (mainwin->lock_count)
|
|
|
|
mainwin->lock_count--;
|
|
|
|
|
|
|
|
main_window_set_menu_sensitive(mainwin);
|
2002-12-24 15:38:23 +01:00
|
|
|
toolbar_main_set_sensitive(mainwin);
|
2001-08-22 12:58:38 +02:00
|
|
|
|
2007-07-25 18:37:48 +02:00
|
|
|
if (mainwin->lock_count == 0 && mainwin->ac_button)
|
2001-08-22 12:58:38 +02:00
|
|
|
gtk_widget_set_sensitive(mainwin->ac_button, TRUE);
|
|
|
|
}
|
|
|
|
|
2002-02-14 16:28:02 +01:00
|
|
|
static void main_window_menu_callback_block(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
mainwin->menu_lock_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void main_window_menu_callback_unblock(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
if (mainwin->menu_lock_count)
|
|
|
|
mainwin->menu_lock_count--;
|
|
|
|
}
|
|
|
|
|
2005-08-01 19:18:42 +02:00
|
|
|
static guint prefs_tag = 0;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
void main_window_reflect_prefs_all(void)
|
2002-02-16 16:50:38 +01:00
|
|
|
{
|
|
|
|
main_window_reflect_prefs_all_real(FALSE);
|
|
|
|
}
|
|
|
|
|
2005-08-02 19:11:21 +02:00
|
|
|
static gboolean reflect_prefs_timeout_cb(gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2005-08-02 19:11:21 +02:00
|
|
|
gboolean pixmap_theme_changed = GPOINTER_TO_INT(data);
|
2001-04-19 14:21:46 +02:00
|
|
|
GList *cur;
|
|
|
|
MainWindow *mainwin;
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2002-09-29 23:46:05 +02:00
|
|
|
GtkWidget *pixmap;
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
for (cur = mainwin_list; cur != NULL; cur = cur->next) {
|
|
|
|
mainwin = (MainWindow *)cur->data;
|
|
|
|
|
|
|
|
main_window_show_cur_account(mainwin);
|
2001-08-24 13:19:44 +02:00
|
|
|
main_window_set_menu_sensitive(mainwin);
|
2002-12-24 15:38:23 +01:00
|
|
|
toolbar_main_set_sensitive(mainwin);
|
2001-05-28 20:38:15 +02:00
|
|
|
|
2002-02-12 22:57:15 +01:00
|
|
|
/* pixmap themes */
|
2002-06-13 22:18:19 +02:00
|
|
|
if (pixmap_theme_changed) {
|
2002-12-24 15:38:23 +01:00
|
|
|
toolbar_update(TOOLBAR_MAIN, mainwin);
|
|
|
|
messageview_reflect_prefs_pixmap_theme();
|
|
|
|
compose_reflect_prefs_pixmap_theme();
|
2002-02-16 16:50:38 +01:00
|
|
|
folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
|
|
|
|
summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2004-01-12 22:28:31 +01:00
|
|
|
pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_ONLINE);
|
2002-09-29 23:46:05 +02:00
|
|
|
gtk_container_remove(GTK_CONTAINER(mainwin->online_switch),
|
|
|
|
mainwin->online_pixmap);
|
|
|
|
gtk_container_add (GTK_CONTAINER(mainwin->online_switch), pixmap);
|
|
|
|
gtk_widget_show(pixmap);
|
|
|
|
mainwin->online_pixmap = pixmap;
|
2004-01-12 22:28:31 +01:00
|
|
|
pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_OFFLINE);
|
2002-09-29 23:46:05 +02:00
|
|
|
gtk_container_remove(GTK_CONTAINER(mainwin->offline_switch),
|
|
|
|
mainwin->offline_pixmap);
|
|
|
|
gtk_container_add (GTK_CONTAINER(mainwin->offline_switch), pixmap);
|
|
|
|
gtk_widget_show(pixmap);
|
|
|
|
mainwin->offline_pixmap = pixmap;
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
2008-05-26 21:33:40 +02:00
|
|
|
hooks_invoke(THEME_CHANGED_HOOKLIST, NULL);
|
2002-02-16 16:50:38 +01:00
|
|
|
}
|
|
|
|
|
2005-08-31 12:15:44 +02:00
|
|
|
headerview_set_font(mainwin->messageview->headerview);
|
2001-04-19 14:21:46 +02:00
|
|
|
headerview_set_visibility(mainwin->messageview->headerview,
|
|
|
|
prefs_common.display_header_pane);
|
2005-05-19 11:16:26 +02:00
|
|
|
textview_reflect_prefs(mainwin->messageview->mimeview->textview);
|
2005-08-01 19:18:42 +02:00
|
|
|
folderview_reflect_prefs();
|
|
|
|
summary_reflect_prefs();
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2005-05-19 11:16:26 +02:00
|
|
|
summary_redisplay_msg(mainwin->summaryview);
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
|
|
|
if (prefs_common.layout_mode == SMALL_LAYOUT) {
|
|
|
|
if (mainwin->in_folder) {
|
|
|
|
mainwindow_enter_folder(mainwin);
|
|
|
|
} else {
|
|
|
|
mainwindow_exit_folder(mainwin);
|
|
|
|
}
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
2005-08-01 19:18:42 +02:00
|
|
|
prefs_tag = 0;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2006-07-31 08:45:10 +02:00
|
|
|
void main_window_reflect_prefs_all_now(void)
|
|
|
|
{
|
|
|
|
reflect_prefs_timeout_cb(GINT_TO_POINTER(FALSE));
|
|
|
|
}
|
|
|
|
|
2006-03-17 19:10:51 +01:00
|
|
|
void main_window_reflect_prefs_custom_colors(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
GtkMenuShell *menu;
|
|
|
|
GList *cur;
|
|
|
|
|
|
|
|
/* re-create colorlabel submenu */
|
|
|
|
menu = GTK_MENU_SHELL(mainwin->colorlabel_menu);
|
|
|
|
g_return_if_fail(menu != NULL);
|
|
|
|
|
|
|
|
/* clear items. get item pointers. */
|
|
|
|
for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
|
|
|
|
gtk_menu_item_remove_submenu(GTK_MENU_ITEM(cur->data));
|
|
|
|
}
|
|
|
|
mainwindow_colorlabel_menu_create(mainwin, TRUE);
|
|
|
|
summary_reflect_prefs_custom_colors(mainwin->summaryview);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-12-03 18:32:15 +01:00
|
|
|
static gint tags_tag = 0;
|
|
|
|
static gboolean main_window_reflect_tags_changes_real(gpointer data)
|
2007-07-02 18:35:40 +02:00
|
|
|
{
|
|
|
|
GtkMenuShell *menu;
|
|
|
|
GList *cur;
|
2007-12-03 18:32:15 +01:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
|
2008-03-31 08:47:40 +02:00
|
|
|
if (summary_is_locked(mainwin->summaryview)) {
|
|
|
|
tags_tag = 0;
|
2007-12-03 18:32:15 +01:00
|
|
|
return TRUE;
|
2008-03-31 08:47:40 +02:00
|
|
|
}
|
2007-07-02 18:35:40 +02:00
|
|
|
/* re-create tags submenu */
|
|
|
|
menu = GTK_MENU_SHELL(mainwin->tags_menu);
|
2007-12-04 22:49:04 +01:00
|
|
|
g_return_val_if_fail(menu != NULL, FALSE);
|
2007-07-02 18:35:40 +02:00
|
|
|
|
|
|
|
/* clear items. get item pointers. */
|
|
|
|
for (cur = menu->children; cur != NULL && cur->data != NULL; cur = cur->next) {
|
|
|
|
gtk_menu_item_remove_submenu(GTK_MENU_ITEM(cur->data));
|
|
|
|
}
|
|
|
|
mainwindow_tags_menu_create(mainwin, TRUE);
|
|
|
|
summary_reflect_tags_changes(mainwin->summaryview);
|
2007-12-03 18:32:15 +01:00
|
|
|
|
2008-03-31 08:47:40 +02:00
|
|
|
tags_tag = 0;
|
2007-12-03 18:32:15 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
2007-07-02 18:35:40 +02:00
|
|
|
|
2007-12-03 18:32:15 +01:00
|
|
|
void main_window_reflect_tags_changes(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
if (tags_tag == 0) {
|
|
|
|
tags_tag = g_timeout_add(100, main_window_reflect_tags_changes_real,
|
|
|
|
mainwin);
|
|
|
|
}
|
2007-07-02 18:35:40 +02:00
|
|
|
}
|
|
|
|
|
2005-08-01 19:18:42 +02:00
|
|
|
void main_window_reflect_prefs_all_real(gboolean pixmap_theme_changed)
|
|
|
|
{
|
2008-05-23 07:12:52 +02:00
|
|
|
if (prefs_tag == 0) {
|
2008-07-05 17:38:37 +02:00
|
|
|
prefs_tag = g_timeout_add(100, reflect_prefs_timeout_cb,
|
2005-08-02 19:11:21 +02:00
|
|
|
GINT_TO_POINTER(pixmap_theme_changed));
|
2005-08-01 19:18:42 +02:00
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2001-10-22 10:42:36 +02:00
|
|
|
void main_window_set_summary_column(void)
|
|
|
|
{
|
|
|
|
GList *cur;
|
|
|
|
MainWindow *mainwin;
|
|
|
|
|
|
|
|
for (cur = mainwin_list; cur != NULL; cur = cur->next) {
|
|
|
|
mainwin = (MainWindow *)cur->data;
|
|
|
|
summary_set_column_order(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-05 21:57:42 +02:00
|
|
|
void main_window_set_folder_column(void)
|
|
|
|
{
|
|
|
|
GList *cur;
|
|
|
|
MainWindow *mainwin;
|
|
|
|
|
|
|
|
for (cur = mainwin_list; cur != NULL; cur = cur->next) {
|
|
|
|
mainwin = (MainWindow *)cur->data;
|
|
|
|
folderview_set_column_order(mainwin->folderview);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
static void main_window_set_account_selector_menu(MainWindow *mainwin,
|
|
|
|
GList *account_list)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
GList *cur_ac;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *menuitem;
|
|
|
|
PrefsAccount *ac_prefs;
|
2008-07-29 21:07:54 +02:00
|
|
|
GtkWidget *menu;
|
|
|
|
gchar *accel_path;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
menu = gtk_menu_new();
|
|
|
|
gtk_menu_set_accel_group (GTK_MENU (menu),
|
|
|
|
gtk_ui_manager_get_accel_group(mainwin->ui_manager));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
|
|
|
|
ac_prefs = (PrefsAccount *)cur_ac->data;
|
|
|
|
|
|
|
|
menuitem = gtk_menu_item_new_with_label
|
|
|
|
(ac_prefs->account_name
|
|
|
|
? ac_prefs->account_name : _("Untitled"));
|
|
|
|
gtk_widget_show(menuitem);
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_menu_append(GTK_MENU(menu), menuitem);
|
2004-05-25 10:39:41 +02:00
|
|
|
g_signal_connect(G_OBJECT(menuitem), "activate",
|
|
|
|
G_CALLBACK(account_selector_menu_cb),
|
|
|
|
ac_prefs);
|
2008-07-29 21:07:54 +02:00
|
|
|
accel_path = g_strconcat("<Actions>/Menu/Configuration/ChangeAccount/",(ac_prefs->account_name
|
|
|
|
? ac_prefs->account_name : _("Untitled")), NULL );
|
|
|
|
gtk_menu_item_set_accel_path(GTK_MENU_ITEM(menuitem), accel_path);
|
|
|
|
g_free(accel_path);
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mainwin->ac_menu), menu);
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void main_window_set_account_receive_menu(MainWindow *mainwin,
|
|
|
|
GList *account_list)
|
|
|
|
{
|
|
|
|
GList *cur_ac, *cur_item;
|
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *menuitem;
|
|
|
|
PrefsAccount *ac_prefs;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(
|
|
|
|
gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive")));
|
2004-02-21 12:01:01 +01:00
|
|
|
|
|
|
|
/* search for separator */
|
|
|
|
for (cur_item = GTK_MENU_SHELL(menu)->children; cur_item != NULL;
|
|
|
|
cur_item = cur_item->next) {
|
2008-07-29 21:07:54 +02:00
|
|
|
if (cur_item->data == gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive/Separator1")) {
|
2004-02-21 12:01:01 +01:00
|
|
|
cur_item = cur_item->next;
|
|
|
|
break;
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
}
|
2004-02-21 12:01:01 +01:00
|
|
|
|
|
|
|
/* destroy all previous menu item */
|
|
|
|
while (cur_item != NULL) {
|
|
|
|
GList *next = cur_item->next;
|
|
|
|
gtk_widget_destroy(GTK_WIDGET(cur_item->data));
|
|
|
|
cur_item = next;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
|
|
|
|
ac_prefs = (PrefsAccount *)cur_ac->data;
|
|
|
|
|
2008-05-21 08:42:15 +02:00
|
|
|
if (ac_prefs->protocol == A_NONE)
|
|
|
|
continue;
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
menuitem = gtk_menu_item_new_with_label
|
|
|
|
(ac_prefs->account_name ? ac_prefs->account_name
|
|
|
|
: _("Untitled"));
|
|
|
|
gtk_widget_show(menuitem);
|
|
|
|
gtk_menu_append(GTK_MENU(menu), menuitem);
|
2004-05-25 10:39:41 +02:00
|
|
|
g_signal_connect(G_OBJECT(menuitem), "activate",
|
|
|
|
G_CALLBACK(account_receive_menu_cb),
|
|
|
|
ac_prefs);
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-20 12:19:18 +01:00
|
|
|
static void main_window_set_toolbar_combo_receive_menu(MainWindow *mainwin,
|
|
|
|
GList *account_list)
|
|
|
|
{
|
2007-07-13 18:47:36 +02:00
|
|
|
GList *cur_ac;
|
2005-12-20 12:19:18 +01:00
|
|
|
GtkWidget *menuitem;
|
|
|
|
PrefsAccount *ac_prefs;
|
|
|
|
GtkWidget *menu = NULL;
|
|
|
|
|
2007-07-13 18:47:36 +02:00
|
|
|
if (mainwin->toolbar->getall_btn == NULL) /* button doesn't exist */
|
2005-12-20 12:19:18 +01:00
|
|
|
return;
|
|
|
|
|
2007-07-13 18:47:36 +02:00
|
|
|
menu = gtk_menu_tool_button_get_menu(GTK_MENU_TOOL_BUTTON(mainwin->toolbar->getall_btn));
|
|
|
|
if (menu)
|
|
|
|
gtk_widget_destroy(menu);
|
|
|
|
menu = gtk_menu_new();
|
2005-12-20 12:19:18 +01:00
|
|
|
|
|
|
|
for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
|
|
|
|
ac_prefs = (PrefsAccount *)cur_ac->data;
|
|
|
|
|
2008-05-21 08:42:15 +02:00
|
|
|
if (ac_prefs->protocol == A_NONE)
|
|
|
|
continue;
|
|
|
|
|
2005-12-20 12:19:18 +01:00
|
|
|
menuitem = gtk_menu_item_new_with_label
|
|
|
|
(ac_prefs->account_name
|
|
|
|
? ac_prefs->account_name : _("Untitled"));
|
|
|
|
gtk_widget_show(menuitem);
|
|
|
|
gtk_menu_append(GTK_MENU(menu), menuitem);
|
|
|
|
g_signal_connect(G_OBJECT(menuitem), "activate",
|
|
|
|
G_CALLBACK(account_receive_menu_cb),
|
|
|
|
ac_prefs);
|
|
|
|
}
|
2007-07-13 18:47:36 +02:00
|
|
|
gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(mainwin->toolbar->getall_btn), menu);
|
2005-12-20 12:19:18 +01:00
|
|
|
}
|
|
|
|
|
2006-05-12 19:42:48 +02:00
|
|
|
static void main_window_set_toolbar_combo_compose_menu(MainWindow *mainwin,
|
|
|
|
GList *account_list)
|
|
|
|
{
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-07-13 18:47:36 +02:00
|
|
|
GList *cur_ac;
|
2006-05-12 19:42:48 +02:00
|
|
|
GtkWidget *menuitem;
|
|
|
|
PrefsAccount *ac_prefs;
|
|
|
|
GtkWidget *menu = NULL;
|
|
|
|
|
2007-07-13 18:47:36 +02:00
|
|
|
if (mainwin->toolbar->compose_mail_btn == NULL) /* button doesn't exist */
|
2006-05-12 19:42:48 +02:00
|
|
|
return;
|
|
|
|
|
2007-07-13 18:47:36 +02:00
|
|
|
menu = gtk_menu_tool_button_get_menu(GTK_MENU_TOOL_BUTTON(mainwin->toolbar->compose_mail_btn));
|
|
|
|
if (menu)
|
|
|
|
gtk_widget_destroy(menu);
|
|
|
|
menu = gtk_menu_new();
|
|
|
|
|
|
|
|
for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
|
|
|
|
ac_prefs = (PrefsAccount *)cur_ac->data;
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2007-07-13 18:47:36 +02:00
|
|
|
menuitem = gtk_menu_item_new_with_label
|
|
|
|
(ac_prefs->account_name
|
|
|
|
? ac_prefs->account_name : _("Untitled"));
|
|
|
|
gtk_widget_show(menuitem);
|
|
|
|
gtk_menu_append(GTK_MENU(menu), menuitem);
|
|
|
|
g_signal_connect(G_OBJECT(menuitem), "activate",
|
|
|
|
G_CALLBACK(account_compose_menu_cb),
|
|
|
|
ac_prefs);
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
2007-07-13 18:47:36 +02:00
|
|
|
gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(mainwin->toolbar->compose_mail_btn), menu);
|
|
|
|
#endif
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
void main_window_set_account_menu(GList *account_list)
|
|
|
|
{
|
|
|
|
GList *cur;
|
|
|
|
MainWindow *mainwin;
|
|
|
|
|
|
|
|
for (cur = mainwin_list; cur != NULL; cur = cur->next) {
|
|
|
|
mainwin = (MainWindow *)cur->data;
|
|
|
|
main_window_set_account_selector_menu(mainwin, account_list);
|
|
|
|
main_window_set_account_receive_menu(mainwin, account_list);
|
2005-12-20 12:19:18 +01:00
|
|
|
main_window_set_toolbar_combo_receive_menu(mainwin, account_list);
|
2006-05-12 19:42:48 +02:00
|
|
|
main_window_set_toolbar_combo_compose_menu(mainwin, account_list);
|
2005-12-20 12:19:18 +01:00
|
|
|
}
|
2006-11-09 19:09:10 +01:00
|
|
|
hooks_invoke(ACCOUNT_LIST_CHANGED_HOOKLIST, NULL);
|
2005-12-20 12:19:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void main_window_set_account_menu_only_toolbar(GList *account_list)
|
|
|
|
{
|
|
|
|
GList *cur;
|
|
|
|
MainWindow *mainwin;
|
|
|
|
|
|
|
|
for (cur = mainwin_list; cur != NULL; cur = cur->next) {
|
|
|
|
mainwin = (MainWindow *)cur->data;
|
|
|
|
main_window_set_toolbar_combo_receive_menu(mainwin, account_list);
|
2006-05-12 19:42:48 +02:00
|
|
|
main_window_set_toolbar_combo_compose_menu(mainwin, account_list);
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void main_window_show_cur_account(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
gchar *buf;
|
|
|
|
gchar *ac_name;
|
|
|
|
|
|
|
|
ac_name = g_strdup(cur_account
|
|
|
|
? (cur_account->account_name
|
|
|
|
? cur_account->account_name : _("Untitled"))
|
|
|
|
: _("none"));
|
|
|
|
|
|
|
|
if (cur_account)
|
|
|
|
buf = g_strdup_printf("%s - %s", ac_name, PROG_VERSION);
|
|
|
|
else
|
|
|
|
buf = g_strdup(PROG_VERSION);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(mainwin->window), buf);
|
|
|
|
g_free(buf);
|
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
if (mainwin->ac_label)
|
|
|
|
gtk_label_set_text(GTK_LABEL(mainwin->ac_label), ac_name);
|
2007-07-25 18:37:48 +02:00
|
|
|
if (mainwin->ac_button)
|
|
|
|
gtk_widget_queue_resize(mainwin->ac_button);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
g_free(ac_name);
|
|
|
|
}
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-01-19 19:16:09 +01:00
|
|
|
static void main_window_separation_change(MainWindow *mainwin, LayoutType layout_mode)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
|
|
|
GtkWidget *folder_wid = GTK_WIDGET_PTR(mainwin->folderview);
|
|
|
|
GtkWidget *summary_wid = GTK_WIDGET_PTR(mainwin->summaryview);
|
2002-11-28 23:56:41 +01:00
|
|
|
GtkWidget *message_wid = mainwin->messageview->vbox;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
if (layout_mode == prefs_common.layout_mode)
|
|
|
|
return;
|
2002-05-18 17:22:17 +02:00
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
debug_print("Changing window separation type from %d to %d\n",
|
|
|
|
prefs_common.layout_mode, layout_mode);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
/* remove widgets from those containers */
|
|
|
|
gtk_widget_ref(folder_wid);
|
|
|
|
gtk_widget_ref(summary_wid);
|
|
|
|
gtk_widget_ref(message_wid);
|
2001-12-11 10:18:29 +01:00
|
|
|
gtkut_container_remove
|
2001-04-19 14:21:46 +02:00
|
|
|
(GTK_CONTAINER(folder_wid->parent), folder_wid);
|
2001-12-11 10:18:29 +01:00
|
|
|
gtkut_container_remove
|
2001-04-19 14:21:46 +02:00
|
|
|
(GTK_CONTAINER(summary_wid->parent), summary_wid);
|
2001-12-11 10:18:29 +01:00
|
|
|
gtkut_container_remove
|
2001-04-19 14:21:46 +02:00
|
|
|
(GTK_CONTAINER(message_wid->parent), message_wid);
|
|
|
|
|
|
|
|
gtk_widget_hide(mainwin->window);
|
2007-01-19 19:16:09 +01:00
|
|
|
main_window_set_widgets(mainwin, layout_mode);
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_show(mainwin->window);
|
|
|
|
|
|
|
|
gtk_widget_unref(folder_wid);
|
|
|
|
gtk_widget_unref(summary_wid);
|
|
|
|
gtk_widget_unref(message_wid);
|
|
|
|
}
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2007-03-21 18:44:45 +01:00
|
|
|
void mainwindow_reset_paned(GtkPaned *paned)
|
2007-01-19 19:16:09 +01:00
|
|
|
{
|
|
|
|
gint min, max, mid;
|
2007-03-21 18:44:45 +01:00
|
|
|
|
|
|
|
if (gtk_paned_get_child1(GTK_PANED(paned)))
|
|
|
|
gtk_widget_show(gtk_paned_get_child1(GTK_PANED(paned)));
|
|
|
|
if (gtk_paned_get_child2(GTK_PANED(paned)))
|
|
|
|
gtk_widget_show(gtk_paned_get_child2(GTK_PANED(paned)));
|
|
|
|
|
|
|
|
GTK_EVENTS_FLUSH();
|
2007-01-19 19:16:09 +01:00
|
|
|
g_object_get (G_OBJECT(paned),
|
|
|
|
"min-position",
|
|
|
|
&min, NULL);
|
|
|
|
g_object_get (G_OBJECT(paned),
|
|
|
|
"max-position",
|
|
|
|
&max, NULL);
|
|
|
|
mid = (min+max)/2;
|
|
|
|
gtk_paned_set_position(GTK_PANED(paned), mid);
|
|
|
|
}
|
|
|
|
|
2007-03-21 18:44:45 +01:00
|
|
|
static void mainwin_paned_show_first(GtkPaned *paned)
|
|
|
|
{
|
|
|
|
gint max;
|
|
|
|
g_object_get (G_OBJECT(paned),
|
|
|
|
"max-position",
|
|
|
|
&max, NULL);
|
|
|
|
|
|
|
|
if (gtk_paned_get_child1(GTK_PANED(paned)))
|
|
|
|
gtk_widget_show(gtk_paned_get_child1(GTK_PANED(paned)));
|
|
|
|
if (gtk_paned_get_child2(GTK_PANED(paned)))
|
|
|
|
gtk_widget_hide(gtk_paned_get_child2(GTK_PANED(paned)));
|
|
|
|
gtk_paned_set_position(GTK_PANED(paned), max);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mainwin_paned_show_last(GtkPaned *paned)
|
|
|
|
{
|
|
|
|
gint min;
|
|
|
|
g_object_get (G_OBJECT(paned),
|
|
|
|
"min-position",
|
|
|
|
&min, NULL);
|
|
|
|
|
|
|
|
if (gtk_paned_get_child1(GTK_PANED(paned)))
|
|
|
|
gtk_widget_hide(gtk_paned_get_child1(GTK_PANED(paned)));
|
|
|
|
if (gtk_paned_get_child2(GTK_PANED(paned)))
|
|
|
|
gtk_widget_show(gtk_paned_get_child2(GTK_PANED(paned)));
|
|
|
|
gtk_paned_set_position(GTK_PANED(paned), min);
|
|
|
|
}
|
|
|
|
|
2002-06-11 23:46:03 +02:00
|
|
|
void main_window_toggle_message_view(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
SummaryView *summaryview = mainwin->summaryview;
|
2007-01-19 19:16:09 +01:00
|
|
|
GtkWidget *ppaned = NULL;
|
2002-06-11 23:46:03 +02:00
|
|
|
GtkWidget *container = NULL;
|
2007-01-19 19:16:09 +01:00
|
|
|
|
2007-01-20 12:29:48 +01:00
|
|
|
switch (prefs_common.layout_mode) {
|
|
|
|
case NORMAL_LAYOUT:
|
|
|
|
case VERTICAL_LAYOUT:
|
2007-03-22 08:52:47 +01:00
|
|
|
case SMALL_LAYOUT:
|
2007-01-19 19:16:09 +01:00
|
|
|
ppaned = mainwin->vpaned;
|
|
|
|
container = mainwin->hpaned;
|
|
|
|
if (ppaned->parent != NULL) {
|
2002-06-11 23:46:03 +02:00
|
|
|
mainwin->messageview->visible = FALSE;
|
|
|
|
summaryview->displayed = NULL;
|
2007-01-19 19:16:09 +01:00
|
|
|
gtk_widget_ref(ppaned);
|
|
|
|
gtkut_container_remove(GTK_CONTAINER(container), ppaned);
|
|
|
|
gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), container);
|
2002-06-11 23:46:03 +02:00
|
|
|
} else {
|
|
|
|
mainwin->messageview->visible = TRUE;
|
2007-01-19 19:16:09 +01:00
|
|
|
gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), ppaned);
|
|
|
|
gtk_container_add(GTK_CONTAINER(container), ppaned);
|
|
|
|
gtk_widget_unref(ppaned);
|
2002-06-11 23:46:03 +02:00
|
|
|
}
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
|
|
|
case WIDE_LAYOUT:
|
2007-01-19 19:16:09 +01:00
|
|
|
ppaned = mainwin->hpaned;
|
|
|
|
container = mainwin->vpaned;
|
|
|
|
if (mainwin->messageview->vbox->parent != NULL) {
|
|
|
|
mainwin->messageview->visible = FALSE;
|
|
|
|
summaryview->displayed = NULL;
|
|
|
|
gtk_widget_ref(mainwin->messageview->vbox);
|
|
|
|
gtkut_container_remove(GTK_CONTAINER(container), mainwin->messageview->vbox);
|
|
|
|
} else {
|
|
|
|
mainwin->messageview->visible = TRUE;
|
|
|
|
gtk_container_add(GTK_CONTAINER(container), mainwin->messageview->vbox);
|
|
|
|
gtk_widget_unref(mainwin->messageview->vbox);
|
|
|
|
}
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
|
|
|
case WIDE_MSGLIST_LAYOUT:
|
|
|
|
g_warning("can't hide messageview in this wide msglist layout");
|
|
|
|
break;
|
2002-06-11 23:46:03 +02:00
|
|
|
}
|
|
|
|
|
2005-03-30 14:01:26 +02:00
|
|
|
if (messageview_is_visible(mainwin->messageview))
|
|
|
|
gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
|
|
|
|
GTK_ARROW_DOWN, GTK_SHADOW_OUT);
|
|
|
|
else
|
|
|
|
gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
|
|
|
|
GTK_ARROW_UP, GTK_SHADOW_OUT);
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
if (mainwin->messageview->visible == FALSE)
|
|
|
|
messageview_clear(mainwin->messageview);
|
|
|
|
|
2002-06-11 23:46:03 +02:00
|
|
|
main_window_set_menu_sensitive(mainwin);
|
|
|
|
|
2003-08-21 10:45:43 +02:00
|
|
|
prefs_common.msgview_visible = mainwin->messageview->visible;
|
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
if (messageview_is_visible(mainwin->messageview)) {
|
|
|
|
gtk_widget_queue_resize(mainwin->hpaned);
|
|
|
|
gtk_widget_queue_resize(mainwin->vpaned);
|
|
|
|
}
|
2006-09-28 21:10:14 +02:00
|
|
|
summary_grab_focus(summaryview);
|
2008-03-16 15:17:25 +01:00
|
|
|
if (!summary_is_list(summaryview)) {
|
|
|
|
summary_show(summaryview, summaryview->folder_item);
|
|
|
|
}
|
2002-06-11 23:46:03 +02:00
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
void main_window_get_size(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
GtkAllocation *allocation;
|
|
|
|
|
2006-02-13 18:04:54 +01:00
|
|
|
if (mainwin_list == NULL || mainwin->messageview == NULL) {
|
2005-02-10 10:50:19 +01:00
|
|
|
debug_print("called after messageview "
|
|
|
|
"has been deallocated!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation);
|
|
|
|
|
2003-08-21 10:45:43 +02:00
|
|
|
if (allocation->width > 1 && allocation->height > 1) {
|
|
|
|
prefs_common.summaryview_width = allocation->width;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
if (messageview_is_visible(mainwin->messageview))
|
2003-08-21 10:45:43 +02:00
|
|
|
prefs_common.summaryview_height = allocation->height;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2003-08-21 10:45:43 +02:00
|
|
|
prefs_common.mainview_width = allocation->width;
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
allocation = &mainwin->window->allocation;
|
2007-12-27 20:26:13 +01:00
|
|
|
if (allocation->width > 1 && allocation->height > 1 &&
|
|
|
|
!prefs_common.mainwin_maximised) {
|
2003-08-21 10:45:43 +02:00
|
|
|
prefs_common.mainview_height = allocation->height;
|
|
|
|
prefs_common.mainwin_width = allocation->width;
|
|
|
|
prefs_common.mainwin_height = allocation->height;
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
allocation = &(GTK_WIDGET_PTR(mainwin->folderview)->allocation);
|
2003-08-21 10:45:43 +02:00
|
|
|
if (allocation->width > 1 && allocation->height > 1) {
|
|
|
|
prefs_common.folderview_width = allocation->width;
|
|
|
|
prefs_common.folderview_height = allocation->height;
|
|
|
|
}
|
2003-08-09 08:26:27 +02:00
|
|
|
|
|
|
|
allocation = &(GTK_WIDGET_PTR(mainwin->messageview)->allocation);
|
2003-08-21 10:45:43 +02:00
|
|
|
if (allocation->width > 1 && allocation->height > 1) {
|
|
|
|
prefs_common.msgview_width = allocation->width;
|
|
|
|
prefs_common.msgview_height = allocation->height;
|
|
|
|
}
|
|
|
|
|
2004-07-16 13:12:46 +02:00
|
|
|
/* debug_print("summaryview size: %d x %d\n",
|
2003-08-21 10:45:43 +02:00
|
|
|
prefs_common.summaryview_width,
|
|
|
|
prefs_common.summaryview_height);
|
|
|
|
debug_print("folderview size: %d x %d\n",
|
|
|
|
prefs_common.folderview_width,
|
|
|
|
prefs_common.folderview_height);
|
|
|
|
debug_print("messageview size: %d x %d\n",
|
|
|
|
prefs_common.msgview_width,
|
2004-07-16 13:12:46 +02:00
|
|
|
prefs_common.msgview_height); */
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void main_window_get_position(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
gint x, y;
|
|
|
|
|
2007-12-27 20:26:13 +01:00
|
|
|
if (prefs_common.mainwin_maximised)
|
|
|
|
return;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
gtkut_widget_get_uposition(mainwin->window, &x, &y);
|
|
|
|
|
|
|
|
prefs_common.mainview_x = x;
|
|
|
|
prefs_common.mainview_y = y;
|
|
|
|
prefs_common.mainwin_x = x;
|
|
|
|
prefs_common.mainwin_y = y;
|
|
|
|
|
2003-08-21 10:45:43 +02:00
|
|
|
debug_print("main window position: %d, %d\n", x, y);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
void main_window_progress_on(MainWindow *mainwin)
|
|
|
|
{
|
2004-07-28 15:44:01 +02:00
|
|
|
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), "");
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void main_window_progress_off(MainWindow *mainwin)
|
|
|
|
{
|
2004-07-28 15:44:01 +02:00
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mainwin->progressbar), 0.0);
|
|
|
|
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), "");
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
|
|
|
|
2008-05-19 18:38:58 +02:00
|
|
|
static gboolean main_window_empty_trash(MainWindow *mainwin, gboolean confirm, gboolean for_quit)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2007-02-09 15:52:37 +01:00
|
|
|
if (confirm && procmsg_have_trashed_mails_fast()) {
|
2008-05-19 18:38:58 +02:00
|
|
|
AlertValue val;
|
|
|
|
|
|
|
|
if (for_quit)
|
|
|
|
val = alertpanel(_("Empty trash"),
|
2005-08-10 08:20:49 +02:00
|
|
|
_("Delete all messages in trash folders?"),
|
2008-05-14 22:45:55 +02:00
|
|
|
GTK_STOCK_NO, "+" GTK_STOCK_YES, _("Don't quit"));
|
2008-05-19 18:38:58 +02:00
|
|
|
else
|
|
|
|
val = alertpanel(_("Empty trash"),
|
|
|
|
_("Delete all messages in trash folders?"),
|
|
|
|
GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
|
2008-05-14 22:45:55 +02:00
|
|
|
if (val == G_ALERTALTERNATE) {
|
|
|
|
debug_print("will empty trash\n");
|
|
|
|
} else if (val == G_ALERTDEFAULT) {
|
|
|
|
debug_print("will not empty trash\n");
|
|
|
|
return TRUE;
|
|
|
|
} else {
|
|
|
|
return FALSE; /* cancel exit */
|
|
|
|
}
|
2001-04-27 22:27:24 +02:00
|
|
|
manage_window_focus_in(mainwin->window, NULL, NULL);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2004-11-12 07:41:50 +01:00
|
|
|
procmsg_empty_all_trash();
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
if (mainwin->summaryview->folder_item &&
|
|
|
|
mainwin->summaryview->folder_item->stype == F_TRASH)
|
|
|
|
gtk_widget_grab_focus(mainwin->folderview->ctree);
|
2008-05-14 22:45:55 +02:00
|
|
|
return TRUE;
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2007-10-13 10:57:29 +02:00
|
|
|
static void main_window_add_mailbox(MainWindow *mainwin)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
|
|
|
gchar *path;
|
|
|
|
Folder *folder;
|
|
|
|
|
|
|
|
path = input_dialog(_("Add mailbox"),
|
|
|
|
_("Input the location of mailbox.\n"
|
2007-04-29 23:29:10 +02:00
|
|
|
"If an existing mailbox is specified, it will be\n"
|
2001-04-19 14:21:46 +02:00
|
|
|
"scanned automatically."),
|
|
|
|
"Mail");
|
|
|
|
if (!path) return;
|
|
|
|
if (folder_find_from_path(path)) {
|
2005-07-17 09:30:07 +02:00
|
|
|
alertpanel_error(_("The mailbox '%s' already exists."), path);
|
2001-04-19 14:21:46 +02:00
|
|
|
g_free(path);
|
|
|
|
return;
|
|
|
|
}
|
2003-03-13 16:31:22 +01:00
|
|
|
folder = folder_new(folder_get_class_from_string("mh"),
|
2004-11-13 14:28:35 +01:00
|
|
|
!strcmp(path, "Mail") ? _("Mailbox") :
|
|
|
|
g_path_get_basename(path), path);
|
2001-04-19 14:21:46 +02:00
|
|
|
g_free(path);
|
|
|
|
|
2003-04-05 22:38:53 +02:00
|
|
|
if (folder->klass->create_tree(folder) < 0) {
|
2001-04-19 14:21:46 +02:00
|
|
|
alertpanel_error(_("Creation of the mailbox failed.\n"
|
|
|
|
"Maybe some files already exist, or you don't have the permission to write there."));
|
|
|
|
folder_destroy(folder);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
folder_add(folder);
|
|
|
|
folder_set_ui_func(folder, scan_tree_func, mainwin);
|
2005-10-05 21:26:02 +02:00
|
|
|
folder_scan_tree(folder, TRUE);
|
2001-04-19 14:21:46 +02:00
|
|
|
folder_set_ui_func(folder, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2002-08-06 16:22:44 +02:00
|
|
|
SensitiveCond main_window_get_current_state(MainWindow *mainwin)
|
2001-08-24 13:19:44 +02:00
|
|
|
{
|
|
|
|
SensitiveCond state = 0;
|
|
|
|
SummarySelection selection;
|
2001-10-22 10:42:36 +02:00
|
|
|
FolderItem *item = mainwin->summaryview->folder_item;
|
2001-12-07 20:53:31 +01:00
|
|
|
GList *account_list = account_get_list();
|
2007-07-02 18:35:40 +02:00
|
|
|
GSList *tmp;
|
2001-12-07 20:53:31 +01:00
|
|
|
|
2001-08-24 13:19:44 +02:00
|
|
|
selection = summary_get_selection_type(mainwin->summaryview);
|
|
|
|
|
2007-09-16 11:54:07 +02:00
|
|
|
if (mainwin->lock_count == 0 && !claws_is_starting())
|
2001-08-24 13:19:44 +02:00
|
|
|
state |= M_UNLOCKED;
|
|
|
|
if (selection != SUMMARY_NONE)
|
|
|
|
state |= M_MSG_EXIST;
|
2004-02-21 12:01:01 +01:00
|
|
|
if (item && item->path && folder_item_parent(item) && !item->no_select) {
|
2002-02-05 14:27:32 +01:00
|
|
|
state |= M_EXEC;
|
2002-03-01 21:27:37 +01:00
|
|
|
/* if (item->folder->type != F_NEWS) */
|
|
|
|
state |= M_ALLOW_DELETE;
|
2002-02-01 16:19:21 +01:00
|
|
|
|
2002-08-23 12:40:16 +02:00
|
|
|
if (prefs_common.immediate_exec == 0
|
|
|
|
&& mainwin->lock_count == 0)
|
|
|
|
state |= M_DELAY_EXEC;
|
|
|
|
|
2002-07-02 21:49:11 +02:00
|
|
|
if ((selection == SUMMARY_NONE && item->hide_read_msgs)
|
2002-02-01 16:19:21 +01:00
|
|
|
|| selection != SUMMARY_NONE)
|
2006-08-11 18:58:44 +02:00
|
|
|
state |= M_HIDE_READ_MSG;
|
2001-09-22 15:24:51 +02:00
|
|
|
}
|
2002-08-21 15:11:35 +02:00
|
|
|
if (mainwin->summaryview->threaded)
|
|
|
|
state |= M_THREADED;
|
|
|
|
else
|
|
|
|
state |= M_UNTHREADED;
|
2001-08-24 13:19:44 +02:00
|
|
|
if (selection == SUMMARY_SELECTED_SINGLE ||
|
|
|
|
selection == SUMMARY_SELECTED_MULTIPLE)
|
|
|
|
state |= M_TARGET_EXIST;
|
|
|
|
if (selection == SUMMARY_SELECTED_SINGLE)
|
|
|
|
state |= M_SINGLE_TARGET_EXIST;
|
2001-09-26 12:34:08 +02:00
|
|
|
if (mainwin->summaryview->folder_item &&
|
2003-04-05 22:38:53 +02:00
|
|
|
mainwin->summaryview->folder_item->folder->klass->type == F_NEWS)
|
2001-09-26 12:34:08 +02:00
|
|
|
state |= M_NEWS;
|
2002-08-27 00:53:35 +02:00
|
|
|
else
|
|
|
|
state |= M_NOT_NEWS;
|
2006-08-09 22:26:28 +02:00
|
|
|
if (prefs_common.actions_list && g_slist_length(prefs_common.actions_list))
|
|
|
|
state |= M_ACTIONS_EXIST;
|
|
|
|
|
2007-07-02 18:35:40 +02:00
|
|
|
tmp = tags_get_list();
|
|
|
|
if (tmp && g_slist_length(tmp))
|
|
|
|
state |= M_TAGS_EXIST;
|
|
|
|
g_slist_free(tmp);
|
|
|
|
|
2006-08-11 18:58:44 +02:00
|
|
|
if (procmsg_have_queued_mails_fast() && !procmsg_is_sending())
|
|
|
|
state |= M_HAVE_QUEUED_MAILS;
|
|
|
|
|
2001-08-24 13:19:44 +02:00
|
|
|
if (selection == SUMMARY_SELECTED_SINGLE &&
|
2001-10-22 10:42:36 +02:00
|
|
|
(item &&
|
2005-08-07 15:39:27 +02:00
|
|
|
(folder_has_parent_of_type(item, F_DRAFT) ||
|
|
|
|
folder_has_parent_of_type(item, F_OUTBOX) ||
|
|
|
|
folder_has_parent_of_type(item, F_QUEUE))))
|
2001-08-24 13:19:44 +02:00
|
|
|
state |= M_ALLOW_REEDIT;
|
|
|
|
if (cur_account)
|
|
|
|
state |= M_HAVE_ACCOUNT;
|
2001-12-07 20:53:31 +01:00
|
|
|
|
2007-01-06 18:57:16 +01:00
|
|
|
if (any_folder_want_synchronise())
|
|
|
|
state |= M_WANT_SYNC;
|
|
|
|
|
2007-08-02 10:33:19 +02:00
|
|
|
if (item && item->prefs->processing && selection != SUMMARY_NONE)
|
|
|
|
state |= M_HAVE_PROCESSING;
|
|
|
|
|
2008-07-05 23:19:43 +02:00
|
|
|
if (g_list_length(account_list) > 1)
|
|
|
|
state |= M_HAVE_MULTI_ACCOUNT;
|
|
|
|
|
2001-12-07 20:53:31 +01:00
|
|
|
for ( ; account_list != NULL; account_list = account_list->next) {
|
|
|
|
if (((PrefsAccount*)account_list->data)->protocol == A_NNTP) {
|
|
|
|
state |= M_HAVE_NEWS_ACCOUNT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-02-24 18:48:13 +01:00
|
|
|
|
2007-01-18 08:25:09 +01:00
|
|
|
if (procmsg_spam_can_learn() &&
|
|
|
|
(mainwin->summaryview->folder_item &&
|
|
|
|
mainwin->summaryview->folder_item->folder->klass->type != F_UNKNOWN &&
|
|
|
|
mainwin->summaryview->folder_item->folder->klass->type != F_NEWS)) {
|
2006-02-24 18:48:13 +01:00
|
|
|
state |= M_CAN_LEARN_SPAM;
|
|
|
|
}
|
2001-08-24 13:19:44 +02:00
|
|
|
|
2008-07-20 09:32:37 +02:00
|
|
|
if (mainwin->summaryview->folder_item) {
|
|
|
|
state |= M_FOLDER_SELECTED;
|
|
|
|
}
|
|
|
|
|
2002-03-07 14:22:39 +01:00
|
|
|
if (inc_is_active())
|
|
|
|
state |= M_INC_ACTIVE;
|
2007-04-26 12:05:41 +02:00
|
|
|
if (imap_cancel_all_enabled())
|
|
|
|
state |= M_INC_ACTIVE;
|
2002-03-07 14:22:39 +01:00
|
|
|
|
2005-10-05 11:48:57 +02:00
|
|
|
if (mainwin->summaryview->deleted > 0 ||
|
|
|
|
mainwin->summaryview->moved > 0 ||
|
|
|
|
mainwin->summaryview->copied > 0)
|
|
|
|
state |= M_DELAY_EXEC;
|
2005-09-09 18:49:10 +02:00
|
|
|
|
2008-03-06 18:38:45 +01:00
|
|
|
if (summary_is_list(mainwin->summaryview))
|
|
|
|
state |= M_SUMMARY_ISLIST;
|
|
|
|
|
2008-06-03 20:27:47 +02:00
|
|
|
if (prefs_common.layout_mode != SMALL_LAYOUT || mainwin->in_folder)
|
|
|
|
state |= M_IN_MSGLIST;
|
|
|
|
|
2001-08-24 13:19:44 +02:00
|
|
|
return state;
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2002-05-15 09:47:34 +02:00
|
|
|
|
2001-08-22 12:58:38 +02:00
|
|
|
|
|
|
|
void main_window_set_menu_sensitive(MainWindow *mainwin)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2001-08-24 13:19:44 +02:00
|
|
|
SensitiveCond state;
|
2001-08-22 12:58:38 +02:00
|
|
|
gboolean sensitive;
|
2002-08-21 15:11:35 +02:00
|
|
|
SummaryView *summaryview;
|
2002-06-05 08:25:18 +02:00
|
|
|
gchar *menu_path;
|
2008-07-29 21:07:54 +02:00
|
|
|
GtkWidget *menu;
|
2004-02-21 12:01:01 +01:00
|
|
|
GList *cur_item;
|
2008-07-29 21:07:54 +02:00
|
|
|
gint i;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-08-22 12:58:38 +02:00
|
|
|
static const struct {
|
|
|
|
gchar *const entry;
|
2001-08-24 13:19:44 +02:00
|
|
|
SensitiveCond cond;
|
2001-08-22 12:58:38 +02:00
|
|
|
} entry[] = {
|
2008-07-29 21:07:54 +02:00
|
|
|
{"Menu/File/SaveAs", M_TARGET_EXIST},
|
|
|
|
{"Menu/File/Print" , M_TARGET_EXIST},
|
|
|
|
{"Menu/File/SynchroniseFolders", M_WANT_SYNC},
|
|
|
|
{"Menu/File/Exit" , M_UNLOCKED},
|
|
|
|
|
|
|
|
{"Menu/Edit/SelectThread" , M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Edit/DeleteThread" , M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Edit/Find", M_SINGLE_TARGET_EXIST},
|
|
|
|
{"Menu/Edit/QuickSearch", M_IN_MSGLIST},
|
|
|
|
|
|
|
|
{"Menu/View/SetColumns/Folderlist" , M_UNLOCKED|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/View/Sort" , M_EXEC|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/View/ThreadView" , M_EXEC|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/View/ExpandThreads" , M_MSG_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/View/CollapseThreads" , M_MSG_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/View/HideReadMessages" , M_HIDE_READ_MSG|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/View/Goto/Prev" , M_MSG_EXIST},
|
|
|
|
{"Menu/View/Goto/Next" , M_MSG_EXIST},
|
|
|
|
{"Menu/View/Goto/PrevUnread" , M_MSG_EXIST},
|
|
|
|
{"Menu/View/Goto/PrevNew" , M_MSG_EXIST},
|
|
|
|
{"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/AllHeaders" , M_SINGLE_TARGET_EXIST},
|
|
|
|
{"Menu/View/Quotes" , M_SINGLE_TARGET_EXIST},
|
|
|
|
|
|
|
|
{"Menu/Message/Receive/CurrentAccount"
|
2004-02-21 12:01:01 +01:00
|
|
|
, M_HAVE_ACCOUNT|M_UNLOCKED},
|
2008-07-29 21:07:54 +02:00
|
|
|
{"Menu/Message/Receive/AllAccounts"
|
2004-02-21 12:01:01 +01:00
|
|
|
, M_HAVE_ACCOUNT|M_UNLOCKED},
|
2008-07-29 21:07:54 +02:00
|
|
|
{"Menu/Message/Receive/CancelReceiving"
|
2004-02-21 12:01:01 +01:00
|
|
|
, M_INC_ACTIVE},
|
2008-07-29 21:07:54 +02:00
|
|
|
{"Menu/Message/SendQueue" , M_HAVE_ACCOUNT|M_HAVE_QUEUED_MAILS},
|
|
|
|
{"Menu/Message/ComposeEmail", M_HAVE_ACCOUNT},
|
|
|
|
{"Menu/Message/ComposeNews", M_HAVE_NEWS_ACCOUNT},
|
|
|
|
{"Menu/Message/Reply" , M_HAVE_ACCOUNT|M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Message/ReplyTo" , M_HAVE_ACCOUNT|M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Message/FollowupReply", M_HAVE_ACCOUNT|M_TARGET_EXIST|M_NEWS|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Message/Forward" , M_HAVE_ACCOUNT|M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Message/ForwardAtt" , M_HAVE_ACCOUNT|M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Message/Redirect" , M_HAVE_ACCOUNT|M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Message/Move" , M_TARGET_EXIST|M_ALLOW_DELETE},
|
|
|
|
{"Menu/Message/Copy" , M_TARGET_EXIST|M_EXEC},
|
|
|
|
{"Menu/Message/Trash" , M_TARGET_EXIST|M_ALLOW_DELETE|M_NOT_NEWS},
|
|
|
|
{"Menu/Message/Delete" , M_TARGET_EXIST|M_ALLOW_DELETE},
|
|
|
|
{"Menu/Message/CancelNews" , M_TARGET_EXIST|M_ALLOW_DELETE|M_NEWS},
|
|
|
|
{"Menu/Message/Mark" , M_TARGET_EXIST|M_SUMMARY_ISLIST},
|
|
|
|
{"Menu/Message/Mark/MarkSpam" , M_TARGET_EXIST|M_CAN_LEARN_SPAM},
|
|
|
|
{"Menu/Message/Mark/MarkHam" , M_TARGET_EXIST|M_CAN_LEARN_SPAM},
|
|
|
|
{"Menu/Message/Mark/IgnoreThread" , M_TARGET_EXIST},
|
|
|
|
{"Menu/Message/Mark/UnignoreThread" , M_TARGET_EXIST},
|
|
|
|
{"Menu/Message/Mark/Lock" , M_TARGET_EXIST},
|
|
|
|
{"Menu/Message/Mark/Unlock" , M_TARGET_EXIST},
|
|
|
|
{"Menu/Message/ColorLabel" , M_TARGET_EXIST},
|
|
|
|
{"Menu/Message/Tags" , M_TARGET_EXIST},
|
|
|
|
{"Menu/Message/Reedit" , M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
|
|
|
|
|
|
|
|
{"Menu/Tools/AddSenderToAB" , M_SINGLE_TARGET_EXIST},
|
|
|
|
{"Menu/Tools/CollectAddresses" , M_FOLDER_SELECTED},
|
|
|
|
{"Menu/Tools/CollectAddresses/FromFolder"
|
2008-07-20 09:32:37 +02:00
|
|
|
, M_FOLDER_SELECTED},
|
2008-07-29 21:07:54 +02:00
|
|
|
{"Menu/Tools/CollectAddresses/FromSelected"
|
2006-02-02 09:45:41 +01:00
|
|
|
, M_TARGET_EXIST},
|
2008-07-29 21:07:54 +02:00
|
|
|
{"Menu/Tools/FilterFolder", M_MSG_EXIST|M_EXEC},
|
|
|
|
{"Menu/Tools/FilterSelected" , M_TARGET_EXIST|M_EXEC},
|
|
|
|
{"Menu/Tools/RunProcessing" , M_HAVE_PROCESSING},
|
|
|
|
{"Menu/Tools/CreateFilterRule" , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
|
|
|
|
{"Menu/Tools/CreateProcessingRule" , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
|
|
|
|
{"Menu/Tools/ListUrls" , M_TARGET_EXIST},
|
|
|
|
{"Menu/Tools/Actions" , M_TARGET_EXIST|M_ACTIONS_EXIST},
|
|
|
|
{"Menu/Tools/Execute" , M_DELAY_EXEC},
|
|
|
|
{"Menu/Tools/DeleteDuplicates/SelFolder" , M_MSG_EXIST|M_ALLOW_DELETE},
|
|
|
|
|
|
|
|
{"Menu/Configuration", M_UNLOCKED},
|
|
|
|
{"Menu/Configuration/ChangeAccount", M_HAVE_MULTI_ACCOUNT},
|
|
|
|
{"Menu/Configuration/AccountPrefs", M_UNLOCKED},
|
|
|
|
{"Menu/Configuration/CreateAccount", M_UNLOCKED},
|
|
|
|
{"Menu/Configuration/EditAccounts", M_UNLOCKED},
|
2001-08-22 12:58:38 +02:00
|
|
|
|
|
|
|
{NULL, 0}
|
|
|
|
};
|
2002-01-06 13:21:36 +01:00
|
|
|
|
2001-12-09 15:01:54 +01:00
|
|
|
state = main_window_get_current_state(mainwin);
|
2001-08-22 12:58:38 +02:00
|
|
|
|
|
|
|
for (i = 0; entry[i].entry != NULL; i++) {
|
|
|
|
sensitive = ((entry[i].cond & state) == entry[i].cond);
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, entry[i].entry, sensitive);
|
2001-08-22 12:58:38 +02:00
|
|
|
}
|
2002-02-14 16:28:02 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(
|
|
|
|
gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive")));
|
2004-02-21 12:01:01 +01:00
|
|
|
|
|
|
|
for (cur_item = GTK_MENU_SHELL(menu)->children; cur_item != NULL;
|
|
|
|
cur_item = cur_item->next) {
|
2008-07-29 21:07:54 +02:00
|
|
|
if (cur_item->data == gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/Receive/Separator1")) {
|
2004-02-21 12:01:01 +01:00
|
|
|
cur_item = cur_item->next;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (; cur_item != NULL; cur_item = cur_item->next) {
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(cur_item->data),
|
|
|
|
(M_UNLOCKED & state) != 0);
|
|
|
|
}
|
|
|
|
|
2002-02-14 16:28:02 +01:00
|
|
|
main_window_menu_callback_block(mainwin);
|
2002-06-05 08:25:18 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView",
|
2002-06-11 23:46:03 +02:00
|
|
|
messageview_is_visible(mainwin->messageview));
|
|
|
|
|
2002-08-21 15:11:35 +02:00
|
|
|
summaryview = mainwin->summaryview;
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/DontSort";
|
2002-08-21 15:11:35 +02:00
|
|
|
|
|
|
|
switch (summaryview->sort_key) {
|
|
|
|
case SORT_BY_NUMBER:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Number"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_SIZE:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Size"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_DATE:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Date"; break;
|
2007-07-02 20:15:53 +02:00
|
|
|
case SORT_BY_THREAD_DATE:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/ThreadDate"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_FROM:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/From"; break;
|
2002-12-26 01:40:41 +01:00
|
|
|
case SORT_BY_TO:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/To"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_SUBJECT:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Subject"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_LABEL:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Color"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_MARK:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Mark"; break;
|
2003-01-26 13:56:56 +01:00
|
|
|
case SORT_BY_STATUS:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Status"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_MIME:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Attachment"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_SCORE:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Score"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_LOCKED:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Locked"; break;
|
2007-07-02 20:15:53 +02:00
|
|
|
case SORT_BY_TAGS:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/Tag"; break;
|
2002-08-21 15:11:35 +02:00
|
|
|
case SORT_BY_NONE:
|
|
|
|
default:
|
2008-07-29 21:07:54 +02:00
|
|
|
menu_path = "Menu/View/Sort/DontSort"; break;
|
2002-06-05 08:25:18 +02:00
|
|
|
}
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, menu_path, TRUE);
|
2002-06-05 08:25:18 +02:00
|
|
|
|
2002-08-21 15:11:35 +02:00
|
|
|
if (summaryview->sort_type == SORT_ASCENDING) {
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Ascending", TRUE);
|
2002-06-05 08:25:18 +02:00
|
|
|
} else {
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Descending", TRUE);
|
2002-06-05 08:25:18 +02:00
|
|
|
}
|
|
|
|
|
2002-08-21 15:11:35 +02:00
|
|
|
if (summaryview->sort_key != SORT_BY_NONE) {
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Ascending", TRUE);
|
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Descending", TRUE);
|
2002-06-05 08:25:18 +02:00
|
|
|
} else {
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Ascending", FALSE);
|
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Descending", FALSE);
|
2002-06-05 08:25:18 +02:00
|
|
|
}
|
|
|
|
|
2006-01-09 19:17:30 +01:00
|
|
|
if (mainwin->messageview
|
|
|
|
&& mainwin->messageview->mimeview
|
|
|
|
&& mainwin->messageview->mimeview->textview)
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/AllHeaders",
|
2004-01-12 22:28:31 +01:00
|
|
|
mainwin->messageview->mimeview->textview->show_all_headers);
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/ThreadView", (state & M_THREADED) != 0);
|
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/FoldAll", (prefs_common.hide_quotes == 1));
|
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Fold2", (prefs_common.hide_quotes == 2));
|
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Fold3", (prefs_common.hide_quotes == 3));
|
2002-06-05 08:25:18 +02:00
|
|
|
|
2002-02-14 16:28:02 +01:00
|
|
|
main_window_menu_callback_unblock(mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2006-05-12 19:42:48 +02:00
|
|
|
void main_create_mailing_list_menu (MainWindow *mainwin, MsgInfo *msginfo)
|
|
|
|
{
|
|
|
|
gint is_menu = 0;
|
|
|
|
|
|
|
|
if (msginfo)
|
2008-07-29 21:07:54 +02:00
|
|
|
is_menu = mailing_list_create_submenu (mainwin, msginfo);
|
2006-05-12 19:42:48 +02:00
|
|
|
if (is_menu)
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList", TRUE);
|
2006-05-12 19:42:48 +02:00
|
|
|
else
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList", FALSE);
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static gint mailing_list_create_submenu (MainWindow *mainwin, MsgInfo *msginfo)
|
2006-05-12 19:42:48 +02:00
|
|
|
{
|
|
|
|
gint menu_nb = 0;
|
|
|
|
GtkWidget *menuitem;
|
2006-08-24 18:43:55 +02:00
|
|
|
|
|
|
|
if (!msginfo || !msginfo->extradata) {
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList/Post", FALSE);
|
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList/Help", FALSE);
|
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList/Subscribe", FALSE);
|
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList/Unsubscribe", FALSE);
|
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList/ViewArchive", FALSE);
|
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/MailingList/ContactOwner", FALSE);
|
2006-08-24 18:43:55 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-05-12 19:42:48 +02:00
|
|
|
/* Mailing list post */
|
2006-08-24 18:43:55 +02:00
|
|
|
if (!strcmp2 (msginfo->extradata->list_post, "NO")) {
|
|
|
|
g_free(msginfo->extradata->list_post);
|
|
|
|
msginfo->extradata->list_post = g_strdup (_("No posting allowed"));
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/MailingList/Post");
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2006-08-24 18:43:55 +02:00
|
|
|
menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_post);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
/* Mailing list help */
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/MailingList/Help");
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2006-08-24 18:43:55 +02:00
|
|
|
menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_help);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
/* Mailing list subscribe */
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/MailingList/Subscribe");
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2006-08-24 18:43:55 +02:00
|
|
|
menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_subscribe);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
/* Mailing list unsubscribe */
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/MailingList/Unsubscribe");
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2006-08-24 18:43:55 +02:00
|
|
|
menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_unsubscribe);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
/* Mailing list view archive */
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/MailingList/ViewArchive");
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2006-08-24 18:43:55 +02:00
|
|
|
menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_archive);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
/* Mailing list contact owner */
|
2008-07-29 21:07:54 +02:00
|
|
|
menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/Message/MailingList/ContactOwner");
|
2006-05-12 19:42:48 +02:00
|
|
|
|
2006-08-24 18:43:55 +02:00
|
|
|
menu_nb += mailing_list_populate_submenu (menuitem, msginfo->extradata->list_owner);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
return menu_nb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint mailing_list_populate_submenu (GtkWidget *menuitem, const gchar * list_header)
|
|
|
|
{
|
|
|
|
GtkWidget *item, *menu;
|
|
|
|
const gchar *url_pt ;
|
|
|
|
gchar url_decoded[BUFFSIZE];
|
|
|
|
GList *amenu, *alist;
|
|
|
|
gint menu_nb = 0;
|
|
|
|
|
|
|
|
menu = GTK_WIDGET(GTK_MENU_ITEM(menuitem)->submenu);
|
|
|
|
|
|
|
|
/* First delete old submenu */
|
|
|
|
/* FIXME: we can optimize this, and only change/add/delete necessary items */
|
|
|
|
for (amenu = (GTK_MENU_SHELL(menu)->children) ; amenu; ) {
|
|
|
|
alist = amenu->next;
|
|
|
|
item = GTK_WIDGET (amenu->data);
|
|
|
|
gtk_widget_destroy (item);
|
|
|
|
amenu = alist;
|
|
|
|
}
|
|
|
|
if (list_header) {
|
|
|
|
for (url_pt = list_header; url_pt && *url_pt;) {
|
|
|
|
get_url_part (&url_pt, url_decoded, BUFFSIZE);
|
|
|
|
item = NULL;
|
2007-08-21 10:15:12 +02:00
|
|
|
if (!g_ascii_strncasecmp(url_decoded, "mailto:", 7)) {
|
2006-05-12 19:42:48 +02:00
|
|
|
item = gtk_menu_item_new_with_label ((url_decoded));
|
2006-11-26 12:15:44 +01:00
|
|
|
g_signal_connect(G_OBJECT(item), "activate",
|
|
|
|
G_CALLBACK(mailing_list_compose),
|
|
|
|
NULL);
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
2007-08-21 10:15:12 +02:00
|
|
|
else if (!g_ascii_strncasecmp(url_decoded, "http:", 5) ||
|
|
|
|
!g_ascii_strncasecmp(url_decoded, "https:",6)) {
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
item = gtk_menu_item_new_with_label ((url_decoded));
|
2006-11-26 12:15:44 +01:00
|
|
|
g_signal_connect(G_OBJECT(item), "activate",
|
|
|
|
G_CALLBACK(mailing_list_open_uri),
|
|
|
|
NULL);
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
|
|
|
if (item) {
|
|
|
|
gtk_menu_append (GTK_MENU(menu), item);
|
|
|
|
gtk_widget_show (item);
|
|
|
|
menu_nb++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (menu_nb)
|
|
|
|
gtk_widget_set_sensitive (menuitem, TRUE);
|
|
|
|
else
|
|
|
|
gtk_widget_set_sensitive (menuitem, FALSE);
|
|
|
|
|
|
|
|
|
|
|
|
return menu_nb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void get_url_part (const gchar **buffer, gchar *url_decoded, gint maxlen)
|
|
|
|
{
|
|
|
|
gchar tmp[BUFFSIZE];
|
|
|
|
const gchar *buf;
|
|
|
|
gint i = 0;
|
|
|
|
buf = *buffer;
|
2007-02-27 22:38:57 +01:00
|
|
|
gboolean with_plus = TRUE;
|
|
|
|
|
2006-05-12 19:42:48 +02:00
|
|
|
if (buf == 0x00) {
|
2006-05-29 18:42:33 +02:00
|
|
|
*url_decoded = '\0';
|
2006-05-17 11:28:12 +02:00
|
|
|
*buffer = NULL;
|
2006-05-12 19:42:48 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
/* Ignore spaces, comments and tabs () */
|
|
|
|
for (;*buf == ' ' || *buf == '(' || *buf == '\t'; buf++)
|
|
|
|
if (*buf == '(')
|
|
|
|
for (;*buf != ')' && *buf != 0x00; buf++);
|
|
|
|
|
|
|
|
/* First non space and non comment must be a < */
|
|
|
|
if (*buf =='<' ) {
|
|
|
|
buf++;
|
2007-02-27 22:38:57 +01:00
|
|
|
if (!strncmp(buf, "mailto:", strlen("mailto:")))
|
|
|
|
with_plus = FALSE;
|
2006-05-12 19:42:48 +02:00
|
|
|
for (i = 0; *buf != '>' && *buf != 0x00 && i<maxlen; tmp[i++] = *(buf++));
|
|
|
|
buf++;
|
|
|
|
}
|
2006-05-17 11:28:12 +02:00
|
|
|
else {
|
|
|
|
*buffer = NULL;
|
2006-05-29 18:42:33 +02:00
|
|
|
*url_decoded = '\0';
|
2006-05-17 11:28:12 +02:00
|
|
|
return;
|
|
|
|
}
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
tmp[i] = 0x00;
|
2006-05-29 18:42:33 +02:00
|
|
|
*url_decoded = '\0';
|
2006-05-17 11:28:12 +02:00
|
|
|
*buffer = NULL;
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
if (i == maxlen) {
|
|
|
|
return;
|
|
|
|
}
|
2007-02-27 22:38:57 +01:00
|
|
|
decode_uri_with_plus (url_decoded, (const gchar *)tmp, with_plus);
|
2006-05-12 19:42:48 +02:00
|
|
|
|
|
|
|
/* Prepare the work for the next url in the list */
|
|
|
|
/* after the closing bracket >, ignore space, comments and tabs */
|
2006-05-16 22:25:36 +02:00
|
|
|
for (;buf && *buf && (*buf == ' ' || *buf == '(' || *buf == '\t'); buf++)
|
2006-05-12 19:42:48 +02:00
|
|
|
if (*buf == '(')
|
|
|
|
for (;*buf != ')' && *buf != 0x00; buf++);
|
2006-05-16 22:15:40 +02:00
|
|
|
|
2006-05-16 22:27:03 +02:00
|
|
|
if (!buf || !*buf) {
|
2006-05-16 22:15:40 +02:00
|
|
|
*buffer = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-05-12 19:42:48 +02:00
|
|
|
/* now first non space, non comment must be a comma */
|
|
|
|
if (*buf != ',')
|
|
|
|
for (;*buf != 0x00; buf++);
|
|
|
|
else
|
|
|
|
buf++;
|
|
|
|
*buffer = buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mailing_list_compose (GtkWidget *w, gpointer *data)
|
|
|
|
{
|
|
|
|
gchar *mailto;
|
|
|
|
|
|
|
|
gtk_label_get (GTK_LABEL (GTK_BIN (w)->child), (gchar **) &mailto);
|
|
|
|
compose_new(NULL, mailto+7, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mailing_list_open_uri (GtkWidget *w, gpointer *data)
|
|
|
|
{
|
|
|
|
|
|
|
|
gchar *mailto;
|
|
|
|
|
|
|
|
gtk_label_get (GTK_LABEL (GTK_BIN (w)->child), (gchar **) &mailto);
|
2007-11-21 19:58:18 +01:00
|
|
|
open_uri (mailto, prefs_common_get_uri_cmd());
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
|
|
|
|
2008-07-16 08:36:21 +02:00
|
|
|
static void fix_folderview_scroll(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
static gboolean fix_done = FALSE;
|
|
|
|
|
|
|
|
if (fix_done)
|
|
|
|
return;
|
|
|
|
|
|
|
|
gtk_widget_queue_resize(mainwin->folderview->ctree);
|
|
|
|
|
|
|
|
fix_done = TRUE;
|
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
void main_window_popup(MainWindow *mainwin)
|
|
|
|
{
|
2008-03-07 23:34:02 +01:00
|
|
|
static gboolean first_start = TRUE;
|
|
|
|
|
2006-09-06 11:29:01 +02:00
|
|
|
if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window)))
|
|
|
|
main_window_show(mainwin);
|
|
|
|
|
2007-12-27 20:26:13 +01:00
|
|
|
if (prefs_common.mainwin_maximised)
|
|
|
|
gtk_window_maximize(GTK_WINDOW(mainwin->window));
|
|
|
|
|
2008-03-07 23:34:02 +01:00
|
|
|
if (first_start) {
|
|
|
|
gtk_window_deiconify(GTK_WINDOW(mainwin->window));
|
|
|
|
first_start = FALSE;
|
|
|
|
} else {
|
|
|
|
gtkut_window_popup(mainwin->window);
|
|
|
|
}
|
2007-03-28 18:22:52 +02:00
|
|
|
if (prefs_common.layout_mode == SMALL_LAYOUT) {
|
|
|
|
if (mainwin->in_folder) {
|
|
|
|
mainwindow_enter_folder(mainwin);
|
|
|
|
} else {
|
|
|
|
mainwindow_exit_folder(mainwin);
|
|
|
|
}
|
|
|
|
}
|
2008-07-16 08:36:21 +02:00
|
|
|
fix_folderview_scroll(mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2003-06-16 21:02:35 +02:00
|
|
|
void main_window_show(MainWindow *mainwin)
|
|
|
|
{
|
|
|
|
gtk_widget_show(mainwin->window);
|
|
|
|
gtk_widget_show(mainwin->vbox_body);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2003-08-16 18:28:01 +02:00
|
|
|
gtk_widget_set_uposition(mainwin->window,
|
|
|
|
prefs_common.mainwin_x,
|
|
|
|
prefs_common.mainwin_y);
|
|
|
|
|
2005-05-05 10:18:20 +02:00
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
|
2003-08-16 18:28:01 +02:00
|
|
|
prefs_common.folderview_width,
|
|
|
|
prefs_common.folderview_height);
|
2005-05-05 10:18:20 +02:00
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
|
2003-08-16 18:28:01 +02:00
|
|
|
prefs_common.summaryview_width,
|
|
|
|
prefs_common.summaryview_height);
|
2005-05-05 10:18:20 +02:00
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
|
2003-08-16 18:28:01 +02:00
|
|
|
prefs_common.msgview_width,
|
|
|
|
prefs_common.msgview_height);
|
2008-03-07 21:05:21 +01:00
|
|
|
#endif
|
2003-06-16 21:02:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void main_window_hide(MainWindow *mainwin)
|
|
|
|
{
|
2003-08-16 18:28:01 +02:00
|
|
|
main_window_get_size(mainwin);
|
|
|
|
main_window_get_position(mainwin);
|
|
|
|
|
2003-06-16 21:02:35 +02:00
|
|
|
gtk_widget_hide(mainwin->window);
|
|
|
|
gtk_widget_hide(mainwin->vbox_body);
|
|
|
|
}
|
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
|
|
|
GtkWidget *folderwin = NULL;
|
|
|
|
GtkWidget *messagewin = NULL;
|
|
|
|
GtkWidget *hpaned;
|
|
|
|
GtkWidget *vpaned;
|
|
|
|
GtkWidget *vbox_body = mainwin->vbox_body;
|
2007-03-21 18:44:45 +01:00
|
|
|
gboolean first_set = (mainwin->hpaned == NULL);
|
2003-08-21 10:45:43 +02:00
|
|
|
debug_print("Setting widgets... ");
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-03-22 08:52:47 +01:00
|
|
|
if (layout_mode == SMALL_LAYOUT && first_set) {
|
2007-03-21 18:44:45 +01:00
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
|
2005-03-30 14:01:26 +02:00
|
|
|
prefs_common.folderview_width,
|
|
|
|
prefs_common.folderview_height);
|
2007-03-21 18:44:45 +01:00
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
|
|
|
|
0,0);
|
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
|
|
|
|
0,0);
|
|
|
|
} else {
|
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
|
|
|
|
prefs_common.folderview_width,
|
|
|
|
prefs_common.folderview_height);
|
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
|
2005-03-30 14:01:26 +02:00
|
|
|
prefs_common.summaryview_width,
|
|
|
|
prefs_common.summaryview_height);
|
2007-03-21 18:44:45 +01:00
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
|
2005-03-30 14:01:26 +02:00
|
|
|
prefs_common.msgview_width,
|
|
|
|
prefs_common.msgview_height);
|
2007-03-21 18:44:45 +01:00
|
|
|
}
|
2005-03-30 14:01:26 +02:00
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-01-19 19:16:09 +01:00
|
|
|
mainwin->messageview->statusbar = mainwin->statusbar;
|
|
|
|
mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
2007-01-19 19:16:09 +01:00
|
|
|
/* clean top-most container */
|
|
|
|
if (mainwin->hpaned) {
|
|
|
|
if (mainwin->hpaned->parent == mainwin->vpaned)
|
|
|
|
gtk_widget_destroy(mainwin->vpaned);
|
|
|
|
else
|
|
|
|
gtk_widget_destroy(mainwin->hpaned);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
2007-01-20 12:29:48 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView",
|
2007-03-22 08:52:47 +01:00
|
|
|
(layout_mode != WIDE_MSGLIST_LAYOUT && layout_mode != SMALL_LAYOUT));
|
2007-01-20 12:29:48 +01:00
|
|
|
switch (layout_mode) {
|
|
|
|
case VERTICAL_LAYOUT:
|
|
|
|
case NORMAL_LAYOUT:
|
2007-03-22 08:52:47 +01:00
|
|
|
case SMALL_LAYOUT:
|
2001-04-19 14:21:46 +02:00
|
|
|
hpaned = gtk_hpaned_new();
|
2007-01-19 19:16:09 +01:00
|
|
|
if (layout_mode == VERTICAL_LAYOUT)
|
|
|
|
vpaned = gtk_hpaned_new();
|
|
|
|
else
|
|
|
|
vpaned = gtk_vpaned_new();
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_box_pack_start(GTK_BOX(vbox_body), hpaned, TRUE, TRUE, 0);
|
|
|
|
gtk_paned_add1(GTK_PANED(hpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->folderview));
|
2003-08-21 10:45:43 +02:00
|
|
|
gtk_widget_show(hpaned);
|
|
|
|
gtk_widget_queue_resize(hpaned);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2002-06-11 23:46:03 +02:00
|
|
|
if (messageview_is_visible(mainwin->messageview)) {
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_paned_add2(GTK_PANED(hpaned), vpaned);
|
|
|
|
gtk_paned_add1(GTK_PANED(vpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->summaryview));
|
|
|
|
} else {
|
|
|
|
gtk_paned_add2(GTK_PANED(hpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->summaryview));
|
|
|
|
gtk_widget_ref(vpaned);
|
|
|
|
}
|
|
|
|
gtk_paned_add2(GTK_PANED(vpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->messageview));
|
2003-08-09 08:26:27 +02:00
|
|
|
gtk_widget_show(vpaned);
|
2007-03-22 08:52:47 +01:00
|
|
|
if (layout_mode == SMALL_LAYOUT && first_set) {
|
2007-03-21 18:44:45 +01:00
|
|
|
mainwin_paned_show_first(GTK_PANED(hpaned));
|
|
|
|
}
|
2003-08-21 10:45:43 +02:00
|
|
|
gtk_widget_queue_resize(vpaned);
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
|
|
|
case WIDE_LAYOUT:
|
2001-04-19 14:21:46 +02:00
|
|
|
vpaned = gtk_vpaned_new();
|
|
|
|
hpaned = gtk_hpaned_new();
|
2007-01-19 19:16:09 +01:00
|
|
|
gtk_box_pack_start(GTK_BOX(vbox_body), vpaned, TRUE, TRUE, 0);
|
|
|
|
gtk_paned_add1(GTK_PANED(vpaned), hpaned);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_paned_add1(GTK_PANED(hpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->folderview));
|
|
|
|
gtk_paned_add2(GTK_PANED(hpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->summaryview));
|
2007-01-19 19:16:09 +01:00
|
|
|
|
2003-08-09 08:26:27 +02:00
|
|
|
gtk_widget_show(hpaned);
|
2003-08-21 10:45:43 +02:00
|
|
|
gtk_widget_queue_resize(hpaned);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
if (messageview_is_visible(mainwin->messageview)) {
|
|
|
|
gtk_paned_add2(GTK_PANED(vpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->messageview));
|
|
|
|
} else {
|
|
|
|
gtk_widget_ref(GTK_WIDGET_PTR(mainwin->messageview));
|
|
|
|
}
|
|
|
|
gtk_widget_show(vpaned);
|
|
|
|
gtk_widget_queue_resize(vpaned);
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
|
|
|
case WIDE_MSGLIST_LAYOUT:
|
|
|
|
vpaned = gtk_vpaned_new();
|
|
|
|
hpaned = gtk_hpaned_new();
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox_body), vpaned, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
gtk_paned_add1(GTK_PANED(vpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->summaryview));
|
|
|
|
gtk_paned_add1(GTK_PANED(hpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->folderview));
|
|
|
|
|
|
|
|
gtk_widget_show(hpaned);
|
|
|
|
gtk_widget_queue_resize(hpaned);
|
|
|
|
|
|
|
|
if (messageview_is_visible(mainwin->messageview)) {
|
|
|
|
gtk_paned_add2(GTK_PANED(hpaned),
|
|
|
|
GTK_WIDGET_PTR(mainwin->messageview));
|
|
|
|
} else {
|
|
|
|
gtk_widget_ref(GTK_WIDGET_PTR(mainwin->messageview));
|
|
|
|
}
|
|
|
|
gtk_paned_add2(GTK_PANED(vpaned), hpaned);
|
|
|
|
|
|
|
|
gtk_widget_show(vpaned);
|
|
|
|
gtk_widget_queue_resize(vpaned);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_warning("Unknown layout");
|
|
|
|
return;
|
2007-01-19 19:16:09 +01:00
|
|
|
}
|
2006-06-29 09:20:40 +02:00
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
mainwin->hpaned = hpaned;
|
|
|
|
mainwin->vpaned = vpaned;
|
2006-06-29 09:20:40 +02:00
|
|
|
|
2007-03-22 08:52:47 +01:00
|
|
|
if (layout_mode == SMALL_LAYOUT) {
|
2007-03-21 18:44:45 +01:00
|
|
|
if (mainwin->messageview->visible)
|
|
|
|
main_window_toggle_message_view(mainwin);
|
|
|
|
}
|
|
|
|
|
2007-03-22 08:52:47 +01:00
|
|
|
if (layout_mode == SMALL_LAYOUT && first_set) {
|
2007-03-21 18:44:45 +01:00
|
|
|
gtk_widget_realize(mainwin->window);
|
|
|
|
gtk_widget_realize(mainwin->folderview->ctree);
|
|
|
|
gtk_widget_realize(mainwin->summaryview->hbox);
|
|
|
|
gtk_widget_realize(mainwin->summaryview->hbox_l);
|
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
|
|
|
|
prefs_common.folderview_width,
|
|
|
|
prefs_common.folderview_height);
|
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
|
|
|
|
0,0);
|
|
|
|
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
|
|
|
|
0,0);
|
|
|
|
gtk_widget_set_size_request(GTK_WIDGET(mainwin->window),
|
|
|
|
prefs_common.mainwin_width,
|
|
|
|
prefs_common.mainwin_height);
|
|
|
|
gtk_paned_set_position(GTK_PANED(mainwin->hpaned), 800);
|
|
|
|
}
|
2007-01-19 19:16:09 +01:00
|
|
|
/* remove headerview if not in prefs */
|
|
|
|
headerview_set_visibility(mainwin->messageview->headerview,
|
|
|
|
prefs_common.display_header_pane);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2005-03-30 14:01:26 +02:00
|
|
|
if (messageview_is_visible(mainwin->messageview))
|
|
|
|
gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
|
|
|
|
GTK_ARROW_DOWN, GTK_SHADOW_OUT);
|
|
|
|
else
|
|
|
|
gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
|
|
|
|
GTK_ARROW_UP, GTK_SHADOW_OUT);
|
|
|
|
|
2003-10-05 12:10:30 +02:00
|
|
|
gtk_window_move(GTK_WINDOW(mainwin->window),
|
|
|
|
prefs_common.mainwin_x,
|
|
|
|
prefs_common.mainwin_y);
|
2003-08-09 08:26:27 +02:00
|
|
|
|
|
|
|
gtk_widget_queue_resize(vbox_body);
|
2003-08-21 10:45:43 +02:00
|
|
|
gtk_widget_queue_resize(mainwin->vbox);
|
2003-08-09 08:26:27 +02:00
|
|
|
gtk_widget_queue_resize(mainwin->window);
|
2003-08-01 10:00:32 +02:00
|
|
|
/* CLAWS: previous "gtk_widget_show_all" makes noticeview
|
|
|
|
* and mimeview icon list/ctree lose track of their visibility states */
|
|
|
|
if (!noticeview_is_visible(mainwin->messageview->noticeview))
|
|
|
|
gtk_widget_hide(GTK_WIDGET_PTR(mainwin->messageview->noticeview));
|
2004-01-12 22:28:31 +01:00
|
|
|
if (!noticeview_is_visible(mainwin->messageview->mimeview->siginfoview))
|
|
|
|
gtk_widget_hide(GTK_WIDGET_PTR(mainwin->messageview->mimeview->siginfoview));
|
2007-07-16 19:13:43 +02:00
|
|
|
if (mainwin->messageview->mimeview->ctree_mode)
|
2003-08-01 10:00:32 +02:00
|
|
|
gtk_widget_hide(mainwin->messageview->mimeview->icon_mainbox);
|
|
|
|
else
|
|
|
|
gtk_widget_hide(mainwin->messageview->mimeview->ctree_mainbox);
|
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
prefs_common.layout_mode = layout_mode;
|
2002-05-18 17:22:17 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView",
|
2005-03-30 14:01:26 +02:00
|
|
|
messageview_is_visible(mainwin->messageview));
|
2002-05-18 17:22:17 +02:00
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-01-20 12:29:48 +01:00
|
|
|
switch (prefs_common.layout_mode) {
|
|
|
|
case NORMAL_LAYOUT:
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/Standard", TRUE);
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
|
|
|
case VERTICAL_LAYOUT:
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/ThreeColumns", TRUE);
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
|
|
|
case WIDE_LAYOUT:
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/WideMessage", TRUE);
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
|
|
|
case WIDE_MSGLIST_LAYOUT:
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/WideMessageList", TRUE);
|
2007-01-20 12:29:48 +01:00
|
|
|
break;
|
2007-03-22 08:52:47 +01:00
|
|
|
case SMALL_LAYOUT:
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/SmallScreen", TRUE);
|
2007-03-21 18:44:45 +01:00
|
|
|
break;
|
2007-01-19 19:16:09 +01:00
|
|
|
}
|
2007-07-15 11:14:01 +02:00
|
|
|
#endif
|
2002-05-18 17:22:17 +02:00
|
|
|
|
2003-08-21 10:45:43 +02:00
|
|
|
if (folderwin) {
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect
|
|
|
|
(G_OBJECT(folderwin), "size_allocate",
|
|
|
|
G_CALLBACK(folder_window_size_allocate_cb),
|
2003-08-21 10:45:43 +02:00
|
|
|
mainwin);
|
|
|
|
}
|
|
|
|
if (messagewin) {
|
2003-10-05 12:10:30 +02:00
|
|
|
g_signal_connect
|
|
|
|
(G_OBJECT(messagewin), "size_allocate",
|
|
|
|
G_CALLBACK(message_window_size_allocate_cb),
|
2003-08-21 10:45:43 +02:00
|
|
|
mainwin);
|
|
|
|
}
|
|
|
|
|
2002-08-15 09:38:17 +02:00
|
|
|
debug_print("done.\n");
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2002-09-22 16:27:34 +02:00
|
|
|
void main_window_destroy_all(void)
|
|
|
|
{
|
|
|
|
while (mainwin_list != NULL) {
|
|
|
|
MainWindow *mainwin = (MainWindow*)mainwin_list->data;
|
|
|
|
|
|
|
|
/* free toolbar stuff */
|
|
|
|
toolbar_clear_list(TOOLBAR_MAIN);
|
2002-11-28 23:56:41 +01:00
|
|
|
TOOLBAR_DESTROY_ACTIONS(mainwin->toolbar->action_list);
|
|
|
|
TOOLBAR_DESTROY_ITEMS(mainwin->toolbar->item_list);
|
2002-09-22 16:27:34 +02:00
|
|
|
|
2007-12-07 21:42:42 +01:00
|
|
|
summaryview_destroy(mainwin->summaryview);
|
2006-02-12 21:56:16 +01:00
|
|
|
mainwin->folderview->mainwin = NULL;
|
|
|
|
mainwin->summaryview->mainwin = NULL;
|
|
|
|
mainwin->messageview->mainwin = NULL;
|
|
|
|
|
2002-09-22 16:27:34 +02:00
|
|
|
g_free(mainwin->toolbar);
|
|
|
|
g_free(mainwin);
|
|
|
|
|
|
|
|
mainwin_list = g_list_remove(mainwin_list, mainwin);
|
|
|
|
}
|
|
|
|
g_list_free(mainwin_list);
|
2006-02-12 21:56:16 +01:00
|
|
|
mainwin_list = NULL;
|
2002-09-22 16:27:34 +02:00
|
|
|
}
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
static void toolbar_child_attached(GtkWidget *widget, GtkWidget *child,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2005-05-05 10:18:20 +02:00
|
|
|
gtk_widget_set_size_request(child, 1, -1);
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void toolbar_child_detached(GtkWidget *widget, GtkWidget *child,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2005-05-05 10:18:20 +02:00
|
|
|
gtk_widget_set_size_request(child, -1, -1);
|
2004-02-21 12:01:01 +01:00
|
|
|
}
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2004-07-20 15:31:12 +02:00
|
|
|
static gboolean ac_label_button_pressed(GtkWidget *widget, GdkEventButton *event,
|
2004-02-21 12:01:01 +01:00
|
|
|
gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
|
2003-10-05 12:10:30 +02:00
|
|
|
if (!event) return FALSE;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-08-22 12:58:38 +02:00
|
|
|
gtk_button_set_relief(GTK_BUTTON(widget), GTK_RELIEF_NORMAL);
|
2003-10-05 12:10:30 +02:00
|
|
|
g_object_set_data(G_OBJECT(mainwin->ac_menu), "menu_button",
|
|
|
|
widget);
|
2001-08-22 12:58:38 +02:00
|
|
|
|
|
|
|
gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL,
|
|
|
|
menu_button_position, widget,
|
2001-04-19 14:21:46 +02:00
|
|
|
event->button, event->time);
|
2003-10-05 12:10:30 +02:00
|
|
|
|
|
|
|
return TRUE;
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2001-09-06 12:24:20 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-01-28 13:05:08 +01:00
|
|
|
gboolean close_allowed = TRUE;
|
2001-09-06 12:24:20 +02:00
|
|
|
|
2007-01-28 13:05:08 +01:00
|
|
|
hooks_invoke(MAIN_WINDOW_CLOSE, &close_allowed);
|
|
|
|
|
|
|
|
if (close_allowed && mainwin->lock_count == 0)
|
2008-07-29 21:07:54 +02:00
|
|
|
app_exit_cb(NULL, data);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-08-09 08:26:27 +02:00
|
|
|
static void main_window_size_allocate_cb(GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
main_window_get_size(mainwin);
|
|
|
|
}
|
|
|
|
|
2003-08-21 10:45:43 +02:00
|
|
|
static void folder_window_size_allocate_cb(GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
|
|
|
|
main_window_get_size(mainwin);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void message_window_size_allocate_cb(GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
|
|
|
|
main_window_get_size(mainwin);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void add_mailbox_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
main_window_add_mailbox(mainwin);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void update_folderview_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-07-25 14:21:11 +02:00
|
|
|
summary_show(mainwin->summaryview, NULL);
|
2002-07-31 01:26:59 +02:00
|
|
|
folderview_check_new_all();
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void foldersort_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2004-05-10 12:22:28 +02:00
|
|
|
foldersort_open();
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void import_mbox_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-05-13 12:02:33 +02:00
|
|
|
/* only notify if import has failed */
|
|
|
|
if (import_mbox(mainwin->summaryview->folder_item) == -1) {
|
|
|
|
alertpanel_error(_("Mbox import has failed."));
|
|
|
|
}
|
2001-04-21 01:24:31 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void export_mbox_cb(GtkAction *action, gpointer data)
|
2001-04-21 01:24:31 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-05-13 12:02:33 +02:00
|
|
|
/* only notify if export has failed */
|
|
|
|
if (export_mbox(mainwin->summaryview->folder_item) == -1) {
|
|
|
|
alertpanel_error(_("Export to mbox has failed."));
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void export_list_mbox_cb(GtkAction *action, gpointer data)
|
2005-01-19 11:53:22 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-05-13 12:02:33 +02:00
|
|
|
/* only notify if export has failed */
|
|
|
|
if (summaryview_export_mbox_list(mainwin->summaryview) == -1) {
|
|
|
|
alertpanel_error(_("Export to mbox has failed."));
|
|
|
|
}
|
2005-01-19 11:53:22 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void empty_trash_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2008-05-19 18:38:58 +02:00
|
|
|
main_window_empty_trash(mainwin, TRUE, FALSE);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void save_as_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_save_as(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void print_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_print(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2007-09-18 08:58:04 +02:00
|
|
|
#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
|
2008-07-29 21:07:54 +02:00
|
|
|
static void page_setup_cb(GtkAction *action, gpointer data)
|
2007-09-18 08:58:04 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-09-18 08:58:04 +02:00
|
|
|
GtkWindow *win;
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
win = (mainwin ? GTK_WINDOW(mainwin->window) : NULL);
|
2007-09-18 08:58:04 +02:00
|
|
|
|
|
|
|
printing_page_setup(win);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void app_exit_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2008-05-14 22:45:55 +02:00
|
|
|
if (prefs_common.clean_on_exit) {
|
2008-05-19 18:38:58 +02:00
|
|
|
if (!main_window_empty_trash(mainwin, prefs_common.ask_on_clean, TRUE))
|
2008-05-14 22:45:55 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
if (prefs_common.confirm_on_exit) {
|
2006-11-07 11:47:23 +01:00
|
|
|
if (alertpanel(_("Exit"), _("Exit Claws Mail?"),
|
2006-02-24 12:50:35 +01:00
|
|
|
GTK_STOCK_CANCEL, GTK_STOCK_QUIT, NULL)
|
2006-01-14 10:45:39 +01:00
|
|
|
!= G_ALERTALTERNATE)
|
2001-04-19 14:21:46 +02:00
|
|
|
return;
|
2001-04-27 22:27:24 +02:00
|
|
|
manage_window_focus_in(mainwin->window, NULL, NULL);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
app_will_exit(NULL, mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void search_cb(GtkAction *action, gpointer data)
|
2001-09-24 10:15:52 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
message_search(mainwin->messageview);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void search_folder_cb(GtkAction *action, gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
summary_search(mainwin->summaryview);
|
2001-09-24 10:15:52 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mainwindow_quicksearch(GtkAction *action, gpointer data)
|
2005-06-27 18:57:35 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-12-14 09:38:09 +01:00
|
|
|
summaryview_activate_quicksearch(mainwin->summaryview, TRUE);
|
2005-06-27 18:57:35 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void toggle_message_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-05-18 17:22:17 +02:00
|
|
|
gboolean active;
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2002-05-18 17:22:17 +02:00
|
|
|
|
2002-06-11 23:46:03 +02:00
|
|
|
if (active != messageview_is_visible(mainwin->messageview))
|
|
|
|
summary_toggle_view(mainwin->summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void toggle_toolbar_cb(GtkAction *action, GtkRadioAction *current, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
toolbar_toggle(value, mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void main_window_reply_cb(GtkAction *gaction, gpointer data)
|
2003-03-01 10:45:14 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2003-03-03 20:03:23 +01:00
|
|
|
MessageView *msgview = (MessageView*)mainwin->messageview;
|
|
|
|
GSList *msginfo_list = NULL;
|
2008-07-29 21:07:54 +02:00
|
|
|
gint action = COMPOSE_REPLY;
|
|
|
|
const gchar *a_name = gtk_action_get_name(gaction);
|
|
|
|
|
|
|
|
DO_ACTION("Message/Reply", COMPOSE_REPLY);
|
|
|
|
DO_ACTION("Message/ReplyTo/All", COMPOSE_REPLY_TO_ALL);
|
|
|
|
DO_ACTION("Message/ReplyTo/Sender", COMPOSE_REPLY_TO_SENDER);
|
|
|
|
DO_ACTION("Message/ReplyTo/List", COMPOSE_REPLY_TO_LIST);
|
|
|
|
DO_ACTION("Message/Forward", COMPOSE_FORWARD_INLINE);
|
|
|
|
DO_ACTION("Message/ForwardAtt", COMPOSE_FORWARD_AS_ATTACH);
|
|
|
|
DO_ACTION("Message/Redirect", COMPOSE_REDIRECT);
|
|
|
|
DO_ACTION("Message/FollowupReply", COMPOSE_FOLLOWUP_AND_REPLY_TO);
|
2003-03-03 20:03:23 +01:00
|
|
|
|
|
|
|
g_return_if_fail(msgview != NULL);
|
|
|
|
|
|
|
|
msginfo_list = summary_get_selection(mainwin->summaryview);
|
|
|
|
g_return_if_fail(msginfo_list != NULL);
|
2005-01-27 12:11:16 +01:00
|
|
|
compose_reply_from_messageview(msgview, msginfo_list, action);
|
2003-03-03 20:03:23 +01:00
|
|
|
g_slist_free(msginfo_list);
|
2003-03-01 10:45:14 +01:00
|
|
|
}
|
2003-03-03 20:03:23 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void toggle_col_headers_cb(GtkAction *gaction, gpointer data)
|
2007-07-26 22:30:13 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-07-26 22:30:13 +02:00
|
|
|
FolderView *folderview = mainwin->folderview;
|
|
|
|
SummaryView *summaryview = mainwin->summaryview;
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (gaction))) {
|
2007-07-26 22:30:13 +02:00
|
|
|
gtk_clist_column_titles_show(GTK_CLIST(folderview->ctree));
|
|
|
|
gtk_clist_column_titles_show(GTK_CLIST(summaryview->ctree));
|
|
|
|
prefs_common.show_col_headers = TRUE;
|
|
|
|
} else {
|
|
|
|
gtk_clist_column_titles_hide(GTK_CLIST(folderview->ctree));
|
|
|
|
gtk_clist_column_titles_hide(GTK_CLIST(summaryview->ctree));
|
|
|
|
prefs_common.show_col_headers = FALSE;
|
|
|
|
}
|
|
|
|
}
|
2002-09-22 16:27:34 +02:00
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2008-07-29 21:07:54 +02:00
|
|
|
static void toggle_statusbar_cb(GtkAction *gaction, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (gaction))) {
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_show(mainwin->hbox_stat);
|
|
|
|
prefs_common.show_statusbar = TRUE;
|
|
|
|
} else {
|
|
|
|
gtk_widget_hide(mainwin->hbox_stat);
|
|
|
|
prefs_common.show_statusbar = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void set_layout_cb(GtkAction *action, GtkRadioAction *current, gpointer data)
|
2002-06-11 23:46:03 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
|
|
|
|
LayoutType layout_mode = value;
|
2007-03-21 18:44:45 +01:00
|
|
|
LayoutType old_layout_mode = prefs_common.layout_mode;
|
2007-01-19 19:16:09 +01:00
|
|
|
if (mainwin->menu_lock_count) {
|
|
|
|
return;
|
|
|
|
}
|
2008-07-29 21:07:54 +02:00
|
|
|
if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current))) {
|
2007-01-19 19:16:09 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (layout_mode == prefs_common.layout_mode) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-03-22 08:52:47 +01:00
|
|
|
if (!mainwin->messageview->visible && layout_mode != SMALL_LAYOUT)
|
2007-03-21 18:44:45 +01:00
|
|
|
main_window_toggle_message_view(mainwin);
|
2007-03-22 08:52:47 +01:00
|
|
|
else if (mainwin->messageview->visible && layout_mode == SMALL_LAYOUT)
|
2007-01-19 19:16:09 +01:00
|
|
|
main_window_toggle_message_view(mainwin);
|
2002-06-11 23:46:03 +02:00
|
|
|
|
2007-01-19 19:16:09 +01:00
|
|
|
main_window_separation_change(mainwin, layout_mode);
|
2007-03-21 18:44:45 +01:00
|
|
|
mainwindow_reset_paned(GTK_PANED(mainwin->vpaned));
|
2007-03-22 08:52:47 +01:00
|
|
|
if (old_layout_mode == SMALL_LAYOUT && layout_mode != SMALL_LAYOUT) {
|
2007-03-21 18:44:45 +01:00
|
|
|
mainwindow_reset_paned(GTK_PANED(mainwin->hpaned));
|
|
|
|
}
|
2007-03-22 08:52:47 +01:00
|
|
|
if (old_layout_mode != SMALL_LAYOUT && layout_mode == SMALL_LAYOUT) {
|
2007-03-21 18:44:45 +01:00
|
|
|
mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
|
|
|
|
mainwindow_exit_folder(mainwin);
|
|
|
|
}
|
2007-01-19 19:16:09 +01:00
|
|
|
summary_relayout(mainwin->summaryview);
|
2007-03-30 10:49:14 +02:00
|
|
|
summary_update_unread(mainwin->summaryview, NULL);
|
2002-06-11 23:46:03 +02:00
|
|
|
}
|
2007-07-15 11:14:01 +02:00
|
|
|
#endif
|
2002-06-11 23:46:03 +02:00
|
|
|
|
2005-09-08 20:28:36 +02:00
|
|
|
void main_window_toggle_work_offline (MainWindow *mainwin, gboolean offline,
|
|
|
|
gboolean ask_sync)
|
2002-04-21 14:11:43 +02:00
|
|
|
{
|
2005-09-08 20:28:36 +02:00
|
|
|
offline_ask_sync = ask_sync;
|
2002-10-16 10:12:34 +02:00
|
|
|
if (offline)
|
2002-04-21 14:11:43 +02:00
|
|
|
online_switch_clicked (GTK_BUTTON(mainwin->online_switch), mainwin);
|
2002-10-16 10:12:34 +02:00
|
|
|
else
|
|
|
|
online_switch_clicked (GTK_BUTTON(mainwin->offline_switch), mainwin);
|
2005-09-08 20:28:36 +02:00
|
|
|
offline_ask_sync = TRUE;
|
2002-10-16 10:12:34 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void toggle_work_offline_cb (GtkAction *action, gpointer data)
|
2002-10-16 10:12:34 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
main_window_toggle_work_offline(mainwin, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)), TRUE);
|
2005-09-08 20:28:36 +02:00
|
|
|
}
|
|
|
|
|
2007-01-06 18:57:16 +01:00
|
|
|
static gboolean any_folder_want_synchronise(void)
|
2005-09-08 20:28:36 +02:00
|
|
|
{
|
|
|
|
GList *folderlist = folder_get_list();
|
|
|
|
|
|
|
|
/* see if there are synchronised folders */
|
|
|
|
for (; folderlist; folderlist = folderlist->next) {
|
|
|
|
Folder *folder = (Folder *)folderlist->data;
|
|
|
|
if (folder_want_synchronise(folder)) {
|
2007-01-06 18:57:16 +01:00
|
|
|
return TRUE;
|
2005-09-08 20:28:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-01-06 18:57:16 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mainwindow_check_synchronise(MainWindow *mainwin, gboolean ask)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!any_folder_want_synchronise())
|
2005-09-08 20:28:36 +02:00
|
|
|
return;
|
2007-01-06 18:57:16 +01:00
|
|
|
|
2005-09-08 20:28:36 +02:00
|
|
|
if (offline_ask_sync && ask && alertpanel(_("Folder synchronisation"),
|
|
|
|
_("Do you want to synchronise your folders now?"),
|
2006-01-25 19:41:10 +01:00
|
|
|
GTK_STOCK_CANCEL, _("+_Synchronise"), NULL) != G_ALERTALTERNATE)
|
2005-09-08 20:28:36 +02:00
|
|
|
return;
|
2007-04-05 18:58:30 +02:00
|
|
|
|
|
|
|
if (offline_ask_sync)
|
|
|
|
folder_synchronise(NULL);
|
2002-04-21 14:11:43 +02:00
|
|
|
}
|
2001-08-16 13:28:10 +02:00
|
|
|
|
2002-04-21 14:11:43 +02:00
|
|
|
static void online_switch_clicked (GtkButton *btn, gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin;
|
2008-01-14 10:14:07 +01:00
|
|
|
gboolean have_connectivity;
|
|
|
|
|
|
|
|
#ifdef HAVE_NETWORKMANAGER
|
|
|
|
have_connectivity = networkmanager_is_online(NULL);
|
|
|
|
#else
|
|
|
|
have_connectivity = TRUE;
|
|
|
|
#endif
|
2002-04-21 14:11:43 +02:00
|
|
|
|
|
|
|
mainwin = (MainWindow *) data;
|
|
|
|
|
|
|
|
g_return_if_fail(mainwin != NULL);
|
|
|
|
|
|
|
|
if (btn == GTK_BUTTON(mainwin->online_switch)) {
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2002-04-21 14:11:43 +02:00
|
|
|
gtk_widget_hide (mainwin->online_switch);
|
|
|
|
gtk_widget_show (mainwin->offline_switch);
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/File/OfflineMode", TRUE);
|
|
|
|
|
2006-08-03 18:37:50 +02:00
|
|
|
inc_autocheck_timer_remove();
|
|
|
|
|
|
|
|
/* go offline */
|
|
|
|
if (prefs_common.work_offline)
|
|
|
|
return;
|
2008-01-14 10:14:07 +01:00
|
|
|
|
|
|
|
if(have_connectivity)
|
|
|
|
mainwindow_check_synchronise(mainwin, TRUE);
|
2006-08-21 08:12:40 +02:00
|
|
|
prefs_common.work_offline = TRUE;
|
2006-06-29 19:20:04 +02:00
|
|
|
imap_disconnect_all();
|
2006-10-19 18:49:56 +02:00
|
|
|
hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
|
2002-04-21 14:11:43 +02:00
|
|
|
} else {
|
|
|
|
/*go online */
|
2006-07-12 12:31:41 +02:00
|
|
|
if (!prefs_common.work_offline)
|
|
|
|
return;
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2002-04-21 14:11:43 +02:00
|
|
|
gtk_widget_hide (mainwin->offline_switch);
|
|
|
|
gtk_widget_show (mainwin->online_switch);
|
2007-07-25 18:37:48 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/File/OfflineMode", FALSE);
|
2002-04-21 14:11:43 +02:00
|
|
|
prefs_common.work_offline = FALSE;
|
|
|
|
inc_autocheck_timer_set();
|
2006-07-25 10:44:31 +02:00
|
|
|
refresh_resolvers();
|
2006-10-19 18:49:56 +02:00
|
|
|
hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
|
2002-04-21 14:11:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void addressbook_open_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
|
|
|
addressbook_open(NULL);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void log_window_show_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
log_window_show(mainwin->logwin);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void filtering_debug_window_show_cb(GtkAction *action, gpointer data)
|
2007-03-21 16:00:46 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-03-21 16:00:46 +01:00
|
|
|
log_window_show(mainwin->filtering_debugwin);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void inc_cancel_cb(GtkAction *action, gpointer data)
|
2002-03-07 14:22:39 +01:00
|
|
|
{
|
|
|
|
inc_cancel_all();
|
2007-04-26 12:05:41 +02:00
|
|
|
imap_cancel_all();
|
2002-03-07 14:22:39 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void move_to_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_move_to(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void copy_to_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_copy_to(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void delete_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_delete(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void delete_trash_cb(GtkAction *action, gpointer data)
|
2005-06-22 20:23:15 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2005-06-22 20:23:15 +02:00
|
|
|
summary_delete_trash(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void cancel_cb(GtkAction *action, gpointer data)
|
2002-08-27 00:53:35 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-08-27 00:53:35 +02:00
|
|
|
summary_cancel(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void open_msg_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_open_msg(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void view_source_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_view_source(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void show_all_header_cb(GtkAction *action, gpointer data)
|
2002-02-04 10:56:44 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-02-14 16:28:02 +01:00
|
|
|
if (mainwin->menu_lock_count) return;
|
2005-06-05 22:37:21 +02:00
|
|
|
mainwin->summaryview->messageview->all_headers =
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2002-02-14 16:28:02 +01:00
|
|
|
summary_display_msg_selected(mainwin->summaryview,
|
2008-07-29 21:07:54 +02:00
|
|
|
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
|
2006-08-02 18:30:28 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void hide_quotes_cb(GtkAction *action, gpointer data)
|
2006-07-31 19:17:32 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-08-02 18:30:28 +02:00
|
|
|
|
2006-07-31 19:17:32 +02:00
|
|
|
if (mainwin->menu_lock_count) return;
|
2006-08-02 18:30:28 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
|
|
|
|
const gchar *a_name = gtk_action_get_name(GTK_ACTION(action));
|
|
|
|
if (!strcmp(a_name, "View/Quotes/FoldAll")) prefs_common.hide_quotes = 1;
|
|
|
|
else if (!strcmp(a_name, "View/Quotes/Fold2")) prefs_common.hide_quotes = 2;
|
|
|
|
else if (!strcmp(a_name, "View/Quotes/Fold3")) prefs_common.hide_quotes = 3;
|
|
|
|
} else
|
|
|
|
prefs_common.hide_quotes = 0;
|
2006-08-02 18:30:28 +02:00
|
|
|
|
|
|
|
mainwin->menu_lock_count++;
|
2008-07-29 21:07:54 +02:00
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/FoldAll", (prefs_common.hide_quotes == 1));
|
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Fold2", (prefs_common.hide_quotes == 2));
|
|
|
|
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Fold3", (prefs_common.hide_quotes == 3));
|
2006-08-02 18:30:28 +02:00
|
|
|
mainwin->menu_lock_count--;
|
|
|
|
|
2006-08-04 18:12:21 +02:00
|
|
|
summary_redisplay_msg(mainwin->summaryview);
|
2006-07-31 19:17:32 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mark_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_mark(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void unmark_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_unmark(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mark_as_unread_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_mark_as_unread(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mark_as_read_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_mark_as_read(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mark_all_read_cb(GtkAction *action, gpointer data)
|
2001-09-13 15:38:32 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-09-13 15:38:32 +02:00
|
|
|
summary_mark_all_read(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mark_as_spam_cb(GtkAction *action, gpointer data)
|
2006-02-24 18:48:13 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
summary_mark_as_spam(mainwin->summaryview, TRUE, NULL);
|
2006-02-24 18:48:13 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void mark_as_ham_cb(GtkAction *action, gpointer data)
|
2006-09-13 08:42:36 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
summary_mark_as_spam(mainwin->summaryview, FALSE, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ignore_thread_cb(GtkAction *action, gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-09-13 08:42:36 +02:00
|
|
|
summary_ignore_thread(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void unignore_thread_cb(GtkAction *action, gpointer data)
|
2006-09-13 08:42:36 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-09-13 08:42:36 +02:00
|
|
|
summary_unignore_thread(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void watch_thread_cb(GtkAction *action, gpointer data)
|
2007-07-27 16:19:05 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-07-27 16:19:05 +02:00
|
|
|
summary_watch_thread(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void unwatch_thread_cb(GtkAction *action, gpointer data)
|
2007-07-27 16:19:05 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-07-27 16:19:05 +02:00
|
|
|
summary_unwatch_thread(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void lock_msgs_cb(GtkAction *action, gpointer data)
|
2006-09-13 08:42:36 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-09-13 08:42:36 +02:00
|
|
|
summary_msgs_lock(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void unlock_msgs_cb(GtkAction *action, gpointer data)
|
2006-09-13 08:42:36 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-09-13 08:42:36 +02:00
|
|
|
summary_msgs_unlock(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void reedit_cb(GtkAction *action, gpointer data)
|
2004-05-22 09:27:30 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2004-05-22 09:27:30 +02:00
|
|
|
summary_reedit(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void open_urls_cb(GtkAction *action, gpointer data)
|
2007-02-02 18:48:17 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-02-02 18:48:17 +01:00
|
|
|
if (!mainwin->summaryview->displayed && mainwin->summaryview->selected) {
|
|
|
|
summary_display_msg_selected(mainwin->summaryview,
|
|
|
|
mainwin->messageview->mimeview->textview->show_all_headers);
|
|
|
|
}
|
|
|
|
messageview_list_urls(mainwin->messageview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void add_address_cb(GtkAction *action, gpointer data)
|
2001-09-13 15:38:32 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-09-13 15:38:32 +02:00
|
|
|
summary_add_address(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void set_charset_cb(GtkAction *action, GtkRadioAction *current, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
|
2001-04-19 14:21:46 +02:00
|
|
|
const gchar *str;
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current))) {
|
|
|
|
str = conv_get_charset_str((CharSet)value);
|
2004-10-02 18:33:17 +02:00
|
|
|
|
|
|
|
g_free(mainwin->messageview->forced_charset);
|
|
|
|
mainwin->messageview->forced_charset = str ? g_strdup(str) : NULL;
|
|
|
|
procmime_force_charset(str);
|
|
|
|
|
2002-12-18 11:44:47 +01:00
|
|
|
summary_redisplay_msg(mainwin->summaryview);
|
|
|
|
|
|
|
|
debug_print("forced charset: %s\n", str ? str : "Auto-Detect");
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void set_decode_cb(GtkAction *action, GtkRadioAction *current, gpointer data)
|
2004-10-02 18:33:17 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
|
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current))) {
|
|
|
|
mainwin->messageview->forced_encoding = (EncodingType)value;
|
2004-10-04 12:22:00 +02:00
|
|
|
|
2004-10-02 18:33:17 +02:00
|
|
|
summary_redisplay_msg(mainwin->summaryview);
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
debug_print("forced encoding: %d\n", value);
|
2004-10-02 18:33:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void hide_read_messages (GtkAction *action, gpointer data)
|
2001-12-11 16:06:46 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
GtkWidget *menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/HideReadMessages");
|
2001-12-11 16:06:46 +01:00
|
|
|
if (!mainwin->summaryview->folder_item
|
2008-07-29 21:07:54 +02:00
|
|
|
|| g_object_get_data(G_OBJECT(menuitem), "dont_toggle"))
|
2001-12-11 16:06:46 +01:00
|
|
|
return;
|
|
|
|
summary_toggle_show_read_messages(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void thread_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-04-05 08:19:17 +02:00
|
|
|
gboolean threaded = FALSE;
|
2002-02-14 16:28:02 +01:00
|
|
|
if (mainwin->menu_lock_count) return;
|
2001-09-25 11:12:39 +02:00
|
|
|
if (!mainwin->summaryview->folder_item) return;
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
threaded = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
2006-04-05 08:19:17 +02:00
|
|
|
|
|
|
|
mainwin->summaryview->folder_item->threaded = threaded;
|
|
|
|
|
|
|
|
mainwin->summaryview->threaded = threaded;
|
|
|
|
|
|
|
|
summary_show(mainwin->summaryview,
|
|
|
|
mainwin->summaryview->folder_item);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void expand_threads_cb(GtkAction *action, gpointer data)
|
2002-05-18 17:22:17 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-05-18 17:22:17 +02:00
|
|
|
summary_expand_threads(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void collapse_threads_cb(GtkAction *action, gpointer data)
|
2002-05-18 17:22:17 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-05-18 17:22:17 +02:00
|
|
|
summary_collapse_threads(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void set_summary_display_item_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2001-10-22 10:42:36 +02:00
|
|
|
prefs_summary_column_open();
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void set_folder_display_item_cb(GtkAction *action, gpointer data)
|
2005-08-05 21:57:42 +02:00
|
|
|
{
|
|
|
|
prefs_folder_column_open();
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void sort_summary_cb(GtkAction *action, GtkRadioAction *current, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-06-05 08:25:18 +02:00
|
|
|
FolderItem *item = mainwin->summaryview->folder_item;
|
2008-07-29 21:07:54 +02:00
|
|
|
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
|
2002-06-05 08:25:18 +02:00
|
|
|
|
|
|
|
if (mainwin->menu_lock_count) return;
|
2002-12-18 11:44:47 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current)) && item) {
|
|
|
|
summary_sort(mainwin->summaryview, (FolderSortKey)value,
|
|
|
|
item->sort_type);
|
|
|
|
item->sort_key = value;
|
2002-06-05 08:25:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void sort_summary_type_cb(GtkAction *gaction, GtkRadioAction *current, gpointer data)
|
2002-06-05 08:25:18 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-06-05 08:25:18 +02:00
|
|
|
FolderItem *item = mainwin->summaryview->folder_item;
|
2008-07-29 21:07:54 +02:00
|
|
|
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
|
2002-06-05 08:25:18 +02:00
|
|
|
|
|
|
|
if (mainwin->menu_lock_count) return;
|
2002-12-18 11:44:47 +01:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current)) && item)
|
2002-06-05 08:25:18 +02:00
|
|
|
summary_sort(mainwin->summaryview,
|
2008-07-29 21:07:54 +02:00
|
|
|
item->sort_key, (FolderSortType)value);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void attract_by_subject_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_attract_by_subject(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void delete_duplicated_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2004-05-10 12:22:28 +02:00
|
|
|
FolderItem *item;
|
|
|
|
|
2004-11-12 07:41:50 +01:00
|
|
|
item = folderview_get_selected_item(mainwin->folderview);
|
2004-05-10 12:22:28 +02:00
|
|
|
if (item) {
|
|
|
|
main_window_cursor_wait(mainwin);
|
|
|
|
STATUSBAR_PUSH(mainwin, _("Deleting duplicated messages..."));
|
|
|
|
|
|
|
|
folderutils_delete_duplicates(item, prefs_common.immediate_exec ?
|
|
|
|
DELETE_DUPLICATES_REMOVE : DELETE_DUPLICATES_SETFLAG);
|
|
|
|
|
|
|
|
STATUSBAR_POP(mainwin);
|
|
|
|
main_window_cursor_normal(mainwin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct DelDupsData
|
|
|
|
{
|
|
|
|
guint dups;
|
|
|
|
guint folders;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void deldup_all(FolderItem *item, gpointer _data)
|
|
|
|
{
|
|
|
|
struct DelDupsData *data = _data;
|
|
|
|
gint result;
|
|
|
|
|
|
|
|
result = folderutils_delete_duplicates(item, DELETE_DUPLICATES_REMOVE);
|
|
|
|
if (result >= 0) {
|
|
|
|
data->dups += result;
|
|
|
|
data->folders += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void delete_duplicated_all_cb(GtkAction *action, gpointer mw)
|
2004-05-10 12:22:28 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)mw;
|
2004-05-10 12:22:28 +02:00
|
|
|
struct DelDupsData data = {0, 0};
|
|
|
|
|
2006-11-10 18:31:44 +01:00
|
|
|
main_window_cursor_wait(mainwin);
|
2004-05-10 12:22:28 +02:00
|
|
|
folder_func_to_all_folders(deldup_all, &data);
|
2006-11-10 18:31:44 +01:00
|
|
|
main_window_cursor_normal(mainwin);
|
|
|
|
|
2005-05-06 10:16:44 +02:00
|
|
|
alertpanel_notice(ngettext("Deleted %d duplicate message in %d folders.\n",
|
|
|
|
"Deleted %d duplicate messages in %d folders.\n",
|
|
|
|
data.dups),
|
2004-05-10 12:22:28 +02:00
|
|
|
data.dups, data.folders);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void filter_cb(GtkAction *action, gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
summary_filter(mainwin->summaryview, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void filter_list_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
summary_filter(mainwin->summaryview, TRUE);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void process_cb(GtkAction *action, gpointer data)
|
2007-08-02 10:33:19 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-08-02 10:33:19 +02:00
|
|
|
FolderItem *item = mainwin->summaryview->folder_item;
|
|
|
|
g_return_if_fail(item != NULL);
|
|
|
|
|
2007-11-20 21:13:59 +01:00
|
|
|
item->processing_pending = TRUE;
|
2007-08-02 10:33:19 +02:00
|
|
|
folder_item_apply_processing(item);
|
2007-11-20 21:13:59 +01:00
|
|
|
item->processing_pending = FALSE;
|
2007-08-02 10:33:19 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void execute_summary_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_execute(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void update_summary_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderItem *fitem;
|
|
|
|
FolderView *folderview = mainwin->folderview;
|
|
|
|
|
|
|
|
if (!mainwin->summaryview->folder_item) return;
|
|
|
|
if (!folderview->opened) return;
|
|
|
|
|
2001-07-31 08:17:48 +02:00
|
|
|
folder_update_op_count();
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
fitem = gtk_ctree_node_get_row_data(GTK_CTREE(folderview->ctree),
|
|
|
|
folderview->opened);
|
|
|
|
if (!fitem) return;
|
|
|
|
|
2002-06-30 01:33:42 +02:00
|
|
|
folder_item_scan(fitem);
|
2002-07-25 14:21:11 +02:00
|
|
|
summary_show(mainwin->summaryview, fitem);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prev_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_step(mainwin->summaryview, GTK_SCROLL_STEP_BACKWARD);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void next_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
summary_step(mainwin->summaryview, GTK_SCROLL_STEP_FORWARD);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prev_unread_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-09-13 15:38:32 +02:00
|
|
|
summary_select_prev_unread(mainwin->summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void next_unread_cb(GtkAction *action, gpointer data)
|
2001-05-04 15:04:31 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-09-13 15:38:32 +02:00
|
|
|
summary_select_next_unread(mainwin->summaryview);
|
2001-05-04 15:04:31 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prev_new_cb(GtkAction *action, gpointer data)
|
2002-06-25 11:20:06 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-06-25 11:20:06 +02:00
|
|
|
summary_select_prev_new(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void next_new_cb(GtkAction *action, gpointer data)
|
2002-06-25 11:20:06 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-06-25 11:20:06 +02:00
|
|
|
summary_select_next_new(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prev_marked_cb(GtkAction *action, gpointer data)
|
2001-05-04 15:04:31 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-05-04 15:04:31 +02:00
|
|
|
summary_select_prev_marked(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void next_marked_cb(GtkAction *action, gpointer data)
|
2001-08-27 15:36:15 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-09-13 15:38:32 +02:00
|
|
|
summary_select_next_marked(mainwin->summaryview);
|
2001-08-27 15:36:15 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prev_labeled_cb(GtkAction *action, gpointer data)
|
2001-08-27 15:36:15 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-08-27 15:36:15 +02:00
|
|
|
summary_select_prev_labeled(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void next_labeled_cb(GtkAction *action, gpointer data)
|
2001-09-13 15:38:32 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-09-13 15:38:32 +02:00
|
|
|
summary_select_next_labeled(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void last_read_cb(GtkAction *action, gpointer data)
|
2006-07-31 14:11:12 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-07-31 14:11:12 +02:00
|
|
|
summary_select_last_read(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void parent_cb(GtkAction *action, gpointer data)
|
2006-07-31 14:11:12 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-07-31 14:11:12 +02:00
|
|
|
summary_select_parent(mainwin->summaryview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void goto_folder_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderItem *to_folder;
|
|
|
|
|
2008-02-12 11:44:26 +01:00
|
|
|
to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
if (to_folder)
|
|
|
|
folderview_select(mainwin->folderview, to_folder);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void goto_unread_folder_cb(GtkAction *action, gpointer data)
|
2006-06-22 08:37:06 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2006-09-01 09:39:44 +02:00
|
|
|
folderview_select_next_unread(mainwin->folderview, FALSE);
|
2006-06-22 08:37:06 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void copy_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
messageview_copy_clipboard(mainwin->messageview);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void allsel_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-06-11 23:46:03 +02:00
|
|
|
MessageView *msgview = mainwin->messageview;
|
|
|
|
|
2006-05-26 10:32:09 +02:00
|
|
|
if (messageview_is_visible(msgview) &&
|
2004-01-12 22:28:31 +01:00
|
|
|
(GTK_WIDGET_HAS_FOCUS(msgview->mimeview->textview->text)))
|
2001-04-19 14:21:46 +02:00
|
|
|
messageview_select_all(mainwin->messageview);
|
2006-05-26 10:32:09 +02:00
|
|
|
else
|
|
|
|
summary_select_all(mainwin->summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void select_thread_cb(GtkAction *action, gpointer data)
|
2002-02-28 12:58:02 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-01-13 19:23:51 +01:00
|
|
|
summary_select_thread(mainwin->summaryview, FALSE);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void delete_thread_cb(GtkAction *action, gpointer data)
|
2007-01-13 19:23:51 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-01-13 19:23:51 +01:00
|
|
|
summary_select_thread(mainwin->summaryview, TRUE);
|
2002-02-28 12:58:02 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void create_filter_cb(GtkAction *gaction, gpointer data)
|
2002-01-21 12:34:09 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
const gchar *a_name = gtk_action_get_name(gaction);
|
|
|
|
gint action = -1;
|
|
|
|
|
|
|
|
DO_ACTION("Tools/CreateFilterRule/Automatically", FILTER_BY_AUTO);
|
|
|
|
DO_ACTION("Tools/CreateFilterRule/ByFrom", FILTER_BY_FROM);
|
|
|
|
DO_ACTION("Tools/CreateFilterRule/ByTo", FILTER_BY_TO);
|
|
|
|
DO_ACTION("Tools/CreateFilterRule/BySubject", FILTER_BY_SUBJECT);
|
2004-01-12 22:28:31 +01:00
|
|
|
summary_filter_open(mainwin->summaryview, (PrefsFilterType)action, 0);
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void create_processing_cb(GtkAction *gaction, gpointer data)
|
2004-01-12 22:28:31 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
const gchar *a_name = gtk_action_get_name(gaction);
|
|
|
|
gint action = -1;
|
|
|
|
|
|
|
|
DO_ACTION("Tools/CreateProcessingRule/Automatically", FILTER_BY_AUTO);
|
|
|
|
DO_ACTION("Tools/CreateProcessingRule/ByFrom", FILTER_BY_FROM);
|
|
|
|
DO_ACTION("Tools/CreateProcessingRule/ByTo", FILTER_BY_TO);
|
|
|
|
DO_ACTION("Tools/CreateProcessingRule/BySubject", FILTER_BY_SUBJECT);
|
2004-01-12 22:28:31 +01:00
|
|
|
summary_filter_open(mainwin->summaryview, (PrefsFilterType)action, 1);
|
2002-01-21 12:34:09 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_pre_processing_open_cb(GtkAction *action, gpointer data)
|
2001-05-08 16:25:21 +02:00
|
|
|
{
|
2004-01-12 22:28:31 +01:00
|
|
|
prefs_filtering_open(&pre_global_processing,
|
|
|
|
_("Processing rules to apply before folder rules"),
|
2006-07-06 16:20:03 +02:00
|
|
|
MANUAL_ANCHOR_PROCESSING,
|
2006-07-31 13:44:30 +02:00
|
|
|
NULL, NULL, FALSE);
|
2004-01-12 22:28:31 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_post_processing_open_cb(GtkAction *action, gpointer data)
|
2004-01-12 22:28:31 +01:00
|
|
|
{
|
|
|
|
prefs_filtering_open(&post_global_processing,
|
|
|
|
_("Processing rules to apply after folder rules"),
|
2006-07-06 16:20:03 +02:00
|
|
|
MANUAL_ANCHOR_PROCESSING,
|
2006-07-31 13:44:30 +02:00
|
|
|
NULL, NULL, FALSE);
|
2001-05-08 16:25:21 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_filtering_open_cb(GtkAction *action, gpointer data)
|
2001-05-17 12:57:37 +02:00
|
|
|
{
|
2004-01-12 22:28:31 +01:00
|
|
|
prefs_filtering_open(&filtering_rules,
|
|
|
|
_("Filtering configuration"),
|
2006-07-06 16:20:03 +02:00
|
|
|
MANUAL_ANCHOR_FILTERING,
|
2006-07-31 13:44:30 +02:00
|
|
|
NULL, NULL, TRUE);
|
2001-05-17 12:57:37 +02:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_template_open_cb(GtkAction *action, gpointer data)
|
2001-11-07 11:29:45 +01:00
|
|
|
{
|
|
|
|
prefs_template_open();
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_actions_open_cb(GtkAction *action, gpointer data)
|
2002-02-06 12:15:31 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-02-06 12:15:31 +01:00
|
|
|
prefs_actions_open(mainwin);
|
|
|
|
}
|
2007-07-02 18:35:40 +02:00
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_tags_open_cb(GtkAction *action, gpointer data)
|
2007-07-02 18:35:40 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2007-10-25 18:56:50 +02:00
|
|
|
GSList * list = summary_get_selected_msg_list(mainwin->summaryview);
|
|
|
|
tag_apply_open(list);
|
2007-07-02 18:35:40 +02:00
|
|
|
}
|
2007-10-18 09:13:06 +02:00
|
|
|
#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
|
2008-07-29 21:07:54 +02:00
|
|
|
static void ssl_manager_open_cb(GtkAction *action, gpointer data)
|
2002-11-25 16:21:47 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-11-25 16:21:47 +01:00
|
|
|
ssl_manager_open(mainwin);
|
|
|
|
}
|
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_account_open_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2001-04-19 14:21:46 +02:00
|
|
|
if (!cur_account) {
|
2008-07-29 21:07:54 +02:00
|
|
|
new_account_cb(NULL, mainwin);
|
2001-04-19 14:21:46 +02:00
|
|
|
} else {
|
2002-10-13 17:43:22 +02:00
|
|
|
account_open(cur_account);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void new_account_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
account_edit_open(NULL, NULL);
|
2001-04-19 14:21:46 +02:00
|
|
|
if (!compose_get_compose_list()) account_add();
|
|
|
|
}
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
static void account_selector_menu_cb(GtkMenuItem *menuitem, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2005-08-10 09:25:16 +02:00
|
|
|
FolderItem *item = NULL;
|
2005-09-17 22:03:47 +02:00
|
|
|
cur_account = (PrefsAccount *)data;
|
2005-08-10 09:25:16 +02:00
|
|
|
|
|
|
|
if (!mainwindow_get_mainwindow())
|
|
|
|
return;
|
|
|
|
main_window_show_cur_account(mainwindow_get_mainwindow());
|
|
|
|
toolbar_update(TOOLBAR_MAIN, mainwindow_get_mainwindow());
|
|
|
|
main_window_set_menu_sensitive(mainwindow_get_mainwindow());
|
|
|
|
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
|
|
|
item = folderview_get_selected_item(
|
|
|
|
mainwindow_get_mainwindow()->folderview);
|
|
|
|
if (item) {
|
|
|
|
toolbar_set_compose_button
|
|
|
|
(mainwindow_get_mainwindow()->toolbar,
|
|
|
|
FOLDER_TYPE(item->folder) == F_NEWS ?
|
|
|
|
COMPOSEBUTTON_NEWS : COMPOSEBUTTON_MAIL);
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2004-02-21 12:01:01 +01:00
|
|
|
static void account_receive_menu_cb(GtkMenuItem *menuitem, gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)mainwin_list->data;
|
|
|
|
PrefsAccount *account = (PrefsAccount *)data;
|
|
|
|
|
|
|
|
inc_account_mail(mainwin, account);
|
|
|
|
}
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2006-05-12 19:42:48 +02:00
|
|
|
static void account_compose_menu_cb(GtkMenuItem *menuitem, gpointer data)
|
|
|
|
{
|
|
|
|
PrefsAccount *account = (PrefsAccount *)data;
|
|
|
|
|
2007-08-28 23:06:30 +02:00
|
|
|
compose_new_with_folderitem(account, NULL, NULL);
|
2006-05-12 19:42:48 +02:00
|
|
|
}
|
2007-10-12 13:26:39 +02:00
|
|
|
#endif
|
2008-07-29 21:07:54 +02:00
|
|
|
static void prefs_open_cb(GtkAction *action, gpointer data)
|
2002-12-31 15:43:41 +01:00
|
|
|
{
|
2003-01-06 19:54:30 +01:00
|
|
|
prefs_gtk_open();
|
2002-12-31 15:43:41 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void plugins_open_cb(GtkAction *action, gpointer data)
|
2003-01-01 17:30:29 +01:00
|
|
|
{
|
|
|
|
pluginwindow_create();
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void manual_open_cb(GtkAction *action, gpointer data)
|
|
|
|
{
|
|
|
|
manual_open(MANUAL_MANUAL_CLAWS, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void manual_faq_open_cb(GtkAction *action, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
manual_open(MANUAL_FAQ_CLAWS, NULL);
|
2002-03-05 17:30:04 +01:00
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void legend_open_cb(GtkAction *action, gpointer data)
|
2005-12-09 15:31:58 +01:00
|
|
|
{
|
|
|
|
legend_show();
|
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
static void scan_tree_func(Folder *folder, FolderItem *item, gpointer data)
|
|
|
|
{
|
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
|
|
|
gchar *str;
|
|
|
|
|
|
|
|
if (item->path)
|
|
|
|
str = g_strdup_printf(_("Scanning folder %s%c%s ..."),
|
|
|
|
LOCAL_FOLDER(folder)->rootpath,
|
|
|
|
G_DIR_SEPARATOR,
|
|
|
|
item->path);
|
|
|
|
else
|
|
|
|
str = g_strdup_printf(_("Scanning folder %s ..."),
|
|
|
|
LOCAL_FOLDER(folder)->rootpath);
|
|
|
|
|
|
|
|
STATUSBAR_PUSH(mainwin, str);
|
|
|
|
STATUSBAR_POP(mainwin);
|
|
|
|
g_free(str);
|
|
|
|
}
|
2001-06-24 13:45:04 +02:00
|
|
|
|
2002-12-29 17:11:53 +01:00
|
|
|
static gboolean mainwindow_focus_in_event(GtkWidget *widget, GdkEventFocus *focus,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
SummaryView *summary;
|
|
|
|
|
|
|
|
g_return_val_if_fail(data, FALSE);
|
2006-05-29 18:42:33 +02:00
|
|
|
if (!g_list_find(mainwin_list, data))
|
|
|
|
return TRUE;
|
2002-12-29 17:11:53 +01:00
|
|
|
summary = ((MainWindow *)data)->summaryview;
|
|
|
|
g_return_val_if_fail(summary, FALSE);
|
2004-01-12 22:28:31 +01:00
|
|
|
|
|
|
|
if (GTK_CLIST(summary->ctree)->selection &&
|
|
|
|
g_list_length(GTK_CLIST(summary->ctree)->selection) > 1)
|
|
|
|
return FALSE;
|
|
|
|
|
2002-12-29 17:11:53 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-01-28 13:05:08 +01:00
|
|
|
static gboolean mainwindow_visibility_event_cb(GtkWidget *widget, GdkEventVisibility *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
is_obscured = (event->state == GDK_VISIBILITY_FULLY_OBSCURED);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-03-06 11:16:20 +01:00
|
|
|
static gboolean mainwindow_state_event_cb(GtkWidget *widget, GdkEventWindowState *state,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
if (!claws_is_starting()
|
|
|
|
&& state->changed_mask&GDK_WINDOW_STATE_ICONIFIED
|
|
|
|
&& state->new_window_state&GDK_WINDOW_STATE_ICONIFIED) {
|
|
|
|
|
|
|
|
if (iconified_count > 0)
|
|
|
|
hooks_invoke(MAIN_WINDOW_GOT_ICONIFIED, NULL);
|
|
|
|
iconified_count++;
|
2007-12-27 20:26:13 +01:00
|
|
|
} else if (!claws_is_starting()) {
|
|
|
|
prefs_common.mainwin_maximised =
|
|
|
|
((state->new_window_state&GDK_WINDOW_STATE_MAXIMIZED) != 0);
|
2007-03-06 11:16:20 +01:00
|
|
|
}
|
|
|
|
if (state->new_window_state == 0)
|
|
|
|
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(widget), FALSE);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-01-28 13:05:08 +01:00
|
|
|
gboolean mainwindow_is_obscured(void)
|
|
|
|
{
|
|
|
|
return is_obscured;
|
|
|
|
}
|
|
|
|
|
2002-04-08 05:51:28 +02:00
|
|
|
/*
|
2002-04-20 05:35:55 +02:00
|
|
|
* Harvest addresses for selected folder.
|
2002-04-08 05:51:28 +02:00
|
|
|
*/
|
2008-07-29 21:07:54 +02:00
|
|
|
static void addr_harvest_cb( GtkAction *action, gpointer data)
|
2002-03-16 08:07:34 +01:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-04-20 05:35:55 +02:00
|
|
|
addressbook_harvest( mainwin->summaryview->folder_item, FALSE, NULL );
|
2002-04-08 05:51:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2002-04-20 05:35:55 +02:00
|
|
|
* Harvest addresses for selected messages in summary view.
|
2002-04-08 05:51:28 +02:00
|
|
|
*/
|
2008-07-29 21:07:54 +02:00
|
|
|
static void addr_harvest_msg_cb( GtkAction *action, gpointer data)
|
2002-04-08 05:51:28 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2002-04-20 05:35:55 +02:00
|
|
|
summary_harvest_address( mainwin->summaryview );
|
2002-03-16 08:07:34 +01:00
|
|
|
}
|
|
|
|
|
2003-01-11 11:50:29 +01:00
|
|
|
/*!
|
|
|
|
*\brief get a MainWindow
|
|
|
|
*
|
|
|
|
*\return MainWindow * The first mainwindow in the mainwin_list
|
|
|
|
*/
|
|
|
|
MainWindow *mainwindow_get_mainwindow(void)
|
|
|
|
{
|
|
|
|
if (mainwin_list && mainwin_list->data)
|
|
|
|
return (MainWindow *)(mainwin_list->data);
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-01-20 20:54:05 +01:00
|
|
|
static gboolean mainwindow_progressindicator_hook(gpointer source, gpointer userdata)
|
2003-03-03 21:45:57 +01:00
|
|
|
{
|
|
|
|
ProgressData *data = (ProgressData *) source;
|
|
|
|
MainWindow *mainwin = (MainWindow *) userdata;
|
|
|
|
|
|
|
|
switch (data->cmd) {
|
|
|
|
case PROGRESS_COMMAND_START:
|
|
|
|
case PROGRESS_COMMAND_STOP:
|
2004-07-28 16:04:05 +02:00
|
|
|
gtk_progress_bar_set_fraction
|
|
|
|
(GTK_PROGRESS_BAR(mainwin->progressbar), 0.0);
|
|
|
|
break;
|
2003-03-03 21:45:57 +01:00
|
|
|
case PROGRESS_COMMAND_SET_PERCENTAGE:
|
2004-07-28 16:04:05 +02:00
|
|
|
gtk_progress_bar_set_fraction
|
|
|
|
(GTK_PROGRESS_BAR(mainwin->progressbar), data->value);
|
2003-03-03 21:45:57 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
while (gtk_events_pending()) gtk_main_iteration ();
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-07-29 21:07:54 +02:00
|
|
|
static void sync_cb(GtkAction *action, gpointer data)
|
2005-09-08 20:28:36 +02:00
|
|
|
{
|
2008-07-29 21:07:54 +02:00
|
|
|
MainWindow *mainwin = (MainWindow *)data;
|
2005-09-08 20:28:36 +02:00
|
|
|
mainwindow_check_synchronise(mainwin, FALSE);
|
|
|
|
}
|
|
|
|
|
2006-02-27 18:47:53 +01:00
|
|
|
void mainwindow_learn (MainWindow *mainwin, gboolean is_spam)
|
|
|
|
{
|
|
|
|
summary_mark_as_spam(mainwin->summaryview, is_spam, NULL);
|
|
|
|
}
|
2006-04-10 18:51:13 +02:00
|
|
|
|
2007-06-08 15:18:44 +02:00
|
|
|
void mainwindow_jump_to(const gchar *target, gboolean popup)
|
2006-04-10 18:51:13 +02:00
|
|
|
{
|
|
|
|
gchar *tmp = NULL;
|
|
|
|
gchar *p = NULL;
|
|
|
|
FolderItem *item = NULL;
|
|
|
|
gchar *msg = NULL;
|
|
|
|
MainWindow *mainwin = mainwindow_get_mainwindow();
|
2008-01-23 07:43:15 +01:00
|
|
|
gchar *from_uri = NULL;
|
2006-04-10 18:51:13 +02:00
|
|
|
if (!target)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!mainwin) {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("not initialized\n");
|
2006-04-10 18:51:13 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-01-23 07:43:15 +01:00
|
|
|
if ((from_uri = g_filename_from_uri(target, NULL, NULL)) != NULL)
|
|
|
|
tmp = from_uri;
|
|
|
|
else
|
|
|
|
tmp = g_strdup(target);
|
2006-04-10 18:51:13 +02:00
|
|
|
|
|
|
|
if ((p = strstr(tmp, "\r")) != NULL)
|
|
|
|
*p = '\0';
|
|
|
|
if ((p = strstr(tmp, "\n")) != NULL)
|
|
|
|
*p = '\0';
|
|
|
|
|
|
|
|
if ((item = folder_find_item_from_identifier(tmp))) {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("selecting folder '%s'\n", tmp);
|
2006-04-10 18:51:13 +02:00
|
|
|
folderview_select(mainwin->folderview, item);
|
2007-06-08 15:18:44 +02:00
|
|
|
if (popup)
|
|
|
|
main_window_popup(mainwin);
|
2006-04-10 18:51:13 +02:00
|
|
|
g_free(tmp);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
msg = strrchr(tmp, G_DIR_SEPARATOR);
|
|
|
|
if (msg) {
|
|
|
|
*msg++ = '\0';
|
|
|
|
if ((item = folder_find_item_from_identifier(tmp))) {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("selecting folder '%s'\n", tmp);
|
2006-04-10 18:51:13 +02:00
|
|
|
folderview_select(mainwin->folderview, item);
|
2008-01-23 07:43:15 +01:00
|
|
|
} else if ((item = folder_find_item_from_real_path(tmp))) {
|
|
|
|
g_print("selecting folder '%s'\n", tmp);
|
|
|
|
folderview_select(mainwin->folderview, item);
|
2007-01-05 08:45:41 +01:00
|
|
|
} else {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("'%s' not found\n", tmp);
|
2007-01-05 08:45:41 +01:00
|
|
|
}
|
2006-04-10 18:51:13 +02:00
|
|
|
if (item && msg && atoi(msg)) {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("selecting message %d\n", atoi(msg));
|
2006-04-10 18:51:13 +02:00
|
|
|
summary_select_by_msgnum(mainwin->summaryview, atoi(msg));
|
|
|
|
summary_display_msg_selected(mainwin->summaryview, FALSE);
|
2007-06-08 15:18:44 +02:00
|
|
|
if (popup)
|
|
|
|
main_window_popup(mainwin);
|
2006-04-10 18:51:13 +02:00
|
|
|
g_free(tmp);
|
|
|
|
return;
|
2007-01-05 08:45:41 +01:00
|
|
|
} 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) {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("selecting message %s\n", msg);
|
2007-01-05 08:45:41 +01:00
|
|
|
summary_select_by_msgnum(mainwin->summaryview, msginfo->msgnum);
|
|
|
|
summary_display_msg_selected(mainwin->summaryview, FALSE);
|
2007-06-08 15:18:44 +02:00
|
|
|
if (popup)
|
|
|
|
main_window_popup(mainwin);
|
2007-01-05 08:45:41 +01:00
|
|
|
g_free(tmp);
|
|
|
|
procmsg_msginfo_free(msginfo);
|
|
|
|
return;
|
|
|
|
} else {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("'%s' not found\n", msg);
|
2007-01-05 08:45:41 +01:00
|
|
|
}
|
|
|
|
} else {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("'%s' not found\n", msg);
|
2007-01-05 08:45:41 +01:00
|
|
|
}
|
|
|
|
} else {
|
2007-08-21 11:17:38 +02:00
|
|
|
g_print("'%s' not found\n", tmp);
|
2006-04-10 18:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free(tmp);
|
|
|
|
}
|
2007-03-21 18:44:45 +01:00
|
|
|
|
|
|
|
void mainwindow_exit_folder(MainWindow *mainwin) {
|
2007-03-22 08:52:47 +01:00
|
|
|
if (prefs_common.layout_mode == SMALL_LAYOUT) {
|
2007-03-21 18:44:45 +01:00
|
|
|
folderview_close_opened(mainwin->folderview);
|
|
|
|
mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
|
2008-01-20 17:12:18 +01:00
|
|
|
gtk_widget_grab_focus(mainwin->folderview->ctree);
|
2007-03-21 18:44:45 +01:00
|
|
|
}
|
2007-04-20 18:03:00 +02:00
|
|
|
mainwin->in_folder = FALSE;
|
2008-06-03 20:27:47 +02:00
|
|
|
main_window_set_menu_sensitive(mainwin);
|
2007-03-21 18:44:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void mainwindow_enter_folder(MainWindow *mainwin) {
|
2007-03-22 08:52:47 +01:00
|
|
|
if (prefs_common.layout_mode == SMALL_LAYOUT) {
|
2007-03-21 18:44:45 +01:00
|
|
|
mainwin_paned_show_last(GTK_PANED(mainwin->hpaned));
|
|
|
|
}
|
2007-04-20 18:03:00 +02:00
|
|
|
mainwin->in_folder = TRUE;
|
2008-06-03 20:27:47 +02:00
|
|
|
main_window_set_menu_sensitive(mainwin);
|
2007-03-21 18:44:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef MAEMO
|
|
|
|
gboolean maemo_mainwindow_is_fullscreen(GtkWidget *widget)
|
|
|
|
{
|
|
|
|
gint w, h;
|
|
|
|
gtk_window_get_size(GTK_WINDOW(widget), &w, &h);
|
|
|
|
return (w == 800);
|
|
|
|
}
|
|
|
|
|
|
|
|
void maemo_window_full_screen_if_needed (GtkWindow *window)
|
|
|
|
{
|
|
|
|
if (maemo_mainwindow_is_fullscreen(mainwindow_get_mainwindow()->window)) {
|
|
|
|
gtk_window_fullscreen(GTK_WINDOW(window));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void maemo_connect_key_press_to_mainwindow (GtkWindow *window)
|
|
|
|
{
|
|
|
|
g_signal_connect(G_OBJECT(window), "key_press_event",
|
|
|
|
G_CALLBACK(mainwindow_key_pressed), mainwindow_get_mainwindow());
|
|
|
|
}
|
|
|
|
#endif
|