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 /wizard/rootpartition.cpp | |
download | acritoxinstaller-00286a5db286e21a766b6af057052dc5d17561ad.zip acritoxinstaller-00286a5db286e21a766b6af057052dc5d17561ad.tar.gz |
Initial commit
Diffstat (limited to 'wizard/rootpartition.cpp')
-rw-r--r-- | wizard/rootpartition.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/wizard/rootpartition.cpp b/wizard/rootpartition.cpp new file mode 100644 index 0000000..6341a0f --- /dev/null +++ b/wizard/rootpartition.cpp @@ -0,0 +1,58 @@ +#include <QtGui> +#include "rootpartition.h" +#include "../listdelegate.h" +#include "../listitem.h" + +wpRootPartition::wpRootPartition(QWidget *parent) : QWizardPage(parent) +{ + setupUi(this); + backend = Backend::instance(); + connect(backend, SIGNAL(receivedDataLine(QString,QString)), this, SLOT(receivedDataLine(QString,QString))); + connect(rootPartitionDev, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateComplete())); +} + +void wpRootPartition::initializePage() +{ + clearPage(); +} + +void wpRootPartition::clearPage() +{ + backend->exec("send_possible_root_partitions"); + rootPartitionDev->clear(); + backend->exec("send_possible_root_filesystems"); + rootPartitionFs->clear(); +} + +void wpRootPartition::receivedDataLine(QString data, QString line) +{ + if(data == "possible_root_partitions") + { + QListWidgetItem *item = new QListWidgetItem(QIcon::fromTheme("drive-harddisk"), line); + rootPartitionDev->addItem(item); + } + if(data == "possible_root_filesystems") + { + rootPartitionFs->addItem(line); + } +} + +void wpRootPartition::updateComplete() +{ + emit completeChanged(); +} + +bool wpRootPartition::isComplete() const +{ + if(!rootPartitionDev->currentItem()) return false; + return true; +} + +bool wpRootPartition::validatePage() +{ + if(!isComplete()) return false; + backend->exec(QString("hdmap_set %1:/:%2:auto") + .arg(rootPartitionDev->currentItem()->text().section(" ",0,0)) + .arg(chkFormat->isChecked() ? rootPartitionFs->currentText() : "")); + return true; +} |