Esempio n. 1
0
 def on_save(self):
     """
     Opens file browser when File -> Save ... is clicked
     """
     try:
         filename = str(QFileDialog.getSaveFileName(self, 'Open file', directory="./data", filter="INI (*.ini);;All files (*.*)"))
         InputForm.instance().save_params(filename)
     except Exception:
         QMessageBox.warning(self, "Error", "Error saving ini file!\nError: " + str(sys.exc_info()[1]))
Esempio n. 2
0
 def on_open(self):
     """
     Opens file browser when File -> Open ... is clicked
     """
     try:
         filename = str(
             QFileDialog.getOpenFileName(
                 self,
                 'Open file',
                 directory="./data",
                 filter="INI (*.ini);;All files (*.*)"))
         InputForm.instance().load_params(filename)
     except Exception:
         QMessageBox.warning(
             self, "Error",
             "Error reading ini file!\nError: " + str(sys.exc_info()[1]))
Esempio n. 3
0
    def closeEvent(cls):
        """
        Handles closing of the app
        Saves session settings
        """
        InputForm.instance().save_params("./config/last-session.ini")

        folder = './config/temp'
        for filename in os.listdir(folder):

            if filename == "README":
                continue

            file_path = os.path.join(folder, filename)
            try:
                if os.path.isfile(file_path):
                    os.unlink(file_path)
            except Exception, e:
                print e
Esempio n. 4
0
    def closeEvent(cls):
        """
        Handles closing of the app
        Saves session settings
        """
        InputForm.instance().save_params("./config/last-session.ini")

        folder = "./config/temp"
        for filename in os.listdir(folder):

            if filename == "README":
                continue

            file_path = os.path.join(folder, filename)
            try:
                if os.path.isfile(file_path):
                    os.unlink(file_path)
            except Exception, e:
                print e