* src/mainwindow.c
[claws.git] / src / mainwindow.c
index cadc7d52eacfd221589f4b5457ab1f09e13d0a58..390fac0884dafe6c72c96b3bf6a183aba36d228e 100644 (file)
@@ -67,6 +67,7 @@
 #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"
@@ -413,8 +414,9 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {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, add_mailbox_cb, 0, NULL},
-       {N_("/_File/_Add mbox mailbox..."),     NULL, add_mbox_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},
@@ -972,7 +974,7 @@ MainWindow *main_window_create(SeparateType type)
        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)        \
@@ -1198,7 +1200,7 @@ void main_window_separation_change(MainWindow *mainwin, SeparateType type)
 {
        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",
@@ -1529,8 +1531,9 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        } entry[] = {
                {"/File/Folder"                               , M_UNLOCKED},
                {"/File/Add mailbox..."                       , M_UNLOCKED},
-                {"/File/Add mbox mailbox..."                         , M_UNLOCKED},
-               {"/File/Import mbox file..."                  , 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},
@@ -1685,6 +1688,48 @@ void main_window_popup(MainWindow *mainwin)
        }
 }
 
+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;
@@ -2613,6 +2658,9 @@ static void account_menu_cb(GtkMenuItem   *menuitem, gpointer data)
 {
        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)