#include "version.h"
+#include "crash.h"
+
gchar *prog_version;
gchar *startup_dir;
+gchar *argv0;
gboolean debug_mode = FALSE;
static gint lock_socket = -1;
GPtrArray *attach_files;
gboolean status;
gboolean send;
+ gboolean crash;
+ gchar *crash_params;
} cmd;
static void parse_cmd_opt(int argc, char *argv[]);
static void lock_socket_input_cb (gpointer data,
gint source,
GdkInputCondition condition);
-static gchar *get_socket_name (void);
+#ifndef CLAWS
+static
+#endif
+gchar *get_socket_name (void);
+
static void open_compose_new (const gchar *address,
GPtrArray *attach_files);
prog_version = PROG_VERSION;
startup_dir = g_get_current_dir();
+ argv0 = g_strdup(argv[0]);
parse_cmd_opt(argc, argv);
gtk_set_locale();
gtk_init(&argc, &argv);
+ if (cmd.crash) {
+ crash_main(cmd.crash_params);
+ return 0;
+ }
+
+ crash_install_handlers();
+
#if USE_THREADS || USE_LDAP
g_thread_init(NULL);
if (!g_thread_supported())
MAKE_DIR_IF_NOT_EXIST(get_imap_cache_dir());
MAKE_DIR_IF_NOT_EXIST(get_news_cache_dir());
MAKE_DIR_IF_NOT_EXIST(get_mime_tmp_dir());
+ MAKE_DIR_IF_NOT_EXIST(get_tmp_dir());
MAKE_DIR_IF_NOT_EXIST(RC_DIR G_DIR_SEPARATOR_S "uidl");
if (is_file_exist(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log")) {
val = alertpanel_message_with_disable
(_("Warning"),
- _("GnuPG is not installed properly.\n"
+ _("GnuPG is not installed properly, or needs to be upgraded.\n"
"OpenPGP support disabled."));
if (val & G_ALERTDISABLE)
prefs_common.gpg_warning = FALSE;
gpgme_register_idle(idle_function_for_gpgme);
#endif
-#if USE_PSPELL
- gtkpspellcheckers = gtkpspell_checkers_new();
+#if USE_ASPELL
+ gtkaspellcheckers = gtkaspell_checkers_new();
#endif
addressbook_destroy();
-#if USE_PSPELL
- gtkpspell_checkers_delete();
+#if USE_ASPELL
+ gtkaspell_checkers_delete();
#endif
return 0;
puts(_(" --version output version information and exit"));
exit(1);
+ } else if (!strncmp(argv[i], "--crash", 7)) {
+ cmd.crash = TRUE;
+ cmd.crash_params = g_strdup(argv[i + 1]);
+ i++;
}
+
}
if (cmd.attach_files && cmd.compose == FALSE) {
static void save_all_caches(FolderItem *item, gpointer data)
{
- if(!item->cache)
+ if (!item->cache)
return;
-
folder_item_write_cache(item);
}
{
MainWindow *mainwin = (MainWindow *)data;
gchar *buf;
-
- buf = g_strdup_printf(_("Processing (%s)..."), item->path);
+
+ g_return_if_fail(item);
+ buf = g_strdup_printf(_("Processing (%s)..."),
+ item->path
+ ? item->path
+ : _("top level folder"));
debug_print("%s\n", buf);
- STATUSBAR_PUSH(mainwin, buf);
g_free(buf);
main_window_cursor_wait(mainwin);
folder_item_apply_processing(item);
- debug_print(_("done.\n"));
+ debug_print("done.\n");
STATUSBAR_POP(mainwin);
main_window_cursor_normal(mainwin);
}
if (prefs_common.clean_on_exit)
main_window_empty_trash(mainwin, prefs_common.ask_on_clean);
+ /* save prefs for opened folder */
+ if(mainwin->folderview->opened)
+ {
+ FolderItem *item;
+
+ item = gtk_ctree_node_get_row_data(GTK_CTREE(mainwin->folderview->ctree), mainwin->folderview->opened);
+ summary_save_prefs_to_folderitem(mainwin->folderview->summaryview, item);
+ }
+
/* save all state before exiting */
folder_write_list();
folder_func_to_all_folders(save_all_caches, NULL);
}
#endif /* USE_GPGME */
-static gchar *get_socket_name(void)
+/*
+ * CLAWS: want this public so crash dialog can delete the
+ * lock file too
+ */
+#ifndef CLAWS
+static
+#endif
+gchar *get_socket_name(void)
{
static gchar *filename = NULL;
/* remote command mode */
- debug_print(_("another Sylpheed is already running.\n"));
+ debug_print("another Sylpheed is already running.\n");
if (cmd.receive_all)
fd_write(uxsock, "receive_all\n", 12);