Skip to content

Commit

Permalink
Refine LookupTXDialog includes
Browse files Browse the repository at this point in the history
 - add destructor
 - remove unused members
 - remove unused headers
 - forward declare classes
 - sort headers
 - ...
  • Loading branch information
dexX7 committed May 18, 2015
1 parent 2e2ede3 commit 745bbb0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 87 deletions.
87 changes: 22 additions & 65 deletions src/qt/lookuptxdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,89 +5,46 @@
#include "lookuptxdialog.h"
#include "ui_lookuptxdialog.h"

#include "guiutil.h"
#include "optionsmodel.h"
#include "walletmodel.h"
#include "wallet.h"
#include "base58.h"
#include "ui_interface.h"

#include <boost/filesystem.hpp>

#include "leveldb/db.h"
#include "leveldb/write_batch.h"

// potentially overzealous includes here
#include "base58.h"
#include "rpcserver.h"
#include "init.h"
#include "util.h"
#include <fstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <string>
#include <boost/assign/list_of.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/find.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include "json/json_spirit_utils.h"
#include "mastercore_errors.h"
#include "mastercore_rpc.h"

#include "uint256.h"

#include "json/json_spirit_value.h"
#include "leveldb/db.h"
#include "leveldb/write_batch.h"
// end potentially overzealous includes
#include "json/json_spirit_writer_template.h"

using namespace json_spirit;
#include "mastercore.h"
using namespace mastercore;

// potentially overzealous using here
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace leveldb;
// end potentially overzealous using

#include "mastercore_dex.h"
#include "mastercore_tx.h"
#include "mastercore_sp.h"
#include "mastercore_rpc.h"
#include "mastercore_errors.h"
#include <string>

#include <QDialog>
#include <QDialogButtonBox>
#include <QMessageBox>
#include <QScrollBar>
#include <QTextDocument>

#include <QClipboard>
#include <QDrag>
#include <QMimeData>
#include <QMouseEvent>
#include <QPixmap>
#include <QMenu>
#if QT_VERSION < 0x050000
#include <QUrl>
#endif
#include <QString>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QWidget>

using std::string;
using namespace json_spirit;

LookupTXDialog::LookupTXDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::LookupTXDialog),
model(0)
ui(new Ui::LookupTXDialog)
{
ui->setupUi(this);
this->model = model;

#if QT_VERSION >= 0x040700
// populate placeholder text
ui->searchLineEdit->setPlaceholderText("Search transaction");
#endif

// connect actions
connect(ui->searchButton, SIGNAL(clicked()), this, SLOT(searchButtonClicked()));
}

LookupTXDialog::~LookupTXDialog()
{
delete ui;
}

void LookupTXDialog::searchTX()
{
// search function to lookup address
Expand Down
27 changes: 5 additions & 22 deletions src/qt/lookuptxdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,33 @@
#ifndef LOOKUPTXDIALOG_H
#define LOOKUPTXDIALOG_H

#include "walletmodel.h"

#include <QDialog>
#include <QString>
#include <QImage>
#include <QLabel>
#include <QTextEdit>
#include <QDialogButtonBox>

class OptionsModel;

QT_BEGIN_NAMESPACE
class QUrl;
class QString;
class QWidget;
QT_END_NAMESPACE

namespace Ui {
class LookupTXDialog;
}

/** Dialog for looking up Master Protocol txns */
/** Dialog for looking up Omni Layer transactions */
class LookupTXDialog : public QDialog
{
Q_OBJECT

public:
explicit LookupTXDialog(QWidget *parent = 0);
~LookupTXDialog();

void searchTX();
/** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
*/
QWidget *setupTabChain(QWidget *prev);
QDialog *txDlg;
QLayout *dlgLayout;
QTextEdit *dlgTextEdit;
QDialogButtonBox *buttonBox;
QPushButton *closeButton;

public slots:
void searchButtonClicked();

private:
Ui::LookupTXDialog *ui;
WalletModel *model;

//private slots:

signals:
// Fired when a message should be reported to the user
Expand Down

0 comments on commit 745bbb0

Please sign in to comment.