Edit metadata dialog: When setting the series from a format or via metadata download, ensure that the series index is not automatically changed, when closing the dialog. Fixes #918751 (Series numbering sometimes incorrect)

This commit is contained in:
Kovid Goyal 2012-01-20 09:23:20 +05:30
parent f50122805c
commit 5e677a39a5
2 changed files with 4 additions and 0 deletions

View File

@ -573,6 +573,9 @@ class SeriesIndexEdit(QDoubleSpinBox):
import traceback import traceback
traceback.print_exc() traceback.print_exc()
def reset_original(self):
self.original_series_name = self.series_edit.current_val
def break_cycles(self): def break_cycles(self):
try: try:
self.series_edit.currentIndexChanged.disconnect() self.series_edit.currentIndexChanged.disconnect()

View File

@ -376,6 +376,7 @@ class MetadataSingleDialogBase(ResizableDialog):
if not mi.is_null('series') and mi.series.strip(): if not mi.is_null('series') and mi.series.strip():
self.series.current_val = mi.series self.series.current_val = mi.series
if mi.series_index is not None: if mi.series_index is not None:
self.series_index.reset_original()
self.series_index.current_val = float(mi.series_index) self.series_index.current_val = float(mi.series_index)
if not mi.is_null('languages'): if not mi.is_null('languages'):
langs = [canonicalize_lang(x) for x in mi.languages] langs = [canonicalize_lang(x) for x in mi.languages]