Widgets: cleanup

This commit is contained in:
tobtoht 2021-06-27 17:00:09 +02:00
parent 00d2c1b953
commit 6c3b691ae9
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
23 changed files with 86 additions and 80 deletions

View file

@ -7,7 +7,6 @@
#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QMenu>
#include <utility>
#include "appcontext.h"
#include "components.h"
@ -31,8 +30,8 @@
#include "model/CoinsProxyModel.h"
#include "utils/networking.h"
#include "utils/config.h"
#include "widgets/ccswidget.h"
#include "widgets/redditwidget.h"
#include "widgets/CCSWidget.h"
#include "widgets/RedditWidget.h"
#include "widgets/TickerWidget.h"
#include "wizard/WalletWizard.h"
@ -49,7 +48,7 @@
#endif
#ifdef HAS_XMRIG
#include "widgets/xmrigwidget.h"
#include "widgets/XMRigWidget.h"
#endif
namespace Ui {

View file

@ -5,8 +5,9 @@
#define FEATHER_SENDWIDGET_H
#include <QWidget>
#include "appcontext.h"
#include "widgets/ccswidget.h"
#include "widgets/CCSWidget.h"
namespace Ui {
class SendWidget;

View file

@ -4,12 +4,12 @@
#ifndef FEATHER_SETTINGS_H
#define FEATHER_SETTINGS_H
#include <QAbstractButton>
#include <QDialog>
#include <QSettings>
#include <QAbstractButton>
#include "appcontext.h"
#include "widgets/nodewidget.h"
#include "widgets/NodeWidget.h"
namespace Ui {
class Settings;

View file

@ -670,7 +670,7 @@
<customwidget>
<class>NodeWidget</class>
<extends>QWidget</extends>
<header>widgets/nodewidget.h</header>
<header>widgets/NodeWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>

View file

@ -1,13 +1,13 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include "ccsprogressdelegate.h"
#include "CCSProgressDelegate.h"
#include <QApplication>
CCSProgressDelegate::CCSProgressDelegate(CCSModel *model, QWidget *parent)
: QStyledItemDelegate(parent)
, m_model(model)
: QStyledItemDelegate(parent)
, m_model(model)
{
}

View file

@ -5,6 +5,7 @@
#define FEATHER_CSSPROGRESSDELEGATE_H
#include <QStyledItemDelegate>
#include "model/CCSModel.h"
class CCSProgressDelegate : public QStyledItemDelegate

View file

@ -1,19 +1,20 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include "CCSWidget.h"
#include "ui_CCSWidget.h"
#include <QDesktopServices>
#include <QStandardItemModel>
#include <QTableWidget>
#include <QDesktopServices>
#include "ccswidget.h"
#include "ui_ccswidget.h"
#include "ccsprogressdelegate.h"
#include "CCSProgressDelegate.h"
CCSWidget::CCSWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::CSSWidget),
m_model(new CCSModel(this)),
m_contextMenu(new QMenu(this))
CCSWidget::CCSWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::CSSWidget)
, m_model(new CCSModel(this))
, m_contextMenu(new QMenu(this))
{
ui->setupUi(this);
auto progressDelegate = new CCSProgressDelegate(m_model, this);

View file

@ -4,15 +4,15 @@
#ifndef FEATHER_CSSWIDGET_H
#define FEATHER_CSSWIDGET_H
#include <QItemDelegate>
#include <QMenu>
#include <QObject>
#include <QWidget>
#include <QProgressBar>
#include <QItemDelegate>
#include <QWidget>
#include "widgets/CCSEntry.h"
#include "model/CCSModel.h"
#include "appcontext.h"
#include "model/CCSModel.h"
#include "widgets/CCSEntry.h"
namespace Ui {
class CSSWidget;

View file

@ -3,19 +3,20 @@
#include "LocalMoneroWidget.h"
#include "ui_LocalMoneroWidget.h"
#include "utils/ColorScheme.h"
#include "utils/Icons.h"
#include "utils/NetworkManager.h"
#include "utils/WebsocketNotifier.h"
#include "dialog/LocalMoneroInfoDialog.h"
#include <QMessageBox>
#include <QMenu>
#include "dialog/LocalMoneroInfoDialog.h"
#include "utils/ColorScheme.h"
#include "utils/Icons.h"
#include "utils/NetworkManager.h"
#include "utils/WebsocketNotifier.h"
LocalMoneroWidget::LocalMoneroWidget(QWidget *parent, QSharedPointer<AppContext> ctx)
: QWidget(parent)
, ui(new Ui::LocalMoneroWidget)
, m_ctx(std::move(ctx))
: QWidget(parent)
, ui(new Ui::LocalMoneroWidget)
, m_ctx(std::move(ctx))
{
ui->setupUi(this);

View file

@ -6,8 +6,8 @@
#include <QWidget>
#include "appcontext.h"
#include "api/LocalMoneroApi.h"
#include "appcontext.h"
#include "model/LocalMoneroModel.h"
namespace Ui {

View file

@ -1,15 +1,17 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include <QInputDialog>
#include <QTableWidget>
#include <QMessageBox>
#include "NodeWidget.h"
#include "ui_NodeWidget.h"
#include <QAction>
#include <QDesktopServices>
#include <QInputDialog>
#include <QMenu>
#include <QMessageBox>
#include <QTableWidget>
#include "model/NodeModel.h"
#include "nodewidget.h"
#include "ui_nodewidget.h"
#include "mainwindow.h"
#include "utils/Icons.h"
NodeWidget::NodeWidget(QWidget *parent)

View file

@ -4,9 +4,10 @@
#ifndef FEATHER_NODEWIDGET_H
#define FEATHER_NODEWIDGET_H
#include <QWidget>
#include <QTreeView>
#include <QItemSelection>
#include <QTreeView>
#include <QWidget>
#include "appcontext.h"
#include "model/NodeModel.h"
#include "utils/nodes.h"
@ -44,10 +45,13 @@ signals:
void nodeSourceChanged(NodeSource nodeSource);
private:
void showContextMenu(const QPoint &pos, const FeatherNode &node);
FeatherNode selectedNode();
QScopedPointer<Ui::NodeWidget> ui;
QSharedPointer<AppContext> m_ctx;
NodeModel* m_customModel;
NodeModel* m_wsModel;
NodeModel *m_customModel;
NodeModel *m_wsModel;
QTreeView *m_activeView;
@ -55,9 +59,6 @@ private:
QAction *m_contextActionRemove;
QAction *m_contextActionOpenStatusURL;
QAction *m_contextActionCopy;
void showContextMenu(const QPoint &pos, const FeatherNode &node);
FeatherNode selectedNode();
};
#endif // FEATHER_NODEWIDGET_H

View file

@ -7,10 +7,8 @@
#include <QtGlobal>
#include <QScrollBar>
#include "utils/utils.h"
#include "model/ModelUtils.h"
#include "libwalletqt/WalletManager.h"
#include "model/ModelUtils.h"
PayToEdit::PayToEdit(QWidget *parent) : QPlainTextEdit(parent)
{

View file

@ -1,21 +1,22 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include "RedditWidget.h"
#include "ui_RedditWidget.h"
#include <QDesktopServices>
#include <QStandardItemModel>
#include <QTableWidget>
#include <QDesktopServices>
#include "model/RedditModel.h"
#include "redditwidget.h"
#include "ui_redditwidget.h"
#include "utils/utils.h"
#include "utils/config.h"
RedditWidget::RedditWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::RedditWidget),
m_model(new RedditModel(this)),
m_contextMenu(new QMenu(this))
RedditWidget::RedditWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::RedditWidget)
, m_model(new RedditModel(this))
, m_contextMenu(new QMenu(this))
{
ui->setupUi(this);
ui->tableView->setModel(m_model);

View file

@ -4,9 +4,9 @@
#ifndef FEATHER_REDDITWIDGET_H
#define FEATHER_REDDITWIDGET_H
#include <QItemSelection>
#include <QMenu>
#include <QWidget>
#include <QItemSelection>
#include "model/RedditModel.h"

View file

@ -10,8 +10,8 @@
#include "constants.h"
RestoreHeightWidget::RestoreHeightWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::RestoreHeightWidget)
: QWidget(parent)
, ui(new Ui::RestoreHeightWidget)
{
ui->setupUi(this);

View file

@ -8,9 +8,9 @@
#include "utils/AppData.h"
TickerWidgetBase::TickerWidgetBase(QWidget *parent, QSharedPointer<AppContext> ctx)
: QWidget(parent)
, ui(new Ui::TickerWidget)
, m_ctx(std::move(ctx))
: QWidget(parent)
, ui(new Ui::TickerWidget)
, m_ctx(std::move(ctx))
{
ui->setupUi(this);
@ -50,8 +50,8 @@ void TickerWidgetBase::setFiatText(double amount, const QString &fiatCurrency) {
// BalanceTickerWidget
BalanceTickerWidget::BalanceTickerWidget(QWidget *parent, QSharedPointer<AppContext> ctx, bool totalBalance)
: TickerWidgetBase(parent, std::move(ctx))
, m_totalBalance(totalBalance)
: TickerWidgetBase(parent, std::move(ctx))
, m_totalBalance(totalBalance)
{
if (totalBalance)
this->setTitle("Total balance");
@ -76,8 +76,8 @@ void BalanceTickerWidget::updateDisplay() {
// PriceTickerWidget
PriceTickerWidget::PriceTickerWidget(QWidget *parent, QSharedPointer<AppContext> ctx, QString symbol)
: TickerWidgetBase(parent, std::move(ctx))
, m_symbol(std::move(symbol))
: TickerWidgetBase(parent, std::move(ctx))
, m_symbol(std::move(symbol))
{
this->setTitle(m_symbol);

View file

@ -1,24 +1,25 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include "XMRigWidget.h"
#include "ui_XMRigWidget.h"
#include <QDesktopServices>
#include <QFileDialog>
#include <QMessageBox>
#include <QScrollBar>
#include <QStandardItemModel>
#include <QTableWidget>
#include <QMessageBox>
#include <QDesktopServices>
#include <QScrollBar>
#include <QFileDialog>
#include "xmrigwidget.h"
#include "ui_xmrigwidget.h"
#include "utils/Icons.h"
XMRigWidget::XMRigWidget(QSharedPointer<AppContext> ctx, QWidget *parent)
: QWidget(parent)
, ui(new Ui::XMRigWidget)
, m_ctx(std::move(ctx))
, m_XMRig(new XmRig(Config::defaultConfigDir().path()))
, m_model(new QStandardItemModel(this))
, m_contextMenu(new QMenu(this))
: QWidget(parent)
, ui(new Ui::XMRigWidget)
, m_ctx(std::move(ctx))
, m_XMRig(new XmRig(Config::defaultConfigDir().path()))
, m_model(new QStandardItemModel(this))
, m_contextMenu(new QMenu(this))
{
ui->setupUi(this);

View file

@ -8,9 +8,9 @@
#include <QWidget>
#include <QItemSelection>
#include "appcontext.h"
#include "utils/xmrig.h"
#include "utils/config.h"
#include "appcontext.h"
namespace Ui {
class XMRigWidget;