diff --git a/src/calibre/gui2/dialogs/scheduler.py b/src/calibre/gui2/dialogs/scheduler.py index 53c4223750..c9cb62cfaa 100644 --- a/src/calibre/gui2/dialogs/scheduler.py +++ b/src/calibre/gui2/dialogs/scheduler.py @@ -131,6 +131,10 @@ class RecipeModel(QAbstractItemModel, SearchQueryParser): self.categories = sorted(self.category_map.keys(), cmp=self.sort_categories) self._map = dict(self.category_map) + def scheduled_recipes(self): + for recipe in self.category_map[_('Scheduled')]: + yield recipe + def sort_categories(self, x, y): def decorate(x): @@ -305,6 +309,8 @@ class SchedulerDialog(QDialog, Ui_Dialog): self.connect(button, SIGNAL('toggled(bool)'), self.do_schedule) self.connect(self.search, SIGNAL('search(PyQt_PyObject)'), self._model.search) self.connect(self._model, SIGNAL('modelReset()'), lambda : self.detail_box.setVisible(False)) + self.connect(self.download_all_button, SIGNAL('clicked()'), + self.download_all) self.connect(self.download, SIGNAL('clicked()'), self.download_now) self.search.setFocus(Qt.OtherFocusReason) self.old_news.setValue(gconf['oldest_news']) @@ -317,6 +323,10 @@ class SchedulerDialog(QDialog, Ui_Dialog): if current.parent().isValid(): self.show_recipe(current) + def download_all(self, *args): + for recipe in self._model.scheduled_recipes(): + self.emit(SIGNAL('download_now(PyQt_PyObject)'), recipe) + def download_now(self): recipe = self._model.data(self.recipes.currentIndex(), Qt.UserRole) self.emit(SIGNAL('download_now(PyQt_PyObject)'), recipe) diff --git a/src/calibre/gui2/dialogs/scheduler.ui b/src/calibre/gui2/dialogs/scheduler.ui index c4e4487673..84eb3daa6f 100644 --- a/src/calibre/gui2/dialogs/scheduler.ui +++ b/src/calibre/gui2/dialogs/scheduler.ui @@ -1,7 +1,8 @@ - + + Dialog - - + + 0 0 @@ -9,42 +10,52 @@ 575 - + Schedule news download - - + + :/images/scheduler.svg:/images/scheduler.svg - - - - + + + + Recipes - + - - + + false - + 16 16 - + true - + true - - + + + Download all scheduled recipes at once + + + Download &all scheduled + + + + + + @@ -52,92 +63,92 @@ - - + + - - + + QFrame::NoFrame - + true - - + + 0 0 - 361 + 381 500 - - + + 0 - - + + Schedule for download - + - - + + blurb - + Qt::RichText - + true - + true - - + + &Schedule for download: - - + + false - + - + - - + + Every - + - - + + at - + - - + + Qt::Horizontal - + 40 20 @@ -148,41 +159,41 @@ - + - - + + Every - - - + + + 0 0 - + Interval at which to download this recipe. A value of zero means that the recipe will be downloaded every hour. - + days - + 1 - + 0.000000000000000 - + 365.100000000000023 - + 1.000000000000000 - + 1.000000000000000 @@ -193,54 +204,54 @@ - - + + - + true - - + + &Account - - - + + + - - - + + + &Username: - + username - - - + + + &Password: - + password - - - + + + QLineEdit::Password - - - + + + &Show password @@ -249,18 +260,18 @@ - - + + For the scheduling to work, you must leave calibre running. - + true - - + + &Download now @@ -274,28 +285,28 @@ - - - + + + Qt::Horizontal - + QDialogButtonBox::Ok - - - + + + Delete downloaded news older than the specified number of days. Set to zero to disable. - + days - + Delete downloaded news older than - + 1000 @@ -303,7 +314,7 @@ - + @@ -312,11 +323,11 @@ Dialog accept() - + 613 824 - + 157 274 @@ -328,11 +339,11 @@ Dialog reject() - + 681 824 - + 286 274 @@ -344,11 +355,11 @@ widget setDisabled(bool) - + 454 147 - + 461 168 @@ -360,11 +371,11 @@ widget setEnabled(bool) - + 458 137 - + 461 169 @@ -376,11 +387,11 @@ day setEnabled(bool) - + 421 186 - + 500 184 @@ -392,11 +403,11 @@ time setEnabled(bool) - + 442 193 - + 603 183 @@ -408,11 +419,11 @@ interval setEnabled(bool) - + 428 213 - + 495 218