Skip to content

Commit

Permalink
Clicking on Encryption Icon will unlock wallet for mint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranz5 committed May 27, 2014
1 parent d6f3978 commit ee47e8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
frameBlocksLayout->setContentsMargins(3,0,3,0);
frameBlocksLayout->setSpacing(3);
labelEncryptionIcon = new QLabel();
labelEncryptionIcon = new GUIUtil::ClickableLabel();

labelConnectionsIcon = new GUIUtil::ClickableLabel();
connect(labelConnectionsIcon, SIGNAL(clicked()),this,SLOT(connectionIconClicked()));
Expand Down Expand Up @@ -576,6 +576,15 @@ void BitcoinGUI::blocksIconClicked()
,CClientUIInterface::MODAL);
}

void BitcoinGUI::lockIconClicked()
{
if(!walletModel)
return;

if(walletModel->getEncryptionStatus() == WalletModel::Locked)
unlockWalletForMint();
}

void BitcoinGUI::connectionIconClicked()
{

Expand Down Expand Up @@ -1000,6 +1009,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
unlockWalletAction->setEnabled(false);
lockWalletAction->setEnabled(false);
encryptWalletAction->setEnabled(true);
disconnect(labelEncryptionIcon,SIGNAL(clicked()), this, SLOT(lockIconClicked()));labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
break;
case WalletModel::Unlocked:
labelEncryptionIcon->show();
Expand All @@ -1012,6 +1022,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
unlockWalletAction->setEnabled(false);
lockWalletAction->setEnabled(true);
disconnect(labelEncryptionIcon,SIGNAL(clicked()), this, SLOT(lockIconClicked()));
break;
case WalletModel::Locked:
labelEncryptionIcon->show();
Expand All @@ -1024,6 +1035,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
unlockWalletAction->setEnabled(true);
lockWalletAction->setEnabled(false);
connect(labelEncryptionIcon,SIGNAL(clicked()), this, SLOT(lockIconClicked()));
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ private slots:
void aboutClicked();
/** Show information about network */
void blocksIconClicked();
/** Allow user to unlock wallet from click */
void lockIconClicked();
/** Show information about peers */
void connectionIconClicked();
#ifndef Q_OS_MAC
Expand Down

0 comments on commit ee47e8f

Please sign in to comment.