Skip to content

Commit 41f3515

Browse files
author
limxdev
committed
Change Menusettings
1 parent 9d8e9eb commit 41f3515

4 files changed

Lines changed: 21 additions & 19 deletions

File tree

src/qt/bitcoingui.cpp

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ void BitcoinGUI::createActions()
364364
// FXTC TODO: menu items
365365
//-//unlockWalletAction = new QAction(tr("&Unlock Wallet..."), this);
366366
//-//unlockWalletAction->setToolTip(tr("Unlock wallet"));
367-
//-//lockWalletAction = new QAction(tr("&Lock Wallet"), this);
367+
lockWalletAction = new QAction(tr("&Lock Wallet"), this);
368368
//
369369

370370
// Megacoin
@@ -497,7 +497,7 @@ void BitcoinGUI::createActions()
497497
// Dash
498498
// FXTC TODO: menu items
499499
connect(unlockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(unlockWallet()));
500-
//connect(lockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(lockWallet()));
500+
connect(lockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(lockWallet()));
501501
//
502502

503503
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
@@ -565,7 +565,7 @@ void BitcoinGUI::createMenuBar()
565565
// Dash
566566
// FXTC TODO: menu items
567567
settings->addAction(unlockWalletAction);
568-
//-//settings->addAction(lockWalletAction);
568+
settings->addAction(lockWalletAction);
569569
//
570570

571571
// BitCore
@@ -1425,11 +1425,8 @@ void BitcoinGUI::setEncryptionStatus(int status)
14251425
labelWalletEncryptionIcon->hide();
14261426
encryptWalletAction->setChecked(false);
14271427
changePassphraseAction->setEnabled(false);
1428-
// Dash
1429-
// FXTC TODO: menu items
1430-
//unlockWalletAction->setEnabled(true);
1431-
//-//lockWalletAction->setVisible(false);
1432-
//
1428+
unlockWalletAction->setVisible(false);
1429+
lockWalletAction->setVisible(false);
14331430
encryptWalletAction->setEnabled(true);
14341431
break;
14351432
case WalletModel::Unlocked:
@@ -1438,11 +1435,8 @@ void BitcoinGUI::setEncryptionStatus(int status)
14381435
labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
14391436
encryptWalletAction->setChecked(true);
14401437
changePassphraseAction->setEnabled(true);
1441-
// Dash
1442-
// FXTC TODO: menu items
1443-
unlockWalletAction->setEnabled(true);
1444-
//-//lockWalletAction->setVisible(true);
1445-
//
1438+
unlockWalletAction->setEnabled(false);
1439+
lockWalletAction->setVisible(true);
14461440
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
14471441
break;
14481442
// Dash
@@ -1466,12 +1460,11 @@ void BitcoinGUI::setEncryptionStatus(int status)
14661460
labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
14671461
encryptWalletAction->setChecked(true);
14681462
changePassphraseAction->setEnabled(true);
1469-
// Dash
1470-
// FXTC TODO: menu items
1471-
unlockWalletAction->setEnabled(true);
1472-
//-//lockWalletAction->setVisible(false);
1473-
//
1474-
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
1463+
unlockWalletAction->setVisible(true);
1464+
//unlockWalletAction->setEnabled(true);
1465+
lockWalletAction->setVisible(false);
1466+
encryptWalletAction->setEnabled(false);
1467+
encryptWalletAction->setVisible(false);
14751468
break;
14761469
}
14771470
}

src/qt/bitcoingui.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class BitcoinGUI : public QMainWindow
127127
QAction* changePassphraseAction = nullptr;
128128
// Dash
129129
QAction *unlockWalletAction = nullptr;
130+
QAction *lockWalletAction = nullptr;
130131
//
131132
QAction* aboutQtAction = nullptr;
132133
QAction* openRPCConsoleAction = nullptr;

src/qt/walletframe.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ void WalletFrame::unlockWallet()
204204
walletView->unlockWallet();
205205
}
206206

207+
void WalletFrame::lockWallet()
208+
{
209+
WalletView *walletView = currentWalletView();
210+
if (walletView)
211+
walletView->lockWallet();
212+
}
213+
207214
//Bitcore BEGIN
208215
void WalletFrame::unlockWalletAndKeepUnlocked()
209216
{

src/qt/walletframe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public Q_SLOTS:
9393
void changePassphrase();
9494
/** Ask for passphrase to unlock wallet temporarily */
9595
void unlockWallet();
96+
void lockWallet();
9697
/** Ask for passphrase to unlock wallet till application closes */
9798
void unlockWalletAndKeepUnlocked();
9899

0 commit comments

Comments
 (0)