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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project. // Copyright (c) 2020-2021, The Monero Project.
#include "ccsprogressdelegate.h" #include "CCSProgressDelegate.h"
#include <QApplication> #include <QApplication>

View file

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

View file

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

View file

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

View file

@ -3,14 +3,15 @@
#include "LocalMoneroWidget.h" #include "LocalMoneroWidget.h"
#include "ui_LocalMoneroWidget.h" #include "ui_LocalMoneroWidget.h"
#include <QMessageBox>
#include <QMenu>
#include "dialog/LocalMoneroInfoDialog.h"
#include "utils/ColorScheme.h" #include "utils/ColorScheme.h"
#include "utils/Icons.h" #include "utils/Icons.h"
#include "utils/NetworkManager.h" #include "utils/NetworkManager.h"
#include "utils/WebsocketNotifier.h" #include "utils/WebsocketNotifier.h"
#include "dialog/LocalMoneroInfoDialog.h"
#include <QMessageBox>
#include <QMenu>
LocalMoneroWidget::LocalMoneroWidget(QWidget *parent, QSharedPointer<AppContext> ctx) LocalMoneroWidget::LocalMoneroWidget(QWidget *parent, QSharedPointer<AppContext> ctx)
: QWidget(parent) : QWidget(parent)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,15 +1,16 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project. // 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 <QStandardItemModel>
#include <QTableWidget> #include <QTableWidget>
#include <QMessageBox>
#include <QDesktopServices>
#include <QScrollBar>
#include <QFileDialog>
#include "xmrigwidget.h"
#include "ui_xmrigwidget.h"
#include "utils/Icons.h" #include "utils/Icons.h"
XMRigWidget::XMRigWidget(QSharedPointer<AppContext> ctx, QWidget *parent) XMRigWidget::XMRigWidget(QSharedPointer<AppContext> ctx, QWidget *parent)

View file

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