summaryrefslogtreecommitdiff
path: root/capplets/accessibility
diff options
context:
space:
mode:
authorJens Granseuer <jensgr@gmx.net>2007-05-05 11:14:54 +0000
committerJens Granseuer <jensg@src.gnome.org>2007-05-05 11:14:54 +0000
commit912be5ce979b585cf4cc067745f400bfa62bdfde (patch)
treea5b09bbb51800f3eb6287904ef98fa31e94d9798 /capplets/accessibility
parentd1282b4146ccd425a2c94cc34a2b19e0338d060e (diff)
downloadgnome-control-center-912be5ce979b585cf4cc067745f400bfa62bdfde.tar.gz
set button images via code instead of relying on glade, so they respect
2007-05-05 Jens Granseuer <jensgr@gmx.net> * at-enable-dialog.glade: * main.c: (create_dialog): set button images via code instead of relying on glade, so they respect the gtk-button-images xsetting (closes bug #362880) svn path=/trunk/; revision=7556
Diffstat (limited to 'capplets/accessibility')
-rw-r--r--capplets/accessibility/at-properties/ChangeLog7
-rw-r--r--capplets/accessibility/at-properties/at-enable-dialog.glade266
-rw-r--r--capplets/accessibility/at-properties/main.c63
3 files changed, 52 insertions, 284 deletions
diff --git a/capplets/accessibility/at-properties/ChangeLog b/capplets/accessibility/at-properties/ChangeLog
index b9159e1d2..ef0d4671a 100644
--- a/capplets/accessibility/at-properties/ChangeLog
+++ b/capplets/accessibility/at-properties/ChangeLog
@@ -1,5 +1,12 @@
2007-05-05 Jens Granseuer <jensgr@gmx.net>
+ * at-enable-dialog.glade:
+ * main.c: (create_dialog): set button images via code instead of
+ relying on glade, so they respect the gtk-button-images xsetting
+ (closes bug #362880)
+
+2007-05-05 Jens Granseuer <jensgr@gmx.net>
+
* at-enable-dialog.glade: fix critical warning
2007-04-27 Rodrigo Moya <rodrigo@gnome-db.org>
diff --git a/capplets/accessibility/at-properties/at-enable-dialog.glade b/capplets/accessibility/at-properties/at-enable-dialog.glade
index 0e61ebdf7..3264c6717 100644
--- a/capplets/accessibility/at-properties/at-enable-dialog.glade
+++ b/capplets/accessibility/at-properties/at-enable-dialog.glade
@@ -52,68 +52,8 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">0</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="at_close_and_logout_image">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Close and _Log Out</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
+ <property name="label" translatable="yes">Close and _Log Out</property>
+ <property name="use_underline">True</property>
</widget>
</child>
@@ -216,74 +156,11 @@
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <property name="label" translatable="yes">_Preferred Applications</property>
+ <property name="use_underline">True</property>
<accessibility>
<atkproperty name="AtkObject::accessible_description" translatable="yes">Jump to Preferred Applications dialog</atkproperty>
</accessibility>
- <signal name="activate" handler="on_at_pref_button_activate" last_modification_time="Fri, 13 Apr 2007 15:47:38 GMT"/>
-
- <child>
- <widget class="GtkAlignment" id="alignment7">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image4">
- <property name="visible">True</property>
- <property name="stock">gtk-jump-to</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Preferred Applications</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
</widget>
<packing>
<property name="padding">0</property>
@@ -418,75 +295,11 @@
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <property name="label" translatable="yes">_Keyboard Accessibility</property>
+ <property name="use_underline">True</property>
<accessibility>
- <atkproperty name="AtkObject::accessible_name" translatable="yes">Keyboard Accessibility</atkproperty>
<atkproperty name="AtkObject::accessible_description" translatable="yes">Jump to the Keyboard Accessibility dialog</atkproperty>
</accessibility>
- <signal name="activate" handler="on_keyboard_button_activate" last_modification_time="Fri, 13 Apr 2007 15:01:45 GMT"/>
-
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="stock">gtk-jump-to</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Keyboard Accessibility</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
</widget>
<packing>
<property name="padding">5</property>
@@ -501,74 +314,11 @@
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <property name="label" translatable="yes">Accessible Lo_gin</property>
+ <property name="use_underline">True</property>
<accessibility>
- <atkproperty name="AtkObject::accessible_name" translatable="yes">Accessible Login</atkproperty>
<atkproperty name="AtkObject::accessible_description" translatable="yes">Jump to the Accessible Login dialog</atkproperty>
</accessibility>
-
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image3">
- <property name="visible">True</property>
- <property name="stock">gtk-jump-to</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Accessible Lo_gin</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/capplets/accessibility/at-properties/main.c b/capplets/accessibility/at-properties/main.c
index b00b62d71..83ed0f07e 100644
--- a/capplets/accessibility/at-properties/main.c
+++ b/capplets/accessibility/at-properties/main.c
@@ -11,7 +11,7 @@
#define ACCESSIBILITY_KEY "/desktop/gnome/interface/accessibility"
#define ACCESSIBILITY_KEY_DIR "/desktop/gnome/interface"
-static AtStartupState at_startup_state, at_startup_state_initial;
+static AtStartupState at_startup_state;
static GladeXML *
create_dialog (void)
@@ -21,8 +21,19 @@ create_dialog (void)
dialog = glade_xml_new (GLADEDIR "/at-enable-dialog.glade", "at_properties_dialog", NULL);
if (dialog) {
- gtk_image_set_from_stock (GTK_IMAGE (WID ("at_close_and_logout_image")),
- GTK_STOCK_QUIT, GTK_ICON_SIZE_BUTTON);
+ GtkWidget *image;
+
+ image = gtk_image_new_from_stock (GTK_STOCK_QUIT, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (WID ("at_close_logout_button")), image);
+
+ image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (WID ("at_pref_button")), image);
+
+ image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (WID ("keyboard_button")), image);
+
+ image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (WID ("login_button")), image);
gtk_image_set_from_file (GTK_IMAGE (WID ("at_enable_image")),
PIXMAPDIR "/at-startup.png");
@@ -65,10 +76,10 @@ cb_dialog_response (GtkDialog *dialog, gint response_id)
else {
g_message ("CLOSE AND LOGOUT!");
if (!(client = gnome_master_client ())) {
-
+
gtk_main_quit ();
}
- gnome_client_request_save (client, GNOME_SAVE_GLOBAL, TRUE,
+ gnome_client_request_save (client, GNOME_SAVE_GLOBAL, TRUE,
GNOME_INTERACT_ANY, FALSE, TRUE);
}
}
@@ -84,12 +95,12 @@ close_logout_update (GladeXML *dialog)
}
static void
-at_enable_toggled (GtkToggleButton *toggle_button,
+at_enable_toggled (GtkToggleButton *toggle_button,
GladeXML *dialog)
{
GConfClient *client = gconf_client_get_default ();
gboolean is_enabled = gtk_toggle_button_get_active (toggle_button);
-
+
gconf_client_set_bool (client, ACCESSIBILITY_KEY,
is_enabled,
NULL);
@@ -102,10 +113,10 @@ at_enable_update (GConfClient *client,
GladeXML *dialog)
{
gboolean is_enabled = gconf_client_get_bool (client, ACCESSIBILITY_KEY, NULL);
-
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_enable_toggle")),
is_enabled);
-
+
gtk_widget_set_sensitive (WID ("at_pref_button"), is_enabled);
}
@@ -116,7 +127,7 @@ at_enable_changed (GConfClient *client,
gpointer user_data)
{
at_enable_update (client, user_data);
- close_logout_update (user_data);
+ close_logout_update (user_data);
}
static void
@@ -125,27 +136,27 @@ setup_dialog (GladeXML *dialog)
GConfClient *client;
GtkWidget *widget;
GObject *peditor;
-
+
client = gconf_client_get_default ();
-
- gconf_client_add_dir (client, ACCESSIBILITY_KEY_DIR,
+
+ gconf_client_add_dir (client, ACCESSIBILITY_KEY_DIR,
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
+
widget = WID ("at_enable_toggle");
g_signal_connect (widget, "toggled",
- G_CALLBACK (at_enable_toggled),
+ G_CALLBACK (at_enable_toggled),
dialog);
-
+
peditor = gconf_peditor_new_boolean (NULL, ACCESSIBILITY_KEY,
widget,
NULL);
-
+
at_enable_update (client, dialog);
-
+
gconf_client_notify_add (client, ACCESSIBILITY_KEY_DIR,
at_enable_changed,
dialog, NULL, NULL);
-
+
g_signal_connect (G_OBJECT (WID("at_pref_button")),
"clicked",
G_CALLBACK (cb_at_preferences), NULL);
@@ -160,13 +171,13 @@ setup_dialog (GladeXML *dialog)
widget = WID ("at_properties_dialog");
capplet_set_icon (widget, "gnome-settings-accessibility-technologies");
-
+
g_signal_connect (G_OBJECT (widget),
"response",
G_CALLBACK (cb_dialog_response), NULL);
-
+
gtk_widget_show (widget);
-
+
g_object_unref (client);
}
@@ -175,18 +186,18 @@ main (int argc, char *argv[])
{
GnomeProgram *program;
GladeXML *dialog;
-
+
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
-
+
program = gnome_program_init ("gnome-at-properties", VERSION,
LIBGNOMEUI_MODULE, argc, argv,
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
NULL);
-
+
activate_settings_daemon ();
-
+
dialog = create_dialog ();
if (dialog) {