Enable icons of stock GTK buttons on Windows.
[claws.git] / src / main.c
index 747b7d2d56499302bacaa27b95a9350af6c93476..a38cbd8e918e6481a62fdfdfccadeeecfa4d5c71 100644 (file)
@@ -424,7 +424,8 @@ backup_mode:
                
                /* if g_rename failed, we'll try to copy */
                if (r != 0) {
-                       FILE_OP_ERROR(new_cfg_dir, "g_rename failed, trying copy\n");
+                       FILE_OP_ERROR(new_cfg_dir, "g_rename");
+                       debug_print("rename failed, trying copy\n");
                        goto backup_mode;
                }
        }
@@ -463,8 +464,8 @@ static int migrate_common_rc(const gchar *old_rc, const gchar *new_rc)
                if (strncmp(buf, old_plugin_path, strlen(old_plugin_path))) {
                        err |= (fputs(buf, newfp) == EOF);
                } else {
-                       debug_print("->replacing %s", buf);
-                       debug_print("  with %s%s", new_plugin_path, buf+strlen(old_plugin_path));
+                       debug_print("->replacing %s\n", buf);
+                       debug_print("  with %s%s\n", new_plugin_path, buf+strlen(old_plugin_path));
                        err |= (fputs(new_plugin_path, newfp) == EOF);
                        err |= (fputs(buf+strlen(old_plugin_path), newfp) == EOF);
                }
@@ -1066,6 +1067,10 @@ int main(int argc, char *argv[])
                        "gtk-auto-mnemonics",
                        TRUE,
                        "XProperty");
+       gtk_settings_set_long_property(gtk_settings_get_default(),
+                       "gtk-button-images",
+                       TRUE,
+                       "XProperty");
 #endif
 
 #ifdef HAVE_NETWORKMANAGER_SUPPORT
@@ -1126,7 +1131,7 @@ int main(int argc, char *argv[])
 #endif
        
        /* no config dir exists. See if we can migrate an old config. */
-       if (!is_dir_exist(RC_DIR)) {
+       if (!is_dir_exist(get_rc_dir())) {
                prefs_destroy_cache();
                gboolean r = FALSE;
                
@@ -1135,30 +1140,30 @@ int main(int argc, char *argv[])
                 * and migration succeeded, and FALSE otherwise.
                 */
                if (is_dir_exist(OLD_GTK2_RC_DIR)) {
-                       r = migrate_old_config(OLD_GTK2_RC_DIR, RC_DIR,
+                       r = migrate_old_config(OLD_GTK2_RC_DIR, get_rc_dir(),
                                               g_strconcat("Sylpheed-Claws 2.6.0 ", _("(or older)"), NULL));
                        asked_for_migration = TRUE;
                } else if (is_dir_exist(OLDER_GTK2_RC_DIR)) {
-                       r = migrate_old_config(OLDER_GTK2_RC_DIR, RC_DIR,
+                       r = migrate_old_config(OLDER_GTK2_RC_DIR, get_rc_dir(),
                                               g_strconcat("Sylpheed-Claws 1.9.15 ",_("(or older)"), NULL));
                        asked_for_migration = TRUE;
                } else if (is_dir_exist(OLD_GTK1_RC_DIR)) {
-                       r = migrate_old_config(OLD_GTK1_RC_DIR, RC_DIR,
+                       r = migrate_old_config(OLD_GTK1_RC_DIR, get_rc_dir(),
                                               g_strconcat("Sylpheed-Claws 1.0.5 ",_("(or older)"), NULL));
                        asked_for_migration = TRUE;
                } else if (is_dir_exist(SYLPHEED_RC_DIR)) {
-                       r = migrate_old_config(SYLPHEED_RC_DIR, RC_DIR, "Sylpheed");
+                       r = migrate_old_config(SYLPHEED_RC_DIR, get_rc_dir(), "Sylpheed");
                        asked_for_migration = TRUE;
                }
                
                /* If migration failed or the user didn't want to do it,
                 * we create a new one (and we'll hit wizard later). 
                 */
-               if (r == FALSE && !is_dir_exist(RC_DIR)) {
+               if (r == FALSE && !is_dir_exist(get_rc_dir())) {
 #ifdef G_OS_UNIX
-                       if (copy_dir(SYSCONFDIR "/skel/.claws-mail", RC_DIR) < 0) {
+                       if (copy_dir(SYSCONFDIR "/skel/.claws-mail", get_rc_dir()) < 0) {
 #endif
-                               if (!is_dir_exist(RC_DIR) && make_dir(RC_DIR) < 0) {
+                               if (!is_dir_exist(get_rc_dir()) && make_dir(get_rc_dir()) < 0) {
 #ifdef G_OS_WIN32
                                        win32_close_log();
 #endif
@@ -1459,6 +1464,7 @@ int main(int argc, char *argv[])
        }
 
        if (never_ran) {
+               prefs_common_get_prefs()->config_version = CLAWS_CONFIG_VERSION;
                prefs_common_write_config();
                plugin_load_standard_plugins ();
        } else {