~ubuntu-branches/ubuntu/vivid/gpodder/vivid-proposed

« back to all changes in this revision

Viewing changes to src/gpodder/gtkui/base.py

  • Committer: Bazaar Package Importer
  • Author(s): tony mancill
  • Date: 2010-12-05 17:08:02 UTC
  • mfrom: (5.3.2 experimental) (5.2.10 sid)
  • Revision ID: james.westby@ubuntu.com-20101205170802-qbsq7r331j21np1i
Tags: 2.10-1
* New upstream release
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        # Check if we have mokoui OR hildon before continuing
86
86
        mokoui, hildon = None, None
87
87
        try:
88
 
            import mokoui
 
88
            import hildon
 
89
            if not hasattr(hildon, 'PannableArea'):
 
90
                # Probably using an older version of Hildon
 
91
                raise ImportError('old version of hildon')
89
92
        except ImportError, ie:
90
93
            try:
91
 
                import hildon
 
94
                import mokoui
92
95
            except ImportError, ie:
93
96
                return widget
94
 
            if not hasattr(hildon, 'PannableArea'):
95
 
                # Probably using an older version of Hildon
96
 
                return widget
97
97
 
98
98
        parent = widget.get_parent()
99
99
        child = widget.get_child()
102
102
        def create_fingerscroll():
103
103
            if mokoui is not None:
104
104
                scroll = mokoui.FingerScroll()
105
 
                scroll.set_property('mode', 0)
106
 
                scroll.set_property('spring-speed', 0)
107
 
                scroll.set_property('deceleration', .975)
108
105
            else:
109
106
                scroll = hildon.PannableArea()
110
107
 
111
108
            # The following call looks ugly, but see Gnome bug 591085
112
 
            scroll.set_name(gtk.Buildable.get_name(widget))
 
109
            gtk.Buildable.set_name(scroll, gtk.Buildable.get_name(widget))
113
110
 
114
111
            return scroll
115
112
 
162
159
 
163
160
        return widget
164
161
 
 
162
    def _handle_menu_bar(self, menu):
 
163
        pass
 
164
 
 
165
    def _handle_button(self, button):
 
166
        pass
 
167
 
165
168
    def set_attributes(self):
166
169
        """
167
170
        Convert widget names to attributes of this object.
177
180
            if isinstance(widget, gtk.ScrolledWindow):
178
181
                widget = self._handle_scrolledwindow(widget)
179
182
 
 
183
            if isinstance(widget, gtk.MenuBar):
 
184
                self._handle_menu_bar(widget)
 
185
 
 
186
            if isinstance(widget, gtk.Button):
 
187
                self._handle_button(widget)
 
188
 
180
189
            # The following call looks ugly, but see Gnome bug 591085
181
190
            widget_name = gtk.Buildable.get_name(widget)
182
191