Use gettext for generated GUI code
Instead of using the Qt system. So I can use one single way for everything Also join all the targets into one single target.
This commit is contained in:
parent
f3947b5367
commit
9c7719831a
23
Makefile
23
Makefile
@ -1,16 +1,19 @@
|
|||||||
.PHONY: gui
|
.PHONY: gui
|
||||||
gui: relational_gui/survey.py relational_gui/maingui.py relational_gui/rel_edit.py relational_gui/resources.py
|
gui: relational_gui/survey.py relational_gui/maingui.py relational_gui/rel_edit.py relational_gui/resources.py
|
||||||
|
|
||||||
relational_gui/survey.py:
|
relational_gui/maingui.py relational_gui/survey.py relational_gui/rel_edit.py:
|
||||||
pyuic5 relational_gui/survey.ui > relational_gui/survey.py
|
# Create .py file
|
||||||
|
pyuic5 $(basename $@).ui > $@
|
||||||
relational_gui/maingui.py:
|
# Use my custom editor class
|
||||||
pyuic5 relational_gui/maingui.ui > relational_gui/maingui.py
|
sed -i 's/QtWidgets.QPlainTextEdit/editor.Editor/g' $@
|
||||||
sed -i 's/QtWidgets.QPlainTextEdit/editor.Editor/g' relational_gui/maingui.py
|
echo 'from . import editor' >> $@
|
||||||
echo 'from . import editor' >> relational_gui/maingui.py
|
# Use gettext instead of Qt translations
|
||||||
|
echo 'from gettext import gettext as _' >> $@
|
||||||
relational_gui/rel_edit.py:
|
sed -i \
|
||||||
pyuic5 relational_gui/rel_edit.ui > relational_gui/rel_edit.py
|
-e 's/_translate("MainWindow", /_(/g' \
|
||||||
|
-e 's/_translate("Dialog", /_(/g' \
|
||||||
|
-e 's/_translate("Form", /_(/g' \
|
||||||
|
$@
|
||||||
|
|
||||||
relational_gui/resources.py:
|
relational_gui/resources.py:
|
||||||
pyrcc5 relational_gui/resources.qrc > relational_gui/resources.py
|
pyrcc5 relational_gui/resources.qrc > relational_gui/resources.py
|
||||||
|
Loading…
Reference in New Issue
Block a user