More work on native gui. Make data editable.

This commit is contained in:
thooge committed 2026-10-29 18:59:21 +01:00
1 parent 5641e1706f
commit 7aa5d2af3b
43 files changed
+2686 -1037

No files matched your search

+10 -4
View File
@@ -67,6 +67,7 @@ class CompaniesView(View):
self.entry['contractno'].set_text('')
combobox.activate_row(self.combo['comptype'], company.SUPPLIER)
combobox.activate_row(self.combo['comptype2'], -1)
self.entry['compname'].grab_focus()
def display_record(self):
self.label['name'].set_text(self.comp.compname)
@@ -77,20 +78,20 @@ class CompaniesView(View):
self.label['zip'].set_text(self.comp.zip or '')
self.label['city'].set_text(self.comp.city or '')
self.label['country'].set_text(self.comp.country or '')
self.label['contact'].set_text(self.comp.contact or '')
self.label['phone'].set_text(self.comp.phone or '')
self.label['email'].set_text(self.comp.email or '')
self.label['web'].set_text(self.comp.web or '')
self.label['customerno'].set_text(self.comp.customerno or '')
self.label['contractno'].set_text(self.comp.contractno or '')
self.label['flags'].set_text(self.comp.flags or '')
# TODO translation
self.label['remarks'].set_text(self.comp.remarks or '')
def edit_record(self):
self.entry['compname'].set_text(self.comp.compname)
# Type self.dd_comptype.get(self.comp.comptype, -1)
# Type2 self.dd_comptype.get(self.comp.comptype2, -1)
combobox.activate_row(self.combo['comptype'], self.comp.comptype)
combobox.activate_row(self.combo['comptype2'], self.comp.comptype2)
combobox.activate_row(self.combo['comptype2'], self.comp.comptype2 or -1)
self.entry['shortname'].set_text(self.comp.shortname or '')
self.entry['street'].set_text(self.comp.street or '')
self.entry['zip'].set_text(self.comp.zip or '')
@@ -102,7 +103,11 @@ class CompaniesView(View):
self.entry['web'].set_text(self.comp.web or '')
self.entry['customerno'].set_text(self.comp.customerno or '')
self.entry['contractno'].set_text(self.comp.contractno or '')
flags = (self.comp.flags or '').split(',')
for flag in self.dd_flags:
self.check[flag].set_active(flag in flags)
self.text['remarks'].get_buffer().set_text(self.comp.remarks or '')
self.entry['compname'].grab_focus()
def save_record(self):
# fields must have been validated beforehand
@@ -121,7 +126,8 @@ class CompaniesView(View):
self.comp.email = self.entry['email'].get_text()
self.comp.web = self.entry['web'].get_text()
self.comp.customerno = self.entry['customerno'].get_text()
self.comp.conractno = self.entry['contractno'].get_text()
self.comp.contractno = self.entry['contractno'].get_text()
self.comp.flags = self.get_checks(('historic', 'ordered'))
self.comp.remarks = gtkutils.get_text_contents(self.text['remarks'])
# buttons on list page