Beispiel #1
0
    def closeEvent(self, event):
        self.iface.disconnectFromController()

        settings = QSettings()
        settings.setValue("/Qgis2threejs/wnd/geometry", self.saveGeometry())
        settings.setValue("/Qgis2threejs/wnd/state", self.saveState())
        QMainWindow.closeEvent(self, event)
Beispiel #2
0
 def closeEvent(self, event):
     dprint(1, "closing")
     self._exiting = True
     self.saveSizes()
     if not self.closeFile():
         self._exiting = False
         event.ignore()
         return
     self.skyplot.close()
     self.imgman.close()
     self.closing.emit()
     dprint(1, "invoking os._exit(0)")
     os._exit(0)
     QMainWindow.closeEvent(self, event)
Beispiel #3
0
  def closeEvent(self, event):
    self.iface.disconnectFromController()

    # save export settings to a settings file
    self.settings.saveSettings()

    settings = QSettings()
    settings.setValue("/Qgis2threejs/wnd/geometry", self.saveGeometry())
    settings.setValue("/Qgis2threejs/wnd/state", self.saveState())

    # close dialogs
    for dlg in self.findChildren((PropertiesDialog, ExportToWebDialog, NorthArrowDialog, FooterLabelDialog)):
      dlg.close()

    QMainWindow.closeEvent(self, event)
Beispiel #4
0
 def closeEvent(self, *args, **kwargs):
     sys.stdout = sys.__stdout__
     sys.stderr = sys.__stderr__
     # Terminate the running threads.
     # Set the shutdown flag on each thread to trigger a clean shutdown of each thread.
     self.mainWindow.myRpcWd.shutdown_flag.set()
     print("Saving stuff & closing...")
     if getattr(self.mainWindow.hwdevice, 'dongle', None) is not None:
         self.mainWindow.hwdevice.dongle.close()
         print("Dongle closed")
         
     # Save window/splitter size to cache file
     self.cache["window_width"] = self.width()
     self.cache["window_height"] = self.height()
     self.cache["splitter_sizes"] = self.mainWindow.splitter.sizes()
     self.cache["console_hidden"] = (self.mainWindow.btn_consoleToggle.text() == 'Show')
     
     # Save mnList order to cache file
     mnOrder = {}
     mnList = self.mainWindow.tabMain.myList
     for i in range(mnList.count()):
         mnName = mnList.itemWidget(mnList.item(i)).alias
         mnOrder[mnName] = i
     self.cache['mnList_order'] = mnOrder
     
     # Write cache file
     writeToFile(self.cache, cache_File)
     print("Bye Bye.")
     return QMainWindow.closeEvent(self, *args, **kwargs)
Beispiel #5
0
    def closeEvent(self, event):
        self.iface.abort()

        # save export settings to a settings file
        self.settings.saveSettings()

        settings = QSettings()
        settings.setValue("/Qgis2threejs/wnd/geometry", self.saveGeometry())
        settings.setValue("/Qgis2threejs/wnd/state", self.saveState())

        # stop worker thread event loop
        if self.thread:
            self.thread.quit()
            self.thread.wait()

        # close dialogs
        for dlg in self.findChildren((PropertiesDialog, ExportToWebDialog,
                                      NorthArrowDialog, HFLabelDialog)):
            dlg.close()

        QMainWindow.closeEvent(self, event)
Beispiel #6
0
 def closeEvent(self, *args, **kwargs):
     sys.stdout = sys.__stdout__
     sys.stderr = sys.__stderr__
     # Terminate the running threads.
     # Set the shutdown flag on each thread to trigger a clean shutdown of each thread.
     self.mainWindow.myRpcWd.shutdown_flag.set()
     print("Saving stuff & closing...")
     if getattr(self.mainWindow.hwdevice, 'dongle', None) is not None:
         self.mainWindow.hwdevice.dongle.close()
         print("Dongle closed")
     print("Bye Bye.")
     return QMainWindow.closeEvent(self, *args, **kwargs)
Beispiel #7
0
    def closeEvent(self, *args):
        gprefs.set('preferences_window_geometry',
                bytearray(self.saveGeometry()))
        if self.committed:
            self.gui.must_restart_before_config = self.must_restart
            self.gui.tags_view.recount()
            self.gui.create_device_menu()
            self.gui.set_device_menu_items_state(bool(self.gui.device_connected))
            self.gui.bars_manager.apply_settings()
            self.gui.bars_manager.update_bars()
            self.gui.build_context_menus()

        return QMainWindow.closeEvent(self, *args)
Beispiel #8
0
    def closeEvent(self, *args):
        gprefs.set('preferences_window_geometry',
                   bytearray(self.saveGeometry()))
        if self.committed:
            self.gui.must_restart_before_config = self.must_restart
            self.gui.tags_view.recount()
            self.gui.create_device_menu()
            self.gui.set_device_menu_items_state(
                bool(self.gui.device_connected))
            self.gui.bars_manager.apply_settings()
            self.gui.bars_manager.update_bars()
            self.gui.build_context_menus()

        return QMainWindow.closeEvent(self, *args)
Beispiel #9
0
    def closeEvent(self, *args, **kwargs):
        # Restore output stream
        sys.stdout = sys.__stdout__

        # Terminate the running threads.
        # Set the shutdown flag on each thread to trigger a clean shutdown of each thread.
        self.mainWindow.myRpcWd.shutdown_flag.set()
        print("Saving stuff & closing...")
        if getattr(self.mainWindow.hwdevice, 'dongle', None) is not None:
            self.mainWindow.hwdevice.dongle.close()
            print("Dongle closed")

        # Update window/splitter size
        self.cache['window_width'] = self.width()
        self.cache['window_height'] = self.height()
        self.cache['splitter_x'] = self.mainWindow.splitter.sizes()[0]
        self.cache['splitter_y'] = self.mainWindow.splitter.sizes()[1]
        self.cache['console_hidden'] = (
            self.mainWindow.btn_consoleToggle.text() == 'Show')

        # Update mnList order to cache settings
        mnOrder = {}
        mnList = self.mainWindow.tabMain.myList
        for i in range(mnList.count()):
            mnName = mnList.itemWidget(mnList.item(i)).alias
            mnOrder[mnName] = i
        self.cache['mnList_order'] = mnOrder

        # persist cache
        saveCacheSettings(self.cache)

        # Clear Rewards and Governance DB
        try:
            self.db.open()
        except Exception:
            pass
        self.db.clearTable('REWARDS')
        self.db.clearTable('PROPOSALS')
        self.db.clearTable('MY_VOTES')

        # close database
        self.db.close()

        # Adios
        print("Bye Bye.")

        # Return
        return QMainWindow.closeEvent(self, *args, **kwargs)