diff options
Diffstat (limited to 'workspace/LogReceiver/ndgui.cpp')
| -rw-r--r-- | workspace/LogReceiver/ndgui.cpp | 79 |
1 files changed, 78 insertions, 1 deletions
diff --git a/workspace/LogReceiver/ndgui.cpp b/workspace/LogReceiver/ndgui.cpp index 78aa280..a839aef 100644 --- a/workspace/LogReceiver/ndgui.cpp +++ b/workspace/LogReceiver/ndgui.cpp @@ -1,4 +1,6 @@ #include "ndgui.h" +#include "chooseinterfacedialog.h" +#include "abortbootdialog.h" ndgui::ndgui(QWidget *parent) : QWidget(parent) @@ -93,6 +95,7 @@ void ndgui::handleConnectionEstablished(QString ifName) { void ndgui::handleAbortBoot(QString msg) { qDebug() << "abort boot. reason:" << msg; + showAbortBootDialog(); } void ndgui::handleUpdateStatusLabel(QString ifName, QString status) { @@ -103,5 +106,79 @@ void ndgui::handleUpdateStatusLabel(QString ifName, QString status) { void ndgui::handleAllProcessesFinished() { qDebug() << "all Processes finished"; - mainLayout-> + if (finalUsableInterfaces.size() > 0) { + showChooseInterfaceDialog(); + } else { + showAbortBootDialog(); + } +} + +void ndgui::showAbortBootDialog() { + aBD = new AbortBootDialog(this); + connect(aBD, SIGNAL(showLogSignal()), this, SLOT(showLog())); + connect(aBD, SIGNAL(restartSignal()), this, SLOT(restartSystem())); + connect(aBD, SIGNAL(shutDownSignal()), this, SLOT(shutDownSystem())); + aBD->setModal(true); + aBD->show(); +} + +void ndgui::showChooseInterfaceDialog() { + cID = new ChooseInterfaceDialog(finalUsableInterfaces, this); + connect(cID, SIGNAL(continueSignal(QString)), this, + SLOT(continueBoot(QString))); + connect(cID, SIGNAL(restartSignal()), this, SLOT(restartSystem())); + connect(cID, SIGNAL(shutDownSignal()), this, SLOT(shutDownSystem())); + cID->setModal(true); + cID->show(); +} + +void ndgui::restartSystem() +{ + + if(qobject_cast<AbortBootDialog*>(QObject::sender())>0) + { + qDebug() << "received Signal restart abd"; + aBD->closeDialog(); + } + else if(qobject_cast<ChooseInterfaceDialog*>(QObject::sender())>0) + { + qDebug() << "received Signal restart cid"; + cID->close(); + } + else + { + qDebug() << "unknown sender" << QObject::sender(); + } + + +} + +void ndgui::shutDownSystem() +{ + if(qobject_cast<AbortBootDialog*>(QObject::sender())>0) + { + + aBD->closeDialog(); + } + else if(qobject_cast<ChooseInterfaceDialog*>(QObject::sender())>0) + { + + cID->close(); + } + else + { + qDebug() << "unknown sender" << QObject::sender(); + } + +} + +void ndgui::continueBoot(QString ifName) +{ + QString text = "continue with interface: " + ifName; + cID->close(); +} + +void ndgui::showLog() +{ + qDebug() << "show log"; } |
