~ubuntu-branches/ubuntu/trusty/computer-janitor/trusty

« back to all changes in this revision

Viewing changes to computerjanitorapp/gtk/ui.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-18 10:12:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110518101206-l52kzrxehj9n7188
Tags: 2.1.0-0ubuntu5
computerjanitorapp/gtk/ui.py: Stop forcing GTK 2, we want to use GTK 3
now. Drop GTK 2 workaround for menu popups. Update gir dependency.

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
 
 
36
33
from gi.repository import Gtk, Pango
37
34
 
38
35
from computerjanitorapp import __version__, setup_gettext
440
437
                path, column, cell_x, cell_y = pathinfo
441
438
                treeview.set_cursor(path, column, False)
442
439
            menu = self.popup_menus[treeview]
443
 
            try:
444
 
                menu.popup_for_device(None, None, None, None, None,
445
 
                        event.button, time)
446
 
            except AttributeError:
447
 
                # popup_for_device() is introspection safe, but only exists in
448
 
                # GTK3. popup() isn't introspectable, so in GTK 2 we need to
449
 
                # disable the popup menu functionality
450
 
                log.warning('popup menu not supported when using GTK2')
 
440
            menu.popup_for_device(None, None, None, None, None,
 
441
                    event.button, time)
451
442
            return True
452
443
        else:
453
444
            # No other events are handled by us.