Skip to content

Commit

Permalink
Merge pull request #16 from exploshot/master
Browse files Browse the repository at this point in the history
Update to latest Core and working on language Fix
  • Loading branch information
nnian authored Aug 26, 2019
2 parents 10a637b + 30c6508 commit 339a27d
Show file tree
Hide file tree
Showing 34 changed files with 58 additions and 41 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ set(HUNTER_CONFIGURATION_TYPES Release;Debug CACHE STRING "Hunter configuration
set(HUNTER_JOBS_NUMBER 4 CACHE STRING "Hunter jobs number")
include(hunter/HunterGate)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.190.tar.gz"
SHA1 "bc7da329d2493201de28f0c2a5fcd4de1415c477"
URL "https://github.com/ruslo/hunter/archive/v0.23.206.tar.gz"
SHA1 "9cb4184e563ad45dbafb6755c0d588e5574838d3"
FILEPATH "${CMAKE_CURRENT_LIST_DIR}/cmake/hunter/HunterConfig.cmake"
)

Expand Down Expand Up @@ -73,7 +73,7 @@ if(GIT_FOUND)
endif()
endif()

set(PROJECT_DISPLAY_NAME "Qwertycoin")
set(PROJECT_DISPLAY_NAME "Qwertycoin-GUI")
set(PROJECT_SHORT_NAME "qwcg")
set(PROJECT_CURRENCY_TICKER "QWC")
set(PROJECT_NAME "qwertycoin-gui")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Cryptonote Developers, Bytecoin Developers, Monero Developers, Karbo Developers,

### Copypasta for license when editing files <a name="copypasta"></a>

Hi Qwertycoin contributor, thanks for forking and sending back Pull Requests. Extensive docs about contributing are in the works or elsewhere. For now this is the bit we need to get into all the files we touch. Please add it to the top of the files, see [src/config/CryptoNoteConfig.h](https://github.com/qwertycoin-org/qwertycoin/blob/master/src/config/CryptoNoteConfig.h) for an example.
Hi Qwertycoin contributor, thanks for forking and sending back Pull Requests. Extensive docs about contributing are in the works or elsewhere. For now this is the bit we need to get into all the files we touch. Please add it to the top of the files, see [lib/Global/CryptoNoteConfig.h](https://github.com/qwertycoin-org/qwertycoin/blob/master/lib/Global/CryptoNoteConfig.h) for an example.

```
// Copyright (c) 2018-2019, The Qwertycoin Developers
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/Qt5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOUIC OFF) # Create code from a list of Qt designer ui files
set(CMAKE_AUTORCC ON) # Automatically handle Qt resource files

set(Qt5_COMPONENTS Core Gui Network Widgets)
set(Qt5_COMPONENTS Core Gui LinguistTools Network Widgets)
if (APPLE)
list(APPEND Qt5_COMPONENTS PrintSupport)
endif ()
Expand Down
14 changes: 13 additions & 1 deletion cmake/external/Qwertycoin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ set(QwertycoinFramework_INCLUDE_DIRS
"${SOURCE_DIR}/lib"
"${BINARY_DIR}/lib"
"${BINARY_DIR}/_ExternalProjects/Install/sparsehash/include"
"${SOURCE_DIR}/src" # Temporary hack-ish solution for <config/*> includes.
)
if(MSVC)
list(APPEND QwertycoinFramework_INCLUDE_DIRS "${SOURCE_DIR}/lib/Platform/Windows")
Expand All @@ -60,6 +59,7 @@ set(QwertycoinFramework_LIBS
Crypto
CryptoNoteCore
CryptoNoteProtocol
Global
Http
InProcessNode
JsonRpcServer
Expand Down Expand Up @@ -104,6 +104,7 @@ endforeach()
target_link_libraries(QwertycoinFramework::Common INTERFACE
Threads::Threads
QwertycoinFramework::Crypto
QwertycoinFramework::Global
)
if(UNIX AND NOT ANDROID)
target_link_libraries(QwertycoinFramework::Common INTERFACE -lresolv)
Expand All @@ -116,24 +117,33 @@ target_link_libraries(QwertycoinFramework::CryptoNoteCore INTERFACE
QwertycoinFramework::BlockchainExplorer
QwertycoinFramework::Common
QwertycoinFramework::Crypto
QwertycoinFramework::Global
QwertycoinFramework::Logging
QwertycoinFramework::Serialization
)

# QwertycoinFramework::Global
target_link_libraries(QwertycoinFramework::Global INTERFACE
QwertycoinFramework::Global
)

# QwertycoinFramework::InProcessNode
target_link_libraries(QwertycoinFramework::InProcessNode INTERFACE
QwertycoinFramework::BlockchainExplorer
QwertycoinFramework::Global
)

# QwertycoinFramework::NodeRpcProxy
target_link_libraries(QwertycoinFramework::NodeRpcProxy INTERFACE
QwertycoinFramework::Global
QwertycoinFramework::System
)

# QwertycoinFramework::P2p
target_link_libraries(QwertycoinFramework::P2p INTERFACE
MiniUPnP::miniupnpc
QwertycoinFramework::CryptoNoteProtocol
QwertycoinFramework::Global
)

if(WIN32 AND MSVC)
Expand All @@ -152,6 +162,7 @@ target_link_libraries(QwertycoinFramework::PaymentGate INTERFACE
target_link_libraries(QwertycoinFramework::Rpc INTERFACE
QwertycoinFramework::BlockchainExplorer
QwertycoinFramework::CryptoNoteCore
QwertycoinFramework::Global
QwertycoinFramework::P2p
QwertycoinFramework::PaymentGate
QwertycoinFramework::Serialization
Expand All @@ -172,6 +183,7 @@ endif()
# QwertycoinFramework::Transfers
target_link_libraries(QwertycoinFramework::Transfers INTERFACE
QwertycoinFramework::CryptoNoteCore
QwertycoinFramework::Global
)

# QwertycoinFramework::Wallet
Expand Down
1 change: 1 addition & 0 deletions cmake/hunter/HunterConfig.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
hunter_config(Boost VERSION 1.70.0-p0)
hunter_config(Qt VERSION 5.12.3)
19 changes: 18 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ set(TARGET_SRC
"${CMAKE_CURRENT_LIST_DIR}/gui/WalletEvents.h"
${TARGET_UI}
)

if(APPLE)
list(APPEND TARGET_SRC "${CMAKE_CURRENT_LIST_DIR}/gui/MainWindow.mm")
list(APPEND TARGET_SRC "${CMAKE_CURRENT_LIST_DIR}/gui/macdockiconhandler.h")
Expand Down Expand Up @@ -360,7 +361,7 @@ elseif(PROJECT_OS_WINDOWS) # Windows
JOIN " " WINDEPLOYQT_COMMANDS
COMMAND "\"${CMAKE_COMMAND}\"" -E remove_directory "\"${WINDEPLOYQT_TMP_DIR}\""
COMMAND "\"${CMAKE_COMMAND}\"" -E make_directory "\"${WINDEPLOYQT_TMP_DIR}\""
COMMAND "\"${WINDEPLOYQT_EXE}\"" --dir "\"${WINDEPLOYQT_TMP_DIR}\"" "\"${WINDEPLOYQT_TARGET}\""
COMMAND "\"${WINDEPLOYQT_EXE}\"" --no-translations --dir "\"${WINDEPLOYQT_TMP_DIR}\"" "\"${WINDEPLOYQT_TARGET}\""
)

# execute windeployqt in a tmp directory
Expand Down Expand Up @@ -388,3 +389,19 @@ elseif(PROJECT_OS_WINDOWS) # Windows
else() # unknown
message(WARNING "Can't detect platform. Installation targets are not configured!")
endif()

# translation stuff
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)

file(GLOB TARGET_TRANSLATIONS ${CMAKE_CURRENT_LIST_DIR/languages}/*.ts)

qt5_create_translation(TRANSLATION_MESSAGES ${FILES_TO_TRANSLATE} ${TARGET_TRANSLATIONS})
qt5_add_translation(TRANSLATION_QM ${TARGET_TRANSLATIONS})
add_custom_target(translations_update DEPENDS ${TRANSLATION_MESSAGES})
add_custom_target(translations DEPENDS ${TRANSLATION_QM})

if(APPLE AND UNIX) ## OSX
install(FILES ${TRANSLATION_QM} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_DISPLAY_NAME}.app/Contents/Resources/translations")
else()
install(FILES ${TRANSLATION_QM} DESTINATION translations)
endif()
2 changes: 1 addition & 1 deletion src/CommandLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <Common/Util.h>
#include <config/CryptoNoteConfig.h>
#include <Global/CryptoNoteConfig.h>

#include "CommandLineParser.h"

Expand Down
2 changes: 1 addition & 1 deletion src/CryptoNoteWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <limits>
#include "CryptoNoteWrapper.h"
#include "config/Checkpoints.h"
#include "CryptoNoteCore/CryptoNoteBasicImpl.h"
#include "CryptoNoteCore/CryptoNoteFormatUtils.h"
#include "CryptoNoteCore/Currency.h"
Expand All @@ -25,6 +24,7 @@
#include "System/Dispatcher.h"
#include "CurrencyAdapter.h"
#include "Settings.h"
#include <Global/Checkpoints.h>
#include <QDebug>

namespace WalletGui {
Expand Down
1 change: 0 additions & 1 deletion src/NodeAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ CryptoNote::NetNodeConfig NodeAdapter::makeNetNodeConfig() const {
}

options.insert(std::make_pair("data-dir", boost::program_options::variable_value(dataDir, false)));
int size = options.size();
config.init(options);
config.setTestnet(Settings::instance().isTestnet());
return config;
Expand Down
1 change: 0 additions & 1 deletion src/OptimizationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ void OptimizationManager::checkOptimization() {

void OptimizationManager::optimize() {
if (!Settings::instance().isTrackingMode() && WalletAdapter::instance().isOpen() && m_isSynchronized) {
size_t fusionReadyCount = WalletAdapter::instance().estimateFusion(CurrencyAdapter::instance().getMinimumFee());
const size_t MAX_FUSION_OUTPUT_COUNT = 4;
const quint64 mixin = Settings::instance().getOptimizationMixin();
size_t estimatedFusionInputsCount = CurrencyAdapter::instance().getCurrency().getApproximateMaximumInputCount(CurrencyAdapter::instance().getCurrency().fusionTxMaxSize(), MAX_FUSION_OUTPUT_COUNT, mixin);
Expand Down
8 changes: 4 additions & 4 deletions src/TranslatorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ TranslatorManager::TranslatorManager()

#if defined(_MSC_VER)
m_langPath = QApplication::applicationDirPath();
m_langPath.append("/languages");
m_langPath.append("/translations");
#elif defined(Q_OS_MAC)
m_langPath = QApplication::applicationDirPath();
m_langPath = m_langPath + "/../Resources/languages/";
m_langPath = m_langPath + "/../Resources/translations/";
#else
m_langPath = "/opt/karbo/languages";
m_langPath = "/opt/karbo/translations";
#endif

QDir dir(m_langPath);
Expand All @@ -44,7 +44,7 @@ TranslatorManager::TranslatorManager()
}
}
}
QStringList resourcesQt = dir.entryList(QStringList("qt_??.qm"));
QStringList resourcesQt = dir.entryList(QStringList("??.qm"));
for (int j = 0; j < resourcesQt.size(); j++)
{
QString locale = resourcesQt[j];
Expand Down
5 changes: 4 additions & 1 deletion src/WalletAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <Common/Util.h>
#include <Wallet/WalletErrors.h>
#include <Wallet/LegacyKeysImporter.h>
#include <Global/Constants.h>
#include "CryptoNoteCore/CryptoNoteBasic.h"

#include "NodeAdapter.h"
Expand All @@ -32,6 +33,8 @@ extern "C"
#include "crypto/crypto-ops.h"
}

using namespace Qwertycoin;

namespace WalletGui {

const quint32 MSECS_IN_HOUR = 60 * 60 * 1000;
Expand Down Expand Up @@ -335,7 +338,7 @@ Crypto::SecretKey WalletAdapter::getTxKey(Crypto::Hash& txid) {
} catch (std::system_error&) {
}

return CryptoNote::NULL_SECRET_KEY;
return NULL_SECRET_KEY;
}

void WalletAdapter::sendTransaction(const std::vector<CryptoNote::WalletLegacyTransfer>& _transfers, quint64 _fee, const QString& _paymentId, quint64 _mixin) {
Expand Down
6 changes: 3 additions & 3 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,12 +611,12 @@ void MainWindow::createLanguageMenu(void)
}
#if defined(_MSC_VER)
m_langPath = QApplication::applicationDirPath();
m_langPath.append("/languages");
m_langPath.append("/translations");
#elif defined(Q_OS_MAC)
m_langPath = QApplication::applicationDirPath();
m_langPath = m_langPath + "/../Resources/languages/";
m_langPath = m_langPath + "/../Resources/translations/";
#else
m_langPath = "/opt/karbo/languages";
m_langPath = "/opt/karbo/translations";
#endif
QDir dir(m_langPath);
QStringList fileNames = dir.entryList(QStringList("??.qm"));
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private slots:
QTranslator m_translator; // contains the translations for this application
QTranslator m_translatorQt; // contains the translations for qt
QString m_currLang; // contains the currently loaded language
QString m_langPath; // Path of language files. This is always fixed to /languages.
QString m_langPath; // Path of language files. This is always fixed to /translations.

static MainWindow* m_instance;

Expand Down
1 change: 1 addition & 0 deletions src/gui/TransactionDetailsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "ui_transactiondetailsdialog.h"

using namespace CryptoNote;
using namespace Qwertycoin;

namespace WalletGui {

Expand Down
4 changes: 3 additions & 1 deletion src/gui/TransactionsModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "AddressBookModel.h"
#include "WalletAdapter.h"

using namespace Qwertycoin;

namespace WalletGui {

namespace {
Expand Down Expand Up @@ -408,7 +410,7 @@ QVariant TransactionsModel::getUserRole(const QModelIndex& _index, int _role, Cr
case ROLE_SECRET_KEY: {
if (_transaction.secretKey) {
Crypto::SecretKey txkey = _transaction.secretKey.get();
if (txkey != CryptoNote::NULL_SECRET_KEY) {
if (txkey != NULL_SECRET_KEY) {
return QByteArray(reinterpret_cast<char*>(&txkey), sizeof(txkey));
}
}
Expand Down
16 changes: 0 additions & 16 deletions src/languages/CMakeLists.txt

This file was deleted.

Binary file modified src/languages/de.qm
Binary file not shown.
Binary file removed src/languages/en.qm
Binary file not shown.
Binary file removed src/languages/qt_ar.qm
Binary file not shown.
Binary file removed src/languages/qt_de.qm
Binary file not shown.
1 change: 0 additions & 1 deletion src/languages/qt_en.qm

This file was deleted.

Binary file removed src/languages/qt_es.qm
Binary file not shown.
Binary file removed src/languages/qt_fa.qm
Binary file not shown.
Binary file removed src/languages/qt_fr.qm
Binary file not shown.
Binary file removed src/languages/qt_it.qm
Binary file not shown.
Binary file removed src/languages/qt_ja.qm
Binary file not shown.
Binary file removed src/languages/qt_ko.qm
Binary file not shown.
Binary file removed src/languages/qt_pl.qm
Binary file not shown.
Binary file removed src/languages/qt_pt.qm
Binary file not shown.
Binary file removed src/languages/qt_ru.qm
Binary file not shown.
Binary file removed src/languages/qt_uk.qm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/qwertycoinwallet.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Type=Application
Icon=qwertycoin
MimeType=x-scheme-handler/qwertycoin;
Categories=Office;Finance;
Version=5.2.0
Version=5.2.2
4 changes: 2 additions & 2 deletions src/version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#define PROJECT_COPYRIGHT "@PROJECT_COPYRIGHT@"
#define APP_VER_MAJOR 5
#define APP_VER_MINOR 2
#define APP_VER_REV 0
#define APP_VER_BUILD 3083
#define APP_VER_REV 2
#define APP_VER_BUILD 4052

#define BUILD_COMMIT_ID "@PROJECT_GIT_COMMIT_ID@"
#define PROJECT_VERSION STR(APP_VER_MAJOR) "." STR(APP_VER_MINOR) "." STR(APP_VER_REV)
Expand Down

0 comments on commit 339a27d

Please sign in to comment.