Added some tweak to install-station code
This commit is contained in:
+30
-29
@@ -40,7 +40,7 @@ class MainWindow():
|
||||
Gtk.main_quit()
|
||||
return False
|
||||
|
||||
def next_button(self, widget):
|
||||
def next_page(self, widget):
|
||||
if self.welcome.get_what() == "install":
|
||||
self.next_install_page()
|
||||
else:
|
||||
@@ -59,44 +59,44 @@ class MainWindow():
|
||||
self.notebook.insert_page(typebox, label, 1)
|
||||
self.notebook.next_page()
|
||||
self.notebook.show_all()
|
||||
self.button2.show()
|
||||
self.button3.show()
|
||||
self.cancel_button.show()
|
||||
self.next_button.show()
|
||||
elif page == 1:
|
||||
create_disk_partition_db()
|
||||
self.button1.show()
|
||||
self.back_button.show()
|
||||
if self.types.get_type() == "ufs":
|
||||
udbox = Gtk.VBox(homogeneous=False, spacing=0)
|
||||
udbox.show()
|
||||
self.partition = use_ufs(self.button3)
|
||||
self.partition = use_ufs(self.next_button)
|
||||
get_ud = self.partition.get_model()
|
||||
udbox.pack_start(get_ud, True, True, 0)
|
||||
label = Gtk.Label(label="UFS Disk Configuration")
|
||||
self.notebook.insert_page(udbox, label, 2)
|
||||
self.notebook.next_page()
|
||||
self.notebook.show_all()
|
||||
self.button3.set_sensitive(False)
|
||||
self.next_button.set_sensitive(False)
|
||||
elif self.types.get_type() == "custom":
|
||||
Pbox = Gtk.VBox(homogeneous=False, spacing=0)
|
||||
Pbox.show()
|
||||
self.partition = Partitions(self.button3)
|
||||
self.partition = Partitions(self.next_button)
|
||||
get_part = self.partition.get_model()
|
||||
Pbox.pack_start(get_part, True, True, 0)
|
||||
label = Gtk.Label(label="UFS Custom Configuration")
|
||||
self.notebook.insert_page(Pbox, label, 2)
|
||||
self.notebook.next_page()
|
||||
self.notebook.show_all()
|
||||
self.button3.set_sensitive(False)
|
||||
self.next_button.set_sensitive(False)
|
||||
elif self.types.get_type() == "zfs":
|
||||
Zbox = Gtk.VBox(homogeneous=False, spacing=0)
|
||||
Zbox.show()
|
||||
self.partition = ZFS(self.button3)
|
||||
self.partition = ZFS(self.next_button)
|
||||
get_ZFS = self.partition.get_model()
|
||||
Zbox.pack_start(get_ZFS, True, True, 0)
|
||||
label = Gtk.Label(label="ZFS Configuration")
|
||||
self.notebook.insert_page(Zbox, label, 2)
|
||||
self.notebook.next_page()
|
||||
self.notebook.show_all()
|
||||
self.button3.set_sensitive(False)
|
||||
self.next_button.set_sensitive(False)
|
||||
elif page == 2:
|
||||
self.partition.save_selection()
|
||||
Mbox = Gtk.VBox(homogeneous=False, spacing=0)
|
||||
@@ -106,10 +106,10 @@ class MainWindow():
|
||||
Mbox.pack_start(get_root, True, True, 0)
|
||||
label = Gtk.Label(label="Boot Option")
|
||||
self.notebook.insert_page(Mbox, label, 3)
|
||||
self.button3.set_label("Install")
|
||||
self.next_button.set_label("Install")
|
||||
self.notebook.next_page()
|
||||
self.notebook.show_all()
|
||||
self.button3.set_sensitive(True)
|
||||
self.next_button.set_sensitive(True)
|
||||
elif page == 3:
|
||||
Ibox = Gtk.VBox(homogeneous=False, spacing=0)
|
||||
Ibox.show()
|
||||
@@ -135,22 +135,23 @@ class MainWindow():
|
||||
self.window.set_title("Setup GhostBSD")
|
||||
net_setup_box = Gtk.VBox(homogeneous=False, spacing=0)
|
||||
net_setup_box.show()
|
||||
self.net_setup = network_setup()
|
||||
self.net_setup = network_setup(self.next_button)
|
||||
model = self.net_setup.get_model()
|
||||
net_setup_box.pack_start(model, True, True, 0)
|
||||
label = Gtk.Label(label="Network Setup")
|
||||
self.notebook.insert_page(net_setup_box, label, 1)
|
||||
self.notebook.next_page()
|
||||
self.notebook.show_all()
|
||||
self.button3.show()
|
||||
self.next_button.show()
|
||||
self.next_button.set_sensitive(False)
|
||||
|
||||
def back_page(self, widget):
|
||||
"""Go back to the previous window."""
|
||||
current_page = self.notebook.get_current_page()
|
||||
if current_page == 2:
|
||||
self.button1.hide()
|
||||
self.back_button.hide()
|
||||
elif current_page == 3:
|
||||
self.button3.set_label("Next")
|
||||
self.next_button.set_label("Next")
|
||||
self.notebook.prev_page()
|
||||
new_page = self.notebook.get_current_page()
|
||||
if current_page == 2 and new_page == 1:
|
||||
@@ -174,7 +175,7 @@ class MainWindow():
|
||||
os.remove(dslice)
|
||||
if os.path.exists(disk_schem):
|
||||
os.remove(disk_schem)
|
||||
self.button3.set_sensitive(True)
|
||||
self.next_button.set_sensitive(True)
|
||||
|
||||
def __init__(self):
|
||||
"""Were the Main window start."""
|
||||
@@ -207,15 +208,15 @@ class MainWindow():
|
||||
# Set what page to start at type of installation
|
||||
self.notebook.set_current_page(0)
|
||||
self.table = Gtk.Table(n_rows=1, n_columns=6, homogeneous=True)
|
||||
self.button1 = Gtk.Button(label='Back')
|
||||
self.button1.connect("clicked", self.back_page)
|
||||
self.table.attach(self.button1, 3, 4, 0, 1)
|
||||
self.button2 = Gtk.Button(label='Cancel')
|
||||
self.button2.connect("clicked", self.delete)
|
||||
self.table.attach(self.button2, 4, 5, 0, 1)
|
||||
self.button3 = Gtk.Button(label='Next')
|
||||
self.button3.connect("clicked", self.next_button)
|
||||
self.table.attach(self.button3, 5, 6, 0, 1)
|
||||
self.back_button = Gtk.Button(label='Back')
|
||||
self.back_button.connect("clicked", self.back_page)
|
||||
self.table.attach(self.back_button, 3, 4, 0, 1)
|
||||
self.cancel_button = Gtk.Button(label='Cancel')
|
||||
self.cancel_button.connect("clicked", self.delete)
|
||||
self.table.attach(self.cancel_button, 4, 5, 0, 1)
|
||||
self.next_button = Gtk.Button(label='Next')
|
||||
self.next_button.connect("clicked", self.next_page)
|
||||
self.table.attach(self.next_button, 5, 6, 0, 1)
|
||||
self.table.set_col_spacings(5)
|
||||
self.table.show()
|
||||
self.nbButton = Gtk.Notebook()
|
||||
@@ -226,9 +227,9 @@ class MainWindow():
|
||||
label = Gtk.Label(label="Button")
|
||||
self.nbButton.insert_page(self.table, label, 0)
|
||||
self.window.show_all()
|
||||
self.button1.hide()
|
||||
self.button2.hide()
|
||||
self.button3.hide()
|
||||
self.back_button.hide()
|
||||
self.cancel_button.hide()
|
||||
self.next_button.hide()
|
||||
|
||||
|
||||
MainWindow()
|
||||
|
||||
Reference in New Issue
Block a user