def getVar( var, title = 'Set Variable', label = 'Enter new value:'): oldvalue = '' if var in cgruconfig.VARS: oldvalue = cgruconfig.VARS[var] newvalue, ok = QtGui.QInputDialog.getText( None, title, label, text = oldvalue) if not ok: return cgruconfig.VARS[var] = str( newvalue) variables = [var] cgruconfig.writeVars(variables)
def applySettings( self): variables = [] for day in self.days: variables.append('nimby_' + day) line = str( self.te_begin[day].time().toString( self.time_format)) + ' ' line += str( self.te_end[day].time().toString( self.time_format)) if self.cb_enable[day].isChecked(): line += ' Enable' if self.cb_allow[day].isChecked(): line += ' nimby' else: line += ' NIMBY' if self.cb_eject[day].isChecked(): line += ' Eject' line = line.strip() cgruconfig.VARS[variables[-1]] = line variables.reverse() cgruconfig.writeVars(variables) nimby.refresh( reset = True) self.close()
def applySettings(self): variables = [] for day in self.days: variables.append('nimby_' + day) line = str(self.te_begin[day].time().toString( self.time_format)) + ' ' line += str(self.te_end[day].time().toString(self.time_format)) if self.cb_enable[day].isChecked(): line += ' Enable' if self.cb_allow[day].isChecked(): line += ' nimby' else: line += ' NIMBY' if self.cb_eject[day].isChecked(): line += ' Eject' line = line.strip() cgruconfig.VARS[variables[-1]] = line variables.reverse() cgruconfig.writeVars(variables) nimby.refresh(reset=True) self.close()
def triggerExecInTerminal(i_checked): var = 'keeper_execute_in_terminal' cgruconfig.VARS[var] = i_checked variables = [var] cgruconfig.writeVars(variables)