Skip to content

Commit

Permalink
Merge pull request #838 from qtumproject/time/offlinestake-menu
Browse files Browse the repository at this point in the history
Grouping Staking, Delegations and Super Staking under one menu
  • Loading branch information
qtum-neil committed May 27, 2020
2 parents af9264a + 67e96c0 commit 18574c2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
39 changes: 16 additions & 23 deletions src/qt/bitcoingui.cpp
Expand Up @@ -326,12 +326,16 @@ void BitcoinGUI::createActions()
sendToContractAction = new QAction(tr("Send To"), this);
callContractAction = new QAction(tr("Call"), this);

stakeAction = new QAction(platformStyle->MultiStatesIcon(":/icons/tx_mined"), tr("&Stake"), this);
stakeAction->setStatusTip(tr("Show stake of wallet"));
stakeAction->setToolTip(stakeAction->statusTip());
stakeAction->setCheckable(true);
stakeAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(stakeAction);
walletStakeAction = new QAction(platformStyle->MultiStatesIcon(":/icons/tx_mined"), tr("&Stake"), this);
walletStakeAction->setStatusTip(tr("Show stake of wallet"));
walletStakeAction->setToolTip(walletStakeAction->statusTip());
walletStakeAction->setCheckable(true);
walletStakeAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(walletStakeAction);

stakeAction = new QAction(tr("Staking"), this);
delegationAction = new QAction(tr("Delegations"), this);
superStakerAction = new QAction(tr("Super Staking"), this);

QRCTokenAction = new QAction(platformStyle->MultiStatesIcon(":/icons/qrctoken"), tr("&QRC Tokens"), this);
QRCTokenAction->setStatusTip(tr("QRC Tokens (send, receive or add Tokens in list)"));
Expand All @@ -340,20 +344,6 @@ void BitcoinGUI::createActions()
QRCTokenAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(QRCTokenAction);

delegationAction = new QAction(platformStyle->MultiStatesIcon(":/icons/tx_mined"), tr("&Delegations"), this);
delegationAction->setStatusTip(tr("Delegate coins for staking to supers stakers"));
delegationAction->setToolTip(delegationAction->statusTip());
delegationAction->setCheckable(true);
delegationAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
tabGroup->addAction(delegationAction);

superStakerAction = new QAction(platformStyle->MultiStatesIcon(":/icons/tx_mined"), tr("S&uper Stakers"), this);
superStakerAction->setStatusTip(tr("Supers stakers (add, remove and configure super stakers)"));
superStakerAction->setToolTip(superStakerAction->statusTip());
superStakerAction->setCheckable(true);
superStakerAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
tabGroup->addAction(superStakerAction);

#ifdef ENABLE_WALLET
// These showNormalIfMinimized are needed because Send Coins and Receive Coins
// can be triggered from the tray menu, and need to show the GUI to be useful.
Expand Down Expand Up @@ -633,10 +623,12 @@ void BitcoinGUI::createToolBars()
contractActions.append(sendToContractAction);
contractActions.append(callContractAction);
appNavigationBar->mapGroup(smartContractAction, contractActions);
appNavigationBar->addAction(stakeAction);
QList<QAction*> walletStakeActions;
walletStakeActions.append(stakeAction);
walletStakeActions.append(delegationAction);
walletStakeActions.append(superStakerAction);
appNavigationBar->mapGroup(walletStakeAction, walletStakeActions);
appNavigationBar->addAction(QRCTokenAction);
appNavigationBar->addAction(delegationAction);
appNavigationBar->addAction(superStakerAction);
appNavigationBar->buildUi();
overviewAction->setChecked(true);
}
Expand Down Expand Up @@ -853,6 +845,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
stakeAction->setEnabled(enabled);
delegationAction->setEnabled(enabled);
superStakerAction->setEnabled(enabled);
walletStakeAction->setEnabled(enabled);
m_close_wallet_action->setEnabled(enabled);
}

Expand Down
1 change: 1 addition & 0 deletions src/qt/bitcoingui.h
Expand Up @@ -170,6 +170,7 @@ class BitcoinGUI : public QMainWindow
QAction* addTokenAction = nullptr;
QAction* delegationAction = nullptr;
QAction* superStakerAction = nullptr;
QAction* walletStakeAction = nullptr;
QAction* m_create_wallet_action{nullptr};
QAction* m_open_wallet_action{nullptr};
QMenu* m_open_wallet_menu{nullptr};
Expand Down
2 changes: 1 addition & 1 deletion src/qt/forms/modaloverlay.ui
Expand Up @@ -424,7 +424,7 @@
<item row="1" column="1">
<widget class="QLabel" name="labelMessage">
<property name="text">
<string>Please backup your wallet as soon
<string>Please backup your wallet as soon as possible.
Please make sure to keep an updated antivirus and operating system. We can not recover Your funds if you visit phishing site or lose your backup. Please make sure to keep backups of your private keys or files. We do not store your private keys on this wallet. And you as a user, are entirely responsible for your funds and your own security.</string>
</property>
<property name="alignment">
Expand Down

0 comments on commit 18574c2

Please sign in to comment.