forked from Matoking/ScryptMiner-GUI
-
Notifications
You must be signed in to change notification settings - Fork 5
/
mainwindow.h
121 lines (81 loc) · 2 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <QProcess>
#include <QTime>
#include <QTimer>
#include <QStringList>
#include <QMap>
#include <QSettings>
#include <QEvent>
#include <QMenu>
#include <QDialog>
#include <QIcon>
#include <QFile>
#include <QSystemTrayIcon>
#include "json.h"
// Log types
#define STARTED 0
#define SHARE_SUCCESS 1
#define SHARE_FAIL 2
#define ERROR 3
#define LONGPOLL 4
#define FATAL_ERROR 5
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
QString appDirPath;
QIcon inactiveIcon;
QIcon activeIcon;
QSystemTrayIcon *trayIcon;
bool minerActive;
QNetworkAccessManager *networkManager;
QProcess *minerProcess;
QMap<int, double> threadSpeed;
QTimer *readTimer;
QTimer *poolTimer;
QFile *outputFile;
int acceptedShares;
int rejectedShares;
int roundAcceptedShares;
int roundRejectedShares;
int initThreads;
public slots:
//
void changeEvent(QEvent *);
void setAppDirPath();
void startPressed();
void createTrayActions();
QStringList getArgs();
void startMining();
void stopMining();
// Window manipulation stuff
void resizeElements();
void showMainWindow();
void hideMainWindow();
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
void updateSpeed();
void updatePoolData();
void checkSettings();
void saveSettings();
void recordOutput(QString text);
void reportToList(QString, int, QString);
void minerStarted();
void minerError(QProcess::ProcessError);
void minerFinished(int, QProcess::ExitStatus);
void poolDataLoaded(QNetworkReply*);
void readProcessOutput();
QString getTime(QString);
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H