From 5da5551b62be5aef6d8fb84cb940555079e428b2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Feb 2017 12:27:02 +0530 Subject: [PATCH] Bulk metadata edit: Remove the control to delete specific formats as it is redundant. This functionality is already present by right clicking the Remove books button --- src/calibre/gui2/dialogs/metadata_bulk.py | 17 +- src/calibre/gui2/dialogs/metadata_bulk.ui | 762 ++++++++++------------ 2 files changed, 360 insertions(+), 419 deletions(-) diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py index 6579ee66fc..a78b961c5d 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.py +++ b/src/calibre/gui2/dialogs/metadata_bulk.py @@ -57,8 +57,8 @@ def get_cover_data(stream, ext): # {{{ Settings = namedtuple('Settings', - 'remove_all remove add au aus do_aus rating pub do_series do_autonumber do_remove_format ' - 'remove_format do_swap_ta do_remove_conv do_auto_author series do_series_restart series_start_value series_increment ' + 'remove_all remove add au aus do_aus rating pub do_series do_autonumber ' + 'do_swap_ta do_remove_conv do_auto_author series do_series_restart series_start_value series_increment ' 'do_title_case cover_action clear_series clear_pub pubdate adddate do_title_sort languages clear_languages ' 'restore_original comments generate_cover_settings') @@ -223,10 +223,6 @@ class MyBlockingBusy(QDialog): # {{{ if cdata: cache.set_cover({bid:cdata for bid in self.ids if bid != book_id}) - # Formats - if args.do_remove_format: - cache.remove_formats({bid:(args.remove_format,) for bid in self.ids}) - if args.restore_original: for book_id in self.ids: formats = cache.formats(book_id) @@ -341,11 +337,6 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): self.initialize_combos() - for f in sorted(self.db.all_formats()): - self.remove_format.addItem(f) - - self.remove_format.setCurrentIndex(-1) - self.series.currentIndexChanged[int].connect(self.series_changed) self.rating.currentIndexChanged.connect(lambda:self.apply_rating.setChecked(True)) self.series.editTextChanged.connect(self.series_changed) @@ -1019,8 +1010,6 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): do_series_restart = self.series_numbering_restarts.isChecked() series_start_value = self.series_start_number.value() series_increment = self.series_increment.value() - do_remove_format = self.remove_format.currentIndex() > -1 - remove_format = unicode(self.remove_format.currentText()) do_swap_ta = self.swap_title_and_author.isChecked() do_remove_conv = self.remove_conversion_settings.isChecked() do_auto_author = self.auto_author_sort.isChecked() @@ -1048,7 +1037,7 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): cover_action = 'clone' args = Settings(remove_all, remove, add, au, aus, do_aus, rating, pub, do_series, - do_autonumber, do_remove_format, remove_format, do_swap_ta, + do_autonumber, do_swap_ta, do_remove_conv, do_auto_author, series, do_series_restart, series_start_value, series_increment, do_title_case, cover_action, clear_series, clear_pub, pubdate, adddate, do_title_sort, languages, clear_languages, diff --git a/src/calibre/gui2/dialogs/metadata_bulk.ui b/src/calibre/gui2/dialogs/metadata_bulk.ui index 555e092e31..369dd7c5b4 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.ui +++ b/src/calibre/gui2/dialogs/metadata_bulk.ui @@ -18,6 +18,42 @@ :/images/edit_input.png:/images/edit_input.png + + + + + + If enabled, the book list will be re-sorted and any existing +search or Virtual Library will be refreshed after the edit +is completed. This can be slow on large libraries. + + + &Refresh book list after edit + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + + Qt::AlignCenter + + + @@ -61,30 +97,50 @@ &Basic metadata - - + + - &Apply date - - - - - - - &Author(s): + &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - authors + adddate - - - - true + + + + &Apply date + + + + + + + P&ublished: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + pubdate + + + + + + + Open Tag Editor + + + Open Tag Editor + + + + :/images/chapters.png:/images/chapters.png @@ -112,26 +168,6 @@ - - - - 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. - - - @@ -145,82 +181,55 @@ - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + - &Publisher: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - publisher + &Apply rating - - - - true - - - - - - - If checked, the publisher will be cleared - - - &Clear pub - - - - - - - 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: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - remove_tags - - + + + + + + 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 + + + + + + + When doing a same format to same format conversion, +for e.g., EPUB to EPUB, calibre saves the original EPUB + as ORIGINAL_EPUB. This option tells calibre to restore + the EPUB from ORIGINAL_EPUB. Useful if you did a bulk + conversion of a large number of books and something went wrong. + + + Restore pre conversion &originals, if available + + + + @@ -229,32 +238,6 @@ - - - - Check this box to remove all tags from the books. - - - Remove &all - - - - - - - &Series: - - - Qt::PlainText - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - series - - - @@ -283,6 +266,180 @@ + + + + &Remove tags: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + remove_tags + + + + + + + Add ta&gs: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + tags + + + + + + + Author s&ort: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + author_sort + + + + + + + + + + &Series: + + + Qt::PlainText + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + series + + + + + + + &Languages: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + languages + + + + + + + + + + Remove &all + + + + + + + &Publisher: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + publisher + + + + + + + + + MMM yyyy + + + true + + + + + + + Clear published date + + + ... + + + + :/images/trash.png:/images/trash.png + + + + + + + + + &Apply date + + + + + + + &Author(s): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + authors + + + + + + + true + + + + + + + + + d MMM yyyy + + + true + + + + + + + ... + + + + :/images/trash.png:/images/trash.png + + + + + @@ -363,207 +520,48 @@ from the value in the box - - + + + + If checked, the publisher will be cleared + - &Date: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - adddate + &Clear pub - - - - - - Control how the default generated covers are created - - - Configure co&ver generation - - - - - - - - 0 - 0 - - - - Set the co&mments for all selected books - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - d MMM yyyy - - - true - - - - - - - ... - - - - :/images/trash.png:/images/trash.png - - - - - - - - - &Apply date + + + + Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas. - - - - P&ublished: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - pubdate + + + + true - - - - - - MMM yyyy - - - true - - - - - - - Clear published date - - - ... - - - - :/images/trash.png:/images/trash.png - - - - - - - - - &Languages: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - languages + + + + Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles. - - - - - + + + + Check this box to remove all tags from the books. + Remove &all - - - Remove &format: - - - remove_format - - - - - - - - - - 120 - 16777215 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - When doing a same format to same format conversion, -for e.g., EPUB to EPUB, calibre saves the original EPUB - as ORIGINAL_EPUB. This option tells calibre to restore - the EPUB from ORIGINAL_EPUB. Useful if you did a bulk - conversion of a large number of books and something went wrong. - - - Restore pre conversion &originals, if available - - - - - - Qt::Vertical @@ -579,7 +577,7 @@ for e.g., EPUB to EPUB, calibre saves the original EPUB - + @@ -602,34 +600,9 @@ title and author are swapped before the title case is set - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 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 - - - - + Change &cover @@ -682,28 +655,45 @@ as that of the first selected book. - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - &Apply rating - - + + + + + + Control how the default generated covers are created + + + Configure co&ver generation + + + + + + + + 0 + 0 + + + + Set the co&mments for all selected books + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -1136,7 +1126,7 @@ not multiple and the destination field is multiple - values starting a&t + val&ues starting at starting_from @@ -1191,8 +1181,8 @@ not multiple and the destination field is multiple 0 0 - 210 - 66 + 922 + 268 @@ -1248,42 +1238,6 @@ not multiple and the destination field is multiple - - - - - - - Qt::AlignCenter - - - - - - - - - If enabled, the book list will be re-sorted and any existing -search or Virtual Library will be refreshed after the edit -is completed. This can be slow on large libraries. - - - &Refresh book list after edit - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - @@ -1337,11 +1291,9 @@ is completed. This can be slow on large libraries. apply_pubdate languages clear_languages - remove_format restore_original change_title_to_title_case update_title_sort - remove_conversion_settings cover_generate cover_remove cover_from_fmt