From 131af7d9e72842b81a665e46ae318dcc9c4de9ea Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Wed, 30 Sep 2026 16:18:44 +0200 Subject: [PATCH] Work on native gui. Display records and add missing tasks and measurements. --- INSTALL | 1 + db/mariadb.sql | 1 + db/minimal.sql | 33 +- db/minimal_en.sql | 33 +- locale/de.po | 1431 +++++++++++++----- yms/database.py | 16 + yms/lookup.py | 89 +- yms/model/cable.py | 2 +- yms/model/dbrecord.py | 4 +- yms/model/document.py | 2 +- yms/model/equipment.py | 2 +- yms/model/inventory.py | 5 +- yms/model/project.py | 6 +- yms/model/task.py | 4 +- yms/ui/base.ui | 3079 ++++++++++++++++++++++----------------- yms/ui/boxes.ui | 5 + yms/ui/cables.ui | 28 +- yms/ui/companies.ui | 148 +- yms/ui/documents.ui | 58 +- yms/ui/equipment.ui | 39 +- yms/ui/fuses.ui | 33 +- yms/ui/inventory.ui | 26 +- yms/ui/maintenance.ui | 30 + yms/ui/measurement.ui | 844 +++++++++++ yms/ui/projects.ui | 33 +- yms/ui/provisions.ui | 200 ++- yms/ui/storage.ui | 133 +- yms/ui/tasks.ui | 877 +++++++++++ yms/view/base.py | 175 ++- yms/view/boxes.py | 42 +- yms/view/cables.py | 36 +- yms/view/companies.py | 87 +- yms/view/documents.py | 77 +- yms/view/equipment.py | 23 +- yms/view/fuses.py | 25 +- yms/view/inventory.py | 8 + yms/view/maintenance.py | 26 +- yms/view/measurement.py | 102 ++ yms/view/projects.py | 26 +- yms/view/provisions.py | 31 +- yms/view/status.py | 2 +- yms/view/storage.py | 65 +- yms/view/tasks.py | 89 ++ yms/view/view.py | 2 +- ymsgui.py | 31 +- 45 files changed, 6043 insertions(+), 1966 deletions(-) create mode 100644 yms/ui/measurement.ui create mode 100644 yms/ui/tasks.ui create mode 100644 yms/view/measurement.py create mode 100644 yms/view/tasks.py diff --git a/INSTALL b/INSTALL index 64462c0..f8adab8 100644 --- a/INSTALL +++ b/INSTALL @@ -14,6 +14,7 @@ Yacht Management Software (YMS) Installation 1.2 Native GUI - Python GTK3 - python3-gi + - python3-fitz - python3-pyudev - gir1.2-gtk-3.0 - gir1.2-rsvg-2.0 diff --git a/db/mariadb.sql b/db/mariadb.sql index 7dce1a9..371af5c 100644 --- a/db/mariadb.sql +++ b/db/mariadb.sql @@ -326,6 +326,7 @@ CREATE TABLE measurement ( unit tinyint(3) NOT NULL DEFAULT 1, accuracy enum('unknown','precise','normal','rough','estimated') NOT NULL DEFAULT 'unknown', mdate date DEFAULT NULL, + mcat tinyint(3) DEFAULT NULL, note varchar(80) DEFAULT NULL, PRIMARY KEY (mid), FOREIGN KEY fk_measurement_vessel (vid) diff --git a/db/minimal.sql b/db/minimal.sql index 9276c4b..d22fd20 100644 --- a/db/minimal.sql +++ b/db/minimal.sql @@ -64,22 +64,23 @@ INSERT INTO settings (userid, sno, valstr) VALUES (-1, 212, 'fuse filter json'); /* List of lists is always required */ -INSERT INTO dropdown (ddid, ddval, ddtext) VALUES -(0, 0, 'Liste der Listen'), -(0, 1, 'Rumpftypen'), -(0, 2, 'Firmentypen'), -(0, 3, 'Stauraumtypen'), -(0, 4, 'Ausrüstungskategorien'), -(0, 5, 'Proviantkategorien'), -(0, 6, 'Provianteinheiten'), -(0, 7, 'Sicherungstypen'), -(0, 8, 'Einheiten'), -(0, 9, 'Kistentypen'), -(0, 10, 'Sicherungsblöcke'), -- fuse locations -(0, 11, 'Kabeltypen'), -(0, 12, 'Technische Kabel-Bezeichnung'), -(0, 13, 'Inventarkategorien'), -(0, 14, 'BBN vessel.data Felder'); +INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES +(0, 0, 'Liste der Listen', NULL), +(0, 1, 'Rumpftypen', NULL), +(0, 2, 'Firmentypen', NULL), +(0, 3, 'Stauraumtypen', NULL), +(0, 4, 'Ausrüstungskategorien', NULL), +(0, 5, 'Proviantkategorien', NULL), +(0, 6, 'Provianteinheiten', NULL), +(0, 7, 'Sicherungstypen', NULL), +(0, 8, 'Einheiten', NULL), +(0, 9, 'Kistentypen', NULL), +(0, 10, 'Sicherungsblöcke', NULL), -- fuse locations +(0, 11, 'Kabeltypen', NULL), +(0, 12, 'Technische Kabel-Bezeichnung', NULL), +(0, 13, 'Inventarkategorien', NULL), +(0, 14, 'BBN vessel.data Felder', 'locked'), +(0, 15, 'Messungskategorien', NULL); INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES (2, 1, 'Lieferant', 'fixed'), diff --git a/db/minimal_en.sql b/db/minimal_en.sql index 3ab23d4..1c4b81c 100644 --- a/db/minimal_en.sql +++ b/db/minimal_en.sql @@ -63,22 +63,23 @@ INSERT INTO settings (userid, sno, valstr) VALUES (-1, 212, 'fuse filter json'); /* List of lists is always required */ -INSERT INTO dropdown (ddid, ddval, ddtext) VALUES -(0, 0, 'list of lists'), -(0, 1, 'hull type'), -(0, 2, 'company type'), -(0, 3, 'storage type'), -(0, 4, 'equipment category'), -(0, 5, 'provision category'), -(0, 6, 'provision unit'), -(0, 7, 'fuse type'), -(0, 8, 'unit'), -(0, 9, 'box types'), -(0, 10, 'fuse blocks'), -(0, 11, 'cable types'), -(0, 12, 'cable desc. technical'), -(0, 13, 'inventory category'), -(0, 14, 'BBN vessel.data fields'); +INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES +(0, 0, 'list of lists', NULL), +(0, 1, 'hull type', NULL), +(0, 2, 'company type', NULL), +(0, 3, 'storage type', NULL), +(0, 4, 'equipment category', NULL), +(0, 5, 'provision category', NULL), +(0, 6, 'provision unit', NULL), +(0, 7, 'fuse type', NULL), +(0, 8, 'unit', NULL), +(0, 9, 'box types', NULL), +(0, 10, 'fuse blocks', NULL), +(0, 11, 'cable types', NULL), +(0, 12, 'cable desc. technical', NULL), +(0, 13, 'inventory category', NULL), +(0, 14, 'BBN vessel.data fields', 'locked'), +(0, 15, 'measurement category', NULL); INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES (2, 1, 'Supplier', 'fixed'), diff --git a/locale/de.po b/locale/de.po index b0d03ab..75fe9fd 100644 --- a/locale/de.po +++ b/locale/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: YMS 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-09-07 16:36+0200\n" +"POT-Creation-Date: 2026-09-30 13:55+0200\n" "PO-Revision-Date: 2025-05-15 09:05+0200\n" "Last-Translator: Thomas Hooge \n" "Language-Team: de \n" @@ -30,7 +30,7 @@ msgstr "" "\n" "Anschließend starten Sie dieses Programm neu." -#: ymsgui.py:246 +#: ymsgui.py:245 msgid "" "Database connection cannot be established.\n" "\n" @@ -44,12 +44,49 @@ msgstr "" "Datenbank: {}\n" "Fehler: {} ({})" -#: yms/view/base.py:18 +#: yms/view/base.py:23 #, fuzzy msgid "Base Data" msgstr "Basisdaten" -#: yms/view/base.py:121 +#: yms/view/base.py:56 yms/view/base.py:81 yms/view/base.py:149 +msgid "─── none ───" +msgstr "" + +#: yms/view/base.py:116 yms/view/boxes.py:32 yms/view/cables.py:35 +#: yms/view/companies.py:36 yms/view/documents.py:31 yms/view/equipment.py:32 +#: yms/view/fuses.py:36 yms/view/inventory.py:35 yms/view/maintenance.py:29 +#: yms/view/measurement.py:51 yms/view/projects.py:38 yms/view/provisions.py:39 +#: yms/view/storage.py:23 yms/view/tasks.py:38 +msgid "ID" +msgstr "" + +#: yms/view/base.py:117 +#, fuzzy +msgid "List" +msgstr "Listen" + +#: yms/view/base.py:118 +msgid "Records" +msgstr "" + +#: yms/view/base.py:254 +msgid "" +"Initialize USB-Stick\n" +"All data on that device will be lost!\n" +"Are you really sure?" +msgstr "" + +#: yms/view/base.py:289 +#, fuzzy +msgid "" +"Add new vessel.\n" +"Are you sure?" +msgstr "" +"Lösche Benutzer!\n" +"Sind Sie sicher?" + +#: yms/view/base.py:390 msgid "" "Delete user!\n" "Are you sure?" @@ -57,419 +94,1143 @@ msgstr "" "Lösche Benutzer!\n" "Sind Sie sicher?" -#: yms/view/documents.py:11 yms/ui/main_v0.ui:2731 -msgid "Documents" -msgstr "Dokumente" - -#: yms/view/equipment.py:11 yms/ui/main_v0.ui:1516 yms/ui/main_v0.ui:2130 -#: yms/ui/maintenance.ui:65 -msgid "Equipment" -msgstr "Ausrüstung" - -#: yms/view/inventory.py:11 yms/ui/main_v0.ui:1846 -msgid "Inventory" -msgstr "Inventar" - -#: yms/view/maintenance.py:11 yms/ui/main_v0.ui:2271 -msgid "Maintenance" -msgstr "Wartung" - -#: yms/view/projects.py:11 yms/ui/main_v0.ui:2501 -msgid "Projects" -msgstr "Projekte" - -#: yms/view/provisions.py:11 yms/ui/main_v0.ui:2062 -msgid "Provisions" -msgstr "Verpflegung" - -#: yms/view/status.py:11 yms/ui/main_v0.ui:2350 yms/ui/main_v0.ui:2747 -#: yms/ui/main_v0.ui:2808 yms/ui/projects.ui:76 yms/ui/status.ui:13 -msgid "Status" +#: yms/view/boxes.py:14 +msgid "Boxes" msgstr "" -#: yms/ui/base.ui:21 yms/ui/main_v0.ui:31 -msgid "empty" -msgstr "leer" +#: yms/view/boxes.py:33 yms/ui/boxes.ui:263 yms/ui/boxes.ui:539 +msgid "Label" +msgstr "" -#: yms/ui/base.ui:56 yms/ui/base.ui:850 yms/ui/equipment.ui:455 -#: yms/ui/main_v0.ui:64 yms/ui/main_v0.ui:1225 yms/ui/main_v0.ui:2339 -#: yms/ui/projects.ui:65 +#: yms/view/boxes.py:34 yms/ui/boxes.ui:310 yms/ui/boxes.ui:740 +msgid "Content" +msgstr "Inhalt" + +#: yms/view/boxes.py:35 yms/view/companies.py:39 yms/view/equipment.py:38 +#: yms/view/inventory.py:40 yms/view/maintenance.py:32 yms/view/projects.py:43 +#: yms/view/storage.py:26 yms/ui/base.ui:423 yms/ui/base.ui:787 +#: yms/ui/boxes.ui:285 yms/ui/boxes.ui:687 yms/ui/cables.ui:113 +#: yms/ui/cables.ui:423 yms/ui/cables.ui:824 yms/ui/companies.ui:423 +#: yms/ui/companies.ui:894 yms/ui/documents.ui:413 yms/ui/documents.ui:607 +#: yms/ui/equipment.ui:455 yms/ui/equipment.ui:888 yms/ui/fuses.ui:98 +#: yms/ui/fuses.ui:353 yms/ui/fuses.ui:639 yms/ui/inventory.ui:378 +#: yms/ui/inventory.ui:763 yms/ui/maintenance.ui:344 yms/ui/maintenance.ui:635 +#: yms/ui/projects.ui:105 yms/ui/projects.ui:349 yms/ui/projects.ui:628 +#: yms/ui/provisions.ui:821 yms/ui/storage.ui:419 yms/ui/storage.ui:827 +#: yms/ui/tasks.ui:507 yms/ui/tasks.ui:710 +msgid "Remarks" +msgstr "Bemerkungen" + +#: yms/view/cables.py:14 +msgid "Cables" +msgstr "Kabel" + +#: yms/view/cables.py:36 yms/view/companies.py:37 yms/view/equipment.py:33 +#: yms/view/fuses.py:37 yms/view/inventory.py:36 yms/view/projects.py:39 +#: yms/view/storage.py:24 yms/view/tasks.py:39 yms/ui/base.ui:98 +#: yms/ui/base.ui:579 yms/ui/boxes.ui:119 yms/ui/cables.ui:91 +#: yms/ui/cables.ui:279 yms/ui/cables.ui:666 yms/ui/companies.ui:234 +#: yms/ui/companies.ui:636 yms/ui/equipment.ui:345 yms/ui/equipment.ui:718 +#: yms/ui/fuses.ui:76 yms/ui/inventory.ui:268 yms/ui/inventory.ui:644 +#: yms/ui/measurement.ui:247 yms/ui/measurement.ui:556 yms/ui/projects.ui:83 +#: yms/ui/projects.ui:272 yms/ui/projects.ui:551 yms/ui/provisions.ui:240 +#: yms/ui/provisions.ui:545 yms/ui/storage.ui:257 yms/ui/storage.ui:544 +#: yms/ui/tasks.ui:346 yms/ui/tasks.ui:677 msgid "Name" msgstr "" -#: yms/ui/base.ui:81 yms/ui/equipment.ui:508 yms/ui/main_v0.ui:89 -#: yms/ui/main_v0.ui:1278 +#: yms/view/cables.py:37 yms/view/inventory.py:39 yms/ui/cables.ui:412 +#: yms/ui/cables.ui:813 yms/ui/inventory.ui:92 yms/ui/inventory.ui:367 +#: yms/ui/inventory.ui:752 +msgid "Condition" +msgstr "Zustand" + +#: yms/view/companies.py:14 +msgid "Companies" +msgstr "Firmen" + +#: yms/view/companies.py:23 +msgid "─── all ───" +msgstr "─── alle ───" + +#: yms/view/companies.py:38 yms/view/documents.py:32 yms/ui/boxes.ui:96 +#: yms/ui/boxes.ui:332 yms/ui/boxes.ui:550 yms/ui/cables.ui:301 +#: yms/ui/cables.ui:691 yms/ui/companies.ui:50 yms/ui/companies.ui:220 +#: yms/ui/companies.ui:647 yms/ui/documents.ui:66 yms/ui/fuses.ui:287 +#: yms/ui/fuses.ui:578 yms/ui/inventory.ui:279 yms/ui/inventory.ui:658 +#: yms/ui/storage.ui:280 +msgid "Type" +msgstr "Typ" + +#: yms/view/documents.py:14 +msgid "Documents" +msgstr "Dokumente" + +#: yms/view/documents.py:33 yms/ui/documents.ui:275 yms/ui/documents.ui:596 +msgid "Filename" +msgstr "Dateiname" + +#: yms/view/documents.py:34 yms/ui/documents.ui:252 yms/ui/documents.ui:574 +msgid "Title" +msgstr "Titel" + +#: yms/view/documents.py:35 +msgid "References" +msgstr "Referenzen" + +#: yms/view/equipment.py:14 yms/view/maintenance.py:31 +#: yms/view/measurement.py:55 yms/ui/fuses.ui:320 yms/ui/fuses.ui:617 +#: yms/ui/inventory.ui:312 yms/ui/inventory.ui:694 yms/ui/maintenance.ui:66 +#: yms/ui/maintenance.ui:255 yms/ui/maintenance.ui:555 yms/ui/measurement.ui:81 +#: yms/ui/measurement.ui:270 yms/ui/measurement.ui:639 +msgid "Equipment" +msgstr "Ausrüstung" + +#: yms/view/equipment.py:34 yms/ui/cables.ui:401 yms/ui/cables.ui:802 +#: yms/ui/equipment.ui:87 yms/ui/equipment.ui:367 yms/ui/equipment.ui:760 +msgid "Manufacturer" +msgstr "Hersteller" + +#: yms/view/equipment.py:35 yms/ui/base.ui:109 yms/ui/base.ui:607 +#: yms/ui/base.ui:1781 yms/ui/equipment.ui:378 yms/ui/equipment.ui:771 msgid "Model" msgstr "Modell" -#: yms/ui/base.ui:102 yms/ui/main_v0.ui:141 +#: yms/view/equipment.py:36 yms/ui/base.ui:1748 +#, fuzzy +msgid "Serial" +msgstr "Seriennummer" + +#: yms/view/equipment.py:37 +msgid "Age" +msgstr "Alter" + +#: yms/view/equipment.py:47 +msgid "Add new Equipment" +msgstr "Neue Ausrüstung hinzufügen" + +#: yms/view/equipment.py:53 yms/ui/equipment.ui:698 +msgid "Edit Equipment" +msgstr "Ausrüstung bearbeiten" + +#: yms/view/fuses.py:14 +msgid "Fuses" +msgstr "Sicherungen" + +#: yms/view/fuses.py:38 yms/ui/fuses.ui:298 yms/ui/fuses.ui:592 +msgid "Current" +msgstr "Stromstärke" + +#: yms/view/fuses.py:39 yms/view/provisions.py:40 yms/ui/fuses.ui:342 +#: yms/ui/fuses.ui:564 +msgid "Description" +msgstr "Beschreibung" + +#: yms/view/inventory.py:14 +msgid "Inventory" +msgstr "Inventar" + +#: yms/view/inventory.py:37 +msgid "Container" +msgstr "" + +#: yms/view/inventory.py:38 yms/view/provisions.py:41 yms/ui/fuses.ui:276 +#: yms/ui/fuses.ui:550 yms/ui/inventory.ui:323 yms/ui/inventory.ui:705 +#: yms/ui/provisions.ui:287 yms/ui/provisions.ui:625 +msgid "Number" +msgstr "" + +#: yms/view/maintenance.py:13 +msgid "Maintenance" +msgstr "Wartung" + +#: yms/view/maintenance.py:30 yms/ui/maintenance.ui:232 +#: yms/ui/maintenance.ui:541 +msgid "Activities" +msgstr "Aktivitäten" + +#: yms/view/measurement.py:14 +msgid "Measurements" +msgstr "Messungen" + +#: yms/view/measurement.py:52 +msgid "Measurement" +msgstr "Messung" + +#: yms/view/measurement.py:53 +msgid "Value" +msgstr "Wert" + +#: yms/view/measurement.py:54 yms/ui/measurement.ui:348 +#: yms/ui/measurement.ui:617 +msgid "Accuracy" +msgstr "Genauigkeit" + +#: yms/view/measurement.py:56 yms/ui/measurement.ui:359 +#: yms/ui/measurement.ui:650 +msgid "Note" +msgstr "Notiz" + +#: yms/view/projects.py:13 +msgid "Projects" +msgstr "Projekte" + +#: yms/view/projects.py:40 +msgid "Start date" +msgstr "Startdatum" + +#: yms/view/projects.py:41 +msgid "Duration" +msgstr "Dauer" + +#: yms/view/projects.py:42 yms/view/status.py:14 yms/view/tasks.py:41 +#: yms/ui/cables.ui:102 yms/ui/fuses.ui:87 yms/ui/maintenance.ui:333 +#: yms/ui/maintenance.ui:624 yms/ui/projects.ui:94 yms/ui/projects.ui:338 +#: yms/ui/projects.ui:617 yms/ui/status.ui:14 yms/ui/tasks.ui:129 +#: yms/ui/tasks.ui:380 +msgid "Status" +msgstr "" + +#: yms/view/provisions.py:13 +msgid "Provisions" +msgstr "Verpflegung" + +#: yms/view/provisions.py:42 yms/ui/measurement.ui:337 yms/ui/provisions.ui:323 +#: yms/ui/provisions.ui:658 yms/ui/storage.ui:868 +msgid "Unit" +msgstr "Einheit" + +#: yms/view/provisions.py:43 +#, fuzzy +msgid "Stored" +msgstr "Gespeichert" + +#: yms/view/provisions.py:44 +msgid "Best before" +msgstr "Haltbar bis" + +#: yms/view/storage.py:14 yms/ui/inventory.ui:81 yms/ui/inventory.ui:290 +#: yms/ui/inventory.ui:672 yms/ui/provisions.ui:265 yms/ui/provisions.ui:567 +msgid "Storage" +msgstr "Stauraum" + +#: yms/view/storage.py:25 +#, fuzzy +msgid "Position" +msgstr "" + +#: yms/view/tasks.py:13 +msgid "Tasks" +msgstr "Aufgaben" + +#: yms/view/tasks.py:40 yms/ui/tasks.ui:77 yms/ui/tasks.ui:369 +#: yms/ui/tasks.ui:782 +msgid "Priority" +msgstr "Priorität" + +#: yms/view/tasks.py:42 yms/ui/projects.ui:283 yms/ui/projects.ui:562 +#: yms/ui/tasks.ui:556 yms/ui/tasks.ui:699 +msgid "Responsible" +msgstr "Verantwortlich" + +#: yms/ui/base.ui:81 yms/ui/base.ui:558 +msgid "Ghost" +msgstr "" + +#: yms/ui/base.ui:120 yms/ui/base.ui:846 +msgid "Year built" +msgstr "Baujahr" + +#: yms/ui/base.ui:131 yms/ui/base.ui:628 msgid "LoA" msgstr "LüA" -#: yms/ui/base.ui:113 yms/ui/main_v0.ui:152 -msgid "LWL" -msgstr "" +#: yms/ui/base.ui:142 +#, fuzzy +msgid "Draught min" +msgstr "Tiefgang min" -#: yms/ui/base.ui:124 +#: yms/ui/base.ui:153 yms/ui/base.ui:661 +msgid "Draught" +msgstr "Tiefgang" + +#: yms/ui/base.ui:164 yms/ui/base.ui:650 msgid "Beam" msgstr "" -#: yms/ui/base.ui:135 -msgid "Draught" +#: yms/ui/base.ui:175 +msgid "LwL" msgstr "" -#: yms/ui/base.ui:146 -msgid "Draught, min" +#: yms/ui/base.ui:186 yms/ui/base.ui:754 +msgid "Ballast" msgstr "" -#: yms/ui/base.ui:212 +#: yms/ui/base.ui:320 yms/ui/base.ui:869 +msgid "Shipyard" +msgstr "" + +#: yms/ui/base.ui:343 yms/ui/base.ui:743 #, fuzzy msgid "Displacement" msgstr "Anzeigename" -#: yms/ui/base.ui:223 -msgid "Ballast" +#: yms/ui/base.ui:366 +msgid "Belt position, bow" msgstr "" -#: yms/ui/base.ui:254 yms/ui/base.ui:1035 yms/ui/equipment.ui:645 -#: yms/ui/main_v0.ui:110 yms/ui/main_v0.ui:1415 yms/ui/main_v0.ui:2361 -#: yms/ui/projects.ui:87 -msgid "Remarks" -msgstr "Bemerkungen" +#: yms/ui/base.ui:377 yms/ui/base.ui:950 +msgid "Belt position, aft" +msgstr "" -#: yms/ui/base.ui:293 +#: yms/ui/base.ui:412 yms/ui/base.ui:890 +msgid "Hull shape" +msgstr "" + +#: yms/ui/base.ui:461 yms/ui/base.ui:808 #, fuzzy msgid "Default Storage" msgstr "Stauraum" -#: yms/ui/base.ui:304 -msgid "Shipyard" -msgstr "" - -#: yms/ui/base.ui:336 yms/ui/main_v0.ui:257 -msgid "Add" -msgstr "Hinzufügen" - -#: yms/ui/base.ui:350 yms/ui/base.ui:677 yms/ui/equipment.ui:696 -#: yms/ui/main_v0.ui:270 yms/ui/main_v0.ui:596 yms/ui/main_v0.ui:1466 -msgid "Save" -msgstr "Speichern" - -#: yms/ui/base.ui:375 yms/ui/main_v0.ui:294 -msgid "Vessel" -msgstr "Boot" - -#: yms/ui/base.ui:419 yms/ui/documents.ui:168 yms/ui/equipment.ui:248 -#: yms/ui/inventory.ui:169 yms/ui/main_v0.ui:338 yms/ui/main_v0.ui:1018 -#: yms/ui/main_v0.ui:1688 yms/ui/main_v0.ui:2003 yms/ui/main_v0.ui:2212 -#: yms/ui/main_v0.ui:2442 yms/ui/main_v0.ui:2672 yms/ui/maintenance.ui:147 -#: yms/ui/projects.ui:168 yms/ui/provisions.ui:154 -msgid "New" -msgstr "Neu" - -#: yms/ui/base.ui:433 yms/ui/documents.ui:194 yms/ui/equipment.ui:387 -#: yms/ui/main_v0.ui:352 yms/ui/main_v0.ui:1157 yms/ui/main_v0.ui:2029 -#: yms/ui/main_v0.ui:2238 yms/ui/main_v0.ui:2468 yms/ui/main_v0.ui:2698 -#: yms/ui/maintenance.ui:173 yms/ui/projects.ui:194 yms/ui/provisions.ui:180 +#: yms/ui/base.ui:494 yms/ui/base.ui:1076 yms/ui/boxes.ui:452 +#: yms/ui/cables.ui:579 yms/ui/companies.ui:1032 yms/ui/documents.ui:486 +#: yms/ui/equipment.ui:634 yms/ui/fuses.ui:461 yms/ui/inventory.ui:557 +#: yms/ui/maintenance.ui:452 yms/ui/measurement.ui:467 yms/ui/projects.ui:462 +#: yms/ui/provisions.ui:857 yms/ui/storage.ui:455 yms/ui/tasks.ui:589 msgid "Delete" msgstr "Löschen" -#: yms/ui/base.ui:472 yms/ui/main_v0.ui:391 -msgid "Login" -msgstr "Anmeldung" +#: yms/ui/base.ui:509 +msgid "Add" +msgstr "Hinzufügen" -#: yms/ui/base.ui:483 yms/ui/main_v0.ui:402 -msgid "Displayname" -msgstr "Anzeigename" - -#: yms/ui/base.ui:514 yms/ui/main_v0.ui:433 -msgid "Role" -msgstr "Rolle" - -#: yms/ui/base.ui:525 yms/ui/main_v0.ui:444 -msgid "Language" -msgstr "Sprache" - -#: yms/ui/base.ui:556 yms/ui/main_v0.ui:475 -msgid "Password" -msgstr "Kennwort" - -#: yms/ui/base.ui:575 yms/ui/main_v0.ui:494 -msgid "Create" -msgstr "Anlegen" - -#: yms/ui/base.ui:588 yms/ui/main_v0.ui:507 -msgid "Locked" -msgstr "Gesperrt" - -#: yms/ui/base.ui:601 yms/ui/main_v0.ui:520 -msgid "Deleted" -msgstr "Gelöscht" - -#: yms/ui/base.ui:711 yms/ui/main_v0.ui:630 -msgid "User" -msgstr "Benutzer" - -#: yms/ui/base.ui:751 yms/ui/equipment.ui:276 yms/ui/inventory.ui:195 -#: yms/ui/main_v0.ui:670 yms/ui/main_v0.ui:1045 yms/ui/main_v0.ui:1714 -msgid "Details" -msgstr "" - -#: yms/ui/base.ui:764 yms/ui/documents.ui:181 yms/ui/equipment.ui:262 -#: yms/ui/equipment.ui:402 yms/ui/inventory.ui:182 yms/ui/main_v0.ui:683 -#: yms/ui/main_v0.ui:1031 yms/ui/main_v0.ui:1171 yms/ui/main_v0.ui:1701 -#: yms/ui/main_v0.ui:2016 yms/ui/main_v0.ui:2225 yms/ui/main_v0.ui:2455 -#: yms/ui/main_v0.ui:2685 yms/ui/maintenance.ui:160 yms/ui/projects.ui:181 -#: yms/ui/provisions.ui:167 +#: yms/ui/base.ui:523 yms/ui/base.ui:1407 yms/ui/boxes.ui:195 +#: yms/ui/boxes.ui:467 yms/ui/cables.ui:209 yms/ui/cables.ui:594 +#: yms/ui/companies.ui:147 yms/ui/companies.ui:1047 yms/ui/documents.ui:184 +#: yms/ui/documents.ui:501 yms/ui/equipment.ui:277 yms/ui/equipment.ui:649 +#: yms/ui/fuses.ui:194 yms/ui/fuses.ui:476 yms/ui/inventory.ui:200 +#: yms/ui/inventory.ui:572 yms/ui/maintenance.ui:164 yms/ui/maintenance.ui:467 +#: yms/ui/measurement.ui:179 yms/ui/measurement.ui:482 yms/ui/projects.ui:203 +#: yms/ui/projects.ui:477 yms/ui/provisions.ui:170 yms/ui/provisions.ui:872 +#: yms/ui/storage.ui:189 yms/ui/storage.ui:470 yms/ui/tasks.ui:278 +#: yms/ui/tasks.ui:604 msgid "Edit" msgstr "Bearbeiten" -#: yms/ui/base.ui:791 yms/ui/main_v0.ui:710 -msgid "Lists" -msgstr "Listen" - -#: yms/ui/base.ui:819 yms/ui/base.ui:1292 yms/ui/documents.ui:215 -#: yms/ui/equipment.ui:297 yms/ui/inventory.ui:216 yms/ui/main_v0.ui:739 -#: yms/ui/main_v0.ui:1067 yms/ui/main_v0.ui:1735 yms/ui/main_v0.ui:2050 -#: yms/ui/main_v0.ui:2259 yms/ui/main_v0.ui:2489 yms/ui/main_v0.ui:2719 -#: yms/ui/maintenance.ui:194 yms/ui/projects.ui:215 yms/ui/provisions.ui:201 -msgid "page0" +#: yms/ui/base.ui:545 +msgid "page_detail" msgstr "" -#: yms/ui/base.ui:839 yms/ui/documents.ui:65 yms/ui/main_v0.ui:2569 -msgid "Type" -msgstr "Typ" - -#: yms/ui/base.ui:872 -msgid "Type2" -msgstr "Typ2" - -#: yms/ui/base.ui:903 yms/ui/equipment.ui:466 yms/ui/main_v0.ui:1236 -msgid "Short name" -msgstr "Kurzname" - -#: yms/ui/base.ui:925 -msgid "Street" -msgstr "Straße" - -#: yms/ui/base.ui:936 -msgid "ZIP" -msgstr "PLZ" - -#: yms/ui/base.ui:947 -msgid "City" -msgstr "Stadt" - -#: yms/ui/base.ui:958 -msgid "Country" -msgstr "Land" - -#: yms/ui/base.ui:969 -msgid "Contact" -msgstr "Kontakt" - -#: yms/ui/base.ui:980 -msgid "Phone" -msgstr "Telefon" - -#: yms/ui/base.ui:991 -msgid "Email" +#: yms/ui/base.ui:639 +msgid "LWL" msgstr "" -#: yms/ui/base.ui:1002 -msgid "Web" +#: yms/ui/base.ui:672 +msgid "Draught, min" msgstr "" -#: yms/ui/base.ui:1013 -msgid "Customer no." -msgstr "Kundennr." - -#: yms/ui/base.ui:1024 -msgid "Contract no." -msgstr "Kontraktnr." - -#: yms/ui/base.ui:1221 yms/ui/base.ui:1234 yms/ui/base.ui:1247 -#: yms/ui/inventory.ui:246 yms/ui/inventory.ui:259 yms/ui/inventory.ui:272 -#: yms/ui/main_v0.ui:1765 yms/ui/main_v0.ui:1778 yms/ui/main_v0.ui:1791 -msgid "button" +#: yms/ui/base.ui:857 yms/ui/base.ui:911 yms/ui/base.ui:925 yms/ui/boxes.ui:622 +#: yms/ui/boxes.ui:637 yms/ui/boxes.ui:652 yms/ui/boxes.ui:762 +#: yms/ui/boxes.ui:775 yms/ui/boxes.ui:788 yms/ui/storage.ui:738 +#: yms/ui/storage.ui:753 yms/ui/storage.ui:768 +msgid "0" msgstr "" -#: yms/ui/base.ui:1269 yms/ui/equipment.ui:437 yms/ui/inventory.ui:293 -#: yms/ui/main_v0.ui:1503 yms/ui/main_v0.ui:1812 -msgid "page1" +#: yms/ui/base.ui:939 +msgid "Belt position, front" msgstr "" -#: yms/ui/base.ui:1282 yms/ui/main_v0.ui:751 -msgid "Companies" -msgstr "Firmen" +#: yms/ui/base.ui:972 yms/ui/base.ui:1320 yms/ui/base.ui:1595 +#: yms/ui/boxes.ui:873 yms/ui/cables.ui:980 yms/ui/companies.ui:566 +#: yms/ui/documents.ui:679 yms/ui/equipment.ui:963 yms/ui/fuses.ui:755 +#: yms/ui/inventory.ui:921 yms/ui/maintenance.ui:763 yms/ui/measurement.ui:780 +#: yms/ui/projects.ui:744 yms/ui/provisions.ui:476 yms/ui/storage.ui:941 +#: yms/ui/tasks.ui:836 +msgid "Save" +msgstr "Speichern" -#: yms/ui/documents.ui:30 yms/ui/equipment.ui:30 yms/ui/inventory.ui:30 -#: yms/ui/main_v0.ui:797 yms/ui/main_v0.ui:1549 yms/ui/main_v0.ui:1928 -#: yms/ui/main_v0.ui:2095 yms/ui/main_v0.ui:2304 yms/ui/main_v0.ui:2534 -#: yms/ui/maintenance.ui:30 yms/ui/projects.ui:30 yms/ui/provisions.ui:79 -msgid "Clear" -msgstr "Löschen" - -#: yms/ui/documents.ui:43 yms/ui/equipment.ui:43 yms/ui/inventory.ui:43 -#: yms/ui/main_v0.ui:810 yms/ui/main_v0.ui:1562 yms/ui/main_v0.ui:1941 -#: yms/ui/main_v0.ui:2108 yms/ui/main_v0.ui:2317 yms/ui/main_v0.ui:2547 -#: yms/ui/maintenance.ui:43 yms/ui/projects.ui:43 yms/ui/provisions.ui:92 -msgid "Apply" -msgstr "Anwenden" - -#: yms/ui/documents.ui:76 yms/ui/main_v0.ui:2580 -msgid "Reference" -msgstr "Referenz" - -#: yms/ui/documents.ui:87 yms/ui/equipment.ui:98 yms/ui/inventory.ui:87 -#: yms/ui/main_v0.ui:865 yms/ui/main_v0.ui:1606 yms/ui/main_v0.ui:1900 -#: yms/ui/main_v0.ui:2141 yms/ui/main_v0.ui:2591 yms/ui/maintenance.ui:76 -#: yms/ui/provisions.ui:51 -msgid "Text" -msgstr "" - -#: yms/ui/documents.ui:130 yms/ui/main_v0.ui:2634 -msgid "Filter Documents" -msgstr "Filter Dokumente" - -#: yms/ui/equipment.ui:65 yms/ui/equipment.ui:634 yms/ui/main_v0.ui:832 -#: yms/ui/main_v0.ui:1404 -msgid "Category" -msgstr "Kategorie" - -#: yms/ui/equipment.ui:76 yms/ui/equipment.ui:497 yms/ui/main_v0.ui:843 -#: yms/ui/main_v0.ui:1267 -msgid "Manufacturer" -msgstr "Hersteller" - -#: yms/ui/equipment.ui:87 yms/ui/equipment.ui:623 yms/ui/main_v0.ui:854 -#: yms/ui/main_v0.ui:1393 -msgid "Supplier" -msgstr "Lieferant" - -#: yms/ui/equipment.ui:109 yms/ui/main_v0.ui:876 -msgid "Flags" -msgstr "" - -#: yms/ui/equipment.ui:158 yms/ui/main_v0.ui:925 -msgid "ordered" -msgstr "bestellt" - -#: yms/ui/equipment.ui:171 yms/ui/main_v0.ui:938 -msgid "removed" -msgstr "entfernt" - -#: yms/ui/equipment.ui:184 yms/ui/main_v0.ui:951 -msgid "deleted" -msgstr "gelöscht" - -#: yms/ui/equipment.ui:213 yms/ui/main_v0.ui:980 -msgid "Filter Equipment" -msgstr "Filter Ausrüstung" - -#: yms/ui/equipment.ui:309 yms/ui/main_v0.ui:1079 -msgid "Equipment details" -msgstr "Ausrüstungsdetails" - -#: yms/ui/equipment.ui:326 yms/ui/equipment.ui:337 yms/ui/equipment.ui:348 -#: yms/ui/main_v0.ui:1096 yms/ui/main_v0.ui:1107 yms/ui/main_v0.ui:1118 -msgid "label" -msgstr "" - -#: yms/ui/equipment.ui:415 yms/ui/main_v0.ui:1185 -msgid "Close" -msgstr "Schließen" - -#: yms/ui/equipment.ui:519 yms/ui/main_v0.ui:1289 -msgid "Serial no." -msgstr "Seriennummer" - -#: yms/ui/equipment.ui:530 yms/ui/main_v0.ui:1300 -msgid "Weight, kg" -msgstr "Gewicht, kg" - -#: yms/ui/equipment.ui:541 yms/ui/main_v0.ui:1311 -msgid "Price, €" -msgstr "Preis, €" - -#: yms/ui/equipment.ui:552 yms/ui/main_v0.ui:1322 -msgid "Date puchase" -msgstr "Kaufdatum" - -#: yms/ui/equipment.ui:710 yms/ui/main_v0.ui:1480 +#: yms/ui/base.ui:986 yms/ui/boxes.ui:887 yms/ui/cables.ui:994 +#: yms/ui/companies.ui:580 yms/ui/documents.ui:693 yms/ui/equipment.ui:977 +#: yms/ui/fuses.ui:769 yms/ui/inventory.ui:935 yms/ui/maintenance.ui:777 +#: yms/ui/measurement.ui:794 yms/ui/projects.ui:758 yms/ui/provisions.ui:490 +#: yms/ui/storage.ui:955 yms/ui/tasks.ui:850 msgid "Cancel" msgstr "Abbruch" -#: yms/ui/equipment.ui:733 yms/ui/inventory.ui:314 yms/ui/main_v0.ui:1207 -#: yms/ui/main_v0.ui:1833 +#: yms/ui/base.ui:1008 +msgid "page_edit" +msgstr "" + +#: yms/ui/base.ui:1018 +msgid "Vessel" +msgstr "Boot" + +#: yms/ui/base.ui:1062 yms/ui/boxes.ui:181 yms/ui/cables.ui:195 +#: yms/ui/companies.ui:133 yms/ui/documents.ui:170 yms/ui/equipment.ui:263 +#: yms/ui/fuses.ui:180 yms/ui/inventory.ui:186 yms/ui/maintenance.ui:150 +#: yms/ui/measurement.ui:165 yms/ui/projects.ui:188 yms/ui/provisions.ui:156 +#: yms/ui/storage.ui:175 yms/ui/tasks.ui:264 +msgid "New" +msgstr "Neu" + +#: yms/ui/base.ui:1115 +msgid "Login" +msgstr "Anmeldung" + +#: yms/ui/base.ui:1126 +msgid "Displayname" +msgstr "Anzeigename" + +#: yms/ui/base.ui:1157 +msgid "Role" +msgstr "Rolle" + +#: yms/ui/base.ui:1168 +msgid "Language" +msgstr "Sprache" + +#: yms/ui/base.ui:1199 +msgid "Password" +msgstr "Kennwort" + +#: yms/ui/base.ui:1218 +msgid "Create" +msgstr "Anlegen" + +#: yms/ui/base.ui:1231 +msgid "Locked" +msgstr "Gesperrt" + +#: yms/ui/base.ui:1244 +msgid "Deleted" +msgstr "Gelöscht" + +#: yms/ui/base.ui:1354 +msgid "User" +msgstr "Benutzer" + +#: yms/ui/base.ui:1394 yms/ui/boxes.ui:209 yms/ui/cables.ui:223 +#: yms/ui/companies.ui:161 yms/ui/documents.ui:198 yms/ui/equipment.ui:291 +#: yms/ui/fuses.ui:208 yms/ui/inventory.ui:214 yms/ui/maintenance.ui:178 +#: yms/ui/measurement.ui:193 yms/ui/projects.ui:218 yms/ui/provisions.ui:184 +#: yms/ui/storage.ui:203 yms/ui/tasks.ui:292 +msgid "Details" +msgstr "" + +#: yms/ui/base.ui:1434 +msgid "Lists" +msgstr "Listen" + +#: yms/ui/base.ui:1450 +msgid "Global system settings" +msgstr "" + +#: yms/ui/base.ui:1470 +msgid "Currency symbol" +msgstr "" + +#: yms/ui/base.ui:1481 +msgid "Max image width" +msgstr "" + +#: yms/ui/base.ui:1492 +msgid "Max image height" +msgstr "" + +#: yms/ui/base.ui:1543 +msgid "User settings" +msgstr "" + +#: yms/ui/base.ui:1563 +msgid "Date format" +msgstr "" + +#: yms/ui/base.ui:1623 +msgid "Settings" +msgstr "" + +#: yms/ui/base.ui:1639 +msgid "Backup to USB stick" +msgstr "" + +#: yms/ui/base.ui:1656 +msgid "UUID" +msgstr "" + +#: yms/ui/base.ui:1667 +msgid "Device" +msgstr "" + +#: yms/ui/base.ui:1676 +msgid "Detect" +msgstr "" + +#: yms/ui/base.ui:1712 +msgid "Initialize" +msgstr "" + +#: yms/ui/base.ui:1726 +msgid "Last Backup" +msgstr "" + +#: yms/ui/base.ui:1770 +msgid "Vendor" +msgstr "" + +#: yms/ui/base.ui:1792 +msgid "Partition" +msgstr "" + +#: yms/ui/base.ui:1845 +msgid "Filesystem" +msgstr "" + +#: yms/ui/base.ui:1918 yms/ui/base.ui:1958 +msgid "Backup" +msgstr "" + +#: yms/ui/base.ui:1931 +msgid "Restore" +msgstr "" + +#: yms/ui/boxes.ui:61 yms/ui/cables.ui:56 yms/ui/companies.ui:24 +#: yms/ui/documents.ui:31 yms/ui/equipment.ui:41 yms/ui/fuses.ui:41 +#: yms/ui/inventory.ui:46 yms/ui/maintenance.ui:31 yms/ui/measurement.ui:46 +#: yms/ui/projects.ui:46 yms/ui/provisions.ui:80 yms/ui/storage.ui:71 +#: yms/ui/tasks.ui:31 +msgid "Clear" +msgstr "Löschen" + +#: yms/ui/boxes.ui:74 yms/ui/cables.ui:69 yms/ui/companies.ui:36 +#: yms/ui/documents.ui:44 yms/ui/equipment.ui:54 yms/ui/fuses.ui:54 +#: yms/ui/inventory.ui:59 yms/ui/maintenance.ui:44 yms/ui/measurement.ui:59 +#: yms/ui/projects.ui:60 yms/ui/provisions.ui:93 yms/ui/storage.ui:84 +#: yms/ui/tasks.ui:44 +msgid "Apply" +msgstr "Anwenden" + +#: yms/ui/boxes.ui:142 +#, fuzzy +msgid "Filter Box" +msgstr "Filter Projekte" + +#: yms/ui/boxes.ui:231 yms/ui/cables.ui:245 yms/ui/companies.ui:183 +#: yms/ui/documents.ui:220 yms/ui/equipment.ui:313 yms/ui/fuses.ui:230 +#: yms/ui/inventory.ui:236 yms/ui/maintenance.ui:200 yms/ui/measurement.ui:215 +#: yms/ui/projects.ui:240 yms/ui/provisions.ui:206 yms/ui/storage.ui:225 +#: yms/ui/tasks.ui:314 +msgid "page0" +msgstr "" + +#: yms/ui/boxes.ui:243 +msgid "Box Details" +msgstr "" + +#: yms/ui/boxes.ui:343 yms/ui/boxes.ui:801 yms/ui/cables.ui:379 +#: yms/ui/cables.ui:780 yms/ui/storage.ui:395 yms/ui/storage.ui:890 +msgid "Color" +msgstr "" + +#: yms/ui/boxes.ui:354 yms/ui/boxes.ui:676 yms/ui/cables.ui:368 +#: yms/ui/cables.ui:769 yms/ui/equipment.ui:400 yms/ui/inventory.ui:334 +#: yms/ui/inventory.ui:719 yms/ui/provisions.ui:301 yms/ui/provisions.ui:636 +#, fuzzy +msgid "Weight" +msgstr "Gewicht, kg" + +#: yms/ui/boxes.ui:398 yms/ui/boxes.ui:716 yms/ui/provisions.ui:312 +#: yms/ui/provisions.ui:647 +#, fuzzy +msgid "Weight net" +msgstr "Gewicht, kg" + +#: yms/ui/boxes.ui:420 yms/ui/boxes.ui:665 yms/ui/equipment.ui:411 +#: yms/ui/inventory.ui:345 yms/ui/inventory.ui:730 yms/ui/provisions.ui:775 +#, fuzzy +msgid "Price" +msgstr "Preis, €" + +#: yms/ui/boxes.ui:481 yms/ui/cables.ui:608 yms/ui/companies.ui:1061 +#: yms/ui/documents.ui:515 yms/ui/equipment.ui:663 yms/ui/fuses.ui:490 +#: yms/ui/inventory.ui:586 yms/ui/maintenance.ui:481 yms/ui/measurement.ui:496 +#: yms/ui/projects.ui:491 yms/ui/provisions.ui:886 yms/ui/storage.ui:484 +#: yms/ui/tasks.ui:618 +msgid "Close" +msgstr "Schließen" + +#: yms/ui/boxes.ui:503 yms/ui/cables.ui:630 yms/ui/companies.ui:603 +#: yms/ui/documents.ui:537 yms/ui/equipment.ui:685 yms/ui/fuses.ui:512 +#: yms/ui/inventory.ui:608 yms/ui/maintenance.ui:503 yms/ui/measurement.ui:518 +#: yms/ui/projects.ui:513 yms/ui/provisions.ui:512 yms/ui/storage.ui:506 +#: yms/ui/tasks.ui:640 +msgid "page1" +msgstr "" + +#: yms/ui/boxes.ui:517 +#, fuzzy +msgid "Edit Box" +msgstr "Bearbeiten" + +#: yms/ui/boxes.ui:583 +msgid "Dimensions (L x W x H)" +msgstr "" + +#: yms/ui/boxes.ui:596 yms/ui/boxes.ui:609 +msgid "x" +msgstr "" + +#: yms/ui/boxes.ui:729 +msgid "mm" +msgstr "" + +#: yms/ui/boxes.ui:810 +msgid "#FFFFFF" +msgstr "" + +#: yms/ui/boxes.ui:909 yms/ui/cables.ui:1016 yms/ui/companies.ui:1083 +#: yms/ui/documents.ui:715 yms/ui/equipment.ui:1000 yms/ui/fuses.ui:791 +#: yms/ui/inventory.ui:957 yms/ui/maintenance.ui:799 yms/ui/measurement.ui:816 +#: yms/ui/projects.ui:780 yms/ui/provisions.ui:908 yms/ui/storage.ui:977 +#: yms/ui/tasks.ui:872 msgid "page2" msgstr "" -#: yms/ui/inventory.ui:65 yms/ui/main_v0.ui:1584 -msgid "Storage" -msgstr "Stauraum" +#: yms/ui/cables.ui:156 +#, fuzzy +msgid "Filter Cables" +msgstr "Filter Projekte" -#: yms/ui/inventory.ui:76 yms/ui/main_v0.ui:1595 -msgid "Condition" +#: yms/ui/cables.ui:257 +msgid "Cable Details" +msgstr "" + +#: yms/ui/cables.ui:312 yms/ui/cables.ui:705 +msgid "Tech.-name" +msgstr "" + +#: yms/ui/cables.ui:324 yms/ui/cables.ui:716 +msgid "Length" +msgstr "" + +#: yms/ui/cables.ui:335 yms/ui/cables.ui:730 +#, fuzzy +msgid "Conductors" msgstr "Zustand" -#: yms/ui/inventory.ui:130 yms/ui/main_v0.ui:1649 +#: yms/ui/cables.ui:346 yms/ui/cables.ui:744 +msgid "Diameter" +msgstr "" + +#: yms/ui/cables.ui:357 yms/ui/cables.ui:755 +msgid "Cross section" +msgstr "" + +#: yms/ui/cables.ui:390 yms/ui/cables.ui:791 yms/ui/equipment.ui:98 +#: yms/ui/equipment.ui:433 yms/ui/equipment.ui:866 +msgid "Supplier" +msgstr "Lieferant" + +#: yms/ui/cables.ui:644 +msgid "Edit Cable" +msgstr "" + +#: yms/ui/companies.ui:61 yms/ui/documents.ui:88 yms/ui/equipment.ui:109 +#: yms/ui/inventory.ui:103 yms/ui/maintenance.ui:77 yms/ui/measurement.ui:92 +#: yms/ui/provisions.ui:52 yms/ui/storage.ui:106 yms/ui/tasks.ui:88 +msgid "Text" +msgstr "" + +#: yms/ui/companies.ui:94 +#, fuzzy +msgid "Filter Companies" +msgstr "Firmen" + +#: yms/ui/companies.ui:198 +msgid "Edit company" +msgstr "" + +#: yms/ui/companies.ui:260 +msgid "Secondary type" +msgstr "" + +#: yms/ui/companies.ui:291 yms/ui/companies.ui:669 yms/ui/equipment.ui:356 +#: yms/ui/equipment.ui:729 +msgid "Short name" +msgstr "Kurzname" + +#: yms/ui/companies.ui:313 yms/ui/companies.ui:680 +msgid "Street" +msgstr "Straße" + +#: yms/ui/companies.ui:324 yms/ui/companies.ui:691 +msgid "ZIP" +msgstr "PLZ" + +#: yms/ui/companies.ui:335 yms/ui/companies.ui:702 +msgid "City" +msgstr "Stadt" + +#: yms/ui/companies.ui:346 yms/ui/companies.ui:713 +msgid "Country" +msgstr "Land" + +#: yms/ui/companies.ui:357 yms/ui/companies.ui:828 +msgid "Contact" +msgstr "Kontakt" + +#: yms/ui/companies.ui:368 yms/ui/companies.ui:839 +msgid "Phone" +msgstr "Telefon" + +#: yms/ui/companies.ui:379 yms/ui/companies.ui:850 +msgid "Email" +msgstr "" + +#: yms/ui/companies.ui:390 yms/ui/companies.ui:861 +msgid "Web" +msgstr "" + +#: yms/ui/companies.ui:401 yms/ui/companies.ui:872 +msgid "Customer no." +msgstr "Kundennr." + +#: yms/ui/companies.ui:412 yms/ui/companies.ui:883 +msgid "Contract no." +msgstr "Kontraktnr." + +#: yms/ui/companies.ui:616 +#, fuzzy +msgid "Company details" +msgstr "Firmen" + +#: yms/ui/companies.ui:658 +msgid "Type secondary" +msgstr "" + +#: yms/ui/companies.ui:998 yms/ui/equipment.ui:120 yms/ui/equipment.ui:601 +msgid "Flags" +msgstr "" + +#: yms/ui/documents.ui:77 +msgid "Reference" +msgstr "Referenz" + +#: yms/ui/documents.ui:131 +msgid "Filter Documents" +msgstr "Filter Dokumente" + +#: yms/ui/documents.ui:232 +#, fuzzy +msgid "Document Details" +msgstr "Ausrüstungsdetails" + +#: yms/ui/documents.ui:286 +msgid "Image extents" +msgstr "" + +#: yms/ui/documents.ui:297 +msgid "Mimetype" +msgstr "" + +#: yms/ui/documents.ui:344 +msgid "File size" +msgstr "" + +#: yms/ui/documents.ui:355 +msgid "Upload date" +msgstr "" + +#: yms/ui/documents.ui:366 yms/ui/documents.ui:648 +#, fuzzy +msgid "Document type" +msgstr "Dokumente" + +#: yms/ui/documents.ui:439 +msgid "Role access" +msgstr "" + +#: yms/ui/documents.ui:552 +#, fuzzy +msgid "Edit Document" +msgstr "Filter Dokumente" + +#: yms/ui/equipment.ui:76 yms/ui/equipment.ui:444 yms/ui/equipment.ui:877 +#: yms/ui/inventory.ui:524 yms/ui/inventory.ui:890 yms/ui/provisions.ui:254 +#: yms/ui/provisions.ui:556 +msgid "Category" +msgstr "Kategorie" + +#: yms/ui/equipment.ui:169 +msgid "ordered" +msgstr "bestellt" + +#: yms/ui/equipment.ui:182 +msgid "removed" +msgstr "entfernt" + +#: yms/ui/equipment.ui:195 yms/ui/tasks.ui:184 +msgid "deleted" +msgstr "gelöscht" + +#: yms/ui/equipment.ui:224 +msgid "Filter Equipment" +msgstr "Filter Ausrüstung" + +#: yms/ui/equipment.ui:325 +msgid "Equipment details" +msgstr "Ausrüstungsdetails" + +#: yms/ui/equipment.ui:389 yms/ui/equipment.ui:782 +msgid "Serial no." +msgstr "Seriennummer" + +#: yms/ui/equipment.ui:422 +msgid "Date purchase" +msgstr "Kaufdatum" + +#: yms/ui/equipment.ui:793 +msgid "Weight, kg" +msgstr "Gewicht, kg" + +#: yms/ui/equipment.ui:804 +msgid "Price, €" +msgstr "Preis, €" + +#: yms/ui/equipment.ui:815 +msgid "Date puchase" +msgstr "Kaufdatum" + +#: yms/ui/fuses.ui:141 +msgid "Filter Fuses" +msgstr "Filter Sicherungen" + +#: yms/ui/fuses.ui:242 +msgid "Fuse Details" +msgstr "Sicherungsdetails" + +#: yms/ui/fuses.ui:309 yms/ui/fuses.ui:606 +msgid "Cable" +msgstr "Kabel" + +#: yms/ui/fuses.ui:331 yms/ui/fuses.ui:628 +msgid "Location" +msgstr "Ort" + +#: yms/ui/fuses.ui:528 +msgid "Edit Fuse" +msgstr "Sicherung bearbeiten" + +#: yms/ui/inventory.ui:146 msgid "Filter Inventory" msgstr "Filter Inventar" -#: yms/ui/inventory.ui:228 yms/ui/main_v0.ui:1747 +#: yms/ui/inventory.ui:248 msgid "Inventory details" msgstr "Inventardetails" -#: yms/ui/main.ui:7 yms/ui/main_v0.ui:7 +#: yms/ui/inventory.ui:301 yms/ui/inventory.ui:683 yms/ui/provisions.ui:276 +#: yms/ui/provisions.ui:614 +msgid "Box" +msgstr "Kiste" + +#: yms/ui/inventory.ui:356 +msgid "Purchase Date" +msgstr "Kaufdatum" + +#: yms/ui/inventory.ui:622 +msgid "Edit inventory" +msgstr "Inventar bearbeiten" + +#: yms/ui/inventory.ui:741 +msgid "Puchase date" +msgstr "Kaufdatum" + +#: yms/ui/main.ui:7 msgid "YMS" msgstr "" -#: yms/ui/main_v0.ui:163 -msgid "Width" -msgstr "Breite" - -#: yms/ui/main_v0.ui:174 -msgid "Depth" -msgstr "Tiefgang" - -#: yms/ui/main_v0.ui:185 -msgid "Depth min" -msgstr "Tiefgang min" - -#: yms/ui/main_v0.ui:764 -msgid "Base data" -msgstr "Basisdaten" - -#: yms/ui/main_v0.ui:1877 yms/ui/provisions.ui:28 -msgid "Kategorie" -msgstr "" - -#: yms/ui/main_v0.ui:1965 yms/ui/provisions.ui:116 -msgid "Filter Providions (here selection description)" -msgstr "" - -#: yms/ui/main_v0.ui:2174 yms/ui/maintenance.ui:109 +#: yms/ui/maintenance.ui:111 msgid "Filter Maintenance" msgstr "Filter Wartung" -#: yms/ui/main_v0.ui:2404 yms/ui/projects.ui:130 +#: yms/ui/maintenance.ui:212 +msgid "Maintenance Details" +msgstr "Wartungsdetails" + +#: yms/ui/maintenance.ui:278 yms/ui/maintenance.ui:569 +msgid "Series" +msgstr "Serie" + +#: yms/ui/maintenance.ui:289 +msgid "Interval hours" +msgstr "" + +#: yms/ui/maintenance.ui:300 yms/ui/maintenance.ui:591 +msgid "Last hours" +msgstr "" + +#: yms/ui/maintenance.ui:311 yms/ui/maintenance.ui:602 yms/ui/tasks.ui:438 +msgid "Plan date" +msgstr "Plandatum" + +#: yms/ui/maintenance.ui:322 yms/ui/maintenance.ui:613 +msgid "Completion date" +msgstr "Fertigstellungsdatum" + +#: yms/ui/maintenance.ui:519 +msgid "Edit Maintenance" +msgstr "Wartung bearbeiten" + +#: yms/ui/maintenance.ui:580 +msgid "Interval" +msgstr "Intervall" + +#: yms/ui/measurement.ui:126 +msgid "Filter Measurement" +msgstr "Filter Maß/Messung" + +#: yms/ui/measurement.ui:227 +msgid "Measurement Details" +msgstr "Maß/Messung-Details" + +#: yms/ui/measurement.ui:293 yms/ui/measurement.ui:570 +msgid "Dimensions" +msgstr "Abmessungen" + +#: yms/ui/measurement.ui:304 yms/ui/measurement.ui:584 +msgid "Value 1" +msgstr "Wert 1" + +#: yms/ui/measurement.ui:315 yms/ui/measurement.ui:595 +msgid "Value 2" +msgstr "Wert 2" + +#: yms/ui/measurement.ui:326 yms/ui/measurement.ui:606 +msgid "Value 3" +msgstr "Wert 3" + +#: yms/ui/measurement.ui:534 +msgid "Edit Measurement" +msgstr "Maß/Messung bearbeiten" + +#: yms/ui/measurement.ui:628 +msgid "Date" +msgstr "Datum" + +#: yms/ui/projects.ui:149 msgid "Filter Projects" msgstr "Filter Projekte" -#: yms/ui/main_v0.ui:2762 yms/ui/status.ui:28 +#: yms/ui/projects.ui:252 +msgid "Project Details" +msgstr "Projektdetails" + +#: yms/ui/projects.ui:294 yms/ui/projects.ui:573 +msgid "Date start" +msgstr "Startdatum" + +#: yms/ui/projects.ui:305 +msgid "Duration, days" +msgstr "Dauer, Tage" + +#: yms/ui/projects.ui:316 yms/ui/projects.ui:595 +msgid "Costs plan" +msgstr "Geplante Kosten" + +#: yms/ui/projects.ui:327 yms/ui/projects.ui:606 +msgid "Costs final" +msgstr "Tatsächliche Kosten" + +#: yms/ui/projects.ui:529 +msgid "Edit Project" +msgstr "Projekt bearbeiten" + +#: yms/ui/projects.ui:584 +msgid "Duration days" +msgstr "" + +#: yms/ui/provisions.ui:29 +msgid "Kategorie" +msgstr "" + +#: yms/ui/provisions.ui:117 +msgid "Filter Providions (here selection description)" +msgstr "" + +#: yms/ui/provisions.ui:218 +msgid "Edit provision" +msgstr "Verpflegung bearbeiten" + +#: yms/ui/provisions.ui:334 yms/ui/provisions.ui:669 +msgid "Storedate" +msgstr "Einlagerdatum" + +#: yms/ui/provisions.ui:345 yms/ui/provisions.ui:680 +msgid "Shelflife" +msgstr "Haltbarkeit" + +#: yms/ui/provisions.ui:525 +msgid "View Provision" +msgstr "Verpflegung ansehen" + +#: yms/ui/provisions.ui:798 +msgid "Target" +msgstr "" + +#: yms/ui/status.ui:50 msgid "" "This is an early release of YMS native GUI.\n" "Please use the web frontend wich is already \n" "in an usable state.\n" "\n" "For further assistance please consult the related\n" -"thread in \"Segeln Forum\"\n" +"thread in \"Segeln Forum\"" msgstr "" -#: yms/ui/main_v0.ui:2791 yms/ui/status.ui:57 -msgid "YMS-GUI version 0.2.1" +#: yms/ui/status.ui:83 +msgid "Info" msgstr "" +#: yms/ui/status.ui:112 +msgid "Tables" +msgstr "Tabellen" + +#: yms/ui/status.ui:163 +msgid "Config" +msgstr "Konfiguration" + +#: yms/ui/status.ui:181 +msgid "YMS version x.x.x" +msgstr "" + +#: yms/ui/storage.ui:136 +msgid "Filter Storage" +msgstr "Filter Stauraum" + +#: yms/ui/storage.ui:237 +msgid "Storage Details" +msgstr "Stauraumdetails" + +#: yms/ui/storage.ui:291 +msgid "Position (x, y, z)" +msgstr "" + +#: yms/ui/storage.ui:302 +msgid "Dimension (x, y, z)" +msgstr "" + +#: yms/ui/storage.ui:313 yms/ui/storage.ui:781 +msgid "Angle" +msgstr "Winkel" + +#: yms/ui/storage.ui:324 yms/ui/storage.ui:804 +msgid "Capacity" +msgstr "Kapazität" + +#: yms/ui/storage.ui:522 +msgid "Edit Storage" +msgstr "Stauraum bearbeiten" + +#: yms/ui/storage.ui:558 +msgid "Typ" +msgstr "Typ" + +#: yms/ui/storage.ui:572 +msgid "Position, mm" +msgstr "" + +#: yms/ui/storage.ui:585 +msgid "X" +msgstr "" + +#: yms/ui/storage.ui:598 +msgid "Y" +msgstr "" + +#: yms/ui/storage.ui:611 +msgid "Z" +msgstr "" + +#: yms/ui/storage.ui:686 +msgid "Width, mm" +msgstr "Breite, mm" + +#: yms/ui/storage.ui:699 +msgid "WX" +msgstr "" + +#: yms/ui/storage.ui:712 +msgid "WY" +msgstr "" + +#: yms/ui/storage.ui:725 +msgid "WZ" +msgstr "" + +#: yms/ui/storage.ui:879 +msgid "Degrees" +msgstr "Grad" + +#: yms/ui/tasks.ui:66 yms/ui/tasks.ui:771 +msgid "Project" +msgstr "Projekte" + +#: yms/ui/tasks.ui:142 +msgid "pending" +msgstr "" + +#: yms/ui/tasks.ui:156 +msgid "active" +msgstr "Aktiv" + +#: yms/ui/tasks.ui:170 +msgid "waiting" +msgstr "Wartend" + +#: yms/ui/tasks.ui:198 +msgid "completed" +msgstr "Abgeschlossen" + +#: yms/ui/tasks.ui:225 +msgid "Filter Tasks" +msgstr "Filter Aufgaben" + +#: yms/ui/tasks.ui:326 +msgid "Task Details" +msgstr "Aufgabendetails" + +#: yms/ui/tasks.ui:391 +msgid "Timestamp" +msgstr "" + +#: yms/ui/tasks.ui:449 +msgid "Due date" +msgstr "" + +#: yms/ui/tasks.ui:460 +msgid "Started" +msgstr "Gestartet" + +#: yms/ui/tasks.ui:533 +msgid "Finished" +msgstr "Beendet" + +#: yms/ui/tasks.ui:655 +msgid "Edit Task" +msgstr "Aufgabe bearbeiten" + +#: yms/ui/tasks.ui:803 +msgid "Plan Date" +msgstr "" + +#~ msgid "empty" +#~ msgstr "leer" + +#~ msgid "Type2" +#~ msgstr "Typ2" + +#~ msgid "Depth" +#~ msgstr "Tiefgang" + #~ msgid "Configuration file not found" #~ msgstr "Konfigurationsdatei nicht gefunden" diff --git a/yms/database.py b/yms/database.py index 3b6b479..d1c097b 100644 --- a/yms/database.py +++ b/yms/database.py @@ -125,6 +125,22 @@ class Database: self.conn.commit() return self.cur.rowcount == 1 + def load_setting(self, sno): + sql = "SELECT valstr, valint FROM settings WHERE userid=0 AND sno=%s" + self.cur.execute(sql, (sno,)) + row = self.cur.fetchone() + if not row: + sql = "INSERT INTO settings (userid, sno) VALUES (0, %s)" + self.cur.execute(sql, (sno,)) + self.conn.commit() + return (None, None) + return row + + def save_setting(self, sno, valstr, valint): + sql = "UPDATE settings SET valstr=%s, valint=%s WHERE userid=0 AND sno=%s" + values = (valstr, valint, sno) + return self.execute_write(sql, values, 1) + def execute_write(self, sql, values=(), expected_rows=None): """ Execute an INSERT, UPDATE, or DELETE statement. diff --git a/yms/lookup.py b/yms/lookup.py index e97ec5a..d33aad7 100644 --- a/yms/lookup.py +++ b/yms/lookup.py @@ -21,6 +21,58 @@ class Dropdown: FUSE_BLOCK = 10 CABLE_TYPE = 11 CABLE_TECHNAME = 12 + INVENTORY_CATEGORY = 13 + BBN_VESSELDATA = 14 + MEASUREMENT_CATEGORY = 15 + + Dependencies = { + HULL_TYPE: ( + # unused + ), + COMPANY_TYPE: ( + ('company', 'comptype'), + ('company', 'comptype2') + ), + STORAGE_TYPE: ( + ('storage', 'stype'), + ), + EQUIPMENT_CATEGORY: ( + ('equipment', 'ecat'), + ), + PROVISION_CATEGORY: ( + ('provisions', 'provcat'), + ), + PROVISION_UNIT: ( + ('provisions', 'unit'), + ), + FUSE_TYPE: ( + ('fuse', 'ftype'), + ), + UNIT: ( + ('measurement', 'unit'), + ), + BOX_TYPE: ( + ('box', 'boxtype'), + ), + FUSE_BLOCK: ( + ('fuse', 'location'), + ), + CABLE_TYPE: ( + ('cable', 'cabletype'), + ), + CABLE_TECHNAME: ( + ('cable', 'techname'), + ), + INVENTORY_CATEGORY: ( + ('inventory', 'invcat'), + ), + BBN_VESSELDATA: ( + #unused + ), + MEASUREMENT_CATEGORY: ( + ('measurement', 'mcat'), + ) + } class Lookup: @@ -38,27 +90,28 @@ class Lookup: TODO translation via gettext needed """ db_enums = { - 'user.role': ('user', 'role'), - 'dropdown.flags': ('dropdown', 'flags'), - 'vessel.vtype': ('vessel', 'vtype'), - 'storage.capaunit': ('storage', 'capaunit'), - 'tagref.objtype': ('tagref', 'objtype'), - 'inventory.conttype': ('inventory', 'conttype'), - 'inventory.invcond': ('inventory', 'invcond'), 'cable.cablecond': ('cable', 'cablecond'), - 'measurement.accuracy': ('measurement', 'accuracy'), + 'checkitem.checkresult': ('checkitem', 'checkresult'), + 'checklist.clstate': ('checklist', 'clstate'), + 'company.flags': ('company', 'flags'), + 'docref.reftype': ('docref', 'reftype'), 'document.doctype': ('document', 'doctype'), 'document.roleaccess': ('document', 'roleaccess'), - 'docref.reftype': ('docref', 'reftype'), + 'dropdown.flags': ('dropdown', 'flags'), + 'inventory.conttype': ('inventory', 'conttype'), + 'inventory.invcond': ('inventory', 'invcond'), 'maintenance.maintstate': ('maintenance', 'maintstate'), + 'measurement.accuracy': ('measurement', 'accuracy'), + 'note.notetype': ('note', 'notetype'), 'project.projstate': ('project', 'projstate'), + 'signalk.datatype': ('signalk', 'datatype'), + 'signalk.objtype': ('signalk', 'objtype'), + 'storage.capaunit': ('storage', 'capaunit'), + 'tagref.objtype': ('tagref', 'objtype'), 'task.priority': ('task', 'priority'), 'task.taskstate': ('task', 'taskstate'), - 'note.notetype': ('note', 'notetype'), - 'checklist.clstate': ('checklist', 'clstate'), - 'checkitem.checkresult': ('checkitem', 'checkresult'), - 'signalk.objtype': ('signalk', 'objtype'), - 'signalk.datatype': ('signalk', 'datatype') + 'user.role': ('user', 'role'), + 'vessel.vtype': ('vessel', 'vtype') } for key, (table, column) in db_enums.items(): self._enums[key] = self.db.load_enum(table, column) @@ -83,6 +136,14 @@ class Lookup: def dropdown(self, ddid): return self._dropdowns[ddid] + def user(self): + userlist = {} + sql = "SELECT userid, displayname FROM user ORDER BY displayname" + self.db.cur.execute(sql) + for row in self.db.cur.fetchall(): + userlist[row[0]] = row[1] + return userlist + def refresh(self): # TODO ugly hack please improve self._load_dropdowns() diff --git a/yms/model/cable.py b/yms/model/cable.py index ae2cb36..705cf41 100644 --- a/yms/model/cable.py +++ b/yms/model/cable.py @@ -6,7 +6,7 @@ class Cable(DbRecord): table = "cable" pk_field = "cableid" - fields = ('cableid', 'vid', 'cablename', 'cabletype', 'techname', 'length', + fields = ('vid', 'cablename', 'cabletype', 'techname', 'length', 'conductors', 'diameter', 'xsection', 'weight', 'color', 'supplier', 'manufacturer', 'cablecond', 'remarks') diff --git a/yms/model/dbrecord.py b/yms/model/dbrecord.py index a2b041b..0f6086f 100644 --- a/yms/model/dbrecord.py +++ b/yms/model/dbrecord.py @@ -23,7 +23,7 @@ class DbRecord: self.conn = db.conn self.last_update = None - self.title = _("DbRecord({})") # for pretty print + self._title = _("DbRecord({})") # for pretty print if record_id is not None: self.pk_value = int(record_id) @@ -142,7 +142,7 @@ class DbRecord: return True def __str__(self): - out = [self.title.format(self.pk_value)] + out = [self._title.format(self.pk_value)] for field in self.fields: value = getattr(self, field, None) out.append(" {:15}: {}".format(field, value)) diff --git a/yms/model/document.py b/yms/model/document.py index a3b39bb..8b39937 100644 --- a/yms/model/document.py +++ b/yms/model/document.py @@ -6,7 +6,7 @@ class Document(DbRecord): table = "document" pk_field = "docid" - fields = ('docid', 'doctype', 'mimetype', 'filename', 'extension', + fields = ('doctype', 'mimetype', 'filename', 'extension', 'hash', 'docsize', 'doctime', 'docdate', 'title', 'pages', 'remarks', 'roleaccess') diff --git a/yms/model/equipment.py b/yms/model/equipment.py index f146df8..b7b4ace 100644 --- a/yms/model/equipment.py +++ b/yms/model/equipment.py @@ -6,7 +6,7 @@ class Equipment(DbRecord): table = "equipment" pk_field = "eid" - fields = ('eid', 'vid' 'ename', 'shortname', 'model', 'ecat', 'serial', + fields = ('eid', 'vid', 'ename', 'shortname', 'model', 'ecat', 'serial', 'supplier', 'manufacturer', 'purchdate', 'price', 'weight', 'remarks', 'flags') diff --git a/yms/model/inventory.py b/yms/model/inventory.py index de5bd3b..c5f6a06 100644 --- a/yms/model/inventory.py +++ b/yms/model/inventory.py @@ -6,8 +6,9 @@ class Inventory(DbRecord): table = "inventory" pk_field = "invid" - fields = ('invid', 'invname', 'conttype', 'sid', 'boxid', 'eid', 'number', - 'weight', 'price', 'purchdate', 'invcond', 'remarks', 'flags') + fields = ('invid', 'invname', 'icat', 'conttype', 'sid', 'boxid', 'eid', + 'number', 'weight', 'price', 'purchdate', 'invcond', 'remarks', + 'flags') def __init__(self, db, invid=None): super().__init__(db, invid) diff --git a/yms/model/project.py b/yms/model/project.py index 954204c..9ff470b 100644 --- a/yms/model/project.py +++ b/yms/model/project.py @@ -5,9 +5,9 @@ from .dbrecord import DbRecord class Project(DbRecord): table = "project" - pk_field = "prokid" - fields = ('projid', 'projname', 'vid', 'responsible', 'startdate', - 'duration', 'costs_plan', 'costs_final', 'remarks', 'projstate') + pk_field = "projid" + fields = ('projname', 'vid', 'responsible', 'startdate', 'duration', + 'costs_plan', 'costs_final', 'remarks', 'projstate') def __init__(self, db, projid=None): super().__init__(db, projid) diff --git a/yms/model/task.py b/yms/model/task.py index 33e9903..01b667d 100644 --- a/yms/model/task.py +++ b/yms/model/task.py @@ -6,8 +6,8 @@ class Task(DbRecord): table = "task" pk_field = "taskid" - fields = ('taskid', 'vid', 'projid', 'taskname', 'priority', 'taskstate', - 'state_ts', 'plandate', 'duedate', 'started', 'finished', 'responsible') + fields = ('vid', 'projid', 'taskname', 'priority', 'taskstate', 'state_ts', + 'plandate', 'duedate', 'started', 'finished', 'responsible', 'remarks') def __init__(self, db, taskid=None): super().__init__(db, taskid) diff --git a/yms/ui/base.ui b/yms/ui/base.ui index 0d4037e..68736e7 100644 --- a/yms/ui/base.ui +++ b/yms/ui/base.ui @@ -62,407 +62,455 @@ 1 10 - + True - False - 8 + True - + True - True + False - + True False + vertical - + + True + False + Ghost + + + False + True + 0 + + + + + True False - vertical True False - Ghost + Name - False - True - 0 + 0 + 1 - - + True False - - - True - False - Name - - - 0 - 1 - - - - - True - False - Model - - - 0 - 2 - - - - - True - False - Year built - - - 0 - 3 - - - - - True - False - LoA - - - 0 - 4 - - - - - True - False - Draught min - - - 0 - 8 - - - - - True - False - Draught - - - 0 - 7 - - - - - True - False - Beam - - - 0 - 6 - - - - - True - False - LwL - - - 0 - 5 - - - - - True - False - Ballast - - - 0 - 10 - - - - - True - False - True - - - 1 - 1 - - - - - True - False - True - - - 1 - 2 - - - - - True - False - True - - - 1 - 3 - - - - - True - False - True - - - 1 - 4 - - - - - True - False - True - - - 1 - 5 - - - - - True - False - True - - - 1 - 6 - - - - - True - False - True - - - 1 - 7 - - - - - True - False - True - - - 1 - 8 - - - - - True - False - True - - - 1 - 10 - - - - - True - False - 4 - 4 - True - - - - 0 - 0 - 2 - - - - - True - False - Shipyard - - - 0 - 15 - - - - - True - False - True - - - 1 - 15 - - - - - True - False - Displacement - - - 0 - 9 - - - - - True - False - True - - - 1 - 9 - - - - - True - False - Belt position, front - - - 0 - 11 - - - - - True - False - Belt position, aft - - - 0 - 12 - - - - - True - False - True - - - 1 - 11 - - - - - True - False - True - - - 1 - 12 - - - - - True - False - Hull shape - - - 0 - 13 - - - - - True - False - Remarks - - - 0 - 16 - - - - - True - False - True - - - 1 - 16 - - - - - True - False - True - - - 1 - 13 - - - - - True - False - Default Storage - - - 0 - 14 - - - - - True - False - True - - - 1 - 14 - - + Model + + + 0 + 2 + + + + + True + False + Year built + + + 0 + 3 + + + + + True + False + LoA + + + 0 + 4 + + + + + True + False + Draught min + + + 0 + 8 + + + + + True + False + Draught + + + 0 + 7 + + + + + True + False + Beam + + + 0 + 6 + + + + + True + False + LwL + + + 0 + 5 + + + + + True + False + Ballast + + + 0 + 10 + + + + + True + False + True + True + + + 1 + 1 + + + + + True + False + True + True + + + 1 + 2 + + + + + True + False + True + True + + + 1 + 3 + + + + + True + False + True + True + + + 1 + 4 + + + + + True + False + True + True + + + 1 + 5 + + + + + True + False + True + True + + + 1 + 6 + + + + + True + False + True + True + + + 1 + 7 + + + + + True + False + True + True + + + 1 + 8 + + + + + True + False + True + True + + + 1 + 10 + + + + + True + False + 4 + 4 + True + + + + 0 + 0 + 2 + + + + + True + False + Shipyard + + + 0 + 15 + + + + + True + False + True + True + + + 1 + 15 + + + + + True + False + Displacement + + + 0 + 9 + + + + + True + False + True + True + + + 1 + 9 + + + + + True + False + Belt position, bow + + + 0 + 11 + + + + + True + False + Belt position, aft + + + 0 + 12 + + + + + True + False + True + True + + + 1 + 11 + + + + + True + False + True + True + + + 1 + 12 + + + + + True + False + Hull shape + + + 0 + 13 + + + + + True + False + Remarks + 0 + + + 0 + 16 + + + + + True + False + True + True + True + 0 + + + 1 + 16 + + + + + True + False + True + True + + + 1 + 13 + + + + + True + False + Default Storage + + + 0 + 14 + + + + + True + False + True + True + + + 1 + 14 + + + + + True + True + 1 + + + + + True + False + end + + + Delete + True + True + True + + + + True + True + 0 + True + + + + + Add + True + True + True + True @@ -471,877 +519,514 @@ - + + Edit True - False - end - - - Delete - True - True - True - - - - True - True - 0 - True - - - - - Add - True - True - True - - - - True - True - 1 - - - - - Edit - True - True - True - - - - True - True - 2 - - - - - False - True - 2 - - - - - page_detail - page_detail - - - - - True - False - vertical - - - True - False - Ghost - - - False - True - 0 - - - - - - True - False - 4 - 4 - 4 - 8 - - - True - False - Name - - - 0 - 0 - - - - - True - True - 30 - 30 - 20 - alpha - - - 1 - 0 - - - - - True - False - Model - - - 0 - 1 - - - - - True - True - - - 1 - 1 - - - - - True - False - LoA - - - 0 - 3 - - - - - True - False - LWL - - - 0 - 4 - - - - - True - False - Beam - - - 0 - 5 - - - - - True - False - Draught - - - 0 - 6 - - - - - True - False - Draught, min - - - 0 - 7 - - - - - True - True - adj_loa - 2 - - - 1 - 3 - - - - - True - True - adj_lwl - 2 - - - 1 - 4 - - - - - True - True - adj_beam - 2 - - - 1 - 5 - - - - - True - True - adj_draught - 2 - - - 1 - 6 - - - - - True - True - adj_draught_min - 2 - - - 1 - 7 - - - - - True - False - Displacement - - - 0 - 8 - - - - - True - False - Ballast - - - 0 - 9 - - - - - True - True - adj_displacement - - - 1 - 8 - - - - - True - True - adj_ballast - - - 1 - 9 - - - - - True - False - Remarks - - - 0 - 15 - - - - - True - False - - - 1 - 14 - - - - - True - False - Default Storage - - - 0 - 14 - - - - - True - True - in - - - True - True - True - natural - natural - word - 1 - 1 - 1 - 1 - - - - - - - 1 - 15 - - - - - True - False - Year built - - - 0 - 2 - - - - - True - True - 0 - adj_year_built - - - 1 - 2 - - - - - True - False - Shipyard - - - 0 - 13 - - - - - True - False - - - 1 - 13 - - - - - True - False - Hull shape - - - 0 - 12 - - - - - True - False - - - 1 - 12 - - - - - True - True - 0 - number - adj_belt_front - 2 - - - 1 - 10 - - - - - True - True - 0 - number - adj_belt_aft - 2 - - - 1 - 11 - - - - - True - False - Belt position, front - - - 0 - 10 - - - - - True - False - Belt position, aft - - - 0 - 11 - - + True + True + True True - 4 2 - - - True - False - end - - - Save - True - True - True - - - - True - True - 1 - - - - - Cancel - True - True - True - - - - True - True - 2 - - - - - False - True - 3 - - - page_edit - page_edit - 1 + False + True + 2 - - - - True - False - Vessel - - False + page_detail + page_detail - + True - True + False + vertical + 4 - + True False - vertical + Ghost + + + False + True + 0 + + + + + + True + False + 4 + 4 + 4 + 8 + + + True + False + Name + + + + + + 0 + 0 + + + + + True + True + 30 + 30 + 20 + alpha + + + 1 + 0 + + + + + True + False + Model + + + 0 + 1 + + + + + True + True + + + 1 + 1 + + + + + True + False + LoA + + + 0 + 3 + + + + + True + False + LWL + + + 0 + 4 + + + + + True + False + Beam + + + 0 + 5 + + + + + True + False + Draught + + + 0 + 6 + + + + + True + False + Draught, min + + + 0 + 7 + + + + + True + True + adj_loa + 2 + + + 1 + 3 + + + + + True + True + adj_lwl + 2 + + + 1 + 4 + + + + + True + True + adj_beam + 2 + + + 1 + 5 + + + + + True + True + adj_draught + 2 + + + 1 + 6 + + + + + True + True + adj_draught_min + 2 + + + 1 + 7 + + + + + True + False + Displacement + + + 0 + 8 + + + + + True + False + Ballast + + + 0 + 9 + + + + + True + True + adj_displacement + + + 1 + 8 + + + + + True + True + adj_ballast + + + 1 + 9 + + + + + True + False + Remarks + + + 0 + 15 + + + + + True + False + + + 1 + 14 + + + + + True + False + Default Storage + + + 0 + 14 + + True True in - + True True - - - - + True + natural + natural + word + 1 + 1 + 1 + 1 + + + + 1 + 15 + + + + + True + False + Year built + + + 0 + 2 + + + + + True + True + 0 + adj_year_built + + + 1 + 2 + + + + + True + False + Shipyard + + + 0 + 13 + + + + + True + False + + + 1 + 13 + + + + + True + False + Hull shape + + + 0 + 12 + + + + + True + False + + + 1 + 12 + + + + + True + True + 0 + number + adj_belt_front + 2 + + + 1 + 10 + + + + + True + True + 0 + number + adj_belt_aft + 2 + + + 1 + 11 + + + + + True + False + Belt position, front + + + 0 + 10 + + + + + True + False + Belt position, aft + + + 0 + 11 + + + + + True + True + 4 + 2 + + + + + True + False + end + + + Save + True + True + True + + True True - 0 + 1 - + + Cancel True - False - end - - - New - True - True - True - - - - True - True - 0 - - - - - Delete - True - True - True - - - - True - True - 2 - - + True + True + - False + True True 2 - False - True - - - - - True - False - vertical - - - - True - False - - - True - False - Login - - - 0 - 0 - - - - - True - False - Displayname - - - 0 - 1 - - - - - True - True - - - 1 - 0 - - - - - True - True - - - 1 - 1 - - - - - True - False - Role - - - 0 - 3 - - - - - True - False - Language - - - 0 - 4 - - - - - True - False - - - 1 - 3 - - - - - True - False - - - 1 - 4 - - - - - True - False - Password - - - 0 - 6 - - - - - True - True - - - 1 - 6 - - - - - Create - True - True - True - - - - 2 - 6 - - - - - Locked - True - True - False - True - - - 1 - 8 - - - - - Deleted - True - True - False - True - - - 1 - 9 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - 0 - - - - - True - False - end - - - Save - True - True - True - - - - True - True - 0 - - - - - False - True - 1 - - - - - True - True + False + True + 3 + page_edit + page_edit 1 - - - True - False - User - - - 2 - False - - + + + + + True + False + Vessel + + + False + + + + + True + True - + True False vertical @@ -1351,9 +1036,10 @@ True in - + True True + @@ -1372,24 +1058,26 @@ False end - - Details + + New True True True + True True - 1 + 0 - - Edit + + Delete True True True + True @@ -1406,179 +1094,234 @@ - 2 - - - - - True - False - Lists - - - 2 - False + False + True - + True False vertical - + + True False - Global system settings - - - + + + True + False + Login + + + 0 + 0 + + + + + True + False + Displayname + + + 0 + 1 + + + + + True + True + + + 1 + 0 + + + + + True + True + + + 1 + 1 + + + + + True + False + Role + + + 0 + 3 + + + + + True + False + Language + + + 0 + 4 + + + + + True + False + + + 1 + 3 + + + + + True + False + + + 1 + 4 + + + + + True + False + Password + + + 0 + 6 + + + + + True + True + + + 1 + 6 + + + + + Create + True + True + True + + + + 2 + 6 + + + + + Locked + True + True + False + True + + + 1 + 8 + + + + + Deleted + True + True + False + True + + + 1 + 9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - False + True True 0 - - - - True - False - - - True - False - Currency symbol - - - 0 - 0 - - - - - True - False - Max image width - - - 0 - 1 - - - - - True - False - Max image height - - - 0 - 2 - - - - - True - True - True - - - 1 - 0 - - - - - True - True - adj_sys_max_width - - - 1 - 1 - - - - - True - True - adj_sys_max_height - - - 1 - 2 - - - - - True - True - 1 - - - - - True - False - User settings - - - - - - False - True - 2 - - - - - - True - False - - - True - False - Date format - - - 0 - 0 - - - - - True - False - True - - - 1 - 0 - - - - - True - True - 3 - - True False end - + Save True True True - + True @@ -1590,29 +1333,633 @@ False True - 4 + 1 - 3 - - - - - True - False - Settings - - - 3 - False + True + True - page0 - page0 + 1 + + + + + True + False + User + + + 2 + False + + + + + True + False + vertical + + + True + True + in + + + True + True + + + + + + + + True + True + 0 + + + + + True + False + end + + + Details + True + True + True + + + True + True + 1 + + + + + Edit + True + True + True + + + True + True + 2 + + + + + False + True + 2 + + + + + 2 + + + + + True + False + Lists + + + 2 + False + + + + + True + False + vertical + + + True + False + Global system settings + + + + + + False + True + 0 + + + + + + True + False + + + True + False + Currency symbol + + + 0 + 0 + + + + + True + False + Max image width + + + 0 + 1 + + + + + True + False + Max image height + + + 0 + 2 + + + + + True + True + True + + + 1 + 0 + + + + + True + True + adj_sys_max_width + + + 1 + 1 + + + + + True + True + adj_sys_max_height + + + 1 + 2 + + + + + True + True + 1 + + + + + True + False + User settings + + + + + + False + True + 2 + + + + + + True + False + + + True + False + Date format + + + 0 + 0 + + + + + True + False + True + + + 1 + 0 + + + + + True + True + 3 + + + + + True + False + end + + + Save + True + True + True + + + + True + True + 0 + + + + + False + True + 4 + + + + + 3 + + + + + True + False + Settings + + + 3 + False + + + + + True + False + vertical + + + True + False + Backup to USB stick + + + False + True + 0 + + + + + + True + False + + + True + False + UUID + + + 0 + 5 + + + + + True + False + Device + + + 0 + 0 + + + + + Detect + True + True + True + + + + 2 + 0 + 2 + + + + + True + False + True + + + 1 + 5 + + + + + True + False + True + + + 1 + 0 + + + + + Initialize + True + True + + + + 2 + 8 + + + + + True + False + Last Backup + + + 0 + 9 + + + + + True + False + True + + + 1 + 9 + + + + + True + False + Serial + + + 0 + 1 + + + + + True + False + True + + + 1 + 1 + + + + + True + False + Vendor + + + 0 + 2 + + + + + True + False + Model + + + 0 + 3 + + + + + True + False + Partition + + + 0 + 4 + + + + + True + False + + + 1 + 2 + + + + + True + False + + + 1 + 3 + + + + + True + False + + + 1 + 4 + + + + + True + False + True + + + 1 + 7 + 2 + + + + + True + False + Filesystem + + + 0 + 6 + + + + + True + False + True + + + 1 + 6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + True + 1 + + + + + True + True + + + + + + True + True + 2 + + + + + True + False + end + + + Backup + True + True + True + + + True + True + 1 + + + + + Restore + True + True + True + + + True + True + 2 + + + + + False + True + 3 + + + + + 4 + + + + + True + False + Backup + + + 4 + False diff --git a/yms/ui/boxes.ui b/yms/ui/boxes.ui index 03e8f3c..4246c89 100644 --- a/yms/ui/boxes.ui +++ b/yms/ui/boxes.ui @@ -158,6 +158,7 @@ True True + @@ -295,6 +296,7 @@ False True True + 0 1 @@ -507,6 +509,7 @@ True False vertical + 4 True @@ -527,6 +530,8 @@ True False + 4 + 8 True diff --git a/yms/ui/cables.ui b/yms/ui/cables.ui index 880ce90..5d75925 100644 --- a/yms/ui/cables.ui +++ b/yms/ui/cables.ui @@ -172,6 +172,7 @@ True True + @@ -420,6 +421,7 @@ True False Remarks + 0 0 @@ -552,6 +554,8 @@ True False True + True + 0 1 @@ -632,6 +636,7 @@ True False vertical + 4 True @@ -649,14 +654,19 @@ - + True False + 4 + 8 True False Name + + + 0 @@ -679,6 +689,9 @@ True False Type + + + 0 @@ -701,6 +714,9 @@ True False Length + + + 0 @@ -712,6 +728,9 @@ True False Conductors + + + 0 @@ -734,6 +753,9 @@ True False Cross section + + + 0 @@ -800,6 +822,7 @@ True False Remarks + 0 0 @@ -952,9 +975,6 @@ True False end - - - Save diff --git a/yms/ui/companies.ui b/yms/ui/companies.ui index 8c972b0..5d78e95 100644 --- a/yms/ui/companies.ui +++ b/yms/ui/companies.ui @@ -110,6 +110,10 @@ True True + + + + @@ -183,9 +187,12 @@ True False + 4 + 4 vertical + 4 - + True False Edit company @@ -204,11 +211,16 @@ True False + 4 + 8 True False Type + + + 0 @@ -220,6 +232,9 @@ True False Name + + + 0 @@ -242,7 +257,7 @@ True False - Type2 + Secondary type 0 @@ -281,7 +296,7 @@ - + True True 20 @@ -413,7 +428,7 @@ - + True True 40 @@ -424,7 +439,7 @@ - + True True 10 @@ -435,7 +450,7 @@ - + True True 30 @@ -446,7 +461,7 @@ - + True True 30 @@ -457,7 +472,7 @@ - + True True 30 @@ -468,7 +483,7 @@ - + True True 30 @@ -480,7 +495,7 @@ - + True True 50 @@ -492,7 +507,7 @@ - + True True 40 @@ -503,7 +518,7 @@ - + True True 20 @@ -514,7 +529,7 @@ - + True True 20 @@ -595,7 +610,7 @@ False vertical - + True False Company details @@ -610,12 +625,12 @@ - + True False - + True False Name @@ -626,7 +641,7 @@ - + True False Type @@ -637,7 +652,7 @@ - + True False Type secondary @@ -648,7 +663,7 @@ - + True False Short name @@ -659,7 +674,7 @@ - + True False Street @@ -670,7 +685,7 @@ - + True False ZIP @@ -681,7 +696,7 @@ - + True False City @@ -692,7 +707,7 @@ - + True False Country @@ -707,6 +722,8 @@ True False True + True + 0 1 @@ -718,6 +735,8 @@ True False True + True + 0 1 @@ -729,6 +748,8 @@ True False True + True + 0 1 @@ -740,6 +761,8 @@ True False True + True + 0 1 @@ -751,6 +774,8 @@ True False True + True + 0 1 @@ -762,6 +787,8 @@ True False True + True + 0 1 @@ -773,6 +800,8 @@ True False True + True + 0 1 @@ -784,6 +813,8 @@ True False True + True + 0 1 @@ -791,10 +822,9 @@ - + True False - True Contact @@ -803,10 +833,9 @@ - + True False - True Phone @@ -815,10 +844,9 @@ - + True False - True Email @@ -827,10 +855,9 @@ - + True False - True Web @@ -839,10 +866,9 @@ - + True False - True Customer no. @@ -851,10 +877,9 @@ - + True False - True Contract no. @@ -863,15 +888,15 @@ - + True False - True Remarks + 0 0 - 14 + 15 @@ -879,6 +904,8 @@ True False True + True + 0 1 @@ -890,6 +917,8 @@ True False True + True + 0 1 @@ -901,6 +930,8 @@ True False True + True + 0 1 @@ -912,6 +943,8 @@ True False True + True + 0 1 @@ -919,10 +952,12 @@ - + True False True + True + 0 1 @@ -934,6 +969,8 @@ True False True + True + 0 1 @@ -945,6 +982,33 @@ True False True + True + True + 0 + + + 1 + 15 + + + + + True + False + Flags + + + 0 + 14 + + + + + True + False + True + True + 0 1 @@ -993,12 +1057,12 @@ - - Cancel + + Close True True True - + True diff --git a/yms/ui/documents.ui b/yms/ui/documents.ui index 2dae154..8ff0d6c 100644 --- a/yms/ui/documents.ui +++ b/yms/ui/documents.ui @@ -147,6 +147,7 @@ True True + @@ -240,7 +241,7 @@ - + True False @@ -260,6 +261,7 @@ True False True + True 1 @@ -304,6 +306,7 @@ True False True + True 1 @@ -315,6 +318,7 @@ True False True + True 1 @@ -326,6 +330,7 @@ True False True + True 1 @@ -370,6 +375,7 @@ True False True + True 1 @@ -381,6 +387,7 @@ True False True + True 1 @@ -392,6 +399,7 @@ True False True + True 1 @@ -403,10 +411,11 @@ True False Remarks + 0 0 - 7 + 8 @@ -415,15 +424,54 @@ False True True + True + 0 + + + 1 + 8 + + + + + True + False + Role access + + + 0 + 7 + + + + + True + False + True + True 1 7 + + + True + False + True + 0 + gtk-missing-image + + + 2 + 0 + 9 + + - False + True True 1 @@ -494,6 +542,8 @@ True False + 4 + 4 vertical @@ -515,6 +565,8 @@ True False + 4 + 8 True diff --git a/yms/ui/equipment.ui b/yms/ui/equipment.ui index e827ba6..2748836 100644 --- a/yms/ui/equipment.ui +++ b/yms/ui/equipment.ui @@ -334,7 +334,7 @@ - + True False @@ -457,7 +457,7 @@ 0 - 10 + 11 @@ -465,6 +465,7 @@ True False True + True 1 @@ -476,6 +477,7 @@ True False True + True 1 @@ -487,6 +489,7 @@ True False True + True 1 @@ -498,6 +501,7 @@ True False True + True 1 @@ -509,6 +513,7 @@ True False False + True 1 @@ -520,6 +525,7 @@ True False True + True 1 @@ -531,6 +537,7 @@ True False True + True 1 @@ -542,6 +549,7 @@ True False True + True 1 @@ -553,6 +561,7 @@ True False True + True 1 @@ -564,6 +573,7 @@ True False True + True 1 @@ -576,6 +586,31 @@ False True True + True + 0 + + + 1 + 11 + + + + + True + False + Flags + + + 0 + 10 + + + + + True + False + True + True 1 diff --git a/yms/ui/fuses.ui b/yms/ui/fuses.ui index c406b0f..fc0bf05 100644 --- a/yms/ui/fuses.ui +++ b/yms/ui/fuses.ui @@ -157,6 +157,7 @@ True True + @@ -235,7 +236,7 @@ False vertical - + True False Fuse Details @@ -261,6 +262,7 @@ True False True + True 1 @@ -349,6 +351,7 @@ True False Remarks + 0 0 @@ -360,6 +363,7 @@ True False True + True 1 @@ -371,6 +375,7 @@ True False True + True 1 @@ -382,6 +387,7 @@ True False True + True 1 @@ -393,6 +399,9 @@ True False True + True + True + 0 1 @@ -404,6 +413,7 @@ True False True + True 1 @@ -415,6 +425,7 @@ True False True + True 1 @@ -426,6 +437,7 @@ True False True + True 1 @@ -505,7 +517,10 @@ True False + 4 + 4 vertical + 4 True @@ -523,14 +538,19 @@ - + True False + 4 + 8 True False Number + + + 0 @@ -542,6 +562,9 @@ True False Description + + + 0 @@ -553,6 +576,9 @@ True False Type + + + 0 @@ -564,6 +590,9 @@ True False Current + + + 0 diff --git a/yms/ui/inventory.ui b/yms/ui/inventory.ui index 4fa0fb3..82cf922 100644 --- a/yms/ui/inventory.ui +++ b/yms/ui/inventory.ui @@ -388,7 +388,7 @@ True False True - ddd + True 1 @@ -400,6 +400,7 @@ True False True + True 1 @@ -411,6 +412,7 @@ True False True + True 1 @@ -422,6 +424,7 @@ True False True + True 1 @@ -433,6 +436,7 @@ True False True + True 1 @@ -444,6 +448,7 @@ True False True + True 1 @@ -455,6 +460,7 @@ True False True + True 1 @@ -466,6 +472,7 @@ True False True + True 1 @@ -477,6 +484,7 @@ True False True + True 1 @@ -488,6 +496,7 @@ True False True + True 1 @@ -500,6 +509,8 @@ False True True + True + 0 1 @@ -522,6 +533,7 @@ True False True + True 1 @@ -602,6 +614,7 @@ True False vertical + 4 True @@ -622,11 +635,16 @@ True False + 4 + 8 True False Name + + + 0 @@ -638,6 +656,9 @@ True False Type + + + 0 @@ -682,6 +703,9 @@ True False Number + + + 0 diff --git a/yms/ui/maintenance.ui b/yms/ui/maintenance.ui index 0c65cd2..b84196a 100644 --- a/yms/ui/maintenance.ui +++ b/yms/ui/maintenance.ui @@ -127,6 +127,7 @@ True True + @@ -240,6 +241,7 @@ True False True + True 1 @@ -262,6 +264,7 @@ True False True + True 1 @@ -339,6 +342,7 @@ True False Remarks + 0 0 @@ -350,6 +354,7 @@ True False True + True 1 @@ -361,6 +366,7 @@ True False True + True 1 @@ -372,6 +378,7 @@ True False True + True 1 @@ -383,6 +390,7 @@ True False True + True 1 @@ -394,6 +402,7 @@ True False True + True 1 @@ -405,6 +414,7 @@ True False True + True 1 @@ -416,6 +426,9 @@ True False True + True + True + 0 1 @@ -446,6 +459,7 @@ True True 0 + True @@ -494,7 +508,10 @@ True False + 4 + 4 vertical + 4 True @@ -515,11 +532,16 @@ True False + 4 + 8 True False Activities + + + 0 @@ -531,6 +553,9 @@ True False Equipment + + + 0 @@ -629,6 +654,7 @@ True False + True 1 @@ -639,6 +665,7 @@ True True + True 1 @@ -649,6 +676,7 @@ True True + True 1 @@ -659,6 +687,7 @@ True True + True 1 @@ -691,6 +720,7 @@ True False + True 1 diff --git a/yms/ui/measurement.ui b/yms/ui/measurement.ui new file mode 100644 index 0000000..d311e52 --- /dev/null +++ b/yms/ui/measurement.ui @@ -0,0 +1,844 @@ + + + + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + True + False + 8 + + + True + False + vertical + + + True + True + + + + True + False + + + True + False + vertical + start + + + Clear + True + True + True + + + True + True + 0 + + + + + Apply + True + True + True + + + True + True + 1 + + + + + 2 + 0 + 2 + + + + + True + False + Equipment + + + 0 + 0 + + + + + True + False + Text + + + 0 + 1 + + + + + True + False + True + + + 1 + 0 + + + + + True + True + + + 1 + 1 + + + + + + + True + False + Filter Measurement + + + + + False + True + 0 + + + + + True + True + in + + + True + True + + + + + + + + + True + True + 1 + + + + + True + False + end + + + New + True + True + True + + + + True + True + 0 + + + + + Edit + True + True + True + + + + True + True + 1 + + + + + Details + True + True + True + + + + True + True + 2 + + + + + False + True + 2 + + + + + page0 + page0 + + + + + True + False + vertical + + + True + False + Measurement Details + + + + + + False + True + 0 + + + + + + True + False + + + True + False + Name + + + 0 + 0 + + + + + True + False + True + True + + + 1 + 0 + + + + + True + False + Equipment + + + 0 + 1 + + + + + True + False + True + True + + + 1 + 1 + + + + + True + False + Dimensions + + + 0 + 2 + + + + + True + False + Value 1 + + + 0 + 3 + + + + + True + False + Value 2 + + + 0 + 4 + + + + + True + False + Value 3 + + + 0 + 5 + + + + + True + False + Unit + + + 0 + 6 + + + + + True + False + Accuracy + + + 0 + 7 + + + + + True + False + Note + 0 + + + 0 + 9 + + + + + True + False + True + True + + + 1 + 2 + + + + + True + False + True + True + + + 1 + 3 + + + + + True + False + True + True + + + 1 + 4 + + + + + True + False + True + True + + + 1 + 5 + + + + + True + False + True + True + + + 1 + 6 + + + + + True + False + True + True + + + 1 + 7 + + + + + True + False + True + True + True + 0 + + + 1 + 9 + + + + + True + False + Category + + + 0 + 8 + + + + + True + False + True + True + + + 1 + 8 + + + + + True + True + 1 + + + + + True + False + end + + + Delete + True + True + True + + + + True + True + 0 + True + + + + + Edit + True + True + True + + + + True + True + 1 + + + + + Close + True + True + True + + + + True + True + 2 + + + + + False + True + 2 + + + + + page1 + page1 + 1 + + + + + True + False + 4 + 4 + vertical + 4 + + + True + False + Edit Measurement + + + + + + False + True + 0 + + + + + + True + False + 4 + 8 + + + True + False + Name + + + + + + 0 + 0 + + + + + True + False + Dimensions + + + + + + 0 + 1 + + + + + True + False + Value 1 + + + 0 + 2 + + + + + True + False + Value 2 + + + 0 + 3 + + + + + True + False + Value 3 + + + 0 + 4 + + + + + True + False + Accuracy + + + 0 + 5 + + + + + True + False + Date + + + 0 + 6 + + + + + True + False + Equipment + + + 0 + 7 + + + + + True + False + Note + + + 0 + 8 + + + + + True + True + True + + + 1 + 0 + + + + + True + False + True + + + 1 + 1 + + + + + True + True + True + adj_val1 + + + 1 + 2 + + + + + True + True + True + adj_val2 + + + 1 + 3 + + + + + True + True + True + adj_val3 + + + 1 + 4 + + + + + True + True + True + + + 1 + 6 + + + + + True + False + True + + + 1 + 7 + + + + + True + True + True + True + in + + + True + True + + + + + 1 + 8 + + + + + True + False + + + 1 + 5 + + + + + True + True + 1 + + + + + True + False + end + + + Save + True + True + True + + + + True + True + 1 + + + + + Cancel + True + True + True + + + + True + True + 2 + + + + + False + True + 2 + + + + + page2 + page2 + 2 + + + + diff --git a/yms/ui/projects.ui b/yms/ui/projects.ui index fc3f77e..58f32f1 100644 --- a/yms/ui/projects.ui +++ b/yms/ui/projects.ui @@ -165,6 +165,7 @@ True True + @@ -183,12 +184,13 @@ False end - + New but_new True True True + True @@ -197,12 +199,13 @@ - + Edit but_edit True True True + True @@ -211,11 +214,12 @@ - - Delete + + Details True True True + True @@ -343,6 +347,7 @@ True False Remarks + 0 0 @@ -431,6 +436,9 @@ True False True + True + 0 + 0 1 @@ -439,7 +447,7 @@ - False + True True 1 @@ -455,6 +463,7 @@ True True True + True @@ -464,11 +473,12 @@ - + Edit True True True + True @@ -482,6 +492,7 @@ True True True + True @@ -507,12 +518,18 @@ True False + 4 + 4 vertical + 4 True False - label + Edit Project + + + False @@ -525,6 +542,8 @@ True False + 4 + 8 True diff --git a/yms/ui/provisions.ui b/yms/ui/provisions.ui index f1b36b6..4575ef5 100644 --- a/yms/ui/provisions.ui +++ b/yms/ui/provisions.ui @@ -114,7 +114,7 @@ True False - Filter Providions (here selection description) + Filter Provisions @@ -133,6 +133,7 @@ True True + @@ -211,10 +212,13 @@ False vertical - + True False Edit provision + + + False @@ -227,11 +231,16 @@ True False + 4 + 8 True False Name + + + 0 @@ -276,6 +285,9 @@ True False Number + + + 0 @@ -341,6 +353,7 @@ True True + True 1 @@ -351,6 +364,7 @@ True False + True 1 @@ -361,6 +375,7 @@ True False + True 1 @@ -371,6 +386,7 @@ True False + True 1 @@ -381,6 +397,7 @@ True False + True 1 @@ -391,6 +408,7 @@ True True + True 1 @@ -401,6 +419,7 @@ True True + True 1 @@ -411,6 +430,7 @@ True True + True 1 @@ -421,6 +441,7 @@ True True + True 1 @@ -431,6 +452,7 @@ True True + True 1 @@ -497,10 +519,13 @@ False vertical - + True False View Provision + + + False @@ -509,12 +534,12 @@ - + True False - + True False Name @@ -525,7 +550,7 @@ - + True False Category @@ -536,7 +561,7 @@ - + True False Storage @@ -550,7 +575,8 @@ True False - Placeholder + True + True 1 @@ -561,6 +587,8 @@ True False + True + True 1 @@ -571,6 +599,8 @@ True False + True + True 1 @@ -578,7 +608,7 @@ - + True False Box @@ -589,7 +619,7 @@ - + True False Number @@ -600,32 +630,21 @@ - + True False Weight - - 0 - 5 - - - - - True - False - Weight net - 0 6 - + True False - Unit + Weight net 0 @@ -633,10 +652,10 @@ - + True False - Storedate + Unit 0 @@ -644,20 +663,33 @@ - + + True + False + Storedate + + + 0 + 10 + + + + True False Shelflife 0 - 9 + 11 True False + True + True 1 @@ -668,6 +700,8 @@ True False + True + True 1 @@ -678,16 +712,8 @@ True False - - - 1 - 5 - - - - - True - False + True + True 1 @@ -695,9 +721,11 @@ - + True False + True + True 1 @@ -705,25 +733,113 @@ - + True False + True + True 1 8 + + + True + False + True + True + + + 1 + 10 + + True False + True + True + + + 1 + 11 + + + + + True + False + Price + + + 0 + 9 + + + + + True + False + True + True 1 9 + + + True + False + Target + + + 0 + 5 + + + + + True + False + True + True + + + 1 + 5 + + + + + True + False + Remarks + 0 + + + 0 + 12 + + + + + True + False + True + True + True + 0 + + + 1 + 12 + + True @@ -742,11 +858,13 @@ True True True + True True 0 + True @@ -755,6 +873,7 @@ True True True + True @@ -768,6 +887,7 @@ True True True + True diff --git a/yms/ui/storage.ui b/yms/ui/storage.ui index cc3535a..a6920c9 100644 --- a/yms/ui/storage.ui +++ b/yms/ui/storage.ui @@ -152,6 +152,7 @@ True True + @@ -233,7 +234,7 @@ True False - Storage Detais + Storage Details @@ -245,8 +246,8 @@ - - + + True False @@ -265,33 +266,13 @@ True False True + True 1 0 - - - True - False - Remarks - - - 0 - 6 - - - - - True - False - - - 1 - 6 - - True @@ -352,6 +333,7 @@ True False True + True 1 @@ -363,6 +345,7 @@ True False True + True 1 @@ -374,6 +357,7 @@ True False True + True 1 @@ -385,6 +369,7 @@ True False True + True 1 @@ -396,12 +381,63 @@ True False True + True 1 5 + + + True + False + Color + + + 0 + 6 + + + + + True + False + True + True + True + + + 1 + 6 + + + + + True + False + Remarks + 0 + + + 0 + 7 + + + + + True + False + True + True + True + 0 + + + 1 + 7 + + True @@ -475,7 +511,10 @@ True False + 4 + 4 vertical + 4 True @@ -492,15 +531,20 @@ - - + + True False + 4 + 8 True False Name + + + 0 @@ -512,6 +556,9 @@ True False Typ + + + 0 @@ -778,10 +825,11 @@ True False Remarks + 0 0 - 6 + 7 @@ -798,7 +846,7 @@ 1 - 6 + 7 6 @@ -835,6 +883,35 @@ 4 + + + True + False + Color + + + 0 + 6 + + + + + + + + + + + + + + + + + + + + diff --git a/yms/ui/tasks.ui b/yms/ui/tasks.ui new file mode 100644 index 0000000..68ac0a1 --- /dev/null +++ b/yms/ui/tasks.ui @@ -0,0 +1,877 @@ + + + + + + True + False + 8 + + + True + False + vertical + + + True + True + + + + True + False + + + True + False + vertical + start + + + Clear + True + True + True + + + True + True + 0 + + + + + Apply + True + True + True + + + True + True + 1 + + + + + 2 + 0 + 3 + + + + + True + False + Project + + + 0 + 0 + + + + + True + False + Priority + + + 0 + 1 + + + + + True + False + Text + + + 0 + 2 + + + + + True + False + + + 1 + 0 + + + + + True + False + + + 1 + 1 + + + + + True + True + + + 1 + 2 + + + + + True + False + Status + + + 0 + 3 + + + + + True + False + + + pending + True + True + False + True + + + False + True + 0 + + + + + active + True + True + False + True + + + False + True + 1 + + + + + waiting + True + True + False + True + + + False + True + 2 + + + + + deleted + True + True + False + True + + + False + True + 3 + + + + + completed + True + True + False + True + + + False + True + 4 + + + + + 1 + 3 + + + + + + + + + + True + False + Filter Tasks + + + + + False + True + 0 + + + + + True + True + in + + + True + True + + + + + + + + + True + True + 1 + + + + + True + False + end + + + New + True + True + True + + + + True + True + 0 + + + + + Edit + True + True + True + + + + True + True + 1 + + + + + Details + True + True + True + + + + True + True + 2 + + + + + False + True + 2 + + + + + page0 + page0 + + + + + True + False + vertical + + + True + False + Task Details + + + + + + False + True + 0 + + + + + + True + False + + + True + False + Name + + + 0 + 0 + + + + + True + False + True + True + + + 1 + 0 + + + + + True + False + Priority + + + 0 + 1 + + + + + True + False + Status + + + 0 + 2 + + + + + True + False + Timestamp + + + 0 + 3 + + + + + True + False + True + True + + + 1 + 1 + + + + + True + False + True + True + + + 1 + 2 + + + + + True + False + True + True + + + 1 + 3 + + + + + True + False + Plan date + + + 0 + 4 + + + + + True + False + Due date + + + 0 + 5 + + + + + True + False + Started + + + 0 + 6 + + + + + True + False + True + True + + + 1 + 4 + + + + + True + False + True + True + + + 1 + 5 + + + + + True + False + True + True + + + 1 + 6 + + + + + True + False + Remarks + 0 + + + 0 + 9 + + + + + True + False + True + True + True + 0 + + + 1 + 9 + + + + + True + False + Finished + + + 0 + 7 + + + + + True + False + True + True + + + 1 + 7 + + + + + True + False + Responsible + + + 0 + 8 + + + + + True + False + True + True + + + 1 + 8 + + + + + True + True + 1 + + + + + True + False + end + + + Delete + True + True + True + + + + True + True + 0 + True + + + + + Edit + True + True + True + + + + True + True + 1 + + + + + Close + True + True + True + + + + True + True + 2 + + + + + False + True + 2 + + + + + page1 + page1 + 1 + + + + + True + False + 4 + 4 + vertical + + + True + False + Edit Task + + + + + + False + True + 0 + + + + + + True + False + 4 + 8 + + + True + False + Name + + + 0 + 0 + + + + + True + True + True + + + 1 + 0 + + + + + True + False + Responsible + + + 0 + 6 + + + + + True + False + Remarks + 0 + + + 0 + 7 + + + + + True + True + False + False + in + + + True + True + + + + + 1 + 7 + + + + + True + False + + + 1 + 6 + + + + + True + True + + + 1 + 3 + + + + + True + False + + + 1 + 1 + + + + + True + False + Project + + + 0 + 1 + + + + + True + False + Priority + + + 0 + 2 + + + + + True + False + + + 1 + 2 + + + + + True + False + Plan Date + + + 0 + 3 + + + + + + + + + + + + + + + + + True + True + 1 + + + + + True + False + end + + + Save + True + True + True + + + + True + True + 1 + + + + + Cancel + True + True + True + + + + True + True + 2 + + + + + False + True + 2 + + + + + page2 + page2 + 2 + + + + diff --git a/yms/view/base.py b/yms/view/base.py index 24e5a12..ebea177 100644 --- a/yms/view/base.py +++ b/yms/view/base.py @@ -7,23 +7,35 @@ Notebook mit Vessel, User, Lists, Settings """ import os +import pyudev from gi.repository import GLib, Gtk, Gdk, Rsvg +from datetime import datetime +import subprocess +import locale from .view import View from yms import gtkutils, combobox, treeview from yms.lookup import Dropdown +from yms.model import user class BaseView(View): def __init__(self, context): super().__init__(context, _("Base Data"), "base.ui") - #self.title = _("Base Data") - #builder = Gtk.Builder() - #builder.set_translation_domain(context.textdomain) - #builder.add_from_file(os.path.join(context.ui_path, "base.ui")) - #builder.connect_signals(self) - #self.topwidget = builder.get_object("topobject") - #gtkutils.init_named_controls(self, builder) + self.context = context + + self.user = user.User(context.db) # current user record + self.newuser = False + + self.backupdevice = None # USB-Stick detected only on demand + + # Settings + self.sys_currency = context.db.load_setting(4)[0] or '€' + self.entry['sys_currency'].set_text(self.sys_currency) + self.sys_max_width = context.db.load_setting(20)[1] or 1024 + self.spin['sys_max_width'].set_value(self.sys_max_width) + self.sys_max_height = context.db.load_setting(21)[1] or 768 + self.spin['sys_max_height'].set_value(self.sys_max_height) # combos roles = {'captain': 'Captain', 'helmsman': 'Helmsman', 'sailor': 'Sailor'} @@ -31,6 +43,14 @@ class BaseView(View): langs = {'de': 'Deutsch', 'en': 'English'} combobox.load_from_dict(self.combo['user_lang'], langs) + today = datetime.now() + datedict = { + key: f"{prefix} - {today.strftime(fmt)}" + for key, (fmt, prefix) in context.datefmt_map.items() + } + self.datefmt = context.db.load_setting(2)[0] or 'Y-m-d' + combobox.load_from_dict(self.combo['datefmt'], datedict, self.datefmt) + # shipyard self.db.cur.execute("SELECT compid, compname FROM company WHERE comptype=3 ORDER BY compname") shipyards = dict(self.db.cur.fetchall()) @@ -129,6 +149,132 @@ class BaseView(View): storages = dict(self.db.cur.fetchall()) combobox.refresh_dict(self.combo['storage'], {-1: _("─── none ───")} | storages) + def find_usb_sticks(self): + result = [] + for name in os.listdir("/sys/block"): + device = "/sys/block/" + name + removable = device + "/removable" + if not os.path.exists(removable): + continue + with open(removable) as f: + if f.read().strip() != "1": + continue + device_path = os.path.realpath(device + "/device") + if "/usb" in device_path.lower(): + result.append(name) + return result + + def is_mounted(self, device): + with open("/proc/mounts") as f: + for line in f: + mounted_device = line.split()[0] + if mounted_device == device: + return True + return False + + def on_but_usbdevice_clicked(self, widget): + self.backupdevice = None + + devlist = self.find_usb_sticks() + if len(devlist) == 0: + self.label['usb_device'].set_text('n/a') + return + if len(devlist) != 1: + print(devlist) + print("Multiple devices not supported yet") + self.label['usb_device'].set_text('multiple') + return + usbdev = devlist[0] + self.label['usb_device'].set_text(f"/dev/{usbdev}") + + """ + serial number via python3-pyudev: + import pyudev + + Settings + 7 - usb backup device serial + 8 - usb backup partition uuid + 9 - last backup timestamp + + """ + # first get stick hardware data + udevctx = pyudev.Context() + device = pyudev.Devices.from_sys_path(udevctx, os.path.join("/sys/class/block", usbdev)) + + serial = device.get("ID_SERIAL_SHORT") + vendor = device.get("ID_VENDOR") + model = device.get("ID_MODEL") + self.label['usb_serial'].set_text(serial or 'n/a') + self.label['usb_vendor'].set_text(vendor or 'n/a') + self.label['usb_model'].set_text(model or 'n/a') + + # TODO second get partition, filesystem type and label + # there must be only one ext4 partition on disk + partitions = [ + child for child in device.children + if child.device_type == "partition" + ] + partition = partitions[0] + print(f"Partition={partition}") + if len(partitions) != 1: + print("error: more than one partition!") + return + + partuuid = partition.properties.get("ID_PART_ENTRY_UUID") + fstype = partition.get("ID_FS_TYPE") + plabel = partition.get("ID_FS_LABEL") + self.label['usb_partition'].set_text(plabel) + self.label['usb_uuid'].set_text(partuuid) + self.label['usb_fstype'].set_text(fstype) + + if fstype != "ext4": + print(f"error: invalid fileystem type {fstype}, ext4 expected") + return + + self.backupdevice = f"/dev/{usbdev}1" # partition! + + # check if device is mounted + if not self.is_mounted(self.backupdevice): + print("device is not mounted. trying to mount now") + pass + + # For backup there must be an directory names ymsbackup which contains + # backup description and backup sets + # Desription and identification file backup.json? + # if plabel != 'BACKUP' or not os.path.isdir('ymsbackup') + mountpoint = os.path.join("/media", os.getlogin(), "BACKUP") + if not os.path.isdir(mountpoint): + print(f"Device is not mounted at {mountpoint}") + + def on_but_usbinit_clicked(self, widget): + if self.backupdevice is None: + return + # UUID of devive -> settings + # check if backups already exist + answer = gtkutils.questionbox( + _("Initialize USB-Stick\n" + "All data on that device will be lost!\n" + "Are you really sure?" + ), title="YMS") + if answer == False: + return + if self.label['usb_fstype'].get_text() != 'ext4': + print("formatting {self.backupdevice} with ext4") + #try: + # subprocess.run(["sudo", "mkfs.ext4", "-L", "BACKUP", self.backupdevice], check=True) + #except subprocess.CalledProcessError as e: + # print("formatting failed: ", e) + myself = os.getlogin() + mountpoint = os.path.join("/media", myself, "backup") + basedir = os.path.join(mountpoint, 'ymsbackup') + print(basedir) + # mkdir basedir + # chown (os.getlogin(), 'yms') + # chmod 770 + else: + # + pass + def on_cmb_vessel_changed(self, widget): self.context.vessel.load(combobox.get_list_value(widget)) sql = ("UPDATE settings SET valint=%s WHERE userid=0 AND sno=1") @@ -189,7 +335,20 @@ class BaseView(View): def display_vessel(self, vessel): self.label['vesselname'].set_text(vessel.vesselname) self.label['model'].set_text(vessel.model or '') - self.label['year_built'].set_text(self.format_int(vessel.year_built, default='n/a')) + self.label['shipyard'].set_text(str(vessel.shipyard)) + self.label['year_built'].set_text(self.format_int(vessel.year_built, False, default='n/a')) + self.label['loa'].set_text(self.format_float(vessel.loa, 2, suffix="m")) + self.label['lwl'].set_text(self.format_float(vessel.lwl, 2, suffix="m")) + self.label['beam'].set_text(self.format_float(vessel.beam, 2, suffix="m")) + self.label['draught'].set_text(self.format_float(vessel.draught, 2, suffix="m")) + self.label['draught_min'].set_text(self.format_float(vessel.draught_min, 2, suffix="m")) + self.label['displacement'].set_text(self.format_int(vessel.displacement, 2, suffix="kg")) + self.label['ballast'].set_text(self.format_int(vessel.ballast, 2, suffix="kg")) + self.label['belt_bow'].set_text(self.format_float(vessel.beltpos_bow, 2, suffix="m")) + self.label['belt_aft'].set_text(self.format_float(vessel.beltpos_aft, 2, suffix="m")) + self.label['hull_shape'].set_text(vessel.shapefile or '') + self.label['storage_def'].set_text(str(vessel.sid_default)) + self.label['remarks'].set_text(vessel.remarks or '') def edit_vessel(self, vessel): self.entry['vesselname'].set_text(vessel.vesselname) diff --git a/yms/view/boxes.py b/yms/view/boxes.py index 2b95bb8..52e2d15 100644 --- a/yms/view/boxes.py +++ b/yms/view/boxes.py @@ -5,12 +5,14 @@ from gi.repository import GLib, Gtk, Gdk from .view import View from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown from yms.model import box class BoxesView(View): def __init__(self, context): - super().__init__(context, _("Box"), "boxes.ui") + super().__init__(context, _("Boxes"), "boxes.ui") + self.context = context # box already used for controls so other name here self.sbox = box.Box(context.db) # current record @@ -33,12 +35,33 @@ class BoxesView(View): treeview.add_column(self.tree['box'], _('Remarks'), 3) self.tree['box'].set_model(self.lst_box) + self.dd_boxtype = self.context.lookup.dropdown(Dropdown.BOX_TYPE) + combobox.load_from_dict(self.combo['type'], self.dd_boxtype) def load_list(self): pass + def clear_record(self): + self.entry['label'].set_text('') + self.entry['content'].set_text('') + self.spin['wx'].set_value(0) + self.spin['wy'].set_value(0) + self.spin['wz'].set_value(0) + self.text['remarks'].get_buffer().set_text('') + def display_record(self): self.label['label'].set_text(self.sbox.label) + # storage sid + self.label['content'].set_text(self.sbox.content or '') + self.label['type'].set_text(self.dd_boxtype[self.sbox.boxtype]) + self.label['color'].set_text(self.sbox.color or '') + if self.sbox.color: + self.label['color'].set_markup(f'#{self.sbox.color} ●') + else: + self.label['color'].set_text('') + self.label['weight'].set_text(self.format_float(self.sbox.weight, 2, suffix='kg')) + self.label['weight_net'].set_text(self.format_float(self.sbox.weight_net, 2, suffix='kg')) + self.label['price'].set_text(self.format_float(self.sbox.price, 2, suffix='€')) self.label['remarks'].set_text(self.sbox.remarks or '') def edit_record(self): @@ -64,14 +87,27 @@ class BoxesView(View): self.topwidget.set_visible_child(self.box['box_edit']) def on_but_detail_clicked(self, widget): - sid = treeview.get_value(self.tree['box'], 0) - self.sbox.load(sid) + boxid = treeview.get_value(self.tree['box'], 0) + if not boxid: + return + self.sbox.load(boxid) self.display_record() self.topwidget.set_visible_child(self.box['box_detail']) + self.button['close'].grab_focus() + + def on_tvw_box_row_activated(self, widget, path, column): + boxid = treeview.get_value(widget, 0) + self.sbox.load(boxid) + self.display_record() + self.topwidget.set_visible_child(self.box['box_detail']) + self.button['close'].grab_focus() # buttons on detail page # edit2 uses edit callback def on_but_close_clicked(self, widget): + boxid = treeview.get_value(self.tree['box'], 0) + if not boxid: + return self.topwidget.set_visible_child(self.box['box']) def on_but_delete_clicked(self, widget): diff --git a/yms/view/cables.py b/yms/view/cables.py index f227958..3586635 100644 --- a/yms/view/cables.py +++ b/yms/view/cables.py @@ -5,6 +5,7 @@ from gi.repository import Gtk from .view import View from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown from yms.model import cable class CablesView(View): @@ -36,6 +37,9 @@ class CablesView(View): treeview.add_column(self.tree['cables'], _('Condition'), 2) self.tree['cables'].set_model(self.lst_cables) + self.dd_type = self.context.lookup.dropdown(Dropdown.CABLE_TYPE) + self.dd_tech = self.context.lookup.dropdown(Dropdown.CABLE_TECHNAME) + # buttons on list page def on_but_new_clicked(self, widget): self.topwidget.set_visible_child(self.box['cable_edit']) @@ -44,8 +48,20 @@ class CablesView(View): self.topwidget.set_visible_child(self.box['cable_edit']) def on_but_detail_clicked(self, widget): + cableid = treeview.get_value(self.tree['cables'], 0) + if not cableid: + return + self.cable.load(cableid) + self.display_record() self.topwidget.set_visible_child(self.box['cable_detail']) + self.button['close'].grab_focus() + def on_tvw_cables_row_activated(self, widget, path, column): + cableid = treeview.get_value(widget, 0) + self.cable.load(cableid) + self.display_record() + self.topwidget.set_visible_child(self.box['cable_detail']) + # buttons on detail page # edit2 uses edit callback def on_but_close_clicked(self, widget): @@ -62,7 +78,25 @@ class CablesView(View): self.topwidget.set_visible_child(self.box['cables']) def display_record(self): - pass + self.label['name'].set_text(self.cable.cablename) + self.label['type'].set_text(self.dd_type[self.cable.cabletype]) + if self.cable.techname: + self.label['techname'].set_text(self.dd_tech[self.cable.techname]) + else: + self.label['techname'].set_text('') + self.label['length'].set_text(self.format_int(self.cable.length)) + self.label['conductors'].set_text(self.format_int(self.cable.conductors)) + self.label['diameter'].set_text(self.format_float(self.cable.diameter, 1)) + self.label['xsection'].set_text(self.format_float(self.cable.xsection, 1)) + self.label['weight'].set_text(self.format_float(self.cable.weight)) + if self.cable.color: + self.label['color'].set_markup(f'#{self.cable.color} ●') + else: + self.label['color'].set_text('') + self.label['supplier'].set_text(str(self.cable.supplier)) + self.label['manufacturer'].set_text(str(self.cable.manufacturer)) + self.label['condition'].set_text(self.cable.cablecond) + self.label['remarks'].set_text(self.cable.remarks or '') def edit_record(self): pass diff --git a/yms/view/companies.py b/yms/view/companies.py index 8521984..1861c35 100644 --- a/yms/view/companies.py +++ b/yms/view/companies.py @@ -5,12 +5,14 @@ from gi.repository import Gtk from .view import View from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown from yms.model import company class CompaniesView(View): def __init__(self, context): super().__init__(context, _("Companies"), "companies.ui") + self.context = context self.comp = company.Company(context.db) # current record self.newrecord = False @@ -20,7 +22,13 @@ class CompaniesView(View): self.comptype = dict(self.db.cur.fetchall()) combobox.load_from_dict(self.combo['flt_type'], {-2: _("─── all ───")} | self.comptype, -2) - # companied + self.dd_comptype = self.context.lookup.dropdown(Dropdown.COMPANY_TYPE) + combobox.load_from_dict(self.combo['comptype'], self.dd_comptype) + combobox.load_from_dict(self.combo['comptype2'], self.dd_comptype) + + self.dd_flags = context.lookup.enum('company.flags') + + # companies self.lst_companies = Gtk.ListStore(int, str, str, str) self.db.cur.execute("SELECT compid, compname, comptype, remarks FROM company ORDER BY compname") for row in self.db.cur.fetchall(): @@ -31,30 +39,77 @@ class CompaniesView(View): treeview.add_column(self.tree['companies'], _('Remarks'), 3) self.tree['companies'].set_model(self.lst_companies) - def display_company(self, company): - self.entry['compname'].set_text(company.compname) - # Type - # Type2 - self.entry['shortname'].set_text(company.shortname) - self.entry['street'].set_text(company.street) - self.entry['zip'].set_text(company.zip) - self.entry['city'].set_text(company.city) - self.entry['country'].set_text(company.country) - self.entry['contact'].set_text(company.contact) - self.entry['phone'].set_text(company.phone) - self.entry['email'].set_text(company.email) - self.entry['web'].set_text(company.web) - self.entry['customerno'].set_text(company.customerno) - self.entry['contractno'].set_text(company.contractno) + def clear_record(self): + self.entry['name'].set_text('') + self.entry['shortname'].set_text('') + self.entry['street'].set_text('') + self.entry['zip'].set_text('') + self.entry['city'].set_text('') + self.entry['country'].set_text('') + self.entry['contact'].set_text('') + self.entry['phone'].set_text('') + self.entry['email'].set_text('') + self.entry['web'].set_text('') + self.entry['customerno'].set_text('') + self.entry['contractno'].set_text('') + combobox.activate_row(self.combo['comptype'], -1) + combobox.activate_row(self.combo['comptype2'], -1) + + def display_record(self): + self.label['name'].set_text(self.comp.compname) + self.label['shortname'].set_text(self.comp.shortname or '') + self.label['type'].set_text(self.dd_comptype.get(self.comp.comptype, '')) + self.label['type2'].set_text(self.dd_comptype.get(self.comp.comptype2, '')) + self.label['street'].set_text(self.comp.street or '') + 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['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 '') + 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) + 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 '') + self.entry['city'].set_text(self.comp.city or '') + self.entry['country'].set_text(self.comp.country or '') + self.entry['contact'].set_text(self.comp.contact or '') + self.entry['phone'].set_text(self.comp.phone or '') + self.entry['email'].set_text(self.comp.email or '') + 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 '') # buttons on list page def on_but_new_clicked(self, widget): self.topwidget.set_visible_child(self.box['comp_edit']) def on_but_edit_clicked(self, widget): + compid = treeview.get_value(self.tree['companies'], 0) + if not compid: + return self.topwidget.set_visible_child(self.box['comp_edit']) def on_but_detail_clicked(self, widget): + compid = treeview.get_value(self.tree['companies'], 0) + if not compid: + return + self.comp.load(compid) + self.display_record() + self.topwidget.set_visible_child(self.box['comp_detail']) + + def on_tvw_companies_row_activated(self, widget, path, column): + compid = treeview.get_value(widget, 0) + self.comp.load(compid) + self.display_record() self.topwidget.set_visible_child(self.box['comp_detail']) # buttons on detail page diff --git a/yms/view/documents.py b/yms/view/documents.py index 6f15616..98d819c 100644 --- a/yms/view/documents.py +++ b/yms/view/documents.py @@ -1,7 +1,8 @@ # SPDX-License-Identifier: WTFPL import os -from gi.repository import GLib, Gtk, Gdk +from gi.repository import GLib, Gtk, Gdk, GdkPixbuf, Rsvg +import fitz from .view import View from yms import gtkutils, combobox, treeview @@ -11,6 +12,7 @@ class DocumentsView(View): def __init__(self, context): super().__init__(context, _("Documents"), "documents.ui") + self.context = context self.doc = document.Document(context.db) # current record self.newrecord = False @@ -41,7 +43,18 @@ class DocumentsView(View): self.topwidget.set_visible_child(self.box['doc_edit']) def on_but_detail_clicked(self, widget): + docid = treeview.get_value(self.tree['documents'], 0) + self.doc.load(docid) + self.display_record() self.topwidget.set_visible_child(self.box['doc_detail']) + self.button['close'].grab_focus() + + def on_tvw_documents_row_activated(self, widget, path, column): + docid = treeview.get_value(widget, 0) + self.doc.load(docid) + self.display_record() + self.topwidget.set_visible_child(self.box['doc_detail']) + self.button['close'].grab_focus() # buttons on detail page # edit2 uses edit callback @@ -58,8 +71,68 @@ class DocumentsView(View): def on_but_cancel_clicked(self, widget): self.topwidget.set_visible_child(self.box['documents']) + def pdf_to_pixbuf(self, filename, max_width=400, max_height=400): + doc = fitz.open(filename) + page = doc[0] + rect = page.rect + scale = min(max_width / rect.width, max_height / rect.height) + matrix = fitz.Matrix(scale, scale) + pix = page.get_pixmap(matrix=matrix, alpha=False) + pixbuf = GdkPixbuf.Pixbuf.new_from_data( + pix.samples, + GdkPixbuf.Colorspace.RGB, + pix.alpha, + 8, + pix.width, + pix.height, + pix.stride, + None, + None + ) + return pixbuf + def display_record(self): - pass + print(self.doc) + self.label['title'].set_text(self.doc.title or '') + self.label['filename'].set_text(self.doc.filename) + # self.label['extents'] -> see below + self.label['mimetype'].set_text(self.doc.mimetype) + self.label['filesize'].set_text(self.format_int(self.doc.docsize, suffix="Byte")) + self.label['date'].set_text(self.format_date(self.doc.docdate)) + self.label['doctype'].set_text(self.doc.doctype) + self.label['roleaccess'].set_text(self.doc.roleaccess) + self.label['doctype'].set_text(self.doc.remarks or '') + + # image preview + if self.doc.doctype == 'picture': + filename = f"pic-{self.doc.pk_value:06d}.{self.doc.extension}" + imgpath = os.path.join(self.context.cfg['docpath'], filename) + info = GdkPixbuf.Pixbuf.get_file_info(imgpath) + if info: + imgformat, imgwidth, imgheight = info + self.label['extents'].set_text(f"{imgwidth}x{imgheight} Pixel") + if imgwidth > 400 or imgheight > 400: + print("loading scaled") + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(imgpath, 400, 400, True) + else: + print("loading") + pixbuf = GdkPixbuf.Pixbuf.new_from_file(imgpath) + else: + print("cannot get image info") + self.image['preview'].set_from_pixbuf(pixbuf) + elif self.doc.doctype == 'drawing': + filename = f"drw-{self.doc.pk_value:06d}.{self.doc.extension}" + imgpath = os.path.join(self.context.cfg['docpath'], filename) + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(imgpath, 400, 400, True) + self.image['preview'].set_from_pixbuf(pixbuf) + elif self.doc.mimetype == "application/pdf": + filename = f"doc-{self.doc.pk_value:06d}.{self.doc.extension}" + imgpath = os.path.join(self.context.cfg['docpath'], filename) + print(imgpath) + pixbuf = self.pdf_to_pixbuf(imgpath) + self.image['preview'].set_from_pixbuf(pixbuf) + else: + self.image['preview'].clear() def edit_record(self): pass diff --git a/yms/view/equipment.py b/yms/view/equipment.py index 0d34223..180c309 100644 --- a/yms/view/equipment.py +++ b/yms/view/equipment.py @@ -5,12 +5,14 @@ from gi.repository import GLib, Gtk, Gdk from .view import View from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown from yms.model import equipment class EquipmentView(View): def __init__(self, context): super().__init__(context, _("Equipment"), "equipment.ui") + self.context = context self.equip = equipment.Equipment(context.db) # current record self.newrecord = False @@ -36,11 +38,19 @@ class EquipmentView(View): treeview.add_column(self.tree['equipment'], _('Remarks'), 6) self.tree['equipment'].set_model(self.lst_equipment) + self.dd_category = self.context.lookup.dropdown(Dropdown.EQUIPMENT_CATEGORY) + #combobox.load_from_dict(self.combo['unit'], self.dd_unit) + # buttons on list page def on_but_new_clicked(self, widget): + self.newrecord = True + self.label['title_editor'].set_text(_("Add new Equipment")) + self.clear_record() + self.equip.vid = self.context.vessel.vid self.topwidget.set_visible_child(self.box['equip_edit']) def on_but_edit_clicked(self, widget): + self.label['title_edit'].set_text(_("Edit Equipment")) self.topwidget.set_visible_child(self.box['equip_edit']) def on_but_detail_clicked(self, widget): @@ -48,6 +58,7 @@ class EquipmentView(View): self.equip.load(eid) self.display_record() self.topwidget.set_visible_child(self.box['equip_detail']) + self.button['close'].grab_focus() def on_tvw_equipment_row_activated(self, widget, path, column): eid = treeview.get_value(widget, 0) @@ -72,7 +83,17 @@ class EquipmentView(View): def display_record(self): print(self.equip) - #self.label['name'].set_text(self.equip.sname) + self.label['name'].set_text(self.equip.ename) + self.label['shortname'].set_text(self.equip.shortname or '') + #lookup self.label['manufacturer'].set_text(self.equip.manufacturer) + self.label['model'].set_text(self.equip.model or '') + self.label['serial'].set_text(self.equip.serial or '') + self.label['weight'].set_text(self.format_float(self.equip.weight, 2, suffix='kg')) + self.label['price'].set_text(self.format_float(self.equip.price, 2, suffix='€')) + self.label['date_purch'].set_text(self.equip.purchdate or '') + #lookup self.label['supplier'].set_text(self.equip.supplier) + self.label['category'].set_text(self.dd_category[self.equip.ecat]) + self.label['flags'].set_text(self.equip.flags or '') self.label['remarks'].set_text(self.equip.remarks or '') def edit_record(self): diff --git a/yms/view/fuses.py b/yms/view/fuses.py index b1f8dcd..bbddd89 100644 --- a/yms/view/fuses.py +++ b/yms/view/fuses.py @@ -5,6 +5,7 @@ from gi.repository import Gtk from .view import View from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown from yms.model import fuse class FusesView(View): @@ -38,6 +39,8 @@ class FusesView(View): treeview.add_column(self.tree['fuses'], _('Description'), 3) self.tree['fuses'].set_model(self.lst_fuses) + self.dd_type = self.context.lookup.dropdown(Dropdown.FUSE_TYPE) + # buttons on list page def on_but_new_clicked(self, widget): self.topwidget.set_visible_child(self.box['fuse_edit']) @@ -46,7 +49,20 @@ class FusesView(View): self.topwidget.set_visible_child(self.box['fuse_edit']) def on_but_detail_clicked(self, widget): + fuseid = treeview.get_value(self.tree['fuses'], 0) + if not fuseid: + return + self.fuse.load(fuseid) + self.display_record() self.topwidget.set_visible_child(self.box['fuse_detail']) + self.button['close'].grab_focus() + + def on_tvw_fuses_row_activated(self, widget, path, column): + fuseid = treeview.get_value(widget, 0) + self.fuse.load(fuseid) + self.display_record() + self.topwidget.set_visible_child(self.box['fuse_detail']) + self.button['close'].grab_focus() # buttons on detail page # edit2 uses edit callback @@ -64,7 +80,14 @@ class FusesView(View): self.topwidget.set_visible_child(self.box['fuses']) def display_record(self): - pass + self.label['fnumber'].set_text(f"F{self.fuse.fnumber}") + self.label['type'].set_text(self.dd_type[self.fuse.ftype]) + self.label['current'].set_text(self.format_float(self.fuse.current, 2, suffix="A")) + self.label['cable'].set_text(str(self.fuse.cableid)) + self.label['equipment'].set_text(str(self.fuse.eid)) + self.label['location'].set_text(str(self.fuse.location)) + self.label['description'].set_text(str(self.fuse.description or '')) + self.label['remarks'].set_text(str(self.fuse.remarks or '')) def edit_record(self): pass diff --git a/yms/view/inventory.py b/yms/view/inventory.py index 81f3c34..ab7bbda 100644 --- a/yms/view/inventory.py +++ b/yms/view/inventory.py @@ -5,6 +5,7 @@ from gi.repository import GLib, Gtk, Gdk from .view import View from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown from yms.model import inventory class InventoryView(View): @@ -39,6 +40,8 @@ class InventoryView(View): treeview.add_column(self.tree['inventory'], _('Remarks'), 5) self.tree['inventory'].set_model(self.lst_inventory) + self.dd_category = self.context.lookup.dropdown(Dropdown.INVENTORY_CATEGORY) + # buttons on list page def on_but_new_clicked(self, widget): self.topwidget.set_visible_child(self.box['inv_edit']) @@ -51,6 +54,7 @@ class InventoryView(View): self.inv.load(invid) self.display_record() self.topwidget.set_visible_child(self.box['inv_detail']) + self.button['close'].grab_focus() def on_tvw_inventory_row_activated(self, widget, path, column): invid = treeview.get_value(widget, 0) @@ -85,6 +89,10 @@ class InventoryView(View): self.label['price'].set_text(self.format_float(self.inv.price, suffix='€')) self.label['purchdate'].set_text(self.format_date(self.inv.purchdate)) self.label['condition'].set_text(self.inv.invcond) + if self.inv.icat is not None: + self.label['category'].set_text(self.dd_category[self.inv.icat]) + else: + self.label['category'].set_text('') self.label['remarks'].set_text(self.inv.remarks or '') def edit_record(self): diff --git a/yms/view/maintenance.py b/yms/view/maintenance.py index ef69c0d..8311ce7 100644 --- a/yms/view/maintenance.py +++ b/yms/view/maintenance.py @@ -40,7 +40,20 @@ class MaintenanceView(View): self.topwidget.set_visible_child(self.box['maint_edit']) def on_but_detail_clicked(self, widget): - self.topwidget.set_visible_child(self.box['maintv_detail']) + maintid = treeview.get_value(self.tree['maintenance'], 0) + if not maintid: + return + self.maint.load(maintid) + self.display_record() + self.topwidget.set_visible_child(self.box['maint_detail']) + self.button['close'].grab_focus() + + def on_tvw_maintenance_row_activated(self, widget, path, column): + maintid = treeview.get_value(widget, 0) + self.maint.load(maintid) + self.display_record() + self.topwidget.set_visible_child(self.box['maint_detail']) + self.button['close'].grab_focus() # buttons on detail page # edit2 uses edit callback @@ -58,7 +71,16 @@ class MaintenanceView(View): self.topwidget.set_visible_child(self.box['maintenance']) def display_record(self): - pass + self.label['activities'].set_text(self.maint.activities) + self.label['equipment'].set_text(str(self.maint.eid)) + self.label['series'].set_text(str(self.maint.series)) + self.label['interval'].set_text(self.format_int(self.maint.interval_hours)) + self.label['last'].set_text(self.format_int(self.maint.last_hours)) + self.label['plandate'].set_text(self.format_date(self.maint.plan_date)) + self.label['completion'].set_text(self.format_date(self.maint.completion_date)) + self.label['status'].set_text(self.maint.maintstate) + self.label['remarks'].set_text(self.maint.remarks or '') + def edit_record(self): pass diff --git a/yms/view/measurement.py b/yms/view/measurement.py new file mode 100644 index 0000000..e84ec44 --- /dev/null +++ b/yms/view/measurement.py @@ -0,0 +1,102 @@ +# SPDX-License-Identifier: WTFPL + +import os +from gi.repository import Gtk + +from .view import View +from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown +from yms.model import measurement + +class MeasurementView(View): + + def __init__(self, context): + super().__init__(context, _("Measurements"), "measurement.ui") + + self.measure = measurement.Measurement(context.db) # current record + self.newrecord = False + + # measurement units + self.dd_unit = self.context.lookup.dropdown(Dropdown.UNIT) + + self.lst_measurement = Gtk.ListStore(int, str, str, str, str, str) + sql = ( + "SELECT m.mid, m.mname, m.nval, m.val1, m.val2, m.val3, m.unit, " + "m.accuracy, m.note, e.ename " + "FROM measurement AS m LEFT OUTER JOIN equipment AS e USING (eid) " + "WHERE m.vid=%s " + "ORDER BY m.mid" + ) + self.db.dcur.execute(sql, (context.vessel.vid,)) + for row in self.db.dcur.fetchall(): + if row['nval'] == 1: + value = "{} {}".format(row['val1'], row['unit']) + elif row['nval'] == 2: + value = "{}x{} {}".format(row['val1'], row['val2'], row['unit']) + elif row['nval'] == 3: + value = "{}x{}x{} {}".format(row['val1'], row['val2'], row['val3'], row['unit']) + else: + #invalid + value = "#invalid" + data = ( + row['mid'], + row['mname'], + value, + row['accuracy'], + row['ename'], + row['note'] or '' + ) + self.lst_measurement.append(data) + + treeview.add_column(self.tree['measurement'], _('ID'), 0) + treeview.add_column(self.tree['measurement'], _('Measurement'), 1) + treeview.add_column(self.tree['measurement'], _('Value'), 2) + treeview.add_column(self.tree['measurement'], _('Accuracy'), 3) + treeview.add_column(self.tree['measurement'], _('Equipment'), 4) + treeview.add_column(self.tree['measurement'], _('Note'), 5) + self.tree['measurement'].set_model(self.lst_measurement) + + # buttons on list page + def on_but_new_clicked(self, widget): + self.topwidget.set_visible_child(self.box['measure_edit']) + + def on_but_edit_clicked(self, widget): + self.topwidget.set_visible_child(self.box['measure_edit']) + + def on_but_detail_clicked(self, widget): + mid = treeview.get_value(self.tree['measurement'], 0) + if not mid: + return + self.measure.load(mid) + self.display_record() + self.topwidget.set_visible_child(self.box['measure_detail']) + self.button['close'].grab_focus() + + def on_tvw_measurement_row_activated(self, widget, path, column): + mid = treeview.get_value(widget, 0) + self.measure.load(mid) + self.display_record() + self.topwidget.set_visible_child(self.box['measure_detail']) + self.button['close'].grab_focus() + + # buttons on detail page + # edit2 uses edit callback + def on_but_close_clicked(self, widget): + self.topwidget.set_visible_child(self.box['measurement']) + + def on_but_delete_clicked(self, widget): + self.topwidget.set_visible_child(self.box['measurement']) + + # buttons on edit page + def on_but_save_clicked(self, widget): + pass + + def on_but_cancel_clicked(self, widget): + self.topwidget.set_visible_child(self.box['measurement']) + + def display_record(self): + self.label['name'].set_text(self.measure.mname) + self.label['note'].set_text(self.measure.note or '') + + def edit_record(self): + pass diff --git a/yms/view/projects.py b/yms/view/projects.py index 485c561..fba0beb 100644 --- a/yms/view/projects.py +++ b/yms/view/projects.py @@ -11,6 +11,7 @@ class ProjectsView(View): def __init__(self, context): super().__init__(context, _("Projects"), "projects.ui") + self.context = context self.project = project.Project(context.db) # current record self.newrecord = False @@ -42,6 +43,9 @@ class ProjectsView(View): treeview.add_column(self.tree['projects'], _('Remarks'), 5) self.tree['projects'].set_model(self.lst_projects) + self.dd_user = context.lookup.user() + self.dd_state = self.context.lookup.enum('project.projstate') + # buttons on list page def on_but_new_clicked(self, widget): self.topwidget.set_visible_child(self.box['proj_edit']) @@ -50,7 +54,20 @@ class ProjectsView(View): self.topwidget.set_visible_child(self.box['proj_edit']) def on_but_detail_clicked(self, widget): + projid = treeview.get_value(self.tree['projects'], 0) + if not projid: + return + self.project.load(projid) + self.display_record() self.topwidget.set_visible_child(self.box['proj_detail']) + self.button['close'].grab_focus() + + def on_tvw_projects_row_activated(self, widget, path, column): + projid = treeview.get_value(widget, 0) + self.project.load(projid) + self.display_record() + self.topwidget.set_visible_child(self.box['proj_detail']) + self.button['close'].grab_focus() # buttons on detail page # edit2 uses edit callback @@ -68,7 +85,14 @@ class ProjectsView(View): self.topwidget.set_visible_child(self.box['projects']) def display_record(self): - pass + self.label['name'].set_text(self.project.projname) + self.label['responsible'].set_text(self.dd_user[self.project.responsible]) + self.label['date_start'].set_text(self.format_date(self.project.startdate)) + 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['remarks'].set_text(self.project.remarks or '') def edit_record(self): pass diff --git a/yms/view/provisions.py b/yms/view/provisions.py index a2517e1..87535ea 100644 --- a/yms/view/provisions.py +++ b/yms/view/provisions.py @@ -11,6 +11,7 @@ class ProvisionsView(View): def __init__(self, context): super().__init__(context, _("Provisions"), "provisions.ui") + self.context = context self.prov = provision.Provision(context.db) # current record self.newrecord = False @@ -21,7 +22,7 @@ class ProvisionsView(View): sql = ( "SELECT p.provid, p.provname, p.number, p.unit, p.storedate, p.shelflife " "FROM provisions AS p LEFT OUTER JOIN storage AS s USING (sid) " - "WHERE s.vid=%s" + "WHERE s.vid=%s OR vid IS NULL" ) self.db.dcur.execute(sql, (context.vessel.vid,)) for row in self.db.dcur.fetchall(): @@ -55,7 +56,18 @@ class ProvisionsView(View): self.topwidget.set_visible_child(self.box['prov_edit']) def on_but_detail_clicked(self, widget): + provid = treeview.get_value(self.tree['provisions'], 0) + self.prov.load(provid) + self.display_record() self.topwidget.set_visible_child(self.box['prov_detail']) + self.button['close'].grab_focus() + + def on_tvw_provisions_row_activated(self, widget, path, column): + provid = treeview.get_value(widget, 0) + self.prov.load(provid) + self.display_record() + self.topwidget.set_visible_child(self.box['prov_detail']) + self.button['close'].grab_focus() # buttons on detail page # edit2 uses edit callback @@ -71,3 +83,20 @@ class ProvisionsView(View): def on_but_cancel_clicked(self, widget): self.topwidget.set_visible_child(self.box['provisions']) + + def display_record(self): + print(self.prov) + self.label['name'].set_text(self.prov.provname) + self.label['category'].set_text(str(self.prov.provcat)) + self.label['storage'].set_text(str(self.prov.sid)) + self.label['box'].set_text(str(self.prov.boxid)) + self.label['number'].set_text(str(self.prov.number)) + self.label['unit'].set_text(str(self.prov.unit)) + self.label['target'].set_text(str(self.prov.target)) + self.label['weight'].set_text(self.format_float(self.prov.weight, 2, suffix='kg')) + self.label['weight_net'].set_text(self.format_float(self.prov.weight_net, 2, suffix='kg')) + self.label['price'].set_text(self.format_float(self.prov.price, 2, suffix='€')) + self.label['remarks'].set_text(self.prov.remarks or '') + + def edit_record(self): + pass diff --git a/yms/view/status.py b/yms/view/status.py index f592671..79d91c5 100644 --- a/yms/view/status.py +++ b/yms/view/status.py @@ -11,7 +11,7 @@ class StatusView: def __init__(self, context): self.context = context - self.title = _("Status") + self._title = _("Status") builder = Gtk.Builder() builder.set_translation_domain(context.textdomain) builder.add_from_file(os.path.join(context.ui_path, "status.ui")) diff --git a/yms/view/storage.py b/yms/view/storage.py index 8eaf9c1..2a6a122 100644 --- a/yms/view/storage.py +++ b/yms/view/storage.py @@ -5,14 +5,13 @@ from gi.repository import GLib, Gtk, Gdk from .view import View from yms import gtkutils, combobox, treeview -from yms.model import storage from yms.lookup import Dropdown +from yms.model import storage class StorageView(View): def __init__(self, context): super().__init__(context, _("Storage"), "storage.ui") - self.context = context self.storage = storage.Storage(context.db) # current record @@ -27,15 +26,11 @@ class StorageView(View): treeview.add_column(self.tree['storage'], _('Remarks'), 3) self.tree['storage'].set_model(self.lst_storage) - #combodict = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE) - #combobox.load_from_dict(self.combo['type'], combodict) + self.dd_stype = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE) + combobox.load_from_dict(self.combo['type'], self.dd_stype) - combodict = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE) - print(combodict) - combobox.load_from_dict(self.combo['type'], combodict) - - combodict = self.context.lookup.enum('storage.capaunit') - combobox.load_from_dict(self.combo['unit'], combodict) + self.dd_unit = self.context.lookup.enum('storage.capaunit') + combobox.load_from_dict(self.combo['unit'], self.dd_unit) def add_row(self): pass @@ -55,8 +50,32 @@ class StorageView(View): for row in self.db.cur.fetchall(): self.lst_storage.append(row) + def clear_record(self): + self.storage.clear() + self.entry['sname'].set_text('') + self.spin['x'].set_value(0) + self.spin['y'].set_value(0) + self.spin['z'].set_value(0) + self.spin['wx'].set_value(0) + self.spin['wy'].set_value(0) + self.spin['wz'].set_value(0) + self.spin['angle'].set_value(0) + self.spin['capacity'].set_value(0) + combobox.activate_row(self.combo['type'], -1) + combobox.activate_row(self.combo['unit'], -1) + self.text['remarks'].get_buffer().set_text('') + def display_record(self): self.label['name'].set_text(self.storage.sname) + self.label['type'].set_text(self.dd_stype[self.storage.stype]) + self.label['position'].set_text(f"({self.storage.x}, {self.storage.y}, {self.storage.z})") + self.label['dimension'].set_text(f"({self.storage.wx}, {self.storage.wy}, {self.storage.wz})") + self.label['angle'].set_text(f"{self.storage.angle}°") + self.label['capacity'].set_text(f"{self.storage.capacity} {self.storage.capaunit}") + if self.storage.color: + self.label['color'].set_markup(f'#{self.storage.color} ●') + else: + self.label['color'].set_text('') self.label['remarks'].set_text(self.storage.remarks or '') def edit_record(self): @@ -71,23 +90,9 @@ class StorageView(View): self.spin['capacity'].set_value(self.storage.capacity) combobox.activate_row(self.combo['type'], self.storage.stype) combobox.activate_row(self.combo['unit'], self.storage.capaunit) + # flags self.text['remarks'].get_buffer().set_text(self.storage.remarks or '') - def clear_record(self): - self.storage.clear() - self.entry['sname'].set_text('') - self.spin['x'].set_value(0) - self.spin['y'].set_value(0) - self.spin['z'].set_value(0) - self.spin['wx'].set_value(0) - self.spin['wy'].set_value(0) - self.spin['wz'].set_value(0) - self.spin['angle'].set_value(0) - self.spin['capacity'].set_value(0) - combobox.activate_row(self.combo['type'], -1) - combobox.activate_row(self.combo['unit'], .1) - self.text['remarks'].get_buffer().set_text('') - # buttons on list page def on_but_new_clicked(self, widget): self.newrecord = True @@ -108,9 +113,19 @@ class StorageView(View): def on_but_detail_clicked(self, widget): sid = treeview.get_value(self.tree['storage'], 0) + if not sid: + return self.storage.load(sid) self.display_record() self.topwidget.set_visible_child(self.box['stor_detail']) + self.button['close'].grab_focus() + + def on_tvw_storage_row_activated(self, widget, path, column): + sid = treeview.get_value(widget, 0) + self.storage.load(sid) + self.display_record() + self.topwidget.set_visible_child(self.box['stor_detail']) + self.button['close'].grab_focus() # buttons on detail page # edit2 uses edit callback diff --git a/yms/view/tasks.py b/yms/view/tasks.py new file mode 100644 index 0000000..081f6fd --- /dev/null +++ b/yms/view/tasks.py @@ -0,0 +1,89 @@ +# SPDX-License-Identifier: WTFPL + +import os +from gi.repository import Gtk + +from .view import View +from yms import gtkutils, combobox, treeview +from yms.model import task + +class TasksView(View): + + def __init__(self, context): + super().__init__(context, _("Tasks"), "tasks.ui") + self.context = context + + self.task = task.Task(context.db) # current record + self.newrecord = False + + self.lst_tasks = Gtk.ListStore(int, str, str, str, str) + sql = ( + "SELECT t.taskid, t.taskname, t.priority, t.taskstate, " + "u.displayname AS responsible " + "FROM task AS t JOIN user AS u ON (t.responsible=u.userid)" + "WHERE t.vid=%s " + "ORDER BY t.taskid" + ) + self.db.dcur.execute(sql, (context.vessel.vid,)) + for row in self.db.dcur.fetchall(): + data = ( + row['taskid'], + row['taskname'], + row['priority'], + row['taskstate'], + row['responsible'] + ) + self.lst_tasks.append(data) + + treeview.add_column(self.tree['tasks'], _('ID'), 0) + treeview.add_column(self.tree['tasks'], _('Name'), 1) + treeview.add_column(self.tree['tasks'], _('Priority'), 2) + treeview.add_column(self.tree['tasks'], _('Status'), 3) + treeview.add_column(self.tree['tasks'], _('Responsible'), 4) + self.tree['tasks'].set_model(self.lst_tasks) + + # buttons on list page + def on_but_new_clicked(self, widget): + self.topwidget.set_visible_child(self.box['task_edit']) + + def on_but_edit_clicked(self, widget): + self.topwidget.set_visible_child(self.box['task_edit']) + + def on_but_detail_clicked(self, widget): + taskid = treeview.get_value(self.tree['tasks'], 0) + if not taskid: + return + self.task.load(taskid) + self.display_record() + self.topwidget.set_visible_child(self.box['task_detail']) + self.button['close'].grab_focus() + + def on_tvw_tasks_row_activated(self, widget, path, column): + taskid = treeview.get_value(widget, 0) + self.task.load(taskid) + self.display_record() + self.topwidget.set_visible_child(self.box['task_detail']) + + # buttons on detail page + # edit2 uses edit callback + def on_but_close_clicked(self, widget): + self.topwidget.set_visible_child(self.box['tasks']) + + def on_but_delete_clicked(self, widget): + self.topwidget.set_visible_child(self.box['tasks']) + + # buttons on edit page + def on_but_save_clicked(self, widget): + pass + + def on_but_cancel_clicked(self, widget): + self.topwidget.set_visible_child(self.box['tasks']) + + def display_record(self): + self.label['name'].set_text(self.task.taskname) + self.label['responsible'].set_text('') + self.label['status'].set_text(self.task.taskstate) + self.label['remarks'].set_text(self.task.remarks or '') + + def edit_record(self): + pass diff --git a/yms/view/view.py b/yms/view/view.py index bbaa4be..8b15c2c 100644 --- a/yms/view/view.py +++ b/yms/view/view.py @@ -17,7 +17,7 @@ class View: self.db = context.db self.vessel = context.vessel self.user = context.user - self.title = title + self._title = title builder = Gtk.Builder() builder.set_translation_domain(context.textdomain) builder.add_from_file(os.path.join(context.ui_path, ui_file)) diff --git a/ymsgui.py b/ymsgui.py index c054525..384035d 100755 --- a/ymsgui.py +++ b/ymsgui.py @@ -48,6 +48,8 @@ from yms.view.inventory import InventoryView from yms.view.provisions import ProvisionsView from yms.view.maintenance import MaintenanceView from yms.view.projects import ProjectsView +from yms.view.tasks import TasksView +from yms.view.measurement import MeasurementView from yms.view.cables import CablesView from yms.view.fuses import FusesView from yms.view.documents import DocumentsView @@ -72,14 +74,14 @@ class AppContext: # mapping between PHP and Python datefmt_map = { - 'Y-m-d': '%Y-%m-%d', # ISO / international / technical - 'd.m.Y': '%d.%m.%Y', # Germany / Central & Northern Europe - 'd/m/Y': '%d/%m/%Y', # UK / France / Spain / Italy / Australia / NZ - 'd-m-Y': '%d-%m-%Y', # Netherlands / Denmark / Belgium - 'd M Y': '%d %b %Y', # nautical documents / logbooks / unambiguous - 'm.d.Y': '%m.%d.%Y', # USA - 'm/d/Y': '%m/%d/%Y', # USA - 'Y/m/d': '%Y/%m/%d' # Japan / China + 'Y-m-d': ('%Y-%m-%d', 'YYYY-MM-DD'), # ISO / international / technical + 'd.m.Y': ('%d.%m.%Y', 'DD.MM.YYYY'), # Germany / Central & Northern Europe + 'd/m/Y': ('%d/%m/%Y', 'DD/MM/YYYY'), # UK / France / Spain / Italy / Australia / NZ + 'd-m-Y': ('%d-%m-%Y', 'DD-MM-YYYY'), # Netherlands / Denmark / Belgium + 'd M Y': ('%d %b %Y', 'DD Mon YYYY'), # nautical documents / logbooks / unambiguous + 'm.d.Y': ('%m.%d.%Y', 'MM.DD.YYYY'), # USA + 'm/d/Y': ('%m/%d/%Y', 'MM/DD/YYYY'), # USA + 'Y/m/d': ('%Y/%m/%d', 'YYYY/MM/DD') # Japan / China } def __init__(self): @@ -109,9 +111,10 @@ class AppContext: if row is not None: try: self.datefmt = self.datefmt_map[row[0]] + print(row[0]) except KeyError: # almost impossible case where db value is not in mapping - print("internal error: format mapping missinf") + print("internal error: date format mapping missing") else: # perhaps create missing record here? pass @@ -137,10 +140,12 @@ class Frontend: "equipment": EquipmentView(context), "inventory": InventoryView(context), "provisions": ProvisionsView(context), + "measurement": MeasurementView(context), "cables": CablesView(context), "fuses": FusesView(context), "maintenance": MaintenanceView(context), "projects": ProjectsView(context), + "tasks": TasksView(context), "documents": DocumentsView(context), "status": StatusView(context) } @@ -152,13 +157,11 @@ class Frontend: self.window = builder.get_object("wnd_main") self.notebook = builder.get_object("ntb_modules") for module in self.modules.values(): - self.notebook.append_page(module.topwidget, Gtk.Label(label=module.title)) + self.notebook.append_page(module.topwidget, Gtk.Label(label=module._title)) self.db_poll_ts = context.db.get_timestamp() GLib.timeout_add_seconds(30, self.db_change_poller) - print("Frontend initialized.") - def run(self): #self.label['vessel'].set_text(self._vessel.vesselname) self.window.show_all() @@ -195,14 +198,12 @@ def create_config(cfg, cfgfile): if __name__ == "__main__": - print("Startup sequence entered...") - context = AppContext() locale.setlocale(locale.LC_ALL, '') gettext.bindtextdomain(context.textdomain, 'locale') gettext.textdomain(context.textdomain) - gettext.install(context.textdomain) + gettext.install(context.textdomain, 'locale') config = configparser.ConfigParser() cfgfile = os.path.expanduser(context.cfg['cfgfile'])