2020-10-14 20:12:32 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
// Copyright (c) 2020, The Monero Project.
|
|
|
|
|
|
|
|
#ifndef XMRIGWIDGET_H
|
|
|
|
#define XMRIGWIDGET_H
|
|
|
|
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QItemSelection>
|
|
|
|
|
|
|
|
#include "utils/xmrig.h"
|
|
|
|
#include "utils/config.h"
|
2020-10-16 19:01:18 +00:00
|
|
|
#include "appcontext.h"
|
2020-10-14 20:12:32 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class XMRigWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class XMRigWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-10-16 19:01:18 +00:00
|
|
|
explicit XMRigWidget(AppContext *ctx, QWidget *parent = nullptr);
|
2020-10-14 20:12:32 +00:00
|
|
|
~XMRigWidget();
|
|
|
|
QStandardItemModel *model();
|
|
|
|
|
|
|
|
public slots:
|
2020-10-16 19:01:18 +00:00
|
|
|
void onWalletClosed();
|
|
|
|
void onWalletOpened();
|
2020-10-14 20:12:32 +00:00
|
|
|
void onStartClicked();
|
|
|
|
void onStopClicked();
|
|
|
|
void onClearClicked();
|
|
|
|
void onDownloads(const QJsonObject &data);
|
|
|
|
void linkClicked();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onBrowseClicked();
|
|
|
|
void onProcessError(const QString &msg);
|
|
|
|
void onProcessOutput(const QByteArray &msg);
|
|
|
|
void onThreadsValueChanged(int date);
|
|
|
|
void onPoolChanged(int pos);
|
|
|
|
void onHashrate(const QString &hashrate);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void miningStarted();
|
|
|
|
void miningEnded();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void showContextMenu(const QPoint &pos);
|
|
|
|
|
2020-10-16 19:01:18 +00:00
|
|
|
AppContext *m_ctx;
|
2020-10-14 20:12:32 +00:00
|
|
|
Ui::XMRigWidget *ui;
|
|
|
|
QStandardItemModel *m_model;
|
|
|
|
QMenu *m_contextMenu;
|
|
|
|
unsigned int m_threads;
|
|
|
|
QStringList m_urls;
|
2020-10-16 19:01:18 +00:00
|
|
|
QStringList m_pools{"pool.xmr.pt:9000", "pool.supportxmr.com:9000", "mine.xmrpool.net:443", "xmrpool.eu:9999", "xmr-eu1.nanopool.org:14433", "pool.minexmr.com:6666", "us-west.minexmr.com:6666", "monerohash.com:9999"};
|
2020-10-14 20:12:32 +00:00
|
|
|
XMRig *m_rig;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // REDDITWIDGET_H
|