Skip to content

Commit

Permalink
Refine MetaDExCancelDialog 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 ebfbc0e commit 72d6e30
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 75 deletions.
79 changes: 23 additions & 56 deletions src/qt/metadexcanceldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,32 @@
#include "metadexcanceldialog.h"
#include "ui_metadexcanceldialog.h"

#include "addresstablemodel.h"
#include "bitcoinunits.h"
#include "coincontroldialog.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include "mastercore.h"
#include "mastercore_errors.h"
#include "mastercore_mdex.h"
#include "omnicore_createpayload.h"
#include "omnicore_qtutils.h"

#include "clientmodel.h"
#include "walletmodel.h"
#include "wallet.h"
#include "base58.h"
#include "coincontrol.h"
#include "ui_interface.h"
#include "walletmodel.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 <stdint.h>
#include <stdio.h> // printf!
#include <map>
#include <sstream>
#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 "json/json_spirit_value.h"
#include "leveldb/db.h"
#include "leveldb/write_batch.h"
// end potentially overzealous includes
using namespace json_spirit; // since now using Array in mastercore.h this needs to come first

#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_mdex.h"
#include "mastercore_parse_string.h"
#include "mastercore_tx.h"
#include "mastercore_sp.h"
#include "mastercore_errors.h"
#include "omnicore_qtutils.h"
#include "omnicore_createpayload.h"
#include <vector>

#include <QDateTime>
#include <QDialog>
#include <QMessageBox>
#include <QScrollBar>
#include <QTextDocument>
#include <QString>
#include <QWidget>

using std::ostringstream;
using std::string;
using namespace mastercore;

MetaDExCancelDialog::MetaDExCancelDialog(QWidget *parent) :
QDialog(parent),
Expand All @@ -87,6 +50,10 @@ MetaDExCancelDialog::MetaDExCancelDialog(QWidget *parent) :
UpdateAddressSelector();
}

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

/**
* Sets the client model.
Expand Down
25 changes: 6 additions & 19 deletions src/qt/metadexcanceldialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
#ifndef METADEXCANCELDIALOG_H
#define METADEXCANCELDIALOG_H

#include "clientmodel.h"
#include "walletmodel.h"

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

class OptionsModel;
class ClientModel;
class WalletModel;

QT_BEGIN_NAMESPACE
class QUrl;
class QWidget;
class QString;
QT_END_NAMESPACE

namespace Ui {
Expand All @@ -30,34 +26,25 @@ class MetaDExCancelDialog : public QDialog

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

void setClientModel(ClientModel *model);
void setWalletModel(WalletModel *model);

/** 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);

QLayout *dlgLayout;
QTextEdit *dlgTextEdit;
QDialogButtonBox *buttonBox;
QPushButton *closeButton;


public slots:
void SendCancelTransaction();
void UpdateAddressSelector();
void UpdateCancelCombo();
void RefreshUI();
void fromAddressComboBoxChanged(int);


private:
Ui::MetaDExCancelDialog *ui;
ClientModel *clientModel;
WalletModel *walletModel;

private slots:
// None!

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

0 comments on commit 72d6e30

Please sign in to comment.