diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py index e1ee4327f3..5ea8f00148 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.py +++ b/src/calibre/gui2/dialogs/metadata_bulk.py @@ -15,7 +15,7 @@ from calibre.ebooks.metadata import string_to_authors, authors_to_string from calibre.ebooks.metadata.book.base import composite_formatter from calibre.ebooks.metadata.meta import get_metadata from calibre.gui2.custom_column_widgets import populate_metadata_page -from calibre.gui2 import error_dialog +from calibre.gui2 import error_dialog, ResizableDialog from calibre.gui2.progress_indicator import ProgressIndicator from calibre.utils.config import dynamic from calibre.utils.titlecase import titlecase @@ -49,7 +49,7 @@ def get_cover_data(path): -class MyBlockingBusy(QDialog): +class MyBlockingBusy(QDialog): # {{{ do_one_signal = pyqtSignal() @@ -241,8 +241,9 @@ class MyBlockingBusy(QDialog): self.current_index += 1 self.do_one_signal.emit() + # }}} -class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): +class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog): s_r_functions = { '' : lambda x: x, _('Lower Case') : lambda x: icu_lower(x), @@ -261,9 +262,8 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): ] def __init__(self, window, rows, model, tab): - QDialog.__init__(self, window) + ResizableDialog.__init__(self, window) Ui_MetadataBulkDialog.__init__(self) - self.setupUi(self) self.model = model self.db = model.db self.ids = [self.db.id(r) for r in rows] diff --git a/src/calibre/gui2/dialogs/metadata_bulk.ui b/src/calibre/gui2/dialogs/metadata_bulk.ui index 41858b099b..5c0f1ec78f 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.ui +++ b/src/calibre/gui2/dialogs/metadata_bulk.ui @@ -6,8 +6,8 @@ 0 0 - 752 - 633 + 819 + 650 @@ -17,8 +17,8 @@ :/images/edit_input.png:/images/edit_input.png - - + + @@ -28,818 +28,836 @@ - - - - 6 + + + + QFrame::NoFrame - + 0 - - - + + true + + + + + 0 + 0 + 811 + 589 + + + + 0 - - - &Basic metadata - - - - - - &Author(s): - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - authors - - - - - - - A&utomatically set author sort - - - - - - - Author s&ort: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - author_sort - - - - - - - Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles. - - - - - - - &Rating: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - rating - - - - - - - Rating of this book. 0-5 stars - - - Rating of this book. 0-5 stars - - - QAbstractSpinBox::PlusMinus - - - No change - - - stars - - - -1 - - - 5 - - - -1 - - - - - - - &Publisher: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - publisher - - - - - - - true - - - - - - - Add ta&gs: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - tags - - - - - - - Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas. - - - - - - - Open Tag Editor - - - Open Tag Editor - - - - :/images/chapters.png:/images/chapters.png - - - - - - - &Remove tags: - - - remove_tags - - - - - - - Comma separated list of tags to remove from the books. - - - - - - - Check this box to remove all tags from the books. - - - Remove all - - - - - - - &Series: - - - Qt::PlainText - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - series - - - - - - - + + + + 0 + + + + &Basic metadata + + + + + + &Author(s): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + authors + + + + + + + A&utomatically set author sort + + + + + + + Author s&ort: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + author_sort + + + + + - List of known series. You can add new series. + Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles. + + + + + + + &Rating: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + rating + + + + + + + Rating of this book. 0-5 stars - List of known series. You can add new series. + Rating of this book. 0-5 stars + + QAbstractSpinBox::PlusMinus + + + No change + + + stars + + + -1 + + + 5 + + + -1 + + + + + + + &Publisher: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + publisher + + + + + true - - QComboBox::InsertAlphabetically + + + + + + Add ta&gs: - - QComboBox::AdjustToContents + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + tags - - + + - If checked, the series will be cleared + Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas. + + + + + + + Open Tag Editor - Clear series + Open Tag Editor + + + + :/images/chapters.png:/images/chapters.png - - - - Qt::Horizontal + + + + &Remove tags: - - - 20 - 0 - + + remove_tags - + - - - - - - + + - If not checked, the series number for the books will be set to 1. + Comma separated list of tags to remove from the books. + + + + + + + Check this box to remove all tags from the books. + + + Remove all + + + + + + + &Series: + + + Qt::PlainText + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + series + + + + + + + + + List of known series. You can add new series. + + + List of known series. You can add new series. + + + true + + + QComboBox::InsertAlphabetically + + + QComboBox::AdjustToContents + + + + + + + If checked, the series will be cleared + + + Clear series + + + + + + + Qt::Horizontal + + + + 20 + 0 + + + + + + + + + + + + If not checked, the series number for the books will be set to 1. If checked, selected books will be automatically numbered, in the order you selected them. So if you selected Book A and then Book B, Book A will have series number 1 and Book B series number 2. - - - Automatically number books in this series - - - - - - - false - - - Series will normally be renumbered from the highest number in the database + + + Automatically number books in this series + + + + + + + false + + + Series will normally be renumbered from the highest number in the database for that series. Checking this box will tell calibre to start numbering from the value in the box + + + Force numbers to start with + + + + + + + false + + + 1 + + + 990000 + + + 1 + + + + + + + Qt::Horizontal + + + + 20 + 10 + + + + + + + + + + Remove &format: + + + remove_format + + + + + + + + + + true + + + + + + + &Swap title and author + + + + + + + Force the title to be in title case. If both this and swap authors are checked, +title and author are swapped before the title case is set - Force numbers to start with + Change title to title case - - - - false - - - 1 - - - 990000 - - - 1 - - - - - - - Qt::Horizontal - - - - 20 - 10 - - - - - - - - - - Remove &format: - - - remove_format - - - - - - - - - - true - - - - - - - &Swap title and author - - - - - - - Force the title to be in title case. If both this and swap authors are checked, -title and author are swapped before the title case is set - - - Change title to title case - - - - - - - Remove stored conversion settings for the selected books. + + + + Remove stored conversion settings for the selected books. Future conversion of these books will use the default settings. - - - Remove &stored conversion settings for the selected books - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Change &cover - - - - - - &Generate default cover - - - - - - - &Remove cover - - - - - - - Set from &ebook file(s) - - - - - - - - - - - &Custom metadata - - - - - &Search and replace - - - - QLayout::SetMinimumSize - - - - - true - - - true - - - - - - - - - - - - - - Search &field: - - - search_field - - - - - - - The name of the field that you want to search - - - - - - - + - Search &mode: - - - search_mode + Remove &stored conversion settings for the selected books - - - - Choose whether to use basic text matching or advanced regular expression matching - - - - - + + - Qt::Horizontal + Qt::Vertical 20 - 10 + 40 - - - - - - Te&mplate: - - - s_r_template - - - - - - - - 100 - 0 - - - - Enter a template to be used as the source for the search/replace - - - - - - - &Search for: - - - search_for - - - - - - - - 100 - 0 - - - - Enter the what you are looking for, either plain text or a regular expression, depending on the mode - - - - - - - Check this box if the search string must match exactly upper and lower case. Uncheck it if case is to be ignored - - - Cas&e sensitive - - - true - - - - - - - &Replace with: - - - replace_with - - - - - - - The replacement text. The matched search text will be replaced with this string - - - - - - - - - &Apply function after replace: - - - replace_func + + + + Change &cover + + + + + &Generate default cover + + + + + + + &Remove cover + + + + + + + Set from &ebook file(s) + + + + - - - - Specify how the text is to be processed after matching and replacement. In character mode, the entire -field is processed. In regular expression mode, only the matched text is processed - - - - - - - Qt::Horizontal - - - - 20 - 10 - - - - - - - - - &Destination field: + + + + &Custom metadata + + + + + &Search and replace + + + + QLayout::SetMinimumSize - - destination_field - - - - - - - The field that the text will be put into after all replacements. -If blank, the source field is used if the field is modifiable - - - - - - - + + + + true + + + true + + + + + - M&ode: + + + + + + + + Search &field: - replace_mode + search_field - - + + - Specify how the text should be copied into the destination. + The name of the field that you want to search - - + + + + + + Search &mode: + + + search_mode + + + + + + + Choose whether to use basic text matching or advanced regular expression matching + + + + + + + Qt::Horizontal + + + + 20 + 10 + + + + + + + + + + Te&mplate: + + + s_r_template + + + + + + + + 100 + 0 + + - Specifies whether result items should be split into multiple values or -left as single values. This option has the most effect when the source field is -not multiple and the destination field is multiple + Enter a template to be used as the source for the search/replace + + + + + + + &Search for: + + + search_for + + + + + + + + 100 + 0 + + + + Enter the what you are looking for, either plain text or a regular expression, depending on the mode + + + + + + + Check this box if the search string must match exactly upper and lower case. Uncheck it if case is to be ignored - Split &result + Cas&e sensitive true - - - - Qt::Horizontal - - - - 20 - 10 - - - - - - - - - - - - Qt::Horizontal - - - - 20 - 0 - - - - - - + + - For multiple-valued fields, sho&w + &Replace with: - results_count + replace_with - - - - true - - - 1 - - - 999 - - - 999 - - - - - - - values starting a&t - - - starting_from - - - - - - - true - - - 1 - - - 999 - - - 1 - - - - - - - with values separated b&y - - - multiple_separator - - - - - + + - Used when displaying test results to separate values in multiple-valued fields + The replacement text. The matched search text will be replaced with this string - - - - - - QFrame::NoFrame - - - true - - - - - 0 - 0 - 726 - 334 - - - - - + + + + - Test text + &Apply function after replace: + + + replace_func - - - - Test result + + + + Specify how the text is to be processed after matching and replacement. In character mode, the entire +field is processed. In regular expression mode, only the matched text is processed - - - - Your test: - - - - - - - - - - - + + - Qt::Vertical + Qt::Horizontal 20 - 5 + 10 - - - - - - - - + + + + + &Destination field: + + + destination_field + + + + + + + The field that the text will be put into after all replacements. +If blank, the source field is used if the field is modifiable + + + + + + + + + M&ode: + + + replace_mode + + + + + + + Specify how the text should be copied into the destination. + + + + + + + Specifies whether result items should be split into multiple values or +left as single values. This option has the most effect when the source field is +not multiple and the destination field is multiple + + + Split &result + + + true + + + + + + + Qt::Horizontal + + + + 20 + 10 + + + + + + + + + + + + Qt::Horizontal + + + + 20 + 0 + + + + + + + + For multiple-valued fields, sho&w + + + results_count + + + + + + + true + + + 1 + + + 999 + + + 999 + + + + + + + values starting a&t + + + starting_from + + + + + + + true + + + 1 + + + 999 + + + 1 + + + + + + + with values separated b&y + + + multiple_separator + + + + + + + Used when displaying test results to separate values in multiple-valued fields + + + + + + + + + QFrame::NoFrame + + + true + + + + + 0 + 0 + 197 + 60 + + + + + + + Test text + + + + + + + Test result + + + + + + + Your test: + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 5 + + + + + + + + + + + + + + + - + Qt::Horizontal @@ -893,7 +911,6 @@ not multiple and the destination field is multiple swap_title_and_author change_title_to_title_case button_box - central_widget search_field search_mode s_r_template