From 14339a470b814572b564f808c56f2617d3fa2f30 Mon Sep 17 00:00:00 2001 From: George Kraft IV Date: Thu, 26 Apr 2007 11:14:15 +0000 Subject: [PATCH] Fixes #386413 2007-04-26 George Kraft IV Fixes #386413 * main.c: (AT_STARTUP_DIR, AT_STARTUP_KEY, SR_PREFS_DIR), (init_startup_state, at_startup_toggled, at_startup_update_ui, (at_startup_changed): depricated the selection and startup of hardcoded assistive technologies. * main.c: (cb_at_preferences, cb_keyboard_preferences, cb_login_preferences): added callbacks to launch preference dialogs. * Makefile.am: depricated files at-startup-session.[ch] * at-enable-dialog.glade: removed the checkbox selection of assistive technologies and added a push button to launch the Preferred Applications dialog to setup ATs. svn path=/trunk/; revision=7496 --- .../accessibility/at-properties/ChangeLog | 18 + .../accessibility/at-properties/Makefile.am | 4 +- .../at-properties/at-enable-dialog.glade | 387 +++++++++++++----- capplets/accessibility/at-properties/main.c | 163 ++------ 4 files changed, 325 insertions(+), 247 deletions(-) diff --git a/capplets/accessibility/at-properties/ChangeLog b/capplets/accessibility/at-properties/ChangeLog index ac005e703..53f76fc23 100644 --- a/capplets/accessibility/at-properties/ChangeLog +++ b/capplets/accessibility/at-properties/ChangeLog @@ -1,3 +1,21 @@ +2007-04-26 George Kraft IV + + Fixes #386413 + + * main.c: (AT_STARTUP_DIR, AT_STARTUP_KEY, SR_PREFS_DIR), + (init_startup_state, at_startup_toggled, at_startup_update_ui, + (at_startup_changed): depricated the selection and startup + of hardcoded assistive technologies. + + * main.c: (cb_at_preferences, cb_keyboard_preferences, + cb_login_preferences): added callbacks to launch preference dialogs. + + * Makefile.am: depricated files at-startup-session.[ch] + + * at-enable-dialog.glade: removed the checkbox selection of + assistive technologies and added a push button to launch + the Preferred Applications dialog to setup ATs. + 2007-04-08 Jens Granseuer Patch by: Kristof Vansant diff --git a/capplets/accessibility/at-properties/Makefile.am b/capplets/accessibility/at-properties/Makefile.am index dbfdca699..4249d3ce6 100644 --- a/capplets/accessibility/at-properties/Makefile.am +++ b/capplets/accessibility/at-properties/Makefile.am @@ -2,9 +2,7 @@ bin_PROGRAMS = gnome-at-properties gnome_at_properties_LDADD = $(AT_CAPPLET_LIBS) $(GNOMECC_CAPPLETS_LIBS) $(top_builddir)/capplets/common/libcommon.la gnome_at_properties_SOURCES = \ - main.c \ - at-startup-session.h \ - at-startup-session.c + main.c gnome_at_properties_LDFLAGS = -export-dynamic @INTLTOOL_DESKTOP_RULE@ diff --git a/capplets/accessibility/at-properties/at-enable-dialog.glade b/capplets/accessibility/at-properties/at-enable-dialog.glade index 39578aaa1..bd270324e 100644 --- a/capplets/accessibility/at-properties/at-enable-dialog.glade +++ b/capplets/accessibility/at-properties/at-enable-dialog.glade @@ -10,6 +10,13 @@ False False False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False False @@ -31,6 +38,7 @@ gtk-help True GTK_RELIEF_NORMAL + True -11 @@ -42,6 +50,7 @@ True True GTK_RELIEF_NORMAL + True 0 @@ -51,6 +60,10 @@ 0.5 0 0 + 0 + 0 + 0 + 0 @@ -86,6 +99,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -109,6 +126,7 @@ gtk-close True GTK_RELIEF_NORMAL + True -7 @@ -143,7 +161,7 @@ True - <b>Support</b> + <b>Assistive Technologies</b> False True GTK_JUSTIFY_LEFT @@ -153,6 +171,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -189,15 +211,79 @@ 6 - + True True - _Enable assistive technologies - True GTK_RELIEF_NORMAL - False - False - True + True + + Jump to Preferred Applications dialog + + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-jump-to + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Preferred Applications + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 0 @@ -207,18 +293,20 @@ - + True - <small><i><b>Note:</b> Changes to this setting will not take effect until you next log in.</i></small> - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 + True + True + _Enable assistive technologies + True + GTK_RELIEF_NORMAL + True + False + False + True + + Changes to enable assistive technologies will not take effect ntil your next log in. + 0 @@ -268,9 +356,9 @@ 6 - + True - <b>Applications</b> + <b>Preferences</b> False True GTK_JUSTIFY_LEFT @@ -280,6 +368,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -316,104 +408,175 @@ 6 - + True - Start these assistive technologies every time you log in: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 6 - - - 0 - False - False - - + False + 0 - - - True - True - _Screenreader - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - + + + True + True + GTK_RELIEF_NORMAL + True + + Keyboard Accessibility + Jump to the Keyboard Accessibility dialog + + - - - True - True - _Magnifier - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 - - - True - True - _On-screen keyboard - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - + + + True + False + 2 - - - True - - - 0 - True - True - - + + + True + gtk-jump-to + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + - - - True - - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 + + + True + _Keyboard Accessibility + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 5 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + Accessible Login + Jump to the Accessible Login dialog + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-jump-to + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Accessible Lo_gin + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + 0 diff --git a/capplets/accessibility/at-properties/main.c b/capplets/accessibility/at-properties/main.c index 672e2ae83..b00b62d71 100644 --- a/capplets/accessibility/at-properties/main.c +++ b/capplets/accessibility/at-properties/main.c @@ -10,64 +10,9 @@ #define ACCESSIBILITY_KEY "/desktop/gnome/interface/accessibility" #define ACCESSIBILITY_KEY_DIR "/desktop/gnome/interface" -#define AT_STARTUP_DIR "/desktop/gnome/accessibility/startup" -#define AT_STARTUP_KEY "/desktop/gnome/accessibility/startup/exec_ats" -#define SR_PREFS_DIR "/apps/gnopernicus/srcore" static AtStartupState at_startup_state, at_startup_state_initial; -static void -init_startup_state (GladeXML *dialog) -{ - GConfClient *client = gconf_client_get_default (); - - at_startup_state.flags = (gconf_client_get_bool (client, - ACCESSIBILITY_KEY, - NULL)) ? 1 : 0; - - at_startup_state_init (&at_startup_state); - - at_startup_state_initial.flags = at_startup_state.flags; - g_object_unref (client); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_keyboard_toggle")), - at_startup_state.enabled.osk); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_screenreader_toggle")), - at_startup_state.enabled.screenreader); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_magnifier_toggle")), - at_startup_state.enabled.magnifier); - - gtk_widget_set_sensitive (WID ("at_keyboard_toggle"), - at_startup_state.enabled.osk_installed); - gtk_widget_set_sensitive (WID ("at_screenreader_toggle"), - at_startup_state.enabled.screenreader_installed); - gtk_widget_set_sensitive (WID ("at_magnifier_toggle"), - at_startup_state.enabled.magnifier_installed); - - if (at_startup_state.enabled.osk_installed && - at_startup_state.enabled.screenreader_installed && - at_startup_state.enabled.magnifier_installed) { - gtk_widget_hide (WID ("at_applications_warning_label")); - gtk_widget_hide (WID ("at_applications_hseparator")); - } else { - gchar *warning_label; - - gtk_widget_show (WID ("at_applications_warning_label")); - gtk_widget_show (WID ("at_applications_hseparator")); - if (!at_startup_state.enabled.osk_installed && - !(at_startup_state.enabled.screenreader_installed || - at_startup_state.enabled.magnifier_installed)) { - warning_label = g_strdup_printf ("%s", _("No Assistive Technology is available on your system. The 'gok' package must be installed in order to get on-screen keyboard support, and the 'orca' package must be installed for screenreading and magnifying capabilities.")); - } else if (!at_startup_state.enabled.osk_installed) { - warning_label = g_strdup_printf ("%s", _("Not all available assistive technologies are installed on your system. The 'gok' package must be installed in order to get on-screen keyboard support.")); - } else { - warning_label = g_strdup_printf ("%s", _("Not all available assistive technologies are installed on your system. The 'orca' package must be installed for screenreading and magnifying capabilities.")); - } - gtk_label_set_markup (GTK_LABEL (WID ("at_applications_warning_label")), warning_label); - g_free (warning_label); - } -} - static GladeXML * create_dialog (void) { @@ -80,15 +25,33 @@ create_dialog (void) GTK_STOCK_QUIT, GTK_ICON_SIZE_BUTTON); gtk_image_set_from_file (GTK_IMAGE (WID ("at_enable_image")), - PIXMAPDIR "/at-support.png"); + PIXMAPDIR "/at-startup.png"); gtk_image_set_from_file (GTK_IMAGE (WID ("at_applications_image")), - PIXMAPDIR "/at-startup.png"); + PIXMAPDIR "/at-support.png"); } return dialog; } +static void +cb_at_preferences (GtkDialog *dialog, gint response_id) +{ + g_spawn_command_line_async("gnome-default-applications-properties", NULL); +} + +static void +cb_keyboard_preferences (GtkDialog *dialog, gint response_id) +{ + g_spawn_command_line_async("gnome-accessibility-keyboard-properties", NULL); +} + +static void +cb_login_preferences (GtkDialog *dialog, gint response_id) +{ + g_spawn_command_line_async("gdmsetup", NULL); +} + static void cb_dialog_response (GtkDialog *dialog, gint response_id) { @@ -114,32 +77,12 @@ static void close_logout_update (GladeXML *dialog) { GConfClient *client = gconf_client_get_default (); - gboolean has_changed = - (at_startup_state.flags != at_startup_state_initial.flags) && - gconf_client_get_bool (client, ACCESSIBILITY_KEY, NULL); + gboolean has_changed = gconf_client_get_bool (client, ACCESSIBILITY_KEY, NULL); gtk_widget_set_sensitive (WID ("at_close_logout_button"), has_changed); g_object_unref (client); } -static void -at_startup_toggled (GtkToggleButton *toggle_button, - GladeXML *dialog) -{ - if (toggle_button == GTK_TOGGLE_BUTTON (WID ("at_keyboard_toggle"))) { - at_startup_state.enabled.osk = gtk_toggle_button_get_active (toggle_button); - } - else if (toggle_button == GTK_TOGGLE_BUTTON (WID ("at_magnifier_toggle"))) { - at_startup_state.enabled.magnifier = gtk_toggle_button_get_active (toggle_button); - } - else if (toggle_button == GTK_TOGGLE_BUTTON (WID ("at_screenreader_toggle"))) { - at_startup_state.enabled.screenreader = gtk_toggle_button_get_active (toggle_button); - } - - at_startup_state_update (&at_startup_state); - close_logout_update (dialog); -} - static void at_enable_toggled (GtkToggleButton *toggle_button, GladeXML *dialog) @@ -154,20 +97,6 @@ at_enable_toggled (GtkToggleButton *toggle_button, g_object_unref (client); } -static void -at_startup_update_ui (GConfClient *client, - GladeXML *dialog) -{ - at_startup_state_init (&at_startup_state); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_keyboard_toggle")), - at_startup_state.enabled.osk); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_screenreader_toggle")), - at_startup_state.enabled.screenreader); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_magnifier_toggle")), - at_startup_state.enabled.magnifier); -} - static void at_enable_update (GConfClient *client, GladeXML *dialog) @@ -177,18 +106,7 @@ at_enable_update (GConfClient *client, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_enable_toggle")), is_enabled); - gtk_widget_set_sensitive (WID ("at_applications_frame"), is_enabled); -} - -static void -at_startup_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - at_startup_state_init (&at_startup_state); - at_startup_update_ui (client, user_data); - close_logout_update (user_data); + gtk_widget_set_sensitive (WID ("at_pref_button"), is_enabled); } static void @@ -228,36 +146,18 @@ setup_dialog (GladeXML *dialog) at_enable_changed, dialog, NULL, NULL); - gconf_client_add_dir (client, AT_STARTUP_DIR, - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + g_signal_connect (G_OBJECT (WID("at_pref_button")), + "clicked", + G_CALLBACK (cb_at_preferences), NULL); - gconf_client_add_dir (client, SR_PREFS_DIR, - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + g_signal_connect (G_OBJECT (WID("keyboard_button")), + "clicked", + G_CALLBACK (cb_keyboard_preferences), NULL); - gconf_client_notify_add (client, AT_STARTUP_DIR, - at_startup_changed, - dialog, NULL, NULL); - - gconf_client_notify_add (client, SR_PREFS_DIR, - at_startup_changed, - dialog, NULL, NULL); - - widget = WID ("at_keyboard_toggle"); + g_signal_connect (G_OBJECT (WID("login_button")), + "clicked", + G_CALLBACK (cb_login_preferences), NULL); - g_signal_connect (widget, "toggled", - G_CALLBACK (at_startup_toggled), - dialog); - - widget = WID ("at_magnifier_toggle"); - g_signal_connect (widget, "toggled", - G_CALLBACK (at_startup_toggled), - dialog); - - widget = WID ("at_screenreader_toggle"); - g_signal_connect (widget, "toggled", - G_CALLBACK (at_startup_toggled), - dialog); - widget = WID ("at_properties_dialog"); capplet_set_icon (widget, "gnome-settings-accessibility-technologies"); @@ -290,7 +190,6 @@ main (int argc, char *argv[]) dialog = create_dialog (); if (dialog) { - init_startup_state (dialog); setup_dialog (dialog);