def newProfile(self): win = BaseRecordDialog(self, ["name"]) win.frame.text_label.setText("Name for new profile:") win.connect(win, SIGNAL("okClicked()"), self.insertNewProfile) skeleton = self.cfg.get("management_gui", "template_profile") if skeleton not in self.profile.get_profile_list(): msg = "Name for new profile: (skeleton does not exist yet.)" win.frame.text_label.setText(msg) win.setRecordData(dict(name=skeleton)) win.show() self._dialog = win
def newProfile(self): win = BaseRecordDialog(self, ['name']) win.frame.text_label.setText('Name for new profile:') win.connect(win, SIGNAL('okClicked()'), self.insertNewProfile) skeleton = self.cfg.get('management_gui', 'template_profile') if skeleton not in self.profile.get_profile_list(): msg = 'Name for new profile: (skeleton does not exist yet.)' win.frame.text_label.setText(msg) win.setRecordData(dict(name=skeleton)) win.show() self._dialog = win
def _perform_new_action(self, context, ident): if context == 'package': win = BaseRecordDialog(self, ['package', 'action']) win.connect(win, SIGNAL('okClicked()'), self.slotAddPackage) win.setRecordData(dict(action='install')) win.show() self._dialog = win elif context == 'script': win = ScriptNameDialog(self, 'trait') win.connect(win, SIGNAL('okClicked()'), self.slotMakeNewScript) win.show() self._dialog = win else: raise MethodNotImplementedError(self, 'TraitView._perform_new_action')
def insertNewProfile(self): win = self._dialog profile = win.getRecordData()["name"] profile_list = self.profile.get_profile_list() if profile not in profile_list: skeleton = self.cfg.get("management_gui", "template_profile") if skeleton in profile_list: self.profile.copy_profile(skeleton, profile) self.refreshListView() else: dlg = BaseRecordDialog(win, ["suite"]) dlg.frame.text_label.setText("Select a suite for this profile") dlg.connect(dlg, SIGNAL("okClicked()"), self.insertNewProfilewithSuite) dlg.show() dlg.profile = profile win.suite_dialog = dlg KMessageBox.information(self, "need to select suite here") # need to determine if skeleton exists KMessageBox.information(self, "make profile %s" % profile) else: KMessageBox.error(self, "Profile %s already exists." % profile)
def insertNewProfile(self): win = self._dialog profile = win.getRecordData()['name'] profile_list = self.profile.get_profile_list() if profile not in profile_list: skeleton = self.cfg.get('management_gui', 'template_profile') if skeleton in profile_list: self.profile.copy_profile(skeleton, profile) self.refreshListView() else: dlg = BaseRecordDialog(win, ['suite']) dlg.frame.text_label.setText('Select a suite for this profile') dlg.connect(dlg, SIGNAL('okClicked()'), self.insertNewProfilewithSuite) dlg.show() dlg.profile = profile win.suite_dialog = dlg KMessageBox.information(self, 'need to select suite here') # need to determine if skeleton exists KMessageBox.information(self, 'make profile %s' % profile) else: KMessageBox.error(self, 'Profile %s already exists.' % profile)
def slotNew(self): win = BaseRecordDialog(self, ['name']) win.connect(win, SIGNAL('okClicked()'), self.slotNewSuiteNamed) self._dialog = win win.show()