From 206d696efcee9f066fe0d50eb767232448757ae5 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Sat, 16 Dec 2017 12:51:01 +0100 Subject: [PATCH] Removed the need for install make step --- README.md | 21 +++-- lrelease.pri | 2 +- zeiterfassung/installs.pri | 156 +++++++++++++++++-------------- zeiterfassung/installs_unix.pri | 11 ++- zeiterfassung/installs_win32.pri | 69 ++++++++------ zeiterfassung/zeiterfassung.pro | 4 +- 6 files changed, 151 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index 6e3b550..40176c6 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,27 @@ # Zeiterfassung -This tool helps me assigning my working hours to various accounts at work. +This tool helps me assigning my working hours to projects at work. + +![Screenshot of the main window](https://raw.githubusercontent.com/0xFEEDC0DE64/QtZeiterfassung/master/screenshot.png) ## Building from source +The build process has only been tested with gcc. On windows you have to use MinGW (provided by the Qt setup). All necessary config files or translations should be copied over to the build folder. The executable with all plugin lands in your build folder under /bin + +The simplest way to get it up and running is to just open it in QtCreator. If you are more like a terminal monkey, you can build it there too: ``` git clone https://github.com/0xFEEDC0DE64/QtZeiterfassung.git -pushd QtZeiterfassung -lrelease translations/zeiterfassung_*.ts -popd mkdir build_QtZeiterfassung cd build_QtZeiterfassung qmake ../QtZeiterfassung make -make install # to copy Qt's translations ``` -## Launching +## Launching (on unix) ``` -./zeiterfassung +LD_LIBRARY_PATH=../lib ./zeiterfassung # or just use start.sh ``` +## Launching (on win32) +Double click the **zeiterfassung.exe**. Please report any error message like missing libraries or plugins! + +## Configuration This tool saves its configuration using [QSettings](https://doc.qt.io/qt-5/qsettings.html). On linux, the configuration files are placed in `~/.config/db-software/zeiterfassung.conf`. **Be careful!** This config file contains your password in plain text (if you log in correctly). You can alter the code in main.cpp to change the behaviour of QSettings (for example: saving into an ini file at working directory). - -![Screenshot of the main window](https://raw.githubusercontent.com/0xFEEDC0DE64/QtZeiterfassung/master/screenshot.png) diff --git a/lrelease.pri b/lrelease.pri index 23dba4a..a0ad8fa 100644 --- a/lrelease.pri +++ b/lrelease.pri @@ -5,7 +5,7 @@ isEmpty(QMAKE_LRELEASE) { lrelease.input = TRANSLATIONS lrelease.output = $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm -lrelease.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm +lrelease.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} lrelease.CONFIG += no_link QMAKE_EXTRA_COMPILERS += lrelease PRE_TARGETDEPS += compiler_lrelease_make_all diff --git a/zeiterfassung/installs.pri b/zeiterfassung/installs.pri index a9f5977..7782a92 100644 --- a/zeiterfassung/installs.pri +++ b/zeiterfassung/installs.pri @@ -1,71 +1,91 @@ -translationsinstall.path = $${DESTDIR}/translations -translationsinstall.files = $$[QT_INSTALL_TRANSLATIONS]/qt_en.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtbase_en.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtmultimedia_en.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtquick1_en.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtscript_nen.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtxmlpatterns_en.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qt_de.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtbase_de.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtmultimedia_de.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtquick1_de.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtscript_de.qm \ - $$[QT_INSTALL_TRANSLATIONS]/qtxmlpatterns_de.qm \ - $$OUT_PWD/translations/zeiterfassung_en.qm \ - $$OUT_PWD/translations/zeiterfassung_de.qm \ - $$OUT_PWD/../zeiterfassunglib/translations/zeiterfassunglib_en.qm \ - $$OUT_PWD/../zeiterfassunglib/translations/zeiterfassunglib_de.qm -INSTALLS += translationsinstall +COMPILED_TRANSLATIONS += $$[QT_INSTALL_TRANSLATIONS]/qt_en.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtbase_en.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtmultimedia_en.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtquick1_en.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtscript_en.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtxmlpatterns_en.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qt_de.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtbase_de.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtmultimedia_de.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtquick1_de.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtscript_de.qm \ + $$[QT_INSTALL_TRANSLATIONS]/qtxmlpatterns_de.qm \ + $${OUT_PWD}/translations/zeiterfassung_en.qm \ + $${OUT_PWD}/translations/zeiterfassung_de.qm \ + $${OUT_PWD}/../zeiterfassunglib/translations/zeiterfassunglib_en.qm \ + $${OUT_PWD}/../zeiterfassunglib/translations/zeiterfassunglib_de.qm -themesinstall.path = $${DESTDIR}/themes -themesinstall.files = themes/dark_theme.qss -INSTALLS += themesinstall +copy_compiled_translations.input = COMPILED_TRANSLATIONS +copy_compiled_translations.output = $${DESTDIR}/translations/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_compiled_translations.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_compiled_translations.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_compiled_translations +PRE_TARGETDEPS += compiler_copy_compiled_translations_make_all -darkthemeinstall.path = $${DESTDIR}/themes/dark_theme -darkthemeinstall.files = themes/dark_theme/checkbox_indeterminate_disabled.png \ - themes/dark_theme/radio_unchecked.png \ - themes/dark_theme/up_arrow.png \ - themes/dark_theme/branch_closed-on.png \ - themes/dark_theme/checkbox_checked_disabled.png \ - themes/dark_theme/checkbox_unchecked.png \ - themes/dark_theme/checkbox_indeterminate.png \ - themes/dark_theme/stylesheet-branch-more.png \ - themes/dark_theme/checkbox_checked.png \ - themes/dark_theme/checkbox_unchecked_disabled.png \ - themes/dark_theme/radio_checked.png \ - themes/dark_theme/checkbox_indeterminate_focus.png \ - themes/dark_theme/checkbox_checked_focus.png \ - themes/dark_theme/branch_closed.png \ - themes/dark_theme/Vsepartoolbar.png \ - themes/dark_theme/radio_checked_disabled.png \ - themes/dark_theme/left_arrow.png \ - themes/dark_theme/Vmovetoolbar.png \ - themes/dark_theme/branch_open-on.png \ - themes/dark_theme/close.png \ - themes/dark_theme/stylesheet-branch-end.png \ - themes/dark_theme/stylesheet-vline.png \ - themes/dark_theme/down_arrow_disabled.png \ - themes/dark_theme/radio_unchecked_disabled.png \ - themes/dark_theme/left_arrow_disabled.png \ - themes/dark_theme/Hmovetoolbar.png \ - themes/dark_theme/close-pressed.png \ - themes/dark_theme/up_arrow_disabled.png \ - themes/dark_theme/branch_open.png \ - themes/dark_theme/radio_checked_focus.png \ - themes/dark_theme/sizegrip.png \ - themes/dark_theme/checkbox_unchecked_focus.png \ - themes/dark_theme/right_arrow_disabled.png \ - themes/dark_theme/Hsepartoolbar.png \ - themes/dark_theme/undock.png \ - themes/dark_theme/transparent.png \ - themes/dark_theme/close-hover.png \ - themes/dark_theme/radio_unchecked_focus.png \ - themes/dark_theme/down_arrow.png \ - themes/dark_theme/right_arrow.png -INSTALLS += darkthemeinstall +THEMES += themes/dark_theme.qss -stripsinstall.path = $${DESTDIR}/strips -stripsinstall.files = strips/bookingstartstrip.ui \ - strips/bookingendstrip.ui \ - strips/timeassignmentstrip.ui -INSTALLS += stripsinstall +copy_themes.input = THEMES +copy_themes.output = $${DESTDIR}/themes/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_themes.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_themes.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_themes +PRE_TARGETDEPS += compiler_copy_themes_make_all + +DARK_THEME_RESOURCES += themes/dark_theme/checkbox_indeterminate_disabled.png \ + themes/dark_theme/radio_unchecked.png \ + themes/dark_theme/up_arrow.png \ + themes/dark_theme/branch_closed-on.png \ + themes/dark_theme/checkbox_checked_disabled.png \ + themes/dark_theme/checkbox_unchecked.png \ + themes/dark_theme/checkbox_indeterminate.png \ + themes/dark_theme/stylesheet-branch-more.png \ + themes/dark_theme/checkbox_checked.png \ + themes/dark_theme/checkbox_unchecked_disabled.png \ + themes/dark_theme/radio_checked.png \ + themes/dark_theme/checkbox_indeterminate_focus.png \ + themes/dark_theme/checkbox_checked_focus.png \ + themes/dark_theme/branch_closed.png \ + themes/dark_theme/Vsepartoolbar.png \ + themes/dark_theme/radio_checked_disabled.png \ + themes/dark_theme/left_arrow.png \ + themes/dark_theme/Vmovetoolbar.png \ + themes/dark_theme/branch_open-on.png \ + themes/dark_theme/close.png \ + themes/dark_theme/stylesheet-branch-end.png \ + themes/dark_theme/stylesheet-vline.png \ + themes/dark_theme/down_arrow_disabled.png \ + themes/dark_theme/radio_unchecked_disabled.png \ + themes/dark_theme/left_arrow_disabled.png \ + themes/dark_theme/Hmovetoolbar.png \ + themes/dark_theme/close-pressed.png \ + themes/dark_theme/up_arrow_disabled.png \ + themes/dark_theme/branch_open.png \ + themes/dark_theme/radio_checked_focus.png \ + themes/dark_theme/sizegrip.png \ + themes/dark_theme/checkbox_unchecked_focus.png \ + themes/dark_theme/right_arrow_disabled.png \ + themes/dark_theme/Hsepartoolbar.png \ + themes/dark_theme/undock.png \ + themes/dark_theme/transparent.png \ + themes/dark_theme/close-hover.png \ + themes/dark_theme/radio_unchecked_focus.png \ + themes/dark_theme/down_arrow.png \ + themes/dark_theme/right_arrow.png + +copy_dark_theme_resouces.input = DARK_THEME_RESOURCES +copy_dark_theme_resouces.output = $${DESTDIR}/themes/dark_theme/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_dark_theme_resouces.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_dark_theme_resouces.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_dark_theme_resouces +PRE_TARGETDEPS += compiler_copy_dark_theme_resouces_make_all + +STRIPLAYOUTS += strips/bookingstartstrip.ui \ + strips/bookingendstrip.ui \ + strips/timeassignmentstrip.ui + +copy_striplayouts.input = STRIPLAYOUTS +copy_striplayouts.output = $${DESTDIR}/strips/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_striplayouts.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_striplayouts.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_striplayouts +PRE_TARGETDEPS += compiler_copy_striplayouts_make_all diff --git a/zeiterfassung/installs_unix.pri b/zeiterfassung/installs_unix.pri index 0e21c25..c8dd1f2 100644 --- a/zeiterfassung/installs_unix.pri +++ b/zeiterfassung/installs_unix.pri @@ -1,3 +1,8 @@ -scriptsinstall.path = $${DESTDIR} -scriptsinstall.files = unix/start.sh -INSTALLS += scriptsinstall +SCRIPTS += unix/start.sh + +copy_scripts.input = SCRIPTS +copy_scripts.output = $${DESTDIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_scripts.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_scripts.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_scripts +PRE_TARGETDEPS += compiler_copy_scripts_make_all diff --git a/zeiterfassung/installs_win32.pri b/zeiterfassung/installs_win32.pri index 9254151..4279b20 100644 --- a/zeiterfassung/installs_win32.pri +++ b/zeiterfassung/installs_win32.pri @@ -1,34 +1,45 @@ CONFIG(debug, release|debug): DEBUG_SIGN = d -libinstall.path = $${DESTDIR} -libinstall.files = win32/Qt.conf \ - $$OUT_PWD/../lib/zeiterfassunglib.dll \ - $$[QT_INSTALL_BINS]/Qt5Core$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_BINS]/Qt5Gui$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_BINS]/Qt5Network$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_BINS]/Qt5Widgets$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_BINS]/libgcc_s_dw2-1.dll \ - $$[QT_INSTALL_BINS]/libstd~1.dll \ - $$[QT_INSTALL_BINS]/libwinpthread-1.dll -INSTALLS += libinstall +LIBRARIES += win32/Qt.conf \ + $$OUT_PWD/../lib/zeiterfassunglib.dll \ + $$[QT_INSTALL_BINS]/Qt5Core$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_BINS]/Qt5Gui$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_BINS]/Qt5Network$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_BINS]/Qt5Widgets$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_BINS]/libgcc_s_dw2-1.dll \ + $$[QT_INSTALL_BINS]/libstdc++-6.dll \ + $$[QT_INSTALL_BINS]/libwinpthread-1.dll -iconenginesinstall.path = $$DESTDIR/plugins/iconengines -iconenginesinstall.files = $$[QT_INSTALL_PLUGINS]/iconengines/qsvgicon$${DEBUG_SIGN}.dll -INSTALLS += iconenginesinstall +copy_libraries.input = LIBRARIES +copy_libraries.output = $${DESTDIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_libraries.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_libraries.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_libraries +PRE_TARGETDEPS += compiler_copy_libraries_make_all -imageformatsinstall.path = $$DESTDIR/plugins/imageformats -imageformatsinstall.files = $$[QT_INSTALL_PLUGINS]/imageformats/qdds$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qgif$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qicns$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qico$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qjpeg$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qsvg$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qtga$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qtiff$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qwbmp$${DEBUG_SIGN}.dll \ - $$[QT_INSTALL_PLUGINS]/imageformats/qwebp$${DEBUG_SIGN}.dll -INSTALLS += imageformatsinstall +IMAGE_FORMATS += $$[QT_INSTALL_PLUGINS]/imageformats/qdds$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qgif$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qicns$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qico$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qjpeg$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qsvg$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qtga$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qtiff$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qwbmp$${DEBUG_SIGN}.dll \ + $$[QT_INSTALL_PLUGINS]/imageformats/qwebp$${DEBUG_SIGN}.dll -platformsinstall.path = $$DESTDIR/plugins/platforms -win32: platformsinstall.files = $$[QT_INSTALL_PLUGINS]/platforms/qwindows$${DEBUG_SIGN}.dll -INSTALLS += platformsinstall +copy_image_formats.input = IMAGE_FORMATS +copy_image_formats.output = $${DESTDIR}/plugins/imageformats/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_image_formats.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_image_formats.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_image_formats +PRE_TARGETDEPS += compiler_copy_image_formats_make_all + +PLATFORMS += $$[QT_INSTALL_PLUGINS]/platforms/qwindows$${DEBUG_SIGN}.dll + +copy_platforms.input = PLATFORMS +copy_platforms.output = $${DESTDIR}/plugins/platforms/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_platforms.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_platforms.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_platforms +PRE_TARGETDEPS += compiler_copy_platforms_make_all diff --git a/zeiterfassung/zeiterfassung.pro b/zeiterfassung/zeiterfassung.pro index a4214f7..23b76b5 100755 --- a/zeiterfassung/zeiterfassung.pro +++ b/zeiterfassung/zeiterfassung.pro @@ -27,8 +27,8 @@ FORMS += strips/bookingstartstrip.ui \ RESOURCES += -TRANSLATIONS += translations/zeiterfassung_en.ts \ - translations/zeiterfassung_de.ts +TRANSLATIONS += translations/zeiterfassung_en.ts \ + translations/zeiterfassung_de.ts include(../lrelease.pri)