From d2d8108e7c21756b5798a7d3eafcd3fa9ae0f915 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Apr 2015 08:03:58 +0530 Subject: [PATCH] ... --- src/calibre/gui2/widgets2.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/calibre/gui2/widgets2.py b/src/calibre/gui2/widgets2.py index 9765724754..606e3380eb 100644 --- a/src/calibre/gui2/widgets2.py +++ b/src/calibre/gui2/widgets2.py @@ -134,6 +134,17 @@ class RightClickButton(QToolButton): class Dialog(QDialog): + ''' + An improved version of Qt's QDialog class. This automatically remembers the + last used size, automatically connects the signals for QDialogButtonBox, + automatically sets the window title and if the dialog has an object names + splitter, automatically saves the splitter state. + + In order to use it, simply subclass an implement setup_ui(). You can also + implement sizeHint() to give the dialog a different default size when shown + for the first time. + ''' + def __init__(self, title, name, parent=None, prefs=gprefs): QDialog.__init__(self, parent) self.prefs_for_persistence = prefs