Пример #1
0
 def closeEvent ( self, event ):
     """ Handles the user requesting the window to close.
     """
     # If the 'Handler' allowed the window to close, then pass the request
     # along to the standard Qt event handler, which will close the window:
     if getattr( self, '_closed', False ):
         QMainWindow.closeEvent( self, event )
Пример #2
0
 def closeEvent(self, event):
     '''Catch MainWindow's close event so we can hide it instead.'''
     if self.hide_window:
         self.hide()
         event.ignore()
     else:
         QMainWindow.closeEvent(self, event)
Пример #3
0
 def closeEvent(self, ev):
     self.saveMailInfo()
     loop = QtCore.QEventLoop()
     self.thread.finished.connect(loop.quit)
     self.thread.quit()
     loop.exec_()
     QMainWindow.closeEvent(self, ev)
Пример #4
0
    def closeEvent(self, event):
        self.saveSettings()

        global lo_target
        if lo_target and self.lo_server:
            lo_send(lo_target, "/unregister")

        QMainWindow.closeEvent(self, event)
Пример #5
0
    def handleQtCloseEvent(self, event):
        if self.isTrayAvailable() and self._parent.isVisible():
            event.accept()
            self.__hideShowCall()
            return

        self.close()
        QMainWindow.closeEvent(self._parent, event)
Пример #6
0
    def closeEvent(self, event):
        self.saveSettings()

        global lo_target
        if lo_target and self.lo_server:
            lo_send(lo_target, "/unregister")

        QMainWindow.closeEvent(self, event)
Пример #7
0
 def closeEvent(self, event):
     self.saveConfig()
     if not self.ensure_save_data("Exiting whith unsaved data",
                                  "The last modifications you made were not saved."
                                  " Are you sure you want to exit?"):
         event.ignore()
         return
     QMainWindow.closeEvent(self, event)
Пример #8
0
 def closeEvent(self, event):
     if not self.distributedObjects.editorController.closeOpenedFiles():
         event.ignore()  # closing source files may be canceled by user
     else:
         self.settings.setValue("geometry", self.saveGeometry())
         self.settings.setValue("windowState", self.saveState())
         QMainWindow.closeEvent(self, event)
         self.pluginloader.savePluginInfo()
Пример #9
0
 def closeEvent(self, event):
     """
     @type event: QEvent
     """
     if self.sender() is self.system_tray_icon.exit_action:
         QMainWindow.closeEvent(self, event)
     else:
         event.ignore()
         self.setVisible(False)
Пример #10
0
    def closeEvent(self, e):
        self.unregisterAllActions()

        # save the window state
        settings = QSettings()
        settings.setValue("/DB_Manager/mainWindow/windowState", self.saveState())
        settings.setValue("/DB_Manager/mainWindow/geometry", self.saveGeometry())

        QMainWindow.closeEvent(self, e)
Пример #11
0
 def closeEvent(self, event):
     if not self.do.editorController.closeOpenedFiles():
         event.ignore()  # closing source files may be canceled by user
     else:
         self.settings.setValue("geometry", self.saveGeometry())
         self.settings.setValue("windowState", self.saveState())
         self.dockToolBarManager.saveState(self.settings)
         QMainWindow.closeEvent(self, event)
         self.pluginloader.savePluginInfo()
Пример #12
0
 def closeEvent(self, event):
     self.saveConfig()
     if not self.ensure_save_data(
             "Exiting whith unsaved data",
             "The last modifications you made were not saved."
             " Are you sure you want to exit?"):
         event.ignore()
         return
     QMainWindow.closeEvent(self, event)
Пример #13
0
    def handleQtCloseEvent(self, event):
        if self.isTrayAvailable() and self._parent.isVisible():
            event.ignore()
            self.__hideShowCall()
            return False
        else:
            self.close()

        QMainWindow.closeEvent(self._parent, event)
        return True
Пример #14
0
    def closeEvent(self, e):
        self.unregisterAllActions()

        # save the window state
        settings = QSettings()
        settings.setValue("/DB_Manager/mainWindow/windowState",
                          self.saveState())
        settings.setValue("/DB_Manager/mainWindow/geometry",
                          self.saveGeometry())

        QMainWindow.closeEvent(self, e)
Пример #15
0
    def closeEvent(self, e):
        self.unregisterAllActions()
        # clear preview, this will delete the layer in preview tab
        self.preview.loadPreview(None)

        # save the window state
        settings = QSettings()
        settings.setValue("/DB_Manager/mainWindow/windowState", self.saveState())
        settings.setValue("/DB_Manager/mainWindow/geometry", self.saveGeometry())

        QMainWindow.closeEvent(self, e)
Пример #16
0
 def closeEvent(self, closeEvent):
     if not self.closed:
         self.closed = True
         try:
             self.settings.setValue("geometry", self.saveGeometry())
             self.settings.setValue("state", self.saveState())
             self.settings.setValue("locked", QVariant(self.locked))
             self.settings.sync()
         except:
             getCoreLogger().exception("while storing order of GUI plugins:\n  %s", str(sys.exc_info()))
     
     QMainWindow.closeEvent(self, closeEvent)     
Пример #17
0
    def closeEvent(self, event):
        if self.fIdleTimerId != 0:
            self.killTimer(self.fIdleTimerId)
            self.fIdleTimerId = 0

        self.saveSettings()
        self.slot_backendStop(True)

        QMainWindow.closeEvent(self, event)

        # Needed in case the web inspector is still alive
        #self.ui.webinspector.close()
        QApplication.instance().quit()
Пример #18
0
    def closeEvent(self, event):
        if self.fIdleTimerId != 0:
            self.killTimer(self.fIdleTimerId)
            self.fIdleTimerId = 0

        self.saveSettings()
        self.slot_backendStop()

        QMainWindow.closeEvent(self, event)

        # Needed in case the web inspector is still alive
        #self.ui.webinspector.close()
        QApplication.instance().quit()
Пример #19
0
    def closeEvent(self, e):
        self.unregisterAllActions()
        # clear preview, this will delete the layer in preview tab
        self.preview.loadPreview(None)

        # save the window state
        settings = QSettings()
        settings.setValue("/DB_Manager/mainWindow/windowState",
                          self.saveState())
        settings.setValue("/DB_Manager/mainWindow/geometry",
                          self.saveGeometry())

        QMainWindow.closeEvent(self, e)
Пример #20
0
	def onClose(self, closeEvent):
		cursor = self.configDb.cursor()
		cursor.execute("REPLACE INTO `settings` (name, value) VALUES ('mainwindow.x', ?), ('mainwindow.y', ?)", [self.pos().x(), self.pos().y()])

		sizes = self.mainWindow.splitter_2.sizes()
		for i, size in enumerate(sizes):
			cursor.execute("REPLACE INTO `settings` (name, value) VALUES ('splitter_2.%d', ?)" % i, [size])

		indexSize = self.mainWindow.indexes.columnWidth(0)
		cursor.execute("REPLACE INTO `settings` (name, value) VALUES ('tableIndexes.columnWidth', ?)", [indexSize])

		self.configDb.commit()

		QMainWindow.closeEvent(self, closeEvent)
Пример #21
0
 def closeEvent(self, event):
     """
     @type event: QEvent
     """
     if self.sender() is self.system_tray_icon.exit_action or not self.ssh_tunnel.isRunning():
         QMainWindow.closeEvent(self, event)
         if self.ssh_tunnel.isRunning():
             self.stop_tunnel()
             self.ssh_tunnel.quit()
             self.ssh_tunnel.wait()
         self.app.quit()
     else:
         event.ignore()
         self.setVisible(False)
Пример #22
0
 def closeEvent(self, event):
     self._saveAppState()
     # save rules if not empty and user clicked Modified/Save button
     if self.rulesModel.rowCount() > 0 and not self.cancelled:
         text = self.rulesModel.getRawRules().validate()
         if text:
             self.cancelled = True
             QMessageBox.information(self, APP_TITLE, 
                                     self.tr("Validation failed because of:<p><p>") + text)
             event.ignore()
             return              #  RETURN - cancel app closing ######
         self.rulesModel.saveScript()
     # accept window closing
     QMainWindow.closeEvent(self, event)
     # quit application
     m_app.quit()
	def closeEvent(self, e):
		"""
		if self.state == self.Unsaved:
			cad = u"Esta a punto de salir sin guardar, ¿salir?"
			reply = QMessageBox.question(self, 'Message', cad, QMessageBox.Yes, QMessageBox.No)
			if reply == QMessageBox.No:
				e.ignore()
				return
		"""
		
		#Vaciamos el proyecto antes de cerrar la aplicacion.
		self.centralWidget().reset()
		
		settings = QSettings("LuisjaCorp", "Criptocefa")
		settings.setValue("geometry", self.saveGeometry())
		settings.setValue("windowState", self.saveState())
		
		QMainWindow.closeEvent(self, e)
Пример #24
0
 def closeEvent(self, event):
     """Store setting on exit
     """
     sett.storeSetting('geometry', self.saveGeometry())
     sett.storeSetting('state', self.saveState())
     sett.storeSetting("splitter_1Sizes", self.splitter_1.saveState())
     sett.storeSetting("splitter_1Geo", self.splitter_1.saveGeometry())
     sett.storeSetting("splitter_2Sizes", self.splitter_2.saveState())
     sett.storeSetting('images/last_filename', self.image_name)
     sett.storeSetting('images/zoom_factor', self.getZoomFactor())
     row_l = self.comboBoxLang.currentIndex()
     lang = self.comboBoxLang.itemData(row_l).toString()
     if lang:
         sett.storeSetting('language', lang)
     row_p = self.comboBoxPSM.currentIndex()
     sett.storeSetting('PSM', self.comboBoxPSM.itemData(row_p).toString())
     row_r = self.comboBoxRIL.currentIndex()
     sett.storeSetting('RIL', self.comboBoxRIL.itemData(row_r).toString())
     QMainWindow.closeEvent(self, event)
Пример #25
0
    def onClose(self, closeEvent):
        cursor = self.configDb.cursor()
        cursor.execute(
            "REPLACE INTO `settings` (name, value) VALUES ('mainwindow.x', ?), ('mainwindow.y', ?)",
            [self.pos().x(), self.pos().y()])

        sizes = self.mainWindow.splitter_2.sizes()
        for i, size in enumerate(sizes):
            cursor.execute(
                "REPLACE INTO `settings` (name, value) VALUES ('splitter_2.%d', ?)"
                % i, [size])

        indexSize = self.mainWindow.indexes.columnWidth(0)
        cursor.execute(
            "REPLACE INTO `settings` (name, value) VALUES ('tableIndexes.columnWidth', ?)",
            [indexSize])

        self.configDb.commit()

        QMainWindow.closeEvent(self, closeEvent)
 def closeEvent(self, event):
     """Store setting on exit
     """
     sett.storeSetting('geometry', self.saveGeometry())
     sett.storeSetting('state', self.saveState())
     sett.storeSetting("splitter_1Sizes", self.splitter_1.saveState());
     sett.storeSetting("splitter_1Geo", self.splitter_1.saveGeometry());
     sett.storeSetting("splitter_2Sizes", self.splitter_2.saveState());
     sett.storeSetting('images/last_filename', self.image_name)
     sett.storeSetting('images/zoom_factor', self.getZoomFactor())
     row_l = self.comboBoxLang.currentIndex()
     lang = self.comboBoxLang.itemData(row_l).toString()
     if lang:
         sett.storeSetting('language', lang)
     row_p = self.comboBoxPSM.currentIndex()
     sett.storeSetting('PSM',
                       self.comboBoxPSM.itemData(row_p).toString())
     row_r = self.comboBoxRIL.currentIndex()
     sett.storeSetting('RIL',
                       self.comboBoxRIL.itemData(row_r).toString())
     QMainWindow.closeEvent(self, event)
Пример #27
0
    def closeEvent( self, event ):
        """NOT A PUBLIC API
        Close event handler.
        Shows save files dialog. Cancels close, if dialog was rejected
        """
        # request close all documents
        if not core.workspace().askToCloseAll():
            event.ignore()
            return

        core.aboutToTerminate.emit()
        self.hide()

        core.workspace().forceCloseAllDocuments()

        self._saveState()
        self._saveGeometry()

        return QMainWindow.closeEvent(self, event)
Пример #28
0
    def closeEvent(self, event):
        """NOT A PUBLIC API
        Close event handler.
        Shows save files dialog. Cancels close, if dialog was rejected
        """

        # saving geometry BEFORE closing widgets, because state might be changed, when docks are closed
        self._saveState()
        self._saveGeometry()

        # request close all documents
        if not core.workspace().askToCloseAll():
            event.ignore()
            return

        core.aboutToTerminate.emit()
        self.hide()

        core.workspace().forceCloseAllDocuments()

        return QMainWindow.closeEvent(self, event)
Пример #29
0
    def closeEvent( self, event ):
        """NOT A PUBLIC API
        Close event handler.
        Shows save files dialog. Cancels close, if dialog was rejected
        """

        # saving geometry BEFORE closing widgets, because state might be changed, when docks are closed
        self._saveState()
        self._saveGeometry()

        # request close all documents
        if not core.workspace().askToCloseAll():
            event.ignore()
            return

        core.aboutToTerminate.emit()
        self.hide()

        core.workspace().forceCloseAllDocuments()

        return QMainWindow.closeEvent(self, event)
Пример #30
0
 def closeEvent(self, event):
     logger.info('Exiting')
     QMainWindow.closeEvent(self, event)
Пример #31
0
 def closeEvent(self, event):
     self.treeWidget.cleanup()
     QMainWindow.closeEvent(self, event)
Пример #32
0
 def closeEvent(self, event):
     # Call the method of the parent as well
     QMainWindow.closeEvent(self, event)
Пример #33
0
 def closeEvent(self, event):
     self._widget.saveSettings()
     settings = QSettings()
     settings.setValue('geometry', self.saveGeometry())
     return QMainWindow.closeEvent(self, event)
Пример #34
0
 def closeEvent(self, event):
     self.closeConsoleLog()
     self.settings.setValue("geometry", self.saveGeometry())
     self.settings.setValue("windowState", self.saveState())
     QMainWindow.closeEvent(self, event)
     sys.exit(0)
Пример #35
0
 def closeEvent(self, evt):
     settings = QSettings()
     settings.setValue("mainWin/geometry", self.saveGeometry())
     settings.setValue("mainWin/windowState", self.saveState())
     QMainWindow.closeEvent(self, evt)
Пример #36
0
 def closeEvent(self, event):
     self.closePort()
     QMainWindow.closeEvent(self, event)
Пример #37
0
 def closeEvent(self, e):
     """Overrides the ``QMainWindow.closeEvent`` slot to save
     settings before we tear down the application.
     """
     self.__writeSettings()
     QMainWindow.closeEvent(self, e)
Пример #38
0
	def closeEvent(self, e):
		settings = QSettings("LuisjaCorp", "PnPCards")
		settings.setValue("geometry", self.saveGeometry())
		settings.setValue("windowState", self.saveState())
		QMainWindow.closeEvent(self, e)
Пример #39
0
 def closeEvent(self, event):
     #Use QT settings saving mechanism
     #settings stored in ~/.config/Statoil/ErtGui.conf
     self.__saveSettings()
     QMainWindow.closeEvent(self, event)
Пример #40
0
 def closeEvent(self, event):
     #Use QT settings saving mechanism
     #settings stored in ~/.config/Statoil/ErtGui.conf
     self.__saveSettings()
     QMainWindow.closeEvent(self, event)
 def closeEvent(self, event):
     #TODO: save state here
     #self.settings.setValue('guiState',self.saveState())
     self.closeInstrument()
     QMainWindow.closeEvent(self, event)
Пример #42
0
 def closeEvent(self, *args, **kwargs):
     
     self.is_closed = 1
     
     return QMainWindow.closeEvent(self, *args, **kwargs)
 def closeEvent(self, evt):
     settings = QSettings()
     settings.setValue("mainWin/geometry", self.saveGeometry())
     settings.setValue("mainWin/windowState", self.saveState())
     QMainWindow.closeEvent(self, evt)
Пример #44
0
 def closeEvent(self, event):
     settings = QSettings()
     settings.setValue('split', self.splitter.saveState())
     settings.setValue('header', self.tree.header().saveState())
     return QMainWindow.closeEvent(self, event)
Пример #45
0
 def closeEvent(self, event):
     self.saveSettings()
     QMainWindow.closeEvent(self, event)
 def closeEvent(self,event):
     #TODO: save state here
     #self.settings.setValue('guiState',self.saveState())
     self.closeInstrument()
     QMainWindow.closeEvent(self,event)