diff --git a/README.md b/README.md index 0796f57..b19c0c0 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,19 @@ # bytecoin-gui -## Requirements - -1. Qt5 libraries
-To install all required packages on Ubuntu use the following command: -``` -sudo apt install qt5-qmake qtbase5-dev qtbase5-dev-tools -``` - ## How to build binaries from source code ### Windows - -TODO +To build the gui you must have built bytecoin core, so please do all steps from [here](https://github.com/bcndev/bytecoin#building-on-windows) before proceed. Install [QtCreator](https://www.qt.io/download-thank-you?os=windows), open the project file bytecoin-gui/src/bytecoin-gui.pro in QtCreator and build it using MSVS kit (you must have MSVS installed already to build bytecoin core). ### MacOS -TODO +To build the gui you must have built bytecoin core, so please do all steps from [here](https://github.com/bcndev/bytecoin#building-on-mac-osx) before proceed. Install [QtCreator](https://www.qt.io/download-thank-you?os=macos), open the project file bytecoin-gui/src/bytecoin-gui.pro in QtCreator and build it using clang kit (you must have XCode installed already to build bytecoin core). ### Linux ``` +# To install all required packages on Ubuntu use the following command: +$ sudo apt install qt5-qmake qtbase5-dev qtbase5-dev-tools + $ git clone https://github.com/bcndev/bytecoin.git $ cd bytecoin $ mkdir -p build @@ -34,3 +28,18 @@ $ cd build $ cmake .. $ make -j4 ``` +Alternative way: +``` +# Install QtCreator: +$ sudo apt install qtcreator + +$ git clone https://github.com/bcndev/bytecoin.git +$ cd bytecoin +$ mkdir -p build +$ cd build +$ cmake .. +$ make -j4 bytecoin-crypto +$ cd ../.. +$ git clone https://github.com/bcndev/bytecoin-gui.git +``` +Now open the project file bytecoin-gui/src/bytecoin-gui.pro in QtCreator and build it. diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 07b62e6..6bdcb13 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,12 @@ ## Release Notes +### v2.0.4 + +- Updated Bytecoin daemons. +- Fixed window file path on MacOS. +- Fixed bug in transaction list. +- Fixed minor GUI fixes. + ### v2.0.2 - Fixed `walletd` crashes when reopening wallet. diff --git a/src/bytecoin-gui.pro b/src/bytecoin-gui.pro index 6c06028..0a1b9c2 100644 --- a/src/bytecoin-gui.pro +++ b/src/bytecoin-gui.pro @@ -15,7 +15,7 @@ TEMPLATE = app macx: QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11 macx: ICON = images/bytecoin.icns win32: RC_ICONS = images/bytecoin.ico -win32: VERSION = 2.18.4.4 +win32: VERSION = 2.18.5.9 #QMAKE_CXXFLAGS += -fno-omit-frame-pointer -fsanitize=address,undefined #LIBS += -lasan -lubsan diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b06d805..02ddd82 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -334,13 +334,18 @@ void MainWindow::showLog() void MainWindow::setTitle() { + clearTitle(); +#ifdef Q_OS_MAC + if (Settings::instance().getConnectionMethod() == ConnectionMethod::BUILTIN) + setWindowFilePath(Settings::instance().getWalletFile()); + else + setWindowTitle(Settings::instance().getRpcEndPoint()); +#else const QString fileName = Settings::instance().getConnectionMethod() == ConnectionMethod::BUILTIN ? Settings::instance().getWalletFile() : Settings::instance().getRpcEndPoint(); -#ifdef Q_OS_MAC - setWindowFilePath(fileName); -#else + setWindowTitle(fileName); #endif } @@ -349,6 +354,7 @@ void MainWindow::clearTitle() { #ifdef Q_OS_MAC setWindowFilePath(QString{}); + setWindowTitle(QString{}); #else setWindowTitle(QString{}); #endif @@ -365,12 +371,6 @@ void MainWindow::setConnectedState() m_ui->m_overviewButton->click(); setTitle(); -#ifdef Q_OS_MAC - if (Settings::instance().getConnectionMethod() == ConnectionMethod::BUILTIN) - setWindowFilePath(Settings::instance().getWalletFile()); - else - setWindowFilePath(Settings::instance().getRpcEndPoint()); -#endif } void MainWindow::setDisconnectedState() @@ -392,9 +392,6 @@ void MainWindow::setDisconnectedState() m_ui->m_exportViewOnlyKeysAction->setEnabled(false); clearTitle(); -#ifdef Q_OS_MAC - setWindowFilePath(QString()); -#endif } void MainWindow::builtinRun() diff --git a/src/rpcapi.cpp b/src/rpcapi.cpp index 49e0fa3..d99b3dc 100644 --- a/src/rpcapi.cpp +++ b/src/rpcapi.cpp @@ -247,7 +247,7 @@ CreateTransaction::Request::toJson() const RPCAPI_SERIALIZE_STRUCT(value, json, transaction); - RPCAPI_SERIALIZE_FIELD(value, json, spend_address); + RPCAPI_SERIALIZE_FIELD(value, json, spend_addresses); RPCAPI_SERIALIZE_FIELD(value, json, any_spend_address); RPCAPI_SERIALIZE_FIELD(value, json, change_address); RPCAPI_SERIALIZE_FIELD(value, json, confirmed_height_or_depth); diff --git a/src/rpcapi.h b/src/rpcapi.h index caa2d5f..0a4269b 100644 --- a/src/rpcapi.h +++ b/src/rpcapi.h @@ -376,7 +376,7 @@ struct CreateTransaction struct Request { Transaction transaction; - QString spend_address; + QStringList spend_addresses; bool any_spend_address = false; QString change_address; HeightOrDepth confirmed_height_or_depth = -DEFAULT_CONFIRMATIONS - 1; diff --git a/src/version.h b/src/version.h index 9ee6d56..765bfb8 100644 --- a/src/version.h +++ b/src/version.h @@ -1,8 +1,8 @@ #ifndef VERSION_H #define VERSION_H -constexpr char VERSION[] = "2.0.2"; +constexpr char VERSION[] = "2.0.4"; constexpr char VERSION_SUFFIX[] = "stable"; -constexpr char REVISION[] = "20180404"; +constexpr char REVISION[] = "20180509"; #endif // VERSION_H diff --git a/src/walletmodel.cpp b/src/walletmodel.cpp index bdcc35b..e21ac0d 100644 --- a/src/walletmodel.cpp +++ b/src/walletmodel.cpp @@ -25,7 +25,7 @@ struct WalletModelState bool viewOnly = false; RemoteWalletd::State walletdState = RemoteWalletd::State::STOPPED; - int unconfimedSize = 0; + int unconfirmedSize = 0; bool canFetchMore = true; }; @@ -90,6 +90,8 @@ QVariant WalletModel::headerData(int section, Qt::Orientation orientation, int r return tr("Fee"); case COLUMN_ADDRESS: return tr("Address"); + case COLUMN_PROOF: + return tr("Proof"); } break; case Qt::TextAlignmentRole: @@ -191,22 +193,45 @@ void WalletModel::addressesReceived(const RpcApi::Addresses& response) void WalletModel::transfersReceived(const RpcApi::Transfers& history) { const quint32 highestConfirmedBlock = getHighestKnownConfirmedBlock(); - if (history.next_from_height >= highestConfirmedBlock) +// const quint32 highestConfirmedBlock = pimpl_->highestConfirmedBlockDuringRequest; +// QList txs; +// QList unconfirmedTxs; +// for (const RpcApi::Block& block : history.blocks) +// { +// if (block.header.height > highestConfirmedBlock) +// unconfirmedTxs.append(block.transactions); +// else +// txs.append(block.transactions); +// } +// QList newTxs = unconfirmedTxs; +// newTxs.append(txs); +// newTxs.append(pimpl_->txs.mid(pimpl_->unconfirmedSize)); // cut unconfirmed and save confirmed only + +// pimpl_->unconfirmedSize = unconfirmedTxs.size(); +// containerReceived(pimpl_->txs, newTxs, pimpl_->addresses.size()); + + if (history.next_from_height >= highestConfirmedBlock) // unconfirmed { +// pimpl_->txs.erase(pimpl_->txs.begin(), pimpl_->txs.begin() + pimpl_->unconfirmedSize); +// pimpl_->unconfirmedSize = 0; + QList txs; for (const RpcApi::Block& block : history.blocks) txs.append(block.transactions); - if (txs == pimpl_->txs.mid(0, pimpl_->unconfimedSize)) + if (txs == pimpl_->txs.mid(0, pimpl_->unconfirmedSize)) return; - const QList& confirmedTxs = pimpl_->txs.mid(pimpl_->unconfimedSize); - pimpl_->unconfimedSize = txs.size(); + const QList& confirmedTxs = pimpl_->txs.mid(pimpl_->unconfirmedSize); + pimpl_->unconfirmedSize = txs.size(); txs.append(confirmedTxs); containerReceived(pimpl_->txs, txs, pimpl_->addresses.size()); } - else if (history.next_to_height < highestConfirmedBlock) + else if (history.next_to_height < highestConfirmedBlock) // confirmed { +// pimpl_->txs.erase(pimpl_->txs.begin(), pimpl_->txs.begin() + pimpl_->unconfirmedSize); +// pimpl_->unconfirmedSize = 0; + QList txs; for (const RpcApi::Block& block : history.blocks) txs.append(block.transactions); @@ -222,9 +247,10 @@ void WalletModel::transfersReceived(const RpcApi::Transfers& history) } else if (txs.last().block_height > getTopConfirmedBlock()) { - QList newTxs = pimpl_->txs.mid(0, pimpl_->unconfimedSize); + QList newTxs = pimpl_->txs.mid(0, pimpl_->unconfirmedSize); newTxs.append(txs); - newTxs.append(pimpl_->txs.mid(pimpl_->unconfimedSize)); +// QList newTxs = txs; + newTxs.append(pimpl_->txs.mid(pimpl_->unconfirmedSize)); containerReceived(pimpl_->txs, newTxs, pimpl_->addresses.size()); } } @@ -319,17 +345,18 @@ void WalletModel::statusReceived(const RpcApi::Status& status) quint32 WalletModel::getTopConfirmedBlock() const { - return pimpl_->unconfimedSize < pimpl_->txs.size() ? pimpl_->txs[pimpl_->unconfimedSize].block_height : 0; + return pimpl_->unconfirmedSize < pimpl_->txs.size() ? pimpl_->txs[pimpl_->unconfirmedSize].block_height : 0; } quint32 WalletModel::getBottomConfirmedBlock() const { - return pimpl_->unconfimedSize < pimpl_->txs.size() ? pimpl_->txs.last().block_height : std::numeric_limits::max(); + return pimpl_->unconfirmedSize < pimpl_->txs.size() ? pimpl_->txs.last().block_height : std::numeric_limits::max(); } quint32 WalletModel::getHighestKnownConfirmedBlock() const { - const quint32 topKnownBlockHeight = pimpl_->status.top_known_block_height; +// const quint32 topKnownBlockHeight = pimpl_->status.top_known_block_height; + const quint32 topKnownBlockHeight = pimpl_->status.top_block_height; return topKnownBlockHeight < CONFIRMATIONS + 2 ? 0 : topKnownBlockHeight - CONFIRMATIONS - 2; } @@ -563,7 +590,7 @@ QVariant WalletModel::getDisplayRoleHistory(const QModelIndex& index) const break; } } - return pimpl_->viewOnly ? QVariant{} : proof ? QVariant(tr("Proof")) : QVariant(tr("Try")); + return pimpl_->viewOnly ? QVariant{} : proof ? QVariant(tr("Get")) : QVariant(tr("Try")); } }