forked from netpipe/cannachat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
300 lines (224 loc) · 7.17 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QProcess>
#include <QPlainTextEdit>
#include <QThread>
#include "ircclient.h"
#include <QVector>
#include <vector>
#include <QListWidgetItem>
#include <QTreeWidgetItem>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlError>
#ifdef SOUND
#include <QMediaPlayer>
#endif
//#include "src/encryption/rsa/Rsa.h"
#include <QEvent>
#include <QThread>
#include <QDebug>
#include <QCryptographicHash>
#include <QGraphicsView>
#include <QTabWidget>
#include "src/downloadmanager.h"
#ifdef MEDIAPLAYER
#include <QMouseEvent>
#include <QStringListModel>
#include <QDropEvent>
#include <QMimeData>
#include "src/mpqt/audiothread.h"
#include "src/mpqt/scanner.h"
#include "src/mpqt/track.h"
#include "src/mpqt/trackmodel.h"
#include "src/mpqt/trackdelegate.h"
#include "src/mpqt/playlistManager.h"
#include <src/downloadmanager.h>
#endif
//#define IRRLICHT
#ifdef IRRLICHT
#include <QGLWidget>
#include "irrutil.h"
#include "irrlichtwidget.h"
//IrrlichtWidget* widget2 ;
#endif
using namespace std;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
void importThemeInfoFromFile();
void loadThemeFile(QString path, QString name);
// virtual void resizeEvent(QResizeEvent *event);
MainWindow(QWidget *parent = 0);
bool eventFilter( QObject *o, QEvent *e );
bool loaded=false;
QString fileName;
void resizeEvent(QResizeEvent* event);
void themeInit();
void writesettings();
void readsettings();
void on_smtptestmessage_clicked();
QString GetRandomString(int length,QString chars);
QString GetReallyRandomString(int length,QString chars);
void createEmailTable();
void EmailInsertWallet();
void getEmailSettings();
~MainWindow();
#ifdef SOUND
QMediaPlayer*player;
void playsound(QString test);
qint64 curseconds;
#endif
vector<IrcClient*> serverarray;
bool bsaving;
void unCompress(QString filename , QString ofilename);
void Compress(QString filename , QString ofilename);
int adminftp=0;
QString decodetxQR();
int smtpsend(QString toemail,QString Message);
#if DOWNLOAD
void Download(QString URL);
DownloadManager manager;
#endif
//encryption
QString encryptxor(QString test,QString key);
QString decryptxor(QString string,QString key);
QByteArray md5Checksum(QString stuff);
QByteArray fileChecksum(const QString &fileName,QCryptographicHash::Algorithm hashAlgorithm);
QString rot13( const QString & input );
QString simplecrypt(QString string,QString key,QCryptographicHash::Algorithm hash);
QString simpledecrypt(QString string,QString key,QCryptographicHash::Algorithm hash);
#ifdef ENCRYPTION
Rsa *rsaTester;
BigInt m_e, m_n;
QString aesKey;
#endif
QString encdec(QString ,int );
QString encdec2(QString ,int );
#ifdef ENCRYPTION
QString rsaenc(QString input, Rsa *rsa = NULL);
QString rsadec(QString input, Rsa *rsa);
#endif
QByteArray aesenc(QString input,QString,QString);
QString aesdec(QByteArray input,QString,QString);
QByteArray EncryptMsg(QString plainMsg,QString aeskey1,QString aeskey2);
#ifdef ENCRYPTION
QString DecryptMsg(QByteArray encryptedMsg, Rsa *rsa,QString aeskey1,QString aeskey2);
#endif
void GenerateQRCode(QString data);
void EAN13(QString productname,QString country,QString ean,QGraphicsView *graphicsView);
QString decodeqr(QString image);
void QRCode(QString text2);
#ifdef PYTHON
//python
void settext();
void qtPython();
#endif
void parseSearch();
#ifdef MEDIAPLAYER
QVideoWidget *vidplayer;
//void playsound(QString);
///////
/// \brief trackModel
///
TrackModel *trackModel;
AudioThread *audio;
Scanner *scanner;
PlaylistManager *m_playlistDB = nullptr;
QList<Track *> tracklist;
QPoint dragPos;
bool moving,shuffle;
short repeatMode;
long position;
QAction *clearAction,*scanAction;
protected:
void addItem(QString s);
void dropEvent(QDropEvent *e);
void dragEnterEvent(QDragEnterEvent *e);
void setRepeatModeIcon();
void nextTrack(bool next);
bool hasNextTrack();
public slots:
void onFindMusic(QString);
//void onStartOfPlayback(double total);
void onStartOfPlayback();
void onEndOfPlayback();
void onPauseOfPlayback();
void onCurPos(double position, double total);
void onSlidertime(QString sliderduration,qint64 duration,qint64 progress);
void onFileAdded(QString file);
void onClearList();
//void onFindMusic();
private slots:
void on_closeButton_clicked();
void on_horizontalSlider_sliderPressed();
void on_horizontalSlider_sliderReleased();
void seek(int seconds);
void on_pushButton_play_clicked();
void on_pushButton_repeat_clicked();
void on_pushButton_shuffle_clicked();
void on_pushButton_prev_clicked();
void on_pushButton_next_clicked();
void on_listView_clicked(const QModelIndex &index);
void showContextMenuForWidget(const QPoint &pos);
void stopScanner();
#endif
private slots:
void on_actionExit_triggered();
void on_actionNew_triggered();
void on_actionClose_triggered();
void on_actionRestore_triggered();
void on_themeApply_clicked();
void on_scantheme_clicked();
void on_cmbTheme_currentIndexChanged(const QString &arg1);
void on_connect_clicked();
void on_actionSave_triggered();
void on_addserver_clicked();
void on_removeserver_clicked();
void on_addchannel_clicked();
void on_removechannel_clicked();
void on_serveredit_clicked();
void on_editchannel_clicked();
void on_joinchannel_clicked();
void on_channelList_clicked(const QModelIndex &index);
void on_serverlist_clicked(const QModelIndex &index);
void on_serverlist_currentRowChanged(int currentRow);
void on_ftpserver_clicked();
void on_smtpsave_clicked();
void on_scan_clicked();
void on_generate_clicked();
void on_savetofile_clicked();
void on_asciigen_clicked();
void on_asciito_editingFinished();
void on_pushButton_clicked();
void on_tabWidget_currentChanged(int index);
void on_pushButton_2_clicked();
void on_pushButton_3_clicked();
void on_chooseStationbtn_clicked();
// void on_txtIds_currentRowChanged(int currentRow);
void on_comboBox_currentIndexChanged(const QString &arg1);
void on_refreshbtn_clicked();
void on_txtNames_currentRowChanged(int currentRow);
void on_playstationbtn_clicked();
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
void on_stationurls_itemDoubleClicked(QListWidgetItem *item);
void on_txtNames_itemDoubleClicked(QListWidgetItem *item);
void on_pushButton_4_clicked();
void on_pushButton_5_clicked();
void on_pyrun_clicked();
private:
QSqlDatabase db;
//IrcClient *ircwidget;
#ifdef IRRLICHT
IrrlichtWidget* widget ;
#endif
Ui::MainWindow *ui;
QString m_trackDuration;
DownloadManager *dlmanager;
};
#endif // MAINWINDOW_H