Commits

Rodrigo Bistolfi  committed 8a1f87b

Use our partition editor instead gparted (initial commit)

  • Participants
  • Parent commits d123612
  • Branches partition_editor

Comments (0)

Files changed (1)

File vinstall/controller/advanced.py

         """Return next controller
 
         """
-        if self.is_display_set() or self.selection == 0:
+        if self.selection == 0:
             from vinstall.controller import mountpoints
             return mountpoints.Mountpoint
         else:
+            if self.is_display_set():
+                return GUIPartitionManager
             return TUIPartitionManager
 
     def previous(self):
         from vinstall.controller import intro
         return intro.Introduction
 
-    def process(self, index):
-        """Launch partitioning program if needed
-
-        """
-        self.selection = index
-        if index == 1:
-            if self.is_display_set():
-                command = "/usr/sbin/gparted".split()
-                subprocess.call(command)
-
     def is_display_set(self):
         """Return True if graphical program should be used
 
 
         """
         return TUIPartitionManager
+
+
+from vinstall.backend import partitioning
+
+
+class GUIPartitionManager(object):
+
+    def init(self):
+        """Find available disks
+
+        """
+        self.disks = list(media.Disk.all())
+
+    def render(self):
+        """disk selection
+
+        """
+        #dropdown = model.DropdownOptionList(label="Select disk")
+        #for disk in self.disks:
+        #    dropdown.add_option(str(disk))
+        partitioner = partitioning.DiskPartitioner()
+        partitioner.devices = self.disks
+        return Render("Partitions", "Prepare your disk for Vector",
+                partitioner)
+
+    def next(self):
+        """Next controller
+
+        """
+        return PostPartitioning
+
+    def previous(self):
+        """Previous controller
+
+        """
+        return AdvancedMode
+
+