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
## [0.4.2] - 2021-07-01
## [0.5] - 2021-07-02
## Added
- Tabelle "Gegenstände": Zeilen sind sortierbar (-> Klick auf Spaltenköpfe)
- Tabelle "Gegenstände": Spalten sind anordenbar
- 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
## Added

Binary file not shown.

View file

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

Binary file not shown.

View file

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

View file

@ -1,36 +1,36 @@
@ECHO OFF
:: --------------------------------------------------------------------------------------------------------------------------------------
:: project: GarageCalc1 Window-Exe Generator
:: summary: create a GarageCalc1-executable for Windows (version with no-console-windows as well as version with console windows for traces)
:: 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.1"
SET version="v0.4"
SET release_dir="D:\Temp\Prog\ownCloud\profp@uberspace\transfer"
SET prev_dir=%cd%
SET reinstall_venv="true"
SET reinstall_venv="false"
SET do_zip="false"
CD ..
ECHO Creating GarageCalc1 Windows.exe-version in folder %cd%\dist
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;GarageCalc1.bat" ^
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\GarageCalc1.ico ^
REM --icon=.\img\GarageCalc.ico ^
REM --debug=imports ^
REM --key=N0T1me40pp0ssum5
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 This feature uses the "tinyaes" module internally for the encryption.
REM
@ -55,21 +55,21 @@ 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=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"
pyinstaller .\src\main.py --name=GarageCalc1 --noconfirm --windowed --clean --onefile --log-level=ERROR --hidden-import=PySide2.QtXml ^
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="LICENSE.txt;." ^
--add-data="README.md;." ^
--add-data="changelog.md;." ^
--add-data="requirements.txt;." ^
--add-data=".\src\*.ui;." ^
--add-data="*.txt;." ^
--add-data="*.md;." ^
--add-data="ui;.\ui" ^
--add-data="i18n;.\i18n" ^
--add-data="img;.\img"
::MOVE .\dist\GarageCalc1\*.md .\dist\
::MOVE .\dist\GarageCalc1\LICENSE .\dist\
::MOVE .\dist\GarageCalc\*.md .\dist\
::MOVE .\dist\GarageCalc\LICENSE .\dist\
::clean-up img-folder
::MOVE .\dist\GarageCalc1\img .\dist\img>NUL
::MOVE .\dist\GarageCalc\img .\dist\img>NUL
::Remove temp dir and files
DEL /Q *.spec>NUL
@ -83,7 +83,7 @@ IF %do_zip%=="false" GOTO END
::-mx5 = This is default (compression is normal).
::-mx7 = Maximum 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
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.headers = self.verticalHeader()
self.headers.setContextMenuPolicy(Qt.CustomContextMenu)
self.headers.customContextMenuRequested.connect(self.on_rowheadercontext_menu)
self.headers.setSelectionMode(QAbstractItemView.SingleSelection)
self.headers.sectionClicked.connect(self.select_row)
self.headers.setSectionsMovable(True)
self.vertHeader = self.verticalHeader()
self.vertHeader.setContextMenuPolicy(Qt.CustomContextMenu)
self.vertHeader.customContextMenuRequested.connect(self.on_rowheadercontext_menu)
self.vertHeader.setSelectionMode(QAbstractItemView.SingleSelection)
self.vertHeader.sectionClicked.connect(self.select_row)
self.vertHeader.setSectionsMovable(True)
# optimize row height
self.resizeRowsToContents()
self.row_selected = False
@ -114,7 +116,7 @@ class TableWidget(QTableWidget):
row_delete_items = menu.addAction(QIcon(ICON_ERASER), QCoreApplication.translate("TableWidget", "Delete items"))
ac = menu.exec_(self.mapToGlobal(position))
row = self.headers.logicalIndexAt(position)
row = self.vertHeader.logicalIndexAt(position)
if ac == row_cut:
self.item_cut()

View file

@ -15,7 +15,7 @@ import configparser
# Third party imports
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.QtCore import QFile, QSize, Qt, QCoreApplication, QTranslator
from PySide2.QtUiTools import QUiLoader
@ -28,7 +28,7 @@ from utils import show_about, resource_path
from clsTableWidget import TableWidget
# Local globals
APP_VERSION = "v0.4.2"
APP_VERSION = "v0.5"
DIR_APPDATA = os.getenv('LOCALAPPDATA')
@ -56,20 +56,25 @@ COL_LENGTH = 1
COL_WIDTH = 2
COL_HEIGHT = 3
COL_WEIGHT = 4
COL_COMMENT = 5
DEFAULT_GARAGE_LENGTH = "6"
DEFAULT_GARAGE_WIDTH = "2.5"
DEFAULT_GARAGE_HEIGHT = "2.5"
TBL_STUFF_COL_COUNT = 5
TBL_STUFF_COL_COUNT = 6
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?")
####################################################################
def main():
qApp = QApplication(sys.argv)
global APP_NAME
qApp.setApplicationName(APP_NAME)
qApp.setApplicationDisplayName(APP_DISPNAME)
qApp.setApplicationVersion(APP_VERSION)
@ -108,19 +113,39 @@ def main():
qApp.installTranslator(translator)
app_name = qApp.translate("main", APP_NAME)
qApp.setApplicationName(app_name)
winMain = MainWindow(language)
if qApp.primaryScreen().size().width() <= 700:
if qApp.primaryScreen().size().width() <= 800:
winMain.showMaximized()
else:
winMain.resize(610, 640)
winMain.show()
winMain.resize(WIN_WIDTH, WIN_HEIGHT)
winMain.show()
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):
def __init__(self, language):
@ -140,15 +165,16 @@ class MainWindow(QMainWindow):
self.create_toolbar()
self.create_statusbar()
global APP_NAME
APP_NAME = qApp.setApplicationName(qApp.translate("main", "Garage Space Calculator"))
self.statusBar.showMessage(f"{APP_NAME} {APP_VERSION} - {APP_AUTHOR}", 5000)
self.statusBar.showMessage(f"{APP_DISPNAME} {APP_VERSION} - {APP_AUTHOR}", 5000)
self.calc_voluminae()
self.ui.efWeight.setText(str("0"))
self.retranslateUi()
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):
menuMain = self.menuBar()
self.menuSettings = menuMain.addMenu(QCoreApplication.translate("main", "&Settings"))
@ -176,18 +202,24 @@ class MainWindow(QMainWindow):
self.menuLanguage.setTitle(QCoreApplication.translate("main", "Language"))
# tables
self.ui.tableGarage.setVerticalHeaderLabels([QCoreApplication.translate("main","Garage")])
self.ui.tableGarage.setVerticalHeaderLabels([
QCoreApplication.translate("main","Garage")])
self.ui.tableGarage.setHorizontalHeaderLabels([
QCoreApplication.translate("main","Length") + " [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","Width") + " [m]",
QCoreApplication.translate("main","Height") + " [m]",
QCoreApplication.translate("main","Weight") + " [m]"])
QCoreApplication.translate("main","Weight") + " [m]",
QCoreApplication.translate("main","Comment")
])
# labels
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.setColumnCount(TBL_STUFF_COL_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)
def create_actions(self):
self.actionNew = QAction()
self.actionNew.setIcon(QIcon(resource_path(ICON_NEW)))
@ -310,7 +347,7 @@ class MainWindow(QMainWindow):
if self.opened_file:
self.setWindowTitle(self.opened_file)
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.is_modified = False
@ -358,10 +395,12 @@ class MainWindow(QMainWindow):
garage_length = 0
garage_width = 0
garage_height = 0
garage_comment = ""
item_length = tblGarage.item(0, 0)
item_width = tblGarage.item(0, 1)
item_height = tblGarage.item(0, 2)
item_comment = tblGarage.item(0, 3)
# loop over table Garage
for row in range(tblGarage.rowCount()):
@ -389,8 +428,12 @@ class MainWindow(QMainWindow):
except ValueError:
garage_height = 0.0
# get garage comment
if item_comment:
garage_comment = item_comment.text()
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
for row in range(tblStuff.rowCount()):
@ -399,12 +442,14 @@ class MainWindow(QMainWindow):
width = None
height = None
weight = None
comment = None
item_stuff = tblStuff.item(row, COL_STUFF)
item_length = tblStuff.item(row, COL_LENGTH)
item_width = tblStuff.item(row, COL_WIDTH)
item_height = tblStuff.item(row, COL_HEIGHT)
item_weight = tblStuff.item(row, COL_WEIGHT)
item_comment = tblStuff.item(row, COL_COMMENT)
if item_stuff:
stuff_text = item_stuff.text()
@ -433,8 +478,11 @@ class MainWindow(QMainWindow):
except ValueError:
weight = None
if item_comment:
comment = item_comment.text()
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
self.opened_file = os.path.basename(fileName)
@ -478,10 +526,12 @@ class MainWindow(QMainWindow):
garage_length = row[1]
garage_width = row[2]
garage_height = row[3]
garage_comment = row[4]
tblGarage.setItem(0, COL_LENGTH-1, QTableWidgetItem(str(garage_length)))
tblGarage.setItem(0, COL_WIDTH-1, QTableWidgetItem(str(garage_width)))
tblGarage.setItem(0, COL_HEIGHT-1, QTableWidgetItem(str(garage_height)))
tblGarage.setItem(0, COL_COMMENT-1, QTableWidgetItem(garage_comment))
except IndexError as ex:
pass
@ -493,12 +543,14 @@ class MainWindow(QMainWindow):
stuff_width = row[2]
stuff_height = row[3]
stuff_weight = row[4]
stuff_comment = row[5]
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_WIDTH, QTableWidgetItem(str(stuff_width)))
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_COMMENT, QTableWidgetItem(stuff_comment))
except IndexError as ex:
pass
@ -506,6 +558,8 @@ class MainWindow(QMainWindow):
row_idx += 1
tblStuff.setRowCount(TBL_STUFF_ROW_COUNT)
# optimize row height
tblStuff.resizeRowsToContents()
self.is_modified = False
self.opened_file = os.path.basename(fileName)
@ -513,7 +567,7 @@ class MainWindow(QMainWindow):
if fileName:
self.setWindowTitle(self.opened_file)
else:
self.setWindowTitle(f"{APP_NAME} {APP_VERSION} by {APP_AUTHOR}")
self.setWindowTitle(f"{qApp.applicationName()} {APP_VERSION} - {APP_AUTHOR}")
def file_export(self):
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_WIDTH, QCoreApplication.translate("main","Width") + " [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(1, 3, 10)
worksheet.set_column(4, 5, 20)
start_row = 2
# loop over table Garage
@ -567,9 +623,13 @@ class MainWindow(QMainWindow):
except ValueError:
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_WIDTH, garage_width)
worksheet.write(start_row + row, COL_HEIGHT, garage_height)
worksheet.write(start_row + row, COL_COMMENT, garage_comment)
start_row = 4
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_HEIGHT, QCoreApplication.translate("main","Height") + " [m]")
worksheet.write(start_row, COL_WEIGHT, QCoreApplication.translate("main","Weight") + " [kg]")
worksheet.write(start_row, COL_COMMENT, QCoreApplication.translate("main","Comment") )
start_row = 6
# loop over table Stuff
@ -589,6 +650,7 @@ class MainWindow(QMainWindow):
item_width = tblStuff.item(row, COL_WIDTH)
item_height = tblStuff.item(row, COL_HEIGHT)
item_weight = tblStuff.item(row, COL_WEIGHT)
item_comment = tblStuff.item(row, COL_COMMENT)
if item_stuff:
stuff_text = item_stuff.text()
@ -627,6 +689,11 @@ class MainWindow(QMainWindow):
except ValueError:
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:
row_idx += 1

View file

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