diff options
author | Stefano Karapetsas <[email protected]> | 2014-03-09 19:30:21 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-03-09 19:30:21 +0100 |
commit | 4deb284a83cee61c31240e14c0e095d95f206422 (patch) | |
tree | 1b53cf5297db3ac82a093933a70cc1f1545e501c | |
parent | 6e6a19dc4b069e812ff5dad875a233030ede5637 (diff) | |
download | mate-control-center-4deb284a83cee61c31240e14c0e095d95f206422.tar.bz2 mate-control-center-4deb284a83cee61c31240e14c0e095d95f206422.tar.xz |
default-applications: Fix 'run at start' checkboxes for accessibility apps
-rw-r--r-- | capplets/default-applications/mate-da-capplet.c | 24 | ||||
-rw-r--r-- | capplets/default-applications/mate-da-capplet.h | 19 |
2 files changed, 28 insertions, 15 deletions
diff --git a/capplets/default-applications/mate-da-capplet.c b/capplets/default-applications/mate-da-capplet.c index 56f29eb4..7461fe0b 100644 --- a/capplets/default-applications/mate-da-capplet.c +++ b/capplets/default-applications/mate-da-capplet.c @@ -124,21 +124,15 @@ set_changed(GtkComboBox* combo, MateDACapplet* capplet, GList* list, gint type) break; case DA_TYPE_TERMINAL: - settings = g_settings_new (TERMINAL_SCHEMA); - g_settings_set_string (settings, TERMINAL_KEY, g_app_info_get_executable (item)); - g_object_unref (settings); + g_settings_set_string (capplet->terminal_settings, TERMINAL_KEY, g_app_info_get_executable (item)); break; case DA_TYPE_VISUAL: - settings = g_settings_new (VISUAL_SCHEMA); - g_settings_set_string (settings, VISUAL_KEY, g_app_info_get_executable (item)); - g_object_unref (settings); + g_settings_set_string (capplet->visual_settings, VISUAL_KEY, g_app_info_get_executable (item)); break; case DA_TYPE_MOBILITY: - settings = g_settings_new (MOBILITY_SCHEMA); - g_settings_set_string (settings, MOBILITY_KEY, g_app_info_get_executable (item)); - g_object_unref (settings); + g_settings_set_string (capplet->mobility_settings, MOBILITY_KEY, g_app_info_get_executable (item)); break; default: @@ -525,6 +519,8 @@ show_dialog(MateDACapplet* capplet, const gchar* start_page) capplet->file_combo_box = get_widget("filemanager_combobox"); capplet->image_combo_box = get_widget("image_combobox"); + capplet->visual_startup_checkbutton = get_widget("visual_start_checkbutton"); + capplet->mobility_startup_checkbutton = get_widget("mobility_start_checkbutton"); g_signal_connect(capplet->window, "screen-changed", G_CALLBACK(screen_changed_cb), capplet); screen_changed_cb(capplet->window, gdk_screen_get_default(), capplet); @@ -587,6 +583,8 @@ show_dialog(MateDACapplet* capplet, const gchar* start_page) g_signal_connect(capplet->text_combo_box, "changed", G_CALLBACK(text_combo_changed_cb), capplet); g_signal_connect(capplet->file_combo_box, "changed", G_CALLBACK(file_combo_changed_cb), capplet); + g_settings_bind (capplet->mobility_settings, MOBILITY_STARTUP_KEY, capplet->mobility_startup_checkbutton, "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (capplet->visual_settings, VISUAL_STARTUP_KEY, capplet->visual_startup_checkbutton, "active", G_SETTINGS_BIND_DEFAULT); gtk_window_set_icon_name(GTK_WINDOW (capplet->window), "preferences-desktop-default-applications"); @@ -647,10 +645,18 @@ main(int argc, char** argv) MateDACapplet* capplet = g_new0(MateDACapplet, 1); + capplet->terminal_settings = g_settings_new (TERMINAL_SCHEMA); + capplet->mobility_settings = g_settings_new (MOBILITY_SCHEMA); + capplet->visual_settings = g_settings_new (VISUAL_SCHEMA); + show_dialog(capplet, start_page); g_free(start_page); gtk_main(); + g_object_unref (capplet->terminal_settings); + g_object_unref (capplet->mobility_settings); + g_object_unref (capplet->visual_settings); + return 0; } diff --git a/capplets/default-applications/mate-da-capplet.h b/capplets/default-applications/mate-da-capplet.h index dde385ee..cd9f2afc 100644 --- a/capplets/default-applications/mate-da-capplet.h +++ b/capplets/default-applications/mate-da-capplet.h @@ -24,14 +24,16 @@ #include <gtk/gtk.h> -#define TERMINAL_SCHEMA "org.mate.applications-terminal" -#define TERMINAL_KEY "exec" +#define TERMINAL_SCHEMA "org.mate.applications-terminal" +#define TERMINAL_KEY "exec" -#define VISUAL_SCHEMA "org.mate.applications-at-visual" -#define VISUAL_KEY "exec" +#define VISUAL_SCHEMA "org.mate.applications-at-visual" +#define VISUAL_KEY "exec" +#define VISUAL_STARTUP_KEY "startup" -#define MOBILITY_SCHEMA "org.mate.applications-at-mobility" -#define MOBILITY_KEY "exec" +#define MOBILITY_SCHEMA "org.mate.applications-at-mobility" +#define MOBILITY_KEY "exec" +#define MOBILITY_STARTUP_KEY "startup" typedef struct _MateDACapplet { GtkBuilder* builder; @@ -117,6 +119,11 @@ typedef struct _MateDACapplet { GList* file_managers; GList* text_editors; GList* image_viewers; + + /* Settings objects */ + GSettings* terminal_settings; + GSettings* visual_settings; + GSettings* mobility_settings; } MateDACapplet; #endif |