fix some GTK API deprecation

This commit is contained in:
ericbsd
2020-09-09 20:53:07 -03:00
parent 556154d928
commit 1cc5a11b51
+22 -22
View File
@@ -50,12 +50,12 @@ class MainWindow():
"""Go to the next window.""" """Go to the next window."""
page = self.notebook.get_current_page() page = self.notebook.get_current_page()
if page == 0: if page == 0:
typebox = Gtk.VBox(False, 0) typebox = Gtk.VBox(homogeneous=False, spacing=0)
typebox.show() typebox.show()
self.types = Types() self.types = Types()
get_types = self.types.get_model() get_types = self.types.get_model()
typebox.pack_start(get_types, True, True, 0) typebox.pack_start(get_types, True, True, 0)
label = Gtk.Label("Types") label = Gtk.Label(label="Types")
self.notebook.insert_page(typebox, label, 1) self.notebook.insert_page(typebox, label, 1)
self.notebook.next_page() self.notebook.next_page()
self.notebook.show_all() self.notebook.show_all()
@@ -65,65 +65,65 @@ class MainWindow():
create_disk_partition_db() create_disk_partition_db()
self.button1.show() self.button1.show()
if self.types.get_type() == "ufs": if self.types.get_type() == "ufs":
udbox = Gtk.VBox(False, 0) udbox = Gtk.VBox(homogeneous=False, spacing=0)
udbox.show() udbox.show()
self.partition = use_ufs(self.button3) self.partition = use_ufs(self.button3)
get_ud = self.partition.get_model() get_ud = self.partition.get_model()
udbox.pack_start(get_ud, True, True, 0) udbox.pack_start(get_ud, True, True, 0)
label = Gtk.Label("UFS Disk Configuration") label = Gtk.Label(label="UFS Disk Configuration")
self.notebook.insert_page(udbox, label, 2) self.notebook.insert_page(udbox, label, 2)
self.notebook.next_page() self.notebook.next_page()
self.notebook.show_all() self.notebook.show_all()
self.button3.set_sensitive(False) self.button3.set_sensitive(False)
elif self.types.get_type() == "custom": elif self.types.get_type() == "custom":
Pbox = Gtk.VBox(False, 0) Pbox = Gtk.VBox(homogeneous=False, spacing=0)
Pbox.show() Pbox.show()
self.partition = Partitions(self.button3) self.partition = Partitions(self.button3)
get_part = self.partition.get_model() get_part = self.partition.get_model()
Pbox.pack_start(get_part, True, True, 0) Pbox.pack_start(get_part, True, True, 0)
label = Gtk.Label("UFS Custom Configuration") label = Gtk.Label(label="UFS Custom Configuration")
self.notebook.insert_page(Pbox, label, 2) self.notebook.insert_page(Pbox, label, 2)
self.notebook.next_page() self.notebook.next_page()
self.notebook.show_all() self.notebook.show_all()
self.button3.set_sensitive(False) self.button3.set_sensitive(False)
elif self.types.get_type() == "zfs": elif self.types.get_type() == "zfs":
Zbox = Gtk.VBox(False, 0) Zbox = Gtk.VBox(homogeneous=False, spacing=0)
Zbox.show() Zbox.show()
self.partition = ZFS(self.button3) self.partition = ZFS(self.button3)
get_ZFS = self.partition.get_model() get_ZFS = self.partition.get_model()
Zbox.pack_start(get_ZFS, True, True, 0) Zbox.pack_start(get_ZFS, True, True, 0)
label = Gtk.Label("ZFS Configuration") label = Gtk.Label(label="ZFS Configuration")
self.notebook.insert_page(Zbox, label, 2) self.notebook.insert_page(Zbox, label, 2)
self.notebook.next_page() self.notebook.next_page()
self.notebook.show_all() self.notebook.show_all()
self.button3.set_sensitive(False) self.button3.set_sensitive(False)
elif page == 2: elif page == 2:
self.partition.save_selection() self.partition.save_selection()
Mbox = Gtk.VBox(False, 0) Mbox = Gtk.VBox(homogeneous=False, spacing=0)
Mbox.show() Mbox.show()
self.bootmanager = bootManager() self.bootmanager = bootManager()
get_root = self.bootmanager.get_model() get_root = self.bootmanager.get_model()
Mbox.pack_start(get_root, True, True, 0) Mbox.pack_start(get_root, True, True, 0)
label = Gtk.Label("Boot Option") label = Gtk.Label(label="Boot Option")
self.notebook.insert_page(Mbox, label, 3) self.notebook.insert_page(Mbox, label, 3)
self.button3.set_label("Install") self.button3.set_label("Install")
self.notebook.next_page() self.notebook.next_page()
self.notebook.show_all() self.notebook.show_all()
self.button3.set_sensitive(True) self.button3.set_sensitive(True)
elif page == 3: elif page == 3:
Ibox = Gtk.VBox(False, 0) Ibox = Gtk.VBox(homogeneous=False, spacing=0)
Ibox.show() Ibox.show()
install = installSlide() install = installSlide()
get_install = install.get_model() get_install = install.get_model()
Ibox.pack_start(get_install, True, True, 0) Ibox.pack_start(get_install, True, True, 0)
label = Gtk.Label("Installation") label = Gtk.Label(label="Installation")
self.notebook.insert_page(Ibox, label, 8) self.notebook.insert_page(Ibox, label, 8)
self.notebook.next_page() self.notebook.next_page()
instpro = installProgress(self.window) instpro = installProgress(self.window)
progressBar = instpro.getProgressBar() progressBar = instpro.getProgressBar()
box1 = Gtk.VBox(False, 0) box1 = Gtk.VBox(homogeneous=False, spacing=0)
box1.show() box1.show()
label = Gtk.Label("Progress Bar") label = Gtk.Label(label="Progress Bar")
box1.pack_end(progressBar, False, False, 0) box1.pack_end(progressBar, False, False, 0)
self.nbButton.insert_page(box1, label, 4) self.nbButton.insert_page(box1, label, 4)
self.nbButton.next_page() self.nbButton.next_page()
@@ -133,12 +133,12 @@ class MainWindow():
page = self.notebook.get_current_page() page = self.notebook.get_current_page()
if page == 0: if page == 0:
self.window.set_title("Setup GhostBSD") self.window.set_title("Setup GhostBSD")
net_setup_box = Gtk.VBox(False, 0) net_setup_box = Gtk.VBox(homogeneous=False, spacing=0)
net_setup_box.show() net_setup_box.show()
self.net_setup = network_setup() self.net_setup = network_setup()
model = self.net_setup.get_model() model = self.net_setup.get_model()
net_setup_box.pack_start(model, True, True, 0) net_setup_box.pack_start(model, True, True, 0)
label = Gtk.Label("Network Setup") label = Gtk.Label(label="Network Setup")
self.notebook.insert_page(net_setup_box, label, 1) self.notebook.insert_page(net_setup_box, label, 1)
self.notebook.next_page() self.notebook.next_page()
self.notebook.show_all() self.notebook.show_all()
@@ -186,9 +186,9 @@ class MainWindow():
self.window.set_title("Install GhostBSD") self.window.set_title("Install GhostBSD")
self.window.set_border_width(0) self.window.set_border_width(0)
self.window.set_icon_from_file(logo) self.window.set_icon_from_file(logo)
mainHBox = Gtk.HBox(False, 0) mainHBox = Gtk.HBox(homogeneous=False, spacing=0)
mainHBox.show() mainHBox.show()
mainVbox = Gtk.VBox(False, 0) mainVbox = Gtk.VBox(homogeneous=False, spacing=0)
mainVbox.show() mainVbox.show()
self.window.add(mainHBox) self.window.add(mainHBox)
mainHBox.pack_start(mainVbox, True, True, 0) mainHBox.pack_start(mainVbox, True, True, 0)
@@ -197,16 +197,16 @@ class MainWindow():
self.notebook.show() self.notebook.show()
self.notebook.set_show_tabs(False) self.notebook.set_show_tabs(False)
self.notebook.set_show_border(False) self.notebook.set_show_border(False)
welcome_box = Gtk.VBox(False, 0) welcome_box = Gtk.VBox(homogeneous=False, spacing=0)
welcome_box.show() welcome_box.show()
self.welcome = Welcome(self.next_install_page, self.next_setup_page) self.welcome = Welcome(self.next_install_page, self.next_setup_page)
get_types = self.welcome.get_model() get_types = self.welcome.get_model()
welcome_box.pack_start(get_types, True, True, 0) welcome_box.pack_start(get_types, True, True, 0)
label = Gtk.Label("Welcome") label = Gtk.Label(label="Welcome")
self.notebook.insert_page(welcome_box, label, 0) self.notebook.insert_page(welcome_box, label, 0)
# Set what page to start at type of installation # Set what page to start at type of installation
self.notebook.set_current_page(0) self.notebook.set_current_page(0)
self.table = Gtk.Table(1, 6, True) self.table = Gtk.Table(n_rows=1, n_columns=6, homogeneous=True)
self.button1 = Gtk.Button(label='Back') self.button1 = Gtk.Button(label='Back')
self.button1.connect("clicked", self.back_page) self.button1.connect("clicked", self.back_page)
self.table.attach(self.button1, 3, 4, 0, 1) self.table.attach(self.button1, 3, 4, 0, 1)
@@ -223,7 +223,7 @@ class MainWindow():
self.nbButton.show() self.nbButton.show()
self.nbButton.set_show_tabs(False) self.nbButton.set_show_tabs(False)
self.nbButton.set_show_border(False) self.nbButton.set_show_border(False)
label = Gtk.Label("Button") label = Gtk.Label(label="Button")
self.nbButton.insert_page(self.table, label, 0) self.nbButton.insert_page(self.table, label, 0)
self.window.show_all() self.window.show_all()
self.button1.hide() self.button1.hide()