2015-07-10 21:37:22 +00:00
|
|
|
#include <QApplication>
|
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
|
#include <QtQml>
|
|
|
|
|
|
|
|
|
|
#include "ClientDataModel.hpp"
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
2015-07-13 18:14:58 +00:00
|
|
|
fc::thread::current().set_name( "main" );
|
2015-07-10 21:37:22 +00:00
|
|
|
QApplication app(argc, argv);
|
2015-07-13 18:35:17 +00:00
|
|
|
app.setApplicationName("Graphene Client");
|
|
|
|
|
app.setOrganizationDomain("cryptonomex.org");
|
|
|
|
|
app.setOrganizationName("Cryptonomex, Inc.");
|
2015-07-10 21:37:22 +00:00
|
|
|
|
2015-07-13 18:14:58 +00:00
|
|
|
qRegisterMetaType<std::function<void()>>();
|
|
|
|
|
|
2015-07-10 21:37:22 +00:00
|
|
|
qmlRegisterType<Asset>("Graphene.Client", 0, 1, "Asset");
|
|
|
|
|
qmlRegisterType<Balance>("Graphene.Client", 0, 1, "Balance");
|
|
|
|
|
qmlRegisterType<Account>("Graphene.Client", 0, 1, "Account");
|
2015-07-13 17:19:07 +00:00
|
|
|
qmlRegisterType<ChainDataModel>("Graphene.Client", 0, 1, "DataModel");
|
|
|
|
|
qmlRegisterType<GrapheneApplication>("Graphene.Client", 0, 1, "GrapheneApplication");
|
2015-07-10 21:37:22 +00:00
|
|
|
|
|
|
|
|
QQmlApplicationEngine engine;
|
2015-07-14 13:46:38 +00:00
|
|
|
/*
|
2015-07-13 21:22:06 +00:00
|
|
|
QVariant crypto;
|
|
|
|
|
crypto.setValue(Crypto());
|
|
|
|
|
engine.rootContext()->setContextProperty("Crypto", crypto);
|
2015-07-14 13:46:38 +00:00
|
|
|
*/
|
2015-07-13 18:16:02 +00:00
|
|
|
#ifdef NDEBUG
|
2015-07-10 21:37:22 +00:00
|
|
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
2015-07-13 18:16:02 +00:00
|
|
|
#else
|
|
|
|
|
engine.load(QUrl(QStringLiteral("qml/main.qml")));
|
|
|
|
|
#endif
|
2015-07-10 21:37:22 +00:00
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
|
}
|