Native gui programming

This commit is contained in:
2025-11-07 19:12:08 +01:00
parent e80a0688cc
commit a3793df629
3 changed files with 138 additions and 6 deletions
+14 -3
View File
@@ -6,9 +6,12 @@ Configuration file located at ~/.config/ymsgui.conf:
[DB]
host = localhost
db = yms
user = yms
user = ymsgui
pass = topsecret
[Documents]
basepath = /var/local/yms
"""
import os
@@ -58,6 +61,12 @@ class Frontend():
else:
self.vname = "Ghost(0)"
# get list of vessels
db.cur.execute("SELECT vid, vesselname, model FROM vessel ORDER BY vid")
for row in db.cur.fetchall():
print(row)
print(type(self.combo['vessel']))
def run(self):
self.label['vessel'].set_text(self.vname)
self.window.show_all()
@@ -66,7 +75,7 @@ class Frontend():
def on_but_info_clicked(self, widget):
# Userlist
sql = ("SELECT userid, login FROM user ORDER BY login")
sql = ("SELECT userid, login, displayname FROM user ORDER BY login")
db.cur.execute(sql)
for row in db.cur.fetchall():
print(row)
@@ -95,7 +104,9 @@ def create_config(cfgfile):
fh.write('host = localhost\n')
fh.write('db = yms\n')
fh.write('user = yms\n')
fh.write('pass = geheim\n')
fh.write('pass = geheim\n\n')
fh.write('[documents]\n')
fh.write('basepath = /var/local/yms\n')
if __name__ == "__main__":
locale.setlocale(locale.LC_ALL, '')