def open_config(self, config_path): if os.path.exists(config_path): app_config.set_last_dir(os.path.dirname(config_path)) if not config_path in self.windows: c = ConfigWindow(self) c.set_configuration(config_path, None) app_config.add_config_to_history(config_path) c.closeEvent = lambda x: self.windows.pop(config_path) self.windows[config_path] = c self.windows[config_path].show()
def open_config(self, config_path): if os.path.exists(config_path): app_config.set_last_dir(os.path.dirname(config_path)) if not config_path in self.windows: c = ConfigWindow(self) c.set_configuration(config_path, None) app_config.add_config_to_history(config_path) c.closeEvent = lambda x: self.windows.pop(config_path) self.windows[config_path] = c self.windows[config_path].show()
def open_config(self): cur_dir = app_config.get_config_history()[-1] params = {"caption":"Choose Configuration","filter":"Config Files(*.json *.halc)"} if cur_dir: params["dir"] = app_config.get_config_history()[-1] f = QtGui.QFileDialog.getOpenFileName(**params) if f[0]: self.config_path = f[0] app_config.add_config_to_history(self.config_path) self.set_configuration(self.config_path, self.working_dir)
def create_new_config(self): cur_dir = app_config.get_config_history()[-1] params = {"caption":"Choose Configuration","filter":"bc.json"} if cur_dir: params["dir"] = app_config.get_config_history()[-1] f = QtGui.QFileDialog.getSaveFileName(**params) if f[0]: self.config_path = f[0] FileConfigLoader.new(self.config_path) app_config.add_config_to_history(self.config_path) self.set_configuration(self.config_path, self.working_dir)
def create_new_config(self): params = {"caption":"Choose Configuration","filter":"bc.halc"} if len(app_config.get_config_history())>0: last_config = app_config.get_config_history()[-1] last_config = last_config.replace("'", '') params["dir"] = os.path.dirname(last_config) f = QtGui.QFileDialog.getSaveFileName(**params) if f[0]: self.config_path = f[0] FileConfigLoader.new(self.config_path) app_config.add_config_to_history(self.config_path) self.set_configuration(self.config_path, self.working_dir)
def create_new_config(self): params = {"caption": "Choose Configuration", "filter": "bc.halc"} if len(app_config.get_config_history()) > 0: last_config = app_config.get_config_history()[-1] last_config = last_config.replace("'", '') params["dir"] = os.path.dirname(last_config) f = QtGui.QFileDialog.getSaveFileName(**params) if f[0]: self.config_path = f[0] FileConfigLoader.new(self.config_path) app_config.add_config_to_history(self.config_path) self.set_configuration(self.config_path, self.working_dir)
def open_config(self): cur_dir = None if app_config.get_config_history(): cur_dir = app_config.get_config_history()[-1] params = { "caption": "Choose Configuration", "filter": "Config Files(bc.json *.halc)" } if cur_dir: params["dir"] = app_config.get_config_history()[-1] f = QtGui.QFileDialog.getOpenFileName(**params) if f[0]: self.config_path = f[0] app_config.add_config_to_history(self.config_path) self.set_configuration(self.config_path, self.working_dir)
def open_recent(self, *args, **kwargs): app_config.add_config_to_history(self.sender().text()) self.set_configuration(self.sender().text(), self.working_dir)
def open_recent(self, *args, **kwargs): app_config.add_config_to_history(self.sender().text()) self.set_configuration(self.sender().text(), self.working_dir)