~stub/ubuntu/precise/calibre/devel

« back to all changes in this revision

Viewing changes to src/calibre/gui2/preferences/main.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-04-12 11:29:25 UTC
  • mfrom: (42.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110412112925-c7171kt2bb5rmft4
Tags: 0.7.50+dfsg-2
* debian/control: Build with libpodofo-dev to enable PDF metadata.
  (Closes: #619632)
* debian/control: Add libboost1.42-dev build dependency. Apparently it is
  needed in some setups. (Closes: #619807)
* debian/rules: Call dh_sip to generate a proper sip API dependency, to
  prevent crashes like #616372 for partial upgrades.
* debian/control: Bump python-qt4 dependency to >= 4.8.3-2, which reportedly
  fixes crashes on startup. (Closes: #619701, #620125)

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
 
158
158
    run_wizard_requested = pyqtSignal()
159
159
 
160
 
    def __init__(self, gui, initial_plugin=None):
 
160
    def __init__(self, gui, initial_plugin=None, close_after_initial=False):
161
161
        QMainWindow.__init__(self, gui)
162
162
        self.gui = gui
163
163
        self.must_restart = False
164
164
        self.committed = False
 
165
        self.close_after_initial = close_after_initial
165
166
 
166
167
        self.resize(900, 720)
167
168
        nh, nw = min_available_height()-25, available_width()-10
306
307
 
307
308
    def esc(self, *args):
308
309
        if self.stack.currentIndex() == 1:
309
 
            self.hide_plugin()
 
310
            self.cancel()
310
311
        elif self.stack.currentIndex() == 0:
311
312
            self.close()
312
313
 
331
332
                    show_copy_button=False)
332
333
        self.showing_widget.refresh_gui(self.gui)
333
334
        self.hide_plugin()
334
 
        if must_restart and rc:
 
335
        if self.close_after_initial or (must_restart and rc):
335
336
            self.close()
336
337
 
337
338
 
338
339
    def cancel(self, *args):
339
 
        self.hide_plugin()
 
340
        if self.close_after_initial:
 
341
            self.close()
 
342
        else:
 
343
            self.hide_plugin()
340
344
 
341
345
    def restore_defaults(self, *args):
342
346
        self.showing_widget.restore_defaults()