From af2cdf9f985a396e7e32b9c16d9e696db4bc0f44 Mon Sep 17 00:00:00 2001 From: Penek Date: Wed, 16 Sep 2015 16:48:25 +0300 Subject: [PATCH] Add form for second authorization (2fa) with checking transaction hashes in blockchain --- novacoin-qt.pro | 9 +- src/qt/bitcoingui.cpp | 18 ++ src/qt/bitcoingui.h | 6 + src/qt/forms/secondauthdialog.ui | 230 +++++++++++++++++++++++ src/qt/locale/bitcoin_en.ts | 386 ++++++++++++++++++++++++++------------ src/qt/locale/bitcoin_ru.ts | 380 +++++++++++++++++++++++++------------ src/qt/locale/bitcoin_uk.ts | 380 +++++++++++++++++++++++++------------ src/qt/secondauthdialog.cpp | 170 +++++++++++++++++ src/qt/secondauthdialog.h | 42 ++++ 9 files changed, 1260 insertions(+), 361 deletions(-) create mode 100644 src/qt/forms/secondauthdialog.ui create mode 100644 src/qt/secondauthdialog.cpp create mode 100644 src/qt/secondauthdialog.h diff --git a/novacoin-qt.pro b/novacoin-qt.pro index f540caf..1972f70 100644 --- a/novacoin-qt.pro +++ b/novacoin-qt.pro @@ -268,7 +268,8 @@ HEADERS += src/qt/bitcoingui.h \ src/clientversion.h \ src/qt/multisigaddressentry.h \ src/qt/multisiginputentry.h \ - src/qt/multisigdialog.h + src/qt/multisigdialog.h \ + src/qt/secondauthdialog.h SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \ src/qt/intro.cpp \ @@ -342,7 +343,8 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \ src/kernel.cpp \ src/qt/multisigaddressentry.cpp \ src/qt/multisiginputentry.cpp \ - src/qt/multisigdialog.cpp + src/qt/multisigdialog.cpp \ + src/qt/secondauthdialog.cpp RESOURCES += \ src/qt/bitcoin.qrc @@ -363,7 +365,8 @@ FORMS += \ src/qt/forms/optionsdialog.ui \ src/qt/forms/multisigaddressentry.ui \ src/qt/forms/multisiginputentry.ui \ - src/qt/forms/multisigdialog.ui + src/qt/forms/multisigdialog.ui \ + src/qt/forms/secondauthdialog.ui contains(USE_QRCODE, 1) { HEADERS += src/qt/qrcodedialog.h diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 8b9e114..15c8075 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -9,6 +9,7 @@ #include "addressbookpage.h" #include "sendcoinsdialog.h" #include "signverifymessagedialog.h" +#include "secondauthdialog.h" #include "multisigdialog.h" #include "optionsdialog.h" #include "aboutdialog.h" @@ -77,6 +78,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): clientModel(0), walletModel(0), signVerifyMessageDialog(0), + secondAuthDialog(0), multisigPage(0), encryptWalletAction(0), lockWalletAction(0), @@ -137,6 +139,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): signVerifyMessageDialog = new SignVerifyMessageDialog(0); + secondAuthDialog = new SecondAuthDialog(0); + multisigPage = new MultisigDialog(0); centralWidget = new QStackedWidget(this); @@ -229,6 +233,7 @@ BitcoinGUI::~BitcoinGUI() delete aboutDialog; delete optionsDialog; delete multisigPage; + delete secondAuthDialog; delete signVerifyMessageDialog; } @@ -324,6 +329,8 @@ void BitcoinGUI::createActions() signMessageAction->setStatusTip(tr("Sign messages with your Novacoin addresses to prove you own them")); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Novacoin addresses")); + secondAuthAction = new QAction(QIcon(":/icons/key"), tr("Second &auth..."), this); + secondAuthAction->setStatusTip(tr("Second auth with your Novacoin addresses")); lockWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Lock wallet"), this); lockWalletAction->setStatusTip(tr("Lock wallet")); @@ -357,6 +364,7 @@ void BitcoinGUI::createActions() connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); + connect(secondAuthAction, SIGNAL(triggered()), this, SLOT(gotoSecondAuthPage())); } void BitcoinGUI::createMenuBar() @@ -378,6 +386,7 @@ void BitcoinGUI::createMenuBar() file->addAction(exportAction); file->addAction(signMessageAction); file->addAction(verifyMessageAction); + file->addAction(secondAuthAction); file->addAction(multisigAction); file->addSeparator(); file->addAction(quitAction); @@ -478,6 +487,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) receiveCoinsPage->setModel(walletModel->getAddressTableModel()); sendCoinsPage->setModel(walletModel); signVerifyMessageDialog->setModel(walletModel); + secondAuthDialog->setModel(walletModel); multisigPage->setModel(walletModel); setEncryptionStatus(walletModel->getEncryptionStatus()); @@ -521,6 +531,7 @@ void BitcoinGUI::createTrayIcon() trayIconMenu->addSeparator(); trayIconMenu->addAction(signMessageAction); trayIconMenu->addAction(verifyMessageAction); + trayIconMenu->addAction(secondAuthAction); trayIconMenu->addSeparator(); trayIconMenu->addAction(optionsAction); trayIconMenu->addAction(openRPCConsoleAction); @@ -931,6 +942,13 @@ void BitcoinGUI::gotoVerifyMessageTab(QString addr) signVerifyMessageDialog->setAddress_VM(addr); } +void BitcoinGUI::gotoSecondAuthPage(QString addr) +{ + secondAuthDialog->show(); + secondAuthDialog->raise(); + secondAuthDialog->activateWindow(); +} + void BitcoinGUI::gotoMultisigPage() { multisigPage->show(); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index d27151a..20eb7ca 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -13,6 +13,7 @@ class OverviewPage; class AddressBookPage; class SendCoinsDialog; class SignVerifyMessageDialog; +class SecondAuthDialog; class MultisigDialog; class Notificator; class RPCConsole; @@ -70,6 +71,7 @@ private: AddressBookPage *receiveCoinsPage; SendCoinsDialog *sendCoinsPage; SignVerifyMessageDialog *signVerifyMessageDialog; + SecondAuthDialog *secondAuthDialog; MultisigDialog *multisigPage; QLabel *labelEncryptionIcon; @@ -88,6 +90,7 @@ private: QAction *addressBookAction; QAction *signMessageAction; QAction *verifyMessageAction; + QAction *secondAuthAction; QAction *multisigAction; QAction *aboutAction; QAction *receiveCoinsAction; @@ -173,6 +176,9 @@ private slots: /** Show Sign/Verify Message dialog and switch to verify message tab */ void gotoVerifyMessageTab(QString addr = ""); + /** Show Second Auth dialog */ + void gotoSecondAuthPage(QString addr = ""); + /** Show configuration dialog */ void optionsClicked(); /** Show about dialog */ diff --git a/src/qt/forms/secondauthdialog.ui b/src/qt/forms/secondauthdialog.ui new file mode 100644 index 0000000..7d529fc --- /dev/null +++ b/src/qt/forms/secondauthdialog.ui @@ -0,0 +1,230 @@ + + + SecondAuthDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 768 + 221 + + + + Second Authentification + + + + + + You can sign hash of transaction exists in the blockchain with your addresses. + + + Qt::PlainText + + + true + + + + + + + + + The address for authentification (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + 34 + + + + + + + Choose an address from the address book + + + + + + + :/icons/address-book:/icons/address-book + + + Alt+A + + + false + + + + + + + + + + + 64 + + + + + + + Paste hash from clipboard + + + + + + + :/icons/editpaste:/icons/editpaste + + + Alt+P + + + false + + + + + + + + + 6 + + + + + + true + + + + true + + + + + + + Copy the current signature to the system clipboard + + + + + + + :/icons/editcopy:/icons/editcopy + + + Alt+C + + + false + + + + + + + + + + + Sign the hash + + + &Sign Data + + + + :/icons/edit:/icons/edit + + + false + + + + + + + Reset all sign message fields + + + Clear &All + + + + :/icons/remove:/icons/remove + + + false + + + + + + + Qt::Horizontal + + + + 10 + 48 + + + + + + + + + 75 + true + + + + + + + true + + + + + + + Qt::Horizontal + + + + 40 + 48 + + + + + + + + + + + QValidatedLineEdit + QLineEdit +
qvalidatedlineedit.h
+
+
+ + + + +
diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 3505128..1fe2b2d 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1,6 +1,7 @@ - + +UTF-8 AboutDialog @@ -33,7 +34,7 @@ Copyright © 2012-2015 The NovaCoin developers <html><head/><body><p><br/>This is experimental software.</p><p>Distributed under the MIT/X11 software license, see the accompanying file COPYING or <br/><a href="http://www.opensource.org/licenses/mit-license.php"><span style=" text-decoration: underline; color:#0000ff;">http://www.opensource.org/licenses/mit-license.php</span></a>.</p><p>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href="http://www.openssl.org/"><span style=" text-decoration: underline; color:#0000ff;">http://www.openssl.org/</span></a>) and cryptographic software written by Eric Young (<a href="mailto:eay@cryptsoft.com"><span style=" text-decoration: underline; color:#0000ff;">eay@cryptsoft.com</span></a>) and UPnP software written by Thomas Bernard(<a href="mailto:miniupnp@free.fr"><span style=" text-decoration: underline; color:#0000ff;">miniupnp@free.fr</span></a>).</p></body></html> - <html><head/><body><p><br/>This is experimental software.</p><p>Distributed under the MIT/X11 software license, see the accompanying file COPYING or <br/><a href="http://www.opensource.org/licenses/mit-license.php"><span style=" text-decoration: underline; color:#0000ff;">http://www.opensource.org/licenses/mit-license.php</span></a>.</p><p>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href="http://www.openssl.org/"><span style=" text-decoration: underline; color:#0000ff;">http://www.openssl.org/</span></a>) and cryptographic software written by Eric Young (<a href="mailto:eay@cryptsoft.com"><span style=" text-decoration: underline; color:#0000ff;">eay@cryptsoft.com</span></a>) and UPnP software written by Thomas Bernard(<a href="mailto:miniupnp@free.fr"><span style=" text-decoration: underline; color:#0000ff;">miniupnp@free.fr</span></a>).</p></body></html> + <html><head/><body><p><br/>This is experimental software.</p><p>Distributed under the MIT/X11 software license, see the accompanying file COPYING or <br/><a href="http://www.opensource.org/licenses/mit-license.php"><span style=" text-decoration: underline; color:#0000ff;">http://www.opensource.org/licenses/mit-license.php</span></a>.</p><p>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href="http://www.openssl.org/"><span style=" text-decoration: underline; color:#0000ff;">http://www.openssl.org/</span></a>) and cryptographic software written by Eric Young (<a href="mailto:eay@cryptsoft.com"><span style=" text-decoration: underline; color:#0000ff;">eay@cryptsoft.com</span></a>) and UPnP software written by Thomas Bernard(<a href="mailto:miniupnp@free.fr"><span style=" text-decoration: underline; color:#0000ff;">miniupnp@free.fr</span></a>).</p></body></html> @@ -318,296 +319,306 @@ Copyright © 2012-2015 The NovaCoin developers A fatal error occurred. NovaCoin can no longer continue safely and will quit. - - + + NovaCoin NovaCoin - + Wallet Wallet - + &Overview &Overview - + Show general overview of wallet Show general overview of wallet - + &Send coins &Send coins - + Send coins to a NovaCoin address Send coins to a NovaCoin address - + &Receive coins &Receive coins - + Show the list of addresses for receiving payments Show the list of addresses for receiving payments - + &Transactions &Transactions - + Browse transaction history Browse transaction history - + &Minting &Minting - + Show your minting capacity Show your minting capacity - + &Address Book &Address Book - + Edit the list of stored addresses and labels Edit the list of stored addresses and labels - + Multisig Multisig - + Open window for working with multisig addresses Open window for working with multisig addresses - + E&xit E&xit - + Quit application Quit application - + &About NovaCoin &About NovaCoin - + Show information about NovaCoin Show information about NovaCoin - - + + About &Qt About &Qt - + Show information about Qt Show information about Qt - + &Options... &Options... - + Modify configuration options for NovaCoin Modify configuration options for NovaCoin - + &Show / Hide &Show / Hide - + &Encrypt Wallet... &Encrypt Wallet... - + Encrypt or decrypt wallet Encrypt or decrypt wallet - + &Backup Wallet... &Backup Wallet... - + Backup wallet to another location Backup wallet to another location - + &Dump Wallet... &Dump Wallet... - + Dump keys to a text file Dump keys to a text file - + &Import Wallet... &Import Wallet... - + Import keys into a wallet Import keys into a wallet - + &Change Passphrase... &Change Passphrase... - + Change the passphrase used for wallet encryption Change the passphrase used for wallet encryption - + Sign &message... Sign &message... - + Sign messages with your Novacoin addresses to prove you own them Sign messages with your Novacoin addresses to prove you own them - + &Verify message... &Verify message... - + Verify messages to ensure they were signed with specified Novacoin addresses Verify messages to ensure they were signed with specified Novacoin addresses - + + Second &auth... + + + + + Second auth with your Novacoin addresses + + + + &Lock wallet &Lock wallet - + Lock wallet Lock wallet - + Unlo&ck wallet Unlo&ck wallet - + Unlock wallet Unlock wallet - + Unlo&ck wallet for mining Unlo&ck wallet for mining - + Unlock wallet for mining Unlock wallet for mining - + &Export... &Export... - + Export the data in the current tab to a file Export the data in the current tab to a file - + &Debug window &Debug window - + Open debugging and diagnostic console Open debugging and diagnostic console - + &File &File - + &Settings &Settings - + &Wallet security &Wallet security - + &Help &Help - + Tabs toolbar Tabs toolbar - + Actions toolbar Actions toolbar - + [testnet] [testnet] - - + + NovaCoin client NovaCoin client - + %n active connection(s) to NovaCoin network %n active connection to NovaCoin network @@ -615,12 +626,12 @@ Copyright © 2012-2015 The NovaCoin developers - + Synchronizing with network... Synchronizing with network... - + ~%n block(s) remaining ~%n block remaining @@ -628,27 +639,27 @@ Copyright © 2012-2015 The NovaCoin developers - + Downloaded %1 of %2 blocks of transaction history (%3% done). Downloaded %1 of %2 blocks of transaction history (%3% done). - + Downloaded %1 blocks of transaction history. Downloaded %1 blocks of transaction history. - + Current PoW difficulty is %1. - + Current PoS difficulty is %1. - + %n second(s) ago %n second ago @@ -656,7 +667,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n minute(s) ago %n minute ago @@ -664,7 +675,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n hour(s) ago %n hour ago @@ -672,7 +683,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n day(s) ago %n day ago @@ -680,86 +691,86 @@ Copyright © 2012-2015 The NovaCoin developers - + Up to date Up to date - + Catching up... Catching up... - + Last received block was generated %1. Last received block was generated %1. - + Wallet is offline Wallet is offline - + Wallet is locked Wallet is locked - + Blockchain download is in progress Blockchain download is in progress - + Stake miner is active<br>%1 inputs being used for mining<br>Network weight is %3 Stake miner is active<br>Kernel rate is %1 k/s<br>CD rate is %2 CD/s<br>Network weight is %3 - Stake miner is active<br>Kernel rate is %1 k/s<br>CD rate is %2 CD/s<br>Network weight is %3 + Stake miner is active<br>Kernel rate is %1 k/s<br>CD rate is %2 CD/s<br>Network weight is %3 - + No suitable inputs were found No suitable inputs were found - + Error Error - + Warning Warning - + Information Information - + This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee? This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee? - + Confirm transaction fee Confirm transaction fee - + Sent transaction Sent transaction - + Incoming transaction Incoming transaction - + Date: %1 Amount: %2 Type: %3 @@ -772,94 +783,94 @@ Address: %4 - - + + URI handling URI handling - - + + URI can not be parsed! This can be caused by an invalid NovaCoin address or malformed URI parameters. URI can not be parsed! This can be caused by an invalid NovaCoin address or malformed URI parameters. - + Wallet is <b>encrypted</b> and currently <b>unlocked</b> Wallet is <b>encrypted</b> and currently <b>unlocked</b> - + Wallet is <b>encrypted</b> and currently <b>locked</b> Wallet is <b>encrypted</b> and currently <b>locked</b> - + Backup Wallet Backup Wallet - + Wallet Data (*.dat) Wallet Data (*.dat) - + Backup Failed Backup Failed - + There was an error trying to save the wallet data to the new location. There was an error trying to save the wallet data to the new location. - + Dump Wallet There was an error trying to save the wallet data to the new location. - - + + Wallet dump (*.txt) Wallet dump (*.txt) - + Dump failed Dump failed - + An error happened while trying to save the keys to your location. Keys were not saved. An error happened while trying to save the keys to your location. Keys were not saved. - + Dump successful Dump successful - + Keys were saved to this file: %2 Keys were saved to this file: %2 - + Import Wallet Import Wallet - + Import Failed Import Failed - + An error happened while trying to import the keys. Some or all keys from: %1, @@ -870,12 +881,12 @@ Some or all keys from: were not imported into your wallet. - + Import Successful Import Successful - + All keys from: %1, were imported into your wallet. @@ -906,7 +917,7 @@ Some or all keys from: 0 - 0 + 0 @@ -920,7 +931,7 @@ Some or all keys from: 0.00 NVC - 0.00 NVC + 0.00 NVC @@ -1711,7 +1722,7 @@ This label turns red, if the priority is smaller than "medium". / 1 - / 1 + / 1 @@ -1775,11 +1786,11 @@ This label turns red, if the priority is smaller than "medium". 123.456 - 123.456 + 123.456 NVC - NVC + NVC @@ -2637,6 +2648,141 @@ Reduce the number of addresses involved in the address creation. + SecondAuthDialog + + Signatures - Sign / Verify a Message + Signatures - Sign / Verify a Message + + + The address to sign the message with (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + The address to sign the message with (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + Choose an address from the address book + Choose an address from the address book + + + + Alt+A + Alt+A + + + Paste address from clipboard + Paste address from clipboard + + + + Second Authentication + + + + + You can sign hash of transaction exists in the blockchain with your addresses. + + + + + The address for authentification (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + + Paste hash from clipboard + + + + + Alt+P + Alt+P + + + + Copy the current signature to the system clipboard + Copy the current signature to the system clipboard + + + + Alt+C + + + + + Sign the hash + + + + Sign the message to prove you own this NovaCoin address + Sign the message to prove you own this NovaCoin address + + + + &Sign Data + + + + + Reset all sign message fields + Reset all sign message fields + + + + Clear &All + Clear &All + + + + Enter a NovaCoin address (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + Enter a NovaCoin address (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + Click "Sign data" to generate signature + + + + + The entered address is invalid. + The entered address is invalid. + + + + + Please check the address and try again. + Please check the address and try again. + + + + The entered address does not refer to a key. + The entered address does not refer to a key. + + + + Wallet unlock was cancelled. + Wallet unlock was cancelled. + + + + Private key for the entered address is not available. + Private key for the entered address is not available. + + + + No information available about transaction. + + + + + Message signing failed. + Message signing failed. + + + + Message signed. + Message signed. + + + SendCoinsDialog @@ -2677,7 +2823,7 @@ Reduce the number of addresses involved in the address creation. 0 - 0 + 0 @@ -2691,7 +2837,7 @@ Reduce the number of addresses involved in the address creation. 0.00 NVC - 0.00 NVC + 0.00 NVC @@ -2780,7 +2926,7 @@ Reduce the number of addresses involved in the address creation. 123.456 NVC - 123.456 NVC + 123.456 NVC diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index bfaa6bf..3b9f27e 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -1,6 +1,7 @@ - + +UTF-8 AboutDialog @@ -314,296 +315,306 @@ Copyright © 2012-2015 The NovaCoin developers Произошла неисправимая ошибка. NovaCoin не может безопасно продолжать работу и будет закрыт. - - + + NovaCoin NovaCoin - + Wallet Бумажник - + &Overview О&бзор - + Show general overview of wallet Показать общий обзор действий с бумажником - + &Send coins Отп&равка монет - + Send coins to a NovaCoin address Отправить монеты на указанный адрес NovaCoin - + &Receive coins &Получение монет - + Show the list of addresses for receiving payments Показать список адресов для получения платежей - + &Transactions &Транзакции - + Browse transaction history Показать историю транзакций - + &Minting &PoS - + Show your minting capacity Показать ваш PoS потенциал - + &Address Book &Адресная книга - + Edit the list of stored addresses and labels Изменить список сохранённых адресов и меток к ним - + Multisig Мультиподпись - + Open window for working with multisig addresses Открыть окно для работы с адресами с мультиподписью - + E&xit В&ыход - + Quit application Закрыть приложение - + &About NovaCoin &О NovaCoin - + Show information about NovaCoin Показать информацию о NovaCoin'е - - + + About &Qt О &Qt - + Show information about Qt Показать информацию о Qt - + &Options... Оп&ции... - + Modify configuration options for NovaCoin Изменить параметры конфигурации NovaCoin - + &Show / Hide &Показать / Скрыть - + &Encrypt Wallet... &Зашифровать бумажник - + Encrypt or decrypt wallet Зашифровать или расшифровать бумажник - + &Backup Wallet... &Сделать резервную копию бумажника - + Backup wallet to another location Сделать резервную копию бумажника в другом месте - + &Dump Wallet... &Выгрузка ключей... - + Dump keys to a text file Выгрузить ключи в текстовый файл - + &Import Wallet... &Импорт ключей... - + Import keys into a wallet Импортировать ключи из текстового файла - + &Change Passphrase... &Изменить пароль - + Change the passphrase used for wallet encryption Изменить пароль шифрования бумажника - + Sign &message... &Подписать сообщение - + Sign messages with your Novacoin addresses to prove you own them Подписать сообщения вашим Novacoin адресом, чтобы доказать, что вы им владеете - + &Verify message... &Проверить сообщение... - + Verify messages to ensure they were signed with specified Novacoin addresses Проверить сообщения, чтобы удостовериться, что они подписаны определенным Novacoin адресом - + + Second &auth... + &Дополнительная авторизация + + + + Second auth with your Novacoin addresses + Дополнительная авторизация по Вашим адресам + + + &Lock wallet &Заблокировать бумажник - + Lock wallet Заблокировать бумажник - + Unlo&ck wallet Разб&локировать бумажник - + Unlock wallet Разблокировать бумажник - + Unlo&ck wallet for mining Ра&зблокировать для майнинга - + Unlock wallet for mining Разблокировать для майнинга - + &Export... &Экспорт... - + Export the data in the current tab to a file Экспортировать данные из вкладки в файл - + &Debug window &Окно отладки - + Open debugging and diagnostic console Открыть консоль отладки и диагностики - + &File &Файл - + &Settings &Настройки - + &Wallet security &Безопасность - + &Help &Помощь - + Tabs toolbar Панель вкладок - + Actions toolbar Панель действий - + [testnet] [тестовая сеть] - - + + NovaCoin client NovaCoin клиент - + %n active connection(s) to NovaCoin network %n активное соединение с сетью @@ -612,12 +623,12 @@ Copyright © 2012-2015 The NovaCoin developers - + Synchronizing with network... Синхронизация с сетью... - + ~%n block(s) remaining остался ~%n блок @@ -626,27 +637,27 @@ Copyright © 2012-2015 The NovaCoin developers - + Downloaded %1 of %2 blocks of transaction history (%3% done). Загружено %1 из %2 блоков истории операций (%3% завершено). - + Downloaded %1 blocks of transaction history. Загружено %1 блоков истории транзакций. - + Current PoW difficulty is %1. - + Current PoS difficulty is %1. - + %n second(s) ago %n секунду назад @@ -655,7 +666,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n minute(s) ago %n минуту назад @@ -664,7 +675,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n hour(s) ago %n час назад @@ -673,7 +684,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n day(s) ago %n день назад @@ -682,86 +693,86 @@ Copyright © 2012-2015 The NovaCoin developers - + Up to date Синхронизировано - + Catching up... Синхронизируется... - + Last received block was generated %1. Последний полученный блок был сгенерирован %1. - + Wallet is offline Бумажник не в сети - + Wallet is locked Бумажник заблокирован - + Blockchain download is in progress Загрузка цепочки блоков ещё не завершена - + Stake miner is active<br>%1 inputs being used for mining<br>Network weight is %3 Stake miner is active<br>Kernel rate is %1 k/s<br>CD rate is %2 CD/s<br>Network weight is %3 - Proof-of-Stake майнер активен<br>Попыток генерации %1 в сек<br>Вес попыток %2 монетодень/с<br>Вес сети %3 монетодней + Proof-of-Stake майнер активен<br>Попыток генерации %1 в сек<br>Вес попыток %2 монетодень/с<br>Вес сети %3 монетодней - + No suitable inputs were found Нет подходящих транзакций - + Error Ошибка - + Warning Предупреждение - + Information Сообщение - + This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee? Данная транзакция превышает предельно допустимый размер. Но Вы можете всё равно совершить её, добавив комиссию в %1, которая отправится тем узлам, которые обработают Вашу транзакцию, и поможет поддержать сеть. Вы хотите добавить комиссию? - + Confirm transaction fee Подтвердите комиссию - + Sent transaction Исходящая транзакция - + Incoming transaction Входящая транзакция - + Date: %1 Amount: %2 Type: %3 @@ -774,94 +785,94 @@ Address: %4 - - + + URI handling Обработка URI - - + + URI can not be parsed! This can be caused by an invalid NovaCoin address or malformed URI parameters. Не удалось обработать URI! Это может быть связано с неверным адресом NovaCoin или неправильными параметрами URI. - + Wallet is <b>encrypted</b> and currently <b>unlocked</b> Бумажник <b>зашифрован</b> и в настоящее время <b>разблокирован</b> - + Wallet is <b>encrypted</b> and currently <b>locked</b> Бумажник <b>зашифрован</b> и в настоящее время <b>заблокирован</b> - + Backup Wallet Сделать резервную копию бумажника - + Wallet Data (*.dat) Данные бумажника (*.dat) - + Backup Failed Резервное копирование не удалось - + There was an error trying to save the wallet data to the new location. При попытке сохранения данных бумажника в новое место произошла ошибка. - + Dump Wallet Произошла ошибка при сохранении копии данных бумажника. - - + + Wallet dump (*.txt) Файл с ключами (*.txt) - + Dump failed Ошибка выгрузки - + An error happened while trying to save the keys to your location. Keys were not saved. Произошла ошибка при попытке выгрузки ключей в указанный файл. Ключи не сохранены. - + Dump successful Выгрузка завершена - + Keys were saved to this file: %2 Ключи сохранены в %2 - + Import Wallet Импорт ключей - + Import Failed Ошибка импорта - + An error happened while trying to import the keys. Some or all keys from: %1, @@ -872,12 +883,12 @@ Some or all keys from: не были импортированы. - + Import Successful Импорт завершен - + All keys from: %1, were imported into your wallet. @@ -908,7 +919,7 @@ Some or all keys from: 0 - 0 + 0 @@ -922,7 +933,7 @@ Some or all keys from: 0.00 NVC - 0.00 NVC + 0.00 NVC @@ -1713,7 +1724,7 @@ This label turns red, if the priority is smaller than "medium". / 1 - / 1 + / 1 @@ -1777,11 +1788,11 @@ This label turns red, if the priority is smaller than "medium". 123.456 - 123.456 + 123.456 NVC - NVC + NVC @@ -2639,6 +2650,137 @@ Reduce the number of addresses involved in the address creation. + SecondAuthDialog + + Signatures - Sign / Verify a Message + Подписи - подписать/проверить сообщение + + + The address to sign the message with (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + Адрес, которым вы хотите подписать сообщение (напр. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + Choose an address from the address book + Выберите адрес из адресной книги + + + + Alt+A + Alt+A + + + + Alt+P + Alt+P + + + + Copy the current signature to the system clipboard + Скопировать текущую подпись в системный буфер обмена + + + + Alt+C + Alt+C + + + + &Sign Data + &Подписать данные + + + + Reset all sign message fields + Сбросить значения всех полей подписывания сообщений + + + + Clear &All + Очистить &всё + + + + Enter a NovaCoin address (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + Введите адрес NovaCoin (напр. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + The entered address is invalid. + Введённый адрес неверен + + + + + Please check the address and try again. + Пожалуйста, проверьте адрес и попробуйте ещё раз. + + + + The entered address does not refer to a key. + Введённый адрес не связан с ключом + + + + Wallet unlock was cancelled. + Разблокировка бумажника была отменена. + + + + Private key for the entered address is not available. + Для введённого адреса недоступен закрытый ключ + + + + No information available about transaction. + Информация об указанной транзакции недоступна. + + + + Message signing failed. + Не удалось подписать сообщение + + + + Message signed. + Сообщение подписано + + + + Second Authentification + Дополнительная авторизация + + + + You can sign hash of transaction exists in the blockchain with your addresses. + Вы можете подписывать хэши транзакций, существующих в цепочке блоков, своими адресами. + + + + The address for authentification (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + Адрес, по которому вы проходите авторизацию (напр. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + Paste hash from clipboard + Вставить хэш из буфера обмена + + + + Sign the hash + Подписать хэш транзакции + + + &Sign data + &Подписать данные + + + + Click "Sign data" to generate signature + Нажмите "Подписать данные" для создания подписи + + + SendCoinsDialog @@ -2679,7 +2821,7 @@ Reduce the number of addresses involved in the address creation. 0 - 0 + 0 @@ -2693,7 +2835,7 @@ Reduce the number of addresses involved in the address creation. 0.00 NVC - 0.00 NVC + 0.00 NVC @@ -2782,7 +2924,7 @@ Reduce the number of addresses involved in the address creation. 123.456 NVC - 123.456 NVC + 123.456 NVC diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index cbaeb7b..ea2163f 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -1,6 +1,7 @@ - + +UTF-8 AboutDialog @@ -315,296 +316,306 @@ Copyright © 2012-2015 The NovaCoin developers Сталася фатальна помилка. Програма зараз закриється, оскільки NovaCoin не може продовжувати роботу безпечно. - - + + NovaCoin NovaCoin - + Wallet Гаманець - + &Overview &Огляд - + Show general overview of wallet Показати загальний огляд гаманця - + &Send coins В&ідправити - + Send coins to a NovaCoin address Відправити монети на вказану адресу - + &Receive coins О&тримати - + Show the list of addresses for receiving payments Показати список адрес для отримання платежів - + &Transactions &Транзакції - + Browse transaction history Переглянути історію транзакцій - + &Minting &PoS - + Show your minting capacity Показати ваш PoS потенціал - + &Address Book &Адресна книга - + Edit the list of stored addresses and labels Редагувати список збережених адрес та міток - + Multisig Мультипідпис - + Open window for working with multisig addresses Відкрити вікно для роботи з мультипідпис-адресом - + E&xit &Вихід - + Quit application Вийти - + &About NovaCoin П&ро NovaCoin - + Show information about NovaCoin Показати інформацію про NovaCoin - - + + About &Qt &Про Qt - + Show information about Qt Показати інформацію про Qt - + &Options... &Параметри... - + Modify configuration options for NovaCoin Редагувати параметри NovaCoin - + &Show / Hide Показати / Приховати - + &Encrypt Wallet... &Шифрування гаманця... - + Encrypt or decrypt wallet Зашифрувати чи розшифрувати гаманець - + &Backup Wallet... &Резервне копіювання гаманця... - + Backup wallet to another location Резервне копіювання гаманця в інше місце - + &Dump Wallet... &Вивантаження гаманця... - + Dump keys to a text file Вивантажити ключі у текстовий файл - + &Import Wallet... &Імпорт гаманця... - + Import keys into a wallet Імпортувати ключі до гаманця - + &Change Passphrase... &Змінити пароль... - + Change the passphrase used for wallet encryption Змінити пароль, який використовується для шифрування гаманця - + Sign &message... Підписати п&овідомлення... - + Sign messages with your Novacoin addresses to prove you own them Підтвердіть, що Ви є власником повідомлення підписавши його Вашою Novacoin-адресою - + &Verify message... П&еревірити повідомлення... - + Verify messages to ensure they were signed with specified Novacoin addresses Перевірте повідомлення для впевненості, що воно підписано вказаною Novacoin-адресою - + + Second &auth... + + + + + Second auth with your Novacoin addresses + + + + &Lock wallet Заблокувати гаманець - + Lock wallet Розблокувати гаманець - + Unlo&ck wallet Розбло&кувати гаманець - + Unlock wallet Розблокувати гаманець - + Unlo&ck wallet for mining Розбло&кувати гаманець для майнігу - + Unlock wallet for mining Розблокувати гаманець для майнігу - + &Export... &Експорт... - + Export the data in the current tab to a file Експортувати дані з поточної вкладки в файл - + &Debug window &Вікно відладки - + Open debugging and diagnostic console Відкрити консоль відладки і діагностики - + &File &Файл - + &Settings &Налаштування - + &Wallet security &Безпека гаманця - + &Help &Довідка - + Tabs toolbar Панель вкладок - + Actions toolbar Панель дій - + [testnet] [тестова мережа] - - + + NovaCoin client NovaCoin клієнт - + %n active connection(s) to NovaCoin network %n активне з'єднання з мережею NovaCoin @@ -613,12 +624,12 @@ Copyright © 2012-2015 The NovaCoin developers - + Synchronizing with network... Синхронізація з мережею... - + ~%n block(s) remaining ~%n блок залишився @@ -627,27 +638,27 @@ Copyright © 2012-2015 The NovaCoin developers - + Downloaded %1 of %2 blocks of transaction history (%3% done). Завантажено %1 з %2 блоків історії транзакцій (%3% виконано). - + Downloaded %1 blocks of transaction history. Завантажено %1 блоків історії транзакцій. - + Current PoW difficulty is %1. - + Current PoS difficulty is %1. - + %n second(s) ago %n секунду тому @@ -656,7 +667,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n minute(s) ago %n хвилину тому @@ -665,7 +676,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n hour(s) ago %n годину тому @@ -674,7 +685,7 @@ Copyright © 2012-2015 The NovaCoin developers - + %n day(s) ago %n день тому @@ -683,86 +694,86 @@ Copyright © 2012-2015 The NovaCoin developers - + Up to date Синхронізовано - + Catching up... Синхронізується... - + Last received block was generated %1. Останній отриманий блок було згенеровано %1. - + Wallet is offline Гаманець офф-лайн - + Wallet is locked Гаманець заблокованний - + Blockchain download is in progress Відбувається завантаження ланцюжка блоків - + Stake miner is active<br>%1 inputs being used for mining<br>Network weight is %3 Stake miner is active<br>Kernel rate is %1 k/s<br>CD rate is %2 CD/s<br>Network weight is %3 - PoS майнер активний<br>Спроб генерації %1 в сек<br>Вага спроб %2 монетодень/с<br>Вага мережі %3 монетоднів + PoS майнер активний<br>Спроб генерації %1 в сек<br>Вага спроб %2 монетодень/с<br>Вага мережі %3 монетоднів - + No suitable inputs were found Було знайдено непридатний вхід - + Error Помилка - + Warning Попередження - + Information Інформація - + This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee? Ця транзакція перевищує максимально допустимий розмір. Проте ви можете здійснити її, додавши комісію в %1, яка відправиться тим вузлам, які її оброблять, це допоможе підтримати мережу. Ви бажаєте додати комісію? - + Confirm transaction fee Підтвердіть комісію транзакції - + Sent transaction Вихідна транзакція - + Incoming transaction Вхідна транзакція - + Date: %1 Amount: %2 Type: %3 @@ -775,94 +786,94 @@ Address: %4 - - + + URI handling Обробка URI - - + + URI can not be parsed! This can be caused by an invalid NovaCoin address or malformed URI parameters. Неможливо обробити URI! Це може бути викликано неправильною NovaCoin-адресою, чи невірними параметрами URI. - + Wallet is <b>encrypted</b> and currently <b>unlocked</b> <b>Зашифрований</b> гаманець <b>розблоковано</b> - + Wallet is <b>encrypted</b> and currently <b>locked</b> <b>Зашифрований</b> гаманець <b>заблоковано</b> - + Backup Wallet Бекап гаманця - + Wallet Data (*.dat) Данi гаманця (*.dat) - + Backup Failed Помилка резервного копіювання - + There was an error trying to save the wallet data to the new location. Виникла помилка при спробі зберегти гаманець на нове місце. - + Dump Wallet Вивантажити гаманець - - + + Wallet dump (*.txt) Дамп гаманця (*.txt) - + Dump failed Вивантаження не вдалося - + An error happened while trying to save the keys to your location. Keys were not saved. Відбулася помилка під час спроби зберегти ключі до місця призначення. Ключі не були збережені. - + Dump successful Вивантаження успішне - + Keys were saved to this file: %2 Ключі були збережені у цей фаіл: %2 - + Import Wallet Імпортувати гаманець - + Import Failed Імпорт не вдався - + An error happened while trying to import the keys. Some or all keys from: %1, @@ -873,12 +884,12 @@ Some or all keys from: не були імпортовані до вашого гаманця. - + Import Successful Імпорт успішний - + All keys from: %1, were imported into your wallet. @@ -909,7 +920,7 @@ Some or all keys from: 0 - 0 + 0 @@ -923,7 +934,7 @@ Some or all keys from: 0.00 NVC - 0.00 NVC + 0.00 NVC @@ -1716,7 +1727,7 @@ This label turns red, if the priority is smaller than "medium". / 1 - / 1 + / 1 @@ -1780,11 +1791,11 @@ This label turns red, if the priority is smaller than "medium". 123.456 - 123.456 + 123.456 NVC - NVC + NVC @@ -2642,6 +2653,137 @@ Reduce the number of addresses involved in the address creation. + SecondAuthDialog + + Signatures - Sign / Verify a Message + Підписи - Підпис / Перевірка повідомлення + + + The address to sign the message with (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + Виберіть адресу, який буде використаний для підписання повідомлення (наприклад 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + Choose an address from the address book + Оберіть адресу з адресної книги + + + + Alt+A + Alt+A + + + + Second Authentication + + + + + You can sign hash of transaction exists in the blockchain with your addresses. + + + + + The address for authentification (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + + Paste hash from clipboard + + + + + Alt+P + Alt+P + + + + Copy the current signature to the system clipboard + Скопіювати поточну сигнатуру до системного буферу обміну + + + + Alt+C + + + + + Sign the hash + + + + Sign the message to prove you own this NovaCoin address + Підпишіть повідомлення щоб довести, що ви є власником цієї адреси + + + + &Sign Data + + + + + Reset all sign message fields + Скинути всі поля підпису повідомлення + + + + Clear &All + Очистити &все + + + + Enter a NovaCoin address (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + Введіть адресу NovaCoin (наприклад 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5) + + + + Click "Sign data" to generate signature + + + + + The entered address is invalid. + Введена нечинна адреса. + + + + + Please check the address and try again. + Будь ласка, перевірте адресу та спробуйте ще. + + + + The entered address does not refer to a key. + Введена адреса не відноситься до ключа. + + + + Wallet unlock was cancelled. + Розблокування гаманця було скасоване. + + + + Private key for the entered address is not available. + Приватний ключ для введеної адреси недоступний. + + + + No information available about transaction. + + + + + Message signing failed. + Не вдалося підписати повідомлення. + + + + Message signed. + Повідомлення підписано. + + + SendCoinsDialog @@ -2682,7 +2824,7 @@ Reduce the number of addresses involved in the address creation. 0 - 0 + 0 @@ -2696,7 +2838,7 @@ Reduce the number of addresses involved in the address creation. 0.00 NVC - 0.00 NVC + 0.00 NVC @@ -2785,7 +2927,7 @@ Reduce the number of addresses involved in the address creation. 123.456 NVC - 123.456 NVC + 123.456 NVC diff --git a/src/qt/secondauthdialog.cpp b/src/qt/secondauthdialog.cpp new file mode 100644 index 0000000..2f28103 --- /dev/null +++ b/src/qt/secondauthdialog.cpp @@ -0,0 +1,170 @@ +#include "secondauthdialog.h" +#include "ui_secondauthdialog.h" + +#include "addressbookpage.h" +#include "base58.h" +#include "guiutil.h" +#include "dialogwindowflags.h" +#include "init.h" +#include "main.h" +#include "optionsmodel.h" +#include "walletmodel.h" +#include "wallet.h" + +#include +#include + +#include +#include + +SecondAuthDialog::SecondAuthDialog(QWidget *parent) : + QWidget(parent, DIALOGWINDOWHINTS), + ui(new Ui::SecondAuthDialog), + model(0) +{ + ui->setupUi(this); + +#if (QT_VERSION >= 0x040700) + /* Do not move this to the XML file, Qt before 4.7 will choke on it */ + ui->addressIn->setPlaceholderText(tr("Enter a NovaCoin address (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5)")); + ui->signatureOut->setPlaceholderText(tr("Click \"Sign data\" to generate signature")); +#endif + + GUIUtil::setupAddressWidget(ui->addressIn, this); + + ui->addressIn->installEventFilter(this); + ui->messageIn->installEventFilter(this); + ui->signatureOut->installEventFilter(this); + + ui->signatureOut->setFont(GUIUtil::bitcoinAddressFont()); +} + +SecondAuthDialog::~SecondAuthDialog() +{ + delete ui; +} + +void SecondAuthDialog::setModel(WalletModel *model) +{ + this->model = model; +} + +void SecondAuthDialog::on_addressBookButton_clicked() +{ + if (model && model->getAddressTableModel()) + { + AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::ReceivingTab, this); + dlg.setModel(model->getAddressTableModel()); + if (dlg.exec()) + { + ui->addressIn->setText(dlg.getReturnValue()); + } + } +} + +void SecondAuthDialog::on_pasteButton_clicked() +{ + ui->messageIn->setText(QApplication::clipboard()->text()); +} + +void SecondAuthDialog::on_signMessageButton_clicked() +{ + /* Clear old signature to ensure users don't get confused on error with an old signature displayed */ + ui->signatureOut->clear(); + + CBitcoinAddress addr(ui->addressIn->text().toStdString()); + if (!addr.IsValid()) + { + ui->addressIn->setValid(false); + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); + ui->statusLabel->setText(tr("The entered address is invalid.") + QString(" ") + tr("Please check the address and try again.")); + return; + } + + CKeyID keyID; + if (!addr.GetKeyID(keyID)) + { + ui->addressIn->setValid(false); + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); + ui->statusLabel->setText(tr("The entered address does not refer to a key.") + QString(" ") + tr("Please check the address and try again.")); + return; + } + + WalletModel::UnlockContext ctx(model->requestUnlock()); + if (!ctx.isValid()) + { + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); + ui->statusLabel->setText(tr("Wallet unlock was cancelled.")); + return; + } + + CKey key; + if (!pwalletMain->GetKey(keyID, key)) + { + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); + ui->statusLabel->setText(tr("Private key for the entered address is not available.")); + return; + } + + uint256 hash; + hash.SetHex(ui->messageIn->text().toStdString()); + CTransaction tx; + uint256 hashBlock = 0; + if (!GetTransaction(hash, tx, hashBlock) || !hashBlock) { + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); + ui->statusLabel->setText(tr("No information available about transaction.")); + return; + } + + CDataStream ss(SER_GETHASH, 0); + ss << strMessageMagic; + ss << ui->messageIn->text().toStdString(); + + std::vector vchSig; + if (!key.SignCompact(Hash(ss.begin(), ss.end()), vchSig)) + { + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); + ui->statusLabel->setText(QString("") + tr("Message signing failed.") + QString("")); + return; + } + + ui->statusLabel->setStyleSheet("QLabel { color: green; }"); + ui->statusLabel->setText(QString("") + tr("Message signed.") + QString("")); + + ui->signatureOut->setText(QString::fromStdString(EncodeBase64(&vchSig[0], vchSig.size()))); +} + +void SecondAuthDialog::on_copySignatureButton_clicked() +{ + QApplication::clipboard()->setText(ui->signatureOut->text()); +} + +void SecondAuthDialog::on_clearButton_clicked() +{ + ui->addressIn->clear(); + ui->messageIn->clear(); + ui->signatureOut->clear(); + ui->statusLabel->clear(); + + ui->addressIn->setFocus(); +} + +bool SecondAuthDialog::eventFilter(QObject *object, QEvent *event) +{ + return QWidget::eventFilter(object, event); +} + +void SecondAuthDialog::keyPressEvent(QKeyEvent *event) +{ +#ifdef ANDROID + if(event->key() == Qt::Key_Back) + { + close(); + } +#else + if(event->key() == Qt::Key_Escape) + { + close(); + } +#endif +} diff --git a/src/qt/secondauthdialog.h b/src/qt/secondauthdialog.h new file mode 100644 index 0000000..1fa329c --- /dev/null +++ b/src/qt/secondauthdialog.h @@ -0,0 +1,42 @@ +#ifndef SECONDAUTHDIALOG_H +#define SECONDAUTHDIALOG_H + +#include + +namespace Ui { + class SecondAuthDialog; +} +class WalletModel; + +QT_BEGIN_NAMESPACE +QT_END_NAMESPACE + +class SecondAuthDialog : public QWidget +{ + Q_OBJECT + +public: + explicit SecondAuthDialog(QWidget *parent = 0); + ~SecondAuthDialog(); + + void setModel(WalletModel *model); + void setAddress(QString address); + +protected: + bool eventFilter(QObject *object, QEvent *event); + void keyPressEvent(QKeyEvent *); + +private: + Ui::SecondAuthDialog *ui; + WalletModel *model; + +private slots: + /* sign */ + void on_addressBookButton_clicked(); + void on_pasteButton_clicked(); + void on_signMessageButton_clicked(); + void on_copySignatureButton_clicked(); + void on_clearButton_clicked(); +}; + +#endif // SECONDAUTHDIALOG_H -- 1.7.1