mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-17 07:11:29 +02:00
70 lines
1.6 KiB
C++
70 lines
1.6 KiB
C++
// SPDX-License-Identifier: BSD-3-Clause
|
|
// SPDX-FileCopyrightText: The Monero Project
|
|
|
|
#ifndef FEATHER_NODEWIDGET_H
|
|
#define FEATHER_NODEWIDGET_H
|
|
|
|
#include <QItemSelection>
|
|
#include <QTreeView>
|
|
#include <QWidget>
|
|
|
|
#include "model/NodeModel.h"
|
|
#include "utils/nodes.h"
|
|
|
|
namespace Ui {
|
|
class NodeWidget;
|
|
}
|
|
|
|
class NodeModel;
|
|
class QCheckBox;
|
|
class NodeWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit NodeWidget(QWidget *parent = nullptr);
|
|
~NodeWidget();
|
|
void setWSModel(NodeModel *model);
|
|
void setCustomModel(NodeModel *model);
|
|
void setupUI(Nodes *nodes);
|
|
void setCanConnect(bool canConnect);
|
|
NodeModel* model();
|
|
|
|
public slots:
|
|
void onCustomAddClicked();
|
|
void onShowWSContextMenu(const QPoint &pos);
|
|
void onShowCustomContextMenu(const QPoint &pos);
|
|
void onWebsocketStatusChanged();
|
|
|
|
private slots:
|
|
void onContextConnect();
|
|
void onContextCustomNodeRemove();
|
|
void onContextStatusURL();
|
|
void onContextNodeCopy();
|
|
|
|
signals:
|
|
void connectToNode(FeatherNode node);
|
|
void nodeSourceChanged(NodeSource nodeSource);
|
|
void localNodeToggled(bool enabled);
|
|
|
|
private:
|
|
void showContextMenu(const QPoint &pos, const FeatherNode &node);
|
|
FeatherNode selectedNode();
|
|
|
|
QScopedPointer<Ui::NodeWidget> ui;
|
|
QCheckBox *m_localNodeCheck = nullptr;
|
|
Nodes *m_nodes;
|
|
NodeModel *m_customModel;
|
|
NodeModel *m_wsModel;
|
|
bool m_canConnect = true;
|
|
|
|
QTreeView *m_activeView;
|
|
|
|
QAction *m_contextActionConnect;
|
|
QAction *m_contextActionRemove;
|
|
QAction *m_contextActionOpenStatusURL;
|
|
QAction *m_contextActionCopy;
|
|
};
|
|
|
|
#endif // FEATHER_NODEWIDGET_H
|