#include "prefs_filtering.h"
#include "prefs_account.h"
#include "prefs_summary_column.h"
+#include "prefs_folder_column.h"
#include "prefs_template.h"
#include "action.h"
#include "account.h"
static gboolean ac_label_button_pressed (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
-static void ac_menu_popup_closed (GtkMenuShell *menu_shell,
- gpointer data);
static gint main_window_close_cb (GtkWidget *widget,
GdkEventAny *event,
guint action,
GtkWidget *widget);
-static void set_display_item_cb (MainWindow *mainwin,
+static void set_summary_display_item_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+static void set_folder_display_item_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
static void sort_summary_cb (MainWindow *mainwin,
{N_("/_View/E_xpand all threads"), NULL, expand_threads_cb, 0, NULL},
{N_("/_View/Co_llapse all threads"), NULL, collapse_threads_cb, 0, NULL},
{N_("/_View/_Hide read messages"), NULL, hide_read_messages, 0, "<ToggleItem>"},
- {N_("/_View/Set displayed _items..."), NULL, set_display_item_cb, 0, NULL},
+ {N_("/_View/Set displayed _columns"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_View/Set displayed _columns/in _Folder list..."), NULL, set_folder_display_item_cb, 0, NULL},
+ {N_("/_View/Set displayed _columns/in _Message list..."),NULL, set_summary_display_item_cb, 0, NULL},
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_View/_Go to"), NULL, NULL, 0, "<Branch>"},
GtkWidget *menuitem;
gint i;
guint n_menu_entries;
- gboolean hide_messageview = FALSE;
static GdkGeometry geometry;
menu_set_sensitive(ifactory, "/Help/Manual (Local)", manual_available(MANUAL_MANUAL_LOCAL));
menu_set_sensitive(ifactory, "/Help/FAQ (Local)", manual_available(MANUAL_FAQ_LOCAL));
- 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);
-
+ 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);
+ }
/* link window to mainwin->window to avoid gdk warnings */
mainwin->window = window;
color[2] = folderview->color_new;
color[3] = folderview->color_op;
- colormap = gdk_window_get_colormap(window->window);
+ colormap = gdk_drawable_get_colormap(window->window);
gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success);
for (i = 0; i < 4; i++) {
if (success[i] == FALSE)
debug_print("done.\n");
messageview->visible = prefs_common.msgview_visible;
- hide_messageview = !messageview->visible;
-
+
main_window_set_widgets(mainwin, type);
g_signal_connect(G_OBJECT(window), "size_allocate",
/* set account selection menu */
ac_menu = gtk_item_factory_get_widget
(ifactory, "/Configuration/Change current account");
- g_signal_connect(G_OBJECT(ac_menu), "selection_done",
- G_CALLBACK(ac_menu_popup_closed), mainwin);
mainwin->ac_menu = ac_menu;
toolbar_main_set_sensitive(mainwin);
if (prefs_common.work_offline)
online_switch_clicked (GTK_BUTTON(online_switch), mainwin);
- if (mainwin->type == SEPARATE_NONE && hide_messageview)
- main_window_toggle_message_view(mainwin);
-
return mainwin;
}
main_window_reflect_prefs_all_real(FALSE);
}
-static gboolean reflect_prefs_timeout_cb(gboolean *data)
+static gboolean reflect_prefs_timeout_cb(gpointer data)
{
- gboolean pixmap_theme_changed = *data;
+ gboolean pixmap_theme_changed = GPOINTER_TO_INT(data);
GList *cur;
MainWindow *mainwin;
GtkWidget *pixmap;
void main_window_reflect_prefs_all_real(gboolean pixmap_theme_changed)
{
if (prefs_tag == 0 || pixmap_theme_changed) {
- prefs_tag = g_timeout_add(500, reflect_prefs_timeout_cb, &pixmap_theme_changed);
+ prefs_tag = g_timeout_add(500, reflect_prefs_timeout_cb,
+ GINT_TO_POINTER(pixmap_theme_changed));
}
}
}
}
+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);
+ }
+}
+
static void main_window_set_account_selector_menu(MainWindow *mainwin,
GList *account_list)
{
folder = FOLDER(list->data);
if (folder && folder->trash && folder->trash->total_msgs > 0)
has_trash++;
+ if (folder->account && folder->account->set_trash_folder &&
+ folder_find_item_from_identifier(folder->account->trash_folder))
+ has_trash++;
}
if (!has_trash) return;
if (confirm) {
if (alertpanel(_("Empty trash"),
- _("Empty all messages in trash?"),
+ _("Delete all messages in trash folders?"),
GTK_STOCK_YES, GTK_STOCK_NO, NULL)
!= G_ALERTDEFAULT)
return;
state |= M_NOT_NEWS;
if (selection == SUMMARY_SELECTED_SINGLE &&
(item &&
- (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
- item->stype == F_QUEUE)))
+ (folder_has_parent_of_type(item, F_DRAFT) ||
+ folder_has_parent_of_type(item, F_OUTBOX) ||
+ folder_has_parent_of_type(item, F_QUEUE))))
state |= M_ALLOW_REEDIT;
if (cur_account)
state |= M_HAVE_ACCOUNT;
return TRUE;
}
-static void ac_menu_popup_closed(GtkMenuShell *menu_shell, gpointer data)
-{
- MainWindow *mainwin = (MainWindow *)data;
- GtkWidget *button;
-
- button = g_object_get_data(G_OBJECT(menu_shell), "menu_button");
- if (!button) return;
- gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
- g_object_set_data(G_OBJECT(mainwin->ac_menu), "menu_button", NULL);
- manage_window_focus_in(mainwin->window, NULL, NULL);
-}
-
static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event,
gpointer data)
{
summary_collapse_threads(mainwin->summaryview);
}
-static void set_display_item_cb(MainWindow *mainwin, guint action,
+static void set_summary_display_item_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
prefs_summary_column_open();
}
+static void set_folder_display_item_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ prefs_folder_column_open();
+}
+
static void sort_summary_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
static void account_selector_menu_cb(GtkMenuItem *menuitem, gpointer data)
{
cur_account = (PrefsAccount *)data;
- main_window_reflect_prefs_all();
+ FolderItem *item = NULL;
+
+ 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());
+ gtk_button_set_relief(GTK_BUTTON(mainwindow_get_mainwindow()->ac_button), GTK_RELIEF_NONE);
+ 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);
+ }
}
static void account_receive_menu_cb(GtkMenuItem *menuitem, gpointer data)