def ui_content(self): page_title = _("Please select the disk to use for booting %s") % \ self.application.product.PRODUCT_SHORT other_device = self._model.get("boot.device.custom", "") devices = self.storage_discovery.all_devices_for_ui_table() ws = [ui.Header("header[0]", page_title)] tbl_head = self.storage_discovery.tbl_tpl.format(bus=_("Location"), name=_("Device Name"), size=_("Size (GB)")) if devices: ws += [ui.Table("boot.device", "", tbl_head, devices), ui.Divider("divider[0]"), ui.Button("button.other_device", "Other device: %s" % other_device), DeviceDetails("label.details", self, _("(No device)")) ] else: ws += [ui.Label("boot.no_device", _("No Valid Boot Devices Detected"))] page = ui.Page("boot", ws) page.buttons = [ui.QuitButton("button.quit", _("Quit")), ui.Button("button.back", _("Back")), ui.SaveButton("button.next", _("Continue"))] self.widgets.add(page) return page
def ui_content(self): ws = [ ui.Header("header[0]", _("Require a password for the admin user?")), ui.Label( "label[0]", _("Please enter the current admin ") + _("password. You may also change the admin password ") + _("if required. If the new password fields are left ") + _("blank the password will remain the same.")), ui.Label("label[1]", _("Password for the admin user")), ui.Divider("divider[0]"), ui.PasswordEntry("upgrade.current_password", _("Current Password:"******"divider[1]"), ui.ConfirmedEntry("upgrade.password", _("Password:"******"current_password.info", ""), ui.Label("password.info", self.__no_new_password_msg) ] page = ui.Page("password", ws) page.buttons = [ ui.QuitButton("button.quit", "Quit"), ui.Button("button.back", "Back"), ui.SaveButton("button.next", "Update") ] self.widgets.add(page) return page
def ui_content(self): page_title = "Please select the disk to use for booting %s" % \ self.application.product.PRODUCT_SHORT other_device = self._model.get("boot.device.custom", "") devices = self.storage_discovery.all_devices_for_ui_table(other_device) ws = [ui.Header("header[0]", page_title)] if devices: ws += [ ui.Table( "boot.device", "", " %6s %11s %5s" % ("Location", "Device Name", "Size"), devices), DeviceDetails("label.details", self, "(No device)") ] else: ws += [ ui.Label("boot.no_device", "No Valid Boot Devices Detected") ] page = ui.Page("boot", ws) page.buttons = [ ui.QuitButton("button.quit", "Quit"), ui.Button("button.back", "Back"), ui.SaveButton("button.next", "Continue") ] self.widgets.add(page) return page
def ui_content(self): ws = [ ui.Header("header[0]", "Require a password for local console access?"), ui.Label( "label[0]", "Please enter the current admin " + "password. You may also change the admin password " + "if required. If the new password fields are left" + "blank the password will remain the same."), ui.Label("label[1]", "Password for local console access"), ui.Divider("divider[0]"), ui.PasswordEntry("upgrade.current_password", "Current Password:"******"divider[1]"), ui.PasswordEntry("upgrade.password", "Password:"******"upgrade.password_confirmation", "Confirm Password:"******"divider[2]"), ui.Label("current_password.info", ""), ui.Label("password.info", self.__no_new_password_msg) ] self.widgets.add(ws) page = ui.Page("password", ws) page.buttons = [ ui.QuitButton("button.quit", "Quit"), ui.Button("button.back", "Back"), ui.SaveButton("button.next", "Update") ] return page
def ui_content(self): ws = [ ui.Header("header[0]", "Storage Volumes"), ui.Label( "label[0]", "Please enter the sizes for the " + "following partitions in MB"), ui.Divider("divider[0]"), ui.Entry("storage.efi_size", "UEFI/Bios:", enabled=False), ui.Divider("divider[1]"), ui.Entry("storage.root_size", "Root & RootBackup:", enabled=False), ui.Label("label[1]", "(2 partitions at 512MB each)"), ui.Divider("divider[2]"), ui.Entry("storage.swap_size", "Swap:"), ui.Entry("storage.config_size", "Config:"), ui.Entry("storage.logging_size", "Logging:"), ui.Entry("storage.data_size", "Data:"), ] self.widgets.add(ws) page = ui.Page("storage", ws) page.buttons = [ ui.QuitButton("button.quit", "Quit"), ui.Button("button.back", "Back"), ui.SaveButton("button.next", "Next") ] return page
def ui_content(self): ws = [ui.Header("header[0]", _("Installation"))] ws += self.___installation_options() ws += [ui.Divider("divider[0]")] ws += self.__additional_infos() self.widgets.add(ws) page = ui.Page("welcome", ws) page.buttons = [ui.QuitButton("button.quit", _("Quit"))] return page
def ui_content(self): page_title = \ _("Please select the disk(s) to use for installation of %s") \ % self.application.product.PRODUCT_SHORT other_device = self._model.get("installation.device.custom", "") devices = self.storage_discovery.all_devices_for_ui_table() ws = [ui.Header("header[0]", page_title)] tbl_head = self.storage_discovery.tbl_tpl.format(bus="Location", name="Device Name", size="Size (GB)") if devices: ws += [ ui.Table("installation.device.current", "", tbl_head, devices, height=3, multi=True), ui.Button("button.other_device", "Other Device: %s" % other_device), ui.Divider("divider[0]"), DeviceDetails("installation.device.details", self, _("(No device)")) ] else: ws += [ ui.Label("installation.no_device", _("No Valid Install Devices Detected")) ] page = ui.Page("installation", ws) page.buttons = [ ui.QuitButton("button.quit", _("Quit")), ui.Button("button.back", _("Back")), ui.SaveButton("button.next", _("Continue")) ] self.widgets.add(page) # We are directly connecting to the table's on_change event # The tables on_change event is fired (in the multi-case) # when the highlighted entry is changed. table = self.widgets["installation.device.current"] table.on_change.connect(self.__update_details) return page
def ui_content(self): kbd = system.Keyboard() c = kbd.get_current() self.logger.debug("Current layout: %s" % c) ws = [ui.Header("header[0]", "Keyboard Layout Selection"), ui.Table("keyboard.layout", "", "Available Keyboard Layouts", kbd.available_layouts(), c), ui.Label("label[0]", "(Hit Enter to select a layout)") ] self.widgets.add(ws) page = ui.Page("keyboard", ws) page.buttons = [ui.QuitButton("button.quit", "Quit"), ui.Button("button.back", "Back"), ui.SaveButton("button.next", "Continue")] return page
def ui_content(self): ws = [ui.Header("header[0]", _("Storage Volumes")), ui.KeywordLabel("storage.drive_size", "Drive size: ")] if not self.__enough_free_space(): ws.extend([ui.Notice("space.notice", "Not enough space! Needs at least " "%sMB for installation, %sMB " "available" % (str(self._min_drive_size), self._drive_size))]) if not self._fill: ws.extend([ui.KeywordLabel("storage.free_space", "Remaining Space: ")]) ws.extend([ui.Label("label[0]", "Please enter the sizes for the " + "following partitions in MB"), ui.Checkbox("storage.fill_data", "Fill disk with Data " + "partition", True), ui.Entry("storage.efi_size", _("UEFI/Bios:"), enabled=False), ui.Entry("storage.root_size", _("Root & RootBackup:"), enabled=False), ui.Label("label[1]", _("(2 partitions at %sMB each)") % self.model().get("storage.root_size")), ui.Divider("divider[2]"), ui.Entry("storage.swap_size", _("Swap MB:")), ui.Entry("storage.config_size", _("Config MB:")), ui.Entry("storage.logging_size", _("Logging MB:")), ui.Entry("storage.data_size", _("Data MB:"), enabled=not self._fill), ]) if not self._fill: ws.extend([ui.Label("label[2]", "(-1 fills all free space)")]) self.widgets.add(ws) page = ui.Page("storage", ws) page.buttons = [ui.QuitButton("button.quit", _("Quit")), ui.Button("button.back", _("Back"))] if self.__enough_free_space(): can_continue = self.model() and self.__calculate_free_space() >= 0 page.buttons.extend([ui.SaveButton("button.next", _("Continue"), enabled=can_continue)]) return page
def ui_content(self): ws = [ui.Header("header[0]", "Require a password for the admin user?"), ui.Divider("divider[0]"), ui.PasswordEntry("admin.password", "Password:"******"admin.password_confirmation", "Confirm Password:"******"divider[1]"), ui.Label("password.info", "") ] self.widgets.add(ws) page = ui.Page("password", ws) page.buttons = [ui.QuitButton("button.quit", "Quit"), ui.Button("button.back", "Back"), ui.SaveButton("button.next", "Install")] return page
def ui_content(self): ws = [ ui.Header("header[0]", "Require a password for local console access?"), ui.Divider("divider[0]"), ui.PasswordEntry("root.password", "Password:"******"root.password_confirmation", "Confirm Password:"******"password", ws) page.buttons = [ ui.QuitButton("button.quit", "Quit"), ui.Button("button.back", "Back"), ui.SaveButton("button.next", "Install") ] return page
def ui_content(self): ws = [ ui.Header("header[0]", _("Storage Volumes")), ui.KeywordLabel("storage.drive_size", "Drive size: ") ] if not self._fill: ws.extend( [ui.KeywordLabel("storage.free_space", "Remaining Space: ")]) ws.extend([ ui.Label( "label[0]", "Please enter the sizes for the " + "following partitions in MB"), ui.Checkbox("storage.fill_data", "Fill disk with Data " + "partition", True), ui.Entry("storage.efi_size", _("UEFI/Bios:"), enabled=False), ui.Entry("storage.root_size", _("Root & RootBackup:"), enabled=False), ui.Label( "label[1]", _("(2 partitions at %sMB each)") % self.model().get("storage.efi_size")), ui.Divider("divider[2]"), ui.Entry("storage.swap_size", _("Swap:")), ui.Entry("storage.config_size", _("Config:")), ui.Entry("storage.logging_size", _("Logging:")), ui.Entry("storage.data_size", _("Data:"), enabled=not self._fill), ]) if not self._fill: ws.extend([ui.Label("label[2]", "(-1 fills all free space)")]) self.widgets.add(ws) page = ui.Page("storage", ws) page.buttons = [ ui.QuitButton("button.quit", _("Quit")), ui.Button("button.back", _("Back")), ui.SaveButton("button.next", _("Continue")) ] return page
def ui_content(self): ws = [ ui.Header("header[0]", _("Enter a password for the admin user")), ui.Divider("divider[0]"), ui.ConfirmedEntry("admin.password", _("Password:"******"password", ws) page.buttons = [ ui.QuitButton("button.quit", _("Quit")), ui.Button("button.back", _("Back")), ui.SaveButton("button.next", _("Install"), enabled=False) ] self.widgets.add(page) return page
def ui_content(self): align = lambda l: l.ljust(16) if not self._model: self._build_model() ws = [ ui.Header("header[0]", _("Confirm disk selections")), ui.Notice("notice[0]", _("The data on these disks will " "be erased!")), ui.KeywordLabel("boot.header", _("Boot device")), DiskDetails("boot.device.current", self, self._model["boot.device.current"]) ] if self._storage_tagged(self._model["boot.device.current"]): ws.extend([ ui.Notice("boot.notice", _("Boot device may be part " "of a storage domain!")) ]) ws.extend([ui.KeywordLabel("install.header", "Install devices")]) for i in range(len(self._model["installation.devices"])): ws.extend([ DiskDetails("installation.device[%s]" % i, self, self._model["installation.devices"][i]) ]) if self._storage_tagged(self._model["installation.devices"][i]): ws.extend([ ui.Notice( "installation.notice[%s]" % i, _("This device may be part of a storage " "domain!")) ]) ws.extend([ ui.Divider("divider[0]"), ui.KeywordLabel("storage.volumes", _("Volume sizes")) ]) intuples = lambda lst, n: [lst[x:x + n] for x in range(0, len(lst), n)] for xs in intuples( sorted(k for k in self._model.keys() if k.startswith("storage.")), 2): chi = [] for x in xs: chi.append( ui.KeywordLabel( x, _( align( x.replace("_", " ").replace( "storage.", "").title() + ":")))) row = ui.Row("row[%s]" % xs, chi) ws.append(row) if int(self._model["storage.data_size"]) < (50 * 1024): ws.extend([ ui.Divider("divider.he"), ui.Notice( "notice.he", "The size of the data volume is " "not large enough to use the Engine " "Appliance, must be at least 50GB (51200MB)") ]) page = ui.Page("confirmation", ws) page.buttons = [ ui.QuitButton("button.quit", _("Quit")), ui.Button("button.back", _("Back")), ui.SaveButton("button.next", _("Confirm")) ] self.widgets.add(page) return page