2008-09-25 [colin] 3.5.0cvs129
[claws.git] / src / main.c
index 4685bdd96cfa4d20f27f135d4bf3423746e640f0..f3ad3dfa59d84fd480ee8567c570f12ebc7b7a0f 100644 (file)
@@ -802,7 +802,7 @@ static void win32_open_log(void)
                if (rename_force("claws-win32.log", "claws-win32.log.bak") < 0)
                        FILE_OP_ERROR("claws-win32.log", "rename");
        }
-       win32_debug_fp = fopen("claws-win32.log", "w");
+       win32_debug_fp = g_fopen("claws-win32.log", "w");
        if (win32_debug_fp)
        {
                g_set_print_handler(win32_print_stdout);
@@ -862,7 +862,7 @@ static void main_dump_features_list(gboolean show_debug_only)
        else
                g_print(" compface\n");
 #endif
-#if USE_ASPELL
+#if USE_ENCHANT
        if (show_debug_only)
                debug_print(" aspell\n");
        else
@@ -974,7 +974,7 @@ static void dbus_update(FolderItem *removed_item)
                        "claws-mail", G_TYPE_INVALID, G_TYPE_INVALID);
        }
        if (error) {
-               debug_print(error->message);
+               debug_print("%s", error->message);
                g_error_free(error);
        }
 }
@@ -1052,7 +1052,9 @@ int main(int argc, char *argv[])
        gboolean asked_for_migration = FALSE;
        gboolean start_done = TRUE;
        GtkUIManager *gui_manager = NULL;
-       
+       GSList *plug_list = NULL;
+       gboolean never_ran = TRUE;
+
        START_TIMING("startup");
 
        sc_starting = TRUE;
@@ -1120,6 +1122,13 @@ int main(int argc, char *argv[])
        gtk_set_locale();
        gtk_init(&argc, &argv);
 
+#ifdef G_OS_WIN32
+       gtk_settings_set_string_property(gtk_settings_get_default(),
+                       "gtk-theme-name",
+                       "MS-Windows",
+                       "XProperty");
+#endif
+
 #ifdef HAVE_NETWORKMANAGER_SUPPORT
        went_offline_nm = FALSE;
        nm_proxy = NULL;
@@ -1313,7 +1322,7 @@ int main(int argc, char *argv[])
        prefs_receive_init();
        prefs_send_init();
        tags_read_tags();
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
        gtkaspell_checkers_init();
        prefs_spelling_init();
 #endif
@@ -1408,6 +1417,7 @@ int main(int argc, char *argv[])
                }
                main_window_reflect_prefs_all_now();
                folder_write_list();
+               never_ran = TRUE;
        }
 
        if (!account_get_list()) {
@@ -1427,6 +1437,7 @@ int main(int argc, char *argv[])
 #endif
                        exit(1);
                }
+               never_ran = TRUE;
        }
 
        
@@ -1504,15 +1515,36 @@ int main(int argc, char *argv[])
                prefs_matcher_read_config();
        }
        
-       if (plugin_get_unloaded_list() != NULL) {
+       if ((plug_list = plugin_get_unloaded_list()) != NULL) {
+               GSList *cur;
+               gchar *list = NULL;
+               gint num_plugins = 0;
+               for (cur = plug_list; cur; cur = cur->next) {
+                       Plugin *plugin = (Plugin *)cur->data;
+                       gchar *tmp = g_strdup_printf("%s\n%s",
+                               list? list:"",
+                               plugin_get_name(plugin));
+                       g_free(list);
+                       list = tmp;
+                       num_plugins++;
+               }
                main_window_cursor_normal(mainwin);
-               alertpanel_warning(_("Some plugin(s) failed to load. "
+               alertpanel_warning(ngettext(
+                                    "The following plugin failed to load. "
+                                    "Check the Plugins configuration "
+                                    "for more information:\n%s",
+                                    "The following plugins failed to load. "
                                     "Check the Plugins configuration "
-                                    "for more information."));
+                                    "for more information:\n%s", 
+                                    num_plugins), 
+                                    list);
                main_window_cursor_wait(mainwin);
+               g_free(list);
+               g_slist_free(plug_list);
        }
 
-       plugin_load_standard_plugins ();
+       if (never_ran)
+               plugin_load_standard_plugins ();
       
        /* if not crashed, show window now */
        if (!claws_crashed()) {
@@ -1758,7 +1790,7 @@ static void exit_claws(MainWindow *mainwin)
        prefs_logging_done();
        prefs_send_done();
        tags_write_tags();
-#ifdef USE_ASPELL       
+#ifdef USE_ENCHANT       
        prefs_spelling_done();
        gtkaspell_checkers_quit();
 #endif