-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqtedit
executable file
·36 lines (26 loc) · 861 Bytes
/
qtedit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#use the qt designer to open the ".ui" file
/usr/lib/qt5/bin/designer "$1"
#get names
filebasename=$(python3 -c "
import sys
import os
print(sys.argv[1].split('.')[0].split(os.sep)[-1])
" "$1")
targetpyfile=$(python3 -c "
import sys
print(sys.argv[1].split('.')[0] + '.py')
" "$1")
# after your're done run pyuic5
pyuic5 "$1" -o "$targetpyfile" --resource-suffix _rc --import-from gui
# run lupdate to update the .ts files
lupdate "$1" -ts res/l10n/"$filebasename"_de.ts res/l10n/"$filebasename"_en.ts
# run linguist to edit .ts files
linguist res/l10n/"$filebasename"_de.ts res/l10n/"$filebasename"_en.ts
# run lrelease to convert to .ts files to .qm files
lrelease res/l10n/*.ts
# check the resource file
#nano res/resources.qrc
# ..or not.
#convert the qrc file into a .py resource file.
pyrcc5 res/resources.qrc -o gui/resources_rc.py