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

+4 -1
View File
@@ -2,6 +2,7 @@
import os
from gi.repository import Gtk
from gettext import pgettext
from .view import View
from yms import gtkutils, combobox, treeview
@@ -60,6 +61,7 @@ class ProjectsView(View):
self.spin['costs_final'].set_value(0)
combobox.activate_row(self.combo['status'], 'new')
self.text['remarks'].get_buffer().set_text('')
self.entry['name'].grab_focus()
def display_record(self):
self.label['name'].set_text(self.project.projname)
@@ -68,7 +70,7 @@ class ProjectsView(View):
self.label['duration'].set_text(self.format_int(self.project.duration, suffix="Days"))
self.label['costs_plan'].set_text(self.format_float(self.project.costs_plan, 2, suffix="€"))
self.label['costs_final'].set_text(self.format_float(self.project.costs_final, 2, suffix="€"))
self.label['status'].set_text(self.project.projstate)
self.label['status'].set_text(pgettext("project.projstate", self.project.projstate))
self.label['remarks'].set_text(self.project.remarks or '')
def edit_record(self):
@@ -79,6 +81,7 @@ class ProjectsView(View):
self.spin['costs_final'].set_value(self.project.costs_final)
combobox.activate_row(self.combo['status'], self.project.projstate)
self.text['remarks'].get_buffer().set_text(self.project.remarks or '')
self.entry['name'].grab_focus()
def save_record(self):
# fields must have been validated beforehand