diff --git a/src/glade/updateaddons.glade b/src/glade/updateaddons.glade index 2ad373ec7..31b73797f 100644 --- a/src/glade/updateaddons.glade +++ b/src/glade/updateaddons.glade @@ -31,6 +31,45 @@ 0 + + + True + start + + + _Select All + True + True + True + True + + + False + False + 0 + + + + + Select _None + True + True + True + True + + + False + False + 1 + + + + + False + 8 + 2 + + True @@ -57,7 +96,7 @@ True - end + start gtk-cancel @@ -70,6 +109,7 @@ False False 0 + True @@ -84,6 +124,7 @@ False False 1 + True diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index 3cb344bd5..ef49a020e 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -199,6 +199,17 @@ WIKI_HELP_PAGE_KEY = '%s_-_Keybindings' % const.URL_MANUAL_PAGE WIKI_HELP_PAGE_MAN = '%s' % const.URL_MANUAL_PAGE ADDONS_URL = "http://gramps-addons.svn.sourceforge.net/viewvc/gramps-addons/trunk" +#------------------------------------------------------------------------- +# +# Local Functions +# +#------------------------------------------------------------------------- +def update_rows(model, path, iter): + """ + Update the rows of a model. + """ + model.row_changed(path, iter) + #------------------------------------------------------------------------- # # ViewManager @@ -367,6 +378,10 @@ class ViewManager(CLIManager): _('Available Gramps Updates for Addons')) apply_button = glade.get_object('apply') cancel_button = glade.get_object('cancel') + select_all = glade.get_object('select_all') + select_all.connect("clicked", self.select_all_clicked) + select_none = glade.get_object('select_none') + select_none.connect("clicked", self.select_none_clicked) apply_button.connect("clicked", self.install_addons) cancel_button.connect("clicked", lambda obj: self.update_dialog.destroy()) @@ -392,8 +407,27 @@ class ViewManager(CLIManager): if pos: self.list.selection.select_iter(pos) self.update_dialog.run() + + def select_all_clicked(self, widget): + """ + Select all of the addons for download. + """ + for row in self.list.model: # treemodelrow + row[0] = True + self.list.model.foreach(update_rows) + + def select_none_clicked(self, widget): + """ + Select none of the addons for download. + """ + for row in self.list.model: # treemodelrow + row[0] = False + self.list.model.foreach(update_rows) def install_addons(self, obj): + """ + Process all of the selected addons. + """ for row in self.list.model: # treemodelrow if row[0]: # toggle load_addon_file(row[4], callback=LOG.debug)