Permalink
Browse files

Make Block Browser function as standalone window

  • Loading branch information...
Tranz5 committed Sep 1, 2014
1 parent 05625df commit 66c24346d4b6cc45423fc0e16f534101a3b65c9d
Showing with 40 additions and 62 deletions.
  1. +5 −9 src/qt/bitcoingui.cpp
  2. +1 −3 src/qt/bitcoingui.h
  3. +2 −2 src/qt/blockbrowser.cpp
  4. +2 −2 src/qt/blockbrowser.h
  5. +25 −25 src/qt/forms/blockbrowser.ui
  6. +1 −2 src/walletstack.h
  7. +3 −17 src/walletview.cpp
  8. +1 −2 src/walletview.h
View
@@ -256,20 +256,17 @@ void BitcoinGUI::createActions()
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction);
- blockAction = new QAction(QIcon(":/icons/blexp"), tr("&Block Explorer"), this);
- blockAction->setStatusTip(tr("Explore the BlockChain"));
- blockAction->setToolTip(blockAction->statusTip());
- blockAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
- blockAction->setCheckable(true);
- tabGroup->addAction(blockAction);
-
charityAction = new QAction(QIcon(":/icons/send"), tr("Stake For &Charity"), this);
charityAction->setStatusTip(tr("Enable Stake For Charity"));
charityAction->setToolTip(charityAction->statusTip());
- charityAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
+ charityAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
charityAction->setCheckable(true);
tabGroup->addAction(charityAction);
+ blockAction = new QAction(QIcon(":/icons/blexp"), tr("Block Bro&wser"), this);
+ blockAction->setStatusTip(tr("Explore the BlockChain"));
+ blockAction->setToolTip(blockAction->statusTip());
+
blocksIconAction = new QAction(QIcon(""), tr("Current &Block Info"), this);
blocksIconAction->setStatusTip(tr("Get Current Block Information"));
blocksIconAction->setToolTip(blocksIconAction->statusTip());
@@ -474,7 +471,6 @@ void BitcoinGUI::createToolBars()
toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar2->addAction(exportAction);
toolbar2->addAction(openRPCConsoleAction);
- toolbar2->addAction(blockAction);
}
void BitcoinGUI::setClientModel(ClientModel *clientModel)
View
@@ -17,7 +17,6 @@ class SendCoinsDialog;
class SignVerifyMessageDialog;
class Notificator;
class RPCConsole;
-class BlockBrowser;
class StakeForCharityDialog;
class CWallet;
@@ -73,7 +72,6 @@ class BitcoinGUI : public QMainWindow
private:
ClientModel *clientModel;
CWalletManager *walletManager;
- BlockBrowser *blockBrowser;
StakeForCharityDialog *stakeForCharityDialog;
QMap<QString, WalletModel*> mapWalletModels;
@@ -156,7 +154,7 @@ public slots:
void gotoReceiveCoinsPage(bool fExportOnly=false, bool fExportConnect=true, bool fExportFirstTime=false);
/** Switch to send coins page */
void gotoSendCoinsPage();
- /** Switch to block explorer page */
+ /** Switch to block browser page */
void gotoBlockBrowser();
/** Show Sign/Verify Message dialog and switch to sign message tab */
View
@@ -324,12 +324,12 @@ double getTxFees(std::string txid)
BlockBrowser::BlockBrowser(QWidget *parent) :
- QWidget(parent),
+ QDialog(parent, Qt::WindowMinMaxButtonsHint),
ui(new Ui::BlockBrowser)
{
ui->setupUi(this);
- setFixedSize(400, 420);
+ setBaseSize(850, 500);
connect(ui->blockButton, SIGNAL(pressed()), this, SLOT(blockClicked()));
connect(ui->txButton, SIGNAL(pressed()), this, SLOT(txClicked()));
View
@@ -5,7 +5,7 @@
#include "main.h"
#include "wallet.h"
#include "base58.h"
-#include <QWidget>
+#include <QDialog>
#include <QDir>
#include <QFile>
@@ -40,7 +40,7 @@ class BlockBrowser;
}
class ClientModel;
-class BlockBrowser : public QWidget
+class BlockBrowser : public QDialog
{
Q_OBJECT
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BlockBrowser</class>
- <widget class="QWidget" name="BlockBrowser">
+ <widget class="QDialog" name="BlockBrowser">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
@@ -12,8 +12,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>822</width>
- <height>524</height>
+ <width>850</width>
+ <height>500</height>
</rect>
</property>
<property name="sizePolicy">
@@ -32,7 +32,7 @@
<bool>false</bool>
</property>
<property name="windowTitle">
- <string>Form</string>
+ <string>Block Browser</string>
</property>
<layout class="QGridLayout">
<property name="sizeConstraint">
@@ -63,26 +63,26 @@
<number>7</number>
</property>
<item>
- <widget class="QLabel" name="labelBlockExplorer">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="styleSheet">
- <string notr="true">font-weight:bold;</string>
- </property>
- <property name="text">
- <string>Block Explorer</string>
- </property>
- </widget>
+ <widget class="QLabel" name="labelBlockExplorer">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">font-weight:bold;</string>
+ </property>
+ <property name="text">
+ <string>Block Browser</string>
+ </property>
+ </widget>
</item>
<item>
<spacer name="horizontalSpacerBE">
@@ -407,4 +407,4 @@
</widget>
<resources/>
<connections/>
-</ui>
+</ui>
View
@@ -23,7 +23,6 @@ class SendCoinsDialog;
class SignVerifyMessageDialog;
class Notificator;
class RPCConsole;
-class BlockBrowser;
class StakeForCharityDialog;
class CWalletManager;
@@ -78,7 +77,7 @@ public slots:
void gotoReceiveCoinsPage(bool fExportOnly=false, bool fExportConnect=true, bool fExportFirstTime=false);
/** Switch to send coins page */
void gotoSendCoinsPage();
- /** Switch to block explorer page */
+ /** Switch to block browser page */
void gotoBlockBrowser();
/** Show Sign/Verify Message dialog and switch to sign message tab */
View
@@ -55,7 +55,7 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
// Create tabs
overviewPage = new OverviewPage();
- blockBrowser = new BlockBrowser(this);
+ blockBrowser = new BlockBrowser(gui);
transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
@@ -78,7 +78,6 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
addWidget(addressBookPage);
addWidget(receiveCoinsPage);
addWidget(sendCoinsPage);
- addWidget(blockBrowser);
addWidget(stakeForCharityDialog);
@@ -142,17 +141,10 @@ void WalletView::createActions()
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction);
- blockAction = new QAction(QIcon(":/icons/blexp"), tr("&Block Explorer"), this);
- blockAction->setStatusTip(tr("Explore the BlockChain"));
- blockAction->setToolTip(blockAction->statusTip());
- blockAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
- blockAction->setCheckable(true);
- tabGroup->addAction(blockAction);
-
charityAction = new QAction(QIcon(":/icons/send"), tr("Stake For &Charity"), this);
charityAction->setStatusTip(tr("Enable Stake For Charity"));
charityAction->setToolTip(charityAction->statusTip());
- charityAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
+ charityAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
charityAction->setCheckable(true);
tabGroup->addAction(charityAction);
@@ -162,7 +154,6 @@ void WalletView::createActions()
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
- connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser()));
connect(charityAction, SIGNAL(triggered()), this, SLOT(charityClicked()));
encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this);
@@ -302,14 +293,9 @@ void WalletView::gotoOverviewPage()
void WalletView::gotoBlockBrowser()
{
- blockAction->setChecked(true);
- setCurrentWidget(blockBrowser);
-
- gui->exportAction->setEnabled(false);
- disconnect(gui->exportAction, SIGNAL(triggered()), 0, 0);
+ blockBrowser->show();
}
-
void WalletView::gotoHistoryPage(bool fExportOnly, bool fExportConnect, bool fExportFirstTime)
{
if (fExportOnly && historyAction->isChecked() )
View
@@ -99,7 +99,6 @@ class WalletView : public QStackedWidget
QAction *changePassphraseAction;
QAction *aboutQtAction;
QAction *openRPCConsoleAction;
- QAction *blockAction;
QAction *charityAction;
TransactionView *transactionView;
@@ -119,7 +118,7 @@ public slots:
void gotoReceiveCoinsPage(bool fExportOnly=false, bool fExportConnect=true, bool fExportFirstTime=false);
/** Switch to send coins page */
void gotoSendCoinsPage();
- /** Switch to block explorer page */
+ /** Switch to block browser page */
void gotoBlockBrowser();
/** Show Sign/Verify Message dialog and switch to sign message tab */

0 comments on commit 66c2434

Please sign in to comment.