Add Show a dialog after Midori crashes to Preferences

This commit is contained in:
Christian Dywan 2009-01-12 03:17:37 +01:00
parent 0d24549112
commit c2f33d01b6
3 changed files with 29 additions and 2 deletions

View file

@ -2180,7 +2180,8 @@ main (int argc,
/* We test for the presence of a dummy file which is created once /* 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. */ and deleted during normal runtime, but persists in case of a crash. */
katze_assign (config_file, build_config_filename ("running")); 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); GtkWidget* dialog = midori_create_diagnostic_dialog (settings, _session);
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));

View file

@ -368,7 +368,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
/* Page "General" */ /* Page "General" */
PAGE_NEW (GTK_STOCK_HOME, _("General")); PAGE_NEW (GTK_STOCK_HOME, _("General"));
FRAME_NEW (_("Startup")); FRAME_NEW (_("Startup"));
TABLE_NEW (2, 2); TABLE_NEW (3, 2);
label = katze_property_label (settings, "load-on-startup"); label = katze_property_label (settings, "load-on-startup");
INDENTED_ADD (label, 0, 1, 0, 1); INDENTED_ADD (label, 0, 1, 0, 1);
button = katze_property_proxy (settings, "load-on-startup", NULL); 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" */ /* TODO: We need something like "use current website" */
entry = katze_property_proxy (settings, "homepage", NULL); entry = katze_property_proxy (settings, "homepage", NULL);
FILLED_ADD (entry, 1, 2, 1, 2); 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")); FRAME_NEW (_("Transfers"));
TABLE_NEW (3, 2); TABLE_NEW (3, 2);
label = katze_property_label (settings, "download-folder"); label = katze_property_label (settings, "download-folder");

View file

@ -43,6 +43,7 @@ struct _MidoriWebSettings
MidoriStartup load_on_startup; MidoriStartup load_on_startup;
gchar* homepage; gchar* homepage;
gboolean show_crash_dialog;
gchar* download_folder; gchar* download_folder;
gchar* download_manager; gchar* download_manager;
gchar* text_editor; gchar* text_editor;
@ -103,6 +104,7 @@ enum
PROP_LOAD_ON_STARTUP, PROP_LOAD_ON_STARTUP,
PROP_HOMEPAGE, PROP_HOMEPAGE,
PROP_SHOW_CRASH_DIALOG,
PROP_DOWNLOAD_FOLDER, PROP_DOWNLOAD_FOLDER,
PROP_DOWNLOAD_MANAGER, PROP_DOWNLOAD_MANAGER,
PROP_TEXT_EDITOR, PROP_TEXT_EDITOR,
@ -422,6 +424,22 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
"http://www.google.com", "http://www.google.com",
flags)); 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, g_object_class_install_property (gobject_class,
PROP_DOWNLOAD_FOLDER, PROP_DOWNLOAD_FOLDER,
g_param_spec_string ( g_param_spec_string (
@ -886,6 +904,9 @@ midori_web_settings_set_property (GObject* object,
case PROP_HOMEPAGE: case PROP_HOMEPAGE:
katze_assign (web_settings->homepage, g_value_dup_string (value)); katze_assign (web_settings->homepage, g_value_dup_string (value));
break; break;
case PROP_SHOW_CRASH_DIALOG:
web_settings->show_crash_dialog = g_value_get_boolean (value);
break;
case PROP_DOWNLOAD_FOLDER: case PROP_DOWNLOAD_FOLDER:
katze_assign (web_settings->download_folder, g_value_dup_string (value)); katze_assign (web_settings->download_folder, g_value_dup_string (value));
break; break;
@ -1055,6 +1076,9 @@ midori_web_settings_get_property (GObject* object,
case PROP_HOMEPAGE: case PROP_HOMEPAGE:
g_value_set_string (value, web_settings->homepage); g_value_set_string (value, web_settings->homepage);
break; break;
case PROP_SHOW_CRASH_DIALOG:
g_value_set_boolean (value, web_settings->show_crash_dialog);
break;
case PROP_DOWNLOAD_FOLDER: case PROP_DOWNLOAD_FOLDER:
g_value_set_string (value, web_settings->download_folder); g_value_set_string (value, web_settings->download_folder);
break; break;