~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/UpdatesAvailable.py

  • Committer: Dylan McCall
  • Date: 2012-06-29 17:38:26 UTC
  • mto: This revision was merged to the branch mainline in revision 2582.
  • Revision ID: dylanmccall@ubuntu.com-20120629173826-r2byc0ji1wl1o5r7
Attempt to load a symbolic icon for 'restart required'.
Don't select second item in update list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
        restart_icon_renderer.set_property("xpad", 4)
139
139
        restart_icon_renderer.set_property("ypad", 2)
140
140
        restart_icon_renderer.set_property("stock-size", Gtk.IconSize.MENU)
 
141
        restart_icon_renderer.set_property("follow-state", True)
141
142
        restart_column = Gtk.TreeViewColumn(None, restart_icon_renderer)
142
143
        restart_column.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
143
144
        self.treeview_update.append_column(restart_column)
188
189
        # Line up row details under expanders.
189
190
        # FIXME: This is completely arbitrary and should probably be happening in the Ambiance theme itself.
190
191
        self.treeview_update.set_level_indentation(12)
191
 
            
192
192
 
193
193
        # setup the help viewer and disable the help button if there
194
194
        # is no viewer available
240
240
        # List of packages we know require a restart.
241
241
        # Just an ugly hack to test the feature while packages lack the needed metadata.
242
242
        # FIXME: Remove this soon.
243
 
        restart_sourcepkgs = 'linux-meta'
 
243
        restart_sourcepkgs = ['linux-meta']
244
244
        
245
245
        def pkg_requires_restart(pkg):
246
246
            restart_condition = pkg.candidate.record.get('XB-Restart-Required')
263
263
        
264
264
        # FIXME: Non-standard, incorrect icon name (from app category).
265
265
        # Theme support for what we want seems to be lacking.
266
 
        gicon = Gio.ThemedIcon.new('reboot-notifier') if requires_restart else None
 
266
        if requires_restart:
 
267
            restart_icon_names = ['view-refresh-symbolic',
 
268
                                  'system-restart',
 
269
                                  'system-reboot']
 
270
            gicon = Gio.ThemedIcon.new_from_names(restart_icon_names)
 
271
        else:
 
272
            gicon = None
267
273
        renderer.set_property("gicon", gicon)
268
274
 
269
275
    def pkg_toggle_renderer_data_func(self, cell_layout, renderer, model, iter, data):
584
590
            self.notebook_details.set_sensitive(True)
585
591
            self.treeview_update.set_sensitive(True)
586
592
            self.button_install.grab_default()
587
 
            self.treeview_update.set_cursor(Gtk.TreePath.new_from_string("1"),
588
 
                                            None, False)
589
593
        self.label_header.set_markup(text_header)
590
594
        return True
591
595