[Xfce4-commits] <xfce4-settings:master> Add some information and checks if at is enabled.
Nick Schermer
noreply at xfce.org
Thu Feb 17 22:20:01 CET 2011
Updating branch refs/heads/master
to 242e2a66ed9f0a5caba937949c4355bc719160ee (commit)
from 97f2823edcddaaf9b9d51d5f8e725779e7394e80 (commit)
commit 242e2a66ed9f0a5caba937949c4355bc719160ee
Author: Nick Schermer <nick at xfce.org>
Date: Thu Feb 17 22:15:32 2011 +0100
Add some information and checks if at is enabled.
.../accessibility-dialog.glade | 72 +++++++++++++++++++-
dialogs/accessibility-settings/main.c | 33 +++++++++
2 files changed, 104 insertions(+), 1 deletions(-)
diff --git a/dialogs/accessibility-settings/accessibility-dialog.glade b/dialogs/accessibility-settings/accessibility-dialog.glade
index 3d6c3d0..fce6fe4 100644
--- a/dialogs/accessibility-settings/accessibility-dialog.glade
+++ b/dialogs/accessibility-settings/accessibility-dialog.glade
@@ -92,7 +92,77 @@
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="info-logout">
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-info</property>
+ <property name="icon-size">5</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Assistive technologies will be enabled the
+next time you login.</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="info-no-at">
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-dialog-warning</property>
+ <property name="icon-size">5</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">No AT-SPI provider was found on your system.</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
</child>
</object>
</child>
diff --git a/dialogs/accessibility-settings/main.c b/dialogs/accessibility-settings/main.c
index d6f217e..d758871 100644
--- a/dialogs/accessibility-settings/main.c
+++ b/dialogs/accessibility-settings/main.c
@@ -65,6 +65,37 @@ accessibility_settings_sensitivity (GtkToggleButton *button,
static void
+accessibility_settings_at (GtkToggleButton *button,
+ GtkBuilder *builder)
+{
+ AtkObject *atkobj;
+ GObject *info_logout;
+ GObject *no_atspi;
+ gchar **atspi;
+
+ info_logout = gtk_builder_get_object (builder, "info-logout");
+ no_atspi = gtk_builder_get_object (builder, "info-no-at");
+
+ gtk_widget_hide (GTK_WIDGET (info_logout));
+ gtk_widget_hide (GTK_WIDGET (no_atspi));
+
+ if (gtk_toggle_button_get_active (button))
+ {
+ atspi = xfce_resource_match (XFCE_RESOURCE_CONFIG, "autostart/at-spi-*.desktop", TRUE);
+ atkobj = gtk_widget_get_accessible (GTK_WIDGET (button));
+
+ if (atspi == NULL || g_strv_length (atspi) == 0)
+ gtk_widget_show (GTK_WIDGET (no_atspi));
+ else if (!GTK_IS_ACCESSIBLE (atkobj))
+ gtk_widget_show (GTK_WIDGET (info_logout));
+
+ g_strfreev (atspi);
+ }
+}
+
+
+
+static void
accessibility_settings_dialog_configure_widgets (GtkBuilder *builder)
{
GObject *box, *object;
@@ -72,6 +103,8 @@ accessibility_settings_dialog_configure_widgets (GtkBuilder *builder)
/* assistive technologies */
object = gtk_builder_get_object (builder, "start-at");
xfconf_g_property_bind (session_channel, "/general/StartAt", G_TYPE_BOOLEAN, object, "active");
+ g_signal_connect (object, "toggled", G_CALLBACK (accessibility_settings_at), builder);
+ accessibility_settings_at (GTK_TOGGLE_BUTTON (object), builder);
/* Sticky keys */
object = gtk_builder_get_object (builder, "sticky-keys-enabled");
More information about the Xfce4-commits
mailing list