~alexeftimie/jockey/fix-gobject

« back to all changes in this revision

Viewing changes to jockey/ui.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-14 17:27:14 UTC
  • mfrom: (2.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714172714-l5spiezm7e85w3gm
Tags: 0.5.3-0ubuntu1
* New upstream release:
  - Add a text frontend, 'jockey-text'.  Although the GTK and KDE frontends
    can be launched and scripted command line, they are dependent upon
    DISPLAY being set.  This text frontend has the ability to run in a true
    text only environment. (By Mario Limonciello) (LP: #394688)
  - Ported to polkit-1.
* debian/control: Update policykit dependencies to policykit-1. Drop
  policykit-kde, since it does not exist so far.
* Merge bug fix from trunk: Move X-KDE-autostart-phase: field from menu to
  autostart .desktop.
* kde/jockey-kde, kde/jockey-kde.desktop.in: Reintroduce code to run
  frontend as root, since there is no KDE frontend for polkit-1 yet.
* data/handlers/broadcom_wl.py: rmmod b43 and friends before enabling wl, so
  that it will work on the fly. (LP: #393689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import dbus.mainloop.glib
29
29
 
30
30
from oslib import OSLib
31
 
from backend import UnknownHandlerException, PermissionDeniedByPolicy, BackendCrashError, polkit_auth_wrapper, dbus_sync_call_signal_wrapper, Backend, DBUS_BUS_NAME
 
31
from backend import UnknownHandlerException, PermissionDeniedByPolicy, \
 
32
    BackendCrashError, convert_dbus_exceptions, \
 
33
    dbus_sync_call_signal_wrapper, Backend, DBUS_BUS_NAME
32
34
 
33
35
def bool(str):
34
36
    '''Convert backend encoding of a boolean to a real boolean.'''
257
259
                'certification_label': '', 'button_toggle_label': None,
258
260
            }
259
261
 
260
 
        info = polkit_auth_wrapper(self.backend().handler_info, handler_id)
 
262
        info = self.backend().handler_info(handler_id)
261
263
 
262
264
        result = {
263
265
            'name': self.get_ui_driver_name(info),
372
374
        '''
373
375
        # first, modes without GUI
374
376
        if self.argv_options.update_db:
375
 
            polkit_auth_wrapper(self.backend().update_driverdb)
 
377
            self.backend().update_driverdb()
376
378
            return 0
377
379
        elif self.argv_options.list:
378
380
            self.list()
438
440
        Return True if any new driver is available which is not yet enabled.
439
441
        '''
440
442
        try:
441
 
            (new_used, new_avail) = polkit_auth_wrapper(
442
 
                self.backend().new_used_available, self.argv_options.mode)
 
443
            (new_used, new_avail) = convert_dbus_exceptions(
 
444
                    self.backend().new_used_available, self.argv_options.mode)
443
445
        except PermissionDeniedByPolicy:
444
446
            self.error_msg(self.string_unprivileged)
445
447
            return False
541
543
        refreshed.
542
544
        '''
543
545
        try:
544
 
            i = polkit_auth_wrapper(self.backend().handler_info, handler_id)
 
546
            i = convert_dbus_exceptions(self.backend().handler_info, handler_id)
545
547
        except UnknownHandlerException:
546
548
            self.error_msg('%s: %s' % (self.string_unknown_driver, handler_id))
547
549
            self.error_msg(self._('Use --list to see available drivers'))
589
591
            if gui:
590
592
                try:
591
593
                    self._install_progress_shown = False
592
 
                    polkit_auth_wrapper(dbus_sync_call_signal_wrapper, 
593
 
                        self.backend(), 'set_enabled',
 
594
                    convert_dbus_exceptions(dbus_sync_call_signal_wrapper, self.backend(),
 
595
                        'set_enabled',
594
596
                        {'install_progress': self._install_progress_handler, 
595
597
                         'remove_progress': self._remove_progress_handler}, 
596
598
                        handler_id, enable)
598
600
                    if self._install_progress_shown:
599
601
                        self.ui_progress_finish()
600
602
            else:
601
 
                polkit_auth_wrapper(self.backend().set_enabled, handler_id, enable)
 
603
                convert_dbus_exceptions(dbus_sync_call_signal_wrapper,
 
604
                        self.backend(), 'set_enabled', {}, handler_id, enable)
602
605
        except PermissionDeniedByPolicy:
603
606
            self.error_message('', self.string_unprivileged)
604
607
            return False