Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,372 changed files
with
23,619 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# biz_data_x APP for Qt 5.7 | ||
If not otherwise mentioned inside source files (*.cpp, *.hpp, *.qml): | ||
|
||
##Author: | ||
ekke (Ekkehard Gentz) | ||
|
||
Max-Josefs-Platz 30 | ||
|
||
83022 Rosenheim | ||
|
||
Germany | ||
|
||
Twitter: @ekkescorner | ||
|
||
LinkedIn: https://de.linkedin.com/in/ekkehard | ||
|
||
###blogs | ||
http://ekkes-corner.org | ||
|
||
http://appbus.org | ||
|
||
http://j.mp/qt-x | ||
|
||
(c) 2016 ekke (ekkehard gentz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# ekke (Ekkehard Gentz) @ekkescorner | ||
TEMPLATE = app | ||
TARGET = c2gQtCon_x | ||
|
||
QT += qml quick core | ||
CONFIG += c++11 | ||
|
||
HEADERS += \ | ||
cpp/applicationui.hpp \ | ||
cpp/uiconstants.hpp \ | ||
cpp/gen/SettingsData.hpp \ | ||
cpp/gen/Bookmark.hpp \ | ||
cpp/gen/Building.hpp \ | ||
cpp/gen/Conference.hpp \ | ||
cpp/gen/DataManager.hpp \ | ||
cpp/gen/Day.hpp \ | ||
cpp/gen/Favorite.hpp \ | ||
cpp/gen/Floor.hpp \ | ||
cpp/gen/PersonsAPI.hpp \ | ||
cpp/gen/Room.hpp \ | ||
cpp/gen/ScheduleItem.hpp \ | ||
cpp/gen/Session.hpp \ | ||
cpp/gen/SessionAPI.hpp \ | ||
cpp/gen/SessionTrack.hpp \ | ||
cpp/gen/Speaker.hpp \ | ||
cpp/gen/SpeakerAPI.hpp \ | ||
cpp/gen/SpeakerImage.hpp | ||
|
||
SOURCES += cpp/main.cpp \ | ||
cpp/applicationui.cpp \ | ||
cpp/gen/SettingsData.cpp \ | ||
cpp/gen/Bookmark.cpp \ | ||
cpp/gen/Building.cpp \ | ||
cpp/gen/Conference.cpp \ | ||
cpp/gen/DataManager.cpp \ | ||
cpp/gen/Day.cpp \ | ||
cpp/gen/Favorite.cpp \ | ||
cpp/gen/Floor.cpp \ | ||
cpp/gen/PersonsAPI.cpp \ | ||
cpp/gen/Room.cpp \ | ||
cpp/gen/ScheduleItem.cpp \ | ||
cpp/gen/Session.cpp \ | ||
cpp/gen/SessionAPI.cpp \ | ||
cpp/gen/SessionTrack.cpp \ | ||
cpp/gen/Speaker.cpp \ | ||
cpp/gen/SpeakerAPI.cpp \ | ||
cpp/gen/SpeakerImage.cpp | ||
|
||
lupdate_only { | ||
SOURCES += qml/main.qml \ | ||
qml/common/*.qml \ | ||
qml/navigation/*.qml \ | ||
qml/pages/*.qml \ | ||
qml/popups/*.qml \ | ||
qml/tabs/*.qml | ||
} | ||
|
||
OTHER_FILES += images/black/*.png \ | ||
images/black/x18/*.png \ | ||
images/black/x36/*.png \ | ||
images/black/x48/*.png \ | ||
images/white/*.png \ | ||
images/white/x18/*.png \ | ||
images/white/x36/*.png \ | ||
images/white/x48/*.png \ | ||
images/extra/*.png \ | ||
translations/*.* \ | ||
data-assets/*.json \ | ||
data-assets/prod/*.json \ | ||
data-assets/test/*.json \ | ||
images/LICENSE \ | ||
LICENSE \ | ||
*.md | ||
|
||
RESOURCES += qml.qrc \ | ||
translations.qrc \ | ||
images.qrc \ | ||
data-assets.qrc | ||
|
||
# Additional import path used to resolve QML modules in Qt Creator's code model | ||
QML_IMPORT_PATH = | ||
|
||
# Default rules for deployment. | ||
include(deployment.pri) | ||
|
||
# T R A N S L A T I O N S | ||
|
||
# if languages are added: | ||
# 1. rebuild project to generate *.qm | ||
# 2. add existing .qm files to translations.qrc | ||
|
||
# if changes to translatable strings: | ||
# 1. Run Tools-External-Linguist-Update | ||
# 2. Run Linguist and do translations | ||
# 3. Build and run on iOS and Android to verify translations | ||
# 4. Optional: if translations not done: Run Tools-External-Linguist-Release | ||
|
||
# Supported languages | ||
LANGUAGES = de en | ||
|
||
# used to create .ts files | ||
defineReplace(prependAll) { | ||
for(a,$$1):result += $$2$${a}$$3 | ||
return($$result) | ||
} | ||
# Available translations | ||
tsroot = $$join(TARGET,,,.ts) | ||
tstarget = $$join(TARGET,,,_) | ||
TRANSLATIONS = $$PWD/translations/$$tsroot | ||
TRANSLATIONS += $$prependAll(LANGUAGES, $$PWD/translations/$$tstarget, .ts) | ||
# run LRELEASE to generate the qm files | ||
qtPrepareTool(LRELEASE, lrelease) | ||
for(tsfile, TRANSLATIONS) { | ||
command = $$LRELEASE $$tsfile | ||
system($$command)|error("Failed to run: $$command") | ||
} | ||
|
||
DISTFILES += \ | ||
cpp/gen/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
// ekke (Ekkehard Gentz) @ekkescorner | ||
#include "applicationui.hpp" | ||
#include "uiconstants.hpp" | ||
|
||
#include <QtQml> | ||
#include <QGuiApplication> | ||
|
||
#include <QJsonObject> | ||
#include <QFile> | ||
|
||
|
||
#include <QDebug> | ||
|
||
const QString settingsDataFile = "/settingsData.json"; | ||
|
||
using namespace ekke::constants; | ||
|
||
ApplicationUI::ApplicationUI(QObject *parent) : QObject(parent), mDataManager(new DataManager(this)) | ||
{ | ||
mSettingsData = mDataManager->settingsData(); | ||
|
||
mCachingDone = false; | ||
mCachingInWork = false; | ||
|
||
} | ||
|
||
void ApplicationUI::addContextProperty(QQmlContext *context) | ||
{ | ||
context->setContextProperty("dataManager", mDataManager); | ||
} | ||
|
||
/* Change Theme Palette */ | ||
QStringList ApplicationUI::swapThemePalette() | ||
{ | ||
mSettingsData->setDarkTheme(!mSettingsData->darkTheme()); | ||
if (mSettingsData->darkTheme()) { | ||
return darkPalette; | ||
} | ||
return lightPalette; | ||
} | ||
|
||
/* Get current default Theme Palette */ | ||
QStringList ApplicationUI::defaultThemePalette() | ||
{ | ||
if (mSettingsData->darkTheme()) { | ||
return darkPalette; | ||
} | ||
return lightPalette; | ||
} | ||
|
||
/* Get one of the Primary Palettes */ | ||
QStringList ApplicationUI::primaryPalette(const int paletteIndex) | ||
{ | ||
mSettingsData->setPrimaryColor(paletteIndex); | ||
switch (paletteIndex) { | ||
case 0: | ||
return materialRed; | ||
break; | ||
case 1: | ||
return materialPink; | ||
break; | ||
case 2: | ||
return materialPurple; | ||
break; | ||
case 3: | ||
return materialDeepPurple; | ||
break; | ||
case 4: | ||
return materialIndigo; | ||
break; | ||
case 5: | ||
return materialBlue; | ||
break; | ||
case 6: | ||
return materialLightBlue; | ||
break; | ||
case 7: | ||
return materialCyan; | ||
break; | ||
case 8: | ||
return materialTeal; | ||
break; | ||
case 9: | ||
return materialGreen; | ||
break; | ||
case 10: | ||
return materialLightGreen; | ||
break; | ||
case 11: | ||
return materialLime; | ||
break; | ||
case 12: | ||
return materialYellow; | ||
break; | ||
case 13: | ||
return materialAmber; | ||
break; | ||
case 14: | ||
return materialOrange; | ||
break; | ||
case 15: | ||
return materialDeepOrange; | ||
break; | ||
case 16: | ||
return materialBrown; | ||
break; | ||
case 17: | ||
return materialGrey; | ||
break; | ||
default: | ||
return materialBlueGrey; | ||
break; | ||
} | ||
} | ||
|
||
/* Get one of the Accent Palettes */ | ||
QStringList ApplicationUI::accentPalette(const int paletteIndex) | ||
{ | ||
mSettingsData->setAccentColor(paletteIndex); | ||
int currentPrimary = mSettingsData->primaryColor(); | ||
QStringList thePalette = primaryPalette(paletteIndex); | ||
mSettingsData->setPrimaryColor(currentPrimary); | ||
// we need: primaryColor, textOnPrimary, iconOnPrimaryFolder | ||
return QStringList{thePalette.at(1), thePalette.at(4), thePalette.at(7)}; | ||
} | ||
|
||
/* Get Default Primary Palette */ | ||
QStringList ApplicationUI::defaultPrimaryPalette() | ||
{ | ||
return primaryPalette(mSettingsData->primaryColor()); | ||
} | ||
|
||
/* Get Default Accent Palette */ | ||
QStringList ApplicationUI::defaultAccentPalette() | ||
{ | ||
return accentPalette(mSettingsData->accentColor()); | ||
} | ||
|
||
bool ApplicationUI::isDebugBuild() | ||
{ | ||
#ifdef QT_DEBUG | ||
return true; | ||
#endif | ||
qDebug() << "Running a RELEASE build"; | ||
return false; | ||
} | ||
|
||
|
||
// ATTENTION | ||
// iOS: NO SIGNAL | ||
// Android: SIGNAL if leaving the App with Android BACK Key | ||
// Android: NO SIGNAL if using HOME or OVERVIEW and THEN CLOSE from there | ||
void ApplicationUI::onAboutToQuit() | ||
{ | ||
qDebug() << "On About to Q U I T Signal received"; | ||
startCaching(); | ||
} | ||
|
||
void ApplicationUI::onApplicationStateChanged(Qt::ApplicationState applicationState) | ||
{ | ||
qDebug() << "S T A T E changed into: " << applicationState; | ||
if(applicationState == Qt::ApplicationState::ApplicationSuspended) { | ||
startCaching(); | ||
return; | ||
} | ||
if(applicationState == Qt::ApplicationState::ApplicationActive) { | ||
resetCaching(); | ||
} | ||
} | ||
|
||
void ApplicationUI::resetCaching() | ||
{ | ||
if(mCachingInWork) { | ||
qDebug() << "no reset caching - already in work"; | ||
return; | ||
} | ||
qDebug() << "reset caching"; | ||
mCachingDone = false; | ||
} | ||
|
||
void ApplicationUI::startCaching() | ||
{ | ||
if(mCachingInWork || mCachingDone) { | ||
qDebug() << "no start caching - already in work ? " << mCachingInWork << " done ? " << mCachingDone; | ||
return; | ||
} | ||
doCaching(); | ||
} | ||
|
||
void ApplicationUI::doCaching() | ||
{ | ||
qDebug() << "DO Caching BEGIN"; | ||
mCachingInWork = true; | ||
mCachingDone = false; | ||
|
||
mDataManager->finish(); | ||
|
||
mCachingInWork = false; | ||
mCachingDone = QGuiApplication::applicationState() != Qt::ApplicationState::ApplicationActive; | ||
qDebug() << "DO Caching END - Done ? " << mCachingDone; | ||
} | ||
|
||
|
||
|
Oops, something went wrong.