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) bootstr = "" if rhpl.getArch() in ['s390', 's390x']: floppystr = "" if not anaconda.canReIPL: self.rebootButton.set_label(_("Shutdown")) if not anaconda.reIPLMessage is None: floppystr = anaconda.reIPLMessage else: floppystr = _("Remove any media used during the installation " "process and press the \"Reboot\" button to " "reboot your system." "\n\n") txt = _("Congratulations, the installation is complete.\n\n" "%s%s") %(floppystr, bootstr) label = gui.WrappingLabel(txt) hbox.pack_start (label, True, True) gtk.gdk.beep() return hbox
def __init__(self, storage, intf, parent): self.storage = storage self.intf = intf self.parent = parent self.dialog = None self.dialog = gtk.Dialog(_("Clone Drive Tool"), self.parent) self.dialog.set_default_size(500, 200) gui.addFrame(self.dialog) self.dialog.add_button('gtk-cancel', 2) self.dialog.add_button('gtk-ok', 1) self.dialog.set_position(gtk.WIN_POS_CENTER) # present list of drives as source vbox = gtk.VBox() clnmessage = _( "This tool clones the layout from a partitioned source " "onto other similar sized drives. The source must have " "partitions which are restricted to that drive and must " "ONLY contain unused software RAID partitions. " "EVERYTHING on the target drive(s) will be destroyed.\n") lbl = gui.WrappingLabel(clnmessage) vbox.pack_start(lbl) box = gtk.HBox() lbl = gtk.Label(_("Source Drive:")) lbl.set_alignment(0.0, 0.0) box.pack_start(lbl, padding=5) (sw, self.sourceView) = self.createDriveList(storage.partitioned) selection = self.sourceView.get_selection() selection.set_mode(gtk.SELECTION_SINGLE) box.pack_start(sw, padding=5) lbl = gtk.Label(_("Target Drive(s):")) lbl.set_alignment(0.0, 0.0) box.pack_start(lbl, padding=5) (sw, self.targetView) = self.createDriveList(storage.partitioned) selection = self.targetView.get_selection() selection.set_mode(gtk.SELECTION_MULTIPLE) box.pack_start(sw, padding=5) frame = gtk.Frame(_("Drives")) frame.add(box) vbox.pack_start(frame) # put contents into dialog self.dialog.vbox.pack_start(vbox) self.dialog.show_all() return
def getScreen(self, intf, instclass, dispatch): self.intf = intf self.dispatch = dispatch vbox = gtk.VBox(gtk.FALSE, 0) vbox.set_border_width(5) hbox = gtk.HBox(gtk.FALSE, 0) header = _("The default installation environment includes our " "recommended package selection, including:\n\n") footer = _("\n\nAfter installation, additional software can be " "added or removed using the 'system-config-packages' " "tool.\n\n" "If you are familiar with %s, you may have specific " "packages you would like to install or avoid " "installing. Check the box below to " "customize your installation.") % (productName, ) if len(instclass.pkgstext) > 0: labeltxt = header + _(instclass.pkgstext) + footer else: labeltxt = _( "If you would like to change the default package set to be " "installed you can choose to customize this below.") label = gui.WrappingLabel(labeltxt) hbox.pack_start(label, gtk.FALSE, gtk.FALSE, 0) vbox.pack_start(hbox, gtk.FALSE, gtk.FALSE, 0) self.acceptRadio = gtk.RadioButton( None, _("_Install default software packages")) self.customizeRadio = gtk.RadioButton( self.acceptRadio, _("_Customize software packages to be installed")) vbox2 = gtk.VBox(gtk.FALSE) vbox2.pack_start(self.acceptRadio, gtk.FALSE, gtk.FALSE, 0) vbox2.pack_start(self.customizeRadio, gtk.FALSE, gtk.FALSE, 0) al = gtk.Alignment(0.5, 0) al.add(vbox2) vbox.pack_start(al, gtk.FALSE, gtk.FALSE, 25) custom = not self.dispatch.stepInSkipList("package-selection") if custom: self.customizeRadio.set_active(1) else: self.acceptRadio.set_active(0) big_al = gtk.Alignment(0.5, 0.2) big_al.add(vbox) return big_al
def editDriveOrder(self, *args): # we only support this for grub if not self.usingGrub: self.intf.messageWindow(_("Unable to Change Drive Order for LILO"), _("We do not support changing the " "drive order for use with LILO."), type="ok") return dialog = gtk.Dialog(_("Edit Drive Order"), flags = gtk.DIALOG_MODAL) gui.addFrame(dialog) dialog.set_modal(gtk.TRUE) dialog.set_position(gtk.WIN_POS_CENTER) label = gui.WrappingLabel(_("Arrange the drives to be in the same " "order as used by the BIOS. Changing " "the drive order may be useful if you " "have multiple SCSI adapters or both SCSI " "and IDE adapters and want to boot from " "the SCSI device.\n\n" "Changing the drive order will change " "where the installation program " "locates the Master Boot Record (MBR).")) label.set_alignment(0.0, 0.0) dialog.vbox.pack_start(label, padding = 25) orderWidget = DriveOrderWidget(self.driveOrder, self.diskset) alignment = gtk.Alignment() alignment.set(0.5, 0, 0, 0) alignment.add(orderWidget.getWidget()) dialog.vbox.pack_start(alignment) dialog.add_button('gtk-cancel', 1) dialog.add_button('gtk-ok', 0) dialog.show_all() while 1: rc = dialog.run() if rc == 1: break self.driveOrder = orderWidget.getOrder() self.setMbrLabel(self.driveOrder[0]) break dialog.destroy() return rc
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 __init__(self, bl, parent, intf): self.parent = parent self.intf = intf if bl.getPassword(): usePass = 1 self.password = bl.getPassword() else: usePass = 0 self.password = None vbox = gtk.VBox(gtk.FALSE, 5) label = gui.WrappingLabel( _("A boot loader password prevents users from changing options passed to the kernel. For greater system security, it is recommended that you set a password." )) label.set_alignment(0.0, 0.5) vbox.pack_start(label, gtk.FALSE) # password widgets + callback self.usePassCb = gtk.CheckButton(_("_Use a boot loader password")) self.passButton = gtk.Button("No password") if usePass: self.usePassCb.set_active(gtk.TRUE) self.passButton.set_sensitive(gtk.TRUE) else: self.usePassCb.set_active(gtk.FALSE) self.passButton.set_sensitive(gtk.FALSE) self.usePassCb.connect("toggled", self.passCallback) self.passButton.connect("clicked", self.passButtonCallback) self.setPassLabel() box = gtk.HBox(gtk.FALSE, 5) box.pack_start(self.usePassCb) box.pack_start(self.passButton) vbox.pack_start(box, gtk.FALSE) alignment = gtk.Alignment() alignment.set(0.1, 0, 0, 0) alignment.add(vbox) self.widget = alignment
def getScreen (self): self.ics.setHelpEnabled (gtk.FALSE) hbox = gtk.HBox (gtk.FALSE, 5) pix = self.ics.readPixmap ("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, gtk.FALSE, gtk.FALSE, 36) bootstr = "" if iutil.getArch() == "s390": floppystr = "" else: floppystr = _("Remove any installation media (diskettes or " "CD-ROMs) used during the installation process " "and press the \"Reboot\" button to reboot your " "system." "\n\n") txt = _("Congratulations, the installation is complete.\n\n" "%s%s") %(floppystr, bootstr) foo = _("For information on Errata (updates and bug fixes), visit:\n" "\thttp://www.redhat.com/errata/\n\n" "For information on automatic updates through Red Hat " "Network, visit:\n" "\thttp://rhn.redhat.com/\n\n" "For information on using and configuring the system, visit:\n" "\thttp://www.redhat.com/docs/\n" "\thttp://www.redhat.com/apps/support/\n\n" "To register the product for support, visit:\n" "\thttp://www.redhat.com/apps/activate/\n\n") label = gui.WrappingLabel(txt) hbox.pack_start (label, gtk.TRUE, gtk.TRUE) 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) anaconda.id.setInstallProgressClass(self) vbox.set_border_width(6) return vbox
def setupChooseBootloaderRadioBox(self): radio_vbox = gtk.VBox(gtk.FALSE, 2) radio_vbox.set_border_width(5) label = gui.WrappingLabel( _("Please select the boot loader that " "the computer will use. GRUB is the " "default boot loader. However, if you " "do not wish to overwrite your current " "boot loader, select \"Do not install " "a boot loader.\" ")) label.set_alignment(0.0, 0.0) self.grub_radio = gtk.RadioButton(None, (_("Use _GRUB as the " "boot loader"))) if bootloader.showLilo: self.lilo_radio = gtk.RadioButton(self.grub_radio, (_("Use _LILO as the boot " "loader"))) else: self.lilo_radio = None self.none_radio = gtk.RadioButton(self.grub_radio, (_("_Do not " "install a " "boot loader"))) radio_vbox.pack_start(label, gtk.FALSE) radio_vbox.pack_start(self.grub_radio, gtk.FALSE) if self.lilo_radio: radio_vbox.pack_start(self.lilo_radio, gtk.FALSE) radio_vbox.pack_start(self.none_radio, gtk.FALSE) if self.blname is None: self.none_radio.set_active(gtk.TRUE) elif self.lilo_radio is not None and self.blname == "LILO" and iutil.getArch( ) == "i386": self.lilo_radio.set_active(gtk.TRUE) else: self.grub_radio.set_active(gtk.TRUE) return radio_vbox
def __init__(self, anaconda, parent): self.parent = parent self.intf = anaconda.intf if anaconda.id.bootloader.getPassword(): usePass = 1 self.password = anaconda.id.bootloader.getPassword() else: usePass = 0 self.password = None vbox = gtk.VBox(False, 5) label = gui.WrappingLabel(_("A boot loader password prevents users from changing options passed to the kernel. For greater system security, it is recommended that you set a password.")) label.set_alignment(0.0, 0.5) vbox.pack_start(label, False) # password widgets + callback self.usePassCb = gtk.CheckButton(_("_Use a boot loader password")) self.passButton = gtk.Button("No password") if usePass: self.usePassCb.set_active(True) self.passButton.set_sensitive(True) else: self.usePassCb.set_active(False) self.passButton.set_sensitive(False) self.usePassCb.connect("toggled", self.passCallback) self.passButton.connect("clicked", self.passButtonCallback) self.setPassLabel() box = gtk.HBox(False, 5) box.pack_start(self.usePassCb, False) box.pack_start(self.passButton, False) vbox.pack_start(box, False) self.widget = vbox
def __init__(self, anaconda, parent, blname): self.bl = anaconda.id.bootloader self.fsset = anaconda.id.fsset self.diskset = anaconda.id.diskset self.parent = parent self.intf = anaconda.intf if blname is not None: self.blname = blname else: self.blname = "GRUB" self.setIllegalChars() self.vbox = gtk.VBox(False, 5) label = gui.WrappingLabel(_("You can configure the boot loader to boot other operating systems. " "It will allow you to select an operating system to boot from the list. " "To add additional operating systems, which are not automatically " "detected, click 'Add.' To change the operating system booted by default, " "select 'Default' by the desired operating system.")) label.set_alignment(0.0, 0.0) label.set_size_request(350, -1) self.vbox.pack_start(label, False) spacer = gtk.Label("") spacer.set_size_request(10, 1) self.vbox.pack_start(spacer, False) box = gtk.HBox (False, 5) sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) sw.set_size_request(300, 100) box.pack_start(sw, True) self.osStore = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_BOOLEAN) self.osTreeView = gtk.TreeView(self.osStore) theColumns = [ _("Default"), _("Label"), _("Device") ] self.checkboxrenderer = gtk.CellRendererToggle() column = gtk.TreeViewColumn(theColumns[0], self.checkboxrenderer, active = 0) column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) self.checkboxrenderer.connect("toggled", self.toggledDefault) self.osTreeView.append_column(column) for columnTitle in theColumns[1:]: renderer = gtk.CellRendererText() column = gtk.TreeViewColumn(columnTitle, renderer, text = theColumns.index(columnTitle)) column.set_clickable(False) self.osTreeView.append_column(column) self.osTreeView.set_headers_visible(True) self.osTreeView.columns_autosize() self.osTreeView.set_size_request(100, 100) sw.add(self.osTreeView) self.osTreeView.connect('row-activated', self.osTreeActivateCb) self.imagelist = self.bl.images.getImages() self.defaultDev = self.bl.images.getDefault() self.fillOSList() buttonbar = gtk.VButtonBox() buttonbar.set_layout(gtk.BUTTONBOX_START) buttonbar.set_border_width(5) add = gtk.Button(_("_Add")) buttonbar.pack_start(add, False) add.connect("clicked", self.addEntry) edit = gtk.Button(_("_Edit")) buttonbar.pack_start(edit, False) edit.connect("clicked", self.editEntry) delete = gtk.Button(_("_Delete")) buttonbar.pack_start(delete, False) delete.connect("clicked", self.deleteEntry) box.pack_start(buttonbar, False) self.vbox.pack_start(box, False) self.widget = self.vbox
def editOther(self, oldDevice, oldLabel, isDefault, isRoot = 0): dialog = gtk.Dialog(_("Image"), self.parent) dialog.add_button('gtk-cancel', 2) dialog.add_button('gtk-ok', 1) dialog.set_position(gtk.WIN_POS_CENTER) gui.addFrame(dialog) dialog.vbox.pack_start(gui.WrappingLabel( _("Enter a label to be displayed in the boot loader menu. The " "device (or hard drive and partition number) is the device " "from which it boots."))) spacer = gtk.Label("") spacer.set_size_request(10, 1) dialog.vbox.pack_start(spacer, False) table = gtk.Table(2, 5) table.set_row_spacings(5) table.set_col_spacings(5) label = gui.MnemonicLabel(_("_Label")) table.attach(label, 0, 1, 1, 2, gtk.FILL, 0, 10) labelEntry = gtk.Entry(32) label.set_mnemonic_widget(labelEntry) table.attach(labelEntry, 1, 2, 1, 2, gtk.FILL, 0, 10) if oldLabel: labelEntry.set_text(oldLabel) label = gui.MnemonicLabel(_("_Device")) table.attach(label, 0, 1, 2, 3, gtk.FILL, 0, 10) if not isRoot: # XXX should potentially abstract this out into a function pedparts = [] parts = [] disks = self.diskset.disks for drive in disks.keys(): pedparts.extend(partedUtils.get_all_partitions(disks[drive])) for part in pedparts: parts.append(partedUtils.get_partition_name(part)) del pedparts parts.sort() deviceCombo = datacombo.DataComboBox() defindex = 0 i = 0 for part in parts: deviceCombo.append("/dev/%s" %(part,), part) if oldDevice and oldDevice == part: defindex = i i = i + 1 deviceCombo.set_active(defindex) table.attach(deviceCombo, 1, 2, 2, 3, gtk.FILL, 0, 10) label.set_mnemonic_widget(deviceCombo) else: table.attach(gtk.Label(oldDevice), 1, 2, 2, 3, gtk.FILL, 0, 10) default = gtk.CheckButton(_("Default Boot _Target")) table.attach(default, 0, 2, 3, 4, gtk.FILL, 0, 10) if isDefault != 0: default.set_active(True) if self.numentries == 1 and oldDevice != None: default.set_sensitive(False) else: default.set_sensitive(True) dialog.vbox.pack_start(table) dialog.show_all() while 1: rc = dialog.run() # cancel if rc == 2: break label = labelEntry.get_text() if not isRoot: dev = deviceCombo.get_active_value() else: dev = oldDevice if not label: self.intf.messageWindow(_("Error"), _("You must specify a label for the " "entry"), type="warning") continue foundBad = 0 for char in self.illegalChars: if char in label: self.intf.messageWindow(_("Error"), _("Boot label contains illegal " "characters"), type="warning") foundBad = 1 break if foundBad: continue # verify that the label hasn't been used foundBad = 0 for key in self.imagelist.keys(): if dev == key: continue if self.blname == "GRUB": thisLabel = self.imagelist[key][1] else: thisLabel = self.imagelist[key][0] # if the label is the same as it used to be, they must # have changed the device which is fine if thisLabel == oldLabel: continue if thisLabel == label: self.intf.messageWindow(_("Duplicate Label"), _("This label is already in " "use for another boot entry."), type="warning") foundBad = 1 break if foundBad: continue # XXX need to do some sort of validation of the device? # they could be duplicating a device, which we don't handle if dev in self.imagelist.keys() and (not oldDevice or dev != oldDevice): self.intf.messageWindow(_("Duplicate Device"), _("This device is already being " "used for another boot entry."), type="warning") continue # if we're editing a previous, get what the old info was for # labels. otherwise, make it something safe for grub and the # device name for lilo for lack of any better ideas if oldDevice: (oldshort, oldlong, oldisroot) = self.imagelist[oldDevice] else: (oldshort, oldlong, oldisroot) = (dev, label, None) # if we're editing and the device has changed, delete the old if oldDevice and dev != oldDevice: del self.imagelist[oldDevice] # go ahead and add it if self.blname == "GRUB": self.imagelist[dev] = (oldshort, label, isRoot) else: self.imagelist[dev] = (label, oldlong, isRoot) if default.get_active(): self.defaultDev = dev # refill the os list store self.fillOSList() break dialog.destroy()
def getScreen(self, dispatch, bl, fsset, diskSet): self.dispatch = dispatch self.bl = bl self.intf = dispatch.intf if self.bl.getPassword(): self.usePass = 1 self.password = self.bl.getPassword() else: self.usePass = 0 self.password = None thebox = gtk.VBox(gtk.FALSE, 10) spacer = gtk.Label("") spacer.set_size_request(10, 1) thebox.pack_start(spacer, gtk.FALSE) if self.bl.useGrub(): self.blname = "GRUB" else: self.blname = "LILO" # XXX this is kind of ugly if self.dispatch.stepInSkipList("instbootloader"): self.blname = None # make sure we get a valid device to say we're installing to if bl.getDevice() is not None: self.bldev = bl.getDevice() else: # we don't know what it is yet... if mbr is possible, we want # it, else we want the boot dev choices = fsset.bootloaderChoices(diskSet, self.bl) if choices.has_key('mbr'): self.bldev = choices['mbr'][0] else: self.bldev = choices['boot'][0] self.bllabel = gui.WrappingLabel("") self.bllabel.set_alignment(0.0, 0.5) hbox = gtk.HBox(gtk.FALSE, 10) hbox.pack_start(self.bllabel, gtk.FALSE) button = gtk.Button(_("_Change boot loader")) hbox.pack_start(button, gtk.FALSE) button.connect("clicked", self.changeBootloaderCallback) alignment = gtk.Alignment() alignment.set(0.1, 0, 0, 0) alignment.add(hbox) thebox.pack_start(alignment, gtk.FALSE) spacer = gtk.Label("") spacer.set_size_request(10, 1) thebox.pack_start(spacer, gtk.FALSE) # configure the systems available to boot from the boot loader self.oslist = OSBootWidget(bl, fsset, diskSet, self.parent, self.intf, self.blname) thebox.pack_start(self.oslist.getWidget(), gtk.FALSE) thebox.pack_start(gtk.HSeparator(), gtk.FALSE) # control whether or not there's a boot loader password and what it is self.blpass = BootloaderPasswordWidget(bl, self.parent, self.intf) thebox.pack_start(self.blpass.getWidget(), gtk.FALSE) thebox.pack_start(gtk.HSeparator(), gtk.FALSE) # check box to control showing the advanced screen self.advanced = gtk.CheckButton( _("Configure advanced boot loader " "_options")) if dispatch.stepInSkipList("bootloaderadvanced"): self.advanced.set_active(gtk.FALSE) else: self.advanced.set_active(gtk.TRUE) thebox.pack_start(self.advanced, gtk.FALSE) # finally, update the label and activate widgets appropriately self.updateBootLoaderLabel() return thebox
def getScreen (self, intf, network, firewall, security): self.firewall = firewall self.security = security self.network = network self.intf = intf self.devices = self.network.available().keys() self.devices.sort() self.netCBs = {} box = gtk.VBox (gtk.FALSE, 5) box.set_border_width (5) label = gui.WrappingLabel (_("A firewall can help prevent unauthorized access to your computer from the outside world. Would you like to enable a firewall?")) label.set_alignment (0.0, 0) label.set_size_request(450, -1) box.pack_start(label, gtk.FALSE) vbox = gtk.VBox (gtk.FALSE) self.disabled_radio = gtk.RadioButton (None, (_("N_o firewall"))) self.enabled_radio = gtk.RadioButton (self.disabled_radio, (_("_Enable firewall"))) self.custom_radio = gtk.RadioButton (self.disabled_radio, (_("_Custom firewall"))) self.disabled_radio.connect("clicked", self.activate_firewall) self.custom_radio.connect("clicked", self.activate_firewall) self.enabled_radio.connect("clicked", self.activate_firewall) vbox.pack_start (self.disabled_radio) vbox.pack_start (self.enabled_radio) a = gtk.Alignment () a.add (vbox) a.set (0.3, 0, 0.7, 1.0) box.pack_start (a, gtk.FALSE, 5) self.table = gtk.Table (2, 8) box.pack_start (self.table, gtk.FALSE, 5) y = 0 label = gtk.Label (_("What services should be allowed to pass through " "the firewall?")) label.set_size_request(450, -1) label.set_alignment(0.0, 0.0) self.table.attach(label, 0, 2, y, y + 1, gtk.EXPAND | gtk.FILL, gtk.FILL, 5, 5) y = y + 1 hbox = gtk.HBox(gtk.FALSE, 10) self.label2 = gui.MnemonicLabel (_("_Allow incoming:")) self.label2.set_alignment (0.2, 0.0) self.incoming = checklist.CheckList(1) self.incoming.set_size_request(-1, 125) self.label2.set_mnemonic_widget(self.incoming) incomingSW = gtk.ScrolledWindow() incomingSW.set_border_width(5) incomingSW.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) incomingSW.set_shadow_type(gtk.SHADOW_IN) incomingSW.add(self.incoming) # self.table.attach (self.label2, 0, 1, y, y + 1, gtk.FILL, gtk.FILL, 5, 5) self.table.attach (incomingSW, 0, 2, y, y + 1, gtk.EXPAND|gtk.FILL, gtk.FILL, 5, 5) self.knownPorts = {"SSH": self.firewall.ssh, "Telnet": self.firewall.telnet, "WWW (HTTP)": self.firewall.http, "Mail (SMTP)": self.firewall.smtp, "FTP": self.firewall.ftp} for item in self.knownPorts.keys(): self.incoming.append_row ((item, ""), self.knownPorts[item]) y = y + 1 self.label3 = gui.MnemonicLabel (_("Other _ports:")) self.ports = gtk.Entry () self.label3.set_mnemonic_widget(self.ports) self.table.attach (self.label3, 0, 1, y, y + 1, gtk.FILL, gtk.FILL, 5, 5) self.table.attach (self.ports, 1, 2, y, y + 1, gtk.EXPAND|gtk.FILL, gtk.FILL, 10, 5) y = y + 1 label = gui.WrappingLabel (_("If you would like to allow all traffic " "from a device, select it below.")) label.set_size_request(450, -1) label.set_alignment(0, 1) self.table.attach(label, 0, 2, y, y + 1, gtk.FILL, gtk.FILL, 5, 5) y = y + 1 hbox = gtk.HBox(gtk.FALSE, 10) self.label1 = gui.MnemonicLabel (_("_Trusted devices:")) self.label1.set_alignment (0.2, 0.0) self.trusted = checklist.CheckList(1) self.trusted.set_size_request(-1, 40) self.label1.set_mnemonic_widget(self.trusted) trustedSW = gtk.ScrolledWindow() trustedSW.set_border_width(5) trustedSW.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) trustedSW.set_shadow_type(gtk.SHADOW_IN) trustedSW.add(self.trusted) if self.devices != []: # self.table.attach (self.label1, 0, 1, y, y + 1, gtk.FILL, gtk.FILL, 5, 5) self.table.attach (trustedSW, 0, 2, y, y + 1, gtk.EXPAND|gtk.FILL, gtk.FILL, 5, 0) for device in self.devices: if device in self.firewall.trustdevs: self.trusted.append_row ((device, device), gtk.TRUE) else: self.trusted.append_row ((device, device), gtk.FALSE) y = y + 1 if self.firewall.enabled == 0: self.disabled_radio.set_active (gtk.TRUE) else: self.enabled_radio.set_active(gtk.TRUE) if self.firewall.portlist != "": self.ports.set_text (self.firewall.portlist) self.activate_firewall(None) box.pack_start (gtk.HSeparator(), gtk.FALSE) label = gtk.Label(_("_Security Enhanced Linux (SELinux) Extensions:")) label.set_use_underline(gtk.TRUE) self.se_option_menu = gtk.OptionMenu() label.set_mnemonic_widget(self.se_option_menu) se_menu = gtk.Menu() for i in (_("Disabled"), _("Warn"), _("Active")): se_menu.add(gtk.MenuItem(i)) self.se_option_menu.set_menu(se_menu) self.se_option_menu.set_history(self.security.getSELinux()) hbox = gtk.HBox() hbox.set_spacing(8) hbox.pack_start(label, gtk.FALSE) hbox.pack_start(self.se_option_menu, gtk.TRUE) if flags.selinux == 0: hbox.set_sensitive(gtk.FALSE) if (SELINUX_DEFAULT == 1) or flags.selinux: box.pack_start(hbox, gtk.FALSE) return box
def passwordWindow(self, *args): dialog = gtk.Dialog(_("Enter Boot Loader Password"), self.parent) dialog.add_button('gtk-cancel', 2) dialog.add_button('gtk-ok', 1) dialog.set_position(gtk.WIN_POS_CENTER) gui.addFrame(dialog) label = gui.WrappingLabel(_("Enter a boot loader password and then confirm it. (Note that your BIOS keymap may be different than the actual keymap you are used to.)")) label.set_alignment(0.0, 0.0) dialog.vbox.pack_start(label) table = gtk.Table(2, 2) table.set_row_spacings(5) table.set_col_spacings(5) label = gui.MnemonicLabel(_("_Password:"******"Con_firm:")) table.attach(label, 0, 1, 3, 4, gtk.FILL, 0, 10) confirmEntry = gtk.Entry (16) confirmEntry.set_visibility (False) label.set_mnemonic_widget(confirmEntry) table.attach(confirmEntry, 1, 2, 3, 4, gtk.FILL, 0, 10) dialog.vbox.pack_start(table) # set the default if self.password: pwEntry.set_text(self.password) confirmEntry.set_text(self.password) dialog.show_all() while 1: rc = dialog.run() if rc == 2: break if pwEntry.get_text() != confirmEntry.get_text(): self.intf.messageWindow(_("Passwords don't match"), _("Passwords do not match"), type='warning') continue thePass = pwEntry.get_text() if not thePass: continue if len(thePass) < 6: ret = self.intf.messageWindow(_("Warning"), _("Your boot loader password is less than " "six characters. We recommend a longer " "boot loader password." "\n\n" "Would you like to continue with this " "password?"), type = "yesno") if ret == 0: continue self.password = thePass break dialog.destroy() return rc
def getScreen (self, anaconda): self.rootPassword = anaconda.id.rootPassword self.intf = anaconda.intf self.passwords = {} box = gtk.VBox () box.set_border_width(5) hbox = gtk.HBox() pix = gui.readImageFromFile ("root-password.png") if pix: hbox.pack_start (pix, False) label = gui.WrappingLabel (_("The root account is used for " "administering the system. Enter " "a password for the root user.")) label.set_line_wrap(True) label.set_size_request(350, -1) label.set_alignment(0.0, 0.5) hbox.pack_start(label, False) box.pack_start(hbox, False) self.forward = lambda widget, box=box: box.emit('focus', gtk.DIR_TAB_FORWARD) table = gtk.Table (2, 2) table.set_size_request(365, -1) table.set_row_spacings (5) table.set_col_spacings (5) pass1 = gui.MnemonicLabel (_("Root _Password: "******"_Confirm: ")) pass2.set_alignment (0.0, 0.5) table.attach (pass2, 0, 1, 1, 2, gtk.FILL, 0, 10) self.pw = gtk.Entry (128) pass1.set_mnemonic_widget(self.pw) self.pw.connect ("activate", self.forward) self.pw.connect ("map-event", self.setFocus) self.pw.set_visibility (False) self.confirm = gtk.Entry (128) pass2.set_mnemonic_widget(self.confirm) self.confirm.connect ("activate", self.forward) self.confirm.set_visibility (False) table.attach (self.pw, 1, 2, 0, 1, gtk.FILL|gtk.EXPAND, 5) table.attach (self.confirm, 1, 2, 1, 2, gtk.FILL|gtk.EXPAND, 5) hbox = gtk.HBox() hbox.pack_start(table, False) box.pack_start (hbox, False) # root password statusbar self.rootStatus = gtk.Label ("") wrapper = gtk.HBox(0, False) wrapper.pack_start (self.rootStatus) box.pack_start (wrapper, False) if not self.rootPassword["isCrypted"]: self.pw.set_text(self.rootPassword["password"]) self.confirm.set_text(self.rootPassword["password"]) else: self.pw.set_text("xxxxxxxx") self.confirm.set_text("xxxxxxxx") return box
def selectInstallNetDeviceDialog(network, devices=None): devs = devices or network.netdevices.keys() if not devs: return None devs.sort() dialog = gtk.Dialog(_("Select network interface")) dialog.add_button('gtk-cancel', gtk.RESPONSE_CANCEL) dialog.add_button('gtk-ok', 1) dialog.set_position(gtk.WIN_POS_CENTER) gui.addFrame(dialog) dialog.vbox.pack_start( gui.WrappingLabel( _("This requires that you have an active " "network connection during the installation " "process. Please configure a network interface."))) combo = gtk.ComboBox() cell = gtk.CellRendererText() combo.pack_start(cell, True) combo.set_attributes(cell, text=0) cell.set_property("wrap-width", 525) combo.set_size_request(480, -1) store = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING) combo.set_model(store) ksdevice = network.getKSDevice() if ksdevice: ksdevice = ksdevice.get('DEVICE') preselected = None for dev in devices: i = store.append(None) if not preselected: preselected = i desc = network.netdevices[dev].description if desc: desc = "%s - %s" % (dev, desc) else: desc = "%s" % (dev, ) hwaddr = network.netdevices[dev].get("HWADDR") if hwaddr: desc = "%s - %s" % ( desc, hwaddr, ) if ksdevice and ksdevice == dev: preselected = i store[i] = (desc, dev) combo.set_active_iter(preselected) dialog.vbox.pack_start(combo) dialog.show_all() rc = dialog.run() if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]: install_device = None else: active = combo.get_active_iter() install_device = combo.get_model().get_value(active, 1) dialog.destroy() return install_device
def __init__(self, partitions, diskset, intf, parent): self.partitions = partitions self.diskset = diskset self.intf = intf self.parent = parent self.dialog = None self.dialog = gtk.Dialog(_("Make RAID Device"), self.parent) self.dialog.set_size_request(500, 400) gui.addFrame(self.dialog) self.dialog.add_button('gtk-cancel', 2) self.dialog.add_button('gtk-ok', 1) self.dialog.set_position(gtk.WIN_POS_CENTER) # present list of drives as source vbox = gtk.VBox() lbl = gui.WrappingLabel( _("Clone Drive Tool\n\n" "This tool allows you to significantly " "reduce the amount of effort required " "to setup RAID arrays. The idea is to " "take a source drive which has been " "prepared with the desired partitioning " "layout, and clone this layout onto other " "similar sized drives. Then a RAID device " "can be created.\n\n" "NOTE: The source drive must have " "partitions which are restricted to be on " "that drive only, and can only contain " "unused software RAID partitions. Other " "partition types are not allowed.\n\n" "EVERYTHING on the target drive(s) will be " "destroyed by this process.")) vbox.pack_start(lbl) box = gtk.HBox() lbl = gtk.Label(_("Source Drive:")) lbl.set_alignment(0.0, 0.0) box.pack_start(lbl, padding=5) (sw, self.sourceView) = self.createDriveList(diskset) selection = self.sourceView.get_selection() selection.set_mode(gtk.SELECTION_SINGLE) box.pack_start(sw) lbl = gtk.Label(_("Target Drive(s):")) lbl.set_alignment(0.0, 0.0) box.pack_start(lbl, padding=5) (sw, self.targetView) = self.createDriveList(diskset) selection = self.targetView.get_selection() selection.set_mode(gtk.SELECTION_MULTIPLE) box.pack_start(sw) frame = gtk.Frame(_("Drives")) frame.add(box) vbox.pack_start(frame) # put contents into dialog self.dialog.vbox.pack_start(vbox) self.dialog.show_all() return