Commit 262039de87a0cb676807695d3d5b739d58f21ac4
1 parent
b0d210f7
Exists in
master
and in
2 other branches
Adding message dialog when gsettings fail to prevent the windows 'hang'
on schema failure.
Showing
1 changed file
with
25 additions
and
1 deletions
Show diff stats
src/objects/settings/gsettings.c
| ... | ... | @@ -112,7 +112,31 @@ |
| 112 | 112 | #endif // DEBUG |
| 113 | 113 | |
| 114 | 114 | if(!settings) { |
| 115 | - g_warning("Error creating settings"); | |
| 115 | + | |
| 116 | + g_warning("Error loading system settings"); | |
| 117 | + | |
| 118 | + GtkWidget * dialog = gtk_message_dialog_new_with_markup( | |
| 119 | + NULL, | |
| 120 | + 0, | |
| 121 | + GTK_MESSAGE_ERROR, | |
| 122 | + GTK_BUTTONS_CLOSE, | |
| 123 | + _("Can't load system settings") | |
| 124 | + ); | |
| 125 | + | |
| 126 | + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),_("Unable to initialize system settings. Application may crash in unexpected ways")); | |
| 127 | + | |
| 128 | + gtk_window_set_title(GTK_WINDOW(dialog),_("System settings error")); | |
| 129 | + | |
| 130 | + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); | |
| 131 | + | |
| 132 | + gtk_widget_show_all(dialog); | |
| 133 | + | |
| 134 | + //g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | |
| 135 | + //g_signal_connect(dialog,"response",G_CALLBACK(gtk_widget_destroy),NULL); | |
| 136 | + gtk_dialog_run(GTK_DIALOG(dialog)); | |
| 137 | + | |
| 138 | + g_application_quit(g_application_get_default()); | |
| 139 | + | |
| 116 | 140 | } |
| 117 | 141 | |
| 118 | 142 | return settings; | ... | ... |