diff options
author | Andreas Loibl <andreas@andreas-loibl.de> | 2011-03-17 05:07:10 +0100 |
---|---|---|
committer | Andreas Loibl <andreas@andreas-loibl.de> | 2011-03-17 05:07:10 +0100 |
commit | 00286a5db286e21a766b6af057052dc5d17561ad (patch) | |
tree | 7232dadf6dc3570705c3104fe0c000f480c7a0ee /mainwizard.cpp | |
download | acritoxinstaller-00286a5db286e21a766b6af057052dc5d17561ad.zip acritoxinstaller-00286a5db286e21a766b6af057052dc5d17561ad.tar.gz |
Initial commit
Diffstat (limited to 'mainwizard.cpp')
-rw-r--r-- | mainwizard.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/mainwizard.cpp b/mainwizard.cpp new file mode 100644 index 0000000..25df6f1 --- /dev/null +++ b/mainwizard.cpp @@ -0,0 +1,84 @@ +#include <QtGui> +#include "mainwizard.h" +#include "listdelegate.h" +#include "listitem.h" +#include "wizard/welcome.h" +#include "wizard/partitions.h" +#include "wizard/partmansel.h" +#include "wizard/partman.h" +#include "wizard/rootpartition.h" +#include "wizard/bootloader.h" +#include "wizard/rootpwd.h" +#include "wizard/usercfg.h" +#include "wizard/userpwd.h" +#include "wizard/network.h" +#include "wizard/summary.h" +#include "wizard/installation.h" + +MainWizard::MainWizard() +{ + backend = Backend::instance(); + backend->runBackend(); + + connect(backend, SIGNAL(isBusy(bool)), this, SLOT(backendBusy(bool))); + connect(backend, SIGNAL(receivedCommand(QString,QString)), this, SLOT(processCommand(QString,QString))); + + setPage(Page_Welcome, new wpWelcome(this)); + setPage(Page_Partitions, new wpPartitions(this)); + setPage(Page_PartManSel, new wpPartManSel(this)); + setPage(Page_PartMan, new wpPartMan(this)); + setPage(Page_RootPartition, new wpRootPartition(this)); + setPage(Page_Bootloader, new wpBootloader(this)); + setPage(Page_RootPwd, new wpRootPwd(this)); + setPage(Page_UserCfg, new wpUserCfg(this)); + setPage(Page_UserPwd, new wpUserPwd(this)); + setPage(Page_Network, new wpNetwork(this)); + setPage(Page_Summary, new wpSummary(this)); + setPage(Page_Installation, new wpInstallation(this)); + setStartId(Page_Welcome); + setWizardStyle(ModernStyle); + setWindowTitle(tr("Installer")); + + filter = new BusyAppFilter; + + setPixmap(QWizard::LogoPixmap, QIcon::fromTheme("acritoxinstaller").pixmap(64,64)); +} + +void MainWizard::reject() +{ + backend->exitBackend(); + QWizard::reject(); +} + +void MainWizard::backendBusy(bool busy) +{ + qDebug((QString("MainWizard::backendBusy: ")+(busy ? "yes" : "no")).toUtf8()); + if(!busy) + { + QApplication::restoreOverrideCursor(); + QApplication::instance()->removeEventFilter(filter); + } + else if(!QApplication::overrideCursor()) + { + QApplication::setOverrideCursor(Qt::WaitCursor); + QApplication::instance()->installEventFilter(filter); + } +} + +void MainWizard::processCommand(QString command, QString args) +{ + if(command == "loadpage") + { + QList<int> pages = pageIds(); + for(int i = 0; i < pages.size(); ++i) + if(page(i)->objectName() == args) + { + break; + } + } +} + +QSize MainWizard::sizeHint() const +{ + return QSize(800,600); +} |