summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Bauer2011-04-25 16:33:51 +0200
committerJonathan Bauer2011-04-25 16:33:51 +0200
commit79de7cb99904109346870bc95fc2eef585c500d0 (patch)
tree4ca9d843cf714273297dbbc941bf22d00a8ff0f0 /src
parentloading system page improved display logic (diff)
downloadfbgui-79de7cb99904109346870bc95fc2eef585c500d0.tar.gz
fbgui-79de7cb99904109346870bc95fc2eef585c500d0.tar.xz
fbgui-79de7cb99904109346870bc95fc2eef585c500d0.zip
1sec delay between loading page showing & preparing kexec
Diffstat (limited to 'src')
-rw-r--r--src/fbgui.cpp28
-rw-r--r--src/fbgui.h13
2 files changed, 19 insertions, 22 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index b55fb9c..45524eb 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -63,7 +63,7 @@ fbgui::fbgui() {
SLOT(updateProgressBar(const int&, const double&, const QString&)));
QObject::connect(dm, SIGNAL(downloadQueueEmpty()), jsi, SLOT(
callbackOnFinished()));
- QObject::connect(dm, SIGNAL(downloadQueueEmpty()), this, SLOT(showLoadSystem()));
+ QObject::connect(dm, SIGNAL(downloadQueueEmpty()), this, SLOT(loadSystem()));
// move download manager to its own thread
dm->moveToThread(&dmThread);
@@ -350,6 +350,14 @@ void fbgui::performReboot() {
//-------------------------------------------------------------------------------------------
// Preparing Kernel Switch per kexec (initiating Stage 3)
//-------------------------------------------------------------------------------------------
+void fbgui::loadSystem() {
+ //show loading system page.
+ //_webView->disconnect(this);
+ //QObject::connect(_webView, SIGNAL(loadFinished(bool)), this, SLOT(prepareKexec()));
+ _webView->load(QUrl("qrc:/html/loadsystem.html"));
+ QTimer::singleShot(1000, this, SLOT(prepareKexec()));
+}
+//-------------------------------------------------------------------------------------------
/**
* This method prepares kexec.
*
@@ -426,9 +434,9 @@ void fbgui::prepareKexec() {
*
*/
void fbgui::runKexec() {
- QProcess *process = new QProcess(this);
- process->startDetached("kexec -e");
- if (!process->waitForStarted()) {
+ QProcess process;
+ process.startDetached("kexec -e");
+ if (!process.waitForStarted()) {
qxtLog->debug() << "[gui] Failed to execute: kexec -e";
qxtLog->debug() << "[gui] Exiting in 5 seconds...";
QTimer::singleShot(5000, this, SLOT(close()));
@@ -479,15 +487,5 @@ void fbgui::toggleDebugConsole() {
}
//-------------------------------------------------------------------------------------------
//
+
//-------------------------------------------------------------------------------------------
-void fbgui::showLoadSystem() {
- //show loading system page.
- _webView->disconnect(this);
- QObject::connect(_webView, SIGNAL(loadFinished(bool)), this, SLOT(prepareKexec()));
- _webView->load(QUrl("qrc:/html/loadsystem.html"));
-}
-//-------------------------------------------------------------------------------------------
-void fbgui::quitFailure() {
-}
-void fbgui::quitSuccess() {
-}
diff --git a/src/fbgui.h b/src/fbgui.h
index 9d19ec2..35197d8 100644
--- a/src/fbgui.h
+++ b/src/fbgui.h
@@ -103,8 +103,8 @@ private slots:
// toggles debug console when action _toggleDebugConsole happens.
void toggleDebugConsole();
- // triggered by fileChanged Signal of _watcher
- // deletes _watcher, since we don't need it anymore and tries to load URL.
+ // This function is triggered by fileChanged Signal of _watcher.
+ // It deletes _watcher, since we don't need it anymore and tries to load URL.
void prepareURLLoad();
void loadURLDone(bool success);
@@ -112,13 +112,12 @@ private slots:
void performShutDown();
// reboot the system
void performReboot();
- // Kexec
- void showLoadSystem();
+ // shows "loading system" page
+ void loadSystem();
+ // prepares kexec by loading downloaded initramfs, kernel into kexec
void prepareKexec();
+ // executes: kexec -e
void runKexec();
- void quitSuccess();
- void quitFailure();
-
};
#endif // FBGUI_H