def __init__(self, parent=None, state=None, dataModel=Impact): QDialog.__init__(self, parent) self.setAttribute(Qt.WA_DeleteOnClose) MapperMixin.__init__(self, dataModel) self.resize(300, 200) self.setWindowTitle( QApplication.translate("ImpactEditor", "Project Impact Editor")) self.gridLayout = QGridLayout(self) self.gridLayout.setMargin(10) self.vlNotification = QVBoxLayout() self.vlNotification.setMargin(0) self.gridLayout.addLayout(self.vlNotification, 0, 0, 1, 2) #Add vertical layout for the notification bar self.setNotificationLayout(self.vlNotification) self.lblImpact = QLabel(self) self.lblImpact.setText( QApplication.translate("ImpactEditor", "Socio-Economic Impact")) self.gridLayout.addWidget(self.lblImpact, 1, 0, 1, 1) self.cboImpact = ComboBoxWithOther(self) self.cboImpact.lineEdit().setMaxLength(30) self.gridLayout.addWidget(self.cboImpact, 1, 1, 1, 1) self.lblRank = QLabel(self) self.lblRank.setText(QApplication.translate("ImpactEditor", "Rank")) self.gridLayout.addWidget(self.lblRank, 2, 0, 1, 1) self.cboRank = QComboBox(self) self.cboRank.setMinimumSize(QSize(0, 30)) self.gridLayout.addWidget(self.cboRank, 2, 1, 1, 1) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Save) self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 2) #Load combobox options loadComboSelections(self.cboImpact.comboBox(), CheckSocioEconomicImpact) self.cboRank.addItem("") self.cboRank.addItem( QApplication.translate("ImpactEditor", "3 (Highest)"), 3) self.cboRank.addItem("2", 2) self.cboRank.addItem( QApplication.translate("ImpactEditor", "1 (Lowest)"), 1) #Configure mappings self.addMapping("itemID",self.cboImpact.comboBox(),True, \ pseudoname=QApplication.translate("ImpactEditor","Priority Service")) self.addMapping("OtherItem", self.cboImpact.lineEdit()) self.addMapping("Rank", self.cboRank, True) #Connect signals self.connect(self.buttonBox, SIGNAL("accepted()"), self.submit) self.connect(self.buttonBox, SIGNAL("rejected()"), self.cancel)
def __init__(self,parent,socialtenure): QDialog.__init__(self,parent) self.setupUi(self) self.socialtenure = socialtenure #GUI initialization self.initGui() #Load STR info loadComboSelections(self.cboSTRType, CheckSocialTenureRelationship) setComboCurrentIndexWithItemData(self.cboSTRType,socialtenure.SocialTenureType) if socialtenure.AgreementAvailable: self.chkSTRAgreement.setChecked(True) #Setup notification self.notifBar = NotificationBar(self.vlNotification) #Setup dirty state control monitor self._strDirtMonitor = ControlDirtyTrackerCollection() #Register controls for monitoring dirty state self._strDirtMonitor.addControl(self.cboSTRType) self._strDirtMonitor.addControl(self.chkSTRAgreement) ''' Flag for saving or updating the respondent on hitting enter. This is useful for situations where you wish to defer saving or updating to be handled by another control. ''' self.saveUpdateOnEnter = True
def __init__(self, parent=None, datamodel=None): QDialog.__init__(self, parent) self.setupUi(self) BasePersonDialogMixin.__init__(self, datamodel) #Load combobox items loadComboSelections(self.cboGender, CheckGender) loadComboSelections(self.cboMaritalStatus, CheckMaritalStatus) #Set current date as maximum date self.dtDoB.setMaximumDate(QDate.currentDate()) #Input mask for controlling cellphone number entries. self.txtCellphone.setInputMask("9999-999999") self.txtCellphone.setCursorPosition(0) #Specify mappings self.addMapping("FirstName", self.txtFirstName, True) self.addMapping("LastName", self.txtLastName, True) self.addMapping("Cellphone", self.txtCellphone) self.addMapping("GenderID", self.cboGender, True, pseudoname="Gender") self.addMapping("MaritalStatusID", self.cboMaritalStatus, True, pseudoname="Marital Status") self.addMapping("DateofBirth", self.dtDoB) #Connect signals self.buttonBox.accepted.connect(self.submit) self.buttonBox.rejected.connect(self.cancel)
def __init__(self, parent=None, datamodel=Witness): BasePerson.__init__(self, parent, datamodel) self.setWindowTitle( QApplication.translate("WitnessEditor", "Witness Editor")) #Add widget for capturing the witness relationship lblRelationship = QLabel(self) lblRelationship.setText( QApplication.translate("WitnessEditor", "Relationship")) self.cboRelationship = QComboBox(self) self.cboRelationship.setMinimumHeight(30) loadComboSelections(self.cboRelationship, CheckWitnessRelationship) #Specify additional mapping for respondent role self.addMapping("RelationshipID", self.cboRelationship, True, pseudoname="Witness Relationship") rowCount = self.gridLayout.rowCount() self.gridLayout.removeWidget(self.buttonBox) self.gridLayout.addWidget(lblRelationship, rowCount - 1, 0, 1, 1) self.gridLayout.addWidget(self.cboRelationship, rowCount - 1, 1, 1, 1) self.gridLayout.addWidget(self.buttonBox, rowCount, 0, 1, 2)
def __init__(self, parent=None, datamodel=Respondent): BasePerson.__init__(self, parent, datamodel) self.setWindowTitle( QApplication.translate("RespondentEditor", "Respondent Editor")) #Add widget for capturing the respondent role lblRole = QLabel(self) lblRole.setText(QApplication.translate("RespondentEditor", "Role")) self.cboRole = QComboBox(self) self.cboRole.setMinimumHeight(30) loadComboSelections(self.cboRole, CheckRespondentType) #Specify additional mapping for respondent role self.addMapping("RoleID", self.cboRole, True, pseudoname="Respondent Role") rowCount = self.gridLayout.rowCount() self.gridLayout.removeWidget(self.buttonBox) self.gridLayout.addWidget(lblRole, rowCount - 1, 0, 1, 1) self.gridLayout.addWidget(self.cboRole, rowCount - 1, 1, 1, 1) self.gridLayout.addWidget(self.buttonBox, rowCount, 0, 1, 2)
def __init__(self,parent=None,datamodel=None): QDialog.__init__(self,parent) self.setupUi(self) BasePersonDialogMixin.__init__(self,datamodel) #Load combobox items loadComboSelections(self.cboGender,CheckGender) loadComboSelections(self.cboMaritalStatus,CheckMaritalStatus) #Set current date as maximum date self.dtDoB.setMaximumDate(QDate.currentDate()) #Input mask for controlling cellphone number entries. self.txtCellphone.setInputMask("9999-999999") self.txtCellphone.setCursorPosition(0) #Specify mappings self.addMapping("FirstName", self.txtFirstName, True) self.addMapping("LastName", self.txtLastName, True) self.addMapping("Cellphone", self.txtCellphone) self.addMapping("GenderID", self.cboGender,True,pseudoname="Gender") self.addMapping("MaritalStatusID", self.cboMaritalStatus,True,pseudoname="Marital Status") self.addMapping("DateofBirth", self.dtDoB) #Connect signals self.buttonBox.accepted.connect(self.submit) self.buttonBox.rejected.connect(self.cancel)
def __init__(self, parent=None, state=None, dataModel=Priority): QDialog.__init__(self, parent) self.setAttribute(Qt.WA_DeleteOnClose) MapperMixin.__init__(self, dataModel) self.resize(290, 200) self.setWindowTitle(QApplication.translate("PriorityServiceEditor", "Priority Service Editor")) self.gridLayout = QGridLayout(self) self.gridLayout.setMargin(10) self.vlNotification = QVBoxLayout() self.vlNotification.setMargin(0) self.gridLayout.addLayout(self.vlNotification, 0, 0, 1, 2) # Add vertical layout for the notification bar self.setNotificationLayout(self.vlNotification) self.lblPService = QLabel(self) self.lblPService.setText(QApplication.translate("PriorityServiceEditor", "Service")) self.gridLayout.addWidget(self.lblPService, 1, 0, 1, 1) self.cboPService = ComboBoxWithOther(self) self.cboPService.lineEdit().setMaxLength(30) self.gridLayout.addWidget(self.cboPService, 1, 1, 1, 1) self.lblRank = QLabel(self) self.lblRank.setText(QApplication.translate("PriorityServiceEditor", "Rank")) self.gridLayout.addWidget(self.lblRank, 2, 0, 1, 1) self.cboRank = QComboBox(self) self.cboRank.setMinimumSize(QSize(0, 30)) self.gridLayout.addWidget(self.cboRank, 2, 1, 1, 1) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Save) self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 2) # Load combobox options loadComboSelections(self.cboPService.comboBox(), CheckInputService) self.cboRank.addItem("") self.cboRank.addItem(QApplication.translate("PriorityServiceEditor", "3 (Highest)"), 3) self.cboRank.addItem("2", 2) self.cboRank.addItem(QApplication.translate("PriorityServiceEditor", "1 (Lowest)"), 1) # Configure mappings self.addMapping( "itemID", self.cboPService.comboBox(), True, pseudoname=QApplication.translate("PriorityServiceEditor", "Priority Service"), ) self.addMapping("OtherItem", self.cboPService.lineEdit()) self.addMapping("Rank", self.cboRank, True) # Connect signals self.connect(self.buttonBox, SIGNAL("accepted()"), self.submit) self.connect(self.buttonBox, SIGNAL("rejected()"), self.cancel)
def __init__(self, parent=None, state=None, dataModel=FoodCrop): QDialog.__init__(self, parent) self.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) MapperMixin.__init__(self, dataModel) # Connect signals self.buttonBox.accepted.connect(self.submit) self.buttonBox.rejected.connect(self.cancel) # Load combobox items loadComboSelections(self.cboCropCategory, CheckFoodCropCategory) # Define mappings self.addMapping("Acreage", self.sbAcreage) self.addMapping("CropName", self.txtCropName, True) self.addMapping("CategoryID", self.cboCropCategory, True, pseudoname="Food crop category")
def __init__(self, parent=None, state=None, dataModel=HouseholdSaving): QDialog.__init__(self, parent) self.setAttribute(Qt.WA_DeleteOnClose) MapperMixin.__init__(self, dataModel) self.resize(290, 175) self.setWindowTitle( QApplication.translate("HouseholdSavingEditor", "Household Saving Editor")) self.gridLayout = QGridLayout(self) self.vlNotification = QVBoxLayout() self.vlNotification.setMargin(0) self.gridLayout.addLayout(self.vlNotification, 0, 0, 1, 2) #Add vertical layout for the notification bar self.setNotificationLayout(self.vlNotification) self.lblSavingsOption = QLabel(self) self.lblSavingsOption.setText( QApplication.translate("HouseholdIncomeEditor", "Savings Option")) self.gridLayout.addWidget(self.lblSavingsOption, 1, 0, 1, 1) self.cboSavingsOption = ComboBoxWithOther(self) self.cboSavingsOption.setMinimumSize(QSize(0, 30)) self.gridLayout.addWidget(self.cboSavingsOption, 1, 1, 1, 1) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Save) self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 2) #Load saving options loadComboSelections(self.cboSavingsOption.comboBox(), CheckSavingsOption) #Configure mappings self.addMapping("OptionID",self.cboSavingsOption.comboBox(),True, \ pseudoname=QApplication.translate("HouseholdSavingEditor","Saving option type")) self.addMapping("OtherOption", self.cboSavingsOption.lineEdit()) #Connect signals self.connect(self.buttonBox, SIGNAL("accepted()"), self.submit) self.connect(self.buttonBox, SIGNAL("rejected()"), self.cancel)
def __init__(self, parent=None, state=None, dataModel=HouseholdSaving): QDialog.__init__(self, parent) self.setAttribute(Qt.WA_DeleteOnClose) MapperMixin.__init__(self, dataModel) self.resize(290, 175) self.setWindowTitle(QApplication.translate("HouseholdSavingEditor", "Household Saving Editor")) self.gridLayout = QGridLayout(self) self.vlNotification = QVBoxLayout() self.vlNotification.setMargin(0) self.gridLayout.addLayout(self.vlNotification, 0, 0, 1, 2) # Add vertical layout for the notification bar self.setNotificationLayout(self.vlNotification) self.lblSavingsOption = QLabel(self) self.lblSavingsOption.setText(QApplication.translate("HouseholdIncomeEditor", "Savings Option")) self.gridLayout.addWidget(self.lblSavingsOption, 1, 0, 1, 1) self.cboSavingsOption = ComboBoxWithOther(self) self.cboSavingsOption.setMinimumSize(QSize(0, 30)) self.gridLayout.addWidget(self.cboSavingsOption, 1, 1, 1, 1) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Save) self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 2) # Load saving options loadComboSelections(self.cboSavingsOption.comboBox(), CheckSavingsOption) # Configure mappings self.addMapping( "OptionID", self.cboSavingsOption.comboBox(), True, pseudoname=QApplication.translate("HouseholdSavingEditor", "Saving option type"), ) self.addMapping("OtherOption", self.cboSavingsOption.lineEdit()) # Connect signals self.connect(self.buttonBox, SIGNAL("accepted()"), self.submit) self.connect(self.buttonBox, SIGNAL("rejected()"), self.cancel)
def __init__(self, parent=None, state=None, dataModel=FoodCrop): QDialog.__init__(self, parent) self.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) MapperMixin.__init__(self, dataModel) #Connect signals self.buttonBox.accepted.connect(self.submit) self.buttonBox.rejected.connect(self.cancel) #Load combobox items loadComboSelections(self.cboCropCategory, CheckFoodCropCategory) #Define mappings self.addMapping("Acreage", self.sbAcreage) self.addMapping("CropName", self.txtCropName, True) self.addMapping("CategoryID", self.cboCropCategory, True, pseudoname="Food crop category")
def __init__(self,parent=None,datamodel = Respondent): BasePerson.__init__(self,parent,datamodel) self.setWindowTitle(QApplication.translate("RespondentEditor","Respondent Editor")) #Add widget for capturing the respondent role lblRole = QLabel(self) lblRole.setText(QApplication.translate("RespondentEditor","Role")) self.cboRole = QComboBox(self) self.cboRole.setMinimumHeight(30) loadComboSelections(self.cboRole,CheckRespondentType) #Specify additional mapping for respondent role self.addMapping("RoleID", self.cboRole,True,pseudoname="Respondent Role") rowCount = self.gridLayout.rowCount() self.gridLayout.removeWidget(self.buttonBox) self.gridLayout.addWidget(lblRole, rowCount-1, 0, 1, 1) self.gridLayout.addWidget(self.cboRole, rowCount-1, 1, 1, 1) self.gridLayout.addWidget(self.buttonBox,rowCount,0,1,2)
def __init__(self,parent=None,datamodel = Witness): BasePerson.__init__(self,parent,datamodel) self.setWindowTitle(QApplication.translate("WitnessEditor","Witness Editor")) #Add widget for capturing the witness relationship lblRelationship = QLabel(self) lblRelationship.setText(QApplication.translate("WitnessEditor","Relationship")) self.cboRelationship = QComboBox(self) self.cboRelationship.setMinimumHeight(30) loadComboSelections(self.cboRelationship,CheckWitnessRelationship) #Specify additional mapping for respondent role self.addMapping("RelationshipID", self.cboRelationship,True,pseudoname="Witness Relationship") rowCount = self.gridLayout.rowCount() self.gridLayout.removeWidget(self.buttonBox) self.gridLayout.addWidget(lblRelationship, rowCount-1, 0, 1, 1) self.gridLayout.addWidget(self.cboRelationship, rowCount-1, 1, 1, 1) self.gridLayout.addWidget(self.buttonBox,rowCount,0,1,2)