| | 105 | def _showNoA11yDialog(self): |
|---|
| | 106 | ''' |
|---|
| | 107 | Shows a dialog with a relevant message when desktop accessibility seems to |
|---|
| | 108 | be disabled. If desktop accessibility is disabled in gconf, prompts the |
|---|
| | 109 | user to enable it. |
|---|
| | 110 | ''' |
|---|
| | 111 | cl = gconf.client_get_default() |
|---|
| | 112 | if not cl.get_bool('/desktop/gnome/interface/accessibility'): |
|---|
| | 113 | message = _('Accerciser could not see the applications on your desktop.' |
|---|
| | 114 | 'You must enable desktop accessibility to fix this problem.' |
|---|
| | 115 | 'Do you want to enable it now?') |
|---|
| | 116 | dialog = gtk.MessageDialog(self.window,type=gtk.MESSAGE_ERROR, |
|---|
| | 117 | buttons=gtk.BUTTONS_YES_NO, |
|---|
| | 118 | message_format=message) |
|---|
| | 119 | response_id = dialog.run() |
|---|
| | 120 | dialog.destroy() |
|---|
| | 121 | if response_id == gtk.RESPONSE_YES: |
|---|
| | 122 | cl = gconf.client_get_default() |
|---|
| | 123 | cl.set_bool('/desktop/gnome/interface/accessibility', True) |
|---|
| | 124 | dialog = gtk.MessageDialog( |
|---|
| | 125 | self.window, |
|---|
| | 126 | type=gtk.MESSAGE_INFO, |
|---|
| | 127 | buttons=gtk.BUTTONS_OK, |
|---|
| | 128 | message_format=_('Note: Changes only take effect after logout.')) |
|---|
| | 129 | dialog.run() |
|---|
| | 130 | dialog.destroy() |
|---|
| | 131 | return False |
|---|
| | 132 | return True |
|---|
| | 133 | |
|---|
| | 134 | def _shutDown(self): |
|---|
| | 135 | ''' |
|---|
| | 136 | Cleans up any object instances that need explicit shutdown. |
|---|
| | 137 | ''' |
|---|
| | 138 | pass |
|---|
| | 139 | |
|---|
| | 140 | def _stop(self): |
|---|
| | 141 | self._shutDown() |
|---|
| | 142 | pyatspi.Registry.stop() |
|---|
| | 143 | |
|---|
| | 144 | def onDeleteEvent(self, widget, event, data=None): |
|---|
| | 145 | self._stop() |
|---|
| | 146 | return False |
|---|
| | 147 | |
|---|