This repository was archived by the owner on Mar 22, 2018. It is now read-only.
forked from demmm/welcome
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
79 lines (65 loc) · 2.23 KB
/
mainwindow.cpp
File metadata and controls
79 lines (65 loc) · 2.23 KB
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
/*
* Copyright (c) 2013-2016 Anke Boersma <demm@kaosx.us>
*
* 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 2 of the License, or
* (at your option) any later version.
*
*/
#include <QtGui>
#include <QMessageBox>
#include <QProcess>
#include <QDesktopWidget>
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QRect position = frameGeometry();
position.moveCenter(QDesktopWidget().availableGeometry().center());
move(position.topLeft());
Qt::WindowFlags flags;
flags = Qt::Window
| Qt::WindowMinimizeButtonHint
| Qt::WindowCloseButtonHint;
setFixedSize(680,400);
setWindowFlags( flags );
// signals/slots mechanism in action
this->connect(this->ui->pushButton_install, SIGNAL(clicked()), this, SLOT(InstallKaOS()));
this->connect(this->ui->pushButton_passw, SIGNAL(clicked()), this, SLOT(Passwords()));
this->connect(this->ui->pushButton_about, SIGNAL(clicked()), this, SLOT(About()));
this->connect(this->ui->pushButton_package, SIGNAL(clicked()), this, SLOT(PackageList()));
this->connect(this->ui->pushButton_guide, SIGNAL(clicked()), this, SLOT(Guide()));
this->connect(this->ui->pushButton_forum, SIGNAL(clicked()), this, SLOT(Forum()));
}
void MainWindow::InstallKaOS()
{
QProcess::startDetached("/usr/bin/launch-calamares.sh");
}
void MainWindow::Passwords()
{
QMessageBox::about(this,"Passwords",
"Correct passwords for use in the live session:\n"
"root: root / root\n"
"user: live / live\n"
"Hope you enjoy :)\n");
}
void MainWindow::About()
{
QDesktopServices::openUrl(QUrl("file:///home/live/Desktop/info/about.pdf"));
}
void MainWindow::PackageList()
{
QProcess::startDetached("/home/live/Desktop/info/packages.sh");
}
void MainWindow::Guide()
{
QDesktopServices::openUrl(QUrl("file:///home/live/Desktop/info/guide.pdf"));
}
void MainWindow::Forum()
{
QDesktopServices::openUrl(QUrl("http://forum.kaosx.us/"));
}