From b95927f0f5bb161e536c1c88430242c94d20246f Mon Sep 17 00:00:00 2001 From: Bytecoin Developer Date: Wed, 21 Mar 2018 20:03:58 +0300 Subject: [PATCH] Add a batch of release v2.0.0 commits --- CMakeLists.txt | 4 +- ReleaseNotes.md | 9 +- Windows Installer/Installer.vdproj | 16 +- Windows Installer/Installer32.vdproj | 12 +- src/IMinerWorker.h | 18 +- src/IMiningManager.h | 18 +- src/IPoolClient.h | 18 +- src/IPoolMiner.h | 18 +- src/JsonRpc/JsonRpcClient.cpp | 27 ++- src/JsonRpc/JsonRpcClient.h | 9 + src/JsonRpc/JsonRpcNotification.cpp | 18 +- src/JsonRpc/JsonRpcNotification.h | 18 +- src/JsonRpc/JsonRpcObject.cpp | 18 +- src/JsonRpc/JsonRpcObject.h | 18 +- src/JsonRpc/JsonRpcObjectFactory.cpp | 18 +- src/JsonRpc/JsonRpcObjectFactory.h | 18 +- src/JsonRpc/JsonRpcRequest.cpp | 18 +- src/JsonRpc/JsonRpcRequest.h | 18 +- src/JsonRpc/JsonRpcResponse.cpp | 18 +- src/JsonRpc/JsonRpcResponse.h | 18 +- src/Miner/Miner.cpp | 18 +- src/Miner/Miner.h | 18 +- src/Miner/StratumClient.cpp | 18 +- src/Miner/StratumClient.h | 18 +- src/Miner/Worker.cpp | 18 +- src/Miner/Worker.h | 18 +- src/MinerDelegate.cpp | 18 +- src/MinerDelegate.h | 18 +- src/MinerModel.cpp | 18 +- src/MinerModel.h | 18 +- src/MiningFrame.cpp | 63 +++---- src/MiningFrame.h | 18 +- src/MiningFrame.ui | 83 ++++----- src/MiningManager.cpp | 18 +- src/MiningManager.h | 18 +- src/PoolHeaderView.cpp | 40 ---- src/PoolHeaderView.h | 36 ---- src/PoolTreeView.cpp | 60 +++--- src/PoolTreeView.h | 18 +- src/aboutdialog.cpp | 22 +-- src/aboutdialog.h | 18 +- src/aboutdialog.ui | 2 +- src/addressbookdelegate.cpp | 18 +- src/addressbookdelegate.h | 18 +- src/addressbookdialog.cpp | 18 +- src/addressbookdialog.h | 18 +- src/addressbookframe.cpp | 18 +- src/addressbookframe.h | 18 +- src/addressbookframe.ui | 23 ++- src/addressbookmanager.cpp | 18 +- src/addressbookmanager.h | 18 +- src/addressbookmodel.cpp | 18 +- src/addressbookmodel.h | 18 +- src/addressbooksortedmodel.cpp | 18 +- src/addressbooksortedmodel.h | 18 +- src/application.cpp | 85 ++++++++- src/application.h | 9 + src/askpassworddialog.cpp | 3 + src/askpassworddialog.h | 3 + src/balanceoverviewframe.cpp | 9 +- src/balanceoverviewframe.h | 3 + src/bytecoin-gui.pro | 19 +- src/changepassworddialog.cpp | 3 + src/changepassworddialog.h | 3 + src/checkproofdialog.cpp | 80 ++++++++ src/checkproofdialog.h | 44 +++++ src/checkproofdialog.ui | 262 +++++++++++++++++++++++++++ src/common.cpp | 3 + src/common.h | 3 + src/connectionoptionsframe.cpp | 48 ++--- src/connectionoptionsframe.h | 18 +- src/connectionoptionsframe.ui | 2 +- src/connectselectiondialog.cpp | 3 + src/connectselectiondialog.h | 3 + src/crashdialog.cpp | 3 + src/crashdialog.h | 3 + src/createproofdialog.cpp | 114 ++++++++++++ src/createproofdialog.h | 48 +++++ src/createproofdialog.ui | 240 ++++++++++++++++++++++++ src/importkeydialog.cpp | 3 + src/importkeydialog.h | 3 + src/logframe.cpp | 3 + src/logframe.h | 3 + src/logframe.ui | 24 +++ src/logger.cpp | 24 +-- src/logger.h | 18 +- src/main.cpp | 3 + src/mainwindow.cpp | 39 ++-- src/mainwindow.h | 25 +-- src/mainwindow.ui | 82 ++++++++- src/miningoverviewframe.cpp | 3 + src/miningoverviewframe.h | 3 + src/newaddressdialog.cpp | 18 +- src/newaddressdialog.h | 18 +- src/okbutton.cpp | 78 ++++---- src/okbutton.h | 18 +- src/overviewframe.cpp | 97 +++++----- src/overviewframe.h | 19 +- src/overviewframe.ui | 32 ---- src/popup.cpp | 3 + src/popup.h | 3 + src/progressbar.cpp | 3 + src/progressbar.h | 3 + src/questiondialog.cpp | 18 +- src/questiondialog.h | 18 +- src/resizablescrollarea.cpp | 18 +- src/resizablescrollarea.h | 18 +- src/rpcapi.cpp | 69 +++++++ src/rpcapi.h | 69 +++++++ src/sendconfirmationdialog.cpp | 3 + src/sendconfirmationdialog.h | 3 + src/sendframe.cpp | 82 ++++----- src/sendframe.h | 18 +- src/sendframe.ui | 10 +- src/settings.cpp | 21 ++- src/settings.h | 6 +- src/signalhandler.cpp | 18 +- src/signalhandler.h | 18 +- src/statusbar.cpp | 43 ++--- src/statusbar.h | 21 +-- src/transferframe.cpp | 56 +++--- src/transferframe.h | 18 +- src/walletd.cpp | 83 +++++++-- src/walletd.h | 10 + src/walletdparamsdialog.cpp | 36 ++++ src/walletdparamsdialog.h | 37 ++++ src/walletdparamsdialog.ui | 145 +++++++++++++++ src/walletmodel.cpp | 95 +++++++++- src/walletmodel.h | 9 + src/windoweditemmodel.cpp | 18 +- src/windoweditemmodel.h | 18 +- 131 files changed, 2109 insertions(+), 1549 deletions(-) delete mode 100644 src/PoolHeaderView.cpp delete mode 100644 src/PoolHeaderView.h create mode 100644 src/checkproofdialog.cpp create mode 100644 src/checkproofdialog.h create mode 100644 src/checkproofdialog.ui create mode 100644 src/createproofdialog.cpp create mode 100644 src/createproofdialog.h create mode 100644 src/createproofdialog.ui create mode 100644 src/walletdparamsdialog.cpp create mode 100644 src/walletdparamsdialog.h create mode 100644 src/walletdparamsdialog.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index f2a3d14..aea029c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,6 @@ set(SOURCES src/MinerModel.cpp src/MiningFrame.cpp src/MiningManager.cpp - src/PoolHeaderView.cpp src/connectselectiondialog.cpp src/walletd.cpp src/rpcapi.cpp @@ -76,6 +75,9 @@ set(SOURCES src/importkeydialog.cpp src/questiondialog.cpp src/PoolTreeView.cpp + src/createproofdialog.cpp + src/checkproofdialog.cpp + src/walletdparamsdialog.cpp ) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 59f673c..aac750e 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,6 +1,13 @@ ## Release Notes -### v.2.0.0-beta-20180219 +### v2.0.0 + +- Added creating send proofs. +- Added checking send proofs. +- Added wallet daemon parameters window. +- Added bytecoind status in the status bar. + +### v2.0.0-beta-20180219 - Added importing keys. - Fixed stealing focus. diff --git a/Windows Installer/Installer.vdproj b/Windows Installer/Installer.vdproj index eff6637..927c0df 100644 --- a/Windows Installer/Installer.vdproj +++ b/Windows Installer/Installer.vdproj @@ -1391,7 +1391,7 @@ } "{3C67513D-01DD-4637-8A68-80971EB9504F}:_BB6FE95E6903428FBAEC9FE62CB0FE39" { - "DefaultLocation" = "8:[ProgramFilesFolder][ProductName]" + "DefaultLocation" = "8:[ProgramFiles64Folder][ProductName]" "Name" = "8:#1925" "AlwaysCreate" = "11:FALSE" "Condition" = "8:" @@ -1483,23 +1483,23 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Bytecoin" - "ProductCode" = "8:{8589E67D-599D-4959-B521-1F10908FA3F5}" - "PackageCode" = "8:{97B81D4E-0610-41F0-9D01-CDECD35E90F1}" + "ProductCode" = "8:{0D485391-2605-4122-9735-D21D26FCD025}" + "PackageCode" = "8:{1BB8055F-FB3F-411B-8DEF-18C6BF9D8BE1}" "UpgradeCode" = "8:{DC5C7D60-BB08-4B97-B634-E87679CCEB3C}" "AspNetVersion" = "8:" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:2.0.0" + "ProductVersion" = "8:18.3.20" "Manufacturer" = "8:Bytecoin Developers" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" - "Title" = "8:Bytecoin Beta Installer" + "Title" = "8:Bytecoin 3.0.0 Installer" "Subject" = "8:" "ARPCONTACT" = "8:Bytecoin Developers" "Keywords" = "8:" - "ARPCOMMENTS" = "8:Beta version of new bytecoin from 19 February 2018" + "ARPCOMMENTS" = "8:Release version of bytecoin from 20 March 2018" "ARPURLINFOABOUT" = "8:https://bytecoin.org" "ARPPRODUCTICON" = "8:_ABCF8F071D16461785EDF6D56ED2ABCE" "ARPIconIndex" = "3:0" @@ -1706,7 +1706,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:WARNING: This is Beta (pre-release) version of new bytecoin core and GUI wallet from 2018/02/19. Proceed with caution." + "Value" = "8:Release version 3.0.0 of bytecoin core and GUI wallet from 2018/03/20." "DefaultValue" = "8:#1202" "UsePlugInResources" = "11:TRUE" } @@ -1945,7 +1945,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:WARNING: This is Beta (pre-release) version of new bytecoin core and GUI wallet from 2018/02/19. Proceed with caution." + "Value" = "8:Release version 3.0.0 of bytecoin core and GUI wallet from 2018/03/20." "DefaultValue" = "8:#1202" "UsePlugInResources" = "11:TRUE" } diff --git a/Windows Installer/Installer32.vdproj b/Windows Installer/Installer32.vdproj index 7b5d11d..ff128ef 100644 --- a/Windows Installer/Installer32.vdproj +++ b/Windows Installer/Installer32.vdproj @@ -1483,15 +1483,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Bytecoin" - "ProductCode" = "8:{8589E67D-599D-4959-B521-1F10908FA3F5}" - "PackageCode" = "8:{27B3D69D-6186-4724-84CD-2C5627792B8D}" + "ProductCode" = "8:{C7A0F50F-34A0-45A7-9271-53017B6C61AB}" + "PackageCode" = "8:{3136530C-C2B2-41C4-86BD-FCDA2B0B2AFB}" "UpgradeCode" = "8:{DC5C7D60-BB08-4B97-B634-E87679CCEB3C}" "AspNetVersion" = "8:" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:2.0.0" + "ProductVersion" = "8:18.3.15" "Manufacturer" = "8:Bytecoin Developers" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" @@ -1499,7 +1499,7 @@ "Subject" = "8:" "ARPCONTACT" = "8:Bytecoin Developers" "Keywords" = "8:" - "ARPCOMMENTS" = "8:Beta version of new bytecoin from 19 February 2018" + "ARPCOMMENTS" = "8:Beta version of new bytecoin from 15 March 2018" "ARPURLINFOABOUT" = "8:https://bytecoin.org" "ARPPRODUCTICON" = "8:_ABCF8F071D16461785EDF6D56ED2ABCE" "ARPIconIndex" = "3:0" @@ -1706,7 +1706,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:WARNING: This is Beta (pre-release) version of new bytecoin core and GUI wallet from 2018/02/19. Proceed with caution." + "Value" = "8:WARNING: This is Beta (pre-release) version of new bytecoin core and GUI wallet from 2018/03/15. Proceed with caution." "DefaultValue" = "8:#1202" "UsePlugInResources" = "11:TRUE" } @@ -1945,7 +1945,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:WARNING: This is Beta (pre-release) version of new bytecoin core and GUI wallet from 2018/02/19. Proceed with caution." + "Value" = "8:WARNING: This is Beta (pre-release) version of new bytecoin core and GUI wallet from 2018/03/15. Proceed with caution." "DefaultValue" = "8:#1202" "UsePlugInResources" = "11:TRUE" } diff --git a/src/IMinerWorker.h b/src/IMinerWorker.h index 013e8c8..b51b91d 100644 --- a/src/IMinerWorker.h +++ b/src/IMinerWorker.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/IMiningManager.h b/src/IMiningManager.h index f33b40e..0d43e98 100644 --- a/src/IMiningManager.h +++ b/src/IMiningManager.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/IPoolClient.h b/src/IPoolClient.h index ec122b5..1ea4a96 100644 --- a/src/IPoolClient.h +++ b/src/IPoolClient.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/IPoolMiner.h b/src/IPoolMiner.h index 3230dbe..9b91dfd 100644 --- a/src/IPoolMiner.h +++ b/src/IPoolMiner.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/JsonRpc/JsonRpcClient.cpp b/src/JsonRpc/JsonRpcClient.cpp index 5aff2b8..f36a5d9 100644 --- a/src/JsonRpc/JsonRpcClient.cpp +++ b/src/JsonRpc/JsonRpcClient.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include "JsonRpcClient.h" @@ -141,7 +144,7 @@ void Client::replyFinished(QNetworkReply* reply) if (!jsonDocument.isObject()) { qDebug("[JsonRpcClient] JSON document is not an object."); - emit jsonParsingError("JSON document is not an object."); + emit jsonParsingError(tr("JSON document is not an object.")); return; } const QJsonObject json = jsonDocument.object(); @@ -274,6 +277,18 @@ void WalletClient::sendSendTx(const RpcApi::SendTransaction::Request& req) insertResponseHandler(requestID, std::bind(&WalletClient::sendTxHandler, this, _1)); } +void WalletClient::sendCreateProof(const RpcApi::CreateSendProof::Request& req) +{ + const QString requestID = sendRequest(RpcApi::CreateSendProof::METHOD, req.toJson()); + insertResponseHandler(requestID, std::bind(&WalletClient::proofsHandler, this, _1)); +} + +void WalletClient::sendCheckProof(const RpcApi::CheckSendProof::Request& req) +{ + const QString requestID = sendRequest(RpcApi::CheckSendProof::METHOD, req.toJson()); + insertResponseHandler(requestID, std::bind(&WalletClient::checkProofHandler, this, _1)); +} + void WalletClient::statusHandler(const QVariantMap& result) const { emit statusReceived(RpcApi::Status::fromJson(result)); @@ -313,6 +328,16 @@ void WalletClient::viewKeyHandler(const QVariantMap& result) const emit viewKeyReceived(RpcApi::ViewKey::fromJson(result)); } +void WalletClient::proofsHandler(const QVariantMap &result) const +{ + emit proofsReceived(RpcApi::Proofs::fromJson(result)); +} + +void WalletClient::checkProofHandler(const QVariantMap& result) const +{ + emit checkProofReceived(RpcApi::ProofCheck::fromJson(result)); +} + //#undef CHECK_CONVERTIBLE diff --git a/src/JsonRpc/JsonRpcClient.h b/src/JsonRpc/JsonRpcClient.h index 84450bd..67b003a 100644 --- a/src/JsonRpc/JsonRpcClient.h +++ b/src/JsonRpc/JsonRpcClient.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #pragma once #include @@ -86,6 +89,8 @@ class WalletClient : public Client void sendGetViewKey(); void sendCreateTx(const RpcApi::CreateTransaction::Request& req); void sendSendTx(const RpcApi::SendTransaction::Request& req); + void sendCreateProof(const RpcApi::CreateSendProof::Request& req); + void sendCheckProof(const RpcApi::CheckSendProof::Request& req); signals: void statusReceived(const RpcApi::Status& result) const; @@ -96,6 +101,8 @@ class WalletClient : public Client void unspentReceived(const RpcApi::Unspents& result) const; void createTxReceived(const RpcApi::CreatedTx& result) const; void sendTxReceived(const RpcApi::SentTx& result) const; + void proofsReceived(const RpcApi::Proofs& result) const; + void checkProofReceived(const RpcApi::ProofCheck& result) const; private: void statusHandler(const QVariantMap& result) const; @@ -106,6 +113,8 @@ class WalletClient : public Client // void unspentHandler(const QVariantMap& result) const; void createTxHandler(const QVariantMap& result) const; void sendTxHandler(const QVariantMap& result) const; + void proofsHandler(const QVariantMap& result) const; + void checkProofHandler(const QVariantMap& result) const; }; //class StratumClient : public Client diff --git a/src/JsonRpc/JsonRpcNotification.cpp b/src/JsonRpc/JsonRpcNotification.cpp index fd286d1..53ac955 100644 --- a/src/JsonRpc/JsonRpcNotification.cpp +++ b/src/JsonRpc/JsonRpcNotification.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/JsonRpc/JsonRpcNotification.h b/src/JsonRpc/JsonRpcNotification.h index fa9bb87..694c5c8 100644 --- a/src/JsonRpc/JsonRpcNotification.h +++ b/src/JsonRpc/JsonRpcNotification.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/JsonRpc/JsonRpcObject.cpp b/src/JsonRpc/JsonRpcObject.cpp index 1a9973f..3c1ba71 100644 --- a/src/JsonRpc/JsonRpcObject.cpp +++ b/src/JsonRpc/JsonRpcObject.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include diff --git a/src/JsonRpc/JsonRpcObject.h b/src/JsonRpc/JsonRpcObject.h index 7232c15..0b83274 100644 --- a/src/JsonRpc/JsonRpcObject.h +++ b/src/JsonRpc/JsonRpcObject.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/JsonRpc/JsonRpcObjectFactory.cpp b/src/JsonRpc/JsonRpcObjectFactory.cpp index 58c58ee..e002d5a 100644 --- a/src/JsonRpc/JsonRpcObjectFactory.cpp +++ b/src/JsonRpc/JsonRpcObjectFactory.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/JsonRpc/JsonRpcObjectFactory.h b/src/JsonRpc/JsonRpcObjectFactory.h index aa2722d..b1ce109 100644 --- a/src/JsonRpc/JsonRpcObjectFactory.h +++ b/src/JsonRpc/JsonRpcObjectFactory.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include diff --git a/src/JsonRpc/JsonRpcRequest.cpp b/src/JsonRpc/JsonRpcRequest.cpp index 19ab934..915cd3a 100644 --- a/src/JsonRpc/JsonRpcRequest.cpp +++ b/src/JsonRpc/JsonRpcRequest.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/JsonRpc/JsonRpcRequest.h b/src/JsonRpc/JsonRpcRequest.h index 45cacf1..d134f99 100644 --- a/src/JsonRpc/JsonRpcRequest.h +++ b/src/JsonRpc/JsonRpcRequest.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/JsonRpc/JsonRpcResponse.cpp b/src/JsonRpc/JsonRpcResponse.cpp index 8d645e3..509043b 100644 --- a/src/JsonRpc/JsonRpcResponse.cpp +++ b/src/JsonRpc/JsonRpcResponse.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/JsonRpc/JsonRpcResponse.h b/src/JsonRpc/JsonRpcResponse.h index 0ab1386..03f6bb0 100644 --- a/src/JsonRpc/JsonRpcResponse.h +++ b/src/JsonRpc/JsonRpcResponse.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/Miner/Miner.cpp b/src/Miner/Miner.cpp index f89f9b0..0e4d2e9 100644 --- a/src/Miner/Miner.cpp +++ b/src/Miner/Miner.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/Miner/Miner.h b/src/Miner/Miner.h index 1ce6df5..5a754c8 100644 --- a/src/Miner/Miner.h +++ b/src/Miner/Miner.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/Miner/StratumClient.cpp b/src/Miner/StratumClient.cpp index d1db595..c117cef 100644 --- a/src/Miner/StratumClient.cpp +++ b/src/Miner/StratumClient.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/Miner/StratumClient.h b/src/Miner/StratumClient.h index 9b68073..5fef273 100644 --- a/src/Miner/StratumClient.h +++ b/src/Miner/StratumClient.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/Miner/Worker.cpp b/src/Miner/Worker.cpp index 634069b..9565342 100644 --- a/src/Miner/Worker.cpp +++ b/src/Miner/Worker.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/Miner/Worker.h b/src/Miner/Worker.h index 33204ab..69ddd9a 100644 --- a/src/Miner/Worker.h +++ b/src/Miner/Worker.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/MinerDelegate.cpp b/src/MinerDelegate.cpp index eaa237b..2bd05d1 100644 --- a/src/MinerDelegate.cpp +++ b/src/MinerDelegate.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include diff --git a/src/MinerDelegate.h b/src/MinerDelegate.h index 754ceef..41950eb 100644 --- a/src/MinerDelegate.h +++ b/src/MinerDelegate.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/MinerModel.cpp b/src/MinerModel.cpp index 0e4c8cf..cf9c1bf 100644 --- a/src/MinerModel.cpp +++ b/src/MinerModel.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/MinerModel.h b/src/MinerModel.h index 80dcae0..cea07cf 100644 --- a/src/MinerModel.h +++ b/src/MinerModel.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/MiningFrame.cpp b/src/MiningFrame.cpp index 5ab0dcc..224a137 100644 --- a/src/MiningFrame.cpp +++ b/src/MiningFrame.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -29,7 +15,6 @@ #include "IPoolMiner.h" #include "MinerDelegate.h" #include "MinerModel.h" -#include "PoolHeaderView.h" #include "ui_MiningFrame.h" @@ -37,34 +22,34 @@ namespace WalletGUI { namespace { -const char MINING_FRAME_STYLE_SHEET_TEMPLATE[] = - "* {" - "font-family: %fontFamily%;" - "}" +//const char MINING_FRAME_STYLE_SHEET_TEMPLATE[] = +// "* {" +// "font-family: %fontFamily%;" +// "}" - "WalletGui--MiningFrame {" - "background-color: #ffffff;" - "}" +// "WalletGui--MiningFrame {" +// "background-color: #ffffff;" +// "}" - "WalletGui--MiningFrame #m_miningManageFrame {" - "background-color: %backgroundColorGray%;" - "border: none;" - "border-bottom: 1px solid %borderColor%;" - "}" +// "WalletGui--MiningFrame #m_miningManageFrame {" +// "background-color: %backgroundColorGray%;" +// "border: none;" +// "border-bottom: 1px solid %borderColor%;" +// "}" - "WalletGui--MiningFrame #m_miningManageFrame #m_cpuCoresCombo {" - "background-color: #ffffff;" - "min-width: 40px;" - "max-width: 40px;" - "}" +// "WalletGui--MiningFrame #m_miningManageFrame #m_cpuCoresCombo {" +// "background-color: #ffffff;" +// "min-width: 40px;" +// "max-width: 40px;" +// "}" - "WalletGui--MiningFrame #m_addPoolFrame {" - "border: none;" - "border-top: 1px solid %borderColor%;" - "}"; +// "WalletGui--MiningFrame #m_addPoolFrame {" +// "border: none;" +// "border-top: 1px solid %borderColor%;" +// "}"; -const int NAVIGATION_SECTION_WIDTH = 50; +//const int NAVIGATION_SECTION_WIDTH = 50; bool isIpOrHostName(const QString& _string) { QRegExp ipRegExp("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"); diff --git a/src/MiningFrame.h b/src/MiningFrame.h index 7c3f8fb..05e623d 100644 --- a/src/MiningFrame.h +++ b/src/MiningFrame.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/MiningFrame.ui b/src/MiningFrame.ui index cd2cec2..a5421eb 100644 --- a/src/MiningFrame.ui +++ b/src/MiningFrame.ui @@ -19,7 +19,7 @@ QFrame::Raised - + 0 @@ -323,57 +323,44 @@ - - - 25 + + + Qt::NoFocus - - 0 + + QFrame::NoFrame - - 25 + + QAbstractScrollArea::AdjustToContents - - 20 + + false - - - - Qt::NoFocus - - - QFrame::NoFrame - - - QAbstractScrollArea::AdjustToContents - - - false - - - false - - - false - - - QAbstractItemView::InternalMove - - - Qt::MoveAction - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - QAbstractItemView::ScrollPerPixel - - - - + + false + + + false + + + QAbstractItemView::InternalMove + + + Qt::MoveAction + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + false + + diff --git a/src/MiningManager.cpp b/src/MiningManager.cpp index b48220e..3eb9946 100644 --- a/src/MiningManager.cpp +++ b/src/MiningManager.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/MiningManager.h b/src/MiningManager.h index 824392a..255778a 100644 --- a/src/MiningManager.h +++ b/src/MiningManager.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/PoolHeaderView.cpp b/src/PoolHeaderView.cpp deleted file mode 100644 index 711770e..0000000 --- a/src/PoolHeaderView.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . - -#include "PoolHeaderView.h" -#include "MinerModel.h" - -namespace WalletGUI { - -PoolHeaderView::PoolHeaderView(QWidget* _parent) : QHeaderView(Qt::Horizontal, _parent) { -} - -PoolHeaderView::~PoolHeaderView() { -} - -void PoolHeaderView::paintSection(QPainter* _painter, const QRect& _rect, int _logicalIndex) const{ - if (_logicalIndex != MinerModel::COLUMN_POOL_URL) { - QHeaderView::paintSection(_painter, _rect, _logicalIndex); - return; - } - - QRect rect(_rect); - rect.setLeft(_rect.left() + 13); - QHeaderView::paintSection(_painter, rect, _logicalIndex); -} - -} diff --git a/src/PoolHeaderView.h b/src/PoolHeaderView.h deleted file mode 100644 index a2fb071..0000000 --- a/src/PoolHeaderView.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . - -#pragma once - -#include - -namespace WalletGUI { - -class PoolHeaderView : public QHeaderView { - Q_OBJECT - Q_DISABLE_COPY(PoolHeaderView) - -public: - explicit PoolHeaderView(QWidget* _parent); - ~PoolHeaderView(); - -protected: - void paintSection(QPainter* _painter, const QRect& _rect, int _logicalIndex) const override; -}; - -} diff --git a/src/PoolTreeView.cpp b/src/PoolTreeView.cpp index 4711ab0..bc4837f 100644 --- a/src/PoolTreeView.cpp +++ b/src/PoolTreeView.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -30,31 +16,31 @@ namespace WalletGUI namespace { -const char POOL_TREE_VIEW_STYLE_SHEET_TEMPLATE[] = - "WalletGui--PoolTreeView::item:selected {" - "color: %fontColorGray%;" - "background: %backgroundColorAlternate%;" - "}" +//const char POOL_TREE_VIEW_STYLE_SHEET_TEMPLATE[] = +// "WalletGui--PoolTreeView::item:selected {" +// "color: %fontColorGray%;" +// "background: %backgroundColorAlternate%;" +// "}" - "WalletGui--PoolTreeView::item:alternate:selected {" - "color: %fontColorGray%;" - "background: #ffffff;" - "}" +// "WalletGui--PoolTreeView::item:alternate:selected {" +// "color: %fontColorGray%;" +// "background: #ffffff;" +// "}" - "WalletGui--PoolTreeView::item:!selected {" - "color: #000000;" - "background: %backgroundColorAlternate%;" - "}" +// "WalletGui--PoolTreeView::item:!selected {" +// "color: #000000;" +// "background: %backgroundColorAlternate%;" +// "}" - "WalletGui--PoolTreeView::item:alternate:!selected {" - "color: #000000;" - "background: #ffffff;" - "}"; +// "WalletGui--PoolTreeView::item:alternate:!selected {" +// "color: #000000;" +// "background: #ffffff;" +// "}"; class CursorManager { public: - CursorManager(QAbstractItemView* _view, QEvent* _event, bool _isDragging = false) : m_view(_view), - m_event(_event), m_isDragging(_isDragging) { + CursorManager(QAbstractItemView* _view, QEvent* _event/*, bool _isDragging = false*/) : m_view(_view), + m_event(_event)/*, m_isDragging(_isDragging)*/ { } ~CursorManager() { @@ -70,7 +56,7 @@ class CursorManager { private: QAbstractItemView* m_view; QEvent* m_event; - bool m_isDragging; +// bool m_isDragging; void processMouseMoveEvent() { QMouseEvent* mouseEvent = reinterpret_cast(m_event); @@ -130,7 +116,7 @@ void PoolTreeView::dropEvent(QDropEvent* _event) { } void PoolTreeView::mouseMoveEvent(QMouseEvent* _event) { - CursorManager cursorMan(this, _event, state() == PoolTreeView::DraggingState); + CursorManager cursorMan(this, _event/*, state() == PoolTreeView::DraggingState*/); if (!(_event->buttons() & Qt::LeftButton)) { QTableView::mouseMoveEvent(_event); QModelIndex index = indexAt(_event->pos()); diff --git a/src/PoolTreeView.h b/src/PoolTreeView.h index 8e202a8..f31fae2 100644 --- a/src/PoolTreeView.h +++ b/src/PoolTreeView.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index bef70b2..cae68af 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include @@ -33,8 +19,8 @@ AboutDialog::AboutDialog(QWidget* parent) m_ui->m_aboutLabel->setText( aboutText .arg(Settings::getVersion()) - .arg(Settings::getVersionSuffix()) - .arg(Settings::getRevision()) +// .arg(Settings::getVersionSuffix()) +// .arg(Settings::getRevision()) .arg(QDateTime::currentDateTime().date().year())); } diff --git a/src/aboutdialog.h b/src/aboutdialog.h index 45d75fb..6982d39 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui index 2dfeaef..45b4c28 100644 --- a/src/aboutdialog.ui +++ b/src/aboutdialog.ui @@ -41,7 +41,7 @@ - <html><head/><body><p>Bytecoin GUI version %1-%2-%3</p><p>Bytecoin is the next generation anonymous cryptocurrency based on CryptoNote.</p><p>Copyright © 2012-%4 The Bytecoin developers</p><p>This is free software.</p><p>Distributed under the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.</p><p>Distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details:</p><p><a href="https://www.gnu.org/licenses/lgpl.html"><span style=" text-decoration: underline; color:#0000ff;">https://www.gnu.org/licenses/lgpl.html</span></a></p><p><a href="http://bytecoin.org/"><span style=" text-decoration: underline; color:#0000ff;">https://bytecoin.org/</span></a></p></body></html> + <html><head/><body><p>Bytecoin GUI version %1</p><p>Bytecoin is the next generation anonymous cryptocurrency based on CryptoNote.</p><p>Copyright © 2012-%2 The Bytecoin developers</p><p>This is free software.</p><p>Distributed under the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.</p><p>Distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details:</p><p><a href="https://www.gnu.org/licenses/lgpl.html"><span style=" text-decoration: underline; color:#0000ff;">https://www.gnu.org/licenses/lgpl.html</span></a></p><p><a href="http://bytecoin.org/"><span style=" text-decoration: underline; color:#0000ff;">https://bytecoin.org/</span></a></p></body></html> Qt::RichText diff --git a/src/addressbookdelegate.cpp b/src/addressbookdelegate.cpp index 5ee61aa..2b7972b 100644 --- a/src/addressbookdelegate.cpp +++ b/src/addressbookdelegate.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/addressbookdelegate.h b/src/addressbookdelegate.h index dbea392..b88c5e7 100644 --- a/src/addressbookdelegate.h +++ b/src/addressbookdelegate.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/addressbookdialog.cpp b/src/addressbookdialog.cpp index a11ebae..1cbcd62 100644 --- a/src/addressbookdialog.cpp +++ b/src/addressbookdialog.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include "addressbookdialog.h" #include "addressbookmodel.h" diff --git a/src/addressbookdialog.h b/src/addressbookdialog.h index 3f49a9b..0c6e0ce 100644 --- a/src/addressbookdialog.h +++ b/src/addressbookdialog.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/addressbookframe.cpp b/src/addressbookframe.cpp index a31b3c9..bce473e 100644 --- a/src/addressbookframe.cpp +++ b/src/addressbookframe.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/addressbookframe.h b/src/addressbookframe.h index e45810b..0341c2e 100644 --- a/src/addressbookframe.h +++ b/src/addressbookframe.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/addressbookframe.ui b/src/addressbookframe.ui index 2b40818..23ffb3d 100644 --- a/src/addressbookframe.ui +++ b/src/addressbookframe.ui @@ -6,7 +6,7 @@ 0 0 - 870 + 1070 500 @@ -24,22 +24,28 @@ 0 - 25 + 0 - 23 + 0 - 25 + 0 - 23 + 10 0 + + 6 + + + 6 + @@ -136,8 +142,11 @@ 0 - - 0 + + 6 + + + 6 diff --git a/src/addressbookmanager.cpp b/src/addressbookmanager.cpp index 85cfd31..f3f963a 100644 --- a/src/addressbookmanager.cpp +++ b/src/addressbookmanager.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/addressbookmanager.h b/src/addressbookmanager.h index eb6fe52..a0a4aba 100644 --- a/src/addressbookmanager.h +++ b/src/addressbookmanager.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/addressbookmodel.cpp b/src/addressbookmodel.cpp index cfc05f6..0733fc4 100644 --- a/src/addressbookmodel.cpp +++ b/src/addressbookmodel.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include diff --git a/src/addressbookmodel.h b/src/addressbookmodel.h index cc8e67f..2217aee 100644 --- a/src/addressbookmodel.h +++ b/src/addressbookmodel.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/addressbooksortedmodel.cpp b/src/addressbooksortedmodel.cpp index efa8b20..5a14e8b 100644 --- a/src/addressbooksortedmodel.cpp +++ b/src/addressbooksortedmodel.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include "addressbooksortedmodel.h" #include "addressbookmodel.h" diff --git a/src/addressbooksortedmodel.h b/src/addressbooksortedmodel.h index 797b941..bbfa969 100644 --- a/src/addressbooksortedmodel.h +++ b/src/addressbooksortedmodel.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/application.cpp b/src/application.cpp index ff80e3f..7bfa2a2 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include #include @@ -23,6 +26,9 @@ #include "askpassworddialog.h" #include "crashdialog.h" #include "importkeydialog.h" +#include "createproofdialog.h" +#include "checkproofdialog.h" +#include "walletdparamsdialog.h" namespace WalletGUI { @@ -43,6 +49,8 @@ WalletApplication::WalletApplication(int& argc, char** argv) setQuitOnLastWindowClosed(false); QLocale::setDefault(QLocale::c()); loadFonts(); + + connect(this, &WalletApplication::createWalletdSignal, this, &WalletApplication::createWalletd, Qt::QueuedConnection); } WalletApplication::~WalletApplication() @@ -82,12 +90,12 @@ bool WalletApplication::init() if (!m_lockFile->tryLock()) { WalletLogger::warning(tr("[Application] Bytecoin wallet GUI already running")); - QMessageBox::warning(nullptr, QObject::tr("Fail"), "Bytecoin wallet GUI already running"); + QMessageBox::warning(nullptr, QObject::tr("Fail"), tr("Bytecoin wallet GUI already running")); return false; } QObject::connect(&SignalHandler::instance(), &SignalHandler::quitSignal, this, &WalletApplication::quit); - initSystemTrayIcon(); +// initSystemTrayIcon(); const bool connectionSelected = Settings::instance().connectionMethodSet(); const bool walletFileSet = !Settings::instance().getWalletFile().isEmpty(); @@ -107,6 +115,9 @@ bool WalletApplication::init() connect(m_mainWindow, &MainWindow::createTxSignal, this, &WalletApplication::createTx); connect(m_mainWindow, &MainWindow::sendTxSignal, this, &WalletApplication::sendTx); connect(m_mainWindow, &MainWindow::restartDaemon, this, &WalletApplication::restartDaemon); + connect(m_mainWindow, &MainWindow::createProofSignal, this, &WalletApplication::createProof); + connect(m_mainWindow, &MainWindow::checkProofSignal, this, &WalletApplication::checkProof); + connect(m_mainWindow, &MainWindow::showWalletdParamsSignal, this, &WalletApplication::showWalletdParams); connect(m_mainWindow, &MainWindow::createWalletSignal, this, &WalletApplication::createWallet); connect(m_mainWindow, &MainWindow::importKeysSignal, this, &WalletApplication::importKeys); @@ -119,7 +130,8 @@ bool WalletApplication::init() if(isFirstRun) firstRun(); else - createWalletd(); +// createWalletd(); + emit createWalletdSignal(QPrivateSignal{}); return true; } @@ -133,6 +145,8 @@ void WalletApplication::subscribeToWalletd() connect(walletd_, &RemoteWalletd::viewKeyReceivedSignal, walletModel_, &WalletModel::viewKeyReceived); connect(walletd_, &RemoteWalletd::unspentsReceivedSignal, walletModel_, &WalletModel::unspentsReceived); // connect(walletd_, &RemoteWalletd::sendTxReceivedSignal, walletModel_, &WalletModel::transactionSent); +// connect(walletd_, &RemoteWalletd::proofsReceivedSignal, this, &WalletApplication::showProof); +// connect(walletd_, &RemoteWalletd::checkProofReceivedSignal, this, &WalletApplication::showCheckProof); connect(walletd_, &RemoteWalletd::stateChangedSignal, walletModel_, &WalletModel::stateChanged); connect(walletd_, &RemoteWalletd::connectedSignal, this, &WalletApplication::connectedToWalletd); @@ -212,6 +226,18 @@ void WalletApplication::sendTx(const RpcApi::SendTransaction::Request& req) walletd_->sendTx(req); } +void WalletApplication::sendCreateProof(const QString& txHash, const QString& message) +{ + const RpcApi::CreateSendProof::Request req{txHash, message, QStringList{}}; + walletd_->createProof(req); +} + +void WalletApplication::sendCheckProof(const QString& proof) +{ + const RpcApi::CheckSendProof::Request req{proof}; + walletd_->checkSendProof(req); +} + void WalletApplication::createWalletd() { if (Settings::instance().getConnectionMethod() == ConnectionMethod::BUILTIN) @@ -226,7 +252,8 @@ void WalletApplication::createWalletd() void WalletApplication::restartDaemon() { - createWalletd(); +// createWalletd(); + emit createWalletdSignal(QPrivateSignal{}); } void WalletApplication::splashMsg(const QString& msg) @@ -358,9 +385,10 @@ void WalletApplication::daemonFinished(int exitCode, QProcess::ExitStatus /*exit if (crashDialog_->execWithReason(msg, showPasswordEdit) == QDialog::Accepted) { - if (showPasswordEdit) - walletd->setPassword(crashDialog_->getPassword()); - walletd->run(); +// if (showPasswordEdit) +// walletd->setPassword(crashDialog_->getPassword()); +// walletd->run(); + restartDaemon(); } } @@ -449,8 +477,10 @@ void WalletApplication::importKeys(QWidget* parent) void WalletApplication::requestPassword() { AskPasswordDialog dlg(false, m_mainWindow); + BuiltinWalletd* walletd = static_cast(walletd_); + connect(walletd, &BuiltinWalletd::daemonErrorOccurredSignal, &dlg, &AskPasswordDialog::reject); if (dlg.exec() == QDialog::Accepted) - static_cast(walletd_)->setPassword(dlg.getPassword()); + walletd->setPassword(dlg.getPassword()); else walletd_->stop(); } @@ -458,8 +488,10 @@ void WalletApplication::requestPassword() void WalletApplication::requestPasswordWithConfirmation() { ChangePasswordDialog dlg(false, m_mainWindow); + BuiltinWalletd* walletd = static_cast(walletd_); + connect(walletd, &BuiltinWalletd::daemonErrorOccurredSignal, &dlg, &ChangePasswordDialog::reject); if (dlg.exec() == QDialog::Accepted) - static_cast(walletd_)->setPassword(dlg.getNewPassword()); + walletd->setPassword(dlg.getNewPassword()); else walletd_->stop(); } @@ -479,4 +511,39 @@ void WalletApplication::requestWalletdAuth(QAuthenticator* authenticator) } } +void WalletApplication::createProof(const QString& txHash) +{ + CreateProofDialog dlg{txHash, m_mainWindow}; + connect(&dlg, &CreateProofDialog::generateProofSignal, this, &WalletApplication::sendCreateProof); + connect(walletd_, &RemoteWalletd::proofsReceivedSignal, + &dlg, + [&dlg](const RpcApi::Proofs& proofs) + { + dlg.addProofs(proofs.send_proofs); + }); + dlg.exec(); +} + +void WalletApplication::checkProof() +{ + CheckProofDialog dlg{m_mainWindow}; + connect(&dlg, &CheckProofDialog::checkProofSignal, this, &WalletApplication::sendCheckProof); + connect(walletd_, &RemoteWalletd::checkProofReceivedSignal, + &dlg, + [&dlg](const RpcApi::ProofCheck& check) + { + dlg.showCheckResult(check.validation_error); + }); + dlg.exec(); +} + +void WalletApplication::showWalletdParams() +{ + WalletdParamsDialog dlg(Settings::instance().getConnectionMethod() == ConnectionMethod::BUILTIN, m_mainWindow); + connect(&dlg, &WalletdParamsDialog::restartWalletd, this, &WalletApplication::restartDaemon); + BuiltinWalletd* walletd = static_cast(walletd_); + connect(walletd, &BuiltinWalletd::daemonErrorOccurredSignal, &dlg, &WalletdParamsDialog::reject); + dlg.exec(); +} + } diff --git a/src/application.h b/src/application.h index 6d35055..d5582a6 100644 --- a/src/application.h +++ b/src/application.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #pragma once #include @@ -62,11 +65,17 @@ class WalletApplication: public QApplication signals: void builtinRunSignal(); void remoteConnectedSignal(); + void createWalletdSignal(QPrivateSignal); public slots: void createTx(const RpcApi::CreateTransaction::Request& req); void sendTx(const RpcApi::SendTransaction::Request& req); + void createProof(const QString& txHash); + void sendCreateProof(const QString& txHash, const QString& message); + void checkProof(); + void sendCheckProof(const QString& proof); void restartDaemon(); + void showWalletdParams(); void connectToRemoteWalletd(); diff --git a/src/askpassworddialog.cpp b/src/askpassworddialog.cpp index e0132b6..dddd435 100644 --- a/src/askpassworddialog.cpp +++ b/src/askpassworddialog.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include "askpassworddialog.h" #include "ui_askpassworddialog.h" diff --git a/src/askpassworddialog.h b/src/askpassworddialog.h index 33ec135..0a1773c 100644 --- a/src/askpassworddialog.h +++ b/src/askpassworddialog.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef ASKPASSWORDDIALOG_H #define ASKPASSWORDDIALOG_H diff --git a/src/balanceoverviewframe.cpp b/src/balanceoverviewframe.cpp index 33560fa..6569fdd 100644 --- a/src/balanceoverviewframe.cpp +++ b/src/balanceoverviewframe.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include #include @@ -8,12 +11,6 @@ #include "walletmodel.h" #include "popup.h" -namespace { - -constexpr int SHOW_COPIED_TIMEOUT_MSECS = 1500; - -} - namespace WalletGUI { BalanceOverviewFrame::BalanceOverviewFrame(QWidget *parent) diff --git a/src/balanceoverviewframe.h b/src/balanceoverviewframe.h index daf8f2c..6b97f47 100644 --- a/src/balanceoverviewframe.h +++ b/src/balanceoverviewframe.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef BALANCEFRAME_H #define BALANCEFRAME_H diff --git a/src/bytecoin-gui.pro b/src/bytecoin-gui.pro index 2c146bb..f539010 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.2.19 +win32: VERSION = 2.18.3.20 #QMAKE_CXXFLAGS += -fno-omit-frame-pointer -fsanitize=address,undefined #LIBS += -lasan -lubsan @@ -73,7 +73,6 @@ SOURCES += main.cpp\ MinerModel.cpp \ MiningFrame.cpp \ MiningManager.cpp \ - PoolHeaderView.cpp \ connectselectiondialog.cpp \ walletd.cpp \ rpcapi.cpp \ @@ -95,7 +94,10 @@ SOURCES += main.cpp\ askpassworddialog.cpp \ importkeydialog.cpp \ questiondialog.cpp \ - PoolTreeView.cpp + PoolTreeView.cpp \ + createproofdialog.cpp \ + checkproofdialog.cpp \ + walletdparamsdialog.cpp HEADERS += mainwindow.h \ signalhandler.h \ @@ -126,7 +128,6 @@ HEADERS += mainwindow.h \ MinerModel.h \ MiningFrame.h \ MiningManager.h \ - PoolHeaderView.h \ IMinerWorker.h \ IMiningManager.h \ IPoolClient.h \ @@ -152,7 +153,10 @@ HEADERS += mainwindow.h \ askpassworddialog.h \ importkeydialog.h \ questiondialog.h \ - PoolTreeView.h + PoolTreeView.h \ + createproofdialog.h \ + checkproofdialog.h \ + walletdparamsdialog.h FORMS += mainwindow.ui \ overviewframe.ui \ @@ -173,7 +177,10 @@ FORMS += mainwindow.ui \ logframe.ui \ askpassworddialog.ui \ importkeydialog.ui \ - questiondialog.ui + questiondialog.ui \ + createproofdialog.ui \ + checkproofdialog.ui \ + walletdparamsdialog.ui RESOURCES += \ resources.qrc \ diff --git a/src/changepassworddialog.cpp b/src/changepassworddialog.cpp index 09b8560..2f60a35 100644 --- a/src/changepassworddialog.cpp +++ b/src/changepassworddialog.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include "changepassworddialog.h" diff --git a/src/changepassworddialog.h b/src/changepassworddialog.h index 53b9385..4ae9743 100644 --- a/src/changepassworddialog.h +++ b/src/changepassworddialog.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef WALLETGUI_CHANGEPASSWORDDIALOG_H #define WALLETGUI_CHANGEPASSWORDDIALOG_H diff --git a/src/checkproofdialog.cpp b/src/checkproofdialog.cpp new file mode 100644 index 0000000..55b38aa --- /dev/null +++ b/src/checkproofdialog.cpp @@ -0,0 +1,80 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + +#include +#include +#include + +#include "checkproofdialog.h" +#include "ui_checkproofdialog.h" +#include "rpcapi.h" +#include "common.h" + +namespace WalletGUI +{ + +CheckProofDialog::CheckProofDialog(QWidget *parent) + : QDialog(parent) + , ui(new Ui::CheckProofDialog) +{ + ui->setupUi(this); + clear(); +} + +CheckProofDialog::~CheckProofDialog() +{ + delete ui; +} + +void CheckProofDialog::clear() +{ + ui->messageLabel->clear(); + ui->amountLabel->clear(); + ui->addressLabel->clear(); + ui->txHashLabel->clear(); +} + +void CheckProofDialog::pasteFromClipboard() +{ + ui->proofEdit->setPlainText(QApplication::clipboard()->text()); +} + +void CheckProofDialog::proofChanged() +{ + ui->resultLabel->setText(QString("%1").arg(tr("Unchecked"))); + + clear(); + + const QString proofString = ui->proofEdit->toPlainText(); + const QByteArray proofBytes = proofString.toLatin1(); + + QJsonParseError parseError; + QJsonDocument jsonDocument = QJsonDocument::fromJson(proofBytes, &parseError); + if (parseError.error != QJsonParseError::NoError) + return; + + if (!jsonDocument.isObject()) + return; + const QJsonObject json = jsonDocument.object(); + const RpcApi::Proof proof = RpcApi::Proof::fromJson(json.toVariantMap()); + + ui->messageLabel->setText(proof.message); + ui->amountLabel->setText(formatAmount(proof.amount) + " BCN"); + ui->addressLabel->setText(proof.address); + ui->txHashLabel->setText(proof.transaction_hash); +} + +void CheckProofDialog::checkProof() +{ + emit checkProofSignal(ui->proofEdit->toPlainText()); +} + +void CheckProofDialog::showCheckResult(const QString& result) +{ + if (result.isEmpty()) + ui->resultLabel->setText(QString("%1").arg(tr("The proof is correct!"))); + else + ui->resultLabel->setText(QString("%1").arg(result)); +} + +} diff --git a/src/checkproofdialog.h b/src/checkproofdialog.h new file mode 100644 index 0000000..26e3593 --- /dev/null +++ b/src/checkproofdialog.h @@ -0,0 +1,44 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + +#ifndef CHECKPROOFDIALOG_H +#define CHECKPROOFDIALOG_H + +#include + +namespace Ui { +class CheckProofDialog; +} + +namespace WalletGUI +{ + +class CheckProofDialog : public QDialog +{ + Q_OBJECT + +public: + explicit CheckProofDialog(QWidget *parent = 0); + ~CheckProofDialog(); + +public slots: + void showCheckResult(const QString& result); + +signals: + void checkProofSignal(const QString& proof); + +private: + Ui::CheckProofDialog *ui; + + void clear(); + +private slots: + void pasteFromClipboard(); + void proofChanged(); + void checkProof(); + +}; + +} + +#endif // CHECKPROOFDIALOG_H diff --git a/src/checkproofdialog.ui b/src/checkproofdialog.ui new file mode 100644 index 0000000..a9d4bd3 --- /dev/null +++ b/src/checkproofdialog.ui @@ -0,0 +1,262 @@ + + + CheckProofDialog + + + + 0 + 0 + 400 + 292 + + + + + 0 + 0 + + + + Check proof + + + + + + Proof: + + + + + + + + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + Result of checking: + + + + + + + + 0 + 0 + + + + IBeamCursor + + + Unchecked + + + false + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + Tx hash: + + + + + + + Message: + + + + + + + To address: + + + + + + + Amount: + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + + + + + Check + + + true + + + + + + + Paste from clipboard + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + false + + + + + + + + + + + closeButton + clicked() + CheckProofDialog + reject() + + + 349 + 222 + + + 199 + 122 + + + + + copyButton + clicked() + CheckProofDialog + pasteFromClipboard() + + + 77 + 222 + + + 199 + 122 + + + + + proofEdit + textChanged() + CheckProofDialog + proofChanged() + + + 199 + 105 + + + 199 + 122 + + + + + checkButton + clicked() + CheckProofDialog + checkProof() + + + 49 + 222 + + + 199 + 122 + + + + + + pasteFromClipboard() + proofChanged() + checkProof() + + diff --git a/src/common.cpp b/src/common.cpp index c8d41b4..95bc618 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include diff --git a/src/common.h b/src/common.h index 90c05ab..3eac5ba 100644 --- a/src/common.h +++ b/src/common.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef COMMON_H #define COMMON_H diff --git a/src/connectionoptionsframe.cpp b/src/connectionoptionsframe.cpp index 1566863..d6bc496 100644 --- a/src/connectionoptionsframe.cpp +++ b/src/connectionoptionsframe.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -30,21 +16,21 @@ namespace WalletGUI { namespace { -const char CONNECTION_OPTIONS_STYLE_SHEET_TEMPLATE[] = - "WalletGui--ConnectionOptionsFrame {" - "background: #ffffff;" - "}" - - "WalletGui--ConnectionOptionsFrame QRadioButton {" - "spacing: 20px;" - "}" - - "WalletGui--ConnectionOptionsFrame QRadioButton," - "WalletGui--ConnectionOptionsFrame QLineEdit," - "WalletGui--ConnectionOptionsFrame QSpinBox {" - "min-height: 25px;" - "max-height: 25px;" - "}"; +//const char CONNECTION_OPTIONS_STYLE_SHEET_TEMPLATE[] = +// "WalletGui--ConnectionOptionsFrame {" +// "background: #ffffff;" +// "}" + +// "WalletGui--ConnectionOptionsFrame QRadioButton {" +// "spacing: 20px;" +// "}" + +// "WalletGui--ConnectionOptionsFrame QRadioButton," +// "WalletGui--ConnectionOptionsFrame QLineEdit," +// "WalletGui--ConnectionOptionsFrame QSpinBox {" +// "min-height: 25px;" +// "max-height: 25px;" +// "}"; //const char VALIDATION_LABEL_STYLE_SHEET[] = // "WalletGUI--ConnectionOptionsFrame QLabel" diff --git a/src/connectionoptionsframe.h b/src/connectionoptionsframe.h index f1423f0..ee29590 100644 --- a/src/connectionoptionsframe.h +++ b/src/connectionoptionsframe.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/connectionoptionsframe.ui b/src/connectionoptionsframe.ui index 5d049b2..4ec7c14 100644 --- a/src/connectionoptionsframe.ui +++ b/src/connectionoptionsframe.ui @@ -143,7 +143,7 @@ - Wallet will connect to Bytecoin node in the local or global network. Please specify IP address or domain name and the port. + <html><head/><body><p>Wallet GUI will connect to Wallet daemon (walletd) in the local or global network. Please specify IP address or domain name and the port.</p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop diff --git a/src/connectselectiondialog.cpp b/src/connectselectiondialog.cpp index 9fba4e5..1a9b99b 100644 --- a/src/connectselectiondialog.cpp +++ b/src/connectselectiondialog.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include "connectselectiondialog.h" diff --git a/src/connectselectiondialog.h b/src/connectselectiondialog.h index 100c25e..4dba49f 100644 --- a/src/connectselectiondialog.h +++ b/src/connectselectiondialog.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef CONNECTSELECTIONDIALOG_H #define CONNECTSELECTIONDIALOG_H diff --git a/src/crashdialog.cpp b/src/crashdialog.cpp index 8f39211..f90dc67 100644 --- a/src/crashdialog.cpp +++ b/src/crashdialog.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include "crashdialog.h" #include "ui_crashdialog.h" #include "mainwindow.h" diff --git a/src/crashdialog.h b/src/crashdialog.h index a501ab7..b5728d5 100644 --- a/src/crashdialog.h +++ b/src/crashdialog.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef WALLETGUI_CRASHDIALOG_H #define WALLETGUI_CRASHDIALOG_H diff --git a/src/createproofdialog.cpp b/src/createproofdialog.cpp new file mode 100644 index 0000000..285d3bb --- /dev/null +++ b/src/createproofdialog.cpp @@ -0,0 +1,114 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + +#include +#include +#include + +#include "createproofdialog.h" +#include "ui_createproofdialog.h" + +namespace WalletGUI +{ + +CreateProofDialog::CreateProofDialog(const QString& txHash, QWidget *parent) + : QDialog(parent) + , ui(new Ui::CreateProofDialog) + , txHash_(txHash) +{ + ui->setupUi(this); + showElements(false); + adjustSize(); +// ui->verticalLayout->update(); +} + +CreateProofDialog::~CreateProofDialog() +{ + delete ui; +} + +void CreateProofDialog::showElements(bool show) +{ + ui->addressLabel->setVisible(show); + ui->addressesBox->setVisible(show); + ui->proofLabel->setVisible(show); + ui->proofEdit->setVisible(show); + ui->copyButton->setVisible(show); +} + +QString CreateProofDialog::extractAddress(const QString& proof) +{ + static constexpr char ADDRESS_KEY[] = "address"; + + QJsonParseError parseError; + QJsonDocument jsonDocument = QJsonDocument::fromJson(proof.toLatin1(), &parseError); + if (parseError.error != QJsonParseError::NoError) + { + ui->proofEdit->setTextColor(Qt::red); + ui->proofEdit->setText(parseError.errorString()); + return QString{}; + } + + if (!jsonDocument.isObject()) + { + ui->proofEdit->setTextColor(Qt::red); + ui->proofEdit->setText(tr("JSON document is not an object.")); + return QString{}; + } + const QJsonObject json = jsonDocument.object(); + const bool containsAddress = json.contains(ADDRESS_KEY); + if (!containsAddress) + { + ui->proofEdit->setTextColor(Qt::red); + ui->proofEdit->setText(tr("The proof does not contain any address.")); + return QString{}; + } + return json[ADDRESS_KEY].toString(); +} + +void CreateProofDialog::addProofs(const QStringList& proofs) +{ + ui->proofEdit->clear(); + ui->addressesBox->clear(); + proofs_.clear(); + showElements(true); + + if (proofs.isEmpty()) + { + ui->proofEdit->setTextColor(Qt::red); + ui->proofEdit->setText(tr("No proofs were generated.")); + return; + } + + for (int i = 0; i < proofs.size(); ++i) + { + const QString address = extractAddress(proofs[i]); + if (address.isEmpty()) + continue; + proofs_.insert(i, proofs[i]); + ui->addressesBox->addItem(address); + } +// ui->proofEdit->setText(proof); +} + +void CreateProofDialog::generateProof() +{ + emit generateProofSignal(txHash_, ui->messageEdit->text()); +} + +void CreateProofDialog::copyToClipboard() +{ + QApplication::clipboard()->setText(ui->proofEdit->toPlainText()); +} + +void CreateProofDialog::addressChanged(int index) +{ + ui->proofEdit->setText(proofs_[index]); +} + +void CreateProofDialog::currentAddressChanged() +{ + ui->proofEdit->setText(proofs_[ui->addressesBox->currentIndex()]); +} + +} diff --git a/src/createproofdialog.h b/src/createproofdialog.h new file mode 100644 index 0000000..d1a40a3 --- /dev/null +++ b/src/createproofdialog.h @@ -0,0 +1,48 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + +#ifndef CREATEPROOFDIALOG_H +#define CREATEPROOFDIALOG_H + +#include +#include + +namespace Ui { +class CreateProofDialog; +} + +namespace WalletGUI +{ + +class CreateProofDialog : public QDialog +{ + Q_OBJECT + +public: + explicit CreateProofDialog(const QString& txHash, QWidget *parent = 0); + ~CreateProofDialog(); + +public slots: + void addProofs(const QStringList& proofs); + void copyToClipboard(); + void addressChanged(int index); + void currentAddressChanged(); + +signals: + void generateProofSignal(const QString& txHash, const QString& message); + +private slots: + void generateProof(); + +private: + Ui::CreateProofDialog *ui; + QString txHash_; + QMap proofs_; + + QString extractAddress(const QString& proof); + void showElements(bool show); +}; + +} + +#endif // CREATEPROOFDIALOG_H diff --git a/src/createproofdialog.ui b/src/createproofdialog.ui new file mode 100644 index 0000000..41bcebf --- /dev/null +++ b/src/createproofdialog.ui @@ -0,0 +1,240 @@ + + + CreateProofDialog + + + + 0 + 0 + 450 + 286 + + + + + 0 + 0 + + + + + 450 + 0 + + + + Create proof + + + + + + + 0 + 0 + + + + User message: + + + + + + + + 0 + 0 + + + + Entered message will be embedded to proof + + + + + + + Address: + + + + + + + true + + + + + + + Proof: + + + + + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + Generate + + + true + + + true + + + + + + + Copy to clipboard + + + false + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + Close + + + false + + + + + + + + + + + cancelButton + clicked() + CreateProofDialog + reject() + + + 49 + 236 + + + 196 + 132 + + + + + copyButton + clicked() + CreateProofDialog + copyToClipboard() + + + 239 + 236 + + + 196 + 132 + + + + + generateButton + clicked() + CreateProofDialog + generateProof() + + + 343 + 236 + + + 196 + 132 + + + + + addressesBox + activated(int) + CreateProofDialog + addressChanged(int) + + + 196 + 107 + + + 196 + 132 + + + + + addressesBox + currentTextChanged(QString) + CreateProofDialog + currentAddressChanged() + + + 196 + 107 + + + 196 + 132 + + + + + + generateProof() + copyToClipboard() + addressChanged(int) + currentAddressChanged() + + diff --git a/src/importkeydialog.cpp b/src/importkeydialog.cpp index 6211899..efd64a8 100644 --- a/src/importkeydialog.cpp +++ b/src/importkeydialog.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include "importkeydialog.h" diff --git a/src/importkeydialog.h b/src/importkeydialog.h index 4593886..f1bb7d5 100644 --- a/src/importkeydialog.h +++ b/src/importkeydialog.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef IMPORTKEYDIALOG_H #define IMPORTKEYDIALOG_H diff --git a/src/logframe.cpp b/src/logframe.cpp index 47fa88a..29322f1 100644 --- a/src/logframe.cpp +++ b/src/logframe.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include "logframe.h" #include "ui_logframe.h" diff --git a/src/logframe.h b/src/logframe.h index cf1a36f..3ab0867 100644 --- a/src/logframe.h +++ b/src/logframe.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef LOGFRAME_H #define LOGFRAME_H diff --git a/src/logframe.ui b/src/logframe.ui index 696ebdd..4e12187 100644 --- a/src/logframe.ui +++ b/src/logframe.ui @@ -20,6 +20,18 @@ QFrame::Raised + + 0 + + + 0 + + + 0 + + + 10 + @@ -32,6 +44,18 @@ + + 6 + + + 0 + + + 6 + + + 0 + diff --git a/src/logger.cpp b/src/logger.cpp index 3edc781..596e0e5 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -159,7 +145,7 @@ void WalletLogger::messageHandler(QtMsgType type, const QMessageLogContext& cont void WalletLogger::debugImpl(const QString& message) { - qCDebug(Wallet) << qPrintable(message); + qCDebug(Wallet, "%s", qPrintable(message)); } void WalletLogger::infoImpl(const QString& message) @@ -173,12 +159,12 @@ void WalletLogger::infoImpl(const QString& message) void WalletLogger::warningImpl(const QString& message) { - qCWarning(Wallet) << qPrintable(message); + qCWarning(Wallet, "%s", qPrintable(message)); } void WalletLogger::criticalImpl(const QString& message) { - qCCritical(Wallet) << qPrintable(message); + qCCritical(Wallet, "%s", qPrintable(message)); } } diff --git a/src/logger.h b/src/logger.h index 25b3ca7..ce6f022 100644 --- a/src/logger.h +++ b/src/logger.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/main.cpp b/src/main.cpp index 0fa2485..a0e1035 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include #include "mainwindow.h" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 96c4dd2..47a353d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include @@ -55,7 +41,7 @@ namespace WalletGUI { namespace { -const int MAX_RECENT_WALLET_COUNT = 10; +//const int MAX_RECENT_WALLET_COUNT = 10; //const char COMMUNITY_FORUM_URL[] = "https://bytecointalk.org"; const char COMMUNITY_FORUM_URL[] = "https://bytecoin.org"; const char REPORT_ISSUE_URL[] = "https://bytecoin.org/contact"; @@ -369,6 +355,7 @@ void MainWindow::setConnectedState() m_ui->m_miningButton->setEnabled(true); m_ui->m_overviewButton->setEnabled(true); m_ui->m_addressBookButton->setEnabled(true); + m_ui->m_checkProofAction->setEnabled(true); if (m_ui->m_logFrame->isVisible()) m_ui->m_overviewButton->click(); @@ -395,6 +382,7 @@ void MainWindow::setDisconnectedState() m_miningManager->stopMining(); m_ui->m_changePasswordAction->setEnabled(false); + m_ui->m_checkProofAction->setEnabled(false); clearTitle(); #ifdef Q_OS_MAC @@ -411,7 +399,7 @@ void MainWindow::jsonErrorResponse(const QString& /*id*/, const QString& errorSt { QMessageBox msg(this); msg.setIcon(QMessageBox::Critical); - msg.setWindowTitle(tr("Error.")); + msg.setWindowTitle(tr("Error")); msg.setText(errorString); msg.exec(); @@ -439,4 +427,19 @@ void MainWindow::packetReceived(const QByteArray& data) m_ui->m_logFrame->addNetworkMessage(QString("<-- ") + QString::fromUtf8(data) + '\n'); } +void MainWindow::createProof(const QString& txHash) +{ + emit createProofSignal(txHash); +} + +void MainWindow::checkProof() +{ + emit checkProofSignal(); +} + +void MainWindow::showWalletdParams() +{ + emit showWalletdParamsSignal(); +} + } diff --git a/src/mainwindow.h b/src/mainwindow.h index 4e05aeb..dcb933d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once @@ -121,9 +107,16 @@ class MainWindow : public QMainWindow Q_SLOT void remoteWallet(); Q_SLOT void encryptWallet(); + Q_SLOT void createProof(const QString& txHash); + Q_SLOT void checkProof(); + Q_SLOT void showWalletdParams(); + signals: void createTxSignal(const RpcApi::CreateTransaction::Request& req, QPrivateSignal); void sendTxSignal(const RpcApi::SendTransaction::Request& req, QPrivateSignal); + void createProofSignal(const QString& txHash); + void checkProofSignal(); + void showWalletdParamsSignal(); void restartDaemon(QPrivateSignal); void createWalletSignal(QWidget* parent); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 1584b1c..3e37bde 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -189,7 +189,7 @@ - + @@ -661,7 +661,7 @@ 0 0 1273 - 23 + 19 @@ -673,7 +673,6 @@ - @@ -685,7 +684,16 @@ + + + &Tools + + + + + + @@ -740,7 +748,7 @@ true - Connect to &remote daemon + Connect to &remote wallet daemon @@ -760,12 +768,22 @@ - Open data &folder + Open default data &folder - Create wallet from keys + Create wallet from &keys + + + + + &Check send proof + + + + + Wallet daemon &parameters @@ -777,6 +795,7 @@ 1 copiedToClipboardSignal() + createProofSignal(QString) @@ -1058,6 +1077,54 @@ + + m_overviewFrame + createProofSignal(QString) + MainWindow + createProof(QString) + + + 318 + 456 + + + 636 + 411 + + + + + m_checkProofAction + triggered() + MainWindow + checkProof() + + + -1 + -1 + + + 636 + 411 + + + + + m_paramsAction + triggered() + MainWindow + showWalletdParams() + + + -1 + -1 + + + 636 + 411 + + + aboutQt() @@ -1076,6 +1143,9 @@ copiedToClipboard() openDataFolder() importKeys() + createProof(QString) + checkProof() + showWalletdParams() diff --git a/src/miningoverviewframe.cpp b/src/miningoverviewframe.cpp index bb0e611..b4dc972 100644 --- a/src/miningoverviewframe.cpp +++ b/src/miningoverviewframe.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include "miningoverviewframe.h" diff --git a/src/miningoverviewframe.h b/src/miningoverviewframe.h index 7f58077..3830384 100644 --- a/src/miningoverviewframe.h +++ b/src/miningoverviewframe.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef MININGOVERVIEWFRAME_H #define MININGOVERVIEWFRAME_H diff --git a/src/newaddressdialog.cpp b/src/newaddressdialog.cpp index e317209..45febe3 100644 --- a/src/newaddressdialog.cpp +++ b/src/newaddressdialog.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include "newaddressdialog.h" #include "addressbookmodel.h" diff --git a/src/newaddressdialog.h b/src/newaddressdialog.h index 3c687fd..303e8a3 100644 --- a/src/newaddressdialog.h +++ b/src/newaddressdialog.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/okbutton.cpp b/src/okbutton.cpp index bc7438b..df4441b 100644 --- a/src/okbutton.cpp +++ b/src/okbutton.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include "okbutton.h" @@ -21,36 +7,36 @@ namespace WalletGUI { namespace { -const char WALLET_OK_BUTTON_STYLE_SHEET_TEMPLATE[] = - "* {" - "font-family: %fontFamily%;" - "}" - - "WalletGui--WalletOkButton {" - "min-width: 80px;" - "max-width: 80px;" - "min-height: 30px;" - "max-height: 30px;" - "font-size: %fontSizeNormal%;" - "color: #ffffff;" - "background-color: %backgroundColorBlueNormal%;" - "border: 1px solid %backgroundColorBlueNormal%;" - "}" - - "WalletGui--WalletOkButton:disabled {" - "background-color: %backgroundColorBlueDisabled%;" - "border: 1px solid %backgroundColorBlueDisabled%;" - "}" - - "WalletGui--WalletOkButton:hover {" - "background-color: %backgroundColorBlueHover%;" - "border: 1px solid %backgroundColorBlueHover%;" - "}" - - "WalletGui--WalletOkButton:pressed {" - "background-color: %backgroundColorBluePressed%;" - "border: 1px solid %backgroundColorBluePressed%;" - "}"; +//const char WALLET_OK_BUTTON_STYLE_SHEET_TEMPLATE[] = +// "* {" +// "font-family: %fontFamily%;" +// "}" + +// "WalletGui--WalletOkButton {" +// "min-width: 80px;" +// "max-width: 80px;" +// "min-height: 30px;" +// "max-height: 30px;" +// "font-size: %fontSizeNormal%;" +// "color: #ffffff;" +// "background-color: %backgroundColorBlueNormal%;" +// "border: 1px solid %backgroundColorBlueNormal%;" +// "}" + +// "WalletGui--WalletOkButton:disabled {" +// "background-color: %backgroundColorBlueDisabled%;" +// "border: 1px solid %backgroundColorBlueDisabled%;" +// "}" + +// "WalletGui--WalletOkButton:hover {" +// "background-color: %backgroundColorBlueHover%;" +// "border: 1px solid %backgroundColorBlueHover%;" +// "}" + +// "WalletGui--WalletOkButton:pressed {" +// "background-color: %backgroundColorBluePressed%;" +// "border: 1px solid %backgroundColorBluePressed%;" +// "}"; } diff --git a/src/okbutton.h b/src/okbutton.h index 4bd9c61..3697c5e 100644 --- a/src/okbutton.h +++ b/src/okbutton.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/overviewframe.cpp b/src/overviewframe.cpp index 26a8b14..e7fc6f0 100644 --- a/src/overviewframe.cpp +++ b/src/overviewframe.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -29,27 +15,27 @@ namespace WalletGUI { namespace { -const char OVERVIEW_STYLE_SHEET_TEMPLATE[] = - "* {" - "font-family: %fontFamily%;" - "}" +//const char OVERVIEW_STYLE_SHEET_TEMPLATE[] = +// "* {" +// "font-family: %fontFamily%;" +// "}" - "WalletGui--OverviewFrame {" - "background-color: #ffffff;" - "border: none;" - "}" +// "WalletGui--OverviewFrame {" +// "background-color: #ffffff;" +// "border: none;" +// "}" - "WalletGui--OverviewFrame #m_allTransactionsButton {" - "margin-top: 2px;" - "}" +// "WalletGui--OverviewFrame #m_allTransactionsButton {" +// "margin-top: 2px;" +// "}" - "WalletGui--OverviewFrame #m_newsFrame {" - "min-height: 130px;" - "max-height: 130px;" - "border: none;" - "border-top: 1px solid %borderColor%;" - "background-color: %backgroundColorGray%;" - "}"; +// "WalletGui--OverviewFrame #m_newsFrame {" +// "min-height: 130px;" +// "max-height: 130px;" +// "border: none;" +// "border-top: 1px solid %borderColor%;" +// "background-color: %backgroundColorGray%;" +// "}"; } @@ -79,19 +65,22 @@ void OverviewFrame::setTransactionsModel(QAbstractItemModel* model) { WalletModel::COLUMN_BLOCK_HEIGHT, 3 }, { WalletModel::COLUMN_BLOCK_HASH, 4 }, { WalletModel::COLUMN_TIMESTAMP, 5 }, - { WalletModel::COLUMN_UNLOCK_TIME, 6 }}; + { WalletModel::COLUMN_UNLOCK_TIME, 6 }, + { WalletModel::COLUMN_PROOF, 7}}; m_transactionsModel = model; m_ui->m_recentTransactionsView->setModel(m_transactionsModel); QHeaderView& header = *m_ui->m_recentTransactionsView->horizontalHeader(); + header.setResizeContentsPrecision(-1); header.moveSection(header.visualIndex(WalletModel::COLUMN_AMOUNT), indices[WalletModel::COLUMN_AMOUNT]); header.moveSection(header.visualIndex(WalletModel::COLUMN_FEE), indices[WalletModel::COLUMN_FEE]); header.moveSection(header.visualIndex(WalletModel::COLUMN_BLOCK_HEIGHT), indices[WalletModel::COLUMN_BLOCK_HEIGHT]); - header.moveSection(header.visualIndex(WalletModel::COLUMN_TIMESTAMP), indices[WalletModel::COLUMN_TIMESTAMP]); header.moveSection(header.visualIndex(WalletModel::COLUMN_HASH), indices[WalletModel::COLUMN_HASH]); header.moveSection(header.visualIndex(WalletModel::COLUMN_BLOCK_HASH), indices[WalletModel::COLUMN_BLOCK_HASH]); header.moveSection(header.visualIndex(WalletModel::COLUMN_UNLOCK_TIME), indices[WalletModel::COLUMN_UNLOCK_TIME]); + header.moveSection(header.visualIndex(WalletModel::COLUMN_PROOF), indices[WalletModel::COLUMN_PROOF]); + header.moveSection(header.visualIndex(WalletModel::COLUMN_TIMESTAMP), indices[WalletModel::COLUMN_TIMESTAMP]); const int columns = m_transactionsModel->columnCount(); // hide all columns @@ -106,6 +95,7 @@ void OverviewFrame::setTransactionsModel(QAbstractItemModel* model) m_ui->m_recentTransactionsView->setColumnHidden(WalletModel::COLUMN_BLOCK_HASH, false); m_ui->m_recentTransactionsView->setColumnHidden(WalletModel::COLUMN_TIMESTAMP, false); m_ui->m_recentTransactionsView->setColumnHidden(WalletModel::COLUMN_UNLOCK_TIME, false); + m_ui->m_recentTransactionsView->setColumnHidden(WalletModel::COLUMN_PROOF, false); header.setSectionResizeMode(WalletModel::COLUMN_AMOUNT, QHeaderView::ResizeToContents); header.setSectionResizeMode(WalletModel::COLUMN_FEE, QHeaderView::ResizeToContents); @@ -114,6 +104,7 @@ void OverviewFrame::setTransactionsModel(QAbstractItemModel* model) header.setSectionResizeMode(WalletModel::COLUMN_BLOCK_HASH, QHeaderView::Stretch); header.setSectionResizeMode(WalletModel::COLUMN_TIMESTAMP, QHeaderView::ResizeToContents); header.setSectionResizeMode(WalletModel::COLUMN_UNLOCK_TIME, QHeaderView::ResizeToContents); + header.setSectionResizeMode(WalletModel::COLUMN_PROOF, QHeaderView::ResizeToContents); // header.setSectionResizeMode(WalletModel::COLUMN_AMOUNT, QHeaderView::Fixed); // header.setSectionResizeMode(WalletModel::COLUMN_FEE, QHeaderView::Fixed); @@ -145,6 +136,7 @@ void OverviewFrame::setMinerModel(QAbstractItemModel* model) void OverviewFrame::rowsInserted(const QModelIndex& /*parent*/, int /*first*/, int /*last*/) { +// m_ui->m_recentTransactionsView->resizeColumnsToContents(); } void OverviewFrame::setMainWindow(QWidget* mainWindow) @@ -174,25 +166,38 @@ bool OverviewFrame::eventFilter(QObject* object, QEvent* event) QMouseEvent* e = (QMouseEvent*)event; QModelIndex modelIndex = view->indexAt(e->pos()); - const bool valid = - modelIndex.isValid() && - (modelIndex.column() == WalletModel::COLUMN_HASH || - modelIndex.column() == WalletModel::COLUMN_BLOCK_HASH); + if (!modelIndex.isValid()) + return false; + const bool copyableColumns = + modelIndex.column() == WalletModel::COLUMN_HASH || + (modelIndex.column() == WalletModel::COLUMN_BLOCK_HASH && !m_transactionsModel->data(modelIndex, WalletModel::ROLE_BLOCK_HASH).toString().isEmpty()); + const bool proofColumn = (modelIndex.column() == WalletModel::COLUMN_PROOF && m_transactionsModel->data(modelIndex, WalletModel::ROLE_PROOF).toBool()); + const bool valid = copyableColumns || proofColumn; if(!valid) return false; - QApplication::clipboard()->setText(m_transactionsModel->data(modelIndex).toString()); - emit copiedToClipboardSignal(); + if (copyableColumns) + { + QApplication::clipboard()->setText(m_transactionsModel->data(modelIndex).toString()); + emit copiedToClipboardSignal(); + } + if (proofColumn) + { + const QString txHash = m_transactionsModel->data(modelIndex, WalletModel::ROLE_HASH).toString(); + emit createProofSignal(txHash); + } } else if (event->type() == QEvent::MouseMove) { QMouseEvent* e = (QMouseEvent*)event; QModelIndex modelIndex = view->indexAt(e->pos()); - if(modelIndex.column() != WalletModel::COLUMN_HASH && modelIndex.column() != WalletModel::COLUMN_BLOCK_HASH) - setCursor(Qt::ArrowCursor); - else - setCursor(Qt::PointingHandCursor); + const bool showHandCursor = + modelIndex.column() == WalletModel::COLUMN_HASH || + (modelIndex.column() == WalletModel::COLUMN_BLOCK_HASH && !m_transactionsModel->data(modelIndex, WalletModel::ROLE_BLOCK_HASH).toString().isEmpty()) || + (modelIndex.column() == WalletModel::COLUMN_PROOF && m_transactionsModel->data(modelIndex, WalletModel::ROLE_PROOF).toBool()); + + setCursor(showHandCursor ? Qt::PointingHandCursor : Qt::ArrowCursor); } else if (event->type() == QEvent::Leave) setCursor(Qt::ArrowCursor); diff --git a/src/overviewframe.h b/src/overviewframe.h index 7bb88f2..58eccfa 100644 --- a/src/overviewframe.h +++ b/src/overviewframe.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once @@ -48,6 +34,7 @@ class OverviewFrame : public QFrame signals: void copiedToClipboardSignal(); + void createProofSignal(const QString& txHash); private: QScopedPointer m_ui; diff --git a/src/overviewframe.ui b/src/overviewframe.ui index 4994351..3f3a65a 100644 --- a/src/overviewframe.ui +++ b/src/overviewframe.ui @@ -104,22 +104,6 @@ 0 - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 25 - 20 - - - - @@ -169,22 +153,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 25 - 20 - - - - diff --git a/src/popup.cpp b/src/popup.cpp index 1ce2cf9..a7343a6 100644 --- a/src/popup.cpp +++ b/src/popup.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include "popup.h" #include diff --git a/src/popup.h b/src/popup.h index 77872f2..a4373bb 100644 --- a/src/popup.h +++ b/src/popup.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef POPUP_H #define POPUP_H diff --git a/src/progressbar.cpp b/src/progressbar.cpp index 92a87cb..118d5c1 100644 --- a/src/progressbar.cpp +++ b/src/progressbar.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include "progressbar.h" #include "walletmodel.h" diff --git a/src/progressbar.h b/src/progressbar.h index 3250fbe..5be8479 100644 --- a/src/progressbar.h +++ b/src/progressbar.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef PROGRESSBAR #define PROGRESSBAR diff --git a/src/questiondialog.cpp b/src/questiondialog.cpp index 02310cc..e57199d 100644 --- a/src/questiondialog.cpp +++ b/src/questiondialog.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include "questiondialog.h" diff --git a/src/questiondialog.h b/src/questiondialog.h index 5789e3e..00f5c58 100644 --- a/src/questiondialog.h +++ b/src/questiondialog.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/resizablescrollarea.cpp b/src/resizablescrollarea.cpp index c0f8623..77e2f8d 100644 --- a/src/resizablescrollarea.cpp +++ b/src/resizablescrollarea.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include "resizablescrollarea.h" diff --git a/src/resizablescrollarea.h b/src/resizablescrollarea.h index a3a9f18..29ddc74 100644 --- a/src/resizablescrollarea.h +++ b/src/resizablescrollarea.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/rpcapi.cpp b/src/rpcapi.cpp index 6e9a7dd..49e0fa3 100644 --- a/src/rpcapi.cpp +++ b/src/rpcapi.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include "rpcapi.h" @@ -14,6 +17,8 @@ constexpr char GetBalance::METHOD[]; constexpr char GetUnspents::METHOD[]; constexpr char CreateTransaction::METHOD[]; constexpr char SendTransaction::METHOD[]; +constexpr char CreateSendProof::METHOD[]; +constexpr char CheckSendProof::METHOD[]; #define RPCAPI_SERIALIZE_FIELD(obj, json, fieldName) \ do \ @@ -113,6 +118,7 @@ GetStatus::Response::fromJson(const QVariantMap& json) RPCAPI_DESERIALIZE_FIELD(value, json, transaction_pool_version); RPCAPI_DESERIALIZE_FIELD(value, json, outgoing_peer_count); RPCAPI_DESERIALIZE_FIELD(value, json, incoming_peer_count); + RPCAPI_DESERIALIZE_FIELD(value, json, lower_level_error); RPCAPI_DESERIALIZE_FIELD(value, json, top_block_height); RPCAPI_DESERIALIZE_FIELD(value, json, top_block_difficulty); @@ -136,6 +142,7 @@ GetStatus::Request::toJson() const RPCAPI_SERIALIZE_FIELD(value, json, transaction_pool_version); RPCAPI_SERIALIZE_FIELD(value, json, outgoing_peer_count); RPCAPI_SERIALIZE_FIELD(value, json, incoming_peer_count); + RPCAPI_SERIALIZE_FIELD(value, json, lower_level_error); return json; } @@ -434,6 +441,68 @@ Transaction::toJson() const return json; } +/*static*/ +Proof +Proof::fromJson(const QVariantMap& json) +{ + Proof value; + + RPCAPI_DESERIALIZE_FIELD(value, json, message); + RPCAPI_DESERIALIZE_FIELD(value, json, address); + RPCAPI_DESERIALIZE_FIELD(value, json, amount); + RPCAPI_DESERIALIZE_FIELD(value, json, transaction_hash); + RPCAPI_DESERIALIZE_FIELD(value, json, proof); + + return value; +} + + +/*static*/ +CreateSendProof::Response +CreateSendProof::Response::fromJson(const QVariantMap& json) +{ + CreateSendProof::Response value; + + RPCAPI_DESERIALIZE_FIELD(value, json, send_proofs); + + return value; +} + +QVariantMap +CreateSendProof::Request::toJson() const +{ + const CreateSendProof::Request& value = *this; + QVariantMap json; + + RPCAPI_SERIALIZE_FIELD(value, json, transaction_hash); + RPCAPI_SERIALIZE_FIELD(value, json, message); + RPCAPI_SERIALIZE_FIELD(value, json, addresses); + + return json; +} + +/*static*/ +CheckSendProof::Response +CheckSendProof::Response::fromJson(const QVariantMap& json) +{ + CheckSendProof::Response value; + + RPCAPI_DESERIALIZE_FIELD(value, json, validation_error); + + return value; +} + +QVariantMap +CheckSendProof::Request::toJson() const +{ + const CheckSendProof::Request& value = *this; + QVariantMap json; + + RPCAPI_SERIALIZE_FIELD(value, json, send_proof); + + return json; +} + #undef RPCAPI_SERIALIZE_FIELD #undef RPCAPI_SERIALIZE_TIMESTAMP #undef RPCAPI_SERIALIZE_STRUCT diff --git a/src/rpcapi.h b/src/rpcapi.h index 6a67c06..caa2d5f 100644 --- a/src/rpcapi.h +++ b/src/rpcapi.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef RPCAPI_H #define RPCAPI_H @@ -186,6 +189,27 @@ struct Block } }; +struct Proof +{ + QString message; + QString address; + Amount amount = 0; + QString transaction_hash; + QString proof; + + static Proof fromJson(const QVariantMap& json); + + auto tie() const + { + return std::tie( + message, + address, + amount, + transaction_hash, + proof); + } +}; + struct GetStatus { static constexpr char METHOD[] = "get_status"; @@ -196,6 +220,7 @@ struct GetStatus quint32 transaction_pool_version = 0; quint32 outgoing_peer_count = 0; quint32 incoming_peer_count = 0; + QString lower_level_error; QVariantMap toJson() const; }; @@ -206,6 +231,7 @@ struct GetStatus quint32 transaction_pool_version = 0; quint32 outgoing_peer_count = 0; quint32 incoming_peer_count = 0; + QString lower_level_error{"Disconnected"}; Height top_block_height = 0; Difficulty top_block_difficulty = 0; @@ -224,6 +250,7 @@ struct GetStatus transaction_pool_version, outgoing_peer_count, incoming_peer_count, + lower_level_error, top_block_height, top_block_difficulty, top_block_timestamp, @@ -389,6 +416,46 @@ struct SendTransaction }; }; +struct CreateSendProof +{ + static constexpr char METHOD[] = "create_send_proof"; + + struct Request + { + QString transaction_hash; + QString message; + QStringList addresses; + + QVariantMap toJson() const; + }; + + struct Response + { + QStringList send_proofs; + + static Response fromJson(const QVariantMap& json); + }; +}; + +struct CheckSendProof +{ + static constexpr char METHOD[] = "check_send_proof"; + + struct Request + { + QString send_proof; + + QVariantMap toJson() const; + }; + + struct Response + { + QString validation_error; + + static Response fromJson(const QVariantMap& json); + }; +}; + using Status = GetStatus::Response; using Transfers = GetTransfers::Response; using Addresses = GetAddresses::Response; @@ -397,6 +464,8 @@ using ViewKey = GetViewKey::Response; using Unspents = GetUnspents::Response; using CreatedTx = CreateTransaction::Response; using SentTx = SendTransaction::Response; +using Proofs = CreateSendProof::Response; +using ProofCheck = CheckSendProof::Response; inline bool operator == (const Status& lhs, const Status& rhs) { return lhs.tie() == rhs.tie(); } diff --git a/src/sendconfirmationdialog.cpp b/src/sendconfirmationdialog.cpp index 54aa412..3563002 100644 --- a/src/sendconfirmationdialog.cpp +++ b/src/sendconfirmationdialog.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include "sendconfirmationdialog.h" diff --git a/src/sendconfirmationdialog.h b/src/sendconfirmationdialog.h index 86b634a..6edb4ac 100644 --- a/src/sendconfirmationdialog.h +++ b/src/sendconfirmationdialog.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef SENDCONFIRMATIONDIALOG #define SENDCONFIRMATIONDIALOG diff --git a/src/sendframe.cpp b/src/sendframe.cpp index 692a25d..4254ab1 100644 --- a/src/sendframe.cpp +++ b/src/sendframe.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -34,38 +20,38 @@ namespace WalletGUI namespace { -const char SEND_FRAME_STYLE_SHEET[] = - "WalletGui--SendFrame {" - "background-color: #ffffff;" - "border: none;" - "}" - - "WalletGui--SendFrame #m_sendScrollarea {" - "background-color: %backgroundColorGray%;" - "border: none;" - "border-bottom: 1px solid %borderColor%;" - "}" - - "WalletGui--SendFrame #m_sendScrollarea QScrollBar:vertical {" - "margin-top: 0px;" - "border-top: none;" - "}" - - "WalletGui--SendFrame #scrollAreaWidgetContents {" - "background-color: #ffffff;" - "border: none;" - "}" - - "WalletGui--SendFrame #m_sendFeeFrame {" - "border: none;" - "border-top: 1px solid %borderColor%;" - "border-bottom: 1px solid %borderColor%;" - "}"; - -const char PAYMENT_URL_AMOUNT_TAG[] = "amount"; -const char PAYMENT_URL_PAYMENT_ID_TAG[] = "payment_id"; -const char PAYMENT_URL_MESSAGE_TAG[] = "message"; -const char PAYMENT_URL_LABEL_TAG[] = "label"; +//const char SEND_FRAME_STYLE_SHEET[] = +// "WalletGui--SendFrame {" +// "background-color: #ffffff;" +// "border: none;" +// "}" + +// "WalletGui--SendFrame #m_sendScrollarea {" +// "background-color: %backgroundColorGray%;" +// "border: none;" +// "border-bottom: 1px solid %borderColor%;" +// "}" + +// "WalletGui--SendFrame #m_sendScrollarea QScrollBar:vertical {" +// "margin-top: 0px;" +// "border-top: none;" +// "}" + +// "WalletGui--SendFrame #scrollAreaWidgetContents {" +// "background-color: #ffffff;" +// "border: none;" +// "}" + +// "WalletGui--SendFrame #m_sendFeeFrame {" +// "border: none;" +// "border-top: 1px solid %borderColor%;" +// "border-bottom: 1px solid %borderColor%;" +// "}"; + +//const char PAYMENT_URL_AMOUNT_TAG[] = "amount"; +//const char PAYMENT_URL_PAYMENT_ID_TAG[] = "payment_id"; +//const char PAYMENT_URL_MESSAGE_TAG[] = "message"; +//const char PAYMENT_URL_LABEL_TAG[] = "label"; const char MIXIN_CRITICAL_COLOR[] = "#ea161f"; const char MIXIN_NORMAL_COLOR[] = "#fdce00"; const char MIXIN_GOOD_COLOR[] = "#6ca025"; diff --git a/src/sendframe.h b/src/sendframe.h index 466cb15..63e6e70 100644 --- a/src/sendframe.h +++ b/src/sendframe.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/sendframe.ui b/src/sendframe.ui index 6b68295..0bc775b 100644 --- a/src/sendframe.ui +++ b/src/sendframe.ui @@ -128,13 +128,13 @@ - 25 + 10 5 - 25 + 10 10 @@ -308,13 +308,13 @@ - 25 + 10 - 11 + 10 - 25 + 10 23 diff --git a/src/settings.cpp b/src/settings.cpp index a012829..5f2dfc9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include #include @@ -22,20 +25,19 @@ constexpr char OPTION_MINING_POOL_SWITCH_STRATEGY[] = "miningPoolSwitchStrategy" constexpr char OPTION_MINING_CPU_CORE_COUNT[] = "miningCpuCoreCount"; constexpr char OPTION_MINING_POOL_LIST[] = "miningPoolList"; constexpr char OPTION_RECENT_WALLETS[] = "recentWallets"; +constexpr char OPTION_WALLETD_PARAMS[] = "walletdParams"; constexpr quint16 DEFAULT_LOCAL_RPC_PORT = 8070; constexpr char LOCAL_HOST[] = "127.0.0.1"; constexpr char VERSION[] = "2.0.0"; -constexpr char VERSION_SUFFIX[] = "beta"; -constexpr char REVISION[] = "20180219"; +constexpr char VERSION_SUFFIX[] = "stable"; +constexpr char REVISION[] = "20180320"; #if defined(Q_OS_LINUX) constexpr char DEFAULT_WORK_DIR[] = ".bytecoin"; #endif -constexpr char DEFAULT_WALLETD_PATH[] = "./walletd"; - const constexpr char* DEFAULT_MINING_POOLS[] = { "pool.bytecoin.party:3333", "bytecoin.uk:3333", "bytecoin-pool.org:3333", "bcn.pool.minergate.com:45550" }; static @@ -157,6 +159,16 @@ QString Settings::getWalletFile() const return settings_->value(OPTION_WALLET_FILE).toString(); } +QStringList Settings::getWalletdParams() const +{ + return settings_->value(OPTION_WALLETD_PARAMS).toString().split(QChar(' '), QString::SkipEmptyParts); +} + + +void Settings::setWalletdParams(const QString& params) +{ + settings_->setValue(OPTION_WALLETD_PARAMS, params); +} void Settings::setLocalRpcPort(quint16 port) { @@ -240,7 +252,6 @@ QDir Settings::getDefaultWorkDir() /*static*/ QString Settings::getDefaultWalletdPath() { -// return DEFAULT_WALLETD_PATH; const QString dir = qApp->applicationDirPath(); #ifdef Q_OS_WIN32 return dir + '/' + "walletd.exe"; diff --git a/src/settings.h b/src/settings.h index fa96874..d3406eb 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef SETTINGS_H #define SETTINGS_H @@ -37,7 +40,6 @@ class Settings : public QObject static QString getVersionSuffix(); static QString getRevision(); - QSettings::Format getFormat() const; quint16 getLocalRpcPort() const; @@ -55,7 +57,9 @@ class Settings : public QObject QStringList getRecentWallets() const; + QStringList getWalletdParams() const; + void setWalletdParams(const QString& params); void setLocalRpcPort(quint16 port); void setRemoteRpcEndPoint(const QString& host, quint16 port); void setConnectionMethod(ConnectionMethod method); diff --git a/src/signalhandler.cpp b/src/signalhandler.cpp index 3da6046..a7f9035 100644 --- a/src/signalhandler.cpp +++ b/src/signalhandler.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include diff --git a/src/signalhandler.h b/src/signalhandler.h index b277f99..a723e94 100644 --- a/src/signalhandler.h +++ b/src/signalhandler.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/statusbar.cpp b/src/statusbar.cpp index d127a50..1118569 100644 --- a/src/statusbar.cpp +++ b/src/statusbar.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -33,7 +19,6 @@ namespace WalletGUI { namespace { const QDateTime EPOCH_DATE_TIME = QDateTime::fromTime_t(0).toUTC(); -const int TEMP_MESSAGE_DURATION = 3000; // msecs const int MSECS_IN_MINUTE = 60 * 1000; const int MSECS_IN_HOUR = 60 * MSECS_IN_MINUTE; @@ -104,16 +89,17 @@ WalletStatusBar::WalletStatusBar(QWidget* parent) , walletModel_(nullptr) , m_syncStatusLabel(new QLabel(this)) , m_syncStatusIconLabel(new QLabel(this)) - , m_encryptionStatusIconLabel(new QLabel(this)) +// , m_encryptionStatusIconLabel(new QLabel(this)) , m_peerCountLabel(new QLabel(this)) , m_walletConnectionLabel(new QLabel(this)) + , m_bytecoindConnectionLabel(new QLabel(this)) , m_syncMovie(new QMovie(this)) , stateMapper_(new QDataWidgetMapper(this)) , isSynchronized_(false) { m_syncStatusLabel->setObjectName("m_syncStatusLabel"); m_syncStatusIconLabel->setObjectName("m_syncStatusIconLabel"); - m_encryptionStatusIconLabel->setObjectName("m_encryptionStatusIconLabel"); +// m_encryptionStatusIconLabel->setObjectName("m_encryptionStatusIconLabel"); m_peerCountLabel->setObjectName("m_peerCountLabel"); m_walletConnectionLabel->setObjectName("m_walletConnectionLabel"); m_syncMovie->setFileName(QString(":icons/light/wallet-sync")); @@ -121,7 +107,8 @@ WalletStatusBar::WalletStatusBar(QWidget* parent) addWidget(m_syncStatusLabel); addPermanentWidget(m_peerCountLabel); addPermanentWidget(m_walletConnectionLabel); - addPermanentWidget(m_encryptionStatusIconLabel); + addPermanentWidget(m_bytecoindConnectionLabel); +// addPermanentWidget(m_encryptionStatusIconLabel); addPermanentWidget(m_syncStatusIconLabel); // setStyleSheet(Settings::instance().getCurrentStyle().makeStyleSheet(STATUS_BAR_STYLE_SHEET_TEMPLATE)); @@ -141,6 +128,7 @@ void WalletStatusBar::setWalletModel(WalletModel* model) stateMapper_->setModel(walletModel_); // clears all previously set mappings stateMapper_->addMapping(m_peerCountLabel, WalletModel::COLUMN_PEER_COUNT_SUM, "text"); stateMapper_->addMapping(m_walletConnectionLabel, WalletModel::COLUMN_STATE, "text"); + stateMapper_->addMapping(m_bytecoindConnectionLabel, WalletModel::COLUMN_LOWER_LEVEL_ERROR, "text"); stateMapper_->toFirst(); connect(walletModel_, &QAbstractItemModel::modelReset, stateMapper_, &QDataWidgetMapper::toFirst); connect(walletModel_, &QAbstractItemModel::dataChanged, this, &WalletStatusBar::nodeStateChanged); @@ -148,8 +136,11 @@ void WalletStatusBar::setWalletModel(WalletModel* model) void WalletStatusBar::nodeStateChanged(const QModelIndex& /*topLeft*/, const QModelIndex& /*bottomRight*/, const QVector& roles) { - if (roles.contains(WalletModel::ROLE_TXPOOL_VERSION) || roles.contains(WalletModel::ROLE_TOP_BLOCK_HASH) || roles.contains(WalletModel::ROLE_PEER_COUNT_SUM)) - updateStatusDescription(); + if (roles.contains(WalletModel::ROLE_TXPOOL_VERSION) || + roles.contains(WalletModel::ROLE_TOP_BLOCK_HASH) || + roles.contains(WalletModel::ROLE_PEER_COUNT_SUM) || + roles.contains(WalletModel::ROLE_LOWER_LEVEL_ERROR)) + updateStatusDescription(); } void WalletStatusBar::updateStatusDescription() @@ -159,6 +150,7 @@ void WalletStatusBar::updateStatusDescription() const quint32 lastBlockHeight = walletModel_->getLastBlockHeight(); const QDateTime lastBlockTimestampReceived = walletModel_->getLastBlockTimestamp(); const quint32 peerCount = walletModel_->getPeerCountSum(); + const QString lowerLevelError = walletModel_->getLowerLevelError(); const QDateTime currentDateTime = QDateTime::currentDateTimeUtc(); const QDateTime lastBlockTimestamp = qMin(lastBlockTimestampReceived, currentDateTime); @@ -169,7 +161,7 @@ void WalletStatusBar::updateStatusDescription() const QString formattedTimeDiff = isThereAnyBlock ? formatTimeDiff(secsSinceLastBlock) : tr("unknown"); const QString blockchainAge = isThereAnyBlock ? tr("%1 ago").arg(formattedTimeDiff) : tr("%1").arg(formattedTimeDiff); - isSynchronized_ = isThereAnyBlock && lastBlockHeight == knownBlockHeight; + isSynchronized_ = lowerLevelError.isEmpty() && isThereAnyBlock && lastBlockHeight == knownBlockHeight; updateSyncState(); QString warningString; @@ -179,13 +171,14 @@ void WalletStatusBar::updateStatusDescription() if (peerCount == 0) warningString.append(tr(" No network connection.")); + const quint32 blocksLeft = knownBlockHeight >= lastBlockHeight ? knownBlockHeight - lastBlockHeight : 0; const QString statusText = isSynchronized_ ? tr("Wallet synchronized. Top block height: %1 / Received: %2 ago.%3") .arg(knownBlockHeight) .arg(formattedTimeDiff) .arg(warningString) : - tr("Synchronization: %1 blocks left (%2)") - .arg(knownBlockHeight - lastBlockHeight) + tr("Synchronization: %1 blocks left (%2).") + .arg(blocksLeft) .arg(blockchainAge); m_syncStatusLabel->setText(statusText); diff --git a/src/statusbar.h b/src/statusbar.h index 864ba52..6edd2be 100644 --- a/src/statusbar.h +++ b/src/statusbar.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once @@ -42,9 +28,10 @@ class WalletStatusBar : public QStatusBar WalletModel* walletModel_; QLabel* m_syncStatusLabel; QLabel* m_syncStatusIconLabel; - QLabel* m_encryptionStatusIconLabel; +// QLabel* m_encryptionStatusIconLabel; QLabel* m_peerCountLabel; QLabel* m_walletConnectionLabel; + QLabel* m_bytecoindConnectionLabel; QMovie* m_syncMovie; QDataWidgetMapper* stateMapper_; bool isSynchronized_; diff --git a/src/transferframe.cpp b/src/transferframe.cpp index 55ff90d..986f789 100644 --- a/src/transferframe.cpp +++ b/src/transferframe.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include #include @@ -36,25 +22,25 @@ namespace WalletGUI { namespace { -const char TRANSFER_FRAME_STYLE_SHEET_TEMPLATE[] = - "WalletGui--TransferFrame {" - "background-color: %backgroundColorGray%;" - "border: none;" - "border-top: 1px solid %borderColor%;" - "}" - - "WalletGui--TransferFrame[hideTopBorder=\"true\"] {" - "border-top: none" - "}" - - "WalletGui--TransferFrame #m_addressBookButton {" - "margin-top: 1px;" - "}" - - "WalletGui--TransferFrame #m_sendAmountSpin {" - "min-width: 230px;" - "max-width: 230px;" - "}"; +//const char TRANSFER_FRAME_STYLE_SHEET_TEMPLATE[] = +// "WalletGui--TransferFrame {" +// "background-color: %backgroundColorGray%;" +// "border: none;" +// "border-top: 1px solid %borderColor%;" +// "}" + +// "WalletGui--TransferFrame[hideTopBorder=\"true\"] {" +// "border-top: none" +// "}" + +// "WalletGui--TransferFrame #m_addressBookButton {" +// "margin-top: 1px;" +// "}" + +// "WalletGui--TransferFrame #m_sendAmountSpin {" +// "min-width: 230px;" +// "max-width: 230px;" +// "}"; } diff --git a/src/transferframe.h b/src/transferframe.h index 036bb50..51b27f5 100644 --- a/src/transferframe.h +++ b/src/transferframe.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once diff --git a/src/walletd.cpp b/src/walletd.cpp index 56793b5..6c432d2 100644 --- a/src/walletd.cpp +++ b/src/walletd.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include #include @@ -124,6 +127,8 @@ RemoteWalletd::RemoteWalletd(const QString& endPoint, QObject* parent) connect(jsonClient_, &JsonRpc::WalletClient::unspentReceived, this, &RemoteWalletd::unspentsReceived); connect(jsonClient_, &JsonRpc::WalletClient::createTxReceived, this, &RemoteWalletd::createTxReceived); connect(jsonClient_, &JsonRpc::WalletClient::sendTxReceived, this, &RemoteWalletd::sendTxReceived); + connect(jsonClient_, &JsonRpc::WalletClient::proofsReceived, this, &RemoteWalletd::proofsReceived); + connect(jsonClient_, &JsonRpc::WalletClient::checkProofReceived, this, &RemoteWalletd::checkProofReceived); connect(jsonClient_, &JsonRpc::WalletClient::networkError, this, &RemoteWalletd::networkError); connect(jsonClient_, &JsonRpc::WalletClient::jsonParsingError, this, &RemoteWalletd::jsonParsingError); @@ -195,7 +200,8 @@ void RemoteWalletd::statusReceived(const RpcApi::Status& status) status.top_block_hash, status.transaction_pool_version, status.outgoing_peer_count, - status.incoming_peer_count}); + status.incoming_peer_count, + status.lower_level_error}); jsonClient_->sendGetBalance(RpcApi::GetBalance::Request{QString{}, -1}); } @@ -256,6 +262,16 @@ void RemoteWalletd::sendTxReceived(const RpcApi::SentTx& tx) emit sendTxReceivedSignal(tx); } +void RemoteWalletd::proofsReceived(const RpcApi::Proofs& proofs) +{ + emit proofsReceivedSignal(proofs); +} + +void RemoteWalletd::checkProofReceived(const RpcApi::ProofCheck& proofCheck) +{ + emit checkProofReceivedSignal(proofCheck); +} + void RemoteWalletd::networkError(const QString& errorString) { if (state_ == State::STOPPED) @@ -334,6 +350,16 @@ void RemoteWalletd::getTransfers(const RpcApi::GetTransfers::Request& req) jsonClient_->sendGetTransfers(req); } +void RemoteWalletd::createProof(const RpcApi::CreateSendProof::Request& req) +{ + jsonClient_->sendCreateProof(req); +} + +void RemoteWalletd::checkSendProof(const RpcApi::CheckSendProof::Request& proof) +{ + jsonClient_->sendCheckProof(proof); +} + void RemoteWalletd::authRequired(QAuthenticator* authenticator) { emit authRequiredSignal(authenticator); @@ -378,9 +404,10 @@ void BuiltinWalletd::run() { QStringList args; args << QString("--wallet-file=%1").arg(pathToWallet_); - args << QString("--walletd-authorization=%1").arg(auth_.getHttpBasicAuth()); +// args << QString("--walletd-authorization=%1").arg(auth_.getHttpBasicAuth()); +// args << QString("--walletd-authorization"); if (createNew_) - args << "--generate-wallet"; + args << "--create-wallet"; const bool importKeys = !keys_.isEmpty(); if (importKeys) @@ -388,19 +415,21 @@ void BuiltinWalletd::run() run(args); - if (createNew_) - emit requestPasswordWithConfirmationSignal(); - else - emit requestPasswordSignal(); +// if (createNew_) +// emit requestPasswordWithConfirmationSignal(); +// else +// emit requestPasswordSignal(); - if (importKeys) - walletd_->write(keys_.toHex() + QString{'\n'}.toUtf8()); +// if (importKeys) +// walletd_->write(keys_.toHex() + QString{'\n'}.toUtf8()); - walletd_->write((password_ + '\n').toUtf8()); - if (createNew_) - walletd_->write((password_ + '\n').toUtf8()); // write confirmation - password_.fill('0', 200); - password_.clear(); +// walletd_->write((password_ + '\n').toUtf8()); +// if (createNew_) +// walletd_->write((password_ + '\n').toUtf8()); // write confirmation +// password_.fill('0', 200); +// password_.clear(); + +// walletd_->write((auth_.getConcatenated() + '\n').toUtf8()); } void BuiltinWalletd::run(const QStringList& args) @@ -426,7 +455,8 @@ void BuiltinWalletd::run(const QStringList& args) }); #endif - walletd_->setArguments(args); + QStringList savedArgs = Settings::instance().getWalletdParams(); + walletd_->setArguments(savedArgs + args); walletd_->start(); qDebug("[Walletd] Waiting for walletd running..."); @@ -484,6 +514,24 @@ void BuiltinWalletd::setPassword(QString&& password) void BuiltinWalletd::daemonStarted() { setState(State::RUNNING); + + if (createNew_) + emit requestPasswordWithConfirmationSignal(); + else + emit requestPasswordSignal(); + + const bool importKeys = !keys_.isEmpty(); + if (importKeys) + walletd_->write(keys_.toHex() + QString{'\n'}.toUtf8()); + + walletd_->write((password_ + '\n').toUtf8()); + if (createNew_) + walletd_->write((password_ + '\n').toUtf8()); // write confirmation + password_.fill('0', 200); + password_.clear(); + + walletd_->write((auth_.getConcatenated() + '\n').toUtf8()); + emit daemonStartedSignal(); } @@ -599,5 +647,10 @@ QString RandomAuth::getHttpBasicAuth() const return QString::fromLatin1(concatenated.toLocal8Bit().toBase64()); } +QString RandomAuth::getConcatenated() const +{ + return user_ + ":" + pass_; +} + } diff --git a/src/walletd.h b/src/walletd.h index cd4dc21..593ef71 100644 --- a/src/walletd.h +++ b/src/walletd.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef WALLETD_H #define WALLETD_H @@ -37,6 +40,8 @@ class RemoteWalletd : public QObject void createTx(const RpcApi::CreateTransaction::Request& tx); void sendTx(const RpcApi::SendTransaction::Request& tx); void getTransfers(const RpcApi::GetTransfers::Request& req); + void createProof(const RpcApi::CreateSendProof::Request& req); + void checkSendProof(const RpcApi::CheckSendProof::Request& proof); State getState() const; bool isConnected() const; @@ -50,6 +55,8 @@ class RemoteWalletd : public QObject void unspentsReceivedSignal(const RpcApi::Unspents& unspents); void createTxReceivedSignal(const RpcApi::CreatedTx& tx); void sendTxReceivedSignal(const RpcApi::SentTx& tx); + void proofsReceivedSignal(const RpcApi::Proofs& proofs); + void checkProofReceivedSignal(const RpcApi::ProofCheck& proofCheck); void networkErrorSignal(const QString& errorString); void jsonParsingErrorSignal(const QString& message); @@ -84,6 +91,8 @@ private slots: void unspentsReceived(const RpcApi::Unspents& unspents); void createTxReceived(const RpcApi::CreatedTx& tx); void sendTxReceived(const RpcApi::SentTx& tx); + void proofsReceived(const RpcApi::Proofs& result); + void checkProofReceived(const RpcApi::ProofCheck& result); void networkError(const QString& errorString); void jsonParsingError(const QString& message); @@ -100,6 +109,7 @@ class RandomAuth const QString& getUser() const; const QString& getPass() const; QString getHttpBasicAuth() const; + QString getConcatenated() const; private: QString user_; diff --git a/src/walletdparamsdialog.cpp b/src/walletdparamsdialog.cpp new file mode 100644 index 0000000..a630088 --- /dev/null +++ b/src/walletdparamsdialog.cpp @@ -0,0 +1,36 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + +#include "walletdparamsdialog.h" +#include "ui_walletdparamsdialog.h" +#include "settings.h" + +namespace WalletGUI +{ + +WalletdParamsDialog::WalletdParamsDialog(bool allowToRestart, QWidget *parent) + : QDialog(parent) + , ui(new Ui::WalletdParamsDialog) +{ + ui->setupUi(this); + ui->applyButton->setEnabled(allowToRestart); + ui->paramsEdit->setText(Settings::instance().getWalletdParams().join(QChar(' '))); +} + +WalletdParamsDialog::~WalletdParamsDialog() +{ + delete ui; +} + +void WalletdParamsDialog::saveParams() +{ + Settings::instance().setWalletdParams(ui->paramsEdit->toPlainText().simplified()); +} + +void WalletdParamsDialog::applyParams() +{ + saveParams(); + emit restartWalletd(); +} + +} diff --git a/src/walletdparamsdialog.h b/src/walletdparamsdialog.h new file mode 100644 index 0000000..0dec060 --- /dev/null +++ b/src/walletdparamsdialog.h @@ -0,0 +1,37 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + +#ifndef WALLETDPARAMSDIALOG_H +#define WALLETDPARAMSDIALOG_H + +#include + +namespace Ui { +class WalletdParamsDialog; +} + +namespace WalletGUI +{ + +class WalletdParamsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit WalletdParamsDialog(bool allowToRestart, QWidget *parent = 0); + ~WalletdParamsDialog(); + +public slots: + void saveParams(); + void applyParams(); + +signals: + void restartWalletd(); + +private: + Ui::WalletdParamsDialog *ui; +}; + +} + +#endif // WALLETDPARAMSDIALOG_H diff --git a/src/walletdparamsdialog.ui b/src/walletdparamsdialog.ui new file mode 100644 index 0000000..c29d863 --- /dev/null +++ b/src/walletdparamsdialog.ui @@ -0,0 +1,145 @@ + + + WalletdParamsDialog + + + + 0 + 0 + 902 + 344 + + + + Wallet daemon parameters + + + + + + Command line options: + + + + + + + false + + + + + + + IBeamCursor + + + <html><head/><body><p>Options:<br/>--data-folder=&lt;fullpath&gt; Folder for wallet cache, blockchain, logs and peer DB. [default: see documentation]<br/>--bytecoind-remote-address=&lt;ip:port&gt; Connect to remote bytecoind and suppress running built-in bytecoind.<br/>--bytecoind-authorization=&lt;usr:pass&gt; HTTP authorization<br/>--testnet Configure for testnet.</p><p>Options for built-in bytecoind (run when no --bytecoind-remote-address specified):<br/>--allow-local-ip Allow local ip add to peer list, mostly in debug purposes.<br/>--p2p-bind-address=&lt;ip:port&gt; Interface and port for P2P network protocol [default: 0.0.0.0:8080].<br/>--p2p-external-port=&lt;port&gt; External port for P2P network protocol, if port forwarding used with NAT [default: 8080].<br/>--bytecoind-bind-address=&lt;ip:port&gt; Interface and port for bytecoind RPC [default: 0.0.0.0:8081].<br/>--seed-node-address=&lt;ip:port&gt; Specify list (one or more) of nodes to start connecting to.<br/>--priority-node-address=&lt;ip:port&gt; Specify list (one or more) of nodes to connect to and attempt to keep the connection open.<br/>--exclusive-node-address=&lt;ip:port&gt; Specify list (one or more) of nodes to connect to only. All other nodes including seed nodes will be ignored.</p></body></html> + + + Qt::TextSelectableByMouse + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Apply + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + + + + + cancelButton + clicked() + WalletdParamsDialog + reject() + + + 851 + 312 + + + 450 + 166 + + + + + applyButton + clicked() + WalletdParamsDialog + applyParams() + + + 140 + 312 + + + 450 + 166 + + + + + applyButton + clicked() + WalletdParamsDialog + accept() + + + 140 + 312 + + + 450 + 166 + + + + + + saveParams() + applyParams() + + diff --git a/src/walletmodel.cpp b/src/walletmodel.cpp index cd21e33..fe07e8d 100644 --- a/src/walletmodel.cpp +++ b/src/walletmodel.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #include #include #include @@ -7,7 +10,7 @@ #include "walletmodel.h" #include "common.h" -#include "rpcapi.h" // ?? +#include "rpcapi.h" #include "settings.h" namespace WalletGUI @@ -184,7 +187,7 @@ void WalletModel::addressesReceived(const RpcApi::Addresses& response) void WalletModel::transfersReceived(const RpcApi::Transfers& history) { - const quint32 highestConfirmedBlock = pimpl_->status.top_known_block_height - CONFIRMATIONS - 2; + const quint32 highestConfirmedBlock = getHighestKnownConfirmedBlock(); if (history.next_from_height >= highestConfirmedBlock) { QList txs; @@ -269,6 +272,8 @@ void WalletModel::statusReceived(const RpcApi::Status& status) changedRoles << ROLE_TOP_BLOCK_HEIGHT; if (status.top_block_difficulty != pimpl_->status.top_block_difficulty) changedRoles << ROLE_TOP_BLOCK_DIFFICULTY << ROLE_NETWORK_HASHRATE; + if (status.lower_level_error != pimpl_->status.lower_level_error) + changedRoles << ROLE_LOWER_LEVEL_ERROR; if (status.top_block_timestamp != pimpl_->status.top_block_timestamp) changedRoles << ROLE_TOP_BLOCK_TIMESTAMP; if (status.top_block_timestamp_median != pimpl_->status.top_block_timestamp_median) @@ -293,19 +298,18 @@ void WalletModel::statusReceived(const RpcApi::Status& status) emit dataChanged(index(0, COLUMN_TOP_BLOCK_HEIGHT), index(0, COLUMN_PEER_COUNT_SUM), changedRoles); - const quint32 highestConfirmedBlock = pimpl_->status.top_known_block_height - CONFIRMATIONS - 2; if (needToRequestConfirmed) { RpcApi::GetTransfers::Request req; req.from_height = getTopConfirmedBlock(); - req.to_height = highestConfirmedBlock; + req.to_height = getHighestKnownConfirmedBlock(); emit getTransfersSignal(req); } if (needToRequestUnconfirmed) { RpcApi::GetTransfers::Request req; - req.from_height = highestConfirmedBlock; + req.from_height = getHighestKnownConfirmedBlock(); emit getTransfersSignal(req); } } @@ -320,6 +324,12 @@ quint32 WalletModel::getBottomConfirmedBlock() const return pimpl_->unconfimedSize < 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; + return topKnownBlockHeight < CONFIRMATIONS + 2 ? 0 : topKnownBlockHeight - CONFIRMATIONS - 2; +} + void WalletModel::balanceReceived(const RpcApi::Balance& balance) { if (balance == pimpl_->balance) @@ -372,7 +382,7 @@ QVariant WalletModel::getDisplayRoleData(const QModelIndex& index) const if (index.column() >= COLUMN_ADDRESS && index.column() <= COLUMN_ADDRESS) return getDisplayRoleAddresses(index); - if (index.column() >= COLUMN_UNLOCK_TIME && index.column() <= COLUMN_TIMESTAMP) + if (index.column() >= COLUMN_UNLOCK_TIME && index.column() <= COLUMN_PROOF) return getDisplayRoleHistory(index); if (index.column() >= COLUMN_TOP_BLOCK_HEIGHT && index.column() <= COLUMN_PEER_COUNT_SUM) @@ -392,7 +402,7 @@ QVariant WalletModel::getUserRoleData(const QModelIndex& index, int role) const if (role >= ROLE_ADDRESS && role <= ROLE_ADDRESS) return getUserRoleAddresses(index, role); - if (role >= ROLE_UNLOCK_TIME && role <= ROLE_TIMESTAMP) + if (role >= ROLE_UNLOCK_TIME && role <= ROLE_PROOF) return getUserRoleHistory(index, role); if (role >= ROLE_TOP_BLOCK_HEIGHT && role <= ROLE_PEER_COUNT_SUM) @@ -535,6 +545,16 @@ QVariant WalletModel::getDisplayRoleHistory(const QModelIndex& index) const return tr("Unknown"); return tx.timestamp.toString(Qt::SystemLocaleShortDate); } + case COLUMN_PROOF: + { + bool proof = false; + for (const RpcApi::Transfer& tr : tx.transfers) + { + if (!tr.ours) + proof = true; + } + return proof ? QVariant(tr("Proof")) : QVariant(/*tr("Try")*/); + } } return QVariant(); @@ -580,6 +600,16 @@ QVariant WalletModel::getUserRoleHistory(const QModelIndex& index, int role) con return tx.block_hash; case ROLE_TIMESTAMP: return tx.timestamp; + case ROLE_PROOF: + { + bool proof = false; + for (const RpcApi::Transfer& tr : tx.transfers) + { + if (!tr.ours) + proof = true; + } + return proof; + } } return QVariant(); @@ -617,6 +647,9 @@ QVariant WalletModel::getDisplayRoleStatus(const QModelIndex& index) const return tr("-", "n/a"); return formatHashRate(pimpl_->status.top_block_difficulty / DIFFICULTY_TARGET); } + case COLUMN_LOWER_LEVEL_ERROR: +// return pimpl_->status.lower_level_error; + return pimpl_->status.lower_level_error.isEmpty() ? tr("Connected to bytecoind") : tr("Bytecoind status: %1").arg(pimpl_->status.lower_level_error); case COLUMN_NEXT_BLOCK_EFFECTIVE_MEDIAN_SIZE: return pimpl_->status.next_block_effective_median_size; case COLUMN_TXPOOL_VERSION: @@ -652,6 +685,8 @@ QVariant WalletModel::getUserRoleStatus(const QModelIndex& /*index*/, int role) return pimpl_->status.top_block_difficulty; case ROLE_NETWORK_HASHRATE: return pimpl_->status.top_block_difficulty / DIFFICULTY_TARGET; + case ROLE_LOWER_LEVEL_ERROR: + return pimpl_->status.lower_level_error; case ROLE_NEXT_BLOCK_EFFECTIVE_MEDIAN_SIZE: return pimpl_->status.next_block_effective_median_size; case ROLE_TXPOOL_VERSION: @@ -805,6 +840,11 @@ quint32 WalletModel::getPeerCountSum() const return pimpl_->status.incoming_peer_count + pimpl_->status.outgoing_peer_count; } +QString WalletModel::getLowerLevelError() const +{ + return pimpl_->status.lower_level_error; +} + QString WalletModel::getAddress() const { if (pimpl_->addresses.isEmpty()) @@ -817,6 +857,47 @@ void WalletModel::reset() beginResetModel(); pimpl_.reset(new WalletModelState); endResetModel(); + + + QVector changedRoles; + changedRoles << Qt::EditRole << Qt::DisplayRole + << ROLE_UNLOCK_TIME + << ROLE_PAYMENT_ID + << ROLE_ANONYMITY + << ROLE_HASH + << ROLE_FEE + << ROLE_PK + << ROLE_EXTRA + << ROLE_COINBASE + << ROLE_AMOUNT + << ROLE_BLOCK_HEIGHT + << ROLE_BLOCK_HASH + << ROLE_TIMESTAMP + << ROLE_PROOF + + << ROLE_TOP_BLOCK_HEIGHT + << ROLE_TOP_BLOCK_TIMESTAMP + << ROLE_TOP_BLOCK_TIMESTAMP_MEDIAN + << ROLE_TOP_BLOCK_HASH + << ROLE_TOP_BLOCK_DIFFICULTY + << ROLE_NETWORK_HASHRATE + << ROLE_LOWER_LEVEL_ERROR + << ROLE_NEXT_BLOCK_EFFECTIVE_MEDIAN_SIZE + << ROLE_TXPOOL_VERSION + << ROLE_PEER_COUNT_OUTGOING + << ROLE_PEER_COUNT_INCOMING + << ROLE_RECOMMENDED_FEE_PER_BYTE + << ROLE_KNOWN_TOP_BLOCK_HEIGHT + << ROLE_PEER_COUNT_SUM + + << ROLE_STATE + + << ROLE_SPENDABLE + << ROLE_SPENDABLE_DUST + << ROLE_LOCKED_OR_UNCONFIRMED + << ROLE_TOTAL; + + emit dataChanged(index(0, COLUMN_UNLOCK_TIME), index(0, COLUMN_TOTAL), changedRoles); } void WalletModel::fetchMore(const QModelIndex& parent) diff --git a/src/walletmodel.h b/src/walletmodel.h index 04ea202..f894f10 100644 --- a/src/walletmodel.h +++ b/src/walletmodel.h @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. + #ifndef WALLETMODEL #define WALLETMODEL @@ -35,6 +38,7 @@ class WalletModel : public QAbstractItemModel COLUMN_BLOCK_HEIGHT, COLUMN_BLOCK_HASH, COLUMN_TIMESTAMP, + COLUMN_PROOF, COLUMN_TOP_BLOCK_HEIGHT, // getStatus COLUMN_TOP_BLOCK_TIMESTAMP, @@ -42,6 +46,7 @@ class WalletModel : public QAbstractItemModel COLUMN_TOP_BLOCK_HASH, COLUMN_TOP_BLOCK_DIFFICULTY, COLUMN_NETWORK_HASHRATE, + COLUMN_LOWER_LEVEL_ERROR, COLUMN_NEXT_BLOCK_EFFECTIVE_MEDIAN_SIZE, COLUMN_TXPOOL_VERSION, COLUMN_PEER_COUNT_OUTGOING, @@ -74,6 +79,7 @@ class WalletModel : public QAbstractItemModel ROLE_BLOCK_HEIGHT, ROLE_BLOCK_HASH, ROLE_TIMESTAMP, + ROLE_PROOF, ROLE_TOP_BLOCK_HEIGHT, // getStatus ROLE_TOP_BLOCK_TIMESTAMP, @@ -81,6 +87,7 @@ class WalletModel : public QAbstractItemModel ROLE_TOP_BLOCK_HASH, ROLE_TOP_BLOCK_DIFFICULTY, ROLE_NETWORK_HASHRATE, + ROLE_LOWER_LEVEL_ERROR, ROLE_NEXT_BLOCK_EFFECTIVE_MEDIAN_SIZE, ROLE_TXPOOL_VERSION, ROLE_PEER_COUNT_OUTGOING, @@ -122,6 +129,7 @@ class WalletModel : public QAbstractItemModel quint32 getPeerCountOutgoing() const; quint32 getPeerCountIncoming() const; quint32 getPeerCountSum() const; + QString getLowerLevelError() const; signals: void getTransfersSignal(const RpcApi::GetTransfers::Request& req); @@ -163,6 +171,7 @@ public slots: quint32 getTopConfirmedBlock() const; quint32 getBottomConfirmedBlock() const; + quint32 getHighestKnownConfirmedBlock() const; const int columnCount_; QScopedPointer pimpl_; diff --git a/src/windoweditemmodel.cpp b/src/windoweditemmodel.cpp index 9ec6e7b..2cac062 100644 --- a/src/windoweditemmodel.cpp +++ b/src/windoweditemmodel.cpp @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #include "windoweditemmodel.h" diff --git a/src/windoweditemmodel.h b/src/windoweditemmodel.h index b529aee..5fcf051 100644 --- a/src/windoweditemmodel.h +++ b/src/windoweditemmodel.h @@ -1,19 +1,5 @@ -// Copyright (c) 2015-2017, The Bytecoin developers -// -// This file is part of Bytecoin. -// -// Bytecoin is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Bytecoin is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with Bytecoin. If not, see . +// Copyright (c) 2015-2018, The Bytecoin developers. +// Licensed under the GNU Lesser General Public License. See LICENSE for details. #pragma once