summaryrefslogtreecommitdiff
path: root/wizard/partitions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wizard/partitions.cpp')
-rw-r--r--wizard/partitions.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/wizard/partitions.cpp b/wizard/partitions.cpp
new file mode 100644
index 0000000..d35e94f
--- /dev/null
+++ b/wizard/partitions.cpp
@@ -0,0 +1,63 @@
+#include <QtGui>
+#include "partitions.h"
+#include "../listdelegate.h"
+#include "../listitem.h"
+#include "../mainwizard.h"
+
+wpPartitions::wpPartitions(QWidget *parent) : QWizardPage(parent)
+{
+ setupUi(this);
+ backend = Backend::instance();
+ connect(listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateComplete()));
+ listWidget->setItemDelegate(new ListDelegate(this));
+}
+
+void wpPartitions::initializePage()
+{
+ listWidget->clear();
+ listWidget->addItem(new ListItem(tr("Manual partitioning"), tr("You will have to do the partitioning with a partition-manager manually. This way you have more possibilities to adjust the installation to your needs. The automatic partitioning lacks several features and is only a (computer generated) list of some possible options."), "partitionmanager", "manual"));
+ listWidget->addItem(new ListItem(tr("Already partitioned"), tr("If you have already partitioned for the installation and don't want to start a partition manager then select this."), "drive-harddisk", "already"));
+ clearPage();
+}
+
+void wpPartitions::clearPage()
+{
+}
+
+void wpPartitions::receivedDataLine(QString data, QString line)
+{
+ if(data == "install_choice")
+ {
+ listWidget->addItem(new ListItem(line, line, "tools-wizard", line.section(" ",0,0)));
+ }
+}
+
+void wpPartitions::updateComplete()
+{
+ emit completeChanged();
+}
+
+bool wpPartitions::isComplete() const
+{
+ if(!listWidget->currentItem()) return false;
+ return true;
+}
+
+bool wpPartitions::validatePage()
+{
+ if(!isComplete()) return false;
+// backend->cfg("install_choice", listWidget->currentItem()->data(ListItem::ItemData).toString());
+ return true;
+}
+
+int wpPartitions::nextId() const
+{
+ if(listWidget->currentItem())
+ {
+ QString choice = listWidget->currentItem()->data(ListItem::ItemData).toString();
+ if(choice == "manual")
+ return MainWizard::Page_PartManSel;
+ else if(choice == "already")
+ return MainWizard::Page_RootPartition;
+ }
+}