def populate_keymap_combo(self, default="us"): # Adds all the keymaps to the dropdown keymaps = GLIUtility.generate_keymap_list() for i in range(len(keymaps)): keymap = keymaps[i] self.keymap.append_text(keymap) # select the default if keymap == default: self.keymap.set_active(i)
def __init__(self, controller): GLIScreen.GLIScreen.__init__(self, controller) vert = gtk.VBox(False, 10) # This box is content so it should fill space to force title to top horiz = gtk.HBox(False, 0) horiz2 = gtk.HBox(False, 0) horiz3 = gtk.HBox(False, 0) addme_to_vert = [] # this code could be reduced, but would it make things any clearer? # create the CLOCK object self.clock = self.Option("Clock") self.clock.HelpText = "Should CLOCK be set to UTC or local? Unless you set your timezone to UTC you will want to choose local." self.clock.Options = ["UTC","local"] self.clock.Type = self.Option.OptionType.COMBO clock_gtk = self.clock.Generate_GTK() addme_to_vert.append(clock_gtk) # create the Windowkeys object self.windowkeys = self.Option("Windowkeys") self.windowkeys.HelpText = "Should we first load the 'windowkeys' console keymap?" self.windowkeys.Options = ["Yes","No"] self.windowkeys.Type = self.Option.OptionType.COMBO clock_gtk = self.windowkeys.Generate_GTK() addme_to_vert.append(clock_gtk) # create the Display Manager object self.displaymanager = self.Option("Display Manager") self.displaymanager.HelpText = "Choose your display manager for Xorg-x11 (note you must make sure that package also gets installed for it to work)" self.displaymanager.Options = ["xdm","kdm","gdm"] self.displaymanager.Type = self.Option.OptionType.COMBO_ENTRY clock_gtk = self.displaymanager.Generate_GTK() addme_to_vert.append(clock_gtk) # create the Default Editor object self.editor = self.Option("Default Editor") self.editor.HelpText = "Choose your default editor" self.editor.Options = ["/bin/nano","/usr/bin/vim","/usr/bin/emacs"] self.editor.Type = self.Option.OptionType.COMBO editor_gtk = self.editor.Generate_GTK() addme_to_vert.append(editor_gtk) # create the Keymap object self.keymap = self.Option("Keymap") self.keymap.HelpText = "Choose your desired keymap" self.keymap.Options = [""] + GLIUtility.generate_keymap_list() self.keymap.Type = self.Option.OptionType.COMBO editor_gtk = self.keymap.Generate_GTK() addme_to_vert.append(editor_gtk) # create the Console Font object self.font = self.Option("Console Font") self.font.HelpText = "Choose your default console font" self.font.Options = [""] + GLIUtility.generate_consolefont_list() self.font.Type = self.Option.OptionType.COMBO editor_gtk = self.font.Generate_GTK() addme_to_vert.append(editor_gtk) # create a last bogus one to make it look pretty. bogus = self.Option("") bogus.HelpText = "" bogus.Type = self.Option.OptionType.NONE bogus = bogus.Generate_GTK() addme_to_vert.append(bogus) # create the XSession object self.xsession = self.Option("XSession") self.xsession.HelpText = "Choose what window manager you want to start default with X if run with xdm, startx, or xinit. (common options are Gnome or Xsession)" self.xsession.Options = ["Gnome","Xsession","fluxbox"] self.xsession.Type = self.Option.OptionType.COMBO_ENTRY editor_gtk = self.xsession.Generate_GTK() addme_to_vert.append(editor_gtk) # create the Extended Keymaps object self.extkeymap = self.Option("Extended Keymaps") self.extkeymap.HelpText = "This sets the maps to load for extended keyboards. Most users will leave this as is." self.extkeymap.Type = self.Option.OptionType.TEXT editor_gtk = self.extkeymap.Generate_GTK() addme_to_vert.append(editor_gtk) addme_to_vert.reverse() for i,item in enumerate(addme_to_vert): if i< 3: horiz.pack_start(item, expand=True, fill=True, padding=10) elif i<6: horiz2.pack_start(item, expand=True, fill=True, padding=10) else: horiz3.pack_start(item, expand=True, fill=True, padding=10) self.add_content(horiz) self.add_content(horiz2) self.add_content(horiz3)
def __init__(self, controller): GLIScreen.GLIScreen.__init__(self, controller) vert = gtk.VBox( False, 10 ) # This box is content so it should fill space to force title to top horiz = gtk.HBox(False, 0) horiz2 = gtk.HBox(False, 0) horiz3 = gtk.HBox(False, 0) addme_to_vert = [] # this code could be reduced, but would it make things any clearer? # create the CLOCK object self.clock = self.Option("Clock") self.clock.HelpText = "Should CLOCK be set to UTC or local? Unless you set your timezone to UTC you will want to choose local." self.clock.Options = ["UTC", "local"] self.clock.Type = self.Option.OptionType.COMBO clock_gtk = self.clock.Generate_GTK() addme_to_vert.append(clock_gtk) # create the Windowkeys object self.windowkeys = self.Option("Windowkeys") self.windowkeys.HelpText = "Should we first load the 'windowkeys' console keymap?" self.windowkeys.Options = ["Yes", "No"] self.windowkeys.Type = self.Option.OptionType.COMBO clock_gtk = self.windowkeys.Generate_GTK() addme_to_vert.append(clock_gtk) # create the Display Manager object self.displaymanager = self.Option("Display Manager") self.displaymanager.HelpText = "Choose your display manager for Xorg-x11 (note you must make sure that package also gets installed for it to work)" self.displaymanager.Options = ["xdm", "kdm", "gdm"] self.displaymanager.Type = self.Option.OptionType.COMBO_ENTRY clock_gtk = self.displaymanager.Generate_GTK() addme_to_vert.append(clock_gtk) # create the Default Editor object self.editor = self.Option("Default Editor") self.editor.HelpText = "Choose your default editor" self.editor.Options = ["/bin/nano", "/usr/bin/vim", "/usr/bin/emacs"] self.editor.Type = self.Option.OptionType.COMBO editor_gtk = self.editor.Generate_GTK() addme_to_vert.append(editor_gtk) # create the Keymap object self.keymap = self.Option("Keymap") self.keymap.HelpText = "Choose your desired keymap" self.keymap.Options = [""] + GLIUtility.generate_keymap_list() self.keymap.Type = self.Option.OptionType.COMBO editor_gtk = self.keymap.Generate_GTK() addme_to_vert.append(editor_gtk) # create the Console Font object self.font = self.Option("Console Font") self.font.HelpText = "Choose your default console font" self.font.Options = [""] + GLIUtility.generate_consolefont_list() self.font.Type = self.Option.OptionType.COMBO editor_gtk = self.font.Generate_GTK() addme_to_vert.append(editor_gtk) # create a last bogus one to make it look pretty. bogus = self.Option("") bogus.HelpText = "" bogus.Type = self.Option.OptionType.NONE bogus = bogus.Generate_GTK() addme_to_vert.append(bogus) # create the XSession object self.xsession = self.Option("XSession") self.xsession.HelpText = "Choose what window manager you want to start default with X if run with xdm, startx, or xinit. (common options are Gnome or Xsession)" self.xsession.Options = ["Gnome", "Xsession", "fluxbox"] self.xsession.Type = self.Option.OptionType.COMBO_ENTRY editor_gtk = self.xsession.Generate_GTK() addme_to_vert.append(editor_gtk) # create the Extended Keymaps object self.extkeymap = self.Option("Extended Keymaps") self.extkeymap.HelpText = "This sets the maps to load for extended keyboards. Most users will leave this as is." self.extkeymap.Type = self.Option.OptionType.TEXT editor_gtk = self.extkeymap.Generate_GTK() addme_to_vert.append(editor_gtk) addme_to_vert.reverse() for i, item in enumerate(addme_to_vert): if i < 3: horiz.pack_start(item, expand=True, fill=True, padding=10) elif i < 6: horiz2.pack_start(item, expand=True, fill=True, padding=10) else: horiz3.pack_start(item, expand=True, fill=True, padding=10) self.add_content(horiz) self.add_content(horiz2) self.add_content(horiz3)