def _setup(self): core.pe.photo.PLAT_SPECIFIC_PHOTO_CLASS = PlatSpecificPhoto self._setupActions() self._update_options() self.recentResults = Recent(self, 'recentResults') self.recentResults.mustOpenItem.connect(self.model.load_from) self.resultWindow = None self.details_dialog = None self.directories_dialog = DirectoriesDialog(self) self.progress_window = ProgressWindow(self.directories_dialog, self.model.progress_window) self.problemDialog = ProblemDialog(parent=self.directories_dialog, model=self.model.problem_dialog) self.ignoreListDialog = IgnoreListDialog( parent=self.directories_dialog, model=self.model.ignore_list_dialog) self.deletionOptions = DeletionOptions( parent=self.directories_dialog, model=self.model.deletion_options) self.about_box = AboutBox(self.directories_dialog, self) self.directories_dialog.show() self.model.load() # The timer scheme is because if the nag is not shown before the application is # completely initialized, the nag will be shown before the app shows up in the task bar # In some circumstances, the nag is hidden by other window, which may make the user think # that the application haven't launched. QTimer.singleShot(0, self.finishedLaunching) QCoreApplication.instance().aboutToQuit.connect( self.application_will_terminate)
def _setup(self): self._setupActions() self._update_options() self.recentResults = Recent(self, 'recentResults') self.recentResults.mustOpenItem.connect(self.model.load_from) self.resultWindow = self.RESULT_WINDOW_CLASS(self) self.progress_window = ProgressWindow(self.resultWindow, self.model.progress_window) self.directories_dialog = DirectoriesDialog(self.resultWindow, self) self.details_dialog = self.DETAILS_DIALOG_CLASS( self.resultWindow, self) self.problemDialog = ProblemDialog(parent=self.resultWindow, model=self.model.problem_dialog) self.ignoreListDialog = IgnoreListDialog( parent=self.resultWindow, model=self.model.ignore_list_dialog) self.deletionOptions = DeletionOptions( parent=self.resultWindow, model=self.model.deletion_options) self.preferences_dialog = self.PREFERENCES_DIALOG_CLASS( self.resultWindow, self) self.about_box = AboutBox(self.resultWindow, self) self.directories_dialog.show() self.model.load() # The timer scheme is because if the nag is not shown before the application is # completely initialized, the nag will be shown before the app shows up in the task bar # In some circumstances, the nag is hidden by other window, which may make the user think # that the application haven't launched. QTimer.singleShot(0, self.finishedLaunching) self.connect(QCoreApplication.instance(), SIGNAL('aboutToQuit()'), self.application_will_terminate)
def _setup(self): core.pe.photo.PLAT_SPECIFIC_PHOTO_CLASS = PlatSpecificPhoto self._setupActions() self.details_dialog = None self._update_options() self.recentResults = Recent(self, "recentResults") self.recentResults.mustOpenItem.connect(self.model.load_from) self.resultWindow = None if self.use_tabs: self.main_window = TabBarWindow( self) if not self.prefs.tabs_default_pos else TabWindow(self) parent_window = self.main_window self.directories_dialog = self.main_window.createPage( "DirectoriesDialog", app=self) self.main_window.addTab(self.directories_dialog, "Directories", switch=False) self.actionDirectoriesWindow.setEnabled(False) else: # floating windows only self.main_window = None self.directories_dialog = DirectoriesDialog(self) parent_window = self.directories_dialog self.progress_window = ProgressWindow(parent_window, self.model.progress_window) self.problemDialog = ProblemDialog(parent=parent_window, model=self.model.problem_dialog) if self.use_tabs: self.ignoreListDialog = self.main_window.createPage( "IgnoreListDialog", parent=self.main_window, model=self.model.ignore_list_dialog) self.excludeListDialog = self.main_window.createPage( "ExcludeListDialog", app=self, parent=self.main_window, model=self.model.exclude_list_dialog) else: self.ignoreListDialog = IgnoreListDialog( parent=parent_window, model=self.model.ignore_list_dialog) self.excludeDialog = ExcludeListDialog( app=self, parent=parent_window, model=self.model.exclude_list_dialog) self.deletionOptions = DeletionOptions( parent=parent_window, model=self.model.deletion_options) self.about_box = AboutBox(parent_window, self) parent_window.show() self.model.load() self.SIGTERM.connect(self.handleSIGTERM) # The timer scheme is because if the nag is not shown before the application is # completely initialized, the nag will be shown before the app shows up in the task bar # In some circumstances, the nag is hidden by other window, which may make the user think # that the application haven't launched. QTimer.singleShot(0, self.finishedLaunching)
def __init__(self): ApplicationBase.__init__(self) self.prefs = Preferences() self.prefs.load() self.model = App(view=self) self._setupActions() self.mainWindow = MainWindow(app=self) self.aboutBox = AboutBox(self.mainWindow, self, withreg=False) self._progress = Progress(self.mainWindow) self.connect(self, SIGNAL('applicationFinishedLaunching()'), self.applicationFinishedLaunching) self.connect(QCoreApplication.instance(), SIGNAL('aboutToQuit()'), self.applicationWillTerminate) self._progress.finished.connect(self.jobFinished)
def __init__(self, filepath=None): ApplicationBase.__init__(self) self.prefs = Preferences() self.prefs.load() global APP_PREFS APP_PREFS = self.prefs locale = QLocale.system() dateFormat = self.prefs.dateFormat decimalSep = locale.decimalPoint() groupingSep = locale.groupSeparator() cachePath = QStandardPaths.standardLocations( QStandardPaths.CacheLocation)[0] appdata = getAppData() DateEdit.DATE_FORMAT = dateFormat self.model = MoneyGuruModel( view=self, date_format=dateFormat, decimal_sep=decimalSep, grouping_sep=groupingSep, cache_path=cachePath, appdata_path=appdata, ) # on the Qt side, we're single document based, so it's one doc per app. self.doc = Document(app=self) self.doc.model.connect() self.mainWindow = MainWindow(doc=self.doc) self.preferencesPanel = PreferencesPanel(self.mainWindow, app=self) self.aboutBox = AboutBox(self.mainWindow, self) self.initialFilePath = None if filepath and op.exists(filepath): self.initialFilePath = filepath elif self.prefs.recentDocuments: self.initialFilePath = self.prefs.recentDocuments[0] self.finishedLaunching.connect(self.applicationFinishedLaunching) QCoreApplication.instance().aboutToQuit.connect( self.applicationWillTerminate)
def __init__(self): appdata = str( QDesktopServices.storageLocation(QDesktopServices.DataLocation)) MusicGuruBase.__init__(self, appdata) ApplicationBase.__init__(self) if not op.exists(appdata): os.makedirs(appdata) logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING) self.prefs = Preferences() self.prefs.load() self.selectedBoardItems = [] self.selectedLocation = None self.mainWindow = MainWindow(app=self) self.locationsPanel = LocationsPanel(app=self) self.detailsPanel = DetailsPanel(app=self) self.ignoreBox = IgnoreBox(app=self) self.progress = Progress(self.mainWindow) self.aboutBox = AboutBox(self.mainWindow, self) self.connect(self.progress, SIGNAL('finished(QString)'), self.jobFinished) self.connect(self, SIGNAL('applicationFinishedLaunching()'), self.applicationFinishedLaunching)