-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.cpp
111 lines (91 loc) · 3.36 KB
/
mainwindow.cpp
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
// Copyright (C) 2019 Lubuntu
// This program 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.
// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDesktopServices>
#include <QUrl>
#include <QDir>
#include <QProcess>
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_buttonManual_clicked()
{
QString manualLink = "https://manual.lubuntu.me";
QDesktopServices::openUrl(QUrl(manualLink));
}
void MainWindow::on_buttonLXQtConfigurationCenter_clicked()
{
QProcess *process = new QProcess(this);
QString file = "/usr/bin/lxqt-config";
process->start(file);
}
void MainWindow::on_buttonCommunity_clicked()
{
QString communityLink = "https://lubuntu.me/links/";
QDesktopServices::openUrl(QUrl(communityLink));
}
void MainWindow::on_buttonContribute_clicked()
{
QString contributeLink = "https://manual.lubuntu.me/stable/B/Contributing.html";
QDesktopServices::openUrl(QUrl(contributeLink));
}
void MainWindow::on_buttonSoftware_clicked()
{
// Open Discover software center
QProcess *process = new QProcess(this);
QString file = "/usr/bin/plasma-discover";
process->start(file);
}
void MainWindow::on_buttonDonate_clicked()
{
// Open Lubuntu Donate link
QString donateLink = "https://lubuntu.me/donate/";
QDesktopServices::openUrl(QUrl(donateLink));
}
void MainWindow::on_buttonBugReports_clicked()
{
// Open Lubuntu Bug reporting wiki page
QString bugLink = "https://phab.lubuntu.me/w/bugs/";
QDesktopServices::openUrl(QUrl(bugLink));
}
void MainWindow::on_actionAbout_triggered()
{
// QAction: this class helps provide icons and images for individual methods
// http://doc.qt.io/qt-5/qaction.html
// I need to find out how to insert the Lubuntu logo with this method
QMessageBox::information(this, "About", "Created By:\n\nSamuel Banya (Developer)\nSimon Quigley (Lubuntu Release Manager)\nArtem Abutalipov (UX/UI Designer)\n\n© Lubuntu 2019");
}
void MainWindow::on_actionExit_triggered()
{
// Tell the user that since the checkbox is unchecked, the Welcome Center will NOT run on
// startup (COMMENTED OUT FOR LATER RESEARCH)
// Related Documentation:
// http://doc.qt.io/qt-5/qt.html#CheckState-enum
// if ui->checkBox->QCheckBox::checkState(Unchecked) {
// QMessageBox::information(this, "The Lubuntu Welcome Center will now NOT begin on startup.\nThank you for installing Lubuntu!");
// }
QApplication::quit();
}
void MainWindow::on_checkBox_stateChanged(int arg1)
{
// Add checkbox stateChanged functionality that depends on a boolean variable of it being checked:
// http://doc.qt.io/qt-5/qml-qtquick-controls-checkbox.html#checkedState-prop
}