~rigved/computer-janitor/bug-458872

« back to all changes in this revision

Viewing changes to computerjanitorapp/gtk/ui.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Shane Harbour, Martin Pitt
  • Date: 2011-03-03 17:22:59 UTC
  • Revision ID: james.westby@ubuntu.com-20110303172259-v3j7ed1zf4fyg0vk
Tags: 2.1.0-0ubuntu4
[ Shane Harbour ]
* NEWS: fixed a typo. (LP: #726616)

[ Martin Pitt ]
* computerjanitorapp/gtk/ui.py: Update require_version() call to current
  pygobject API. Bump python-gobject dependency accordingly.
* computerjanitorapp/gtk/ui.py: Drop the "event.button.button" workaround.
  PyGI now properly handles unions, so it's just "event.button" now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
from operator import mod
32
32
 
 
33
import gi
 
34
gi.require_version('Gtk', '2.0')
 
35
 
33
36
from gi.repository import Gtk, Pango
34
37
 
35
38
from computerjanitorapp import __version__, setup_gettext
40
43
from computerjanitord.service import DBUS_INTERFACE_NAME
41
44
 
42
45
 
43
 
Gtk.require_version('2.0')
44
46
log = logging.getLogger('computerjanitor')
45
47
_ = setup_gettext()
46
48
 
406
408
        """
407
409
        # Original comment: This is slightly tricky and probably a source of
408
410
        # bugs.  Oh well.
409
 
        if event.button.button == 1:
 
411
        if event.button == 1:
410
412
            # Left button event.  Select the row being clicked on.  If the
411
413
            # click is on the cruft name, show or hide its long description.
412
414
            # If the click the click is elsewhere do not handle it.  This
427
429
                # We are not handling this event so that the toggle button
428
430
                # handling can occur.
429
431
                return False
430
 
        elif event.button.button == 3:
 
432
        elif event.button == 3:
431
433
            # Right button event.  Pop up the select/deselect all menu.
432
434
            treeview.grab_focus()
433
435
            x = int(event.x)
440
442
            menu = self.popup_menus[treeview]
441
443
            try:
442
444
                menu.popup_for_device(None, None, None, None, None,
443
 
                        event.button.button, time)
 
445
                        event.button, time)
444
446
            except AttributeError:
445
447
                # popup_for_device() is introspection safe, but only exists in
446
448
                # GTK3. popup() isn't introspectable, so in GTK 2 we need to