diff --git a/.gitignore b/.gitignore index 87af626..a173e45 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /cryptonote/ /cryptonote /Wallet_*/ +CMakeLists.txt.user diff --git a/BitcoinoteDmg.json b/BitcoinoteDmg.json new file mode 100644 index 0000000..93938a2 --- /dev/null +++ b/BitcoinoteDmg.json @@ -0,0 +1,9 @@ +{ + "title": "BitcoiNote", + "icon": "src/images/bitcoinote.icns", + "background": "src/images/bitcoinote_dmg_background.png", + "contents": [ + { "x": 448, "y": 344, "type": "link", "path": "/Applications" }, + { "x": 192, "y": 344, "type": "file", "path": "BitcoiNote.app" } + ] +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index d187d85..fc1350a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) set(VERSION "") +set(PROJECT_VERSION "1.2.1") configure_file("cryptonote/src/version.h.in" "version.h") configure_file("src/CryptoNoteWalletConfig.h.in" "CryptoNoteWalletConfig.h") @@ -129,6 +130,7 @@ file(GLOB_RECURSE CRYPTONOTE_SOURCES cryptonote/src/WalletLegacy/WalletUnconfirmedTransactions.cpp cryptonote/src/WalletLegacy/WalletUserTransactionsCache.cpp cryptonote/src/System/ContextGroup.cpp + cryptonote/src/System/ContextGroupTimeout.cpp cryptonote/src/System/Event.cpp cryptonote/src/System/EventLock.cpp cryptonote/src/System/InterruptedException.cpp @@ -189,10 +191,10 @@ elseif (UNIX) set(SOURCES ${SOURCES} ${OBJC_SOURCES}) set(PLATFORM_DIR OSX) set(MACOSX_BUNDLE_INFO_STRING "Cryptonote GUI wallet") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}") set(MACOSX_BUNDLE_BUNDLE_NAME CryptonoteWallet) - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "$${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}") find_package(Qt5PrintSupport REQUIRED) @@ -202,8 +204,8 @@ elseif (UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -maes -D_DARWIN_C_SOURCE") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa -framework OpenGL -framework CoreFoundation -framework Carbon -framework IOKit -L/usr/lib") - set(MACOSX_BUNDLE_ICON_FILE cryptonote.icns) - set(APPLICATION_ICON src/images/cryptonote.icns) + set(MACOSX_BUNDLE_ICON_FILE bitcoinote.icns) + set(APPLICATION_ICON src/images/bitcoinote.icns) set_source_files_properties(${APPLICATION_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") set(BUILD_PLATFORM MACOSX_BUNDLE) @@ -212,6 +214,11 @@ elseif (UNIX) GET_TARGET_PROPERTY(QT_LIB_DIR "${Qt5Widgets_LIBRARIES}" LOCATION) GET_FILENAME_COMPONENT(QT_LIB_DIR "${QT_LIB_DIR}" PATH) + ADD_CUSTOM_COMMAND( + TARGET ${PROJECT_NAME} PRE_BUILD + COMMAND macdeployqt ${PROJECT_NAME}.app + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + else(APPLE) set(PLATFORM_DIR Linux) @@ -247,4 +254,4 @@ qt5_use_modules(${PROJECT_NAME} Widgets Gui Network) set(ROCKSDB_WITHOUT_GTEST ON CACHE BOOL "No gtest in rocksdb") add_subdirectory(cryptonote/external) -#add_subdirectory(cryptonote/src) \ No newline at end of file +#add_subdirectory(cryptonote/src) diff --git a/README.md b/README.md index 16739b0..a0ba610 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,30 @@ C:\WINDOWS\system32\vcruntime140.dll To compile the debug version, omit the `/p:Configuration=Release` parameter. Then you need to copy the debug dlls instead of the normal ones. These have the same name, only with a `d` at the end (e.g. `Qt5Cored.dll`), and are in the same location, except for `ucrtbased.dll` which you can find in `C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt\ucrtbased.dll`. +### macOS + +Tested only with macOS High Sierra 10.13.6. + +Dependencies: `clang 9.1.0` or later, `CMake 3.5.2` or later, `Boost 1.67` or later and `Qt5` (tested with `Qt 5.10.1`). + +* Use [Homebrew](https://brew.sh/) to install `cmake` and `boost`. +* Use [qt.io](https://www.qt.io/) to install QtCreator. + +To create the symlink to the core directory, use: + +``` +ln -s ../Bitcoinote-Core cryptonote +``` + +To build, open the `CMakeLists.txt` in QtCreator. Also you can turn on `PORTABLE` flag in the project settings tab. + +The resulting package `Bitcoinote.app` can be found in `build` directory which will be created. + +To build `.dmg` file we recommend to use [node-appdmg](https://github.com/LinusU/node-appdmg) project. +Just place the `BitcoinoteDmg.json`, `Bitcoinote.icns` and `Bitcoinote.app` in one directory and run the following command: + +`$ appdmg BitcoinoteDmg.json Bitcoinote.dmg` + ## Usage Notes To run the GUI wallet, the BitcoiNote Core daemon is not required to run. If a daemon already runs, it will be used - otherwise the wallet will use its own "internal daemon" instead. diff --git a/src/Application/BlogReader.cpp b/src/Application/BlogReader.cpp index ecb9e2a..93f2fbf 100644 --- a/src/Application/BlogReader.cpp +++ b/src/Application/BlogReader.cpp @@ -212,27 +212,27 @@ void BlogReader::processBlogReplyData(const QString& _data) { QList newMessages; while (!xml.atEnd() && newMessages.size() < MAX_MESSAGE_COUNT) { xml.readNext(); - if (xml.isStartElement() && !xml.name().compare("entry")) { + if (xml.isStartElement() && !xml.name().compare(QLatin1Literal("entry"))) { MessageItem messageItem; - while (!xml.atEnd() && !(xml.isEndElement() && !xml.name().compare("entry"))) { + while (!xml.atEnd() && !(xml.isEndElement() && !xml.name().compare(QLatin1Literal("entry")))) { xml.readNext(); if (xml.isStartElement()) { - if (!xml.name().compare(BLOG_RSS_ID_TAG_NAME)) { + if (!xml.name().compare(QLatin1Literal(BLOG_RSS_ID_TAG_NAME))) { messageItem.messageId = xml.readElementText(); - } else if(!xml.name().compare(BLOG_RSS_LINK_TAG_NAME)) { + } else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_LINK_TAG_NAME))) { messageItem.messageSourceUrl = xml.attributes().value(BLOG_RSS_LINK_HREF_ATTRIBUTE_NAME).toString(); // Handle root-relative path if(!messageItem.messageSourceUrl.length() || messageItem.messageSourceUrl.at(0).toLatin1() == '/') { messageItem.messageSourceUrl = QString(BLOG_RSS_SCHEME) + QString("://") + QString(BLOG_RSS_HOST) + messageItem.messageSourceUrl; } - } else if(!xml.name().compare(BLOG_RSS_TITLE_TAG_NAME)) { + } else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_TITLE_TAG_NAME))) { messageItem.messageTitle = xml.readElementText(); - } else if(!xml.name().compare(BLOG_RSS_CONTENT_TAG_NAME)) { + } else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_CONTENT_TAG_NAME))) { QString htmlText = xml.readElementText(); QTextDocument textDoc; textDoc.setHtml(htmlText); messageItem.messageText = textDoc.toPlainText(); - } else if(!xml.name().compare(BLOG_RSS_UPDATED_TAG_NAME)) { + } else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_UPDATED_TAG_NAME))) { QString timeString = xml.readElementText(); messageItem.messageTime = QDateTime::fromString(timeString, Qt::ISODate); } diff --git a/src/images/bitcoinote.icns b/src/images/bitcoinote.icns index 5638b18..63fc416 100644 Binary files a/src/images/bitcoinote.icns and b/src/images/bitcoinote.icns differ diff --git a/src/images/bitcoinote.svg b/src/images/bitcoinote.svg new file mode 100644 index 0000000..bbd05ec --- /dev/null +++ b/src/images/bitcoinote.svg @@ -0,0 +1 @@ +BTCN V2BITCOINOTEBTCN \ No newline at end of file diff --git a/src/images/bitcoinote_dmg_background.png b/src/images/bitcoinote_dmg_background.png new file mode 100644 index 0000000..e0d81f2 Binary files /dev/null and b/src/images/bitcoinote_dmg_background.png differ