#include "compose.h"
#include "procmsg.h"
#include "import.h"
+#include "export.h"
#include "prefs_common.h"
#include "prefs_filter.h"
#include "prefs_account.h"
static void import_mbox_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static void export_mbox_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void empty_trash_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
{N_("/_File/_Folder/_Rename folder..."),NULL, rename_folder_cb, 0, NULL},
{N_("/_File/_Folder/_Delete folder"), NULL, delete_folder_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"), NULL, empty_trash_cb, 0, NULL},
{N_("/_File/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_File/_Save as..."), NULL, save_as_cb, 0, NULL},
static void import_mbox_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- import_mbox();
+ import_mbox(mainwin->summaryview->folder_item);
+}
+
+static void export_mbox_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ export_mbox(mainwin->summaryview->folder_item);
}
static void empty_trash_cb(MainWindow *mainwin, guint action,
summary_print(mainwin->summaryview);
}
+static gint queued_messages(void)
+{
+ FolderItem *queue = folder_get_default_queue();
+ folder_item_scan(queue);
+ return queue->total;
+}
+
static void app_exit_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
if (prefs_common.confirm_on_exit) {
return;
}
+ if (prefs_common.warn_queued_on_exit && queued_messages() > 0) {
+ if (alertpanel(_("Queued messages"),
+ _("Some unsent messages are queued. Exit now?"),
+ _("OK"), _("Cancel"), NULL) != G_ALERTDEFAULT)
+ return;
+ }
+
manage_window_focus_in(mainwin->window, NULL, NULL);
app_will_exit(widget, mainwin);
}