aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-02-08 12:39:11 +0200
committerRiccardo Spagni <ric@spagni.net>2017-02-08 12:39:11 +0200
commit2901a3369855629c2cd08f19bc5a7e54e53f21d1 (patch)
tree8378912bd2e33051845aa0c6c0c4215e27a98230
parent979acf774a559745ef0be3ca41445385f9ecf698 (diff)
parent78302be193c8a29323760ad4e30073adf7a58cf6 (diff)
downloadmonzero-gui-2901a3369855629c2cd08f19bc5a7e54e53f21d1.tar.gz
monzero-gui-2901a3369855629c2cd08f19bc5a7e54e53f21d1.tar.xz
monzero-gui-2901a3369855629c2cd08f19bc5a7e54e53f21d1.zip
Merge pull request #440
78302be IOS specific settings (Jaquee) c6dc9a2 IOS build settings (Jaquee)
-rw-r--r--main.cpp23
-rw-r--r--monero-wallet-gui.pro91
2 files changed, 87 insertions, 27 deletions
diff --git a/main.cpp b/main.cpp
index 83e48546..63740cbf 100644
--- a/main.cpp
+++ b/main.cpp
@@ -47,13 +47,17 @@
#include "TransactionHistory.h"
#include "model/TransactionHistoryModel.h"
#include "model/TransactionHistorySortFilterModel.h"
-#include "daemon/DaemonManager.h"
#include "AddressBook.h"
#include "model/AddressBookModel.h"
+// IOS exclusions
+#ifndef Q_OS_IOS
+#include "daemon/DaemonManager.h"
+#endif
int main(int argc, char *argv[])
{
+
QApplication app(argc, argv);
qDebug() << "app startd";
@@ -96,10 +100,10 @@ int main(int argc, char *argv[])
qmlRegisterUncreatableType<TransactionInfo>("moneroComponents.TransactionInfo", 1, 0, "TransactionInfo",
"TransactionHistory can't be instantiated directly");
-
+#ifndef Q_OS_IOS
qmlRegisterUncreatableType<DaemonManager>("moneroComponents.DaemonManager", 1, 0, "DaemonManager",
"DaemonManager can't be instantiated directly");
-
+#endif
qmlRegisterUncreatableType<AddressBookModel>("moneroComponents.AddressBookModel", 1, 0, "AddressBookModel",
"AddressBookModel can't be instantiated directly");
@@ -125,9 +129,13 @@ int main(int argc, char *argv[])
engine.addImageProvider(QLatin1String("qrcode"), new QRCodeImageProvider());
const QStringList arguments = QCoreApplication::arguments();
+
+// Exclude daemon manager from IOS
+#ifndef Q_OS_IOS
DaemonManager * daemonManager = DaemonManager::instance(&arguments);
QObject::connect(&app, SIGNAL(aboutToQuit()), daemonManager, SLOT(closing()));
engine.rootContext()->setContextProperty("daemonManager", daemonManager);
+#endif
// export to QML monero accounts root directory
// wizard is talking about where
@@ -135,13 +143,18 @@ int main(int argc, char *argv[])
// backups - I reckon we save that in My Documents\Monero Accounts\ on
// Windows, ~/Monero Accounts/ on nix / osx
bool isWindows = false;
+ bool isIOS = false;
#ifdef Q_OS_WIN
isWindows = true;
QStringList moneroAccountsRootDir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
+#elif defined(Q_OS_IOS)
+ isIOS = true;
+ QStringList moneroAccountsRootDir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
#elif defined(Q_OS_UNIX)
QStringList moneroAccountsRootDir = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
#endif
engine.rootContext()->setContextProperty("isWindows", isWindows);
+ engine.rootContext()->setContextProperty("isIOS", isIOS);
if (!moneroAccountsRootDir.empty()) {
QString moneroAccountsDir = moneroAccountsRootDir.at(0) + "/Monero/wallets";
@@ -160,6 +173,8 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("defaultAccountName", accountName);
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
+
+ // Load main window (context properties needs to be defined obove this line)
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
QObject *rootObject = engine.rootObjects().first();
@@ -168,8 +183,6 @@ int main(int argc, char *argv[])
QObject::connect(eventFilter, SIGNAL(mousePressed(QVariant,QVariant,QVariant)), rootObject, SLOT(mousePressed(QVariant,QVariant,QVariant)));
QObject::connect(eventFilter, SIGNAL(mouseReleased(QVariant,QVariant,QVariant)), rootObject, SLOT(mouseReleased(QVariant,QVariant,QVariant)));
- //WalletManager::instance()->setLogLevel(WalletManager::LogLevel_Max);
-
bool builtWithScanner = false;
#ifdef WITH_SCANNER
builtWithScanner = true;
diff --git a/monero-wallet-gui.pro b/monero-wallet-gui.pro
index 3066a296..902a99b3 100644
--- a/monero-wallet-gui.pro
+++ b/monero-wallet-gui.pro
@@ -34,7 +34,6 @@ HEADERS += \
src/QR-Code-generator/BitBuffer.hpp \
src/QR-Code-generator/QrCode.hpp \
src/QR-Code-generator/QrSegment.hpp \
- src/daemon/DaemonManager.h \
src/model/AddressBookModel.h \
src/libwalletqt/AddressBook.h \
src/zxcvbn-c/zxcvbn.h \
@@ -58,13 +57,17 @@ SOURCES += main.cpp \
src/QR-Code-generator/BitBuffer.cpp \
src/QR-Code-generator/QrCode.cpp \
src/QR-Code-generator/QrSegment.cpp \
- src/daemon/DaemonManager.cpp \
src/model/AddressBookModel.cpp \
src/libwalletqt/AddressBook.cpp \
src/zxcvbn-c/zxcvbn.c \
src/libwalletqt/UnsignedTransaction.cpp \
src/QR-Code-scanner/QrCodeScanner.cpp
+!ios {
+ HEADERS += src/daemon/DaemonManager.h
+ SOURCES += src/daemon/DaemonManager.cpp
+}
+
lupdate_only {
SOURCES = *.qml \
components/*.qml \
@@ -73,11 +76,50 @@ SOURCES = *.qml \
wizard/*js
}
+
+ios:armv7 {
+ message("target is armv7")
+ LIBS += \
+ -L$$PWD/ofxiOSBoost/build/libs/boost/lib/armv7 \
+}
+ios:arm64 {
+ message("target is arm64")
+ LIBS += \
+ -L$$PWD/ofxiOSBoost/build/libs/boost/lib/arm64 \
+}
+!ios {
LIBS += -L$$WALLET_ROOT/lib \
-lwallet_merged \
- $$WALLET_ROOT/build/release/contrib/epee/src/libepee.a \
+ -lepee \
+ -lunbound
+}
+
+ios {
+ message("Host is IOS")
+
+ QMAKE_LFLAGS += -v
+ QMAKE_IOS_DEVICE_ARCHS = arm64
+ CONFIG += arm64
+ LIBS += -L$$WALLET_ROOT/lib-ios \
+ -lwallet_merged \
+ -lepee \
-lunbound
+ LIBS+= \
+ -L$$PWD/OpenSSL-for-iPhone/lib \
+ -lboost_serialization \
+ -lboost_thread \
+ -lboost_system \
+ -lboost_date_time \
+ -lboost_filesystem \
+ -lboost_regex \
+ -lboost_chrono \
+ -lboost_program_options \
+ -lssl \
+ -lcrypto \
+ -ldl
+}
+
CONFIG(WITH_SCANNER) {
if( greaterThan(QT_MINOR_VERSION, 5) ) {
message("using camera scanner")
@@ -95,6 +137,7 @@ CONFIG(WITH_SCANNER) {
}
}
+
# currently we only support x86 build as qt.io only provides prebuilt qt for x86 mingw
win32 {
@@ -153,7 +196,7 @@ win32 {
linux {
CONFIG(static) {
message("using static libraries")
- LIBS+= -Wl,-Bstatic
+ LIBS+= -Wl,-Bstatic
}
LIBS+= \
-lboost_serialization \
@@ -242,31 +285,35 @@ macx {
}
+!ios {
+ isEmpty(QMAKE_LUPDATE) {
+ win32:LANGUPD = $$[QT_INSTALL_BINS]\lupdate.exe
+ else:LANGUPD = $$[QT_INSTALL_BINS]/lupdate
+ }
-isEmpty(QMAKE_LUPDATE) {
- win32:LANGUPD = $$[QT_INSTALL_BINS]\lupdate.exe
- else:LANGUPD = $$[QT_INSTALL_BINS]/lupdate
-}
+ isEmpty(QMAKE_LRELEASE) {
+ win32:LANGREL = $$[QT_INSTALL_BINS]\lrelease.exe
+ else:LANGREL = $$[QT_INSTALL_BINS]/lrelease
+ }
+
+ langupd.command = \
+ $$LANGUPD $$LANGUPD_OPTIONS $$shell_path($$_PRO_FILE) -ts $$_PRO_FILE_PWD/$$TRANSLATIONS
-isEmpty(QMAKE_LRELEASE) {
- win32:LANGREL = $$[QT_INSTALL_BINS]\lrelease.exe
- else:LANGREL = $$[QT_INSTALL_BINS]/lrelease
-}
-langupd.command = \
- $$LANGUPD $$LANGUPD_OPTIONS $$shell_path($$_PRO_FILE) -ts $$_PRO_FILE_PWD/$$TRANSLATIONS
+ langrel.depends = langupd
+ langrel.input = TRANSLATIONS
+ langrel.output = $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
+ langrel.commands = \
+ $$LANGREL $$LANGREL_OPTIONS ${QMAKE_FILE_IN} -qm $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
+ langrel.CONFIG += no_link
+
+ QMAKE_EXTRA_TARGETS += langupd deploy deploy_win
+ QMAKE_EXTRA_COMPILERS += langrel
+}
-langrel.depends = langupd
-langrel.input = TRANSLATIONS
-langrel.output = $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
-langrel.commands = \
- $$LANGREL $$LANGREL_OPTIONS ${QMAKE_FILE_IN} -qm $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
-langrel.CONFIG += no_link
-QMAKE_EXTRA_TARGETS += langupd deploy deploy_win
-QMAKE_EXTRA_COMPILERS += langrel