0.9.7claws10
[claws.git] / src / mainwindow.c
index 016ea8ee1ef8e86743a6cb849500b68aaf3ace0f..d68ba0c6bb433a1874459360a1b118ad025a4518 100644 (file)
@@ -86,6 +86,7 @@
 #include "pluginwindow.h"
 #include "hooks.h"
 #include "progressindicator.h"
+#include "localfolder.h"
 
 #define AC_LABEL_WIDTH 240
 
@@ -136,9 +137,6 @@ static void message_window_size_allocate_cb (GtkWidget      *widget,
 static void new_folder_cb       (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-static void add_mbox_cb         (MainWindow    *mainwin,
-                                 guint          action,
-                                 GtkWidget     *widget);
 static void rename_folder_cb    (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
@@ -425,7 +423,6 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                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},
@@ -1483,38 +1480,6 @@ void main_window_add_mailbox(MainWindow *mainwin)
        folderview_set(mainwin->folderview);
 }
 
-void main_window_add_mbox(MainWindow *mainwin)
-{
-       gchar *path;
-       Folder *folder;
-
-       path = input_dialog(_("Add mbox mailbox"),
-                           _("Input the location of mailbox."),
-                           "mail");
-
-       if (!path) return;
-
-       if (folder_find_from_path(path)) {
-               alertpanel_error(_("The mailbox `%s' already exists."), path);
-               g_free(path);
-               return;
-       }
-
-       folder = folder_new(folder_get_class_from_string("mbox"), 
-                           g_basename(path), path);
-       g_free(path);
-
-       if (folder->klass->create_tree(folder) < 0) {
-               alertpanel_error(_("Creation of the mailbox failed."));
-               folder_destroy(folder);
-               return;
-       }
-
-       folder_add(folder);
-
-       folderview_set(mainwin->folderview);
-}
-
 SensitiveCond main_window_get_current_state(MainWindow *mainwin)
 {
        SensitiveCond state = 0;
@@ -1596,7 +1561,6 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/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},
@@ -1950,12 +1914,23 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
 
                break;
        case SEPARATE_BOTH:
+               messageview_add_toolbar(mainwin->messageview, messagewin);
+               msgview_ifactory = gtk_item_factory_from_widget(mainwin->messageview->menubar);
+               menu_set_sensitive(msgview_ifactory, "/File/Close", FALSE);
+
                gtk_box_pack_start(GTK_BOX(vbox_body),
                                   GTK_WIDGET_PTR(mainwin->summaryview),
                                   TRUE, TRUE, 0);
-
+               
                mainwin->win.sep_both.folderwin = folderwin;
                mainwin->win.sep_both.messagewin = messagewin;
+               
+               gtk_widget_realize(messagewin);
+               gtk_widget_show_all(GTK_WIDGET_PTR(mainwin->messageview));
+               gtk_widget_show_all(messagewin);
+               toolbar_set_style(mainwin->messageview->toolbar->toolbar, 
+                                 mainwin->messageview->handlebox, 
+                                 prefs_common.toolbar_style);          
 
                break;
        }
@@ -2159,12 +2134,6 @@ static void add_mailbox_cb(MainWindow *mainwin, guint action,
        main_window_add_mailbox(mainwin);
 }
 
-static void add_mbox_cb(MainWindow *mainwin, guint action,
-                       GtkWidget *widget)
-{
-       main_window_add_mbox(mainwin);
-}
-
 static void update_folderview_cb(MainWindow *mainwin, guint action,
                                 GtkWidget *widget)
 {