-
Notifications
You must be signed in to change notification settings - Fork 13
/
mainwindow.h
113 lines (102 loc) · 3.52 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
/**********************************************************************
* mainwindow.h
**********************************************************************
* Copyright (C) 2015-2024 MX Authors
*
* Authors: Adrian
* MX Linux <http://mxlinux.org>
*
* This file is part of MX Snapshot.
*
* MX Snapshot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MX Snapshot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MX Snapshot. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************/
#pragma once
#include <QMessageBox>
#include <QSettings>
#include <QTimer>
#include "settings.h"
#include "work.h"
class QCommandLineParser;
namespace Ui
{
class MainWindow;
}
class MainWindow : public QDialog, public Settings
{
Q_OBJECT
public:
explicit MainWindow(const QCommandLineParser &arg_parser = QCommandLineParser(), QWidget *parent = nullptr);
~MainWindow() override;
protected:
void keyPressEvent(QKeyEvent *event) override;
public slots:
void disableOutput();
void displayOutput();
void outputAvailable(const QString &out);
void procDone();
void procStart();
void processMsg(const QString &msg);
void processMsgBox(BoxType box_type, const QString &title, const QString &msg);
void progress();
private slots:
void btnAbout_clicked();
void btnBack_clicked();
void btnCancel_clicked();
void btnEditExclude_clicked();
void btnHelp_clicked();
void btnNext_clicked();
void btnSelectSnapshot_clicked();
void cbCompression_currentIndexChanged();
void checkMd5_toggled(bool checked);
void checkSha512_toggled(bool checked);
void excludeDesktop_toggled(bool checked);
void excludeDocuments_toggled(bool checked);
void excludeDownloads_toggled(bool checked);
void excludeFlatpaks_toggled(bool checked);
void excludeMusic_toggled(bool checked);
void excludeNetworks_toggled(bool checked);
void excludePictures_toggled(bool checked);
void excludeSteam_toggled(bool checked);
void excludeVideos_toggled(bool checked);
void excludeVirtualBox_toggled(bool checked);
void radioPersonal_clicked(bool checked);
void radioRespin_toggled(bool checked);
void spinCPU_valueChanged(int arg1);
void spinThrottle_valueChanged(int arg1);
private:
Ui::MainWindow *ui;
QTimer timer;
Work work;
QSettings settings;
[[nodiscard]] bool confirmStart();
[[noreturn]] void cleanUp();
bool installPackage(const QString &package);
void appendIsoExtension(QString &file_name) const;
void applyExclusions();
void checkNvidiaGraphicsCard();
void checkSaveWork();
void closeApp();
void editBootMenu();
void handleSelectionPage(const QString &file_name);
void handleSettingsPage(const QString &file_name);
void listFreeSpace();
void listUsedSpace();
void loadSettings();
void prepareForOutput(const QString &file_name);
void setConnections();
void setExclusions();
void setOtherOptions();
void setup();
void showErrorMessageBox(const QString &file_path);
};