|
@ -1,16 +1,32 @@ |
|
|
#include "samplecoreapp.h" |
|
|
#include "samplecoreapp.h" |
|
|
#include "sampleviewmodel.h" |
|
|
#include "sampleviewmodel.h" |
|
|
|
|
|
#include "drawerviewmodel.h" |
|
|
|
|
|
|
|
|
#include <QtCore/QCommandLineParser> |
|
|
#include <QtCore/QCommandLineParser> |
|
|
#include <QtMvvmCore/QtMvvmCoreVersion> |
|
|
#include <QtMvvmCore/QtMvvmCoreVersion> |
|
|
|
|
|
|
|
|
SampleCoreApp::SampleCoreApp(QObject *parent) : |
|
|
SampleCoreApp::SampleCoreApp(QObject *parent) : |
|
|
CoreApp(parent) |
|
|
CoreApp(parent), |
|
|
|
|
|
_showDrawer(false) |
|
|
{ |
|
|
{ |
|
|
QCoreApplication::setApplicationVersion(QStringLiteral(QTMVVMCORE_VERSION_STR)); |
|
|
QCoreApplication::setApplicationVersion(QStringLiteral(QTMVVMCORE_VERSION_STR)); |
|
|
QCoreApplication::setOrganizationName(QStringLiteral("Skycoder42")); |
|
|
QCoreApplication::setOrganizationName(QStringLiteral("Skycoder42")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool SampleCoreApp::showDrawer() const |
|
|
|
|
|
{ |
|
|
|
|
|
return _showDrawer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SampleCoreApp::setShowDrawer(bool showDrawer) |
|
|
|
|
|
{ |
|
|
|
|
|
if (_showDrawer == showDrawer) |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
_showDrawer = showDrawer; |
|
|
|
|
|
emit showDrawerChanged(_showDrawer); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void SampleCoreApp::performRegistrations() |
|
|
void SampleCoreApp::performRegistrations() |
|
|
{ |
|
|
{ |
|
|
Q_INIT_RESOURCE(sample_core); |
|
|
Q_INIT_RESOURCE(sample_core); |
|
@ -30,7 +46,7 @@ int SampleCoreApp::startApp(const QStringList &arguments) |
|
|
}); |
|
|
}); |
|
|
parser.addPositionalArgument(QStringLiteral("names"), |
|
|
parser.addPositionalArgument(QStringLiteral("names"), |
|
|
QStringLiteral("A list of names, joined together as one string"), |
|
|
QStringLiteral("A list of names, joined together as one string"), |
|
|
QStringLiteral("[name...")); |
|
|
QStringLiteral("[names...]")); |
|
|
|
|
|
|
|
|
if(!autoParse(parser, arguments)) |
|
|
if(!autoParse(parser, arguments)) |
|
|
return EXIT_SUCCESS; |
|
|
return EXIT_SUCCESS; |
|
@ -39,5 +55,7 @@ int SampleCoreApp::startApp(const QStringList &arguments) |
|
|
args.insert(SampleViewModel::KeyActive, parser.isSet(QStringLiteral("active"))); |
|
|
args.insert(SampleViewModel::KeyActive, parser.isSet(QStringLiteral("active"))); |
|
|
args.insert(SampleViewModel::KeyNames, parser.positionalArguments()); |
|
|
args.insert(SampleViewModel::KeyNames, parser.positionalArguments()); |
|
|
show<SampleViewModel>(args); |
|
|
show<SampleViewModel>(args); |
|
|
|
|
|
if(_showDrawer) |
|
|
|
|
|
show<DrawerViewModel>(); |
|
|
return EXIT_SUCCESS; |
|
|
return EXIT_SUCCESS; |
|
|
} |
|
|
} |
|
|