def _add_address(self): ea = gmAddressWidgets.cAddressEAPnl(self, -1) ea.address_holder = self.__identity dlg = gmEditArea.cGenericEditAreaDlg2(self, -1, edit_area=ea) dlg.SetTitle(_('Adding new address')) if dlg.ShowModal() == wx.ID_OK: return True return False
def _add_address(self): ea = gmAddressWidgets.cAddressEAPnl(self, -1) ea.address_holder = self.__identity dlg = gmEditArea.cGenericEditAreaDlg2(self, -1, edit_area = ea) dlg.SetTitle(_('Adding new address')) if dlg.ShowModal() == wx.ID_OK: return True return False
def _on_add_new_address_button_pressed(self, event): ea = gmAddressWidgets.cAddressEAPnl(self, -1) ea.address_holder = self.__unit ea.type_is_editable = False dlg = gmEditArea.cGenericEditAreaDlg2(self, -1, edit_area = ea) dlg.SetTitle(_('Adding new address')) if dlg.ShowModal() != wx.ID_OK: return False self.__refresh() return True
def _on_add_new_address_button_pressed(self, event): ea = gmAddressWidgets.cAddressEAPnl(self, -1) ea.address_holder = self.__unit ea.type_is_editable = False dlg = gmEditArea.cGenericEditAreaDlg2(self, -1, edit_area=ea) dlg.SetTitle(_('Adding new address')) if dlg.ShowModal() != wx.ID_OK: return False self.__refresh() return True
def _edit_address(self, address): ea = gmAddressWidgets.cAddressEAPnl(self, -1, address=address) ea.address_holder = self.__identity dlg = gmEditArea.cGenericEditAreaDlg2(self, -1, edit_area=ea) dlg.SetTitle(_('Editing address')) if dlg.ShowModal() == wx.ID_OK: # did we add an entirely new address ? # if so then unlink the old one as implied by "edit" if ea.address['pk_address'] != address['pk_address']: self.__identity.unlink_address(address=address) return True return False
def _edit_address(self, address): ea = gmAddressWidgets.cAddressEAPnl(self, -1, address = address) ea.address_holder = self.__identity dlg = gmEditArea.cGenericEditAreaDlg2(self, -1, edit_area = ea) dlg.SetTitle(_('Editing address')) if dlg.ShowModal() == wx.ID_OK: # did we add an entirely new address ? # if so then unlink the old one as implied by "edit" if ea.address['pk_address'] != address['pk_address']: self.__identity.unlink_address(address = address) return True return False