gint source,
GdkInputCondition condition);
-gchar *get_socket_name (void);
-
-
static void open_compose_new (const gchar *address,
GPtrArray *attach_files);
}
#endif /* HAVE_STARTUP_NOTIFICATION */
-void claws_gtk_idle(void)
+static void claws_gtk_idle(void)
{
while(gtk_events_pending()) {
gtk_main_iteration();
g_usleep(50000);
}
-gboolean defer_check_all(void *data)
+static gboolean defer_check_all(void *data)
{
gboolean autochk = GPOINTER_TO_INT(data);
return FALSE;
}
-gboolean defer_check(void *data)
+static gboolean defer_check(void *data)
{
inc_mail(static_mainwindow, prefs_common.newmail_notify_manu);
imap_gtk_init();
news_gtk_init();
- mainwin = main_window_create
- (prefs_common.sep_folder | prefs_common.sep_msg << 1);
+ mainwin = main_window_create();
manage_window_focus_in(mainwin->window, NULL, NULL);
folderview = mainwin->folderview;
prefs_destroy_cache();
+ compose_reopen_exit_drafts();
+
sc_starting = FALSE;
END_TIMING();
-
+
gtk_main();
exit_claws(mainwin);
main_window_get_size(mainwin);
main_window_get_position(mainwin);
+
prefs_common_write_config();
account_write_config_all();
addressbook_export_to_file();
}
} else if (!strncmp(argv[i], "--attach", 8)) {
const gchar *p = argv[i + 1];
- gchar *file;
+ gchar *file = NULL;
while (p && *p != '\0' && *p != '-') {
if (!cmd.attach_files) {
cmd.attach_files = g_ptr_array_new();
}
- if (*p != G_DIR_SEPARATOR) {
+ if ((file = g_filename_from_uri(p, NULL, NULL)) != NULL) {
+ if (!is_file_exist(file)) {
+ g_free(file);
+ file = NULL;
+ }
+ }
+ if (file == NULL && *p != G_DIR_SEPARATOR) {
file = g_strconcat(claws_get_startup_dir(),
G_DIR_SEPARATOR_S,
p, NULL);
- } else {
+ } else if (file == NULL) {
file = g_strdup(p);
}
g_ptr_array_add(cmd.attach_files, file);
}
}
-static gint get_queued_message_num(void)
-{
- FolderItem *queue;
-
- queue = folder_get_default_queue();
- if (!queue) {
- return -1;
- }
-
- folder_item_scan(queue);
- return queue->total_msgs;
-}
-
static void initial_processing(FolderItem *item, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
{
GList *compose_list = NULL;
+ compose_clear_exit_drafts();
while ((compose_list = compose_get_compose_list()) != NULL) {
Compose *c = (Compose*)compose_list->data;
- compose_draft(c);
+ compose_draft(c, COMPOSE_DRAFT_FOR_EXIT);
}
}
gboolean clean_quit(gpointer data)
sc_exiting = TRUE;
debug_print("exiting\n");
if (compose_get_compose_list()) {
- gint val = alertpanel(_("Really quit?"),
- _("Composing message exists."),
- _("_Save to Draft"), _("_Discard them"), _("Do_n't quit"));
- switch (val) {
- case G_ALERTOTHER:
- sc_exiting = FALSE;
- return;
- case G_ALERTALTERNATE:
- break;
- default:
- draft_all_messages();
- }
-
- manage_window_focus_in(mainwin->window, NULL, NULL);
+ draft_all_messages();
}
- if (prefs_common.warn_queued_on_exit && get_queued_message_num() > 0) {
+ if (prefs_common.warn_queued_on_exit && procmsg_have_queued_mails_fast()) {
if (alertpanel(_("Queued messages"),
_("Some unsent messages are queued. Exit now?"),
GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL)
!= G_ALERTALTERNATE) {
+ main_window_popup(mainwin);
sc_exiting = FALSE;
return;
}
}
sock_cleanup();
+ summary_clear_list(mainwin->summaryview);
if (folderview_get_selected_item(mainwin->folderview))
folder_item_close(folderview_get_selected_item(mainwin->folderview));
gtk_main_quit();
* CLAWS: want this public so crash dialog can delete the
* lock file too
*/
-gchar *get_socket_name(void)
+gchar *claws_get_socket_name(void)
{
static gchar *filename = NULL;
gint uxsock;
gchar *path;
- path = get_socket_name();
+ path = claws_get_socket_name();
uxsock = fd_connect_unix(path);
if (uxsock < 0) {
g_unlink(path);
gdk_input_remove(lock_socket_tag);
}
fd_close(lock_socket);
- filename = get_socket_name();
+ filename = claws_get_socket_name();
g_unlink(filename);
#endif