diff --git a/db/generic.sql b/db/generic.sql index efdbb46..399c22b 100644 --- a/db/generic.sql +++ b/db/generic.sql @@ -13,6 +13,7 @@ INSERT INTO vessel (vid, htype, vesselname, model, loa, lwl, beam, draught, disp (1, 'mono', 'Generic vessel', 'Generic model', 10.0, 9.5, 3.0, 1.8, 4000, 1200, 'generic.svg'); INSERT INTO settings (userid, sno, valint) VALUES +(1, 1, 1), -- Vessel 1 for captain (2, 1, 1), -- Vessel 1 for helmsman (3, 1, 1); -- Vessel 1 for sailor diff --git a/locale/de.po b/locale/de.po index 29771ec..efc0c5a 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-10-24 19:13+0200\n" +"POT-Creation-Date: 2026-11-04 06:46+0100\n" "PO-Revision-Date: 2026-10-21 06:27+0200\n" "Last-Translator: Thomas Hooge \n" "Language-Team: de \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.2.2\n" -#: ymsgui.py:262 +#: ymsgui.py:298 msgid "" "Configuration file '{}' not found.\n" "Default configuration has been created.\n" @@ -31,7 +31,17 @@ msgstr "" "\n" "Anschließend starten Sie dieses Programm neu." -#: ymsgui.py:292 +#: ymsgui.py:324 +msgid "" +"Directory with deck plan files not found.\n" +"\n" +"Please check your configuration file!" +msgstr "" +"Verzeichnis mit Deckslayouts nicht gefunden.\n" +"\n" +"Bitte die Konfigurationsdatei überprügen!" + +#: ymsgui.py:335 msgid "" "Database connection cannot be established.\n" "\n" @@ -51,29 +61,28 @@ msgstr "Basisdaten" #: yms/view/base.py:59 yms/view/base.py:85 yms/view/base.py:89 #: yms/view/base.py:97 yms/view/base.py:166 yms/view/boxes.py:31 -#: yms/view/boxes.py:33 yms/view/cables.py:32 yms/view/cables.py:35 -#: yms/view/cables.py:38 yms/view/companies.py:22 yms/view/companies.py:24 -#: yms/view/equipment.py:36 yms/view/equipment.py:39 yms/view/equipment.py:42 -#: yms/view/fuses.py:47 yms/view/fuses.py:50 yms/view/inventory.py:43 -#: yms/view/inventory.py:46 yms/view/inventory.py:49 yms/view/inventory.py:52 -#: yms/view/inventory.py:55 yms/view/measurement.py:25 -#: yms/view/measurement.py:33 yms/view/measurement.py:37 -#: yms/view/provisions.py:24 yms/view/provisions.py:27 -#: yms/view/provisions.py:30 yms/view/provisions.py:33 yms/view/storage.py:35 -#: yms/view/tasks.py:47 +#: yms/view/boxes.py:33 yms/view/cables.py:30 yms/view/cables.py:33 +#: yms/view/cables.py:36 yms/view/cables.py:39 yms/view/companies.py:22 +#: yms/view/companies.py:24 yms/view/equipment.py:36 yms/view/equipment.py:39 +#: yms/view/equipment.py:42 yms/view/fuses.py:33 yms/view/fuses.py:36 +#: yms/view/inventory.py:43 yms/view/inventory.py:46 yms/view/inventory.py:49 +#: yms/view/inventory.py:52 yms/view/measurement.py:37 +#: yms/view/measurement.py:41 yms/view/provisions.py:24 +#: yms/view/provisions.py:27 yms/view/provisions.py:30 +#: yms/view/provisions.py:33 yms/view/provisions.py:67 yms/view/storage.py:35 +#: yms/view/tasks.py:31 msgid "─── none ───" msgstr "─── keine ───" #: yms/view/base.py:133 yms/view/boxes.py:24 yms/view/cables.py:22 -#: yms/view/companies.py:32 yms/view/documents.py:38 yms/view/equipment.py:25 -#: yms/view/fuses.py:36 yms/view/inventory.py:30 yms/view/maintenance.py:29 -#: yms/view/measurement.py:68 yms/view/projects.py:39 yms/view/provisions.py:38 -#: yms/view/storage.py:25 yms/view/tasks.py:38 +#: yms/view/companies.py:32 yms/view/documents.py:42 yms/view/equipment.py:25 +#: yms/view/fuses.py:22 yms/view/inventory.py:30 yms/view/maintenance.py:21 +#: yms/view/measurement.py:46 yms/view/projects.py:23 yms/view/provisions.py:38 +#: yms/view/storage.py:25 yms/view/tasks.py:22 msgid "ID" msgstr "" #: yms/view/base.py:134 -#, fuzzy msgid "List" msgstr "Liste" @@ -87,8 +96,11 @@ msgid "" "All data on that device will be lost!\n" "Are you really sure?" msgstr "" +"Initialisiere USB-Stick\n" +"Alle Daten auf dem Gerät werden gelöscht!\n" +"Sind Sie wirklich sicher?" -#: yms/view/base.py:336 +#: yms/view/base.py:337 msgid "" "Add new vessel.\n" "Are you sure?" @@ -96,7 +108,7 @@ msgstr "" "Neues Boot hinzufügen.\n" "Sind Sie sicher?" -#: yms/view/base.py:456 +#: yms/view/base.py:458 msgid "" "Delete user!\n" "Are you sure?" @@ -108,38 +120,38 @@ msgstr "" msgid "Boxes" msgstr "Kisten" -#: yms/view/boxes.py:25 yms/ui/boxes.ui:263 yms/ui/boxes.ui:561 +#: yms/view/boxes.py:25 yms/ui/boxes.ui:266 yms/ui/boxes.ui:627 msgid "Label" msgstr "" -#: yms/view/boxes.py:26 yms/ui/boxes.ui:310 yms/ui/boxes.ui:766 +#: yms/view/boxes.py:26 yms/ui/boxes.ui:327 yms/ui/boxes.ui:832 msgid "Content" msgstr "Inhalt" #: yms/view/boxes.py:27 yms/view/companies.py:35 yms/view/equipment.py:31 -#: yms/view/inventory.py:35 yms/view/maintenance.py:32 yms/view/projects.py:44 +#: yms/view/inventory.py:35 yms/view/maintenance.py:24 yms/view/projects.py:28 #: yms/view/storage.py:28 yms/ui/base.ui:513 yms/ui/base.ui:910 -#: yms/ui/boxes.ui:285 yms/ui/boxes.ui:712 yms/ui/cables.ui:113 -#: yms/ui/cables.ui:423 yms/ui/cables.ui:829 yms/ui/companies.ui:423 -#: yms/ui/companies.ui:903 yms/ui/documents.ui:572 yms/ui/documents.ui:766 -#: yms/ui/equipment.ui:455 yms/ui/equipment.ui:929 yms/ui/fuses.ui:98 -#: yms/ui/fuses.ui:353 yms/ui/fuses.ui:639 yms/ui/inventory.ui:378 -#: yms/ui/inventory.ui:801 yms/ui/maintenance.ui:359 yms/ui/maintenance.ui:650 -#: yms/ui/projects.ui:105 yms/ui/projects.ui:349 yms/ui/projects.ui:628 -#: yms/ui/provisions.ui:495 yms/ui/provisions.ui:993 yms/ui/storage.ui:419 -#: yms/ui/storage.ui:827 yms/ui/tasks.ui:507 yms/ui/tasks.ui:716 +#: yms/ui/boxes.ui:295 yms/ui/boxes.ui:778 yms/ui/cables.ui:113 +#: yms/ui/cables.ui:463 yms/ui/cables.ui:908 yms/ui/companies.ui:423 +#: yms/ui/companies.ui:1074 yms/ui/documents.ui:613 yms/ui/documents.ui:819 +#: yms/ui/equipment.ui:493 yms/ui/equipment.ui:1018 yms/ui/fuses.ui:98 +#: yms/ui/fuses.ui:378 yms/ui/fuses.ui:682 yms/ui/inventory.ui:388 +#: yms/ui/inventory.ui:839 yms/ui/maintenance.ui:402 yms/ui/maintenance.ui:717 +#: yms/ui/projects.ui:110 yms/ui/projects.ui:378 yms/ui/projects.ui:688 +#: yms/ui/provisions.ui:489 yms/ui/provisions.ui:1162 yms/ui/storage.ui:471 +#: yms/ui/storage.ui:886 yms/ui/tasks.ui:573 yms/ui/tasks.ui:800 msgid "Remarks" msgstr "Bemerkungen" -#: yms/view/boxes.py:122 +#: yms/view/boxes.py:141 msgid "Add new Box" msgstr "Neue Kiste hinzufügen" -#: yms/view/boxes.py:128 yms/ui/boxes.ui:539 +#: yms/view/boxes.py:147 yms/ui/boxes.ui:605 msgid "Edit Box" msgstr "Kiste bearbeiten" -#: yms/view/boxes.py:159 +#: yms/view/boxes.py:178 msgid "" "Delete box!\n" "Are you sure?" @@ -152,26 +164,34 @@ msgid "Cables" msgstr "Kabel" #: yms/view/cables.py:23 yms/view/companies.py:33 yms/view/equipment.py:26 -#: yms/view/fuses.py:37 yms/view/inventory.py:31 yms/view/projects.py:40 -#: yms/view/storage.py:26 yms/view/tasks.py:39 yms/ui/base.ui:723 -#: 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:645 -#: yms/ui/equipment.ui:345 yms/ui/equipment.ui:756 yms/ui/fuses.ui:76 -#: yms/ui/inventory.ui:268 yms/ui/inventory.ui:682 yms/ui/measurement.ui:247 -#: yms/ui/measurement.ui:602 yms/ui/projects.ui:83 yms/ui/projects.ui:272 -#: yms/ui/projects.ui:551 yms/ui/provisions.ui:275 yms/ui/provisions.ui:717 -#: yms/ui/storage.ui:257 yms/ui/storage.ui:544 yms/ui/tasks.ui:346 -#: yms/ui/tasks.ui:677 +#: yms/view/fuses.py:23 yms/view/inventory.py:31 yms/view/projects.py:24 +#: yms/view/storage.py:26 yms/view/tasks.py:23 yms/ui/base.ui:723 +#: yms/ui/boxes.ui:119 yms/ui/cables.ui:91 yms/ui/cables.ui:280 +#: yms/ui/cables.ui:745 yms/ui/companies.ui:234 yms/ui/companies.ui:753 +#: yms/ui/equipment.ui:353 yms/ui/equipment.ui:855 yms/ui/fuses.ui:76 +#: yms/ui/inventory.ui:276 yms/ui/inventory.ui:720 yms/ui/measurement.ui:255 +#: yms/ui/measurement.ui:687 yms/ui/projects.ui:88 yms/ui/projects.ui:280 +#: yms/ui/projects.ui:611 yms/ui/provisions.ui:280 yms/ui/provisions.ui:805 +#: yms/ui/storage.ui:260 yms/ui/storage.ui:603 yms/ui/tasks.ui:370 +#: yms/ui/tasks.ui:761 msgid "Name" msgstr "" -#: yms/view/cables.py:24 yms/view/inventory.py:34 yms/ui/cables.ui:412 -#: yms/ui/cables.ui:818 yms/ui/equipment.ui:624 yms/ui/equipment.ui:1004 -#: yms/ui/inventory.ui:92 yms/ui/inventory.ui:367 yms/ui/inventory.ui:790 +#: yms/view/cables.py:24 yms/view/inventory.py:34 yms/ui/cables.ui:449 +#: yms/ui/cables.ui:897 yms/ui/equipment.ui:716 yms/ui/equipment.ui:1093 +#: yms/ui/inventory.ui:97 yms/ui/inventory.ui:374 yms/ui/inventory.ui:828 msgid "Condition" msgstr "Zustand" -#: yms/view/cables.py:142 +#: yms/view/cables.py:25 yms/ui/cables.ui:337 yms/ui/cables.ui:797 +msgid "Length" +msgstr "Länge" + +#: yms/view/cables.py:166 yms/ui/cables.ui:723 +msgid "Edit Cable" +msgstr "Bearbeite Kabel" + +#: yms/view/cables.py:196 msgid "" "Delete cable!\n" "Are you sure?" @@ -187,23 +207,23 @@ msgstr "Firmen" msgid "─── all ───" msgstr "─── alle ───" -#: yms/view/companies.py:34 yms/view/documents.py:39 yms/ui/boxes.ui:96 -#: yms/ui/boxes.ui:332 yms/ui/boxes.ui:575 yms/ui/cables.ui:301 -#: yms/ui/cables.ui:692 yms/ui/companies.ui:50 yms/ui/companies.ui:220 -#: yms/ui/companies.ui:656 yms/ui/documents.ui:225 yms/ui/fuses.ui:287 -#: yms/ui/fuses.ui:578 yms/ui/inventory.ui:279 yms/ui/storage.ui:280 +#: yms/view/companies.py:34 yms/view/documents.py:43 yms/ui/boxes.ui:96 +#: yms/ui/boxes.ui:356 yms/ui/boxes.ui:641 yms/ui/cables.ui:308 +#: yms/ui/cables.ui:771 yms/ui/companies.ui:50 yms/ui/companies.ui:220 +#: yms/ui/companies.ui:764 yms/ui/documents.ui:224 yms/ui/fuses.ui:294 +#: yms/ui/fuses.ui:624 yms/ui/storage.ui:290 msgid "Type" msgstr "Typ" -#: yms/view/companies.py:129 +#: yms/view/companies.py:137 msgid "Add new Company" msgstr "Neue Firma hinzufügen" -#: yms/view/companies.py:140 +#: yms/view/companies.py:148 msgid "Edit Company" msgstr "Firma bearbeiten" -#: yms/view/companies.py:165 +#: yms/view/companies.py:173 msgid "" "Delete company!\n" "Are you sure?" @@ -211,27 +231,27 @@ msgstr "" "Lösche Firma!\n" "Sind Sie sicher?" -#: yms/view/documents.py:15 +#: yms/view/documents.py:14 msgid "Documents" msgstr "Dokumente" -#: yms/view/documents.py:40 yms/ui/documents.ui:434 yms/ui/documents.ui:755 +#: yms/view/documents.py:44 yms/ui/documents.ui:439 yms/ui/documents.ui:808 msgid "Filename" msgstr "Dateiname" -#: yms/view/documents.py:41 yms/ui/documents.ui:411 yms/ui/documents.ui:733 +#: yms/view/documents.py:45 yms/ui/documents.ui:410 yms/ui/documents.ui:786 msgid "Title" msgstr "Titel" -#: yms/view/documents.py:42 +#: yms/view/documents.py:46 msgid "References" msgstr "Referenzen" -#: yms/view/documents.py:138 +#: yms/view/documents.py:161 msgid "Add new Document" msgstr "Neues Dokument hinzufügen" -#: yms/view/documents.py:174 +#: yms/view/documents.py:197 msgid "" "Delete document!\n" "Are you sure?" @@ -239,21 +259,21 @@ msgstr "" "Lösche Dokument!\n" "Sind Sie sicher?" -#: yms/view/equipment.py:16 yms/view/maintenance.py:31 -#: yms/view/measurement.py:72 yms/ui/fuses.ui:320 yms/ui/fuses.ui:617 -#: yms/ui/inventory.ui:312 yms/ui/inventory.ui:732 yms/ui/maintenance.ui:81 -#: yms/ui/maintenance.ui:270 yms/ui/maintenance.ui:570 yms/ui/measurement.ui:81 -#: yms/ui/measurement.ui:270 yms/ui/measurement.ui:685 +#: yms/view/equipment.py:16 yms/view/maintenance.py:23 +#: yms/view/measurement.py:50 yms/ui/fuses.ui:336 yms/ui/fuses.ui:660 +#: yms/ui/inventory.ui:304 yms/ui/inventory.ui:770 yms/ui/maintenance.ui:91 +#: yms/ui/maintenance.ui:289 yms/ui/maintenance.ui:637 yms/ui/measurement.ui:86 +#: yms/ui/measurement.ui:285 yms/ui/measurement.ui:770 msgid "Equipment" msgstr "Ausrüstung" -#: yms/view/equipment.py:27 yms/ui/cables.ui:401 yms/ui/cables.ui:807 -#: yms/ui/equipment.ui:87 yms/ui/equipment.ui:367 yms/ui/equipment.ui:801 +#: yms/view/equipment.py:27 yms/ui/cables.ui:435 yms/ui/cables.ui:886 +#: yms/ui/equipment.ui:92 yms/ui/equipment.ui:381 yms/ui/equipment.ui:900 msgid "Manufacturer" msgstr "Hersteller" #: yms/view/equipment.py:28 yms/ui/base.ui:91 yms/ui/base.ui:752 -#: yms/ui/base.ui:2004 yms/ui/equipment.ui:378 yms/ui/equipment.ui:812 +#: yms/ui/base.ui:2004 yms/ui/equipment.ui:395 yms/ui/equipment.ui:911 msgid "Model" msgstr "Modell" @@ -265,15 +285,15 @@ msgstr "Seriennummer" msgid "Age" msgstr "Alter" -#: yms/view/equipment.py:148 +#: yms/view/equipment.py:153 msgid "Add new Equipment" msgstr "Neue Ausrüstung hinzufügen" -#: yms/view/equipment.py:158 yms/ui/equipment.ui:736 +#: yms/view/equipment.py:163 yms/ui/equipment.ui:835 msgid "Edit Equipment" msgstr "Ausrüstung bearbeiten" -#: yms/view/equipment.py:186 +#: yms/view/equipment.py:191 msgid "" "Convert equipment to inventory?\n" "Some properties will be lost!\n" @@ -285,7 +305,7 @@ msgstr "" "\n" "Sind Sie sicher?" -#: yms/view/equipment.py:196 +#: yms/view/equipment.py:201 msgid "" "Delete equipment!\n" "Are you sure?" @@ -297,24 +317,28 @@ msgstr "" msgid "Fuses" msgstr "Sicherungen" -#: yms/view/fuses.py:38 yms/ui/fuses.ui:298 yms/ui/fuses.ui:592 +#: yms/view/fuses.py:24 yms/ui/fuses.ui:308 yms/ui/fuses.ui:635 msgid "Current" msgstr "Stromstärke" -#: yms/view/fuses.py:39 yms/view/provisions.py:39 yms/ui/fuses.ui:342 -#: yms/ui/fuses.ui:564 +#: yms/view/fuses.py:25 yms/view/provisions.py:39 yms/ui/fuses.ui:364 +#: yms/ui/fuses.ui:613 msgid "Description" msgstr "Beschreibung" -#: yms/view/fuses.py:96 +#: yms/view/fuses.py:30 +msgid "─── unknown ───" +msgstr "─── unbekannt ───" + +#: yms/view/fuses.py:136 msgid "Add new Fuse" msgstr "Neue Sicherung hinzufügen" -#: yms/view/fuses.py:105 yms/ui/fuses.ui:528 +#: yms/view/fuses.py:145 yms/ui/fuses.ui:577 msgid "Edit Fuse" msgstr "Sicherung bearbeiten" -#: yms/view/fuses.py:133 +#: yms/view/fuses.py:173 msgid "" "Delete fuse!\n" "Are you sure?" @@ -326,21 +350,21 @@ msgstr "" msgid "Inventory" msgstr "Inventar" -#: yms/view/inventory.py:32 yms/ui/inventory.ui:696 +#: yms/view/inventory.py:32 yms/ui/inventory.ui:290 yms/ui/inventory.ui:734 msgid "Container" msgstr "" -#: yms/view/inventory.py:33 yms/view/provisions.py:40 yms/ui/fuses.ui:276 -#: yms/ui/fuses.ui:550 yms/ui/inventory.ui:323 yms/ui/inventory.ui:743 -#: yms/ui/provisions.ui:322 yms/ui/provisions.ui:797 +#: yms/view/inventory.py:33 yms/view/provisions.py:40 yms/ui/fuses.ui:280 +#: yms/ui/fuses.ui:599 yms/ui/inventory.ui:318 yms/ui/inventory.ui:781 +#: yms/ui/provisions.ui:327 yms/ui/provisions.ui:906 msgid "Number" msgstr "" -#: yms/view/inventory.py:166 +#: yms/view/inventory.py:175 msgid "Add new Inventory" msgstr "Neus Inventar hinzufügen" -#: yms/view/inventory.py:177 +#: yms/view/inventory.py:186 msgid "" "Record is locked!\n" "Edit prohibited." @@ -348,11 +372,11 @@ msgstr "" "Datensatz ist gesperrt!\n" "Bearbeiten nicht zulässig." -#: yms/view/inventory.py:183 +#: yms/view/inventory.py:192 msgid "Edit Inventory" msgstr "Inventar bearbeiten" -#: yms/view/inventory.py:211 +#: yms/view/inventory.py:220 msgid "" "Convert inventory to equipment?\n" "Some properties will be lost!\n" @@ -364,7 +388,7 @@ msgstr "" "\n" "Sind Sie sicher?" -#: yms/view/inventory.py:239 +#: yms/view/inventory.py:248 msgid "" "Delete inventory!\n" "Are you sure?" @@ -376,16 +400,16 @@ msgstr "" msgid "Maintenance" msgstr "Wartung" -#: yms/view/maintenance.py:30 yms/ui/maintenance.ui:247 -#: yms/ui/maintenance.ui:556 +#: yms/view/maintenance.py:22 yms/ui/maintenance.ui:260 +#: yms/ui/maintenance.ui:623 msgid "Activities" msgstr "Aktivitäten" -#: yms/view/maintenance.py:87 yms/ui/maintenance.ui:534 +#: yms/view/maintenance.py:98 yms/ui/maintenance.ui:601 msgid "Edit Maintenance" msgstr "Wartung bearbeiten" -#: yms/view/maintenance.py:118 +#: yms/view/maintenance.py:129 msgid "" "Delete maintenance!\n" "Are you sure?" @@ -397,33 +421,33 @@ msgstr "" msgid "Measurements" msgstr "Messungen" -#: yms/view/measurement.py:69 +#: yms/view/measurement.py:47 msgid "Measurement" msgstr "Messung" -#: yms/view/measurement.py:70 +#: yms/view/measurement.py:48 msgid "Value" msgstr "Wert" -#: yms/view/measurement.py:71 yms/ui/measurement.ui:348 -#: yms/ui/measurement.ui:663 +#: yms/view/measurement.py:49 yms/ui/measurement.ui:385 +#: yms/ui/measurement.ui:748 msgid "Accuracy" msgstr "Genauigkeit" -#: yms/view/measurement.py:73 yms/ui/measurement.ui:359 -#: yms/ui/measurement.ui:696 +#: yms/view/measurement.py:51 yms/ui/measurement.ui:399 +#: yms/ui/measurement.ui:781 msgid "Note" msgstr "Notiz" -#: yms/view/measurement.py:134 +#: yms/view/measurement.py:170 msgid "Add new Measurement" msgstr "Maß/Messung hinzufügen" -#: yms/view/measurement.py:140 yms/ui/measurement.ui:580 +#: yms/view/measurement.py:176 yms/ui/measurement.ui:665 msgid "Edit Measurement" msgstr "Maß/Messung bearbeiten" -#: yms/view/measurement.py:171 +#: yms/view/measurement.py:214 msgid "" "Delete measurement!\n" "Are you sure?" @@ -435,31 +459,31 @@ msgstr "" msgid "Projects" msgstr "Projekte" -#: yms/view/projects.py:41 +#: yms/view/projects.py:25 msgid "Start date" msgstr "Startdatum" -#: yms/view/projects.py:42 +#: yms/view/projects.py:26 msgid "Duration" msgstr "Dauer" -#: yms/view/projects.py:43 yms/view/status.py:14 yms/view/tasks.py:41 -#: yms/ui/cables.ui:102 yms/ui/fuses.ui:87 yms/ui/maintenance.ui:348 -#: yms/ui/maintenance.ui:639 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 yms/ui/tasks.ui:854 +#: yms/view/projects.py:27 yms/view/status.py:14 yms/view/tasks.py:25 +#: yms/ui/cables.ui:102 yms/ui/fuses.ui:87 yms/ui/maintenance.ui:388 +#: yms/ui/maintenance.ui:706 yms/ui/projects.ui:99 yms/ui/projects.ui:364 +#: yms/ui/projects.ui:677 yms/ui/status.ui:14 yms/ui/tasks.ui:150 +#: yms/ui/tasks.ui:413 yms/ui/tasks.ui:918 msgid "Status" msgstr "" -#: yms/view/projects.py:96 +#: yms/view/projects.py:108 msgid "Add new Project" msgstr "Projekt hinzufügen" -#: yms/view/projects.py:102 yms/ui/projects.ui:529 +#: yms/view/projects.py:114 yms/ui/projects.ui:589 msgid "Edit Project" msgstr "Projekt bearbeiten" -#: yms/view/projects.py:133 +#: yms/view/projects.py:145 msgid "" "Delete project!\n" "Are you sure?" @@ -471,9 +495,9 @@ msgstr "" msgid "Provisions" msgstr "Verpflegung" -#: yms/view/provisions.py:41 yms/ui/measurement.ui:337 -#: yms/ui/measurement.ui:839 yms/ui/provisions.ui:358 yms/ui/provisions.ui:830 -#: yms/ui/storage.ui:868 +#: yms/view/provisions.py:41 yms/ui/measurement.ui:371 +#: yms/ui/measurement.ui:914 yms/ui/provisions.ui:363 yms/ui/provisions.ui:948 +#: yms/ui/storage.ui:927 msgid "Unit" msgstr "Einheit" @@ -485,15 +509,15 @@ msgstr "Gespeichert" msgid "Best before" msgstr "Haltbar bis" -#: yms/view/provisions.py:159 +#: yms/view/provisions.py:165 msgid "Add new Provision" msgstr "Verpflegung hinzufügen" -#: yms/view/provisions.py:165 +#: yms/view/provisions.py:171 msgid "Edit Provision" msgstr "Verpflegung bearbeiten" -#: yms/view/provisions.py:194 +#: yms/view/provisions.py:200 msgid "" "Delete provision!\n" "Are you sure?" @@ -501,9 +525,9 @@ msgstr "" "Lösche Proviant!\n" "Sind Sie sicher?" -#: yms/view/storage.py:14 yms/ui/boxes.ui:442 yms/ui/boxes.ui:864 -#: yms/ui/inventory.ui:81 yms/ui/inventory.ui:290 yms/ui/inventory.ui:710 -#: yms/ui/provisions.ui:300 yms/ui/provisions.ui:739 +#: yms/view/storage.py:14 yms/ui/boxes.ui:501 yms/ui/boxes.ui:931 +#: yms/ui/inventory.ui:86 yms/ui/inventory.ui:748 yms/ui/provisions.ui:305 +#: yms/ui/provisions.ui:830 msgid "Storage" msgstr "Stauraum" @@ -511,15 +535,15 @@ msgstr "Stauraum" msgid "Position" msgstr "" -#: yms/view/storage.py:134 +#: yms/view/storage.py:136 msgid "Add new Storage" msgstr "Stauraum hinzufügen" -#: yms/view/storage.py:143 yms/ui/storage.ui:522 +#: yms/view/storage.py:145 yms/ui/storage.ui:581 msgid "Edit Storage" msgstr "Stauraum bearbeiten" -#: yms/view/storage.py:171 +#: yms/view/storage.py:173 msgid "" "Delete storage!\n" "Are you sure?" @@ -531,25 +555,25 @@ msgstr "" msgid "Tasks" msgstr "Aufgaben" -#: yms/view/tasks.py:40 yms/ui/tasks.ui:77 yms/ui/tasks.ui:369 -#: yms/ui/tasks.ui:788 +#: yms/view/tasks.py:24 yms/ui/tasks.ui:98 yms/ui/tasks.ui:399 +#: yms/ui/tasks.ui:862 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:702 +#: yms/view/tasks.py:26 yms/ui/projects.ui:294 yms/ui/projects.ui:622 +#: yms/ui/tasks.ui:634 yms/ui/tasks.ui:786 msgid "Responsible" msgstr "Verantwortlich" -#: yms/view/tasks.py:108 +#: yms/view/tasks.py:119 msgid "Add new Task" msgstr "Neue Aufgabe hinzufügen" -#: yms/view/tasks.py:114 yms/ui/tasks.ui:655 +#: yms/view/tasks.py:125 yms/ui/tasks.ui:739 msgid "Edit Task" msgstr "Aufgabe bearbeiten" -#: yms/view/tasks.py:144 +#: yms/view/tasks.py:155 msgid "" "Delete task!\n" "Are you sure?" @@ -613,11 +637,11 @@ msgstr "Standard-Stauraum" msgid "Hull number" msgstr "Rumpfnummer" -#: yms/ui/base.ui:638 yms/ui/base.ui:1299 yms/ui/boxes.ui:474 -#: yms/ui/cables.ui:579 yms/ui/companies.ui:1041 yms/ui/documents.ui:645 -#: yms/ui/equipment.ui:657 yms/ui/fuses.ui:461 yms/ui/inventory.ui:580 -#: yms/ui/maintenance.ui:467 yms/ui/measurement.ui:513 yms/ui/projects.ui:462 -#: yms/ui/provisions.ui:1052 yms/ui/storage.ui:455 yms/ui/tasks.ui:589 +#: yms/ui/base.ui:638 yms/ui/base.ui:1299 yms/ui/boxes.ui:540 +#: yms/ui/cables.ui:658 yms/ui/companies.ui:1243 yms/ui/documents.ui:698 +#: yms/ui/equipment.ui:756 yms/ui/fuses.ui:510 yms/ui/inventory.ui:618 +#: yms/ui/maintenance.ui:534 yms/ui/measurement.ui:598 yms/ui/projects.ui:522 +#: yms/ui/provisions.ui:1235 yms/ui/storage.ui:514 yms/ui/tasks.ui:673 msgid "Delete" msgstr "Löschen" @@ -626,15 +650,15 @@ msgid "Add" msgstr "Hinzufügen" #: yms/ui/base.ui:667 yms/ui/base.ui:1630 yms/ui/boxes.ui:195 -#: yms/ui/boxes.ui:489 yms/ui/cables.ui:209 yms/ui/cables.ui:594 -#: yms/ui/companies.ui:147 yms/ui/companies.ui:1056 yms/ui/documents.ui:343 -#: yms/ui/documents.ui:660 yms/ui/equipment.ui:277 yms/ui/equipment.ui:672 -#: yms/ui/fuses.ui:194 yms/ui/fuses.ui:476 yms/ui/inventory.ui:200 -#: yms/ui/inventory.ui:595 yms/ui/maintenance.ui:179 yms/ui/maintenance.ui:482 -#: yms/ui/measurement.ui:179 yms/ui/measurement.ui:528 yms/ui/projects.ui:203 -#: yms/ui/projects.ui:477 yms/ui/provisions.ui:205 yms/ui/provisions.ui:1067 -#: yms/ui/storage.ui:189 yms/ui/storage.ui:470 yms/ui/tasks.ui:278 -#: yms/ui/tasks.ui:604 +#: yms/ui/boxes.ui:555 yms/ui/cables.ui:209 yms/ui/cables.ui:673 +#: yms/ui/companies.ui:147 yms/ui/companies.ui:1258 yms/ui/documents.ui:342 +#: yms/ui/documents.ui:713 yms/ui/equipment.ui:282 yms/ui/equipment.ui:771 +#: yms/ui/fuses.ui:194 yms/ui/fuses.ui:525 yms/ui/inventory.ui:205 +#: yms/ui/inventory.ui:633 yms/ui/maintenance.ui:189 yms/ui/maintenance.ui:549 +#: yms/ui/measurement.ui:184 yms/ui/measurement.ui:613 yms/ui/projects.ui:208 +#: yms/ui/projects.ui:537 yms/ui/provisions.ui:210 yms/ui/provisions.ui:1250 +#: yms/ui/storage.ui:189 yms/ui/storage.ui:529 yms/ui/tasks.ui:299 +#: yms/ui/tasks.ui:688 msgid "Edit" msgstr "Bearbeiten" @@ -655,10 +679,10 @@ msgid "Draught, min" msgstr "Tiefgang, min" #: yms/ui/base.ui:983 yms/ui/base.ui:1039 yms/ui/base.ui:1053 -#: yms/ui/boxes.ui:647 yms/ui/boxes.ui:662 yms/ui/boxes.ui:677 -#: yms/ui/boxes.ui:788 yms/ui/boxes.ui:801 yms/ui/boxes.ui:814 -#: yms/ui/provisions.ui:577 yms/ui/provisions.ui:601 yms/ui/storage.ui:738 -#: yms/ui/storage.ui:753 yms/ui/storage.ui:768 +#: yms/ui/boxes.ui:713 yms/ui/boxes.ui:728 yms/ui/boxes.ui:743 +#: yms/ui/boxes.ui:854 yms/ui/boxes.ui:867 yms/ui/boxes.ui:880 +#: yms/ui/provisions.ui:571 yms/ui/provisions.ui:595 yms/ui/storage.ui:797 +#: yms/ui/storage.ui:812 yms/ui/storage.ui:827 msgid "0" msgstr "" @@ -670,7 +694,7 @@ msgstr "Gurtposition, vorne" msgid "Hull type" msgstr "Rumpfform" -#: yms/ui/base.ui:1143 yms/ui/provisions.ui:625 +#: yms/ui/base.ui:1143 yms/ui/provisions.ui:619 msgid "0,00" msgstr "" @@ -679,19 +703,19 @@ msgid "Vessel type" msgstr "Bootstyp" #: yms/ui/base.ui:1195 yms/ui/base.ui:1543 yms/ui/base.ui:1818 -#: yms/ui/boxes.ui:938 yms/ui/cables.ui:1011 yms/ui/companies.ui:575 -#: yms/ui/documents.ui:877 yms/ui/equipment.ui:1035 yms/ui/fuses.ui:756 -#: yms/ui/inventory.ui:1030 yms/ui/maintenance.ui:781 yms/ui/measurement.ui:870 -#: yms/ui/projects.ui:744 yms/ui/provisions.ui:648 yms/ui/storage.ui:970 -#: yms/ui/tasks.ui:920 +#: yms/ui/boxes.ui:1061 yms/ui/cables.ui:1148 yms/ui/companies.ui:680 +#: yms/ui/documents.ui:986 yms/ui/equipment.ui:1214 yms/ui/fuses.ui:901 +#: yms/ui/inventory.ui:1148 yms/ui/maintenance.ui:952 +#: yms/ui/measurement.ui:1035 yms/ui/projects.ui:884 yms/ui/provisions.ui:733 +#: yms/ui/storage.ui:1084 yms/ui/tasks.ui:1161 msgid "Save" msgstr "Speichern" -#: yms/ui/base.ui:1209 yms/ui/boxes.ui:952 yms/ui/cables.ui:1025 -#: yms/ui/companies.ui:589 yms/ui/documents.ui:891 yms/ui/equipment.ui:1049 -#: yms/ui/fuses.ui:770 yms/ui/inventory.ui:1044 yms/ui/maintenance.ui:795 -#: yms/ui/measurement.ui:884 yms/ui/projects.ui:758 yms/ui/provisions.ui:662 -#: yms/ui/storage.ui:984 yms/ui/tasks.ui:934 +#: yms/ui/base.ui:1209 yms/ui/boxes.ui:1075 yms/ui/cables.ui:1162 +#: yms/ui/companies.ui:694 yms/ui/documents.ui:1000 yms/ui/equipment.ui:1228 +#: yms/ui/fuses.ui:915 yms/ui/inventory.ui:1162 yms/ui/maintenance.ui:966 +#: yms/ui/measurement.ui:1049 yms/ui/projects.ui:898 yms/ui/provisions.ui:747 +#: yms/ui/storage.ui:1098 yms/ui/tasks.ui:1175 msgid "Cancel" msgstr "Abbruch" @@ -704,10 +728,10 @@ msgid "Vessel" msgstr "Boot" #: yms/ui/base.ui:1285 yms/ui/boxes.ui:181 yms/ui/cables.ui:195 -#: yms/ui/companies.ui:133 yms/ui/documents.ui:329 yms/ui/equipment.ui:263 -#: yms/ui/fuses.ui:180 yms/ui/inventory.ui:186 yms/ui/maintenance.ui:165 -#: yms/ui/measurement.ui:165 yms/ui/projects.ui:188 yms/ui/provisions.ui:191 -#: yms/ui/storage.ui:175 yms/ui/tasks.ui:264 +#: yms/ui/companies.ui:133 yms/ui/documents.ui:328 yms/ui/equipment.ui:268 +#: yms/ui/fuses.ui:180 yms/ui/inventory.ui:191 yms/ui/maintenance.ui:175 +#: yms/ui/measurement.ui:170 yms/ui/projects.ui:193 yms/ui/provisions.ui:196 +#: yms/ui/storage.ui:175 yms/ui/tasks.ui:285 msgid "New" msgstr "Neu" @@ -748,10 +772,10 @@ msgid "User" msgstr "Benutzer" #: yms/ui/base.ui:1617 yms/ui/boxes.ui:209 yms/ui/cables.ui:223 -#: yms/ui/companies.ui:161 yms/ui/documents.ui:357 yms/ui/equipment.ui:291 -#: yms/ui/fuses.ui:208 yms/ui/inventory.ui:214 yms/ui/maintenance.ui:193 -#: yms/ui/measurement.ui:193 yms/ui/projects.ui:218 yms/ui/provisions.ui:219 -#: yms/ui/storage.ui:203 yms/ui/tasks.ui:292 +#: yms/ui/companies.ui:161 yms/ui/documents.ui:356 yms/ui/equipment.ui:296 +#: yms/ui/fuses.ui:208 yms/ui/inventory.ui:219 yms/ui/maintenance.ui:203 +#: yms/ui/measurement.ui:198 yms/ui/projects.ui:223 yms/ui/provisions.ui:224 +#: yms/ui/storage.ui:203 yms/ui/tasks.ui:313 msgid "Details" msgstr "" @@ -832,18 +856,18 @@ msgid "Restore" msgstr "" #: yms/ui/boxes.ui:61 yms/ui/cables.ui:56 yms/ui/companies.ui:24 -#: yms/ui/documents.ui:190 yms/ui/equipment.ui:41 yms/ui/fuses.ui:41 -#: yms/ui/inventory.ui:46 yms/ui/maintenance.ui:46 yms/ui/measurement.ui:46 -#: yms/ui/projects.ui:46 yms/ui/provisions.ui:115 yms/ui/storage.ui:71 -#: yms/ui/tasks.ui:31 +#: yms/ui/documents.ui:189 yms/ui/equipment.ui:46 yms/ui/fuses.ui:41 +#: yms/ui/inventory.ui:51 yms/ui/maintenance.ui:56 yms/ui/measurement.ui:51 +#: yms/ui/projects.ui:51 yms/ui/provisions.ui:120 yms/ui/storage.ui:71 +#: yms/ui/tasks.ui:52 msgid "Clear" msgstr "Löschen" #: yms/ui/boxes.ui:74 yms/ui/cables.ui:69 yms/ui/companies.ui:36 -#: yms/ui/documents.ui:203 yms/ui/equipment.ui:54 yms/ui/fuses.ui:54 -#: yms/ui/inventory.ui:59 yms/ui/maintenance.ui:59 yms/ui/measurement.ui:59 -#: yms/ui/projects.ui:60 yms/ui/provisions.ui:128 yms/ui/storage.ui:84 -#: yms/ui/tasks.ui:44 +#: yms/ui/documents.ui:202 yms/ui/equipment.ui:59 yms/ui/fuses.ui:54 +#: yms/ui/inventory.ui:64 yms/ui/maintenance.ui:69 yms/ui/measurement.ui:64 +#: yms/ui/projects.ui:65 yms/ui/provisions.ui:133 yms/ui/storage.ui:84 +#: yms/ui/tasks.ui:65 msgid "Apply" msgstr "Anwenden" @@ -852,72 +876,73 @@ msgid "Filter Box" msgstr "Filter Kisten" #: yms/ui/boxes.ui:231 yms/ui/cables.ui:245 yms/ui/companies.ui:183 -#: yms/ui/documents.ui:379 yms/ui/equipment.ui:313 yms/ui/fuses.ui:230 -#: yms/ui/inventory.ui:236 yms/ui/maintenance.ui:215 yms/ui/measurement.ui:215 -#: yms/ui/projects.ui:240 yms/ui/provisions.ui:241 yms/ui/storage.ui:225 -#: yms/ui/tasks.ui:314 +#: yms/ui/documents.ui:378 yms/ui/equipment.ui:318 yms/ui/fuses.ui:230 +#: yms/ui/inventory.ui:241 yms/ui/maintenance.ui:225 yms/ui/measurement.ui:220 +#: yms/ui/projects.ui:245 yms/ui/provisions.ui:246 yms/ui/storage.ui:225 +#: yms/ui/tasks.ui:335 msgid "page0" msgstr "" -#: yms/ui/boxes.ui:243 +#: yms/ui/boxes.ui:244 msgid "Box Details" msgstr "Kistendetails" -#: yms/ui/boxes.ui:343 yms/ui/boxes.ui:827 yms/ui/cables.ui:379 -#: yms/ui/cables.ui:785 yms/ui/storage.ui:395 yms/ui/storage.ui:879 +#: yms/ui/boxes.ui:370 yms/ui/boxes.ui:893 yms/ui/cables.ui:407 +#: yms/ui/cables.ui:864 yms/ui/fuses.ui:786 yms/ui/storage.ui:440 +#: yms/ui/storage.ui:938 msgid "Color" -msgstr "" +msgstr "Farbe" -#: yms/ui/boxes.ui:354 yms/ui/boxes.ui:701 yms/ui/cables.ui:368 -#: yms/ui/cables.ui:774 yms/ui/equipment.ui:400 yms/ui/inventory.ui:334 -#: yms/ui/inventory.ui:757 yms/ui/provisions.ui:336 yms/ui/provisions.ui:808 +#: yms/ui/boxes.ui:384 yms/ui/boxes.ui:767 yms/ui/cables.ui:393 +#: yms/ui/cables.ui:853 yms/ui/equipment.ui:423 yms/ui/inventory.ui:332 +#: yms/ui/inventory.ui:795 yms/ui/provisions.ui:341 yms/ui/provisions.ui:920 msgid "Weight" msgstr "Gewicht" -#: yms/ui/boxes.ui:398 yms/ui/boxes.ui:742 yms/ui/provisions.ui:347 -#: yms/ui/provisions.ui:819 +#: yms/ui/boxes.ui:443 yms/ui/boxes.ui:808 yms/ui/provisions.ui:352 +#: yms/ui/provisions.ui:934 msgid "Weight net" msgstr "Nettogewicht" -#: yms/ui/boxes.ui:420 yms/ui/boxes.ui:690 yms/ui/equipment.ui:411 -#: yms/ui/inventory.ui:345 yms/ui/inventory.ui:768 yms/ui/provisions.ui:613 -#: yms/ui/provisions.ui:947 +#: yms/ui/boxes.ui:472 yms/ui/boxes.ui:756 yms/ui/equipment.ui:437 +#: yms/ui/inventory.ui:346 yms/ui/inventory.ui:806 yms/ui/provisions.ui:607 +#: yms/ui/provisions.ui:1102 msgid "Price" msgstr "Preis" -#: yms/ui/boxes.ui:503 yms/ui/cables.ui:608 yms/ui/companies.ui:1070 -#: yms/ui/documents.ui:49 yms/ui/documents.ui:139 yms/ui/documents.ui:674 -#: yms/ui/equipment.ui:686 yms/ui/fuses.ui:490 yms/ui/inventory.ui:609 -#: yms/ui/maintenance.ui:496 yms/ui/measurement.ui:542 yms/ui/projects.ui:491 -#: yms/ui/provisions.ui:1081 yms/ui/storage.ui:484 yms/ui/tasks.ui:618 +#: yms/ui/boxes.ui:569 yms/ui/cables.ui:687 yms/ui/companies.ui:1272 +#: yms/ui/documents.ui:48 yms/ui/documents.ui:138 yms/ui/documents.ui:727 +#: yms/ui/equipment.ui:785 yms/ui/fuses.ui:539 yms/ui/inventory.ui:647 +#: yms/ui/maintenance.ui:563 yms/ui/measurement.ui:627 yms/ui/projects.ui:551 +#: yms/ui/provisions.ui:1264 yms/ui/storage.ui:543 yms/ui/tasks.ui:702 msgid "Close" msgstr "Schließen" -#: yms/ui/boxes.ui:525 yms/ui/cables.ui:630 yms/ui/companies.ui:612 -#: yms/ui/documents.ui:696 yms/ui/equipment.ui:723 yms/ui/fuses.ui:512 -#: yms/ui/inventory.ui:646 yms/ui/maintenance.ui:518 yms/ui/measurement.ui:564 -#: yms/ui/projects.ui:513 yms/ui/provisions.ui:684 yms/ui/storage.ui:506 -#: yms/ui/tasks.ui:640 +#: yms/ui/boxes.ui:591 yms/ui/cables.ui:709 yms/ui/companies.ui:717 +#: yms/ui/documents.ui:749 yms/ui/equipment.ui:822 yms/ui/fuses.ui:561 +#: yms/ui/inventory.ui:684 yms/ui/maintenance.ui:585 yms/ui/measurement.ui:649 +#: yms/ui/projects.ui:573 yms/ui/provisions.ui:769 yms/ui/storage.ui:565 +#: yms/ui/tasks.ui:724 msgid "page1" msgstr "" -#: yms/ui/boxes.ui:608 +#: yms/ui/boxes.ui:674 msgid "Dimensions (L x W x H)" msgstr "Abmessungen (L x B x H)" -#: yms/ui/boxes.ui:621 yms/ui/boxes.ui:634 +#: yms/ui/boxes.ui:687 yms/ui/boxes.ui:700 msgid "x" msgstr "" -#: yms/ui/boxes.ui:755 +#: yms/ui/boxes.ui:821 msgid "mm" msgstr "" -#: yms/ui/boxes.ui:974 yms/ui/cables.ui:1047 yms/ui/companies.ui:1092 -#: yms/ui/documents.ui:943 yms/ui/equipment.ui:1072 yms/ui/fuses.ui:792 -#: yms/ui/inventory.ui:1066 yms/ui/maintenance.ui:817 yms/ui/measurement.ui:906 -#: yms/ui/projects.ui:780 yms/ui/provisions.ui:1103 yms/ui/storage.ui:1006 -#: yms/ui/tasks.ui:956 +#: yms/ui/boxes.ui:1097 yms/ui/cables.ui:1184 yms/ui/companies.ui:1294 +#: yms/ui/documents.ui:1052 yms/ui/equipment.ui:1251 yms/ui/fuses.ui:937 +#: yms/ui/inventory.ui:1184 yms/ui/maintenance.ui:988 +#: yms/ui/measurement.ui:1071 yms/ui/projects.ui:920 yms/ui/provisions.ui:1286 +#: yms/ui/storage.ui:1120 yms/ui/tasks.ui:1197 msgid "page2" msgstr "" @@ -925,42 +950,34 @@ msgstr "" msgid "Filter Cables" msgstr "Filter Kabel" -#: yms/ui/cables.ui:257 +#: yms/ui/cables.ui:258 msgid "Cable Details" msgstr "Kabeldetails" -#: yms/ui/cables.ui:312 yms/ui/cables.ui:707 +#: yms/ui/cables.ui:322 yms/ui/cables.ui:786 msgid "Tech.-name" msgstr "" -#: yms/ui/cables.ui:324 yms/ui/cables.ui:718 -msgid "Length" -msgstr "Länge" - -#: yms/ui/cables.ui:335 yms/ui/cables.ui:733 +#: yms/ui/cables.ui:351 yms/ui/cables.ui:812 msgid "Conductors" msgstr "Leiter" -#: yms/ui/cables.ui:346 yms/ui/cables.ui:748 +#: yms/ui/cables.ui:365 yms/ui/cables.ui:827 msgid "Diameter" msgstr "Durchmesser" -#: yms/ui/cables.ui:357 yms/ui/cables.ui:759 +#: yms/ui/cables.ui:379 yms/ui/cables.ui:838 msgid "Cross section" msgstr "Querschnitt" -#: yms/ui/cables.ui:390 yms/ui/cables.ui:796 yms/ui/equipment.ui:98 -#: yms/ui/equipment.ui:433 yms/ui/equipment.ui:907 +#: yms/ui/cables.ui:421 yms/ui/cables.ui:875 yms/ui/equipment.ui:103 +#: yms/ui/equipment.ui:465 yms/ui/equipment.ui:996 msgid "Supplier" msgstr "Lieferant" -#: yms/ui/cables.ui:644 -msgid "Edit Cable" -msgstr "Bearbeite Kabel" - -#: yms/ui/companies.ui:61 yms/ui/documents.ui:247 yms/ui/equipment.ui:109 -#: yms/ui/inventory.ui:103 yms/ui/maintenance.ui:92 yms/ui/measurement.ui:92 -#: yms/ui/provisions.ui:87 yms/ui/storage.ui:106 yms/ui/tasks.ui:88 +#: yms/ui/companies.ui:61 yms/ui/documents.ui:246 yms/ui/equipment.ui:114 +#: yms/ui/inventory.ui:108 yms/ui/maintenance.ui:102 yms/ui/measurement.ui:97 +#: yms/ui/provisions.ui:92 yms/ui/storage.ui:106 yms/ui/tasks.ui:109 msgid "Text" msgstr "" @@ -976,168 +993,173 @@ msgstr "Bearbeite Firma" msgid "Secondary type" msgstr "Sekundärer Typ" -#: yms/ui/companies.ui:291 yms/ui/companies.ui:678 yms/ui/equipment.ui:356 -#: yms/ui/equipment.ui:770 +#: yms/ui/companies.ui:291 yms/ui/companies.ui:792 yms/ui/equipment.ui:367 +#: yms/ui/equipment.ui:869 msgid "Short name" msgstr "Kurzname" -#: yms/ui/companies.ui:313 yms/ui/companies.ui:689 +#: yms/ui/companies.ui:313 yms/ui/companies.ui:806 msgid "Street" msgstr "Straße" -#: yms/ui/companies.ui:324 yms/ui/companies.ui:700 +#: yms/ui/companies.ui:324 yms/ui/companies.ui:820 msgid "ZIP" msgstr "PLZ" -#: yms/ui/companies.ui:335 yms/ui/companies.ui:711 +#: yms/ui/companies.ui:335 yms/ui/companies.ui:834 msgid "City" msgstr "Stadt" -#: yms/ui/companies.ui:346 yms/ui/companies.ui:722 +#: yms/ui/companies.ui:346 yms/ui/companies.ui:848 msgid "Country" msgstr "Land" -#: yms/ui/companies.ui:357 yms/ui/companies.ui:837 +#: yms/ui/companies.ui:357 yms/ui/companies.ui:990 msgid "Contact" msgstr "Kontakt" -#: yms/ui/companies.ui:368 yms/ui/companies.ui:848 +#: yms/ui/companies.ui:368 yms/ui/companies.ui:1004 msgid "Phone" msgstr "Telefon" -#: yms/ui/companies.ui:379 yms/ui/companies.ui:859 +#: yms/ui/companies.ui:379 yms/ui/companies.ui:1018 msgid "Email" msgstr "" -#: yms/ui/companies.ui:390 yms/ui/companies.ui:870 +#: yms/ui/companies.ui:390 yms/ui/companies.ui:1032 msgid "Web" msgstr "" -#: yms/ui/companies.ui:401 yms/ui/companies.ui:881 +#: yms/ui/companies.ui:401 yms/ui/companies.ui:1046 msgid "Customer no." msgstr "Kundennr." -#: yms/ui/companies.ui:412 yms/ui/companies.ui:892 +#: yms/ui/companies.ui:412 yms/ui/companies.ui:1060 msgid "Contract no." msgstr "Kontraktnr." -#: yms/ui/companies.ui:625 -msgid "Company details" -msgstr "Firmendetails" - -#: yms/ui/companies.ui:667 -msgid "Type secondary" -msgstr "" - -#: yms/ui/companies.ui:1007 yms/ui/equipment.ui:120 yms/ui/equipment.ui:601 -#: yms/ui/inventory.ui:547 yms/ui/inventory.ui:940 +#: yms/ui/companies.ui:565 yms/ui/companies.ui:1203 yms/ui/equipment.ui:125 +#: yms/ui/equipment.ui:686 yms/ui/inventory.ui:578 yms/ui/inventory.ui:968 msgid "Flags" msgstr "" -#: yms/ui/documents.ui:23 -msgid "Preview" -msgstr "Vorschau" +#: yms/ui/companies.ui:578 +msgid "historic" +msgstr "Historisch" -#: yms/ui/documents.ui:36 yms/ui/documents.ui:920 -msgid "Scan" -msgstr "" - -#: yms/ui/documents.ui:236 -msgid "Reference" -msgstr "Referenz" - -#: yms/ui/documents.ui:290 -msgid "Filter Documents" -msgstr "Filter Dokumente" - -#: yms/ui/documents.ui:391 -msgid "Document Details" -msgstr "Dokumentdetails" - -#: yms/ui/documents.ui:445 -msgid "Image extents" -msgstr "Abmaße" - -#: yms/ui/documents.ui:456 -msgid "Mimetype" -msgstr "" - -#: yms/ui/documents.ui:503 -msgid "File size" -msgstr "Dateigröße" - -#: yms/ui/documents.ui:514 -msgid "Upload date" -msgstr "Uploaddatum" - -#: yms/ui/documents.ui:525 yms/ui/documents.ui:807 -msgid "Document type" -msgstr "Dokumentart" - -#: yms/ui/documents.ui:598 -msgid "Role access" -msgstr "" - -#: yms/ui/documents.ui:711 -msgid "Edit Document" -msgstr "Dokument bearbeiten" - -#: yms/ui/documents.ui:831 -msgid "Access level" -msgstr "Zugriffsebene" - -#: yms/ui/documents.ui:905 -msgid "Upload" -msgstr "" - -#: yms/ui/equipment.ui:76 yms/ui/equipment.ui:444 yms/ui/equipment.ui:918 -#: yms/ui/inventory.ui:524 yms/ui/inventory.ui:919 yms/ui/measurement.ui:457 -#: yms/ui/measurement.ui:817 yms/ui/provisions.ui:64 yms/ui/provisions.ui:289 -#: yms/ui/provisions.ui:728 -msgid "Category" -msgstr "Kategorie" - -#: yms/ui/equipment.ui:169 yms/ui/inventory.ui:970 -msgid "ordered" -msgstr "bestellt" - -#: yms/ui/equipment.ui:182 yms/ui/inventory.ui:984 -msgid "removed" -msgstr "entfernt" - -#: yms/ui/equipment.ui:195 yms/ui/inventory.ui:998 yms/ui/tasks.ui:184 +#: yms/ui/companies.ui:592 yms/ui/equipment.ui:200 yms/ui/inventory.ui:1026 +#: yms/ui/tasks.ui:205 msgid "deleted" msgstr "gelöscht" -#: yms/ui/equipment.ui:224 +#: yms/ui/companies.ui:731 +msgid "Company details" +msgstr "Firmendetails" + +#: yms/ui/companies.ui:778 +msgid "Type secondary" +msgstr "" + +#: yms/ui/documents.ui:22 +msgid "Preview" +msgstr "Vorschau" + +#: yms/ui/documents.ui:35 yms/ui/documents.ui:1029 +msgid "Scan" +msgstr "" + +#: yms/ui/documents.ui:235 +msgid "Reference" +msgstr "Referenz" + +#: yms/ui/documents.ui:289 +msgid "Filter Documents" +msgstr "Filter Dokumente" + +#: yms/ui/documents.ui:390 +msgid "Document Details" +msgstr "Dokumentdetails" + +#: yms/ui/documents.ui:453 +msgid "Image extents" +msgstr "Abmaße" + +#: yms/ui/documents.ui:467 +msgid "Mimetype" +msgstr "" + +#: yms/ui/documents.ui:526 +msgid "File size" +msgstr "Dateigröße" + +#: yms/ui/documents.ui:540 +msgid "Upload date" +msgstr "Uploaddatum" + +#: yms/ui/documents.ui:554 yms/ui/documents.ui:860 +msgid "Document type" +msgstr "Dokumentart" + +#: yms/ui/documents.ui:645 +msgid "Role access" +msgstr "" + +#: yms/ui/documents.ui:764 +msgid "Edit Document" +msgstr "Dokument bearbeiten" + +#: yms/ui/documents.ui:884 +msgid "Access level" +msgstr "Zugriffsebene" + +#: yms/ui/documents.ui:1014 +msgid "Upload" +msgstr "" + +#: yms/ui/equipment.ui:81 yms/ui/equipment.ui:479 yms/ui/equipment.ui:1007 +#: yms/ui/inventory.ui:548 yms/ui/inventory.ui:947 yms/ui/measurement.ui:528 +#: yms/ui/measurement.ui:892 yms/ui/provisions.ui:69 yms/ui/provisions.ui:294 +#: yms/ui/provisions.ui:819 +msgid "Category" +msgstr "Kategorie" + +#: yms/ui/equipment.ui:174 yms/ui/inventory.ui:998 +msgid "ordered" +msgstr "bestellt" + +#: yms/ui/equipment.ui:187 yms/ui/inventory.ui:1012 +msgid "removed" +msgstr "entfernt" + +#: yms/ui/equipment.ui:229 msgid "Filter Equipment" msgstr "Filter Ausrüstung" -#: yms/ui/equipment.ui:325 +#: yms/ui/equipment.ui:331 msgid "Equipment details" msgstr "Ausrüstungsdetails" -#: yms/ui/equipment.ui:389 yms/ui/equipment.ui:823 +#: yms/ui/equipment.ui:409 yms/ui/equipment.ui:922 msgid "Serial no." msgstr "Seriennummer" -#: yms/ui/equipment.ui:422 +#: yms/ui/equipment.ui:451 msgid "Date purchase" msgstr "Kaufdatum" -#: yms/ui/equipment.ui:700 yms/ui/inventory.ui:623 +#: yms/ui/equipment.ui:799 yms/ui/inventory.ui:661 msgid "Convert" msgstr "Umwandeln" -#: yms/ui/equipment.ui:834 +#: yms/ui/equipment.ui:933 msgid "Weight, kg" msgstr "Gewicht, kg" -#: yms/ui/equipment.ui:845 +#: yms/ui/equipment.ui:944 msgid "Price, €" msgstr "Preis, €" -#: yms/ui/equipment.ui:856 +#: yms/ui/equipment.ui:955 msgid "Date puchase" msgstr "Kaufdatum" @@ -1145,162 +1167,161 @@ msgstr "Kaufdatum" msgid "Filter Fuses" msgstr "Filter Sicherungen" -#: yms/ui/fuses.ui:242 +#: yms/ui/fuses.ui:243 msgid "Fuse Details" msgstr "Sicherungsdetails" -#: yms/ui/fuses.ui:309 yms/ui/fuses.ui:606 +#: yms/ui/fuses.ui:322 yms/ui/fuses.ui:649 msgid "Cable" msgstr "Kabel" -#: yms/ui/fuses.ui:331 yms/ui/fuses.ui:628 +#: yms/ui/fuses.ui:350 yms/ui/fuses.ui:671 msgid "Location" msgstr "Ort" -#: yms/ui/inventory.ui:146 +#: yms/ui/inventory.ui:151 msgid "Filter Inventory" msgstr "Filter Inventar" -#: yms/ui/inventory.ui:248 +#: yms/ui/inventory.ui:254 msgid "Inventory details" msgstr "Inventardetails" -#: yms/ui/inventory.ui:301 yms/ui/inventory.ui:721 yms/ui/provisions.ui:311 -#: yms/ui/provisions.ui:786 -msgid "Box" -msgstr "Kiste" - -#: yms/ui/inventory.ui:356 +#: yms/ui/inventory.ui:360 msgid "Purchase Date" msgstr "Kaufdatum" -#: yms/ui/inventory.ui:660 +#: yms/ui/inventory.ui:698 msgid "Edit inventory" msgstr "Inventar bearbeiten" -#: yms/ui/inventory.ui:779 +#: yms/ui/inventory.ui:759 yms/ui/provisions.ui:316 yms/ui/provisions.ui:892 +msgid "Box" +msgstr "Kiste" + +#: yms/ui/inventory.ui:817 msgid "Puchase date" msgstr "Kaufdatum" -#: yms/ui/maintenance.ui:126 +#: yms/ui/maintenance.ui:136 msgid "Filter Maintenance" msgstr "Filter Wartung" -#: yms/ui/maintenance.ui:227 +#: yms/ui/maintenance.ui:238 msgid "Maintenance Details" msgstr "Wartungsdetails" -#: yms/ui/maintenance.ui:293 yms/ui/maintenance.ui:584 +#: yms/ui/maintenance.ui:318 yms/ui/maintenance.ui:651 msgid "Series" msgstr "Serie" -#: yms/ui/maintenance.ui:304 +#: yms/ui/maintenance.ui:332 msgid "Interval hours" msgstr "" -#: yms/ui/maintenance.ui:315 yms/ui/maintenance.ui:606 +#: yms/ui/maintenance.ui:346 yms/ui/maintenance.ui:673 msgid "Last hours" msgstr "" -#: yms/ui/maintenance.ui:326 yms/ui/maintenance.ui:617 yms/ui/tasks.ui:438 +#: yms/ui/maintenance.ui:360 yms/ui/maintenance.ui:684 yms/ui/tasks.ui:486 msgid "Plan date" msgstr "Plandatum" -#: yms/ui/maintenance.ui:337 yms/ui/maintenance.ui:628 +#: yms/ui/maintenance.ui:374 yms/ui/maintenance.ui:695 msgid "Completion date" msgstr "Fertigstellungsdatum" -#: yms/ui/maintenance.ui:595 +#: yms/ui/maintenance.ui:662 msgid "Interval" msgstr "Intervall" -#: yms/ui/measurement.ui:126 +#: yms/ui/measurement.ui:131 msgid "Filter Measurement" msgstr "Filter Maß/Messung" -#: yms/ui/measurement.ui:227 +#: yms/ui/measurement.ui:233 msgid "Measurement Details" msgstr "Maß/Messung-Details" -#: yms/ui/measurement.ui:293 +#: yms/ui/measurement.ui:315 msgid "Dimensions" msgstr "Abmessungen" -#: yms/ui/measurement.ui:304 yms/ui/measurement.ui:630 +#: yms/ui/measurement.ui:329 yms/ui/measurement.ui:715 msgid "Value 1" msgstr "Wert 1" -#: yms/ui/measurement.ui:315 yms/ui/measurement.ui:641 +#: yms/ui/measurement.ui:343 yms/ui/measurement.ui:726 msgid "Value 2" msgstr "Wert 2" -#: yms/ui/measurement.ui:326 yms/ui/measurement.ui:652 +#: yms/ui/measurement.ui:357 yms/ui/measurement.ui:737 msgid "Value 3" msgstr "Wert 3" -#: yms/ui/measurement.ui:480 yms/ui/measurement.ui:674 +#: yms/ui/measurement.ui:558 yms/ui/measurement.ui:759 msgid "Date" msgstr "Datum" #. 1 to 3 dimensions -#: yms/ui/measurement.ui:616 +#: yms/ui/measurement.ui:701 msgctxt "measurement" msgid "Dimensions" msgstr "Dimensionen" -#: yms/ui/projects.ui:149 +#: yms/ui/projects.ui:154 msgid "Filter Projects" msgstr "Filter Projekte" -#: yms/ui/projects.ui:252 +#: yms/ui/projects.ui:258 msgid "Project Details" msgstr "Projektdetails" -#: yms/ui/projects.ui:294 yms/ui/projects.ui:573 +#: yms/ui/projects.ui:308 yms/ui/projects.ui:633 msgid "Date start" msgstr "Startdatum" -#: yms/ui/projects.ui:305 +#: yms/ui/projects.ui:322 msgid "Duration, days" msgstr "Dauer, Tage" -#: yms/ui/projects.ui:316 yms/ui/projects.ui:595 +#: yms/ui/projects.ui:336 yms/ui/projects.ui:655 msgid "Costs plan" msgstr "Geplante Kosten" -#: yms/ui/projects.ui:327 yms/ui/projects.ui:606 +#: yms/ui/projects.ui:350 yms/ui/projects.ui:666 msgid "Costs final" msgstr "Tatsächliche Kosten" -#: yms/ui/projects.ui:584 +#: yms/ui/projects.ui:644 msgid "Duration days" msgstr "" -#: yms/ui/provisions.ui:152 +#: yms/ui/provisions.ui:157 msgid "Filter Provisions" msgstr "Filter Verpflegung" -#: yms/ui/provisions.ui:253 +#: yms/ui/provisions.ui:258 msgid "Edit provision" msgstr "Verpflegung bearbeiten" -#: yms/ui/provisions.ui:369 yms/ui/provisions.ui:841 +#: yms/ui/provisions.ui:374 yms/ui/provisions.ui:962 msgid "Storedate" msgstr "Einlagerdatum" -#: yms/ui/provisions.ui:380 yms/ui/provisions.ui:852 +#: yms/ui/provisions.ui:385 yms/ui/provisions.ui:976 msgid "Shelflife" msgstr "Haltbarkeit" -#: yms/ui/provisions.ui:565 yms/ui/provisions.ui:970 +#: yms/ui/provisions.ui:559 yms/ui/provisions.ui:1132 msgid "Target" msgstr "Zielbestand" -#: yms/ui/provisions.ui:589 yms/ui/provisions.ui:1019 +#: yms/ui/provisions.ui:583 yms/ui/provisions.ui:1195 msgid "Calories" msgstr "Kalorien" -#: yms/ui/provisions.ui:697 +#: yms/ui/provisions.ui:783 msgid "View Provision" msgstr "Verpflegung ansehen" @@ -1330,91 +1351,91 @@ msgstr "Konfiguration" msgid "Filter Storage" msgstr "Filter Stauraum" -#: yms/ui/storage.ui:237 +#: yms/ui/storage.ui:238 msgid "Storage Details" msgstr "Stauraumdetails" -#: yms/ui/storage.ui:291 +#: yms/ui/storage.ui:304 msgid "Position (x, y, z)" msgstr "" -#: yms/ui/storage.ui:302 +#: yms/ui/storage.ui:318 msgid "Dimension (x, y, z)" msgstr "Maße (x, y, z)" -#: yms/ui/storage.ui:313 yms/ui/storage.ui:781 +#: yms/ui/storage.ui:332 yms/ui/storage.ui:840 msgid "Angle" msgstr "Winkel" -#: yms/ui/storage.ui:324 yms/ui/storage.ui:804 +#: yms/ui/storage.ui:346 yms/ui/storage.ui:863 msgid "Capacity" msgstr "Kapazität" -#: yms/ui/storage.ui:558 +#: yms/ui/storage.ui:617 msgid "Typ" msgstr "Typ" -#: yms/ui/storage.ui:572 +#: yms/ui/storage.ui:631 msgid "Position, mm" msgstr "" -#: yms/ui/storage.ui:686 +#: yms/ui/storage.ui:745 msgid "Width, mm" msgstr "Breite, mm" -#: yms/ui/storage.ui:916 +#: yms/ui/storage.ui:975 msgid "Deg" msgstr "Grad" -#: yms/ui/tasks.ui:66 yms/ui/tasks.ui:777 +#: yms/ui/tasks.ui:87 yms/ui/tasks.ui:851 msgid "Project" msgstr "Projekt" -#: yms/ui/tasks.ui:142 +#: yms/ui/tasks.ui:163 msgid "pending" msgstr "Ausstehend" -#: yms/ui/tasks.ui:156 +#: yms/ui/tasks.ui:177 msgid "active" msgstr "Aktiv" -#: yms/ui/tasks.ui:170 +#: yms/ui/tasks.ui:191 msgid "waiting" msgstr "Wartend" -#: yms/ui/tasks.ui:198 +#: yms/ui/tasks.ui:219 msgid "completed" msgstr "Abgeschlossen" -#: yms/ui/tasks.ui:225 +#: yms/ui/tasks.ui:246 msgid "Filter Tasks" msgstr "Filter Aufgaben" -#: yms/ui/tasks.ui:326 +#: yms/ui/tasks.ui:348 msgid "Task Details" msgstr "Aufgabendetails" -#: yms/ui/tasks.ui:391 +#: yms/ui/tasks.ui:427 msgid "Timestamp" msgstr "Zeitstempel" -#: yms/ui/tasks.ui:449 +#: yms/ui/tasks.ui:500 msgid "Due date" msgstr "Fälligkeitsdatum" -#: yms/ui/tasks.ui:460 yms/ui/tasks.ui:868 +#: yms/ui/tasks.ui:514 yms/ui/tasks.ui:932 msgid "Started" msgstr "Gestartet" -#: yms/ui/tasks.ui:533 yms/ui/tasks.ui:879 +#: yms/ui/tasks.ui:605 yms/ui/tasks.ui:943 msgid "Finished" msgstr "Beendet" -#: yms/ui/tasks.ui:812 +#: yms/ui/tasks.ui:886 msgid "Plan Date" msgstr "Plandatum" -#: yms/ui/tasks.ui:823 +#: yms/ui/tasks.ui:897 msgid "Due Date" msgstr "Fälligkeitsdatum" @@ -1458,32 +1479,32 @@ msgctxt "cable.cablecond" msgid "unknown" msgstr "Unbekannt" -#: db/mariadb.sql:529 +#: db/mariadb.sql:530 msgctxt "checkitem.checkresult" msgid "checked" msgstr "Markiert" -#: db/mariadb.sql:529 +#: db/mariadb.sql:530 msgctxt "checkitem.checkresult" msgid "unchecked" msgstr "Unmarkiert" -#: db/mariadb.sql:529 +#: db/mariadb.sql:530 msgctxt "checkitem.checkresult" msgid "unused" msgstr "Unbenutzt" -#: db/mariadb.sql:512 +#: db/mariadb.sql:513 msgctxt "checklist.clstate" msgid "closed" msgstr "Geschlossen" -#: db/mariadb.sql:512 +#: db/mariadb.sql:513 msgctxt "checklist.clstate" msgid "new" msgstr "Neu" -#: db/mariadb.sql:512 +#: db/mariadb.sql:513 msgctxt "checklist.clstate" msgid "open" msgstr "Offen" @@ -1498,87 +1519,87 @@ msgctxt "company.flags" msgid "historic" msgstr "Historisch" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "box" msgstr "Kiste" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "company" msgstr "Firma" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "equipment" msgstr "Ausrüstung" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "maint" msgstr "Wartung" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "project" msgstr "Projekt" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "task" msgstr "Aufgabe" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "user" msgstr "Benutzer" -#: db/mariadb.sql:397 +#: db/mariadb.sql:398 msgctxt "docref.reftype" msgid "vessel" msgstr "Boot" -#: db/mariadb.sql:379 +#: db/mariadb.sql:380 msgctxt "document.doctype" msgid "drawing" msgstr "Zeichnung" -#: db/mariadb.sql:379 +#: db/mariadb.sql:380 msgctxt "document.doctype" msgid "generic" msgstr "Allgemein" -#: db/mariadb.sql:379 +#: db/mariadb.sql:380 msgctxt "document.doctype" msgid "invoice" msgstr "Rechnung" -#: db/mariadb.sql:379 +#: db/mariadb.sql:380 msgctxt "document.doctype" msgid "manual" msgstr "Handbuch" -#: db/mariadb.sql:379 +#: db/mariadb.sql:380 msgctxt "document.doctype" msgid "picture" msgstr "Bild" -#: db/mariadb.sql:390 +#: db/mariadb.sql:391 msgctxt "document.roleaccess" msgid "captain" msgstr "Kapitän" -#: db/mariadb.sql:390 +#: db/mariadb.sql:391 msgctxt "document.roleaccess" msgid "helmsman" msgstr "Steuermann" -#: db/mariadb.sql:390 +#: db/mariadb.sql:391 msgctxt "document.roleaccess" msgid "sailor" msgstr "Seemann" -#: db/mariadb.sql:390 +#: db/mariadb.sql:391 msgctxt "document.roleaccess" msgid "unauth" msgstr "Unauthorisiert" @@ -1703,162 +1724,162 @@ msgctxt "inventory.invcond" msgid "unknown" msgstr "Unbekannt" -#: db/mariadb.sql:424 +#: db/mariadb.sql:425 msgctxt "maintenance.maintstate" msgid "done" msgstr "Erledigt" -#: db/mariadb.sql:424 +#: db/mariadb.sql:425 msgctxt "maintenance.maintstate" msgid "missed" msgstr "Verpaßt" -#: db/mariadb.sql:424 +#: db/mariadb.sql:425 msgctxt "maintenance.maintstate" msgid "new" msgstr "Neu" -#: db/mariadb.sql:424 +#: db/mariadb.sql:425 msgctxt "maintenance.maintstate" msgid "ongoing" msgstr "Laufend" -#: db/mariadb.sql:424 +#: db/mariadb.sql:425 msgctxt "maintenance.maintstate" msgid "plan" msgstr "Geplant" -#: db/mariadb.sql:424 +#: db/mariadb.sql:425 msgctxt "maintenance.maintstate" msgid "skipped" msgstr "Übersprungen" -#: db/mariadb.sql:419 +#: db/mariadb.sql:420 msgctxt "maintenance.plan_precision" msgid "day" msgstr "Tag" -#: db/mariadb.sql:419 +#: db/mariadb.sql:420 msgctxt "maintenance.plan_precision" msgid "month" msgstr "Monat" -#: db/mariadb.sql:419 +#: db/mariadb.sql:420 msgctxt "maintenance.plan_precision" msgid "quarter" msgstr "Quartal" -#: db/mariadb.sql:419 +#: db/mariadb.sql:420 msgctxt "maintenance.plan_precision" msgid "week" msgstr "Woche" -#: db/mariadb.sql:334 +#: db/mariadb.sql:335 msgctxt "measurement.accuracy" msgid "estimated" msgstr "Geschätzt" -#: db/mariadb.sql:334 +#: db/mariadb.sql:335 msgctxt "measurement.accuracy" msgid "normal" msgstr "Normal" -#: db/mariadb.sql:334 +#: db/mariadb.sql:335 msgctxt "measurement.accuracy" msgid "precise" msgstr "Genau" -#: db/mariadb.sql:334 +#: db/mariadb.sql:335 msgctxt "measurement.accuracy" msgid "rough" msgstr "Grob" -#: db/mariadb.sql:334 +#: db/mariadb.sql:335 msgctxt "measurement.accuracy" msgid "unknown" msgstr "Unbekannt" -#: db/mariadb.sql:485 +#: db/mariadb.sql:486 msgctxt "note.notetype" msgid "equip" msgstr "Ausrüstung" -#: db/mariadb.sql:485 +#: db/mariadb.sql:486 msgctxt "note.notetype" msgid "maint" msgstr "Wartung" -#: db/mariadb.sql:485 +#: db/mariadb.sql:486 msgctxt "note.notetype" msgid "task" msgstr "Aufgabe" -#: db/mariadb.sql:445 +#: db/mariadb.sql:446 msgctxt "project.projstate" msgid "finished" msgstr "Beendet" -#: db/mariadb.sql:445 +#: db/mariadb.sql:446 msgctxt "project.projstate" msgid "new" msgstr "Neu" -#: db/mariadb.sql:445 +#: db/mariadb.sql:446 msgctxt "project.projstate" msgid "ongoing" msgstr "Laufend" -#: db/mariadb.sql:445 +#: db/mariadb.sql:446 msgctxt "project.projstate" msgid "paused" msgstr "Pausiert" -#: db/mariadb.sql:445 +#: db/mariadb.sql:446 msgctxt "project.projstate" msgid "plan" msgstr "Geplant" -#: db/mariadb.sql:500 +#: db/mariadb.sql:501 msgctxt "property.objtype" msgid "equip" msgstr "Ausrüstung" -#: db/mariadb.sql:500 +#: db/mariadb.sql:501 msgctxt "property.objtype" msgid "inv" msgstr "Inventar" -#: db/mariadb.sql:500 +#: db/mariadb.sql:501 msgctxt "property.objtype" msgid "maint" msgstr "Wartung" -#: db/mariadb.sql:500 +#: db/mariadb.sql:501 msgctxt "property.objtype" msgid "proj" msgstr "Projekt" -#: db/mariadb.sql:500 +#: db/mariadb.sql:501 msgctxt "property.objtype" msgid "vessel" msgstr "Boot" -#: db/mariadb.sql:582 +#: db/mariadb.sql:583 msgctxt "revision.revtype" msgid "dropdown" msgstr "Dropdown" -#: db/mariadb.sql:582 +#: db/mariadb.sql:583 msgctxt "revision.revtype" msgid "table" msgstr "Tabelle" -#: db/mariadb.sql:553 +#: db/mariadb.sql:554 msgctxt "signalk.objtype" msgid "equipment" msgstr "Ausrüstung" -#: db/mariadb.sql:553 +#: db/mariadb.sql:554 msgctxt "signalk.objtype" msgid "storage" msgstr "Stauraum" @@ -1913,42 +1934,42 @@ msgctxt "tagref.objtype" msgid "task" msgstr "Aufgabe" -#: db/mariadb.sql:461 +#: db/mariadb.sql:462 msgctxt "task.priority" msgid "high" msgstr "Hoch" -#: db/mariadb.sql:461 +#: db/mariadb.sql:462 msgctxt "task.priority" msgid "low" msgstr "Niedrig" -#: db/mariadb.sql:461 +#: db/mariadb.sql:462 msgctxt "task.priority" msgid "medium" msgstr "Mittel" -#: db/mariadb.sql:462 +#: db/mariadb.sql:463 msgctxt "task.taskstate" msgid "active" msgstr "Aktiv" -#: db/mariadb.sql:462 +#: db/mariadb.sql:463 msgctxt "task.taskstate" msgid "completed" msgstr "Abgeschlossen" -#: db/mariadb.sql:462 +#: db/mariadb.sql:463 msgctxt "task.taskstate" msgid "deleted" msgstr "Gelöscht" -#: db/mariadb.sql:462 +#: db/mariadb.sql:463 msgctxt "task.taskstate" msgid "pending" msgstr "Ausstehend" -#: db/mariadb.sql:462 +#: db/mariadb.sql:463 msgctxt "task.taskstate" msgid "waiting" msgstr "Wartend" diff --git a/locale/de/LC_MESSAGES/ymsgui.mo b/locale/de/LC_MESSAGES/ymsgui.mo index 65e1b7a..ed45754 100644 Binary files a/locale/de/LC_MESSAGES/ymsgui.mo and b/locale/de/LC_MESSAGES/ymsgui.mo differ diff --git a/yms/lookup.py b/yms/lookup.py index e8684f4..c986556 100644 --- a/yms/lookup.py +++ b/yms/lookup.py @@ -132,6 +132,7 @@ class Lookup: 'inventory.invcond': ('inventory', 'invcond'), 'inventory.flags': ('inventory', 'flags'), 'maintenance.maintstate': ('maintenance', 'maintstate'), + 'maintenance.plan_precision': ('maintenance', 'plan_precision'), 'measurement.accuracy': ('measurement', 'accuracy'), 'note.notetype': ('note', 'notetype'), 'project.projstate': ('project', 'projstate'), diff --git a/yms/model/box.py b/yms/model/box.py index 5bff792..c7d9152 100644 --- a/yms/model/box.py +++ b/yms/model/box.py @@ -15,6 +15,11 @@ class Box(DbRecord): self.title = _("Box({})") def save(self, commit=True): - super().save(Table.BOXES) + if not super().save(Table.BOXES): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/cable.py b/yms/model/cable.py index e4522ba..2018e41 100644 --- a/yms/model/cable.py +++ b/yms/model/cable.py @@ -16,6 +16,11 @@ class Cable(DbRecord): self.title = _("Cable({})") def save(self, commit=True): - super().save(Table.CABLES) + if not super().save(Table.CABLES): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/company.py b/yms/model/company.py index a8a9870..21723c3 100644 --- a/yms/model/company.py +++ b/yms/model/company.py @@ -22,6 +22,11 @@ class Company(DbRecord): self.title = _("Company({})") def save(self, commit=True): - super().save(Table.COMPANIES) + if not super().save(Table.COMPANIES): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/document.py b/yms/model/document.py index 8b39937..751f5b9 100644 --- a/yms/model/document.py +++ b/yms/model/document.py @@ -13,3 +13,13 @@ class Document(DbRecord): def __init__(self, db, docid=None): super().__init__(db, docid) self.title = _("Document({})") + + def save(self, commit=True): + if not super().save(): + return False + if commit: + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/equipment.py b/yms/model/equipment.py index f67858a..11ccd5e 100644 --- a/yms/model/equipment.py +++ b/yms/model/equipment.py @@ -16,6 +16,11 @@ class Equipment(DbRecord): self.title = _("Equipment({})") def save(self, commit=True): - super().save(Table.EQUIPMENT) + if not super().save(Table.EQUIPMENT): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/fuse.py b/yms/model/fuse.py index d03bf36..369c644 100644 --- a/yms/model/fuse.py +++ b/yms/model/fuse.py @@ -8,13 +8,18 @@ class Fuse(DbRecord): table = "fuse" pk_field = "fuseid" fields = ('fuseid', 'vid', 'fnumber', 'ftype', 'current', 'cableid', - 'eid', 'location', 'description', 'remarks') + 'eid', 'location', 'description', 'color', 'remarks') def __init__(self, db, fuseid=None): super().__init__(db, fuseid) self.title = _("Fuse({})") def save(self, commit=True): - super().save(Table.FUSES) + if not super().save(Table.FUSES): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/inventory.py b/yms/model/inventory.py index 01b1175..d17e3e5 100644 --- a/yms/model/inventory.py +++ b/yms/model/inventory.py @@ -16,6 +16,11 @@ class Inventory(DbRecord): self.title = _("Inventory({})") def save(self, commit=True): - super().save() + if not super().save(): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/maintenance.py b/yms/model/maintenance.py index 50ae8b9..a341969 100644 --- a/yms/model/maintenance.py +++ b/yms/model/maintenance.py @@ -7,9 +7,19 @@ class Maintenance(DbRecord): table = "maintenance" pk_field = "maintid" fields = ('maintid', 'vid', 'eid', 'series', 'activities', 'plan_date', - 'completion_date', 'interval_hours', 'last_hours', 'remarks', - 'maintstate') + 'plan_precision', 'completion_date', 'interval_hours', 'last_hours', + 'remarks', 'maintstate') def __init__(self, db, maintid=None): super().__init__(db, maintid) self.title = _("Maintenance({})") + + def save(self, commit=True): + if not super().save(): + return False + if commit: + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/measurement.py b/yms/model/measurement.py index d26581c..ca8879e 100644 --- a/yms/model/measurement.py +++ b/yms/model/measurement.py @@ -12,3 +12,13 @@ class Measurement(DbRecord): def __init__(self, db, mid=None): super().__init__(db, mid) self.title = _("Measurement({})") + + def save(self, commit=True): + if not super().save(): + return False + if commit: + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/project.py b/yms/model/project.py index 33d6c4c..04d1b87 100644 --- a/yms/model/project.py +++ b/yms/model/project.py @@ -15,6 +15,11 @@ class Project(DbRecord): self.title = _("Project({})") def save(self, commit=True): - super().save(Table.PROJECTS) + if not super().save(Table.PROJECTS): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/provision.py b/yms/model/provision.py index 3ce660b..eea7686 100644 --- a/yms/model/provision.py +++ b/yms/model/provision.py @@ -15,6 +15,11 @@ class Provision(DbRecord): self.title = _("Provision({})") def save(self, commit=True): - super().save() + if not super().save(): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/storage.py b/yms/model/storage.py index c8d71a1..5be2415 100644 --- a/yms/model/storage.py +++ b/yms/model/storage.py @@ -20,9 +20,14 @@ class Storage(DbRecord): self.title = _("Storage({})") def save(self, commit=True): - super().save(Table.STORAGE) + if not super().save(Table.STORAGE): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True def delete(self): # there must be no associated data! diff --git a/yms/model/task.py b/yms/model/task.py index 01b667d..2d743c6 100644 --- a/yms/model/task.py +++ b/yms/model/task.py @@ -12,3 +12,13 @@ class Task(DbRecord): def __init__(self, db, taskid=None): super().__init__(db, taskid) self.title = _("Task({})") + + def save(self, commit=True): + if not super().save(): + return False + if commit: + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True diff --git a/yms/model/vessel.py b/yms/model/vessel.py index 818edcd..cd5052f 100644 --- a/yms/model/vessel.py +++ b/yms/model/vessel.py @@ -44,9 +44,14 @@ class Vessel(DbRecord): self.conn.commit() def save(self, commit=True): - super().save() + if not super().save(): + return False if commit: - self.conn.commit() + try: + self.conn.commit() + except mariadb.Error as e: + return False + return True def delete(self): # there must be no assiciated data! diff --git a/yms/treeview.py b/yms/treeview.py index 056a86f..b2d36f0 100644 --- a/yms/treeview.py +++ b/yms/treeview.py @@ -43,3 +43,25 @@ def set_value(treeview, column, value): return True else: return False + +def set_row_values(treeview, data): + """ + Set every column in row to new value + """ + try: + selection = treeview.get_selection() + except: + return False + if not selection.get_mode() == Gtk.SelectionMode.SINGLE: + return False + (model, iter) = selection.get_selected() + # check if data count matches treeview columns + if len(data) != model.get_n_columns(): + print("treeview:refresh_row column count mismatch") + return False + column = 0 + for value in data: + # TODO data type checks? + model.set_value(iter, column, value) + column += 1 + return True diff --git a/yms/ui/boxes.ui b/yms/ui/boxes.ui index 2f8e9f8..f374fd4 100644 --- a/yms/ui/boxes.ui +++ b/yms/ui/boxes.ui @@ -915,6 +915,7 @@ True True True + True True @@ -994,6 +995,62 @@ 1 + + + True + False + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -1031,7 +1088,7 @@ False True - 2 + 3 diff --git a/yms/ui/cables.ui b/yms/ui/cables.ui index 23a5d34..fd3cc18 100644 --- a/yms/ui/cables.ui +++ b/yms/ui/cables.ui @@ -292,6 +292,7 @@ True False True + 0 @@ -476,6 +477,7 @@ True False True + 0 @@ -490,6 +492,7 @@ True False True + 0 @@ -504,6 +507,7 @@ True False True + 0 @@ -518,6 +522,7 @@ True False True + 0 @@ -532,6 +537,7 @@ True False True + 0 @@ -546,6 +552,7 @@ True False False + 0 @@ -560,6 +567,7 @@ True False True + 0 @@ -574,6 +582,7 @@ True False True + 0 @@ -588,6 +597,7 @@ True False True + 0 @@ -602,6 +612,7 @@ True False True + 0 @@ -616,6 +627,7 @@ True False True + 0 @@ -631,6 +643,7 @@ False True True + 0 0 @@ -383,7 +408,7 @@ 0 - 7 + 8 @@ -392,6 +417,7 @@ False True True + 0 @@ -407,6 +433,7 @@ False True True + 0 @@ -422,6 +449,7 @@ False True True + 0 @@ -438,6 +466,7 @@ True True True + 0 0 @@ -469,6 +499,7 @@ False True True + 0 @@ -484,6 +515,7 @@ False True True + 0 @@ -493,6 +525,36 @@ 3 + + + True + False + Color + + + + 0 + 7 + + + + + True + False + True + True + 0 + + + + 1 + 7 + + True @@ -586,7 +648,7 @@ - + True False @@ -611,9 +673,6 @@ True False Description - - - 0 @@ -625,9 +684,6 @@ True False Type - - - 0 @@ -690,7 +746,7 @@ 0 - 7 + 8 @@ -730,6 +786,7 @@ True True adj_current + 1 1 @@ -756,17 +813,6 @@ 5 - - - True - True - True - - - 1 - 6 - - True @@ -777,14 +823,72 @@ True True True + True + + 1 + 8 + + + + + True + False + Color + + + 0 + 7 + + + + + True + False + + + True + True + + + + + False + True + 0 + + + + + True + True + True + + + + False + True + 1 + + + 1 7 + + + True + False + + + 1 + 6 + + False @@ -792,6 +896,61 @@ 1 + + + True + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -832,7 +991,7 @@ False True - 2 + 3 diff --git a/yms/ui/inventory.ui b/yms/ui/inventory.ui index 7afdc4b..30f7cf7 100644 --- a/yms/ui/inventory.ui +++ b/yms/ui/inventory.ui @@ -1083,6 +1083,61 @@ 1 + + + True + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -1120,7 +1175,7 @@ False True - 2 + 3 diff --git a/yms/ui/maintenance.ui b/yms/ui/maintenance.ui index 9daa3f4..d469905 100644 --- a/yms/ui/maintenance.ui +++ b/yms/ui/maintenance.ui @@ -715,6 +715,7 @@ True False Remarks + 0 0 @@ -722,7 +723,7 @@ - + True True True @@ -817,7 +818,8 @@ True True - True + 10 + 12 False @@ -839,6 +841,17 @@ 1 + + + True + False + + + False + True + 2 + + 1 @@ -853,7 +866,8 @@ True True - True + 10 + 12 False @@ -887,6 +901,61 @@ 1 + + + True + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -924,7 +993,7 @@ False True - 2 + 3 diff --git a/yms/ui/measurement.ui b/yms/ui/measurement.ui index 1420539..ccd5b83 100644 --- a/yms/ui/measurement.ui +++ b/yms/ui/measurement.ui @@ -709,7 +709,7 @@ - + True False Value 1 @@ -720,7 +720,7 @@ - + True False Value 2 @@ -731,7 +731,7 @@ - + True False Value 3 @@ -802,6 +802,7 @@ True False True + 1 @@ -970,6 +971,60 @@ 1 + + + True + False + vertical + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + False + True + 2 + + True @@ -1007,7 +1062,7 @@ False True - 2 + 3 diff --git a/yms/ui/projects.ui b/yms/ui/projects.ui index 20d6642..bddb975 100644 --- a/yms/ui/projects.ui +++ b/yms/ui/projects.ui @@ -17,6 +17,11 @@ 1 10 + + True + False + x-office-calendar-symbolic + True False @@ -789,10 +794,11 @@ - button True True True + img_startdate + True False @@ -813,6 +819,61 @@ 1 + + + True + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -850,7 +911,7 @@ False True - 2 + 3 diff --git a/yms/ui/provisions.ui b/yms/ui/provisions.ui index cf401f1..da0ea45 100644 --- a/yms/ui/provisions.ui +++ b/yms/ui/provisions.ui @@ -668,6 +668,61 @@ 1 + + + True + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -705,7 +760,7 @@ False True - 2 + 3 diff --git a/yms/ui/storage.ui b/yms/ui/storage.ui index b31583e..9a4daa3 100644 --- a/yms/ui/storage.ui +++ b/yms/ui/storage.ui @@ -1019,6 +1019,61 @@ 1 + + + True + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -1056,7 +1111,7 @@ False True - 2 + 3 diff --git a/yms/ui/tasks.ui b/yms/ui/tasks.ui index 1a21589..99f5749 100644 --- a/yms/ui/tasks.ui +++ b/yms/ui/tasks.ui @@ -6,7 +6,7 @@ True False 16 - stock_calendar + x-office-calendar-symbolic True @@ -357,7 +357,7 @@ - + True False @@ -383,6 +383,7 @@ False True True + 0 @@ -417,7 +418,7 @@ 0 - 2 + 3 @@ -431,7 +432,7 @@ 0 - 3 + 4 @@ -440,6 +441,7 @@ False True True + 0 @@ -455,13 +457,14 @@ False True True + 0 1 - 2 + 3 @@ -470,13 +473,14 @@ False True True + 0 1 - 3 + 4 @@ -490,7 +494,7 @@ 0 - 4 + 5 @@ -504,7 +508,7 @@ 0 - 5 + 6 @@ -518,7 +522,7 @@ 0 - 6 + 7 @@ -527,21 +531,7 @@ False True True - - - - 1 - 4 - - - - - True - False - True - True + 0 @@ -552,11 +542,12 @@ - + True False True True + 0 @@ -566,6 +557,22 @@ 6 + + + True + False + True + True + 0 + + + + 1 + 7 + + True @@ -578,7 +585,7 @@ 0 - 9 + 10 @@ -588,6 +595,7 @@ True True True + 0 0 1 - 7 + 8 @@ -638,7 +647,7 @@ 0 - 8 + 9 @@ -647,13 +656,44 @@ False True True + 0 1 - 8 + 9 + + + + + True + False + Project + + + + 0 + 2 + + + + + True + False + True + True + 0 + + + + 1 + 2 @@ -955,6 +995,8 @@ True True + 10 + 12 False @@ -991,6 +1033,8 @@ True True + 10 + 12 False @@ -1027,6 +1071,8 @@ True True + 16 + 18 False @@ -1062,6 +1108,8 @@ True True + 16 + 18 False @@ -1096,6 +1144,61 @@ 1 + + + True + False + + + False + 6 + end + + + + + + + + + + + + False + False + 0 + + + + + False + 16 + + + + + + + + + + + + False + False + 0 + + + + + + + + False + True + 2 + + True @@ -1133,7 +1236,7 @@ False True - 2 + 3 diff --git a/yms/view/base.py b/yms/view/base.py index bee457e..23478c4 100644 --- a/yms/view/base.py +++ b/yms/view/base.py @@ -1,8 +1,8 @@ # SPDX-License-Identifier: WTFPL """ -Spezial: -Notebook mit Vessel, User, Lists, Settings +Special: +Notebook with Vessel, User, Lists, Settings """ @@ -328,6 +328,7 @@ class BaseView(View): self.db.conn.commit() # Refresh dependent data self.load_dropdowns() + self.context.publish("vessel_changed", (self.context.vessel.pk_value, )) # Show data self.display_vessel(self.context.vessel) diff --git a/yms/view/boxes.py b/yms/view/boxes.py index be775f3..93e7829 100644 --- a/yms/view/boxes.py +++ b/yms/view/boxes.py @@ -126,9 +126,9 @@ class BoxesView(View): self.sbox.sid = combobox.get_list_value(self.combo['storage']) self.sbox.boxtype = combobox.get_list_value(self.combo['type']) self.sbox.content = self.entry['content'].get_text() - self.sbox.wx = int(self.spin['wx'].get_value()) - self.sbox.wy = int(self.spin['wy'].get_value()) - self.sbox.wz = int(self.spin['wz'].get_value()) + self.sbox.wx = self.spin['wx'].get_value_as_int() + self.sbox.wy = self.spin['wy'].get_value_as_int() + self.sbox.wz = self.spin['wz'].get_value_as_int() self.sbox.color = self.entry['color'].get_text().lstrip('#') self.sbox.price = self.spin['price'].get_value() self.sbox.weight = self.spin['weight'].get_value() @@ -203,8 +203,12 @@ class BoxesView(View): r = round(rgba.red * 255) g = round(rgba.green * 255) b = round(rgba.blue * 255) + a = round(rgba.alpha * 255) #self.last_valid_rgb = f"{r:02X}{g:02X}{b:02X}" - self.entry['color'].set_text(f"#{r:02X}{g:02X}{b:02X}") + if a > 0: + self.entry['color'].set_text(f"#{r:02X}{g:02X}{b:02X}") + else: + self.entry['color'].set_text('') def on_ent_color_activate(self, entry): self.set_color_from_entry(entry) diff --git a/yms/view/cables.py b/yms/view/cables.py index 7aa28b2..676aa73 100644 --- a/yms/view/cables.py +++ b/yms/view/cables.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: WTFPL import os -from gi.repository import Gtk +from gi.repository import Gtk, Gdk from .view import View from yms import gtkutils, combobox, treeview @@ -16,12 +16,13 @@ class CablesView(View): self.cable = cable.Cable(context.db) # current record self.newrecord = False - self.lst_cables = Gtk.ListStore(int, str, str) + self.lst_cables = Gtk.ListStore(int, str, str, str) self.load_list() treeview.add_column(self.tree['cables'], _('ID'), 0) treeview.add_column(self.tree['cables'], _('Name'), 1) treeview.add_column(self.tree['cables'], _('Condition'), 2) + treeview.add_column(self.tree['cables'], _('Length'), 3) self.tree['cables'].set_model(self.lst_cables) # Cable type @@ -41,21 +42,27 @@ class CablesView(View): combobox.load_from_dict(self.combo['condition'], self.dd_condition, 'unknown') def load_list(self): + selected_id = treeview.get_value(self.tree['cables']) self.lst_cables.clear() sql = ( - "SELECT cableid, cablename, cablecond " + "SELECT cableid, cablename, cablecond, length " "FROM cable " "WHERE vid=%s " "ORDER BY cableid" ) self.db.dcur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['cables'].get_selection() for row in self.db.dcur.fetchall(): data = ( row['cableid'], row['cablename'], - row['cablecond'] + row['cablecond'], + self.format_float(row['length'], suffix='m') ) - self.lst_cables.append(data) + treeiter = self.lst_cables.append(data) + if row['cableid'] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) def display_record(self): self.label['name'].set_text(self.cable.cablename or '') @@ -83,36 +90,69 @@ class CablesView(View): def edit_record(self): # fill UI fields from database record - self.entry['name'].set_text(self.cable.cablename) + self.entry['name'].set_text(self.cable.cablename or '') combobox.activate_row(self.combo['type'], self.cable.cabletype or -1) combobox.activate_row(self.combo['techname'], self.cable.techname or -1) self.spin['length'].set_value(self.cable.length or 0) - self.spin['consuctors'].set_value(self.cable.conductors or 0) + self.spin['conductors'].set_value(self.cable.conductors or 0) self.spin['diameter'].set_value(self.cable.diameter or 0) self.spin['xsection'].set_value(self.cable.xsection or 0) self.spin['weight'].set_value(self.cable.weight or 0) - self.entry['color'].set_text('#' + self.cable.color) - rgba = Gdk.RGBA() - rgba.parse('#' + self.cable.color) + self.entry['color'].set_text(self.format_color(self.cable.color)) + if self.cable.color is None: + rgba = Gdk.RGBA(0, 0, 0, 0) + else: + rgba = Gdk.RGBA() + rgba.parse('#' + self.cable.color) self.button['color'].set_rgba(rgba) combobox.activate_row(self.combo['supplier'], self.cable.supplier or -1) combobox.activate_row(self.combo['manufacturer'], self.cable.manufacturer or -1) - combobox.activate_row(self.combo['consition'], self.cable.cablecond or 'unknown') - self.text['remarks'].get_buffer().set_text(self.sbox.remarks or '') + combobox.activate_row(self.combo['condition'], self.cable.cablecond or 'unknown') + self.text['remarks'].get_buffer().set_text(self.cable.remarks or '') self.entry['name'].grab_focus() def save_record(self): # fields must have been validated beforehand + self.cable.vid = self.context.vessel.vid self.cable.cablename = self.entry['name'].get_text().strip() self.cable.cabletype = combobox.get_list_value(self.combo['type']) + if self.cable.cabletype == -1: + self.cable.cabletype = None self.cable.length = int(self.spin['length'].get_value()) self.cable.conductors = int(self.spin['conductors'].get_value()) self.cable.diameter = self.spin['diameter'].get_value() self.cable.xsection = self.spin['xsection'].get_value() self.cable.weight = int(self.spin['weight'].get_value()) + if self.button['color'].get_rgba().alpha > 0: + self.cable.color = self.entry['color'].get_text().lstrip('#') + else: + self.cable.color = None self.cable.supplier = combobox.get_list_value(self.combo['supplier']) + if self.cable.supplier == -1: + self.cable.supplier = None self.cable.manufacturer = combobox.get_list_value(self.combo['manufacturer']) - self.cable.condition = combobox.get_list_value(self.combo['condition']) + if self.cable.manufacturer == -1: + self.cable.manufacturer = None + self.cable.cablecond = combobox.get_list_value(self.combo['condition']) + self.cable.remarks = gtkutils.get_text_contents(self.text['remarks']) + + def on_but_color_set(self, button): + rgba = button.get_rgba() + r = round(rgba.red * 255) + g = round(rgba.green * 255) + b = round(rgba.blue * 255) + a = round(rgba.alpha * 255) + if a > 0: + self.entry['color'].set_text(f"#{r:02X}{g:02X}{b:02X}") + else: + self.entry['color'].set_text('') + + def on_ent_color_activate(self, entry): + self.set_color_from_entry(entry, self.button['color']) + + def on_ent_color_focus_out_event(self, entry, event): + self.set_color_from_entry(entry, self.button['color']) + return False # buttons on list page def on_but_new_clicked(self, widget): @@ -122,6 +162,13 @@ class CablesView(View): self.topwidget.set_visible_child(self.box['cable_edit']) def on_but_edit_clicked(self, widget): + self.newrecord = False + self.label['title_edit'].set_text(_("Edit Cable")) + cableid = treeview.get_value(self.tree['cables'], 0) + if not cableid: + return + self.cable.load(cableid) + self.edit_record() self.topwidget.set_visible_child(self.box['cable_edit']) def on_but_detail_clicked(self, widget): @@ -163,6 +210,16 @@ class CablesView(View): return self.save_record() print(self.cable) + if not self.cable.save(): + print("ERROR saving cable") + # TODO error in infobox + print(self.context.db.last_error()) + return + if self.newrecord: + self.load_list() + self.newrecord = False + self.display_record() + self.topwidget.set_visible_child(self.box['cable_detail']) def on_but_cancel_clicked(self, widget): self.topwidget.set_visible_child(self.box['cables']) diff --git a/yms/view/documents.py b/yms/view/documents.py index 108dd86..437f28d 100644 --- a/yms/view/documents.py +++ b/yms/view/documents.py @@ -37,21 +37,13 @@ class DocumentsView(View): self.uploaddialog.set_title("Upload new document") self.lst_documents = Gtk.ListStore(int, str, str, str, int) - sql = ( - "SELECT d.docid, d.doctype, d.filename, d.title, COUNT(r.drid) AS refcount " - "FROM document AS d LEFT OUTER JOIN docref AS r USING (docid) " - "GROUP BY d.docid, d.doctype, d.filename, d.title " - "ORDER BY d.docid" - ) - self.db.cur.execute(sql) - for row in self.db.cur.fetchall(): - self.lst_documents.append(row) + self.load_list() treeview.add_column(self.tree['documents'], _('ID'), 0) treeview.add_column(self.tree['documents'], _('Type'), 1) treeview.add_column(self.tree['documents'], _('Filename'), 2) treeview.add_column(self.tree['documents'], _('Title'), 3) - treeview.add_column(self.tree['documents'], _('References'), 3) + treeview.add_column(self.tree['documents'], _('References'), 4) self.tree['documents'].set_model(self.lst_documents) # Status @@ -61,6 +53,23 @@ class DocumentsView(View): self.dd_access = self.context.lookup.enum('document.roleaccess') combobox.load_from_dict(self.combo['accesslevel'], self.dd_access) + def load_list(self): + selected_id = treeview.get_value(self.tree['documents']) + self.lst_documents.clear() + sql = ( + "SELECT d.docid, d.doctype, d.filename, d.title, COUNT(r.drid) AS refcount " + "FROM document AS d LEFT OUTER JOIN docref AS r USING (docid) " + "GROUP BY d.docid, d.doctype, d.filename, d.title " + "ORDER BY d.docid" + ) + self.db.cur.execute(sql) + selection = self.tree['documents'].get_selection() + for row in self.db.cur.fetchall(): + treeiter = self.lst_documents.append(row) + if row['docid'] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) + def clear_record(self): self.doc.clear() combobox.activate_row(self.combo['doctype'], 'generic') diff --git a/yms/view/equipment.py b/yms/view/equipment.py index 04d62b7..c42a2af 100644 --- a/yms/view/equipment.py +++ b/yms/view/equipment.py @@ -5,7 +5,7 @@ from gi.repository import GLib, Gtk, Gdk from dateutil.parser import parse from gettext import pgettext -from .view import View +from .view import View, DatePicker from yms import gtkutils, combobox, treeview from yms.lookup import Dropdown from yms.model import equipment @@ -44,7 +44,29 @@ class EquipmentView(View): self.dd_condition = self.context.lookup.enum('equipment.econd') combobox.load_from_dict(self.combo['condition'], self.dd_condition, 'unknown') + self.entry['purchdate'].set_placeholder_text(context.get_datefmt_placeholder()) + self.dt_purchdate = DatePicker(self.entry['purchdate'], self.button['purchdate'], context.get_datefmt()) + + def get_list_row(self): + return ( + self.equip.eid, + self.equip.ename, + self.dd_manufacturer.get(self.equip.manufacturer, ''), + self.equip.model, + self.equip.serial, + self.format_date(self.equip.purchdate), + self.equip.remarks + ) + + def add_row(self): + treeiter = self.lst_equipment.append(self.get_list_row()) + # TODO self.tree['equipment'].get_selection().select_iter(treeiter) + + def refresh_row(self): + treeview.set_row_values(self.tree['equipment'], self.get_list_row()) + def load_list(self): + selected_id = treeview.get_value(self.tree['equipment']) self.lst_equipment.clear() sql = ( "SELECT e.eid, e.ename, c.compname, e.model, e.serial, " @@ -52,11 +74,17 @@ class EquipmentView(View): "FROM equipment AS e LEFT OUTER JOIN company AS c ON (e.manufacturer=c.compid) " "WHERE e.vid=%s " "ORDER BY e.ename" - ).format(self.context.datefmt.replace('%', '%%')) - # ).format("%%d.%%m.%%Y") # TODO format from settings via mapping + ).format(self.context.get_datefmt().replace('%', '%%')) self.db.cur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['equipment'].get_selection() for row in self.db.cur.fetchall(): - self.lst_equipment.append(row) + treeiter = self.lst_equipment.append(row) + if row[0] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) + + def on_page_activated(self): + print("Equipment activated") def clear_record(self): self.equip.clear() @@ -208,12 +236,14 @@ class EquipmentView(View): return self.save_record() print(self.equip) - self.equip.save() - if self.newrecord: - self.load_list() - else: + if not self.equip.save(): + # TODO error handling pass - # TODO aktuelle Listenzeile aktualisieren! + if self.newrecord: + self.add_row() + #self.load_list() + else: + self.refresh_row() self.newrecord = False self.display_record() self.topwidget.set_visible_child(self.box['equip_detail']) diff --git a/yms/view/fuses.py b/yms/view/fuses.py index 9050479..e09c252 100644 --- a/yms/view/fuses.py +++ b/yms/view/fuses.py @@ -17,21 +17,7 @@ class FusesView(View): self.newrecord = False self.lst_fuses = Gtk.ListStore(int, str, str, str) - sql = ( - "SELECT fuseid, fnumber, current, description " - "FROM fuse " - "WHERE vid=%s " - "ORDER BY fuseid" - ) - self.db.dcur.execute(sql, (context.vessel.vid,)) - for row in self.db.dcur.fetchall(): - data = ( - row['fuseid'], - 'F{}'.format(row['fnumber']), - '{} A'.format(row['current']), # TODO better formatting - row['description'] - ) - self.lst_fuses.append(data) + self.load_list() treeview.add_column(self.tree['fuses'], _('ID'), 0) treeview.add_column(self.tree['fuses'], _('Name'), 1) @@ -41,13 +27,39 @@ class FusesView(View): # Fuse Type self.dd_ftype = self.context.lookup.dropdown(Dropdown.FUSE_TYPE) - combobox.load_from_dict(self.combo['ftype'], self.dd_ftype) + combobox.load_from_dict(self.combo['ftype'], {-1: _("─── unknown ───")} | self.dd_ftype) # Cables self.dd_cable = self.context.lookup.cable(context.vessel.vid) combobox.load_from_dict(self.combo['cable'], {-1: _("─── none ───")} | self.dd_cable) # Equipment self.dd_equipment = self.context.lookup.equipment(context.vessel.vid) combobox.load_from_dict(self.combo['equipment'], {-1: _("─── none ───")} | self.dd_equipment) + # Location + self.dd_location = self.context.lookup.dropdown(Dropdown.FUSE_BLOCK) + combobox.load_from_dict(self.combo['location'], {-1: _("─── unknown ───")} | self.dd_location) + + def load_list(self): + selected_id = treeview.get_value(self.tree['fuses']) + self.lst_fuses.clear() + sql = ( + "SELECT fuseid, fnumber, current, description " + "FROM fuse " + "WHERE vid=%s " + "ORDER BY fuseid" + ) + self.db.dcur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['fuses'].get_selection() + for row in self.db.dcur.fetchall(): + data = ( + row['fuseid'], + 'F{}'.format(row['fnumber']), + '{} A'.format(row['current']), # TODO better formatting + row['description'] + ) + treeiter = self.lst_fuses.append(data) + if row['fuseid'] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) def clear_record(self): self.fuse.clear() @@ -57,18 +69,34 @@ class FusesView(View): self.spin['current'].set_value(0) combobox.activate_row(self.combo['cable'], -1) combobox.activate_row(self.combo['equipment'], -1) - self.entry['location'].set_text('') + combobox.activate_row(self.combo['location'], -1) self.text['remarks'].get_buffer().set_text('') self.spin['fnumber'].grab_focus() def display_record(self): self.label['fnumber'].set_text(f"F{self.fuse.fnumber}") - self.label['type'].set_text(self.dd_type[self.fuse.ftype]) + if self.fuse.ftype: + self.label['type'].set_text(self.dd_ftype[self.fuse.ftype] or '') + else: + self.label['type'].set_text('') 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)) + if self.fuse.cableid: + self.label['cable'].set_text(self.dd_cable[self.fuse.cableid]) + else: + self.label['cable'].set_text('') + if self.fuse.eid: + self.label['equipment'].set_text(self.dd_equipment[self.fuse.eid]) + else: + self.label['equipment'].set_text('') + if self.fuse.location: + self.label['location'].set_text(self.dd_location[self.fuse.location]) + else: + self.label['location'].set_text('') self.label['description'].set_text(str(self.fuse.description or '')) + if self.fuse.color: + self.label['color'].set_markup(f'#{self.cable.color} ●') + else: + self.label['color'].set_text('') self.label['remarks'].set_text(str(self.fuse.remarks or '')) def edit_record(self): @@ -78,20 +106,52 @@ class FusesView(View): self.spin['current'].set_value(self.fuse.current) combobox.activate_row(self.combo['cable'], self.fuse.cableid) combobox.activate_row(self.combo['equipment'], self.fuse.eid) - self.entry['location'].set_text(self.fuse.location) - self.text['remarks'].get_buffer().set_text(self.prov.remarks or '') + combobox.activate_row(self.combo['location'], self.fuse.location) + self.text['remarks'].get_buffer().set_text(self.fuse.remarks or '') self.spin['fnumber'].grab_focus() def save_record(self): # fields must have been validated beforehand - self.fuse.number = int(self.spin['fnumber'].get_value()) + self.fuse.vid = self.context.vessel.vid + self.fuse.fnumber = self.spin['fnumber'].get_value_as_int() + self.fuse.current = self.spin['current'].get_value() self.fuse.description = self.entry['description'].get_text() self.fuse.ftype = combobox.get_list_value(self.combo['ftype']) + if self.fuse.ftype == -1: + self.fuse.ftype = None self.fuse.cableid = combobox.get_list_value(self.combo['cable']) + if self.fuse.cableid == -1: + self.fuse.cableid = None self.fuse.eid = combobox.get_list_value(self.combo['equipment']) - self.fuse.location = self.entry['location'].get_text() + if self.fuse.eid == -1: + self.fuse.eid = None + self.fuse.location = combobox.get_list_value(self.combo['location']) + if self.fuse.location == -1: + self.fuse.location = None + if self.button['color'].get_rgba().alpha > 0: + self.fuse.color = self.entry['color'].get_text().lstrip('#') + else: + self.fuse.color = None self.fuse.remarks = gtkutils.get_text_contents(self.text['remarks']) + def on_but_color_set(self, button): + rgba = button.get_rgba() + r = round(rgba.red * 255) + g = round(rgba.green * 255) + b = round(rgba.blue * 255) + a = round(rgba.alpha * 255) + if a > 0: + self.entry['color'].set_text(f"#{r:02X}{g:02X}{b:02X}") + else: + self.entry['color'].set_text('') + + def on_ent_color_activate(self, entry): + self.set_color_from_entry(entry, self.button['color']) + + def on_ent_color_focus_out_event(self, entry, event): + self.set_color_from_entry(entry, self.button['color']) + return False + # buttons on list page def on_but_new_clicked(self, widget): self.newrecord = True @@ -141,7 +201,19 @@ class FusesView(View): # buttons on edit page def on_but_save_clicked(self, widget): - pass + fnumber = self.spin['fnumber'].get_value_as_int() + current = self.spin['current'].get_value() + # TODO check for duplicate number! + sql = "SELECT COUNT(fnumber) FROM fuse WHERE fnumber=%s" + + if (fnumber == 0) or (current == 0): + # TODO error marker + return + self.save_record() + print(self.fuse) + self.fuse.save() + self.display_record() + self.topwidget.set_visible_child(self.box['fuse_detail']) def on_but_cancel_clicked(self, widget): self.topwidget.set_visible_child(self.box['fuses']) diff --git a/yms/view/inventory.py b/yms/view/inventory.py index 7e9e9ee..22e8396 100644 --- a/yms/view/inventory.py +++ b/yms/view/inventory.py @@ -55,6 +55,7 @@ class InventoryView(View): combobox.load_from_dict(self.combo['condition'], self.dd_condition) def load_list(self): + selected_id = treeview.get_value(self.tree['inventory']) self.lst_inventory.clear() sql = ( "SELECT i.invid, i.invname, s.sname AS container, i.number, i.invcond, i.remarks " @@ -65,9 +66,13 @@ class InventoryView(View): "WHERE s.vid=%s" ) self.db.cur.execute(sql, (self.context.vessel.vid, self.context.vessel.vid)) + selection = self.tree['inventory'].get_selection() for row in self.db.cur.fetchall(): - self.lst_inventory.append(row) - + treeiter = self.lst_inventory.append(row) + if row[0] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) + def lock_timer(self): self.context.db.lock_refresh(self.token) return True # continue timer @@ -96,9 +101,9 @@ class InventoryView(View): self.label['name'].set_text(self.inv.invname) container = pgettext("inventory.conttype", self.inv.conttype) if self.inv.conttype == 'storage': - self.label['conttype'].set_text("{}: {}".format(container, self.dd_storage[self.inv.sid])) + self.label['conttype'].set_text("{}: {}".format(container, self.dd_storage.get(self.inv.sid, ''))) else: - self.label['conttype'].set_text("{}: {}".format(container, self.dd_box[self.inv.boxid])) + self.label['conttype'].set_text("{}: {}".format(container, self.dd_box.get(self.inv.boxid, ''))) self.label['equipment'].set_text(str(self.inv.eid)) self.label['number'].set_text(self.format_int(self.inv.number)) self.label['weight'].set_text(self.format_float(self.inv.weight, suffix='kg')) @@ -255,7 +260,8 @@ class InventoryView(View): return self.save_record() print(self.inv) - self.inv.save() + if not self.inv.save(): + pass if self.newrecord: self.load_list() self.newrecord = False diff --git a/yms/view/maintenance.py b/yms/view/maintenance.py index 46622d1..12cd166 100644 --- a/yms/view/maintenance.py +++ b/yms/view/maintenance.py @@ -2,9 +2,12 @@ import os from gi.repository import Gtk +from dateutil.parser import parse +from datetime import datetime -from .view import View +from .view import View, DatePicker from yms import gtkutils, combobox, treeview +from yms.lookup import Dropdown from yms.model import maintenance class MaintenanceView(View): @@ -16,15 +19,7 @@ class MaintenanceView(View): self.newrecord = False self.lst_maintenance = Gtk.ListStore(int, str, str, str) - sql = ( - "SELECT m.maintid, m.activities, e.ename, m.remarks " - "FROM maintenance AS m LEFT OUTER JOIN equipment AS e USING (eid) " - "WHERE m.vid=%s " - "ORDER BY m.maintid" - ) - self.db.cur.execute(sql, (context.vessel.vid,)) - for row in self.db.cur.fetchall(): - self.lst_maintenance.append(row) + self.load_list() treeview.add_column(self.tree['maintenance'], _('ID'), 0) treeview.add_column(self.tree['maintenance'], _('Activities'), 1) @@ -32,14 +27,49 @@ class MaintenanceView(View): treeview.add_column(self.tree['maintenance'], _('Remarks'), 3) self.tree['maintenance'].set_model(self.lst_maintenance) + # Equipment + self.dd_equipment = self.context.lookup.equipment(context.vessel.vid) + combobox.load_from_dict(self.combo['equipment'], {-1: _("─── none ───")} | self.dd_equipment) + + # Plan date precision + self.dd_precision = self.context.lookup.enum('maintenance.plan_precision') + combobox.load_from_dict(self.combo['plan_precision'], self.dd_precision, 'month') + + # Status + self.dd_status = self.context.lookup.enum('maintenance.maintstate') + combobox.load_from_dict(self.combo['status'], self.dd_status, 'new') + + self.entry['plandate'].set_placeholder_text(context.get_datefmt_placeholder()) + self.dt_plandate = DatePicker(self.entry['plandate'], self.button['plandate'], context.get_datefmt()) + self.entry['completion'].set_placeholder_text(context.get_datefmt_placeholder()) + self.dt_completion = DatePicker(self.entry['completion'], self.button['completion'], context.get_datefmt()) + + def load_list(self): + selected_id = treeview.get_value(self.tree['maintenance']) + self.lst_maintenance.clear() + sql = ( + "SELECT m.maintid, m.activities, e.ename, m.remarks " + "FROM maintenance AS m LEFT OUTER JOIN equipment AS e USING (eid) " + "WHERE m.vid=%s " + "ORDER BY m.maintid" + ) + self.db.cur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['maintenance'].get_selection() + for row in self.db.cur.fetchall(): + treeiter = self.lst_maintenance.append(row) + if row[0] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) + def clear_record(self): self.maint.clear() self.entry['activities'].set_text('') combobox.activate_row(self.combo['equipment'], -1) - self.spin['series'].set_value(0) - self.spin['interval'].set_value(0) - self.spin['last'].set_value(0) + self.spin['series'].set_text('') + self.spin['interval'].set_text('') + self.spin['last_hours'].set_text('') self.entry['plandate'].set_text('') + combobox.activate_row(self.combo['plan_precision'], 'month') self.entry['completion'].set_text('') combobox.activate_row(self.combo['status'], 'new') self.text['remarks'].get_buffer().set_text('') @@ -57,31 +87,49 @@ class MaintenanceView(View): self.label['remarks'].set_text(self.maint.remarks or '') def edit_record(self): - self.entry['activities'].set_text(self.maint.activities) - combobox.activate_row(self.combo['equipment'], self.maint.eid) + self.entry['activities'].set_text(self.maint.activities or '') + combobox.activate_row(self.combo['equipment'], self.maint.eid or -1) self.spin['series'].set_value(self.maint.series or 0) self.spin['interval'].set_value(self.maint.interval_hours or 0) - self.spin['last'].set_value(self.maint.last_hours or 0) - self.entry['plandate'].set_text(self.maint.plan_date) - self.entry['completion'].set_text(self.maint.completion_date) + self.spin['last_hours'].set_value(self.maint.last_hours or 0) + self.entry['plandate'].set_text(self.format_date(self.maint.plan_date)) + self.entry['completion'].set_text(self.format_date(self.maint.completion_date)) combobox.activate_row(self.combo['status'], self.maint.maintstate) self.text['remarks'].get_buffer().set_text(self.maint.remarks or '') self.entry['activities'].grab_focus() def save_record(self): # fields must have been validated beforehand + self.maint.vid = self.context.vessel.vid self.maint.activities = self.entry['activities'].get_text() self.maint.eid = combobox.get_list_value(self.combo['equipment']) - self.maint.series = int(self.spin['series'].get_value()) - self.maint.interval_hours = int(self.spin['interval'].get_value()) - self.maint.last_hours = int(self.spin['last'].get_value()) - self.maint.plan_date = self.entry['plandate'].get_text() - self.maint.completion_date = self.entry['completion'].get_text() + if self.maint.eid == -1: + self.maint.eid = None + self.maint.series = self.spin['series'].get_value_as_int() + if self.maint.series == -1: + self.maint.series = None + self.maint.interval_hours = self.spin['interval'].get_value_as_int() + if self.maint.interval_hours == 0: + self.maint.interval_hours = None + self.maint.last_hours = self.spin['last_hours'].get_value_as_int() + if self.maint.last_hours == 0: + self.maint.last_hours = None + try: + self.maint.plan_date = parse(self.entry['plandate'].get_text(), dayfirst=True) + except ValueError: + self.maint.plan_date = None + try: + self.maint.completion_date = parse(self.entry['completion'].get_text(), dayfirst=True) + except ValueError: + self.maint.completion_date = None self.maint.maintstate = combobox.get_list_value(self.combo['status']) self.maint.remarks = gtkutils.get_text_contents(self.text['remarks']) # buttons on list page def on_but_new_clicked(self, widget): + self.clear_record() + self.newrecord = True + print("New:Datefmt={}".format(self.context.datefmt)) self.topwidget.set_visible_child(self.box['maint_edit']) def on_but_edit_clicked(self, widget): @@ -132,7 +180,16 @@ class MaintenanceView(View): return self.save_record() print(self.maint) - self.maint.save() + if not self.maint.save(): + print("Save error") + # TODO error in infobox + print(self.context.db.last_error()) + return + if self.newrecord: + self.load_list() + self.newrecord = False + self.display_record() + self.topwidget.set_visible_child(self.box['maint_detail']) def on_but_cancel_clicked(self, widget): self.topwidget.set_visible_child(self.box['maintenance']) diff --git a/yms/view/measurement.py b/yms/view/measurement.py index 494efaf..05ddf7b 100644 --- a/yms/view/measurement.py +++ b/yms/view/measurement.py @@ -12,6 +12,9 @@ class MeasurementView(View): def __init__(self, context): super().__init__(context, _("Measurements"), "measurement.ui") + self.infobar.set_revealed(False) + self.infobar_label = Gtk.Label() + self.infobar.get_content_area().add(self.infobar_label) self.measure = measurement.Measurement(context.db) # current record self.newrecord = False @@ -22,9 +25,10 @@ class MeasurementView(View): # accuracy self.dd_accuracy = self.context.lookup.enum('measurement.accuracy') - combobox.load_from_dict(self.combo['accuracy'], {"-1": _("─── none ───")} | self.dd_accuracy) + combobox.load_from_dict(self.combo['accuracy'], self.dd_accuracy, 'unknown') # measurement units + # ATTENTION: Minimum one element in list has to be defined! self.dd_unit = self.context.lookup.dropdown(Dropdown.UNIT) combobox.load_from_dict(self.combo['unit'], self.dd_unit, 1) @@ -37,6 +41,19 @@ class MeasurementView(View): combobox.load_from_dict(self.combo['category'], {-1: _("─── none ───")} | self.dd_category) self.lst_measurement = Gtk.ListStore(int, str, str, str, str, str) + self.load_list() + + 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) + + def load_list(self): + selected_id = treeview.get_value(self.tree['measurement']) + self.lst_measurement.clear() sql = ( "SELECT m.mid, m.mname, m.nval, m.val1, m.val2, m.val3, m.unit, " "m.accuracy, m.note, e.ename " @@ -44,7 +61,8 @@ class MeasurementView(View): "WHERE m.vid=%s " "ORDER BY m.mid" ) - self.db.dcur.execute(sql, (context.vessel.vid,)) + self.db.dcur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['measurement'].get_selection() for row in self.db.dcur.fetchall(): if row['nval'] == 1: value = "{} {}".format(row['val1'], row['unit']) @@ -63,23 +81,18 @@ class MeasurementView(View): 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) + treeiter = self.lst_measurement.append(data) + if row[0] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) def clear_record(self): self.measure.clear() self.entry['name'].set_text('') - combobox.activate_row(self.combo['dimensions'], -1) - self.spin['val1'].set_value(0) - self.spin['val2'].set_value(0) - self.spin['val3'].set_value(0) + combobox.activate_row(self.combo['dimensions'], 1) + self.spin['val1'].set_text('') + self.spin['val2'].set_text('') + self.spin['val3'].set_text('') combobox.activate_row(self.combo['accuracy'], 'unknown') self.entry['date'].set_text('') combobox.activate_row(self.combo['equipment'], -1) @@ -87,29 +100,45 @@ class MeasurementView(View): self.text['note'].get_buffer().set_text('') self.entry['name'].grab_focus() + self.label['edit_val2'].set_visible(False) + self.spin['val2'].set_visible(False) + self.label['edit_val3'].set_visible(False) + self.spin['val3'].set_visible(False) + def display_record(self): self.label['name'].set_text(self.measure.mname) - self.label['dimensions'].set_text(self.measure.nval) - self.label['val1'].set_text(self.measure.val1) + self.label['dimensions'].set_text(self.dd_dimensions[self.measure.nval]) + self.label['val1'].set_text(self.format_int(self.measure.val1)) if self.measure.nval >= 2: - self.label['val2'].set_text(self.measure.val2 or '') + self.label['val2'].set_text(self.format_int(self.measure.val2)) else: self.label['val2'].set_text('n/a') if self.measure.nval == 3: - self.label['val3'].set_text(self.measure.val3 or '') + self.label['val3'].set_text(self.format_int(self.measure.val3)) else: self.label['val3'].set_text('n/a') - # TODO - # unit - # accuracy - # category + self.label['unit'].set_text(self.dd_unit.get(self.measure.unit, '')) + self.label['accuracy'].set_text(self.dd_accuracy[self.measure.accuracy]) + self.label['date'].set_text(self.format_date(self.measure.mdate)) + self.label['category'].set_text(self.dd_category[self.measure.mcat]) + self.label['note'].set_text(self.measure.note or '') def edit_record(self): self.entry['name'].set_text(self.measure.mname) combobox.activate_row(self.combo['dimensions'], self.measure.nval) - self.spin['val1'].set_value(self.measure.val1) - self.spin['val2'].set_value(self.measure.val2 or 0) - self.spin['val3'].set_value(self.measure.val3 or 0) + if self.measure.val1 is None: + self.spin['val1'].set_text('') + else: + self.spin['val1'].set_value(self.measure.val1) + if self.measure.val2 is None: + self.spin['val2'].set_text('') + else: + self.spin['val2'].set_value(self.measure.val2) + if self.measure.val3 is None: + self.spin['val3'].set_text('') + else: + self.spin['val3'].set_value(self.measure.val3) + combobox.activate_row(self.combo['unit'], self.measure.unit or 1) combobox.activate_row(self.combo['accuracy'], self.measure.accuracy) self.entry['date'].set_text(self.measure.mdate) combobox.activate_row(self.combo['equipment'], self.measure.eid) @@ -117,6 +146,11 @@ class MeasurementView(View): self.text['note'].get_buffer().set_text(self.task.note or '') self.entry['name'].grab_focus() + self.label['edit_val2'].set_visible(self.measure.nval > 1) + self.spin['val2'].set_visible(self.measure.nval > 1) + self.label['edit_val3'].set_visible(self.measure.nval > 2) + self.spin['val3'].set_visible(self.measure.nval > 2) + def save_record(self): # fields must have been validated beforehand self.measure.mname = self.entry['name'].get_text() @@ -124,7 +158,7 @@ class MeasurementView(View): self.measure.val1 = self.spin['val1'].get_value_as_int() self.measure.val2 = self.spin['val2'].get_value_as_int() self.measure.val3 = self.spin['val3'].get_value_as_int() - self.measure.accuracy = combobox.get_list_value(self.combo['accurace']) + self.measure.accuracy = combobox.get_list_value(self.combo['accuracy']) self.measure.mdate = self.entry['date'].get_text() self.measure.eid = combobox.get_list_value(self.combo['equipment']) self.measure.mcat = combobox.get_list_value(self.combo['category']) @@ -163,6 +197,13 @@ class MeasurementView(View): self.topwidget.set_visible_child(self.box['measure_detail']) self.button['close'].grab_focus() + def on_cmb_dimensions_changed(self, widget): + ndim = combobox.get_list_value(widget) + self.label['edit_val2'].set_visible(ndim > 1) + self.spin['val2'].set_visible(ndim > 1) + self.label['edit_val3'].set_visible(ndim > 2) + self.spin['val3'].set_visible(ndim > 2) + # buttons on detail page # edit2 uses edit callback def on_but_close_clicked(self, widget): @@ -180,12 +221,23 @@ class MeasurementView(View): # buttons on edit page def on_but_save_clicked(self, widget): # check mandatory fields - if not self.entry['mname'].get_text().strip(): + if not self.entry['name'].get_text().strip(): # TODO error marker + print("Save error mandatory fields missing") + self.infobar.set_message_type(Gtk.MessageType.WARNING) + self.infobar_label.set_text("Save error mandatory fields missing") + self.infobar.set_revealed(True) return + else: + self.infobar_label.set_text('') + self.infobar.set_revealed(False) self.save_record() print(self.measure) self.measure.save() + if self.newrecord: + self.load_list() + self.newrecord = False + self.display_record() self.topwidget.set_visible_child(self.box['measure_detail']) diff --git a/yms/view/projects.py b/yms/view/projects.py index d63beb8..a4ab99b 100644 --- a/yms/view/projects.py +++ b/yms/view/projects.py @@ -18,23 +18,7 @@ class ProjectsView(View): self.newrecord = False self.lst_projects = Gtk.ListStore(int, str, str, int, str, str) - sql = ( - "SELECT projid, projname, startdate, duration, projstate, remarks " - "FROM project " - "WHERE vid=%s " - "ORDER BY projid" - ) - self.db.dcur.execute(sql, (context.vessel.vid,)) - for row in self.db.dcur.fetchall(): - data = ( - row['projid'], - row['projname'], - self.format_date(row['startdate']), - row['duration'], - row['projstate'], - row['remarks'] - ) - self.lst_projects.append(data) + self.load_list() treeview.add_column(self.tree['projects'], _('ID'), 0) treeview.add_column(self.tree['projects'], _('Name'), 1) @@ -52,13 +36,38 @@ class ProjectsView(View): self.dd_state = self.context.lookup.enum('project.projstate') combobox.load_from_dict(self.combo['status'], self.dd_state) + def load_list(self): + selected_id = treeview.get_value(self.tree['projects']) + self.lst_projects.clear() + sql = ( + "SELECT projid, projname, startdate, duration, projstate, remarks " + "FROM project " + "WHERE vid=%s " + "ORDER BY projid" + ) + self.db.dcur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['projects'].get_selection() + for row in self.db.dcur.fetchall(): + data = ( + row['projid'], + row['projname'], + self.format_date(row['startdate']), + row['duration'], + row['projstate'], + row['remarks'] + ) + treeiter = self.lst_projects.append(data) + if row['projid'] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) + def clear_record(self): self.project.clear() self.entry['name'].set_text('') combobox.activate_row(self.combo['responsible'], 0) self.entry['date_start'].set_text('') - self.spin['costs_plan'].set_value(0) - self.spin['costs_final'].set_value(0) + self.spin['costs_plan'].set_text('') + self.spin['costs_final'].set_text('') combobox.activate_row(self.combo['status'], 'new') self.text['remarks'].get_buffer().set_text('') self.entry['name'].grab_focus() @@ -76,15 +85,26 @@ class ProjectsView(View): def edit_record(self): self.entry['name'].set_text(self.project.projname) combobox.activate_row(self.combo['responsible'], self.project.responsible) - self.entry['date_start'].set_text(self.project.startdate) - self.spin['costs_plan'].set_value(self.project.costs_plan) - self.spin['costs_final'].set_value(self.project.costs_final) + self.entry['date_start'].set_text(self.format_date(self.project.startdate)) + if self.project.costs_plan: + self.spin['duration'].set_value(self.project.duration) + else: + self.spin['duration'].set_text('') + if self.project.costs_plan: + self.spin['costs_plan'].set_value(self.project.costs_plan) + else: + self.spin['costs_plan'].set_text('') + if self.project.costs_final: + self.spin['costs_final'].set_value(self.project.costs_final) + else: + self.spin['costs_final'].set_text('') combobox.activate_row(self.combo['status'], self.project.projstate) self.text['remarks'].get_buffer().set_text(self.project.remarks or '') self.entry['name'].grab_focus() def save_record(self): # fields must have been validated beforehand + self.project.vid = self.context.vessel.vid self.project.projname = self.entry['name'].get_text() self.project.responsible = combobox.get_list_value(self.combo['responsible']) self.project.costs_plan = int(self.spin['costs_plan'].get_value()) @@ -103,9 +123,9 @@ class ProjectsView(View): self.newrecord = False self.label['title_edit'].set_text(_("Edit Project")) projid = treeview.get_value(self.tree['projects'], 0) - if not projidid: + if not projid: return - self.measure.load(mid) + self.project.load(projid) self.edit_record() self.topwidget.set_visible_child(self.box['proj_edit']) @@ -142,12 +162,21 @@ class ProjectsView(View): # buttons on edit page def on_but_save_clicked(self, widget): # check mandatory fields - if not self.entry['projname'].get_text().strip(): + if not self.entry['name'].get_text().strip(): # TODO error marker return self.save_record() print(self.project) - self.project.save() + if not self.project.save(): + print("Project save error") + # TODO error in infobox + print(self.context.db.last_error()) + return + if self.newrecord: + self.load_list() + self.newrecord = False + self.display_record() + self.topwidget.set_visible_child(self.box['proj_detail']) def on_but_cancel_clicked(self, widget): self.topwidget.set_visible_child(self.box['projects']) diff --git a/yms/view/provisions.py b/yms/view/provisions.py index 43fbd9d..703070b 100644 --- a/yms/view/provisions.py +++ b/yms/view/provisions.py @@ -44,10 +44,10 @@ class ProvisionsView(View): self.tree['provisions'].set_model(self.lst_provisions) # TODO Date format - self.entry['storedate'].set_placeholder_text("TT.MM.JJJJ") - self.dt_storedate = DatePicker(self.entry['storedate'], self.button['storedate'], context.datefmt) - self.entry['shelflife'].set_placeholder_text("TT.MM.JJJJ") - self.dt_shelflife = DatePicker(self.entry['shelflife'], self.button['shelflife'], context.datefmt) + self.entry['storedate'].set_placeholder_text(context.get_datefmt_placeholder()) + self.dt_storedate = DatePicker(self.entry['storedate'], self.button['storedate'], context.get_datefmt()) + self.entry['shelflife'].set_placeholder_text(context.get_datefmt_placeholder()) + self.dt_shelflife = DatePicker(self.entry['shelflife'], self.button['shelflife'], context.get_datefmt()) def load_list(self): selected_id = treeview.get_value(self.tree['provisions']) @@ -58,6 +58,7 @@ class ProvisionsView(View): "WHERE s.vid=%s OR vid IS NULL" ) self.db.dcur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['provisions'].get_selection() for row in self.db.dcur.fetchall(): data = ( row['provid'], @@ -144,13 +145,14 @@ class ProvisionsView(View): self.prov.unit = combobox.get_list_value(self.combo['unit']) if self.prov.unit == -1: self.prov.unit = None + self.prov.calories = self.spin['calories'].get_value_as_int() # TODO respect configured date format # self.prov.storedate = self.dt_storedate.get_date() # self.prov.shelflife = self.dt_shelflife.get_date() try: self.prov.storedate = parse(self.entry['storedate'].get_text(), dayfirst=True) except ValueError: - self.prov.shelfstoredatelife = None + self.prov.storedate = None try: self.prov.shelflife = parse(self.entry['shelflife'].get_text(), dayfirst=True) except ValueError: diff --git a/yms/view/status.py b/yms/view/status.py index 4ef0d89..605322c 100644 --- a/yms/view/status.py +++ b/yms/view/status.py @@ -52,6 +52,13 @@ class StatusView: self.svg_centerline_y = 0.0 self.load_svg() + # subscribe to data change events + self.context.subscribe("vessel_changed", self.vessel_changed) + + def vessel_changed(self, data): + print(f"Vessel changed. New ID={data[0]}") + self.load_svg() + def load_svg(self): if not self.context.vessel.shapefile: print("No Shapefile defined for current vessel") diff --git a/yms/view/storage.py b/yms/view/storage.py index 70afd73..4b0013b 100644 --- a/yms/view/storage.py +++ b/yms/view/storage.py @@ -38,7 +38,6 @@ class StorageView(View): pass def refresh_row(self): - pass treeview.set_value(self.tree['storage'], 1, self.storage.name) position = f"({self.storage.x}, {self.storage.y}, {self.storage.z})" treeview.set_value(self.tree['storage'], 2, position) diff --git a/yms/view/tasks.py b/yms/view/tasks.py index 9bf394b..8e5c702 100644 --- a/yms/view/tasks.py +++ b/yms/view/tasks.py @@ -2,8 +2,10 @@ import os from gi.repository import Gtk +from dateutil.parser import parse +from datetime import datetime -from .view import View +from .view import View, DatePicker from yms import gtkutils, combobox, treeview from yms.model import task @@ -32,17 +34,24 @@ class TasksView(View): # Priority self.dd_priority = self.context.lookup.enum('task.priority') - combobox.load_from_dict(self.combo['priority'], self.dd_priority) + combobox.load_from_dict(self.combo['priority'], self.dd_priority, 'low') # Status self.dd_state = self.context.lookup.enum('task.taskstate') - combobox.load_from_dict(self.combo['status'], self.dd_state) + combobox.load_from_dict(self.combo['status'], self.dd_state, 'pending') # Responsible self.dd_user = context.lookup.user() - combobox.load_from_dict(self.combo['responsible'], self.dd_user) + combobox.load_from_dict(self.combo['responsible'], self.dd_user, 0) + + self.entry['plandate'].set_placeholder_text(context.get_datefmt_placeholder()) + self.dt_plandate = DatePicker(self.entry['plandate'], self.button['plandate'], context.get_datefmt()) + self.entry['duedate'].set_placeholder_text(context.get_datefmt_placeholder()) + self.dt_duedate = DatePicker(self.entry['duedate'], self.button['duedate'], context.get_datefmt()) def load_list(self): + selected_id = treeview.get_value(self.tree['tasks']) + self.lst_tasks.clear() sql = ( "SELECT t.taskid, t.taskname, t.priority, t.taskstate, " "u.displayname AS responsible " @@ -51,6 +60,7 @@ class TasksView(View): "ORDER BY t.taskid" ) self.db.dcur.execute(sql, (self.context.vessel.vid,)) + selection = self.tree['tasks'].get_selection() for row in self.db.dcur.fetchall(): data = ( row['taskid'], @@ -59,53 +69,77 @@ class TasksView(View): row['taskstate'], row['responsible'] ) - self.lst_tasks.append(data) + treeiter = self.lst_tasks.append(data) + if row['taskid'] == selected_id: + # restore previous selected row + selection.select_iter(treeiter) def clear_record(self): self.task.clear() self.entry['name'].set_text('') combobox.activate_row(self.combo['project'], -1) - combobox.activate_row(self.combo['priority'], -1) + combobox.activate_row(self.combo['priority'], 'low') self.entry['plandate'].set_text('') self.entry['duedate'].set_text('') self.entry['started'].set_text('') self.entry['finished'].set_text('') - combobox.activate_row(self.combo['status'], 'new') + combobox.activate_row(self.combo['status'], 'pending') combobox.activate_row(self.combo['responsible'], 0) self.text['remarks'].get_buffer().set_text('') self.entry['name'].grab_focus() def display_record(self): self.label['name'].set_text(self.task.taskname) - self.label['responsible'].set_text('') + self.label['project'].set_text(self.dd_project.get(self.task.projid, '')) + self.label['priority'].set_text(self.dd_priority[self.task.priority]) + self.label['plandate'].set_text(self.format_date(self.task.plandate)) + self.label['duedate'].set_text(self.format_date(self.task.duedate)) + self.label['started'].set_text(self.format_datetime(self.task.started)) + self.label['finished'].set_text(self.format_datetime(self.task.finished)) self.label['status'].set_text(self.task.taskstate) + self.label['responsible'].set_text('') self.label['remarks'].set_text(self.task.remarks or '') def edit_record(self): self.entry['name'].set_text(self.task.taskname) combobox.activate_row(self.combo['project'], self.task.projid) combobox.activate_row(self.combo['priority'], self.task.priority) - self.entry['plandate'].set_text(self.task.plandate) - self.entry['duedate'].set_text(self.task.duedate) - self.entry['started'].set_text(self.task.started) - self.entry['finished'].set_text(self.task.finsihed) - combobox.activate_row(self.combo['taskstate'], self.task.taskstate) + self.entry['plandate'].set_text(self.format_date(self.task.plandate)) + self.entry['duedate'].set_text(self.format_date(self.task.duedate)) + self.entry['started'].set_text(self.format_datetime(self.task.started)) + self.entry['finished'].set_text(self.format_datetime(self.task.finished)) + combobox.activate_row(self.combo['status'], self.task.taskstate) combobox.activate_row(self.combo['responsible'], self.task.responsible) self.text['remarks'].get_buffer().set_text(self.task.remarks or '') self.entry['name'].grab_focus() def save_record(self): # fields must have been validated beforehand + self.task.vid = self.context.vessel.vid self.task.taskname = self.entry['name'].get_text() self.task.projid = combobox.get_list_value(self.combo['project']) - self.task.priority = combobox.get_list_value(self.combo['project']) - self.task.plandate = self.entry['plandate'].get_text() - self.task.duedate = self.entry['duedate'].get_text() - self.task.started = self.entry['started'].get_text() - self.task.finished = self.entry['finished'].get_text() - self.task.taskstate = combobox.get_list_value(self.combo['taskstate']) - self.task.resposible = combobox.get_list_value(self.combo['responsible']) - self.project.remarks = gtkutils.get_text_contents(self.text['remarks']) + if self.task.projid == -1: + self.task.projid = None + self.task.priority = combobox.get_list_value(self.combo['priority']) + try: + self.task.plandate = parse(self.entry['plandate'].get_text(), dayfirst=True) + except ValueError: + self.task.plandate = None + try: + self.task.duedate = parse(self.entry['plandate'].get_text(), dayfirst=True) + except ValueError: + self.task.duedate = None + try: + self.task.started = parse(self.entry['started'].get_text(), dayfirst=True) + except ValueError: + self.task.started = None + try: + self.task.finished = parse(self.entry['finished'].get_text(), dayfirst=True) + except ValueError: + self.task.finished = None + self.task.taskstate = combobox.get_list_value(self.combo['status']) + self.task.responsible = combobox.get_list_value(self.combo['responsible']) + self.task.remarks = gtkutils.get_text_contents(self.text['remarks']) # buttons on list page def on_but_new_clicked(self, widget): diff --git a/yms/view/view.py b/yms/view/view.py index 76931a0..4f3b81d 100644 --- a/yms/view/view.py +++ b/yms/view/view.py @@ -30,6 +30,10 @@ class View: self.builder.connect_signals(self) self.topwidget = self.builder.get_object("topobject") + self.infobar = self.builder.get_object("infobar") + if self.infobar: + self.infobar.set_revealed(False) + gtkutils.init_named_controls(self, self.builder) def format_int(self, ival, separator=True, suffix=None, default=''): @@ -51,7 +55,23 @@ class View: def format_date(self, dval, default=''): if dval is None: return default - return dval.strftime(self.context.datefmt) + return dval.strftime(self.context.get_datefmt()) + + def format_datetime(self, dtval, default=''): + # we do not use seconds! + if dtval is None: + return default + return dtval.strftime(self.context.get_datefmt() + ' %H:%M') + + def format_color(self, color, default=''): + # alpha only for "no color" + if not color or color.alpha == 0: + return default + else: + r = round(color.red * 255) + g = round(color.green * 255) + b = round(color.blue * 255) + return f"#{r:02X}{g:02X}{b:02X}" def on_textview_keypress(self, widget, event): # Generic limit length function @@ -120,14 +140,18 @@ class View: context.add_class("invalid") def set_color_from_entry(self, entry, colorbutton): - # TODO this was a fast hack! text = entry.get_text().strip() + if len(text) == 6: + text = '#' + text rgba = Gdk.RGBA() if len(text) == 7 and rgba.parse(text): self.last_valid_rgb = text.lstrip('#') - self.entry.set_text(text) + entry.set_text(text.upper()) colorbutton.set_rgba(rgba) self.set_entry_valid(entry, True) + elif len(text) == 0: + # set color to "no color" means: black with alpha=0 + colorbutton.set_rgba(Gdk.RGBA(0, 0, 0, 0)) else: self.set_entry_valid(entry, False) diff --git a/ymsgui.py b/ymsgui.py index 618a9e5..5ce5645 100755 --- a/ymsgui.py +++ b/ymsgui.py @@ -94,7 +94,7 @@ class AppContext: self.ui_path = os.path.join(self.get_sharepath(), "yms", "ui") self.textdomain = "ymsgui" # static here for early initialization self.localedir = "locale" - self.datefmt = '%d.%m.%Y' + self.datefmt = 'Y-m-d' # key into map self.scan_enabled = False # system settings stored in database self.curr_sym = '€' @@ -167,6 +167,12 @@ class AppContext: return "/usr/share" return "" + def get_datefmt(self): + return self.datefmt_map[self.datefmt][0] + + def get_datefmt_placeholder(self): + return self.datefmt_map[self.datefmt][1] + class Frontend: def __init__(self, context): @@ -235,7 +241,7 @@ class Frontend: self.db.cur.execute(sql, (self.db_poll_ts,)) for row in self.db.cur.fetchall(): print(f"refresh table based list #{row[0]}") - # TODO get module name für changes in table + # TODO get module name for changes in table modulemap = { #Table.VESSEL: "base", #Table.USERS: "base",