]> spindle.queued.net Git - midori/commitdiff
Add Show a dialog after Midori crashes to Preferences
authorChristian Dywan <christian@twotoasts.de>
Mon, 12 Jan 2009 02:17:37 +0000 (03:17 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 12 Jan 2009 02:17:37 +0000 (03:17 +0100)
midori/main.c
midori/midori-preferences.c
midori/midori-websettings.c

index 88ac4b35f518e1b3528dca362df03b78fa58b223..31a3e06c3bf8d5974f165c92d0db796f86252eb6 100644 (file)
@@ -2180,7 +2180,8 @@ main (int    argc,
     /* We test for the presence of a dummy file which is created once
        and deleted during normal runtime, but persists in case of a crash. */
     katze_assign (config_file, build_config_filename ("running"));
-    if (g_file_test (config_file, G_FILE_TEST_EXISTS))
+    if (katze_object_get_boolean (settings, "show-crash-dialog")
+        && g_file_test (config_file, G_FILE_TEST_EXISTS))
     {
         GtkWidget* dialog = midori_create_diagnostic_dialog (settings, _session);
         gtk_dialog_run (GTK_DIALOG (dialog));
index b825a45951544ba5a255d07ccd58140a30ccc1aa..f067ca25ae6f4460d2c743d09d74b574ad5e6afd 100644 (file)
@@ -368,7 +368,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     /* Page "General" */
     PAGE_NEW (GTK_STOCK_HOME, _("General"));
     FRAME_NEW (_("Startup"));
-    TABLE_NEW (2, 2);
+    TABLE_NEW (3, 2);
     label = katze_property_label (settings, "load-on-startup");
     INDENTED_ADD (label, 0, 1, 0, 1);
     button = katze_property_proxy (settings, "load-on-startup", NULL);
@@ -378,6 +378,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     /* TODO: We need something like "use current website" */
     entry = katze_property_proxy (settings, "homepage", NULL);
     FILLED_ADD (entry, 1, 2, 1, 2);
+    button = katze_property_proxy (settings, "show-crash-dialog", "blurb");
+    SPANNED_ADD (button, 0, 2, 2, 3);
     FRAME_NEW (_("Transfers"));
     TABLE_NEW (3, 2);
     label = katze_property_label (settings, "download-folder");
index 39d6e1759fd3e9dca9e46cddfc5e13bbe874036a..b0e5607f3919beb69c3af664da65753108f5b8b0 100644 (file)
@@ -43,6 +43,7 @@ struct _MidoriWebSettings
 
     MidoriStartup load_on_startup;
     gchar* homepage;
+    gboolean show_crash_dialog;
     gchar* download_folder;
     gchar* download_manager;
     gchar* text_editor;
@@ -103,6 +104,7 @@ enum
 
     PROP_LOAD_ON_STARTUP,
     PROP_HOMEPAGE,
+    PROP_SHOW_CRASH_DIALOG,
     PROP_DOWNLOAD_FOLDER,
     PROP_DOWNLOAD_MANAGER,
     PROP_TEXT_EDITOR,
@@ -422,6 +424,22 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
                                      "http://www.google.com",
                                      flags));
 
+    /**
+    * MidoriWebSettings:show-crash-dialog:
+    *
+    * Show a dialog after Midori crashed.
+    *
+    * Since: 0.1.2
+    */
+    g_object_class_install_property (gobject_class,
+                                     PROP_SHOW_CRASH_DIALOG,
+                                     g_param_spec_boolean (
+                                     "show-crash-dialog",
+                                     _("Show crash dialog"),
+                                     _("Show a dialog after Midori crashed"),
+                                     TRUE,
+                                     flags));
+
     g_object_class_install_property (gobject_class,
                                      PROP_DOWNLOAD_FOLDER,
                                      g_param_spec_string (
@@ -886,6 +904,9 @@ midori_web_settings_set_property (GObject*      object,
     case PROP_HOMEPAGE:
         katze_assign (web_settings->homepage, g_value_dup_string (value));
         break;
+    case PROP_SHOW_CRASH_DIALOG:
+        web_settings->show_crash_dialog = g_value_get_boolean (value);
+        break;
     case PROP_DOWNLOAD_FOLDER:
         katze_assign (web_settings->download_folder, g_value_dup_string (value));
         break;
@@ -1055,6 +1076,9 @@ midori_web_settings_get_property (GObject*    object,
     case PROP_HOMEPAGE:
         g_value_set_string (value, web_settings->homepage);
         break;
+    case PROP_SHOW_CRASH_DIALOG:
+        g_value_set_boolean (value, web_settings->show_crash_dialog);
+        break;
     case PROP_DOWNLOAD_FOLDER:
         g_value_set_string (value, web_settings->download_folder);
         break;