Commits

Rodrigo Bistolfi committed 8a1f87b

Use our partition editor instead gparted (initial commit)

Comments (0)

Files changed (1)

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
+
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.