def write_config(self): """ Write user config """ config = Settings() config.set("pkgmanager", "path", repr(list(self.user_wralea_path))) # config.set("pkgmanager", "include_namespace", repr(self.include_namespace)) config.write()
def valid_editor(self): """ Valid editor parameter """ use_ext = bool(self.externalBool.checkState() == qt.QtCore.Qt.Checked) command = str(self.commandStr.text()) config = Settings() config.set("editor", "use_external", repr(use_ext)) config.set("editor", "command", command) config.write()
def writeSettings(self): """ Register current settings (geometry and window state) in a setting file """ if self.pm.cproject: from openalea.core.settings import Settings last_proj = self.pm.cproject.name config = Settings() config.set("ProjectManager", "Last Project", last_proj) config.write()
def writeSettings(self): """ Register current settings (geometry and window state) in a setting file """ if self.session.project: last_proj = self.session.project.name config = Settings() config.set("ProjectManager", "Last Project", last_proj) config.write()
def write_settings(self): """ Register current settings (geometry and window state) in a setting file """ cproject = self.project() from openalea.core.settings import Settings config = Settings() if cproject: last_proj = cproject.name config.set("ProjectManager", "Last Project", last_proj) else: config.set("ProjectManager", "Last Project", "") config.write()
def valid_ui(self): """ Valid UI Parameters """ d = [ ["run", "open"], ["run"], ["open"], ] index = self.dbclickBox.currentIndex() styles = ["Spline", "Polyline", "Line"] edge_style_index = self.comboBox.currentIndex() edge_style = styles[edge_style_index] config = Settings() config.set("UI", "DoubleClick", repr(d[index])) config.set("UI", "EdgeStyle", edge_style) config.set("UI", "EvalCue", str(self.evalCue.checkState() == qt.QtCore.Qt.Checked)) config.write() if edge_style != self.edge_style: self.edge_style = edge_style session = self.session session.notify_listeners() ws = session.workspaces for cn in ws: cn.notify_listeners(('graph_modified', ))
def valid_ui(self): """ Valid UI Parameters """ d = [["run", "open"], ["run"], ["open"]] index = self.dbclickBox.currentIndex() styles = ["Spline", "Polyline", "Line"] edge_style_index = self.comboBox.currentIndex() edge_style = styles[edge_style_index] config = Settings() config.set("UI", "DoubleClick", repr(d[index])) config.set("UI", "EdgeStyle", edge_style) config.set("UI", "EvalCue", str(self.evalCue.checkState() == qt.QtCore.Qt.Checked)) config.write() if edge_style != self.edge_style: self.edge_style = edge_style session = self.session session.notify_listeners() ws = session.workspaces for cn in ws: cn.notify_listeners(("graph_modified",))
def write_settings(self): """Save application settings. """ settings = Settings() #main window settings.set("MainWindow", "size", "(%d,%d)" % (self.width(), self.height())) settings.set("MainWindow", "pos", "(%d,%d)" % (self.x(), self.y())) sizes = "[%s]" % ",".join("%d" % val for val in self.splitter_2.sizes()) settings.set("MainWindow", "splitter_2", sizes) sizes = "[%s]" % ",".join("%d" % val for val in self.splitter_3.sizes()) settings.set("MainWindow", "splitter_3", sizes) #tree view settings.set("TreeView", "open", "[]") #workspace last_open = "[%s]" % ",".join("'%s'" % item for item in self._last_opened) settings.set("WorkSpace", "last", last_open) #provenance prov = self.get_provenance() settings.set("Provenance", "enable", str(prov)) settings.write()