[26592] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25641 - trunk/debathena/config/lightdm-config/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Wed Jul 18 12:02:29 2012

Date: Wed, 18 Jul 2012 12:02:25 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201207181602.q6IG2P6Q009296@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2012-07-18 12:02:24 -0400 (Wed, 18 Jul 2012)
New Revision: 25641

Modified:
   trunk/debathena/config/lightdm-config/debian/changelog
   trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter
   trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter.ui
Log:
In lightdm-config:
  * Support basic accessibility options (High Contrast theme and an
    on-screen keyboard, if available)


Modified: trunk/debathena/config/lightdm-config/debian/changelog
===================================================================
--- trunk/debathena/config/lightdm-config/debian/changelog	2012-07-17 12:30:00 UTC (rev 25640)
+++ trunk/debathena/config/lightdm-config/debian/changelog	2012-07-18 16:02:24 UTC (rev 25641)
@@ -2,7 +2,8 @@
 
   * Be clearer about what a DBus error probably means when initiating a
     restart/shutdown from lightdm
-  * Support basic accessibility options (read: a High Contrast Theme)
+  * Support basic accessibility options (High Contrast theme and an
+    on-screen keyboard, if available)
   * Drop a separate panel window and actually implement a real menubar on
     the background window for the top "panel"
   * Display a MOTD on the login screen (Trac: #793)
@@ -12,7 +13,7 @@
   * Deal more gracefully with a missing background image
   * Move greeter to /usr/lib/debathena-lightdm-config
 
- -- Jonathan Reed <jdreed@mit.edu>  Wed, 11 Jul 2012 16:04:05 -0400
+ -- Jonathan Reed <jdreed@mit.edu>  Wed, 18 Jul 2012 12:01:54 -0400
 
 debathena-lightdm-config (1.3) unstable; urgency=low
 

Modified: trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter
===================================================================
--- trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter	2012-07-17 12:30:00 UTC (rev 25640)
+++ trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter	2012-07-18 16:02:24 UTC (rev 25641)
@@ -20,6 +20,7 @@
 import io
 
 KIOSK_LAUNCH_CMD="/usr/lib/debathena-kiosk/lightdm-launch-kiosk"
+PICKBOARD_CMD="/usr/bin/onboard"
 UI_FILE="/usr/share/debathena-lightdm-config/debathena-lightdm-greeter.ui"
 CONFIG_FILE="/etc/debathena-lightdm-greeter.ini"
 CONFIG_DEFAULTS={"minimum_uid": 1,
@@ -97,6 +98,8 @@
             "kpEvent": self.cbKeyPress,
             "power_cb": self.doPowerOperation,
             "contrast_cb": self.toggleContrast,
+            "pickboard_cb": self.togglePickboard,
+            "large_font_cb": self.toggleLargeFont,
             "browse_cb": self.spawnBrowser
         }
 
@@ -134,6 +137,9 @@
         for obj in _OBJS_TO_RENAME:
             self.builder.get_object(obj).set_name(obj)
         
+        # For the pickboard
+        self.keyboardWindow = None
+
         # The login window
         self.winLogin = self.builder.get_object("winLogin")
         # A box containing the prompt label, entry, and a spinner
@@ -257,6 +263,8 @@
             self.builder.get_object(menu).set_property('label', '')
         # Used in the updateTime callback
         self.mnuTime = self.builder.get_object("mnuClock")
+        
+        self.builder.get_object("miPickboard").set_sensitive(os.path.exists(PICKBOARD_CMD))
 
         self.winBg.show_all()
 
@@ -302,6 +310,47 @@
             # your hardware doesn't support it
             self.errDialog("An error occurred while trying to perform a power-related operation.  The most common cause of this is trying to shutdown, reboot, or suspend the machine when someone else is logged in remotely or on one of the virtual terminals.  The full error text appears below:\n\n" + str(e))
 
+
+    def togglePickboard(self, widget):
+        if not widget.get_active():
+            if self.keyboardWindow:
+                self.keyboardWindow.destroy()
+            if self.onboardProc:
+                self.onboardProc.terminate()
+        else:
+            self.onboardProc = None
+            xid = None
+            try:
+                self.onboardProc = subprocess.Popen([PICKBOARD_CMD, "--xid"],
+                                                stdout=subprocess.PIPE)
+                xid = int(self.onboardProc.stdout.readline())
+            except OSError, e:
+                print >>sys.stderr, "Failed to spawn /usr/bin/onboard", str(e)
+            except ValueError:
+                print >>sys.stderr, "onboard didn't return an integer xid (shouldn't happen)"
+                self.onboardProc.kill()
+
+            if self.onboardProc is None or xid is None:
+                self.errDialog("An error occurred while starting the on-screen keyboard.")
+                widget.set_sensitive(False)
+                # Remember, this will call this callback again
+                widget.set_active(False)
+                return
+
+            self.keyboardWindow = Gtk.Window()
+            self.keyboardWindow.show()
+            self.keyboardWindow.accept_focus = False;
+            self.keyboardWindow.focus_on_map = False;
+            keyboardSocket = Gtk.Socket()
+            keyboardSocket.show()
+            self.keyboardWindow.add(keyboardSocket)
+            keyboardSocket.add_id(xid)
+            self.keyboardWindow.move(0, self.screenSize[1] - 200)
+            self.keyboardWindow.resize(int(self.screenSize[0] / 3), 200)
+
+    def toggleLargeFont(self, widget):
+        pass
+
     def toggleContrast(self, widget):
         if widget.get_active():
             self.gtkSettings.set_property('gtk-theme-name', 'HighContrastInverse')

Modified: trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter.ui
===================================================================
--- trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter.ui	2012-07-17 12:30:00 UTC (rev 25640)
+++ trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter.ui	2012-07-18 16:02:24 UTC (rev 25641)
@@ -118,9 +118,9 @@
                       <object class="GtkCheckMenuItem" id="miPickboard">
                         <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
-                        <property name="sensitive">False</property>
                         <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Use On-screen Keyboard</property>
+                        <signal name="toggled" handler="pickboard_cb" swapped="no"/>
                       </object>
                     </child>
                     <child>
@@ -130,6 +130,7 @@
                         <property name="sensitive">False</property>
                         <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Use Large Font</property>
+                        <signal name="toggled" handler="large_font_cb" swapped="no"/>
                       </object>
                     </child>
                   </object>


home help back first fref pref prev next nref lref last post