splitter-control + optimize row height

This commit is contained in:
Paul S 2021-07-02 15:45:59 +02:00
parent 7e2272017f
commit fb88dac713
10 changed files with 341 additions and 326 deletions

View file

@ -1,10 +1,12 @@
# Changelog GarageCalc1 # Changelog GarageCalc1
## [0.4.2] - 2021-07-01 ## [0.5] - 2021-07-02
## Added ## Added
- Tabelle "Gegenstände": Zeilen sind sortierbar (-> Klick auf Spaltenköpfe) - Tabelle "Gegenstände": Zeilen sind sortierbar (-> Klick auf Spaltenköpfe)
- Tabelle "Gegenstände": Spalten sind anordenbar - Tabelle "Gegenstände": Spalten sind anordenbar
- Beide Tabellen: Rechte Spalte wächst dynamisch ans Ende - Beide Tabellen: Rechte Spalte wächst dynamisch ans Ende
- Beide Tabellen: Zusätzliche Spalte "Kommentar" am Ende der Tabelle
- Horizontales Splitter-Control zwischen Tabelle "Garage" und "Gegenstände"
## [0.4.1] - 2021-07-01 ## [0.4.1] - 2021-07-01
## Added ## Added

Binary file not shown.

View file

@ -4,77 +4,77 @@
<context> <context>
<name>TableWidget</name> <name>TableWidget</name>
<message> <message>
<location filename="clsTableWidget.py" line="81"/> <location filename="clsTableWidget.py" line="87"/>
<source>Cut</source> <source>Cut</source>
<translation>Ausschneiden</translation> <translation>Ausschneiden</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="82"/> <location filename="clsTableWidget.py" line="88"/>
<source>Copy</source> <source>Copy</source>
<translation>Kopieren</translation> <translation>Kopieren</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="83"/> <location filename="clsTableWidget.py" line="89"/>
<source>Paste</source> <source>Paste</source>
<translation>Einfügen</translation> <translation>Einfügen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="256"/> <location filename="clsTableWidget.py" line="258"/>
<source>Delete</source> <source>Delete</source>
<translation>Löschen</translation> <translation>Löschen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="106"/> <location filename="clsTableWidget.py" line="108"/>
<source>Cut row</source> <source>Cut row</source>
<translation>Zeile ausschneiden</translation> <translation>Zeile ausschneiden</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="107"/> <location filename="clsTableWidget.py" line="109"/>
<source>Copy row</source> <source>Copy row</source>
<translation>Zeile kopieren</translation> <translation>Zeile kopieren</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="108"/> <location filename="clsTableWidget.py" line="110"/>
<source>Paste row</source> <source>Paste row</source>
<translation>Zeile einfügen</translation> <translation>Zeile einfügen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="110"/> <location filename="clsTableWidget.py" line="112"/>
<source>Insert row before</source> <source>Insert row before</source>
<translation>Zeile oberhalb einfügen</translation> <translation>Zeile oberhalb einfügen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="111"/> <location filename="clsTableWidget.py" line="113"/>
<source>Insert row after</source> <source>Insert row after</source>
<translation>Zeile unterhalb einfügen</translation> <translation>Zeile unterhalb einfügen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="113"/> <location filename="clsTableWidget.py" line="115"/>
<source>Remove row</source> <source>Remove row</source>
<translation>Zeile entfernen</translation> <translation>Zeile entfernen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="114"/> <location filename="clsTableWidget.py" line="116"/>
<source>Delete items</source> <source>Delete items</source>
<translation>Zellinhalte löschen</translation> <translation>Zellinhalte löschen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="149"/> <location filename="clsTableWidget.py" line="151"/>
<source>Row Nr.</source> <source>Row Nr.</source>
<translation>Zeile Nr.</translation> <translation>Zeile Nr.</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="150"/> <location filename="clsTableWidget.py" line="152"/>
<source>to be removed?</source> <source>to be removed?</source>
<translation>entfernen?</translation> <translation>entfernen?</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="150"/> <location filename="clsTableWidget.py" line="152"/>
<source>Remove</source> <source>Remove</source>
<translation>Entfernen</translation> <translation>Entfernen</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="256"/> <location filename="clsTableWidget.py" line="258"/>
<source>Delete cell content?</source> <source>Delete cell content?</source>
<translation>Zellinhalt löschen?</translation> <translation>Zellinhalt löschen?</translation>
</message> </message>
@ -87,122 +87,122 @@
<translation type="obsolete">Hallo Welt</translation> <translation type="obsolete">Hallo Welt</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="114"/> <location filename="main.py" line="178"/>
<source>&amp;Settings</source> <source>&amp;Settings</source>
<translation>&amp;Einstellungen</translation> <translation>&amp;Einstellungen</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="115"/> <location filename="main.py" line="179"/>
<source>Language</source> <source>Language</source>
<translation>Sprache</translation> <translation>Sprache</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="125"/> <location filename="main.py" line="193"/>
<source>Stuff</source> <source>Stuff</source>
<translation>Gegenstand</translation> <translation>Gegenstand</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="516"/> <location filename="main.py" line="595"/>
<source>Length</source> <source>Length</source>
<translation>Länge</translation> <translation>Länge</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="517"/> <location filename="main.py" line="596"/>
<source>Width</source> <source>Width</source>
<translation>Breite</translation> <translation>Breite</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="518"/> <location filename="main.py" line="597"/>
<source>Height</source> <source>Height</source>
<translation>Höhe</translation> <translation>Höhe</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="519"/> <location filename="main.py" line="598"/>
<source>Weight</source> <source>Weight</source>
<translation>Gewicht</translation> <translation>Gewicht</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="474"/> <location filename="main.py" line="553"/>
<source>Dimension of the garage</source> <source>Dimension of the garage</source>
<translation>Dimension der Garage</translation> <translation>Dimension der Garage</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="513"/> <location filename="main.py" line="592"/>
<source>Dimensions of the objects to be stored</source> <source>Dimensions of the objects to be stored</source>
<translation>Dimensionen der zu verstauenden Gegenstände</translation> <translation>Dimensionen der zu verstauenden Gegenstände</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="573"/> <location filename="main.py" line="652"/>
<source>Result</source> <source>Result</source>
<translation>Ergebnis</translation> <translation>Ergebnis</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="576"/> <location filename="main.py" line="655"/>
<source>Volume of the garage</source> <source>Volume of the garage</source>
<translation>Volumen der Garage</translation> <translation>Volumen der Garage</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="580"/> <location filename="main.py" line="659"/>
<source>Volume of the items</source> <source>Volume of the items</source>
<translation>Volumen der Gegenstände</translation> <translation>Volumen der Gegenstände</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="584"/> <location filename="main.py" line="663"/>
<source>Free space in the garage</source> <source>Free space in the garage</source>
<translation>Freier Raum in der Garage</translation> <translation>Freier Raum in der Garage</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="588"/> <location filename="main.py" line="667"/>
<source>Total weight</source> <source>Total weight</source>
<translation>Gesamtgewicht</translation> <translation>Gesamtgewicht</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="142"/> <location filename="main.py" line="212"/>
<source>New (Ctrl+N)</source> <source>New (Ctrl+N)</source>
<translation>Neu (Strg+N)</translation> <translation>Neu (Strg+N)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="143"/> <location filename="main.py" line="213"/>
<source>Open... (Ctrl+O)</source> <source>Open... (Ctrl+O)</source>
<translation>Öffnen... (Strg+O)</translation> <translation>Öffnen... (Strg+O)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="144"/> <location filename="main.py" line="214"/>
<source>Save (Ctrl+S)</source> <source>Save (Ctrl+S)</source>
<translation>Speichern (Strg+S)</translation> <translation>Speichern (Strg+S)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="145"/> <location filename="main.py" line="215"/>
<source>Export to EXCEL...</source> <source>Export to EXCEL...</source>
<translation>Export nach EXCEL...</translation> <translation>Export nach EXCEL...</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="146"/> <location filename="main.py" line="216"/>
<source>Information about the application</source> <source>Information about the application</source>
<translation>Informationen über das Programm</translation> <translation>Informationen über das Programm</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="147"/> <location filename="main.py" line="217"/>
<source>Quit the application (Strg+Q)</source> <source>Quit the application (Strg+Q)</source>
<translation>Programm beenden (Strg+Q)</translation> <translation>Programm beenden (Strg+Q)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="331"/> <location filename="main.py" line="408"/>
<source>Garage</source> <source>Garage</source>
<translation>Garage</translation> <translation>Garage</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="259"/> <location filename="main.py" line="336"/>
<source>Quit</source> <source>Quit</source>
<translation>Beenden</translation> <translation>Beenden</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="268"/> <location filename="main.py" line="345"/>
<source>New</source> <source>New</source>
<translation>Neu</translation> <translation>Neu</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="285"/> <location filename="main.py" line="362"/>
<source>Save</source> <source>Save</source>
<translation>Speichern</translation> <translation>Speichern</translation>
</message> </message>
@ -212,27 +212,27 @@
<translation type="obsolete">CSV-Datei</translation> <translation type="obsolete">CSV-Datei</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="465"/> <location filename="main.py" line="544"/>
<source>All files</source> <source>All files</source>
<translation>Alle Dateien</translation> <translation>Alle Dateien</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="383"/> <location filename="main.py" line="460"/>
<source>file</source> <source>file</source>
<translation>Datei</translation> <translation>Datei</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="384"/> <location filename="main.py" line="461"/>
<source>saved</source> <source>saved</source>
<translation>gespeichert</translation> <translation>gespeichert</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="400"/> <location filename="main.py" line="477"/>
<source>Open</source> <source>Open</source>
<translation>Öffnen</translation> <translation>Öffnen</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="462"/> <location filename="main.py" line="541"/>
<source>Export</source> <source>Export</source>
<translation>Export</translation> <translation>Export</translation>
</message> </message>
@ -242,45 +242,50 @@
<translation type="obsolete">EXCEL-Datei</translation> <translation type="obsolete">EXCEL-Datei</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="645"/> <location filename="main.py" line="724"/>
<source>Error in the garage dimension</source> <source>Error in the garage dimension</source>
<translation>Fehler in der Garagen-Dimension</translation> <translation>Fehler in der Garagen-Dimension</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="698"/> <location filename="main.py" line="777"/>
<source>Error in the dimensions of the objects to be stored</source> <source>Error in the dimensions of the objects to be stored</source>
<translation>Fehler in den Dimensionen der zu verstauenden Gegenstände</translation> <translation>Fehler in den Dimensionen der zu verstauenden Gegenstände</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="592"/> <location filename="main.py" line="671"/>
<source>Successfully exported to EXCEL</source> <source>Successfully exported to EXCEL</source>
<translation>Erfolgreich nach EXCEL exportiert</translation> <translation>Erfolgreich nach EXCEL exportiert</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="401"/> <location filename="main.py" line="478"/>
<source>CSV-file</source> <source>CSV-file</source>
<translation>CSV-Datei</translation> <translation>CSV-Datei</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="463"/> <location filename="main.py" line="542"/>
<source>EXCEL-file</source> <source>EXCEL-file</source>
<translation>EXCEL-Datei</translation> <translation>EXCEL-Datei</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="69"/> <location filename="main.py" line="73"/>
<source>There are unsaved entries. Without saving, all changes are lost. Continue anyway?</source> <source>There are unsaved entries. Without saving, all changes are lost. Continue anyway?</source>
<translation>Es gibt ungespeicherte Einträge. Ohne zu speichern, gehen alle Änderungen verloren. Trotzdem fortfahren?</translation> <translation>Es gibt ungespeicherte Einträge. Ohne zu speichern, gehen alle Änderungen verloren. Trotzdem fortfahren?</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="36"/> <location filename="main.py" line="147"/>
<source>Garage Space Calculator</source> <source>Garage Space Calculator</source>
<translation>Garagenraum-Rechner</translation> <translation>Garagenraum-Rechner</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="39"/> <location filename="utils.py" line="40"/>
<source>Calculates available garage space</source> <source>Calculates available garage space</source>
<translation>Berechnet zur Verfügung stehenden Garagenraum</translation> <translation>Berechnet zur Verfügung stehenden Garagenraum</translation>
</message> </message>
<message>
<location filename="main.py" line="199"/>
<source>Comment</source>
<translation>Kommentar</translation>
</message>
</context> </context>
<context> <context>
<name>utils</name> <name>utils</name>

Binary file not shown.

View file

@ -4,77 +4,77 @@
<context> <context>
<name>TableWidget</name> <name>TableWidget</name>
<message> <message>
<location filename="clsTableWidget.py" line="81"/> <location filename="clsTableWidget.py" line="87"/>
<source>Cut</source> <source>Cut</source>
<translation>Vágd ki</translation> <translation>Vágd ki</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="82"/> <location filename="clsTableWidget.py" line="88"/>
<source>Copy</source> <source>Copy</source>
<translation>Vettem</translation> <translation>Vettem</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="83"/> <location filename="clsTableWidget.py" line="89"/>
<source>Paste</source> <source>Paste</source>
<translation>Beillesztés</translation> <translation>Beillesztés</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="256"/> <location filename="clsTableWidget.py" line="258"/>
<source>Delete</source> <source>Delete</source>
<translation>Törölje</translation> <translation>Törölje</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="106"/> <location filename="clsTableWidget.py" line="108"/>
<source>Cut row</source> <source>Cut row</source>
<translation>Vágott vonal</translation> <translation>Vágott vonal</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="107"/> <location filename="clsTableWidget.py" line="109"/>
<source>Copy row</source> <source>Copy row</source>
<translation>Vettem a szöveget</translation> <translation>Vettem a szöveget</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="108"/> <location filename="clsTableWidget.py" line="110"/>
<source>Paste row</source> <source>Paste row</source>
<translation>Beilleszteni a sort</translation> <translation>Beilleszteni a sort</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="110"/> <location filename="clsTableWidget.py" line="112"/>
<source>Insert row before</source> <source>Insert row before</source>
<translation>A fenti sort beilleszteni</translation> <translation>A fenti sort beilleszteni</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="111"/> <location filename="clsTableWidget.py" line="113"/>
<source>Insert row after</source> <source>Insert row after</source>
<translation>Az alábbi sor beillesztése</translation> <translation>Az alábbi sor beillesztése</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="113"/> <location filename="clsTableWidget.py" line="115"/>
<source>Remove row</source> <source>Remove row</source>
<translation>Távolítsa el a sort</translation> <translation>Távolítsa el a sort</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="114"/> <location filename="clsTableWidget.py" line="116"/>
<source>Delete items</source> <source>Delete items</source>
<translation>Tartalom törlése</translation> <translation>Tartalom törlése</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="149"/> <location filename="clsTableWidget.py" line="151"/>
<source>Row Nr.</source> <source>Row Nr.</source>
<translation>Vonalszám.</translation> <translation>Vonalszám.</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="150"/> <location filename="clsTableWidget.py" line="152"/>
<source>to be removed?</source> <source>to be removed?</source>
<translation>eltávolítani?</translation> <translation>eltávolítani?</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="150"/> <location filename="clsTableWidget.py" line="152"/>
<source>Remove</source> <source>Remove</source>
<translation>A eltávolítása</translation> <translation>A eltávolítása</translation>
</message> </message>
<message> <message>
<location filename="clsTableWidget.py" line="256"/> <location filename="clsTableWidget.py" line="258"/>
<source>Delete cell content?</source> <source>Delete cell content?</source>
<translation>Cellatartalom törlése?</translation> <translation>Cellatartalom törlése?</translation>
</message> </message>
@ -87,122 +87,122 @@
<translation type="obsolete">Hallo Welt</translation> <translation type="obsolete">Hallo Welt</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="114"/> <location filename="main.py" line="178"/>
<source>&amp;Settings</source> <source>&amp;Settings</source>
<translation>&amp;Beállítások</translation> <translation>&amp;Beállítások</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="115"/> <location filename="main.py" line="179"/>
<source>Language</source> <source>Language</source>
<translation>Nyelv</translation> <translation>Nyelv</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="125"/> <location filename="main.py" line="193"/>
<source>Stuff</source> <source>Stuff</source>
<translation>Tárgy</translation> <translation>Tárgy</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="516"/> <location filename="main.py" line="595"/>
<source>Length</source> <source>Length</source>
<translation>Hosszúság</translation> <translation>Hosszúság</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="517"/> <location filename="main.py" line="596"/>
<source>Width</source> <source>Width</source>
<translation>Szélesség</translation> <translation>Szélesség</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="518"/> <location filename="main.py" line="597"/>
<source>Height</source> <source>Height</source>
<translation>Magasság</translation> <translation>Magasság</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="519"/> <location filename="main.py" line="598"/>
<source>Weight</source> <source>Weight</source>
<translation>Súly</translation> <translation>Súly</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="474"/> <location filename="main.py" line="553"/>
<source>Dimension of the garage</source> <source>Dimension of the garage</source>
<translation>A garázs mérete</translation> <translation>A garázs mérete</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="513"/> <location filename="main.py" line="592"/>
<source>Dimensions of the objects to be stored</source> <source>Dimensions of the objects to be stored</source>
<translation>A tárolandó objektumok méretei</translation> <translation>A tárolandó objektumok méretei</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="573"/> <location filename="main.py" line="652"/>
<source>Result</source> <source>Result</source>
<translation>Eredmény</translation> <translation>Eredmény</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="576"/> <location filename="main.py" line="655"/>
<source>Volume of the garage</source> <source>Volume of the garage</source>
<translation>A garázs térfogata</translation> <translation>A garázs térfogata</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="580"/> <location filename="main.py" line="659"/>
<source>Volume of the items</source> <source>Volume of the items</source>
<translation>A tételek mennyisége</translation> <translation>A tételek mennyisége</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="584"/> <location filename="main.py" line="663"/>
<source>Free space in the garage</source> <source>Free space in the garage</source>
<translation>Szabad hely a garázsban</translation> <translation>Szabad hely a garázsban</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="588"/> <location filename="main.py" line="667"/>
<source>Total weight</source> <source>Total weight</source>
<translation>Teljes súly</translation> <translation>Teljes súly</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="142"/> <location filename="main.py" line="212"/>
<source>New (Ctrl+N)</source> <source>New (Ctrl+N)</source>
<translation>Új (Ctrl+N)</translation> <translation>Új (Ctrl+N)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="143"/> <location filename="main.py" line="213"/>
<source>Open... (Ctrl+O)</source> <source>Open... (Ctrl+O)</source>
<translation>Nyissa ki (Ctrl+O)</translation> <translation>Nyissa ki (Ctrl+O)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="144"/> <location filename="main.py" line="214"/>
<source>Save (Ctrl+S)</source> <source>Save (Ctrl+S)</source>
<translation>Mentés (Ctrl+S)</translation> <translation>Mentés (Ctrl+S)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="145"/> <location filename="main.py" line="215"/>
<source>Export to EXCEL...</source> <source>Export to EXCEL...</source>
<translation>Exportálás EXCEL-be...</translation> <translation>Exportálás EXCEL-be...</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="146"/> <location filename="main.py" line="216"/>
<source>Information about the application</source> <source>Information about the application</source>
<translation>Az alkalmazással kapcsolatos információk</translation> <translation>Az alkalmazással kapcsolatos információk</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="147"/> <location filename="main.py" line="217"/>
<source>Quit the application (Strg+Q)</source> <source>Quit the application (Strg+Q)</source>
<translation>Az alkalmazás kilépése (Ctrl+Q)</translation> <translation>Az alkalmazás kilépése (Ctrl+Q)</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="331"/> <location filename="main.py" line="408"/>
<source>Garage</source> <source>Garage</source>
<translation>Garázs</translation> <translation>Garázs</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="259"/> <location filename="main.py" line="336"/>
<source>Quit</source> <source>Quit</source>
<translation>Kilépés</translation> <translation>Kilépés</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="268"/> <location filename="main.py" line="345"/>
<source>New</source> <source>New</source>
<translation>Új</translation> <translation>Új</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="285"/> <location filename="main.py" line="362"/>
<source>Save</source> <source>Save</source>
<translation>Mentés</translation> <translation>Mentés</translation>
</message> </message>
@ -212,27 +212,27 @@
<translation type="obsolete">CSV-fájl</translation> <translation type="obsolete">CSV-fájl</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="465"/> <location filename="main.py" line="544"/>
<source>All files</source> <source>All files</source>
<translation>Minden fájl</translation> <translation>Minden fájl</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="383"/> <location filename="main.py" line="460"/>
<source>file</source> <source>file</source>
<translation>fájl</translation> <translation>fájl</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="384"/> <location filename="main.py" line="461"/>
<source>saved</source> <source>saved</source>
<translation>mentett</translation> <translation>mentett</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="400"/> <location filename="main.py" line="477"/>
<source>Open</source> <source>Open</source>
<translation>Megnyitott</translation> <translation>Megnyitott</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="462"/> <location filename="main.py" line="541"/>
<source>Export</source> <source>Export</source>
<translation>Exportálás</translation> <translation>Exportálás</translation>
</message> </message>
@ -242,45 +242,50 @@
<translation type="obsolete">EXCEL-fájl</translation> <translation type="obsolete">EXCEL-fájl</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="645"/> <location filename="main.py" line="724"/>
<source>Error in the garage dimension</source> <source>Error in the garage dimension</source>
<translation>Hiba a garázs dimenziójában</translation> <translation>Hiba a garázs dimenziójában</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="698"/> <location filename="main.py" line="777"/>
<source>Error in the dimensions of the objects to be stored</source> <source>Error in the dimensions of the objects to be stored</source>
<translation>Hiba a tárolandó objektumok méreteiben</translation> <translation>Hiba a tárolandó objektumok méreteiben</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="592"/> <location filename="main.py" line="671"/>
<source>Successfully exported to EXCEL</source> <source>Successfully exported to EXCEL</source>
<translation>Sikeresen exportált EXCEL-be</translation> <translation>Sikeresen exportált EXCEL-be</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="401"/> <location filename="main.py" line="478"/>
<source>CSV-file</source> <source>CSV-file</source>
<translation>CSV-fájl</translation> <translation>CSV-fájl</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="463"/> <location filename="main.py" line="542"/>
<source>EXCEL-file</source> <source>EXCEL-file</source>
<translation>EXCEL-fájl</translation> <translation>EXCEL-fájl</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="69"/> <location filename="main.py" line="73"/>
<source>There are unsaved entries. Without saving, all changes are lost. Continue anyway?</source> <source>There are unsaved entries. Without saving, all changes are lost. Continue anyway?</source>
<translation>Vannak mentetlen bejegyzések. Mentés nélkül minden módosítás elveszik. Folytassa mégis?</translation> <translation>Vannak mentetlen bejegyzések. Mentés nélkül minden módosítás elveszik. Folytassa mégis?</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="36"/> <location filename="main.py" line="147"/>
<source>Garage Space Calculator</source> <source>Garage Space Calculator</source>
<translation>Garázs hely kalkulátor</translation> <translation>Garázs hely kalkulátor</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="39"/> <location filename="utils.py" line="40"/>
<source>Calculates available garage space</source> <source>Calculates available garage space</source>
<translation>Kiszámítja a rendelkezésre álló garázshelyet</translation> <translation>Kiszámítja a rendelkezésre álló garázshelyet</translation>
</message> </message>
<message>
<location filename="main.py" line="199"/>
<source>Comment</source>
<translation>Megjegyzés</translation>
</message>
</context> </context>
<context> <context>
<name>utils</name> <name>utils</name>

View file

@ -1,36 +1,36 @@
@ECHO OFF @ECHO OFF
:: -------------------------------------------------------------------------------------------------------------------------------------- :: --------------------------------------------------------------------------------------------------------------------------------------
:: project: GarageCalc1 Window-Exe Generator :: project: GarageCalc Window-Exe Generator
:: summary: create a GarageCalc1-executable for Windows (version with no-console-windows as well as version with console windows for traces) :: summary: create a GarageCalc-executable for Windows (version with no-console-windows as well as version with console windows for traces)
:: file: pyinstaller.cmd :: file: pyinstaller.cmd
:: date: version author :: date: version author
:: 2021-06-27 1 paul salajean :: 2021-06-27 1 paul salajean
:: -------------------------------------------------------------------------------------------------------------------------------------- :: --------------------------------------------------------------------------------------------------------------------------------------
SET version="v0.1" SET version="v0.4"
SET release_dir="D:\Temp\Prog\ownCloud\profp@uberspace\transfer" SET release_dir="D:\Temp\Prog\ownCloud\profp@uberspace\transfer"
SET prev_dir=%cd% SET prev_dir=%cd%
SET reinstall_venv="true" SET reinstall_venv="false"
SET do_zip="false" SET do_zip="false"
CD .. CD ..
ECHO Creating GarageCalc1 Windows.exe-version in folder %cd%\dist ECHO Creating GarageCalc Windows.exe-version in folder %cd%\dist
PAUSE PAUSE
REM pyinstaller --noconfirm --log-level=ERROR ^ REM pyinstaller --noconfirm --log-level=ERROR ^
REM --onedir --nowindow ^ REM --onedir --nowindow ^
REM --add-data="README;." ^ REM --add-data="README;." ^
REM --add-data="image1.png;img" ^ REM --add-data="image1.png;img" ^
REM --add-data="img;doc;ui" ^ REM --add-data="img;doc;ui" ^
REM --add-data="LICENSE.txt;changelog.md;GarageCalc1.bat" ^ REM --add-data="LICENSE.txt;changelog.md;GarageCalc.bat" ^
REM --add-binary="libfoo.so;lib" ^ REM --add-binary="libfoo.so;lib" ^
REM --hidden-import=secret1 ^ REM --hidden-import=secret1 ^
REM --hidden-import=secret2 ^ REM --hidden-import=secret2 ^
REM --icon=.\img\GarageCalc1.ico ^ REM --icon=.\img\GarageCalc.ico ^
REM --debug=imports ^ REM --debug=imports ^
REM --key=N0T1me40pp0ssum5 REM --key=N0T1me40pp0ssum5
REM --paths=.\src ^ REM --paths=.\src ^
REM GarageCalc1.spec REM GarageCalc.spec
REM The key-string is a string of 16 characters which is used to encrypt each file of Python byte-code before it is stored in the archive inside the executable file. REM The key-string is a string of 16 characters which is used to encrypt each file of Python byte-code before it is stored in the archive inside the executable file.
REM This feature uses the "tinyaes" module internally for the encryption. REM This feature uses the "tinyaes" module internally for the encryption.
REM REM
@ -55,21 +55,21 @@ python -m pip install -r requirements.txt
:PYINSTALL :PYINSTALL
IF %reinstall_venv%=="false" CALL .\env2\Scripts\activate.bat IF %reinstall_venv%=="false" CALL .\env2\Scripts\activate.bat
ECHO Running "pyinstaller"... ECHO Running "pyinstaller"...
REM pyinstaller .\main.py --name=GarageCalc1 --noconfirm --console --clean --onedir --log-level=ERROR --hidden-import=PySide2.QtXml --icon=.\img\GarageCalc1.ico --add-data="LICENSE;." --add-data="README.md;." --add-data="changelog.md;." --add-data="*.ui;." --add-data="img;.\img" REM pyinstaller .\main.py --name=GarageCalc --noconfirm --console --clean --onedir --log-level=ERROR --hidden-import=PySide2.QtXml --icon=.\img\GarageCalc.ico --add-data="LICENSE;." --add-data="README.md;." --add-data="changelog.md;." --add-data="*.ui;." --add-data="img;.\img"
pyinstaller .\src\main.py --name=GarageCalc1 --noconfirm --windowed --clean --onefile --log-level=ERROR --hidden-import=PySide2.QtXml ^ REM --windowed
pyinstaller .\src\main.py --name=GarageCalc --noconfirm --windowed --clean --onefile --log-level=ERROR --hidden-import=PySide2.QtXml ^
--icon=.\img\icons8-garage-32.ico ^ --icon=.\img\icons8-garage-32.ico ^
--add-data="LICENSE.txt;." ^ --add-data="*.txt;." ^
--add-data="README.md;." ^ --add-data="*.md;." ^
--add-data="changelog.md;." ^ --add-data="ui;.\ui" ^
--add-data="requirements.txt;." ^ --add-data="i18n;.\i18n" ^
--add-data=".\src\*.ui;." ^
--add-data="img;.\img" --add-data="img;.\img"
::MOVE .\dist\GarageCalc1\*.md .\dist\ ::MOVE .\dist\GarageCalc\*.md .\dist\
::MOVE .\dist\GarageCalc1\LICENSE .\dist\ ::MOVE .\dist\GarageCalc\LICENSE .\dist\
::clean-up img-folder ::clean-up img-folder
::MOVE .\dist\GarageCalc1\img .\dist\img>NUL ::MOVE .\dist\GarageCalc\img .\dist\img>NUL
::Remove temp dir and files ::Remove temp dir and files
DEL /Q *.spec>NUL DEL /Q *.spec>NUL
@ -83,7 +83,7 @@ IF %do_zip%=="false" GOTO END
::-mx5 = This is default (compression is normal). ::-mx5 = This is default (compression is normal).
::-mx7 = Maximum compression. ::-mx7 = Maximum compression.
::-mx9 = Ultra compression. ::-mx9 = Ultra compression.
"C:\Program Files\7-zip\7z.exe" a %release_dir%\GarageCalc1_%version%_portable.exe -mx9 -sfx7z.sfx .\dist\* "C:\Program Files\7-zip\7z.exe" a %release_dir%\GarageCalc_%version%_portable.exe -mx9 -sfx7z.sfx .\dist\*
::Disable Virtual env ::Disable Virtual env
CALL .\env2\Scripts\deactivate.bat CALL .\env2\Scripts\deactivate.bat

View file

@ -1,97 +0,0 @@
@ECHO OFF
:: --------------------------------------------------------------------------------------------------------------------------------------
:: project: GarageCalc Window-Exe Generator
:: summary: create a GarageCalc-executable for Windows (version with no-console-windows as well as version with console windows for traces)
:: file: pyinstaller.cmd
:: date: version author
:: 2021-06-27 1 paul salajean
:: --------------------------------------------------------------------------------------------------------------------------------------
SET version="v0.4"
SET release_dir="D:\Temp\Prog\ownCloud\profp@uberspace\transfer"
SET prev_dir=%cd%
SET reinstall_venv="false"
SET do_zip="false"
CD ..
ECHO Creating GarageCalc Windows.exe-version in folder %cd%\dist
PAUSE
REM pyinstaller --noconfirm --log-level=ERROR ^
REM --onedir --nowindow ^
REM --add-data="README;." ^
REM --add-data="image1.png;img" ^
REM --add-data="img;doc;ui" ^
REM --add-data="LICENSE.txt;changelog.md;GarageCalc.bat" ^
REM --add-binary="libfoo.so;lib" ^
REM --hidden-import=secret1 ^
REM --hidden-import=secret2 ^
REM --icon=.\img\GarageCalc.ico ^
REM --debug=imports ^
REM --key=N0T1me40pp0ssum5
REM --paths=.\src ^
REM GarageCalc.spec
REM The key-string is a string of 16 characters which is used to encrypt each file of Python byte-code before it is stored in the archive inside the executable file.
REM This feature uses the "tinyaes" module internally for the encryption.
REM
::one dir:
ECHO ...Running...
RMDIR /S /Q .\dist>nul
RMDIR /S /Q .\build>nul
::Use Virtual env
IF %reinstall_venv%=="false" GOTO PYINSTALL
ECHO Installing virtual env as ".\env2"...
RMDIR /S /Q .\env2>NUL
python -m venv env2
CALL .\env2\Scripts\activate.bat
ECHO Installing necessary python packages...
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
:PYINSTALL
IF %reinstall_venv%=="false" CALL .\env2\Scripts\activate.bat
ECHO Running "pyinstaller"...
REM pyinstaller .\main.py --name=GarageCalc --noconfirm --console --clean --onedir --log-level=ERROR --hidden-import=PySide2.QtXml --icon=.\img\GarageCalc.ico --add-data="LICENSE;." --add-data="README.md;." --add-data="changelog.md;." --add-data="*.ui;." --add-data="img;.\img"
REM --windowed
pyinstaller .\src\main.py --name=GarageCalc --noconfirm --windowed --clean --onefile --log-level=ERROR --hidden-import=PySide2.QtXml ^
--icon=.\img\icons8-garage-32.ico ^
--add-data="*.txt;." ^
--add-data="*.md;." ^
--add-data="ui;.\ui" ^
--add-data="i18n;.\i18n" ^
--add-data="img;.\img"
::MOVE .\dist\GarageCalc\*.md .\dist\
::MOVE .\dist\GarageCalc\LICENSE .\dist\
::clean-up img-folder
::MOVE .\dist\GarageCalc\img .\dist\img>NUL
::Remove temp dir and files
DEL /Q *.spec>NUL
RMDIR /S /Q .\build
::Create self extracting archive
IF %do_zip%=="false" GOTO END
::-mx0 = Don't compress at all - just copy the contents to archive.
::-mx1 = Consumes least time, but compression is low.
::-mx3 = Better than -mx1.
::-mx5 = This is default (compression is normal).
::-mx7 = Maximum compression.
::-mx9 = Ultra compression.
"C:\Program Files\7-zip\7z.exe" a %release_dir%\GarageCalc_%version%_portable.exe -mx9 -sfx7z.sfx .\dist\*
::Disable Virtual env
CALL .\env2\Scripts\deactivate.bat
:END
CD %prev_dir%
ECHO Done. Check %prev_dir%\..\dist
IF %do_zip%=="true" ECHO Done. Check %release_dir%
PAUSE

View file

@ -65,12 +65,14 @@ class TableWidget(QTableWidget):
# self.setEditTriggers(QAbstractItemView.DoubleClicked | QAbstractItemView.EditKeyPressed | QAbstractItemView.AnyKeyPressed) # self.setEditTriggers(QAbstractItemView.DoubleClicked | QAbstractItemView.EditKeyPressed | QAbstractItemView.AnyKeyPressed)
self.headers = self.verticalHeader() self.vertHeader = self.verticalHeader()
self.headers.setContextMenuPolicy(Qt.CustomContextMenu) self.vertHeader.setContextMenuPolicy(Qt.CustomContextMenu)
self.headers.customContextMenuRequested.connect(self.on_rowheadercontext_menu) self.vertHeader.customContextMenuRequested.connect(self.on_rowheadercontext_menu)
self.headers.setSelectionMode(QAbstractItemView.SingleSelection) self.vertHeader.setSelectionMode(QAbstractItemView.SingleSelection)
self.headers.sectionClicked.connect(self.select_row) self.vertHeader.sectionClicked.connect(self.select_row)
self.headers.setSectionsMovable(True) self.vertHeader.setSectionsMovable(True)
# optimize row height
self.resizeRowsToContents()
self.row_selected = False self.row_selected = False
@ -114,7 +116,7 @@ class TableWidget(QTableWidget):
row_delete_items = menu.addAction(QIcon(ICON_ERASER), QCoreApplication.translate("TableWidget", "Delete items")) row_delete_items = menu.addAction(QIcon(ICON_ERASER), QCoreApplication.translate("TableWidget", "Delete items"))
ac = menu.exec_(self.mapToGlobal(position)) ac = menu.exec_(self.mapToGlobal(position))
row = self.headers.logicalIndexAt(position) row = self.vertHeader.logicalIndexAt(position)
if ac == row_cut: if ac == row_cut:
self.item_cut() self.item_cut()

View file

@ -15,7 +15,7 @@ import configparser
# Third party imports # Third party imports
from PySide2.QtWidgets import QApplication, QMainWindow, QTableWidgetItem, QStatusBar, QFileDialog, \ from PySide2.QtWidgets import QApplication, QMainWindow, QTableWidgetItem, QStatusBar, QFileDialog, \
QAbstractItemView, QMenu, QMessageBox, QHBoxLayout, QVBoxLayout, QAction, QActionGroup QAbstractItemView, QMenu, QMessageBox, QHBoxLayout, QVBoxLayout, QAction, QActionGroup, QSizePolicy
from PySide2.QtGui import QIcon from PySide2.QtGui import QIcon
from PySide2.QtCore import QFile, QSize, Qt, QCoreApplication, QTranslator from PySide2.QtCore import QFile, QSize, Qt, QCoreApplication, QTranslator
from PySide2.QtUiTools import QUiLoader from PySide2.QtUiTools import QUiLoader
@ -28,7 +28,7 @@ from utils import show_about, resource_path
from clsTableWidget import TableWidget from clsTableWidget import TableWidget
# Local globals # Local globals
APP_VERSION = "v0.4.2" APP_VERSION = "v0.5"
DIR_APPDATA = os.getenv('LOCALAPPDATA') DIR_APPDATA = os.getenv('LOCALAPPDATA')
@ -56,20 +56,25 @@ COL_LENGTH = 1
COL_WIDTH = 2 COL_WIDTH = 2
COL_HEIGHT = 3 COL_HEIGHT = 3
COL_WEIGHT = 4 COL_WEIGHT = 4
COL_COMMENT = 5
DEFAULT_GARAGE_LENGTH = "6" DEFAULT_GARAGE_LENGTH = "6"
DEFAULT_GARAGE_WIDTH = "2.5" DEFAULT_GARAGE_WIDTH = "2.5"
DEFAULT_GARAGE_HEIGHT = "2.5" DEFAULT_GARAGE_HEIGHT = "2.5"
TBL_STUFF_COL_COUNT = 5 TBL_STUFF_COL_COUNT = 6
TBL_STUFF_ROW_COUNT = 50 TBL_STUFF_ROW_COUNT = 50
WIN_WIDTH = 700
WIN_HEIGHT = 640
TXT_UNSAVED_CHANGES = QCoreApplication.translate("main", "There are unsaved entries. Without saving, all changes are lost. Continue anyway?") TXT_UNSAVED_CHANGES = QCoreApplication.translate("main", "There are unsaved entries. Without saving, all changes are lost. Continue anyway?")
#################################################################### ####################################################################
def main(): def main():
qApp = QApplication(sys.argv) qApp = QApplication(sys.argv)
global APP_NAME
qApp.setApplicationName(APP_NAME) qApp.setApplicationName(APP_NAME)
qApp.setApplicationDisplayName(APP_DISPNAME) qApp.setApplicationDisplayName(APP_DISPNAME)
qApp.setApplicationVersion(APP_VERSION) qApp.setApplicationVersion(APP_VERSION)
@ -108,19 +113,39 @@ def main():
qApp.installTranslator(translator) qApp.installTranslator(translator)
app_name = qApp.translate("main", APP_NAME)
qApp.setApplicationName(app_name)
winMain = MainWindow(language) winMain = MainWindow(language)
if qApp.primaryScreen().size().width() <= 700: if qApp.primaryScreen().size().width() <= 800:
winMain.showMaximized() winMain.showMaximized()
else: else:
winMain.resize(610, 640) winMain.resize(WIN_WIDTH, WIN_HEIGHT)
winMain.show() winMain.show()
sys.exit(qApp.exec_()) sys.exit(qApp.exec_())
#################################################################### ####################################################################
def create_examples(table):
from random import randint, choice
from string import ascii_letters, punctuation, digits
min = 12
max = 15
string_format = ascii_letters
for row in range(table.rowCount()):
generated_string1 = "".join(choice(string_format) for x in range(randint(min, max)))
generated_string2 = "".join(choice(string_format) for x in range(randint(min, max)))
table.setItem(row, 0, QTableWidgetItem(generated_string1))
table.setItem(row, 1, QTableWidgetItem(str(randint(1, 10))))
table.setItem(row, 2, QTableWidgetItem(str(randint(1, 10))))
table.setItem(row, 3, QTableWidgetItem(str(randint(1, 10))))
table.setItem(row, 4, QTableWidgetItem(str(randint(20, 100))))
table.setItem(row, 5, QTableWidgetItem(generated_string2))
#################################################################### ####################################################################
class MainWindow(QMainWindow): class MainWindow(QMainWindow):
def __init__(self, language): def __init__(self, language):
@ -140,15 +165,16 @@ class MainWindow(QMainWindow):
self.create_toolbar() self.create_toolbar()
self.create_statusbar() self.create_statusbar()
global APP_NAME self.statusBar.showMessage(f"{APP_DISPNAME} {APP_VERSION} - {APP_AUTHOR}", 5000)
APP_NAME = qApp.setApplicationName(qApp.translate("main", "Garage Space Calculator"))
self.statusBar.showMessage(f"{APP_NAME} {APP_VERSION} - {APP_AUTHOR}", 5000)
self.calc_voluminae() self.calc_voluminae()
self.ui.efWeight.setText(str("0")) self.ui.efWeight.setText(str("0"))
self.retranslateUi() self.retranslateUi()
self.ui.tableStuff.setFocus() self.ui.tableStuff.setFocus()
# TODO: disable for PROD!
create_examples(self.ui.tableStuff)
self.ui.tableGarage.setItem(0, 3, QTableWidgetItem("Garázs az udvaron"))
def create_menu(self, language=None): def create_menu(self, language=None):
menuMain = self.menuBar() menuMain = self.menuBar()
self.menuSettings = menuMain.addMenu(QCoreApplication.translate("main", "&Settings")) self.menuSettings = menuMain.addMenu(QCoreApplication.translate("main", "&Settings"))
@ -176,18 +202,24 @@ class MainWindow(QMainWindow):
self.menuLanguage.setTitle(QCoreApplication.translate("main", "Language")) self.menuLanguage.setTitle(QCoreApplication.translate("main", "Language"))
# tables # tables
self.ui.tableGarage.setVerticalHeaderLabels([QCoreApplication.translate("main","Garage")]) self.ui.tableGarage.setVerticalHeaderLabels([
QCoreApplication.translate("main","Garage")])
self.ui.tableGarage.setHorizontalHeaderLabels([ self.ui.tableGarage.setHorizontalHeaderLabels([
QCoreApplication.translate("main","Length") + " [m]", QCoreApplication.translate("main","Length") + " [m]",
QCoreApplication.translate("main","Width") + " [m]", QCoreApplication.translate("main","Width") + " [m]",
QCoreApplication.translate("main","Height") + " [m]" QCoreApplication.translate("main","Height") + " [m]",
QCoreApplication.translate("main","Comment")
]) ])
self.ui.tableStuff.setHorizontalHeaderLabels([QCoreApplication.translate("main","Stuff"), self.ui.tableStuff.setHorizontalHeaderLabels([
QCoreApplication.translate("main","Stuff"),
QCoreApplication.translate("main","Length") + " [m]", QCoreApplication.translate("main","Length") + " [m]",
QCoreApplication.translate("main","Width") + " [m]", QCoreApplication.translate("main","Width") + " [m]",
QCoreApplication.translate("main","Height") + " [m]", QCoreApplication.translate("main","Height") + " [m]",
QCoreApplication.translate("main","Weight") + " [m]"]) QCoreApplication.translate("main","Weight") + " [m]",
QCoreApplication.translate("main","Comment")
])
# labels # labels
self.ui.gbGarage.setTitle(QCoreApplication.translate("main","Dimension of the garage")) self.ui.gbGarage.setTitle(QCoreApplication.translate("main","Dimension of the garage"))
@ -220,8 +252,13 @@ class MainWindow(QMainWindow):
self.ui.tableStuff = TableWidget() self.ui.tableStuff = TableWidget()
self.ui.tableStuff.setColumnCount(TBL_STUFF_COL_COUNT) self.ui.tableStuff.setColumnCount(TBL_STUFF_COL_COUNT)
self.ui.tableStuff.setRowCount(TBL_STUFF_ROW_COUNT) self.ui.tableStuff.setRowCount(TBL_STUFF_ROW_COUNT)
self.ui.tableStuff.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.ui.splitter.setStretchFactor(1, 10)
layoutGb.addWidget(self.ui.tableStuff) layoutGb.addWidget(self.ui.tableStuff)
def create_actions(self): def create_actions(self):
self.actionNew = QAction() self.actionNew = QAction()
self.actionNew.setIcon(QIcon(resource_path(ICON_NEW))) self.actionNew.setIcon(QIcon(resource_path(ICON_NEW)))
@ -310,7 +347,7 @@ class MainWindow(QMainWindow):
if self.opened_file: if self.opened_file:
self.setWindowTitle(self.opened_file) self.setWindowTitle(self.opened_file)
else: else:
self.setWindowTitle(f"{APP_NAME} {APP_VERSION} by {APP_AUTHOR}") self.setWindowTitle(f"{qApp.applicationName()} {APP_VERSION} - {APP_AUTHOR}")
self.ui.efVol_Free.setStyleSheet("") self.ui.efVol_Free.setStyleSheet("")
self.is_modified = False self.is_modified = False
@ -358,10 +395,12 @@ class MainWindow(QMainWindow):
garage_length = 0 garage_length = 0
garage_width = 0 garage_width = 0
garage_height = 0 garage_height = 0
garage_comment = ""
item_length = tblGarage.item(0, 0) item_length = tblGarage.item(0, 0)
item_width = tblGarage.item(0, 1) item_width = tblGarage.item(0, 1)
item_height = tblGarage.item(0, 2) item_height = tblGarage.item(0, 2)
item_comment = tblGarage.item(0, 3)
# loop over table Garage # loop over table Garage
for row in range(tblGarage.rowCount()): for row in range(tblGarage.rowCount()):
@ -389,8 +428,12 @@ class MainWindow(QMainWindow):
except ValueError: except ValueError:
garage_height = 0.0 garage_height = 0.0
# get garage comment
if item_comment:
garage_comment = item_comment.text()
if garage_length or garage_width or garage_height: if garage_length or garage_width or garage_height:
writer.writerow([QCoreApplication.translate("main","Garage"), garage_length, garage_width, garage_height]) writer.writerow([QCoreApplication.translate("main","Garage"), garage_length, garage_width, garage_height, garage_comment])
# loop over table Stuff # loop over table Stuff
for row in range(tblStuff.rowCount()): for row in range(tblStuff.rowCount()):
@ -399,12 +442,14 @@ class MainWindow(QMainWindow):
width = None width = None
height = None height = None
weight = None weight = None
comment = None
item_stuff = tblStuff.item(row, COL_STUFF) item_stuff = tblStuff.item(row, COL_STUFF)
item_length = tblStuff.item(row, COL_LENGTH) item_length = tblStuff.item(row, COL_LENGTH)
item_width = tblStuff.item(row, COL_WIDTH) item_width = tblStuff.item(row, COL_WIDTH)
item_height = tblStuff.item(row, COL_HEIGHT) item_height = tblStuff.item(row, COL_HEIGHT)
item_weight = tblStuff.item(row, COL_WEIGHT) item_weight = tblStuff.item(row, COL_WEIGHT)
item_comment = tblStuff.item(row, COL_COMMENT)
if item_stuff: if item_stuff:
stuff_text = item_stuff.text() stuff_text = item_stuff.text()
@ -433,8 +478,11 @@ class MainWindow(QMainWindow):
except ValueError: except ValueError:
weight = None weight = None
if item_comment:
comment = item_comment.text()
if item_stuff or item_length or item_width or item_height or item_weight: if item_stuff or item_length or item_width or item_height or item_weight:
writer.writerow([stuff_text, length, width, height, weight]) writer.writerow([stuff_text, length, width, height, weight, comment])
is_file_saved = True is_file_saved = True
self.opened_file = os.path.basename(fileName) self.opened_file = os.path.basename(fileName)
@ -478,10 +526,12 @@ class MainWindow(QMainWindow):
garage_length = row[1] garage_length = row[1]
garage_width = row[2] garage_width = row[2]
garage_height = row[3] garage_height = row[3]
garage_comment = row[4]
tblGarage.setItem(0, COL_LENGTH-1, QTableWidgetItem(str(garage_length))) tblGarage.setItem(0, COL_LENGTH-1, QTableWidgetItem(str(garage_length)))
tblGarage.setItem(0, COL_WIDTH-1, QTableWidgetItem(str(garage_width))) tblGarage.setItem(0, COL_WIDTH-1, QTableWidgetItem(str(garage_width)))
tblGarage.setItem(0, COL_HEIGHT-1, QTableWidgetItem(str(garage_height))) tblGarage.setItem(0, COL_HEIGHT-1, QTableWidgetItem(str(garage_height)))
tblGarage.setItem(0, COL_COMMENT-1, QTableWidgetItem(garage_comment))
except IndexError as ex: except IndexError as ex:
pass pass
@ -493,12 +543,14 @@ class MainWindow(QMainWindow):
stuff_width = row[2] stuff_width = row[2]
stuff_height = row[3] stuff_height = row[3]
stuff_weight = row[4] stuff_weight = row[4]
stuff_comment = row[5]
tblStuff.setItem(row_idx - 1, COL_STUFF, QTableWidgetItem(stuff)) tblStuff.setItem(row_idx - 1, COL_STUFF, QTableWidgetItem(stuff))
tblStuff.setItem(row_idx - 1, COL_LENGTH, QTableWidgetItem(str(stuff_length))) tblStuff.setItem(row_idx - 1, COL_LENGTH, QTableWidgetItem(str(stuff_length)))
tblStuff.setItem(row_idx - 1, COL_WIDTH, QTableWidgetItem(str(stuff_width))) tblStuff.setItem(row_idx - 1, COL_WIDTH, QTableWidgetItem(str(stuff_width)))
tblStuff.setItem(row_idx - 1, COL_HEIGHT, QTableWidgetItem(str(stuff_height))) tblStuff.setItem(row_idx - 1, COL_HEIGHT, QTableWidgetItem(str(stuff_height)))
tblStuff.setItem(row_idx - 1, COL_WEIGHT, QTableWidgetItem(str(stuff_weight))) tblStuff.setItem(row_idx - 1, COL_WEIGHT, QTableWidgetItem(str(stuff_weight)))
tblStuff.setItem(row_idx - 1, COL_COMMENT, QTableWidgetItem(stuff_comment))
except IndexError as ex: except IndexError as ex:
pass pass
@ -506,6 +558,8 @@ class MainWindow(QMainWindow):
row_idx += 1 row_idx += 1
tblStuff.setRowCount(TBL_STUFF_ROW_COUNT) tblStuff.setRowCount(TBL_STUFF_ROW_COUNT)
# optimize row height
tblStuff.resizeRowsToContents()
self.is_modified = False self.is_modified = False
self.opened_file = os.path.basename(fileName) self.opened_file = os.path.basename(fileName)
@ -513,7 +567,7 @@ class MainWindow(QMainWindow):
if fileName: if fileName:
self.setWindowTitle(self.opened_file) self.setWindowTitle(self.opened_file)
else: else:
self.setWindowTitle(f"{APP_NAME} {APP_VERSION} by {APP_AUTHOR}") self.setWindowTitle(f"{qApp.applicationName()} {APP_VERSION} - {APP_AUTHOR}")
def file_export(self): def file_export(self):
tblGarage = self.ui.tableGarage tblGarage = self.ui.tableGarage
@ -540,8 +594,10 @@ class MainWindow(QMainWindow):
worksheet.write(start_row, COL_LENGTH, QCoreApplication.translate("main","Length") + " [m]") worksheet.write(start_row, COL_LENGTH, QCoreApplication.translate("main","Length") + " [m]")
worksheet.write(start_row, COL_WIDTH, QCoreApplication.translate("main","Width") + " [m]") worksheet.write(start_row, COL_WIDTH, QCoreApplication.translate("main","Width") + " [m]")
worksheet.write(start_row, COL_HEIGHT, QCoreApplication.translate("main","Height") + " [m]") worksheet.write(start_row, COL_HEIGHT, QCoreApplication.translate("main","Height") + " [m]")
worksheet.write(start_row, COL_COMMENT, QCoreApplication.translate("main","Comment"))
worksheet.set_column(0, 0, 25) worksheet.set_column(0, 0, 25)
worksheet.set_column(1, 3, 10) worksheet.set_column(1, 3, 10)
worksheet.set_column(4, 5, 20)
start_row = 2 start_row = 2
# loop over table Garage # loop over table Garage
@ -567,9 +623,13 @@ class MainWindow(QMainWindow):
except ValueError: except ValueError:
garage_height = 0.0 garage_height = 0.0
# get garage comment
garage_comment = tblGarage.item(0, 3).text()
worksheet.write(start_row + row, COL_LENGTH, garage_length) worksheet.write(start_row + row, COL_LENGTH, garage_length)
worksheet.write(start_row + row, COL_WIDTH, garage_width) worksheet.write(start_row + row, COL_WIDTH, garage_width)
worksheet.write(start_row + row, COL_HEIGHT, garage_height) worksheet.write(start_row + row, COL_HEIGHT, garage_height)
worksheet.write(start_row + row, COL_COMMENT, garage_comment)
start_row = 4 start_row = 4
worksheet.write(start_row, 0, QCoreApplication.translate("main", "Dimensions of the objects to be stored")) worksheet.write(start_row, 0, QCoreApplication.translate("main", "Dimensions of the objects to be stored"))
@ -579,6 +639,7 @@ class MainWindow(QMainWindow):
worksheet.write(start_row, COL_WIDTH, QCoreApplication.translate("main","Width") + " [m]") worksheet.write(start_row, COL_WIDTH, QCoreApplication.translate("main","Width") + " [m]")
worksheet.write(start_row, COL_HEIGHT, QCoreApplication.translate("main","Height") + " [m]") worksheet.write(start_row, COL_HEIGHT, QCoreApplication.translate("main","Height") + " [m]")
worksheet.write(start_row, COL_WEIGHT, QCoreApplication.translate("main","Weight") + " [kg]") worksheet.write(start_row, COL_WEIGHT, QCoreApplication.translate("main","Weight") + " [kg]")
worksheet.write(start_row, COL_COMMENT, QCoreApplication.translate("main","Comment") )
start_row = 6 start_row = 6
# loop over table Stuff # loop over table Stuff
@ -589,6 +650,7 @@ class MainWindow(QMainWindow):
item_width = tblStuff.item(row, COL_WIDTH) item_width = tblStuff.item(row, COL_WIDTH)
item_height = tblStuff.item(row, COL_HEIGHT) item_height = tblStuff.item(row, COL_HEIGHT)
item_weight = tblStuff.item(row, COL_WEIGHT) item_weight = tblStuff.item(row, COL_WEIGHT)
item_comment = tblStuff.item(row, COL_COMMENT)
if item_stuff: if item_stuff:
stuff_text = item_stuff.text() stuff_text = item_stuff.text()
@ -627,6 +689,11 @@ class MainWindow(QMainWindow):
except ValueError: except ValueError:
pass pass
if item_comment:
comment = item_comment.text()
if len(comment)>0:
worksheet.write(start_row + row, COL_COMMENT, comment)
if item_stuff or item_length or item_width or item_height or item_weight: if item_stuff or item_length or item_width or item_height or item_weight:
row_idx += 1 row_idx += 1

View file

@ -6,26 +6,45 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>604</width> <width>605</width>
<height>596</height> <height>595</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QSplitter" name="splitter">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="midLineWidth">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="opaqueResize">
<bool>true</bool>
</property>
<property name="handleWidth">
<number>5</number>
</property>
<property name="childrenCollapsible">
<bool>true</bool>
</property>
<widget class="QGroupBox" name="gbGarage"> <widget class="QGroupBox" name="gbGarage">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>91</height> <height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>91</height>
</size> </size>
</property> </property>
<property name="title"> <property name="title">
@ -34,30 +53,21 @@
<property name="flat"> <property name="flat">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QVBoxLayout" name="verticalLayout_3" stretch="0">
<item> <item>
<widget class="QTableWidget" name="tableGarage"> <widget class="QTableWidget" name="tableGarage">
<property name="sizePolicy"> <property name="rowCount">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <number>1</number>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="columnCount">
<size> <number>4</number>
<width>0</width>
<height>58</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>58</height>
</size>
</property> </property>
<attribute name="horizontalHeaderStretchLastSection"> <attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool> <bool>true</bool>
</attribute> </attribute>
<attribute name="verticalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<row> <row>
<property name="text"> <property name="text">
<string>Garage</string> <string>Garage</string>
@ -78,24 +88,52 @@
<string>Höhe [m]</string> <string>Höhe [m]</string>
</property> </property>
</column> </column>
<column>
<property name="text">
<string>Kommentar</string>
</property>
</column>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
<item>
<widget class="QGroupBox" name="gbStuff"> <widget class="QGroupBox" name="gbStuff">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>350</height>
</size>
</property>
<property name="title"> <property name="title">
<string>Dimensionen der zu verstauenden Gegenstände</string> <string>Dimensionen der zu verstauenden Gegenstände</string>
</property> </property>
<property name="flat"> <property name="flat">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"/> <layout class="QVBoxLayout" name="verticalLayout_2" stretch=""/>
</widget>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="gbResults"> <widget class="QGroupBox" name="gbResults">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title"> <property name="title">
<string>Ergebnis</string> <string>Ergebnis</string>
</property> </property>
@ -230,13 +268,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>tableGarage</tabstop>
<tabstop>efVol_Garage</tabstop>
<tabstop>efVol_Stuff</tabstop>
<tabstop>efVol_Free</tabstop>
<tabstop>efWeight</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>