mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Apologies: I broke positioning of converted & duplicated rules in the last commit.
This commit is contained in:
parent
a8359d83c0
commit
04b13a0c62
@ -1032,9 +1032,8 @@ class EditRules(QWidget): # {{{
|
||||
orig_row = idx.row()
|
||||
self.model.remove_rule(idx)
|
||||
new_idx = self.model.add_rule(kind, col, template)
|
||||
new_idx = self.model.move(new_idx, -(self.model.rowCount() - orig_row - 1))
|
||||
self.rules_view.setCurrentIndex(new_idx)
|
||||
while self.rules_view.currentIndex().row() > orig_row:
|
||||
self.move_up()
|
||||
self.changed.emit()
|
||||
|
||||
def duplicate_rule(self):
|
||||
@ -1047,11 +1046,10 @@ class EditRules(QWidget): # {{{
|
||||
idx = self.rules_view.currentIndex()
|
||||
if idx.isValid():
|
||||
kind, col, rule = self.model.data(idx, Qt.ItemDataRole.UserRole)
|
||||
orig_row = idx.row()
|
||||
orig_row = idx.row() + 1
|
||||
new_idx = self.model.add_rule(kind, col, rule)
|
||||
new_idx = self.model.move(new_idx, -(self.model.rowCount() - orig_row - 1))
|
||||
self.rules_view.setCurrentIndex(new_idx)
|
||||
while self.rules_view.currentIndex().row() > orig_row:
|
||||
self.move_up()
|
||||
self.changed.emit()
|
||||
|
||||
def add_rule(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user