From 0415f3bd6cff09afe3bc73b44abca96f4ea735c2 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 24 Apr 2015 13:42:16 -0500 Subject: [PATCH] Improve Reject list --- calibre-plugin/config.py | 2 ++ calibre-plugin/dialogs.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/calibre-plugin/config.py b/calibre-plugin/config.py index ae8a4f10..28238481 100644 --- a/calibre-plugin/config.py +++ b/calibre-plugin/config.py @@ -706,6 +706,7 @@ class ReadingListTab(QWidget): self.send_lists_box.update_items_cache(reading_lists) self.send_lists_box.setText(prefs['send_lists']) horz.addWidget(self.send_lists_box) + self.send_lists_box.setCursorPosition(0) self.l.addLayout(horz) self.addtoreadlists = QCheckBox(_('Add new/updated stories to "To Read" Reading List(s).'),self) @@ -722,6 +723,7 @@ class ReadingListTab(QWidget): self.read_lists_box.update_items_cache(reading_lists) self.read_lists_box.setText(prefs['read_lists']) horz.addWidget(self.read_lists_box) + self.read_lists_box.setCursorPosition(0) self.l.addLayout(horz) self.addtolistsonread = QCheckBox(_('Add stories back to "Send to Device" Reading List(s) when marked "Read".'),self) diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py index 6020a055..b94758ae 100644 --- a/calibre-plugin/dialogs.py +++ b/calibre-plugin/dialogs.py @@ -122,7 +122,7 @@ gpstyle='QGroupBox {border:0; padding-top:10px; padding-bottom:0px; margin-botto class RejectUrlEntry: - matchpat=re.compile(r"^(?P[^,]+)(,(?P(((?P.+) by (?P<auth>.+?)( - (?P<note>.+))?)|.*)))?$") + matchpat=re.compile(r"^(?P<url>[^,]+?)(,(?P<fullnote>(((?P<title>.+?) by (?P<auth>.+?)( - (?P<note>.+))?)|.*)))?$") def __init__(self,url_or_line,note=None,title=None,auth=None, addreasontext=None,fromline=False,book_id=None): @@ -997,6 +997,7 @@ class RejectListTableWidget(QTableWidget): note_cell.set_separator(None) note_cell.setToolTip(_('Select or Edit Reject Note.')) self.setCellWidget(row, 3, note_cell) + note_cell.setCursorPosition(0) def remove_selected_rows(self): self.setFocus() @@ -1072,6 +1073,7 @@ class RejectListDialog(SizePersistedDialog): label.setToolTip(_("This will be added to whatever note you've set for each URL above.")) horz.addWidget(label) horz.addWidget(self.reason_edit) + self.reason_edit.setCursorPosition(0) horz.insertStretch(-1) layout.addLayout(horz) @@ -1171,6 +1173,7 @@ class EditTextDialog(SizePersistedDialog): self.l.addLayout(horz) else: self.l.addWidget(self.reason_edit) + self.reason_edit.setCursorPosition(0) button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) button_box.accepted.connect(self.accept)