mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
previous button should be disabled when previous queue is empty
This commit is contained in:
parent
4aebb5a6d4
commit
114cee2cd3
@ -786,12 +786,23 @@ class CompareMany(QDialog):
|
|||||||
return self.compare_widget.current_mi
|
return self.compare_widget.current_mi
|
||||||
|
|
||||||
|
|
||||||
|
def show_current_item(self):
|
||||||
|
self.setWindowTitle(self.window_title + _(' [%(num)d of %(tot)d]') % dict(
|
||||||
|
num=(self.total - len(self.ids) + 1), tot=self.total))
|
||||||
|
oldmi, newmi = self.get_metadata(self.ids[0])
|
||||||
|
self.compare_widget(oldmi, newmi)
|
||||||
|
self.update_back_button_state()
|
||||||
|
|
||||||
|
def update_back_button_state(self):
|
||||||
|
enabled = bool(self.previous_items)
|
||||||
|
self.back_action.setEnabled(enabled)
|
||||||
|
self.back_button.setEnabled(enabled)
|
||||||
|
|
||||||
def next_item(self, accept):
|
def next_item(self, accept):
|
||||||
self.next_called = True
|
self.next_called = True
|
||||||
if not self.ids:
|
if not self.ids:
|
||||||
return self.accept()
|
return self.accept()
|
||||||
|
|
||||||
|
|
||||||
if self.current_mi is not None:
|
if self.current_mi is not None:
|
||||||
changed = self.compare_widget.apply_changes()
|
changed = self.compare_widget.apply_changes()
|
||||||
if self.current_mi is not None:
|
if self.current_mi is not None:
|
||||||
@ -806,10 +817,7 @@ class CompareMany(QDialog):
|
|||||||
self.accepted[old_id] = (changed, self.current_mi) if accept else (False, None)
|
self.accepted[old_id] = (changed, self.current_mi) if accept else (False, None)
|
||||||
if not self.ids:
|
if not self.ids:
|
||||||
return self.accept()
|
return self.accept()
|
||||||
self.setWindowTitle(self.window_title + _(' [%(num)d of %(tot)d]') % dict(
|
self.show_current_item()
|
||||||
num=(self.total - len(self.ids) + 1), tot=self.total))
|
|
||||||
oldmi, newmi = self.get_metadata(self.ids[0])
|
|
||||||
self.compare_widget(oldmi, newmi)
|
|
||||||
|
|
||||||
|
|
||||||
def previous_item(self):
|
def previous_item(self):
|
||||||
@ -828,12 +836,7 @@ class CompareMany(QDialog):
|
|||||||
|
|
||||||
# move the last previous item to the begining of the pending list
|
# move the last previous item to the begining of the pending list
|
||||||
self.ids.insert(0, last_previous_item)
|
self.ids.insert(0, last_previous_item)
|
||||||
|
self.show_current_item()
|
||||||
# display the last previous item (from the ids list)
|
|
||||||
self.setWindowTitle(self.window_title + _(' [%(num)d of %(tot)d]') % dict(
|
|
||||||
num=(self.total - len(self.ids) + 1), tot=self.total))
|
|
||||||
oldmi, newmi = self.get_metadata(self.ids[0])
|
|
||||||
self.compare_widget(oldmi, newmi)
|
|
||||||
|
|
||||||
|
|
||||||
def accept_all_remaining(self):
|
def accept_all_remaining(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user