def getScreen(self, anaconda): self.intf = anaconda.intf self.anaconda = anaconda self.hostname = network.getDefaultHostname(anaconda) # load the UI (self.xml, self.align) = gui.getGladeWidget("network.glade", "network_align") self.icon = self.xml.get_widget("icon") self.hostnameEntry = self.xml.get_widget("hostnameEntry") self.hostnameEntry.set_text(self.hostname) self.netconfButton = self.xml.get_widget("netconfButton") self.netconfButton.connect("clicked", self._setupNetwork) if len(self.anaconda.network.netdevices) == 0 or flags.imageInstall: self.netconfButton.set_sensitive(False) # pressing Enter in confirm == clicking Next self.hostnameEntry.connect("activate", lambda w: self.ics.setGrabNext(1)) # load the icon gui.readImageFromFile("network.png", image=self.icon) return self.align
def createUpgradeOption(self): r = pixmapRadioButtonGroup() r.addEntry(REINSTALL_STR, _("Fresh Installation"), pixmap=gui.readImageFromFile("install.png"), descr=_("Choose this option to install a fresh copy of %s " "on your system. Existing software and data may " "be overwritten depending on your configuration " "choices.") % productName) r.addEntry(UPGRADE_STR, _("Upgrade an Existing Installation"), pixmap=gui.readImageFromFile("upgrade.png"), descr=_("Choose this option if you would like to upgrade " "your existing %s system. This option will " "preserve the existing data on your storage " "device(s).") % productName) return r
def getScreen(self, anaconda): self.anaconda = anaconda self.intf = anaconda.intf (self.xml, self.align) = gui.getGladeWidget("account.glade", "account_align") self.icon = self.xml.get_widget("icon") self.capslock = self.xml.get_widget("capslock") self.pwlabel = self.xml.get_widget("pwlabel") self.pw = self.xml.get_widget("pw") self.confirmlabel = self.xml.get_widget("confirmlabel") self.confirm = self.xml.get_widget("confirm") # load the icon gui.readImageFromFile("root-password.png", image=self.icon) # connect hotkeys self.pwlabel.set_text_with_mnemonic(_("Root _Password:"******"_Confirm:")) self.confirmlabel.set_mnemonic_widget(self.confirm) # watch for Caps Lock so we can warn the user self.intf.icw.window.connect("key-release-event", lambda w, e: self.handleCapsLockRelease(w, e, self.capslock)) # we might have a root password already if not self.anaconda.users.rootPassword['isCrypted']: self.pw.set_text(self.anaconda.users.rootPassword['password']) self.confirm.set_text(self.anaconda.users.rootPassword['password']) # pressing Enter in confirm == clicking Next vbox = self.xml.get_widget("account_box") self.confirm.connect("activate", lambda widget, vbox=vbox: self.ics.setGrabNext(1)) # set initial caps lock label text self.setCapsLockLabel() return self.align
def getScreen (self, anaconda): self.anaconda = anaconda # this is a bit ugly... but scale the image if we're not at 800x600 (w, h) = self.ics.cw.window.get_size_request() if w >= 800: height = None width = None else: width = 500 height = 258 pix = gui.readImageFromFile("splash.png", width, height, dither=False) box = gtk.EventBox () box.add (pix) return box
def getScreen(self, anaconda): self.anaconda = anaconda box = gtk.VBox(False, 10) pix = gui.readImageFromFile("kernelvm.png") if pix: a = gtk.Alignment() a.add(pix) a.set(0.5, 0.5, 1.0, 1.0) a.set_size_request(200, -1) box.pack_start(a, False) box.pack_start(self.createHbox()) return box
def getScreen (self, anaconda): self.anaconda = anaconda box = gtk.VBox (False, 10) pix = gui.readImageFromFile ("kernelvm.png") if pix: a = gtk.Alignment () a.add (pix) a.set (0.5, 0.5, 1.0, 1.0) a.set_size_request(200, -1) box.pack_start (a, False) box.pack_start(self.createHbox()) return box
def createMenu(self): self.menu = gtk.Menu() # Add a blank column at the (current) end of the view. This column # exists only so we can have a header to click on and display the # drop down allowing column configuration. menuCol = gtk.TreeViewColumn("") menuCol.set_clickable(True) menuCol.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) menuCol.set_fixed_width(30) menuCol.connect("clicked", lambda col, menu: menu.popup(None, None, None, 0, 0), self.menu) image = gui.readImageFromFile("filter-menu.png") image.show_all() menuCol.set_widget(image) # Make sure the menu column gets added after all other columns so it # will be on the far right edge. self.view.connect("show", lambda x: self.view.append_column(menuCol))
def getScreen (self, anaconda): hbox = gtk.HBox (False, 5) pix = gui.readImageFromFile ("done.png") if pix: a = gtk.Alignment () a.add (pix) a.set (0.5, 0.5, 1.0, 1.0) a.set_size_request(200, -1) hbox.pack_start (a, False, False, 36) if isinstance(anaconda.platform, platform.S390): txt = _("Congratulations, your %s installation is complete.\n\n") % (productName,) if not anaconda.canReIPL: self.rebootButton.set_label(_("Shutdown")) txt = txt + _("Please shutdown to use the installed system.\n") else: txt = txt + _("Please reboot to use the installed system.\n") if not anaconda.reIPLMessage is None: txt = txt + "\n" + anaconda.reIPLMessage + "\n\n" txt = txt + _("Note that updates may be available to ensure the proper " "functioning of your system and installation of these " "updates is recommended after the reboot.") else: txt = _("Congratulations, your %s installation is complete.\n\n" "Please reboot to use the installed system. " "Note that updates may be available to ensure the proper " "functioning of your system and installation of these " "updates is recommended after the reboot.") %(productName,) label = gui.WrappingLabel(txt) label.set_size_request(250, -1) hbox.pack_start (label, True, True) gtk.gdk.beep() return hbox
def getScreen (self, anaconda): self.intf = anaconda.intf if anaconda.dir == DISPATCH_BACK: self.intf.icw.prevClicked() return self.pixmaps = self._getRnotes() # Create vbox to contain components of UI vbox = gtk.VBox (False, 12) # Create rnote area self.adpix = None self.adbox = None pix = gui.readImageFromFile ("progress_first.png") if pix: frame = gtk.Frame() frame.set_shadow_type(gtk.SHADOW_NONE) box = gtk.EventBox() self.adpix = pix box.add(self.adpix) self.adbox = box frame.add(box) vbox.pack_start(frame, False) self.progress = gtk.ProgressBar() vbox.pack_start(self.progress, False) self.infolabel = gui.WrappingLabel("") self.infolabel.set_alignment(0,0) vbox.pack_start(self.infolabel) # All done with creating components of UI self.intf.setPackageProgressWindow(self) self.intf.setInstallProgressClass(self) vbox.set_border_width(6) return vbox
def getScreen(self, anaconda): self.intf = anaconda.intf if anaconda.dir == DISPATCH_BACK: self.intf.icw.prevClicked() return self.pixmaps = self._getRnotes() # Create vbox to contain components of UI vbox = gtk.VBox(False, 12) # Create rnote area self.adpix = None self.adbox = None pix = gui.readImageFromFile("progress_first.png") if pix: frame = gtk.Frame() frame.set_shadow_type(gtk.SHADOW_NONE) box = gtk.EventBox() self.adpix = pix box.add(self.adpix) self.adbox = box frame.add(box) vbox.pack_start(frame, False) self.progress = gtk.ProgressBar() vbox.pack_start(self.progress, False) self.infolabel = gui.WrappingLabel("") self.infolabel.set_alignment(0, 0) vbox.pack_start(self.infolabel) # All done with creating components of UI self.intf.setPackageProgressWindow(self) self.intf.setInstallProgressClass(self) vbox.set_border_width(6) return vbox
def getScreen(self, anaconda): self.anaconda = anaconda self.storage = anaconda.storage self.intf = anaconda.intf self.dispatch = anaconda.dispatch if self.anaconda.dir == DISPATCH_FORWARD: # Save system's partition type setting and restore user's self.anaconda.clearPartTypeSystem = self.storage.config.clearPartType if self.anaconda.clearPartTypeSelection is not None: self.storage.config.clearPartType = self.anaconda.clearPartTypeSelection (self.xml, vbox) = gui.getGladeWidget("autopart.glade", "parttypeTable") self.encryptButton = self.xml.get_widget("encryptButton") self.reviewButton = self.xml.get_widget("reviewButton") self.lvmButton = self.xml.get_widget("lvmButton") self.table = self.xml.get_widget("parttypeTable") self.prevrev = None step_data = self.dispatch.step_data("parttype") self.reviewButton.set_active( step_data.get("review_checked", self.dispatch.step_enabled("partition"))) self.encryptButton.set_active(self.storage.encryptedAutoPart) self.lvmButton.set_active(self.storage.autoPartType == AUTOPART_TYPE_LVM) self.buttonGroup = pixmapRadioButtonGroup() self.buttonGroup.addEntry("all", _("Use _All Space"), pixmap=gui.readImageFromFile("partscheme-all.png"), descr=_("Removes all partitions on the selected " "device(s). This includes partitions " "created by other operating systems.\n\n" "<b>Tip:</b> This option will remove " "data from the selected device(s). Make " "sure you have backups.")) self.buttonGroup.addEntry("replace", _("Replace Existing _Linux System(s)"), pixmap=gui.readImageFromFile("partscheme-replace.png"), descr=_("Removes all Linux partitions on the " "selected device(s). This does " "not remove other partitions you may have " "on your storage device(s) (such as VFAT or " "FAT32).\n\n" "<b>Tip:</b> This option will remove " "data from the selected device(s). Make " "sure you have backups.")) self.buttonGroup.addEntry("shrink", _("_Shrink Current System"), pixmap=gui.readImageFromFile("partscheme-shrink.png"), descr=_("Shrinks existing partitions to create free " "space for the default layout.")) self.buttonGroup.addEntry("freespace", _("Use _Free Space"), pixmap=gui.readImageFromFile("partscheme-freespace.png"), descr=_("Retains your current data and partitions and " "uses only the unpartitioned space on the " "selected device(s), assuming you have enough " "free space available.")) self.buttonGroup.addEntry("custom", _("Create _Custom Layout"), pixmap=gui.readImageFromFile("partscheme-custom.png"), descr=_("Manually create your own custom layout on " "the selected device(s) using our partitioning " "tool.")) self.buttonGroup.setToggleCallback(self.typeChanged) widget = self.buttonGroup.render() self.table.attach(widget, 0, 1, 1, 2) # if not set in ks, use UI default if self.storage.clearPartChoice: self.buttonGroup.setCurrent(self.storage.clearPartChoice) else: if self.storage.config.clearPartType in (None, CLEARPART_TYPE_LINUX): self.buttonGroup.setCurrent("replace") elif self.storage.config.clearPartType == CLEARPART_TYPE_NONE: self.buttonGroup.setCurrent("freespace") elif self.storage.config.clearPartType == CLEARPART_TYPE_ALL: self.buttonGroup.setCurrent("all") if self.buttonGroup.getCurrent() == "custom": # make sure reviewButton is active and not sensitive if self.prevrev == None: self.prevrev = self.reviewButton.get_active() self.reviewButton.set_active(True) self.reviewButton.set_sensitive(False) self.encryptButton.set_sensitive(False) self.lvmButton.set_sensitive(False) return vbox
def getScreen(self, anaconda): self.running = 0 mainBox = gtk.VBox(False, 10) hbox = gtk.HBox(False, 5) pix = gui.readImageFromFile("config-language.png") if pix: a = gtk.Alignment() a.add(pix) hbox.pack_start(a, False) label = gtk.Label( _("What language would you like to use during the " "installation process?")) label.set_line_wrap(True) label.set_size_request(350, -1) hbox.pack_start(label, False) self.instLang = anaconda.instLanguage self.listStore = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) for locale in self.instLang.available(): iter = self.listStore.append() nick = self.instLang.getLangByName(locale) lang = '%s (<span lang="%s">%s</span>)' % (_(locale), "%s" % ( nick.split('.')[0], ), self.instLang.getNativeLangName(locale)) self.listStore.set_value(iter, 0, lang) self.listStore.set_value(iter, 1, locale) self.listStore.set_value(iter, 2, _(locale)) self.listStore.set_sort_column_id(2, gtk.SORT_ASCENDING) self.listView = gtk.TreeView(self.listStore) col = gtk.TreeViewColumn(None, gtk.CellRendererText(), markup=0) self.listView.append_column(col) self.listView.set_property("headers-visible", False) current = self.instLang.getLangName(self.instLang.instLang) iter = self.listStore.get_iter_first() while iter: if self.listStore.get_value(iter, 1) == current: selection = self.listView.get_selection() selection.unselect_all() selection.select_iter(iter) break iter = self.listStore.iter_next(iter) self.listView.connect("size-allocate", self.listScroll) sw = gtk.ScrolledWindow() sw.set_border_width(5) sw.set_shadow_type(gtk.SHADOW_IN) sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) sw.add(self.listView) setupTreeViewFixupIdleHandler(self.listView, self.listStore) mainBox.pack_start(hbox, False, False, 10) mainBox.pack_start(sw, True, True) self.running = 1 return mainBox
def getScreen (self, anaconda): self.running = 0 mainBox = gtk.VBox (False, 10) hbox = gtk.HBox(False, 5) pix = gui.readImageFromFile ("config-language.png") if pix: a = gtk.Alignment () a.add (pix) hbox.pack_start (a, False) label = gtk.Label (_("What language would you like to use during the " "installation process?")) label.set_line_wrap (True) label.set_size_request(350, -1) hbox.pack_start(label, False) self.instLang = anaconda.instLanguage self.listStore = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) for locale in self.instLang.available(): iter = self.listStore.append() nick = self.instLang.getLangByName(locale) lang = '%s (<span lang="%s">%s</span>)' % ( _(locale), "%s" % (nick.split('.')[0],), self.instLang.getNativeLangName(locale)) self.listStore.set_value(iter, 0, lang) self.listStore.set_value(iter, 1, locale) self.listStore.set_value(iter, 2, _(locale)) self.listStore.set_sort_column_id(2, gtk.SORT_ASCENDING) self.listView = gtk.TreeView(self.listStore) col = gtk.TreeViewColumn(None, gtk.CellRendererText(), markup=0) self.listView.append_column(col) self.listView.set_property("headers-visible", False) current = self.instLang.getLangName(self.instLang.instLang) iter = self.listStore.get_iter_first() while iter: if self.listStore.get_value(iter, 1) == current: selection = self.listView.get_selection() selection.unselect_all() selection.select_iter(iter) break iter = self.listStore.iter_next(iter) self.listView.connect("size-allocate", self.listScroll) sw = gtk.ScrolledWindow () sw.set_border_width (5) sw.set_shadow_type(gtk.SHADOW_IN) sw.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) sw.add (self.listView) setupTreeViewFixupIdleHandler(self.listView, self.listStore) mainBox.pack_start (hbox, False, False, 10) mainBox.pack_start (sw, True, True) self.running = 1 return mainBox
def getScreen(self, anaconda): self.anaconda = anaconda self.storage = anaconda.storage self.intf = anaconda.intf self.dispatch = anaconda.dispatch if self.anaconda.dir == DISPATCH_FORWARD: # Save system's partition type setting and restore user's self.anaconda.clearPartTypeSystem = self.storage.clearPartType if self.anaconda.clearPartTypeSelection is not None: self.storage.clearPartType = self.anaconda.clearPartTypeSelection (self.xml, vbox) = gui.getGladeWidget("autopart.glade", "parttypeTable") self.encryptButton = self.xml.get_widget("encryptButton") self.reviewButton = self.xml.get_widget("reviewButton") self.table = self.xml.get_widget("parttypeTable") self.prevrev = None self.reviewButton.set_active( not self.dispatch.stepInSkipList("partition")) self.encryptButton.set_active(self.storage.encryptedAutoPart) self.buttonGroup = pixmapRadioButtonGroup() self.buttonGroup.addEntry( "all", _("Use All Space"), pixmap=gui.readImageFromFile("partscheme-all.png"), descr=_("Removes all partitions on the selected " "device(s). This includes partitions " "created by other operating systems.\n\n" "<b>Tip:</b> This option will remove " "data from the selected device(s). Make " "sure you have backups.")) self.buttonGroup.addEntry( "replace", _("Replace Existing Linux System(s)"), pixmap=gui.readImageFromFile("partscheme-replace.png"), descr=_("Removes all Linux partitions on the " "selected device(s). This does " "not remove other partitions you may have " "on your storage device(s) (such as VFAT or " "FAT32).\n\n" "<b>Tip:</b> This option will remove " "data from the selected device(s). Make " "sure you have backups.")) self.buttonGroup.addEntry( "shrink", _("Shrink Current System"), pixmap=gui.readImageFromFile("partscheme-shrink.png"), descr=_("Shrinks existing partitions to create free " "space for the default layout.")) self.buttonGroup.addEntry( "freespace", _("Use Free Space"), pixmap=gui.readImageFromFile("partscheme-freespace.png"), descr=_("Retains your current data and partitions and " "uses only the unpartitioned space on the " "selected device(s), assuming you have enough " "free space available.")) self.buttonGroup.addEntry( "custom", _("Create Custom Layout"), pixmap=gui.readImageFromFile("partscheme-custom.png"), descr=_("Manually create your own custom layout on " "the selected device(s) using our partitioning " "tool.")) self.buttonGroup.setToggleCallback(self.typeChanged) widget = self.buttonGroup.render() self.table.attach(widget, 0, 1, 1, 2) # if not set in ks, use UI default if self.storage.clearPartChoice: self.buttonGroup.setCurrent(self.storage.clearPartChoice) else: if self.storage.clearPartType is None or self.storage.clearPartType == CLEARPART_TYPE_LINUX: self.buttonGroup.setCurrent("replace") elif self.storage.clearPartType == CLEARPART_TYPE_NONE: self.buttonGroup.setCurrent("freespace") elif self.storage.clearPartType == CLEARPART_TYPE_ALL: self.buttonGroup.setCurrent("all") if self.buttonGroup.getCurrent() == "custom": # make sure reviewButton is active and not sensitive if self.prevrev == None: self.prevrev = self.reviewButton.get_active() self.reviewButton.set_active(True) self.reviewButton.set_sensitive(False) self.encryptButton.set_sensitive(False) return vbox