summaryrefslogtreecommitdiff
path: root/wizard/partman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wizard/partman.cpp')
-rw-r--r--wizard/partman.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/wizard/partman.cpp b/wizard/partman.cpp
new file mode 100644
index 0000000..3e232f4
--- /dev/null
+++ b/wizard/partman.cpp
@@ -0,0 +1,55 @@
+#include <QtGui>
+#include "partman.h"
+#include "config.h"
+#include "../listdelegate.h"
+#include "../listitem.h"
+
+wpPartMan::wpPartMan(QWidget *parent) : QWizardPage(parent)
+{
+ setupUi(this);
+ backend = Backend::instance();
+}
+
+void wpPartMan::initializePage()
+{
+ clearPage();
+}
+
+void wpPartMan::clearPage()
+{
+ setComplete(false);
+ delete terminal;
+ delete gridLayout;
+ delete label;
+ setupUi(this);
+ connect(terminal, SIGNAL(finished()), this, SLOT(terminalFinished()));
+ QStringList args;
+ args << "/bin/bash" << BACKEND_PATH << "-e" << "run_partmgr" << backend->cfg("partman_program") << backend->cfg("partman_disk");
+ terminal->setArgs(args);
+ terminal->startShellProgram();
+ terminal->setFocus(Qt::OtherFocusReason);
+}
+
+void wpPartMan::terminalFinished()
+{
+ terminal->releaseKeyboard();
+ terminal->clearFocus();
+ setComplete(true);
+}
+
+void wpPartMan::setComplete(bool c)
+{
+ complete = c;
+ emit completeChanged();
+}
+
+bool wpPartMan::isComplete() const
+{
+ return complete;
+}
+
+bool wpPartMan::validatePage()
+{
+ return complete;
+}
+