2008-09-24 [colin] 3.5.0cvs125
[claws.git] / src / main.c
index dbdc4a310ccf05b460b79321a7dc03fa4e1b17a8..e38a69eab85b15e200f1bb253fad0b03414e47ae 100644 (file)
@@ -25,8 +25,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkrc.h>
+#include <gtk/gtk.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -140,7 +139,6 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #include <hildon-widgets/hildon-banner.h>
 #include <hildon-widgets/hildon-program.h>
 #endif
-#include <gtk/gtkmain.h>
 #include <libosso.h>
 #include <libgnomevfs/gnome-vfs-volume.h>
 #include <libgnomevfs/gnome-vfs-volume-monitor.h>
@@ -804,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);
@@ -838,13 +836,22 @@ static void main_dump_features_list(gboolean show_debug_only)
                return;
 
        if (show_debug_only)
-               debug_print("GTK+ %d.%d.%d / GLib %d.%d.%d\n",
+               debug_print("runtime GTK+ %d.%d.%d / GLib %d.%d.%d\n",
                           gtk_major_version, gtk_minor_version, gtk_micro_version,
                           glib_major_version, glib_minor_version, glib_micro_version);
        else
-               g_print("GTK+ %d.%d.%d / GLib %d.%d.%d\n",
+               g_print("runtime GTK+ %d.%d.%d / GLib %d.%d.%d\n",
                           gtk_major_version, gtk_minor_version, gtk_micro_version,
                           glib_major_version, glib_minor_version, glib_micro_version);
+       if (show_debug_only)
+               debug_print("buildtime GTK+ %d.%d.%d / GLib %d.%d.%d\n",
+                          GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
+                          GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+       else
+               g_print("buildtime GTK+ %d.%d.%d / GLib %d.%d.%d\n",
+                          GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
+                          GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+       
        if (show_debug_only)
                debug_print("Compiled-in features:\n");
        else
@@ -855,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
@@ -967,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);
        }
 }
@@ -1045,7 +1052,8 @@ int main(int argc, char *argv[])
        gboolean asked_for_migration = FALSE;
        gboolean start_done = TRUE;
        GtkUIManager *gui_manager = NULL;
-       
+       GSList *plug_list = NULL;
+
        START_TIMING("startup");
 
        sc_starting = TRUE;
@@ -1113,6 +1121,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;
@@ -1306,7 +1321,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
@@ -1497,12 +1512,32 @@ 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 ();
@@ -1751,7 +1786,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