Пример #1
0
void BitcreditGUI::createActions(const NetworkStyle *networkStyle)
{
    QActionGroup *tabGroup = new QActionGroup(this);

    overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this);
    overviewAction->setStatusTip(tr("Show general overview of wallet"));
    overviewAction->setToolTip(overviewAction->statusTip());
    overviewAction->setCheckable(true);
    overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
    tabGroup->addAction(overviewAction);

    sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this);
    sendCoinsAction->setStatusTip(tr("Send coins to a Bitcredit address"));
    sendCoinsAction->setToolTip(sendCoinsAction->statusTip());
    sendCoinsAction->setCheckable(true);
    sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
    tabGroup->addAction(sendCoinsAction);

    receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
    receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and bitcredit: URIs)"));
    receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
    receiveCoinsAction->setCheckable(true);
    receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
    tabGroup->addAction(receiveCoinsAction);

    historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
    historyAction->setStatusTip(tr("Browse transaction history"));
    historyAction->setToolTip(historyAction->statusTip());
    historyAction->setCheckable(true);
    historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
    tabGroup->addAction(historyAction);

	chatAction = new QAction(QIcon(":/icons/chat"), tr("&IRC"), this);
	chatAction->setToolTip(tr("View chat"));
	chatAction->setCheckable(true);
	tabGroup->addAction(chatAction);
	
	blockAction = new QAction(QIcon(":/icons/block"), tr("&Block Crawler"), this);
    blockAction->setToolTip(tr("Explore the BlockChain"));
    blockAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
    blockAction->setCheckable(true);
    tabGroup->addAction(blockAction);

    voteCoinsAction = new QAction(QIcon(":/icons/vote"), tr("&Vote/Rate"), this);
    voteCoinsAction->setStatusTip(tr("Vote in elections/ Rate a Bank"));
    voteCoinsAction->setToolTip(voteCoinsAction->statusTip());
    voteCoinsAction->setCheckable(true);
    voteCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
    tabGroup->addAction(voteCoinsAction);
    
	exchangeAction = new QAction(QIcon(":/icons/exchange"), tr("&Market Data"), this);
	exchangeAction->setToolTip(tr("Market"));
	exchangeAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
	exchangeAction->setCheckable(true);
	tabGroup->addAction(exchangeAction);    

    bankstatsAction = new QAction(QIcon(":/icons/bankstats"), tr("&Bank Statistics"), this);
    bankstatsAction->setToolTip(tr("Local and Global statistics"));
    bankstatsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_8));
    bankstatsAction->setCheckable(true);
    tabGroup->addAction(bankstatsAction);

    sendMessagesAction = new QAction(QIcon(":/icons/em"), tr("Send &Message"), this);
    sendMessagesAction->setToolTip(tr("Send Encrypted Messages or Requets"));
    sendMessagesAction->setCheckable(true);
    sendMessagesAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_9));
    tabGroup->addAction(sendMessagesAction);

    messageAction = new QAction(QIcon(":/icons/em"), tr("Mess&ages"), this);
    messageAction->setToolTip(tr("Encrypted Messaging"));
    messageAction->setCheckable(true);
    tabGroup->addAction(messageAction);

    invoiceAction = new QAction(QIcon(":/icons/em"), tr("&Invoices"), this);
    invoiceAction->setToolTip(tr("Encrypted Invoicing"));
    invoiceAction->setCheckable(true);
    tabGroup->addAction(invoiceAction);

    receiptAction = new QAction(QIcon(":/icons/em"), tr("Re&ceipts"), this);
    receiptAction->setToolTip(tr("Encrypted Receipting"));
    receiptAction->setCheckable(true);
    tabGroup->addAction(receiptAction);

    sendMessagesAnonAction = new QAction(QIcon(":/icons/em"), tr("S&end Messages"), this);
    sendMessagesAnonAction->setToolTip(tr("Send Anonymous Message"));
    sendMessagesAnonAction->setCheckable(true);
    tabGroup->addAction(sendMessagesAnonAction);

#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.
    connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
    connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
    connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
    connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
	connect(chatAction, SIGNAL(triggered()), this, SLOT(gotoChatPage()));
	connect(exchangeAction, SIGNAL(triggered()), this, SLOT(gotoExchangeBrowserPage()));
	connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser()));
	connect(bankstatsAction, SIGNAL(triggered()), this, SLOT(gotoBankStatisticsPage()));
    connect(voteCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(voteCoinsAction, SIGNAL(triggered()), this, SLOT(gotoVoteCoinsPage()));
    connect(sendMessagesAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(sendMessagesAction, SIGNAL(triggered()), this, SLOT(gotoSendMessagesPage()));
    connect(messageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(messageAction, SIGNAL(triggered()), this, SLOT(gotoMessagesPage()));
    connect(invoiceAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(invoiceAction, SIGNAL(triggered()), this, SLOT(gotoInvoicesPage()));
    connect(receiptAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    connect(receiptAction, SIGNAL(triggered()), this, SLOT(gotoReceiptPage()));
    connect(sendMessagesAnonAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
    
	
#endif // ENABLE_WALLET

    quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
    quitAction->setStatusTip(tr("Quit application"));
    quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
    quitAction->setMenuRole(QAction::QuitRole);
    aboutAction = new QAction(QIcon(":/icons/about"), tr("&About Bitcredit Core"), this);
    aboutAction->setStatusTip(tr("Show information about Bitcredit Core"));
    aboutAction->setMenuRole(QAction::AboutRole);
    aboutQtAction = new QAction(QIcon(":/icons/about_qt"), tr("About &Qt"), this);
    aboutQtAction->setStatusTip(tr("Show information about Qt"));
    aboutQtAction->setMenuRole(QAction::AboutQtRole);
    optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
    optionsAction->setStatusTip(tr("Modify configuration options for Bitcredit Core"));
    optionsAction->setMenuRole(QAction::PreferencesRole);
    toggleHideAction = new QAction(QIcon(":/icons/mini"), tr("&Show / Hide"), this);
    toggleHideAction->setStatusTip(tr("Show or hide the main Window"));

    encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this);
    encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet"));
    encryptWalletAction->setCheckable(true);
    backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this);
    backupWalletAction->setStatusTip(tr("Backup wallet to another location"));
    changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this);
    changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption"));
    signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this);
    signMessageAction->setStatusTip(tr("Sign messages with your Bitcredit addresses to prove you own them"));
    verifyMessageAction = new QAction(QIcon(":/icons/verify"), tr("&Verify message..."), this);
    verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcredit addresses"));
    paperWalletAction = new QAction(QIcon(":/icons/print"), tr("&Print paper wallets"), this);
    paperWalletAction->setStatusTip(tr("Print paper wallets"));

    openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this);
    openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console"));

    usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Sending addresses..."), this);
    usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels"));
    usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Receiving addresses..."), this);
    usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels"));

    openAction = new QAction(QIcon(":/icons/open"), tr("Open &URI..."), this);
    openAction->setStatusTip(tr("Open a bitcredit: URI or payment request"));

    showHelpMessageAction = new QAction(QIcon(":/icons/info"), tr("&Command-line options"), this);
    showHelpMessageAction->setStatusTip(tr("Show the Bitcredit Core help message to get a list with possible Bitcredit command-line options"));

    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
    connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
    connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden()));
    connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked()));
#ifdef ENABLE_WALLET
    if(walletFrame)
    {
        connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool)));
        connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet()));
        connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase()));
        connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));
        connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab()));
        connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses()));
        connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses()));
        connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked()));
        connect(paperWalletAction, SIGNAL(triggered()), walletFrame, SLOT(printPaperWallets()));
    }
#endif
}
Пример #2
0
void BitcreditGUI::createToolBars()  
{
    if(walletFrame)
    {
        // menu/back button
        bover = new QPushButton(this);
        bover->setFixedWidth(830);
        bover->setFixedHeight(50);
        bover->setObjectName("bover");
        bover->move(10,565);
        bover->setText(" <<< Menu <<<");
        connect(bover, SIGNAL(clicked()), this, SLOT(gotoOverviewPage()));
        bover->hide();
        
        // sendrec 'toolbar' with send and receive 'tabs'
        sendrec = new QWidget(this);
        sendrec->setFixedHeight(25);
        sendrec->setFixedWidth(830);
        sendrec->move(10, 135);
        sendrec->hide();
        
        bsendtab = new QPushButton(sendrec);
        bsendtab->setFixedHeight(25);
        bsendtab->setFixedWidth(415);
        bsendtab->move(0,0);
        bsendtab->setText("Send");
        bsendtab->setObjectName("bsendtab");
        bsendtab->setCheckable(true);
        connect(bsendtab, SIGNAL(clicked()), this, SLOT(gotoSendCoinsPage()));
        
        brectab = new QPushButton(sendrec);
        brectab->setFixedHeight(25);
        brectab->setFixedWidth(415);
        brectab->move(415,0);
        brectab->setText("Receive");
        brectab->setObjectName("brectab");
        brectab->setCheckable(true);
        connect(brectab, SIGNAL(clicked()), this, SLOT(gotoReceiveCoinsPage()));

        // p2p finance page lend / borrow toolbar
        p2p = new QWidget(this);
        p2p->setFixedHeight(25);
        p2p->setFixedWidth(830);
        p2p->move(10, 135);
        p2p->setObjectName("uands");
        p2p->hide();

        bborrow = new QPushButton(p2p);
        bborrow->setFixedHeight(25);
        bborrow->setFixedWidth(415);
        bborrow->move(0,0);
        bborrow->setText("Borrow BCR");
        bborrow->setObjectName("bborrow");
        bborrow->setCheckable(true);
        connect(bborrow, SIGNAL(clicked()), this, SLOT(gotoP2PPage()));
        
        blend = new QPushButton(p2p);
        blend->setFixedHeight(25);
        blend->setFixedWidth(415);
        blend->move(415,0);
        blend->setText("Lend BCR");
        blend->setObjectName("blend");
        blend->setCheckable(true);
        connect(blend, SIGNAL(clicked()), this, SLOT(gotoP2PLPage()));

        // utilities and settings 'toolbar'
        uands = new QWidget(this);
        uands->setFixedHeight(25);
        uands->setFixedWidth(830);
        uands->move(10, 135);
        uands->setObjectName("uands");
        uands->hide();

        bbcrstatstab = new QPushButton(uands);
        bbcrstatstab->setFixedHeight(25);
        bbcrstatstab->setFixedWidth(207);
        bbcrstatstab->move(0,0);
        bbcrstatstab->setText("BCR Network Stats");
        bbcrstatstab->setObjectName("bbcrstatstab");
        bbcrstatstab->setCheckable(true);
        bbcrstatstab->setObjectName("bbcrstatstab");
        connect(bbcrstatstab, SIGNAL(clicked()), this, SLOT(gotoUtilitiesPage()));

        bexplorertab = new QPushButton(uands);
        bexplorertab->setFixedHeight(25);
        bexplorertab->setFixedWidth(207);
        bexplorertab->move(208, 0);
        bexplorertab->setText("Block Explorer");
        bexplorertab->setObjectName("bexplorertab");
        bexplorertab->setCheckable(true);
        bexplorertab->setObjectName("bexplorertab");
        connect(bexplorertab, SIGNAL(clicked()), this, SLOT(gotoBlockExplorerPage()));
        
        bmarkettab = new QPushButton(uands);
        bmarkettab->setFixedHeight(25);
        bmarkettab->setFixedWidth(207);
        bmarkettab->move(416, 0);
        bmarkettab->setText("Market Data");
        bmarkettab->setObjectName("bmarkettab");
        bmarkettab->setCheckable(true);
        bmarkettab->setObjectName("bmarkettab");
        connect(bmarkettab, SIGNAL(clicked()), this, SLOT(gotoExchangeBrowserPage()));

        bothertab = new QPushButton(uands);
        bothertab->setFixedHeight(25);
        bothertab->setFixedWidth(206);
        bothertab->move(624, 0);
        bothertab->setText("Other Stuff");
        bothertab->setObjectName("bothertab");
        bothertab->setCheckable(true);
        bothertab->setObjectName("bothertab");
        connect(bothertab, SIGNAL(clicked()), this, SLOT(gotoOtherPage()));
     }
}