diff --git a/src/calibre/gui2/actions/edit_metadata.py b/src/calibre/gui2/actions/edit_metadata.py
index 9b3f2c5bb9..8b57b4b455 100644
--- a/src/calibre/gui2/actions/edit_metadata.py
+++ b/src/calibre/gui2/actions/edit_metadata.py
@@ -162,9 +162,14 @@ def edit_bulk_metadata(self, checked):
return
# Prevent the TagView from updating due to signals from the database
self.gui.tags_view.blockSignals(True)
+ changed = False
try:
- changed = MetadataBulkDialog(self.gui, rows,
- self.gui.library_view.model()).changed
+ while True:
+ dialog = MetadataBulkDialog(self.gui, rows, self.gui.library_view.model())
+ if dialog.changed:
+ changed = True
+ if not dialog.do_again:
+ break
finally:
self.gui.tags_view.blockSignals(False)
if changed:
diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py
index f8177b7680..4fd34e4c4c 100644
--- a/src/calibre/gui2/dialogs/metadata_bulk.py
+++ b/src/calibre/gui2/dialogs/metadata_bulk.py
@@ -6,7 +6,7 @@
import re
from PyQt4.Qt import Qt, QDialog, QGridLayout, QVBoxLayout, QFont, QLabel, \
- pyqtSignal
+ pyqtSignal, QDialogButtonBox
from PyQt4 import QtGui
from calibre.gui2.dialogs.metadata_bulk_ui import Ui_MetadataBulkDialog
@@ -232,8 +232,19 @@ def __init__(self, window, rows, model):
self.create_custom_column_editors()
self.prepare_search_and_replace()
+
+ self.button_box.clicked.connect(self.button_clicked)
+ self.button_box.button(QDialogButtonBox.Apply).setToolTip(_(
+ 'Immediately make all changes without closing the dialog. '
+ 'This operation cannot be canceled or undone'))
+ self.do_again = False
self.exec_()
+ def button_clicked(self, which):
+ if which == self.button_box.button(QDialogButtonBox.Apply):
+ self.do_again = True
+ self.accept()
+
def prepare_search_and_replace(self):
self.search_for.initialize('bulk_edit_search_for')
self.replace_with.initialize('bulk_edit_replace_with')
@@ -692,7 +703,6 @@ def accept(self):
self.db.clean()
return QDialog.accept(self)
-
def series_changed(self, *args):
self.write_series = True
diff --git a/src/calibre/gui2/dialogs/metadata_bulk.ui b/src/calibre/gui2/dialogs/metadata_bulk.ui
index 44839bbacd..344bde0fa0 100644
--- a/src/calibre/gui2/dialogs/metadata_bulk.ui
+++ b/src/calibre/gui2/dialogs/metadata_bulk.ui
@@ -710,7 +710,7 @@ nothing should be put between the original text and the inserted text
Qt::Horizontal
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+ QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok