eekboard: error if config file cannot be read.
This commit is contained in:
@ -1476,26 +1476,6 @@ main (int argc, char *argv[])
|
||||
exit (0);
|
||||
}
|
||||
|
||||
window = gtk_window_new (opt_standalone ?
|
||||
GTK_WINDOW_TOPLEVEL :
|
||||
GTK_WINDOW_POPUP);
|
||||
gtk_widget_set_can_focus (window, FALSE);
|
||||
g_object_set (G_OBJECT(window), "accept_focus", FALSE, NULL);
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Keyboard");
|
||||
g_signal_connect (G_OBJECT (window), "destroy",
|
||||
G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT(window), "eekboard", eekboard);
|
||||
widget = create_widget (eekboard, CSW, CSH);
|
||||
|
||||
if (opt_standalone) {
|
||||
create_menus (eekboard, window);
|
||||
menubar = gtk_ui_manager_get_widget (eekboard->ui_manager, "/MainMenu");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
if (opt_config) {
|
||||
ConfigContext context;
|
||||
GMarkupParseContext *pcontext;
|
||||
@ -1511,7 +1491,12 @@ main (int argc, char *argv[])
|
||||
|
||||
error = NULL;
|
||||
stream = g_file_read (file, NULL, &error);
|
||||
if (stream) {
|
||||
if (!stream) {
|
||||
eekboard_free (eekboard);
|
||||
g_print ("Can't read configuration file: %s\n", opt_config);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
pcontext = g_markup_parse_context_new (&config_parser,
|
||||
0,
|
||||
&context,
|
||||
@ -1534,7 +1519,6 @@ main (int argc, char *argv[])
|
||||
error = NULL;
|
||||
g_markup_parse_context_end_parse (pcontext, &error);
|
||||
g_markup_parse_context_free (pcontext);
|
||||
}
|
||||
g_object_unref (file);
|
||||
|
||||
if (context.list) {
|
||||
@ -1546,6 +1530,26 @@ main (int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
window = gtk_window_new (opt_standalone ?
|
||||
GTK_WINDOW_TOPLEVEL :
|
||||
GTK_WINDOW_POPUP);
|
||||
gtk_widget_set_can_focus (window, FALSE);
|
||||
g_object_set (G_OBJECT(window), "accept_focus", FALSE, NULL);
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Keyboard");
|
||||
g_signal_connect (G_OBJECT (window), "destroy",
|
||||
G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT(window), "eekboard", eekboard);
|
||||
widget = create_widget (eekboard, CSW, CSH);
|
||||
|
||||
if (opt_standalone) {
|
||||
create_menus (eekboard, window);
|
||||
menubar = gtk_ui_manager_get_widget (eekboard->ui_manager, "/MainMenu");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
if (eekboard->config) {
|
||||
GtkListStore *store;
|
||||
GtkTreeIter iter;
|
||||
|
||||
Reference in New Issue
Block a user