/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "prefs_folder_item.h"
#include "prefs_summary_column.h"
#include "prefs_template.h"
+#include "action.h"
#include "account.h"
#include "addressbook.h"
#include "logwindow.h"
GdkEventAny *event,
gpointer data);
-static void add_mailbox_cb (MainWindow *mainwin,
+static void new_folder_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
static void add_mbox_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-static void update_folderview_cb (MainWindow *mainwin,
+static void rename_folder_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-static void new_folder_cb (MainWindow *mainwin,
+static void delete_folder_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-static void rename_folder_cb (MainWindow *mainwin,
+static void update_folderview_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-static void delete_folder_cb (MainWindow *mainwin,
+static void add_mailbox_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
static void import_mbox_cb (MainWindow *mainwin,
static void log_window_show_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-static void sel_download_cb (MainWindow *mainwin,
- guint action,
- GtkWidget *widget);
static void inc_cancel_cb (MainWindow *mainwin,
guint action,
static GtkItemFactoryEntry mainwin_entries[] =
{
{N_("/_File"), NULL, NULL, 0, "<Branch>"},
- {N_("/_File/_Add mailbox..."), NULL, add_mailbox_cb, 0, NULL},
- {N_("/_File/_Add mbox mailbox..."), NULL, add_mbox_cb, 0, NULL},
- {N_("/_File/_Check for new messages in all folders"),
- NULL, update_folderview_cb, 0, NULL},
{N_("/_File/_Folder"), NULL, NULL, 0, "<Branch>"},
{N_("/_File/_Folder/Create _new folder..."),
NULL, new_folder_cb, 0, NULL},
{N_("/_File/_Folder/_Rename folder..."),NULL, rename_folder_cb, 0, NULL},
{N_("/_File/_Folder/_Delete folder"), NULL, delete_folder_cb, 0, NULL},
+ {N_("/_File/_Folder/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_File/_Folder/_Check for new messages in all folders"),
+ NULL, update_folderview_cb, 0, NULL},
+ {N_("/_File/_Add mailbox"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_File/_Add mailbox/MH..."), NULL, add_mailbox_cb, 0, NULL},
+ {N_("/_File/_Add mailbox/mbox..."), NULL, add_mbox_cb, 0, NULL},
{N_("/_File/_Import mbox file..."), NULL, import_mbox_cb, 0, NULL},
{N_("/_File/_Export to mbox file..."), NULL, export_mbox_cb, 0, NULL},
{N_("/_File/Empty _trash"), "<shift>D", empty_trash_cb, 0, NULL},
toolbar_main_set_sensitive(mainwin);
/* create actions menu */
- update_mainwin_actions_menu(ifactory, mainwin);
+ action_update_mainwin_menu(ifactory, mainwin);
/* attach accel groups to main window */
#define ADD_MENU_ACCEL_GROUP_TO_WINDOW(menu,win) \
{
GtkWidget *folder_wid = GTK_WIDGET_PTR(mainwin->folderview);
GtkWidget *summary_wid = GTK_WIDGET_PTR(mainwin->summaryview);
- //GtkWidget *message_wid = GTK_WIDGET_PTR(mainwin->messageview);
+ /* GtkWidget *message_wid = GTK_WIDGET_PTR(mainwin->messageview); */
GtkWidget *message_wid = mainwin->messageview->vbox;
debug_print("Changing window separation type from %d to %d\n",
for (has_trash = 0, list = folder_get_list(); list != NULL; list = list->next) {
folder = FOLDER(list->data);
- if (folder && folder->trash && folder->trash->total > 0)
+ if (folder && folder->trash && folder->trash->total_msgs > 0)
has_trash++;
}
path);
g_free(path);
- if (folder->class->create_tree(folder) < 0) {
+ if (folder->klass->create_tree(folder) < 0) {
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);
g_basename(path), path);
g_free(path);
- if (folder->class->create_tree(folder) < 0) {
+ if (folder->klass->create_tree(folder) < 0) {
alertpanel_error(_("Creation of the mailbox failed."));
folder_destroy(folder);
return;
if (selection == SUMMARY_SELECTED_SINGLE)
state |= M_SINGLE_TARGET_EXIST;
if (mainwin->summaryview->folder_item &&
- mainwin->summaryview->folder_item->folder->class->type == F_NEWS)
+ mainwin->summaryview->folder_item->folder->klass->type == F_NEWS)
state |= M_NEWS;
else
state |= M_NOT_NEWS;
gchar *const entry;
SensitiveCond cond;
} entry[] = {
- {"/File/Add mailbox..." , M_UNLOCKED},
- {"/File/Add mbox mailbox..." , M_UNLOCKED},
- {"/File/Check for new messages in all folders", M_UNLOCKED},
{"/File/Folder" , M_UNLOCKED},
- {"/File/Import mbox file..." , M_UNLOCKED},
+ {"/File/Add mailbox..." , M_UNLOCKED},
+
+ {"/File/Add mailbox/MH..." , M_UNLOCKED},
+ {"/File/Add mailbox/mbox..." , M_UNLOCKED},
{"/File/Export to mbox file..." , M_UNLOCKED},
{"/File/Empty trash" , M_UNLOCKED},
{"/File/Work offline" , M_UNLOCKED},
}
}
+void main_window_show(MainWindow *mainwin)
+{
+ gtk_widget_show(mainwin->window);
+ gtk_widget_show(mainwin->vbox_body);
+
+ switch (mainwin->type) {
+ case SEPARATE_FOLDER:
+ gtk_widget_show(mainwin->win.sep_folder.folderwin);
+ break;
+ case SEPARATE_MESSAGE:
+ gtk_widget_show(mainwin->win.sep_message.messagewin);
+ break;
+ case SEPARATE_BOTH:
+ gtk_widget_show(mainwin->win.sep_both.folderwin);
+ gtk_widget_show(mainwin->win.sep_both.messagewin);
+ break;
+ default:
+ break;
+ }
+}
+
+void main_window_hide(MainWindow *mainwin)
+{
+ gtk_widget_hide(mainwin->window);
+ gtk_widget_hide(mainwin->vbox_body);
+
+ switch (mainwin->type) {
+ case SEPARATE_FOLDER:
+ gtk_widget_hide(mainwin->win.sep_folder.folderwin);
+ break;
+ case SEPARATE_MESSAGE:
+ gtk_widget_hide(mainwin->win.sep_message.messagewin);
+ break;
+ case SEPARATE_BOTH:
+ gtk_widget_hide(mainwin->win.sep_both.folderwin);
+ gtk_widget_hide(mainwin->win.sep_both.messagewin);
+ break;
+ default:
+ break;
+ }
+}
+
static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
{
GtkWidget *folderwin = NULL;
{
cur_account = (PrefsAccount *)data;
main_window_reflect_prefs_all();
+ debug_print("XXX set account %s\n", cur_account == NULL ?
+ (const gchar *) "NULL ACCOUNT POINTER" :
+ cur_account->account_name);
}
static void prefs_open_cb(GtkMenuItem *menuitem, gpointer data)