mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #8575 (Catalog dialog box sizing)
This commit is contained in:
parent
336e35c8ae
commit
bb19d8525b
@ -8,15 +8,12 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
from PyQt4 import QtGui
|
|
||||||
from PyQt4.Qt import QDialog, SIGNAL
|
|
||||||
|
|
||||||
from calibre.customize.ui import config
|
from calibre.customize.ui import config
|
||||||
from calibre.gui2.dialogs.catalog_ui import Ui_Dialog
|
from calibre.gui2.dialogs.catalog_ui import Ui_Dialog
|
||||||
from calibre.gui2 import dynamic
|
from calibre.gui2 import dynamic, ResizableDialog
|
||||||
from calibre.customize.ui import catalog_plugins
|
from calibre.customize.ui import catalog_plugins
|
||||||
|
|
||||||
class Catalog(QDialog, Ui_Dialog):
|
class Catalog(ResizableDialog, Ui_Dialog):
|
||||||
''' Catalog Dialog builder'''
|
''' Catalog Dialog builder'''
|
||||||
|
|
||||||
def __init__(self, parent, dbspec, ids, db):
|
def __init__(self, parent, dbspec, ids, db):
|
||||||
@ -24,10 +21,8 @@ class Catalog(QDialog, Ui_Dialog):
|
|||||||
from calibre import prints as info
|
from calibre import prints as info
|
||||||
from PyQt4.uic import compileUi
|
from PyQt4.uic import compileUi
|
||||||
|
|
||||||
QDialog.__init__(self, parent)
|
ResizableDialog.__init__(self, parent)
|
||||||
|
|
||||||
# Run the dialog setup generated from catalog.ui
|
|
||||||
self.setupUi(self)
|
|
||||||
self.dbspec, self.ids = dbspec, ids
|
self.dbspec, self.ids = dbspec, ids
|
||||||
|
|
||||||
# Display the number of books we've been passed
|
# Display the number of books we've been passed
|
||||||
@ -120,9 +115,7 @@ class Catalog(QDialog, Ui_Dialog):
|
|||||||
self.sync.setChecked(dynamic.get('catalog_sync_to_device', True))
|
self.sync.setChecked(dynamic.get('catalog_sync_to_device', True))
|
||||||
|
|
||||||
self.format.currentIndexChanged.connect(self.show_plugin_tab)
|
self.format.currentIndexChanged.connect(self.show_plugin_tab)
|
||||||
self.connect(self.buttonBox.button(QtGui.QDialogButtonBox.Apply),
|
self.buttonBox.button(self.buttonBox.Apply).clicked.connect(self.apply)
|
||||||
SIGNAL("clicked()"),
|
|
||||||
self.apply)
|
|
||||||
self.show_plugin_tab(None)
|
self.show_plugin_tab(None)
|
||||||
|
|
||||||
geom = dynamic.get('catalog_window_geom', None)
|
geom = dynamic.get('catalog_window_geom', None)
|
||||||
@ -163,7 +156,7 @@ class Catalog(QDialog, Ui_Dialog):
|
|||||||
dynamic.set('catalog_sync_to_device', self.catalog_sync)
|
dynamic.set('catalog_sync_to_device', self.catalog_sync)
|
||||||
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
|
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
|
||||||
|
|
||||||
def apply(self):
|
def apply(self, *args):
|
||||||
# Store current values without building catalog
|
# Store current values without building catalog
|
||||||
self.save_catalog_settings()
|
self.save_catalog_settings()
|
||||||
if self.tabs.count() > 1:
|
if self.tabs.count() > 1:
|
||||||
@ -171,9 +164,9 @@ class Catalog(QDialog, Ui_Dialog):
|
|||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
self.save_catalog_settings()
|
self.save_catalog_settings()
|
||||||
return QDialog.accept(self)
|
return ResizableDialog.accept(self)
|
||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
|
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
|
||||||
QDialog.reject(self)
|
ResizableDialog.reject(self)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<string>Generate catalog</string>
|
<string>Generate catalog</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/library.png</normaloff>:/images/library.png</iconset>
|
<normaloff>:/images/library.png</normaloff>:/images/library.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
@ -31,7 +31,38 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>666</width>
|
||||||
|
<height>599</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
<widget class="QTabWidget" name="tabs">
|
<widget class="QTabWidget" name="tabs">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
@ -82,13 +113,6 @@
|
|||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QLineEdit" name="title"/>
|
<widget class="QLineEdit" name="title"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QCheckBox" name="sync">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Send catalog to device automatically</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -96,30 +120,31 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>0</width>
|
||||||
<height>299</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="sync">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Send catalog to device automatically</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
</layout>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
</widget>
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../work/calibre/resources/images.qrc"/>
|
<include location="../../../../resources/images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user