示例#1
0
 def isIncidentMediumReady(self):
     _list = [str(self.sf_gui.incidentMediumComboBox.itemText(i)) for i in range(1, self.sf_gui.incidentMediumComboBox.count())]
     _current_index = self.sf_gui.incidentMediumComboBox.currentIndex()-1
     [_list, current_index] = removeEmptyStrElementAndUpdateIndexSelected(_list, _current_index)
     if _list == [] or current_index == -1:
         return False
     return True
 def initGui(self):
     _list = [
         str(self.sf_gui.incidentMediumComboBox.itemText(i))
         for i in range(1, self.sf_gui.incidentMediumComboBox.count())
     ]
     self.current_index = self.sf_gui.incidentMediumComboBox.currentIndex(
     ) - 1
     [_list, _] = removeEmptyStrElementAndUpdateIndexSelected(
         _list, self.current_index)
     self.fillGui(_list)
	def validateEvent(cls):
		text_medium = cls.ui.textEdit.toPlainText()
		text_list = text_medium.split('\n')
		[text_list, current_index] = removeEmptyStrElementAndUpdateIndexSelected(text_list, cls.current_index)
		text_list.insert(0, 'Select or Define Incident Medium ...')
		cls.sf_gui.ui.incidentMediumComboBox.clear()
		cls.sf_gui.ui.incidentMediumComboBox.addItems(text_list)
		cls.sf_gui.ui.incidentMediumComboBox.setCurrentIndex(current_index)
		cls.close()
		
 def validateEvent(self):
     text_medium = str(self.ui.textEdit.toPlainText())
     text_list = text_medium.split('\n')
     [text_list,
      current_index] = removeEmptyStrElementAndUpdateIndexSelected(
          text_list, self.current_index)
     text_list.insert(0, 'Select or Define Incident Medium ...')
     self.sf_gui.incidentMediumComboBox.clear()
     self.sf_gui.incidentMediumComboBox.addItems(text_list)
     self.sf_gui.incidentMediumComboBox.setCurrentIndex(current_index)
     self.close()
	def initGui(cls):
		_list = [str(cls.sf_gui.ui.incidentMediumComboBox.itemText(i)) for i in range(1,cls.sf_gui.ui.incidentMediumComboBox.count())]
		cls.current_index = cls.sf_gui.ui.incidentMediumComboBox.currentIndex()-1
		[_list, current_index] = removeEmptyStrElementAndUpdateIndexSelected(_list, cls.current_index)
		cls.fillGui(_list)
	def retrieveIncidentMediumListAndIndex(cls):
		_list = [str(cls.sf_gui.ui.incidentMediumComboBox.itemText(i)) for i in range(1,cls.sf_gui.ui.incidentMediumComboBox.count())]
		_current_index = cls.sf_gui.ui.incidentMediumComboBox.currentIndex()-1
		[_list, current_index] = removeEmptyStrElementAndUpdateIndexSelected(_list, _current_index)
		str_list = ",".join(_list)
		return [str_list, current_index]