Browse Source

Final bugs squished for plugin system & AllAccounts.

cl-refactor
Gav Wood 10 years ago
parent
commit
c4f3c3683f
  1. 13
      alethzero/AllAccounts.cpp
  2. 16
      alethzero/AllAccounts.h
  3. 1
      alethzero/MainFace.cpp
  4. 4
      alethzero/MainFace.h

13
alethzero/AllAccounts.cpp

@ -36,9 +36,18 @@ AllAccounts::AllAccounts(MainFace* _m):
Plugin(_m, "AllAccounts"),
m_ui(new Ui::AllAccounts)
{
m_ui->setupUi(dock());
dock(Qt::RightDockWidgetArea, "All Accounts")->setWidget(new QWidget());
m_ui->setupUi(dock()->widget());
installWatches();
refresh();
connect(m_ui->accounts, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), SLOT(on_accounts_currentItemChanged()));
connect(m_ui->accounts, SIGNAL(doubleClicked(QModelIndex)), SLOT(on_accounts_doubleClicked()));
connect(m_ui->refreshAccounts, SIGNAL(clicked()), SLOT(refresh()));
connect(m_ui->accountsFilter, SIGNAL(textChanged(QString)), SLOT(onAllChange()));
connect(m_ui->showBasic, SIGNAL(toggled(bool)), SLOT(onAllChange()));
connect(m_ui->showContracts, SIGNAL(toggled(bool)), SLOT(onAllChange()));
connect(m_ui->onlyNamed, SIGNAL(toggled(bool)), SLOT(onAllChange()));
}
AllAccounts::~AllAccounts()
@ -72,7 +81,7 @@ void AllAccounts::refresh()
->setData(Qt::UserRole, QByteArray((char const*)i.data(), Address::size));
}
#endif
m_refreshAccounts->setEnabled(false);
m_ui->refreshAccounts->setEnabled(false);
}
void AllAccounts::onAllChange()

16
alethzero/AllAccounts.h

@ -34,8 +34,10 @@ namespace dev
namespace az
{
class AllAccounts: public Plugin
class AllAccounts: public QObject, public Plugin
{
Q_OBJECT
public:
AllAccounts(MainFace* _m);
~AllAccounts();
@ -43,21 +45,13 @@ public:
private slots:
void on_accounts_currentItemChanged();
void on_accounts_doubleClicked();
void on_refreshAccounts_clicked() { refresh(); }
void on_accountsFilter_textChanged() { onAllChange(); }
void on_showBasic_toggled() { onAllChange(); }
void on_showContracts_toggled() { onAllChange(); }
void on_onlyNamed_toggled() { onAllChange(); }
private:
void onAllChange();
void installWatches();
void refresh();
private:
void installWatches();
Ui::AllAccounts* m_ui;
QAction* m_refreshAccounts;
};
}

1
alethzero/MainFace.cpp

@ -39,6 +39,7 @@ QDockWidget* Plugin::dock(Qt::DockWidgetArea _area, QString _title)
{
m_dock = new QDockWidget(_title, m_main);
m_main->addDockWidget(_area, m_dock);
m_dock->setFeatures(QDockWidget::AllDockWidgetFeatures | QDockWidget::DockWidgetVerticalTitleBar);
}
return m_dock;
}

4
alethzero/MainFace.h

@ -87,9 +87,9 @@ public:
virtual void onAllChange() {}
private:
MainFace* m_main;
MainFace* m_main = nullptr;
std::string m_name;
QDockWidget* m_dock;
QDockWidget* m_dock = nullptr;
};
}

Loading…
Cancel
Save