Create catalog dialog now remembers its size

This commit is contained in:
Kovid Goyal 2011-01-27 09:37:51 -07:00
parent f050c0c225
commit 7376b04069
3 changed files with 12 additions and 2 deletions

View File

@ -17,7 +17,7 @@ from calibre.gui2.actions import InterfaceAction
class GenerateCatalogAction(InterfaceAction):
name = 'Generate Catalog'
action_spec = (_('Create catalog of books in your calibre library'), None, None, None)
action_spec = (_('Create a catalog of the books in your calibre library'), None, None, None)
dont_add_to = frozenset(['toolbar-device', 'context-menu-device'])
def generate_catalog(self):

View File

@ -31,7 +31,7 @@ class ConvertAction(InterfaceAction):
partial(self.convert_ebook, False, bulk=True))
cm.addSeparator()
ac = cm.addAction(
_('Create catalog of books in your calibre library'))
_('Create a catalog of the books in your calibre library'))
ac.triggered.connect(self.gui.iactions['Generate Catalog'].generate_catalog)
self.qaction.setMenu(cm)
self.qaction.triggered.connect(self.convert_ebook)

View File

@ -125,6 +125,10 @@ class Catalog(QDialog, Ui_Dialog):
self.apply)
self.show_plugin_tab(None)
geom = dynamic.get('catalog_window_geom', None)
if geom is not None:
self.restoreGeometry(bytes(geom))
def show_plugin_tab(self, idx):
cf = unicode(self.format.currentText()).lower()
while self.tabs.count() > 1:
@ -157,6 +161,7 @@ class Catalog(QDialog, Ui_Dialog):
dynamic.set('catalog_last_used_title', self.catalog_title)
self.catalog_sync = bool(self.sync.isChecked())
dynamic.set('catalog_sync_to_device', self.catalog_sync)
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
def apply(self):
# Store current values without building catalog
@ -167,3 +172,8 @@ class Catalog(QDialog, Ui_Dialog):
def accept(self):
self.save_catalog_settings()
return QDialog.accept(self)
def reject(self):
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
QDialog.reject(self)