def __init__(self, button3): self.box1 = Gtk.VBox(False, 0) self.box1.show() box2 = Gtk.VBox(False, 10) box2.set_border_width(10) self.box1.pack_start(box2, True, True, 0) box2.show() # Title Title = Gtk.Label( "<b><span size='xx-large'>Install GhostBSD entirely on disk</span></b> " ) Title.set_use_markup(True) box2.pack_start(Title, False, False, 0) # chose Disk sw = Gtk.ScrolledWindow() sw.set_shadow_type(Gtk.ShadowType.ETCHED_IN) sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) store = Gtk.TreeStore(str, str, str, 'gboolean') for disk in disk_query(): store.append(None, [disk[0], disk[1], disk[3], True]) treeView = Gtk.TreeView(store) treeView.set_model(store) treeView.set_rules_hint(True) cell = Gtk.CellRendererText() column = Gtk.TreeViewColumn(None, cell, text=0) column_header = Gtk.Label('Disk') column_header.set_use_markup(True) column_header.show() column.set_widget(column_header) column.set_sort_column_id(0) cell2 = Gtk.CellRendererText() column2 = Gtk.TreeViewColumn(None, cell2, text=0) column_header2 = Gtk.Label('Size(MB)') column_header2.set_use_markup(True) column_header2.show() column2.set_widget(column_header2) cell3 = Gtk.CellRendererText() column3 = Gtk.TreeViewColumn(None, cell3, text=0) column_header3 = Gtk.Label('Scheme') column_header3.set_use_markup(True) column_header3.show() column3.set_widget(column_header3) column.set_attributes(cell, text=0) column2.set_attributes(cell2, text=1) column3.set_attributes(cell3, text=2) treeView.append_column(column) treeView.append_column(column2) treeView.append_column(column3) tree_selection = treeView.get_selection() tree_selection.set_mode(Gtk.SelectionMode.SINGLE) tree_selection.connect("changed", self.Selection_Variant, button3) sw.add(treeView) sw.show() box2.pack_start(sw, True, True, 10) sfile = open(part_schem, 'w') sfile.writelines('partscheme=GPT') sfile.close() return
def __init__(self, button3): self.box1 = Gtk.VBox(False, 0) self.box1.show() box2 = Gtk.VBox(False, 10) box2.set_border_width(10) self.box1.pack_start(box2, True, True, 0) box2.show() # Title Title = Gtk.Label("<b><span size='xx-large'>Install GhostBSD entirely on disk</span></b> ") Title.set_use_markup(True) box2.pack_start(Title, False, False, 0) # chose Disk sw = Gtk.ScrolledWindow() sw.set_shadow_type(Gtk.ShadowType.ETCHED_IN) sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) store = Gtk.TreeStore(str, str, str, 'gboolean') for disk in disk_query(): store.append(None, [disk[0], disk[1], disk[3], True]) treeView = Gtk.TreeView(store) treeView.set_model(store) treeView.set_rules_hint(True) cell = Gtk.CellRendererText() column = Gtk.TreeViewColumn(None, cell, text=0) column_header = Gtk.Label('Disk') column_header.set_use_markup(True) column_header.show() column.set_widget(column_header) column.set_sort_column_id(0) cell2 = Gtk.CellRendererText() column2 = Gtk.TreeViewColumn(None, cell2, text=0) column_header2 = Gtk.Label('Size(MB)') column_header2.set_use_markup(True) column_header2.show() column2.set_widget(column_header2) cell3 = Gtk.CellRendererText() column3 = Gtk.TreeViewColumn(None, cell3, text=0) column_header3 = Gtk.Label('Scheme') column_header3.set_use_markup(True) column_header3.show() column3.set_widget(column_header3) column.set_attributes(cell, text=0) column2.set_attributes(cell2, text=1) column3.set_attributes(cell3, text=2) treeView.append_column(column) treeView.append_column(column2) treeView.append_column(column3) tree_selection = treeView.get_selection() tree_selection.set_mode(Gtk.SelectionMode.SINGLE) tree_selection.connect("changed", self.Selection_Variant, button3) sw.add(treeView) sw.show() box2.pack_start(sw, True, True, 10) sfile = open(part_schem, 'w') sfile.writelines('partscheme=GPT') sfile.close() return
def Tree_Store(self): self.store.clear() for disk in disk_query(): shem = disk[-1] piter = self.store.append(None, [disk[0], disk[1], disk[2], disk[3], True]) if shem == "GPT": for pi in partition_query(disk[0]): self.store.append(piter, [pi[0], pi[1], pi[2], pi[3], True]) elif shem == "MBR": for pi in partition_query(disk[0]): piter1 = self.store.append(piter, [pi[0], pi[1], pi[2], pi[3], True]) if pi[0] == 'freespace': pass else: for li in label_query(pi[0]): self.store.append(piter1, [li[0], li[1], li[2], li[3], True]) return self.store
def Tree_Store(self): self.store.clear() for disk in disk_query(): shem = disk[-1] piter = self.store.append(None, [disk[0], str(disk[1]), disk[2], disk[3], True]) if shem == "GPT": for pi in partition_query(disk[0]): self.store.append(piter, [pi[0], str(pi[1]), pi[2], pi[3], True]) elif shem == "MBR": for pi in partition_query(disk[0]): piter1 = self.store.append(piter, [pi[0], str(pi[1]), pi[2], pi[3], True]) if pi[0] == 'freespace': pass else: for li in label_query(pi[0]): self.store.append(piter1, [li[0], str(li[1]), li[2], li[3], True]) return self.store
def __init__(self): window = Gtk.Window() window.set_size_request(700, 500) window.set_resizable(False) window.set_title("GhostBSD Installer") window.set_border_width(0) window.set_icon_from_file("/usr/local/lib/gbi/logo.png") box1 = Gtk.VBox(False, 0) window.add(box1) box1.show() box2 = Gtk.VBox(False, 10) box2.set_border_width(10) box1.pack_start(box2, True, True, 0) box2.show() # Title Title = Gtk.Label( "<b><span size='xx-large'>Install GhostBSD entirely on disk</span></b> " ) Title.set_use_markup(True) box2.pack_start(Title, False, False, 0) # chose Disk sw = Gtk.ScrolledWindow() sw.set_shadow_type(Gtk.ShadowType.ETCHED_IN) sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) store = Gtk.TreeStore(str, str, str, 'gboolean') for disk in disk_query(): store.append(None, [disk[0], disk[1], disk[3], False]) treeView = Gtk.TreeView(store) treeView.set_model(store) treeView.set_rules_hint(True) self.checkcell = Gtk.CellRendererToggle() self.checkcell.set_property('activatable', True) self.checkcell.connect('toggled', self.col1_toggled_cb, store) column1 = Gtk.TreeViewColumn("Check", self.checkcell) cell = Gtk.CellRendererText() column = Gtk.TreeViewColumn(None, cell, text=0) column_header = Gtk.Label('Disk') column_header.set_use_markup(True) column_header.show() column.set_widget(column_header) column.set_sort_column_id(0) cell2 = Gtk.CellRendererText() column2 = Gtk.TreeViewColumn(None, cell2, text=0) column_header2 = Gtk.Label('Size(MB)') column_header2.set_use_markup(True) column_header2.show() column2.set_widget(column_header2) cell3 = Gtk.CellRendererText() column3 = Gtk.TreeViewColumn(None, cell3, text=0) column_header3 = Gtk.Label('Scheme') column_header3.set_use_markup(True) column_header3.show() column3.set_widget(column_header3) column1.add_attribute(self.checkcell, "active", 3) column.set_attributes(cell, text=0) column2.set_attributes(cell2, text=1) column3.set_attributes(cell3, text=2) treeView.append_column(column1) treeView.append_column(column) treeView.append_column(column2) treeView.append_column(column3) tree_selection = treeView.get_selection() tree_selection.set_mode(Gtk.SelectionMode.SINGLE) tree_selection.connect("changed", self.Selection_Variant) sw.add(treeView) sw.show() self.Gmirror = False gMirror_check = Gtk.CheckButton("Mirror Swap") gMirror_check.connect("toggled", self.on_check_Gmirror) grid = Gtk.Grid() grid.set_row_spacing(10) grid.set_column_homogeneous(True) grid.set_row_homogeneous(True) grid.show() grid.attach(sw, 1, 4, 8, 3) box2.pack_start(grid, True, True, 10) sfile = open(part_schem, 'w') sfile.writelines('partscheme=GPT') sfile.close() box2 = Gtk.HBox(False, 10) box2.set_border_width(5) box1.pack_start(box2, False, False, 0) box2.show() # Add button #box2.pack_start(use_disk_bbox(True, # 10, Gtk.BUTTONBOX_END), # True, True, 5) window.show_all()
def __init__(self): window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("destroy", close_application) window.set_size_request(700, 500) window.set_resizable(False) window.set_title("GhostBSD Installer") window.set_border_width(0) window.set_position(gtk.WIN_POS_CENTER) window.set_icon_from_file("/usr/local/etc/gbi/logo.png") box1 = gtk.VBox(False, 0) window.add(box1) box1.show() box2 = gtk.VBox(False, 10) box2.set_border_width(10) box1.pack_start(box2, True, True, 0) box2.show() # Title Title = gtk.Label("<b><span size='xx-large'>Install GhostBSD entirely on disk</span></b> ") Title.set_use_markup(True) box2.pack_start(Title, False, False, 0) # chose Disk sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) store = gtk.TreeStore(str, str, str, 'gboolean') for disk in disk_query(): store.append(None, [disk[0], disk[1], disk[3], True]) treeView = gtk.TreeView(store) treeView.set_model(store) treeView.set_rules_hint(True) cell = gtk.CellRendererText() column = gtk.TreeViewColumn(None, cell, text=0) column_header = gtk.Label('Disk') column_header.set_use_markup(True) column_header.show() column.set_widget(column_header) column.set_sort_column_id(0) cell2 = gtk.CellRendererText() column2 = gtk.TreeViewColumn(None, cell2, text=0) column_header2 = gtk.Label('Size(MB)') column_header2.set_use_markup(True) column_header2.show() column2.set_widget(column_header2) cell3 = gtk.CellRendererText() column3 = gtk.TreeViewColumn(None, cell3, text=0) column_header3 = gtk.Label('Scheme') column_header3.set_use_markup(True) column_header3.show() column3.set_widget(column_header3) column.set_attributes(cell, text=0) column2.set_attributes(cell2, text=1) column3.set_attributes(cell3, text=2) treeView.append_column(column) treeView.append_column(column2) treeView.append_column(column3) tree_selection = treeView.get_selection() tree_selection.set_mode(gtk.SELECTION_SINGLE) tree_selection.connect("changed", self.Selection_Variant) sw.add(treeView) sw.show() box2.pack_start(sw, True, True, 10) sfile = open(part_schem, 'w') sfile.writelines('partscheme=GPT') sfile.close() box2 = gtk.HBox(False, 10) box2.set_border_width(5) box1.pack_start(box2, False, False, 0) box2.show() # Add button box2.pack_start(use_disk_bbox(True, 10, gtk.BUTTONBOX_END), True, True, 5) window.show_all()
def __init__(self): window = Gtk.Window() window.set_size_request(700, 500) window.set_resizable(False) window.set_title("GhostBSD Installer") window.set_border_width(0) window.set_icon_from_file("/usr/local/lib/gbi/logo.png") box1 = Gtk.VBox(False, 0) window.add(box1) box1.show() box2 = Gtk.VBox(False, 10) box2.set_border_width(10) box1.pack_start(box2, True, True, 0) box2.show() # Title Title = Gtk.Label("<b><span size='xx-large'>Install GhostBSD entirely on disk</span></b> ") Title.set_use_markup(True) box2.pack_start(Title, False, False, 0) # chose Disk sw = Gtk.ScrolledWindow() sw.set_shadow_type(Gtk.ShadowType.ETCHED_IN) sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) store = Gtk.TreeStore(str, str, str, 'gboolean') for disk in disk_query(): store.append(None, [disk[0], disk[1], disk[3], False]) treeView = Gtk.TreeView(store) treeView.set_model(store) treeView.set_rules_hint(True) self.checkcell = Gtk.CellRendererToggle() self.checkcell.set_property('activatable', True) self.checkcell.connect('toggled', self.col1_toggled_cb, store) column1 = Gtk.TreeViewColumn("Check", self.checkcell) cell = Gtk.CellRendererText() column = Gtk.TreeViewColumn(None, cell, text=0) column_header = Gtk.Label('Disk') column_header.set_use_markup(True) column_header.show() column.set_widget(column_header) column.set_sort_column_id(0) cell2 = Gtk.CellRendererText() column2 = Gtk.TreeViewColumn(None, cell2, text=0) column_header2 = Gtk.Label('Size(MB)') column_header2.set_use_markup(True) column_header2.show() column2.set_widget(column_header2) cell3 = Gtk.CellRendererText() column3 = Gtk.TreeViewColumn(None, cell3, text=0) column_header3 = Gtk.Label('Scheme') column_header3.set_use_markup(True) column_header3.show() column3.set_widget(column_header3) column1.add_attribute(self.checkcell, "active", 3) column.set_attributes(cell, text=0) column2.set_attributes(cell2, text=1) column3.set_attributes(cell3, text=2) treeView.append_column(column1) treeView.append_column(column) treeView.append_column(column2) treeView.append_column(column3) tree_selection = treeView.get_selection() tree_selection.set_mode(Gtk.SelectionMode.SINGLE) tree_selection.connect("changed", self.Selection_Variant) sw.add(treeView) sw.show() self.Gmirror = False gMirror_check = Gtk.CheckButton("Mirror Swap") gMirror_check.connect("toggled", self.on_check_Gmirror) grid = Gtk.Grid() grid.set_row_spacing(10) grid.set_column_homogeneous(True) grid.set_row_homogeneous(True) grid.show() grid.attach(sw, 1, 4, 8, 3) box2.pack_start(grid, True, True, 10) sfile = open(part_schem, 'w') sfile.writelines('partscheme=GPT') sfile.close() box2 = Gtk.HBox(False, 10) box2.set_border_width(5) box1.pack_start(box2, False, False, 0) box2.show() # Add button #box2.pack_start(use_disk_bbox(True, # 10, Gtk.BUTTONBOX_END), # True, True, 5) window.show_all()
def __init__(self): window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("destroy", close_application) window.set_size_request(700, 500) window.set_resizable(False) window.set_title("GhostBSD Installer") window.set_border_width(0) window.set_position(gtk.WIN_POS_CENTER) window.set_icon_from_file("/usr/local/lib/gbi/logo.png") box1 = gtk.VBox(False, 0) window.add(box1) box1.show() box2 = gtk.VBox(False, 10) box2.set_border_width(10) box1.pack_start(box2, True, True, 0) box2.show() # Title Title = gtk.Label("<b><span size='xx-large'>Install GhostBSD entirely on disk</span></b> ") Title.set_use_markup(True) box2.pack_start(Title, False, False, 0) # chose Disk sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) store = gtk.TreeStore(str, str, str, 'gboolean') for disk in disk_query(): store.append(None, [disk[0], disk[1], disk[3], True]) treeView = gtk.TreeView(store) treeView.set_model(store) treeView.set_rules_hint(True) cell = gtk.CellRendererText() column = gtk.TreeViewColumn(None, cell, text=0) column_header = gtk.Label('Disk') column_header.set_use_markup(True) column_header.show() column.set_widget(column_header) column.set_sort_column_id(0) cell2 = gtk.CellRendererText() column2 = gtk.TreeViewColumn(None, cell2, text=0) column_header2 = gtk.Label('Size(MB)') column_header2.set_use_markup(True) column_header2.show() column2.set_widget(column_header2) cell3 = gtk.CellRendererText() column3 = gtk.TreeViewColumn(None, cell3, text=0) column_header3 = gtk.Label('Scheme') column_header3.set_use_markup(True) column_header3.show() column3.set_widget(column_header3) column.set_attributes(cell, text=0) column2.set_attributes(cell2, text=1) column3.set_attributes(cell3, text=2) treeView.append_column(column) treeView.append_column(column2) treeView.append_column(column3) tree_selection = treeView.get_selection() tree_selection.set_mode(gtk.SELECTION_SINGLE) tree_selection.connect("changed", self.Selection_Variant) sw.add(treeView) sw.show() box2.pack_start(sw, True, True, 10) sfile = open(part_schem, 'w') sfile.writelines('partscheme=GPT') sfile.close() box2 = gtk.HBox(False, 10) box2.set_border_width(5) box1.pack_start(box2, False, False, 0) box2.show() # Add button box2.pack_start(use_disk_bbox(True, 10, gtk.BUTTONBOX_END), True, True, 5) window.show_all()