diff --git a/src/calibre/gui2/dialogs/search.py b/src/calibre/gui2/dialogs/search.py index b4f629fa2a..70c88946e0 100644 --- a/src/calibre/gui2/dialogs/search.py +++ b/src/calibre/gui2/dialogs/search.py @@ -50,6 +50,7 @@ class SearchDialog(QDialog, Ui_Dialog): self.date_month.currentIndexChanged.connect(lambda : self.sel_date.setChecked(True)) self.date_day.valueChanged.connect(lambda : self.sel_date.setChecked(True)) self.date_daysago.valueChanged.connect(lambda : self.sel_daysago.setChecked(True)) + self.date_ago_type.addItems([_('days'), _('weeks'), _('months'), _('years')]) self.date_human.currentIndexChanged.connect(lambda : self.sel_human.setChecked(True)) init_dateop(self.dateop_date) self.sel_date.setChecked(True) @@ -143,7 +144,9 @@ class SearchDialog(QDialog, Ui_Dialog): ans += '-%s' % d return ans if self.sel_daysago.isChecked(): - return '%s%sdaysago' % (prefix, self.date_daysago.value()) + val = self.date_daysago.value() + val *= {0:1, 1:7, 2:30, 3:365}[self.date_ago_type.currentIndex()] + return '%s%sdaysago' % (prefix, val) return '%s%s' % (prefix, unicode(self.date_human.itemData(self.date_human.currentIndex()) or '')) def adv_search_string(self): diff --git a/src/calibre/gui2/dialogs/search.ui b/src/calibre/gui2/dialogs/search.ui index 79d95ee52f..f35946c92c 100644 --- a/src/calibre/gui2/dialogs/search.ui +++ b/src/calibre/gui2/dialogs/search.ui @@ -52,7 +52,7 @@ - &What kind of match to use: + What &kind of match to use: matchkind @@ -109,7 +109,7 @@ - &All these words: + A&ll these words: all @@ -126,7 +126,7 @@ - This exact &phrase: + &This exact phrase: all @@ -143,7 +143,7 @@ - &One or more of these words: + O&ne or more of these words: all @@ -402,7 +402,7 @@ - &month + mo&nth date_month @@ -460,10 +460,13 @@ + + + - days ago + ago