Commits

Ikey Doherty committed 0781b0a

Actually display available partitioning schemes

  • Participants
  • Parent commits 86d0629

Comments (0)

Files changed (1)

src/pages/disks/disks.vala

 		if ( ! part.active ) continue;
 		currentDisk.add_segment (part.path, part.size, random_color () );
 	}
+
+	if (schemes.get_children().length () > 0) {
+		// Remove all options from the scheme box
+		foreach (unowned Gtk.Widget sprog in schemes.get_children ()) {
+			schemes.remove (sprog);
+			sprog = null;
+		}
+	}
+
+	// Now create radio buttons for each item
+	var pschemes = PartitionScheme.for_disk (disk);
+	var color = Config["Interface"]["Foreground"];
+	RadioButton boss = new RadioButton.with_label (null, "<span color=\"%s\">%s</span>".printf(color, pschemes[0].name));
+	(boss.child as Gtk.Label).use_markup = true;
+	schemes.pack_start (boss, false, false, 10);
+	if (pschemes.length > 1) {
+		for (int i=1; i<pschemes.length; i++) {
+			var radBtn = new Gtk.RadioButton.with_label (boss.get_group (), "<span color=\"%s\">%s</span>".printf(color, pschemes[i].name));
+			(radBtn.child as Gtk.Label).use_markup = true;
+			schemes.pack_start (radBtn, false, false, 10);
+		}
+	}
+	schemes.show_all ();
    }
 
    /** Init this page instance */
 
 	// So we can actually display available partitioning schemes
 	schemes = new Gtk.VBox (false, 10);
-	display.pack_start (schemes, true, true, 0);
+	display.pack_start (schemes, true, true, 50);
 
 	navigate_update (NavigationState.ENABLE, NavigationDirection.FORWARD);
    }