Commit 610742c3 authored by Paolo Borelli's avatar Paolo Borelli Committed by Ignacio Casal Quinteiro

Update settings code to the new gaction stuff

parent c3bbe683
......@@ -306,8 +306,7 @@ on_syntax_highlighting_changed (GSettings *settings,
const gchar *key,
GeditSettings *gs)
const GList *windows;
GList *docs, *l;
GList *docs, *windows, *l;
gboolean enable;
enable = g_settings_get_boolean (settings, key);
......@@ -316,27 +315,19 @@ on_syntax_highlighting_changed (GSettings *settings,
for (l = docs; l != NULL; l = g_list_next (l))
gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (l->data),
gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (l->data), enable);
g_list_free (docs);
/* update the sensitivity of the Higlight Mode menu item */
windows = gtk_application_get_windows (GTK_APPLICATION (g_application_get_default ()));
while (windows != NULL)
for (l = windows; l != NULL; l = g_list_next (l))
GtkUIManager *ui;
GtkAction *a;
ui = gedit_window_get_ui_manager (GEDIT_WINDOW (windows->data));
a = gtk_ui_manager_get_action (ui,
gtk_action_set_sensitive (a, enable);
GAction *action;
windows = g_list_next (windows);
action = g_action_map_lookup_action (G_ACTION_MAP (l->data), "highlight_mode");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment