-
Notifications
You must be signed in to change notification settings - Fork 4
/
mainwindow.h
119 lines (90 loc) · 2.7 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "fgamewidget.h"
#include <QMainWindow>
#include <fgame.h>
#include <fdb.h>
#include <fcrawler.h>
#include <fclientupdater.h>
#include <QListWidgetItem>
#include <QSystemTrayIcon>
#include <QMenu>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
bool updateInProgress;
private slots:
void addGame(FGame game);
void on_actionSwitch_View_triggered();
void onGameClick(FGame *game, QObject *sender = NULL);
void onGameDoubleClicked(FGame *game, QObject *sender);
void onGameRightClicked(FGame *game, QObject *sender);
void on_GameInfoDialogFinished();
void on_pb_Min_clicked();
void on_pb_Max_clicked();
void on_pb_Close_clicked();
void on_tgw_GameIconButton_clicked();
void on_tabWidget_currentChanged(int index);
void ShowSettingsContextMenu(const QPoint& pos);
void on_pb_Settings_clicked();
void on_pb_LaunchGame_clicked();
void on_pb_LaunchRandom_clicked();
void resizeDone();
void reloadStylesheet();
void refreshList();
void on_launcherSet(FLauncher launcher);
void on_launcherEdited(FLauncher launcher);
void sttngsBtn_opnSttngs_triggered();
void sttngsBtn_addGame_triggered();
void sttngsBtn_edtGame_triggered();
void sttngsBtn_reportBug_triggered();
void launchRandomGame();
void trayLaunchGame();
protected:
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
private:
Ui::MainWindow *ui;
FGame *game;
FCrawler crawler;
FDB db;
FClientUpdater *cUpdater = new FClientUpdater();
QList<FGame*> gameList;
QList<FGameWidget*> gameWidgetList;
void changeView();
QLayout *gameScrollLayout;
QString currentStyle;
QMenu *settingsMenu;
int currentView;
void setView();
//Save GUI-Size on resize
void resizeEvent(QResizeEvent *event);
QTimer resizeTimer;
QString currentLanguage;
QTranslator appTranslator;
//Frameless Moving
QPoint dragPosition;
QSize initSize;
QRect initPos;
bool dragEnabled;
bool resizeHeightEnabled;
bool resizeWidthEnabled;
bool resizeWidthEnabledInv;
void prepareResize(QMouseEvent *event);
QGraphicsScene* sceneCover;
QGraphicsPixmapItem* itemCover;
void checkForUpdates();
QSystemTrayIcon *trayIcon;
void createTrayIcon();
void switchTranslator(QTranslator &translator, const QString &filename);
void loadLanguage(const QString &rLanguage);
};
#endif // MAINWINDOW_H