From c2f33d01b6d7a34766138eb6a58b29a76e24dc02 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 12 Jan 2009 03:17:37 +0100 Subject: [PATCH] Add Show a dialog after Midori crashes to Preferences --- midori/main.c | 3 ++- midori/midori-preferences.c | 4 +++- midori/midori-websettings.c | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/midori/main.c b/midori/main.c index 88ac4b35..31a3e06c 100644 --- a/midori/main.c +++ b/midori/main.c @@ -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)); diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index b825a459..f067ca25 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -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"); diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 39d6e175..b0e5607f 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -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; -- 2.39.5