def initialize(self): NormalSpoke.initialize(self) self._enableButton = self.builder.get_object("enableKdumpCheck") self._reservationTypeLabel = self.builder.get_object("reservationTypeLabel") self._autoButton = self.builder.get_object("autoButton") self._manualButton = self.builder.get_object("manualButton") self._currentlyReservedLabel = self.builder.get_object("currentlyReservedLabel") self._currentlyReservedMB = self.builder.get_object("currentlyReservedMB") self._toBeReservedLabel = self.builder.get_object("toBeReservedLabel") self._toBeReservedSpin = self.builder.get_object("toBeReservedSpin") self._totalMemLabel = self.builder.get_object("totalMemLabel") self._totalMemMB = self.builder.get_object("totalMemMB") self._usableMemLabel = self.builder.get_object("usableMemLabel") self._usableMemMB = self.builder.get_object("usableMemMB") self._config_buffer = self.builder.get_object("advancedConfigBuffer") # Set an initial value and adjustment on the spin button lower, upper, step = getMemoryBounds() adjustment = Gtk.Adjustment(lower, lower, upper, step, step, 0) self._toBeReservedSpin.set_adjustment(adjustment) self._toBeReservedSpin.set_value(lower) # Initialize the advanced config area with the contents of /etc/kdump.conf try: with open(CONFIG_FILE, "r") as fobj: self._config_buffer.set_text(fobj.read()) except IOError: self._config_buffer.set_text("")
def __init__(self, *args): NormalSpoke.__init__(self, *args) self.applyOnSkip = True self.ancestors = [] self.disks = [] self.selected_disks = []
def __init__(self, data, storage, payload): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing payload-related information :type payload: pyanaconda.payload.Payload """ self._error = None self._back_already_clicked = False self._storage_playground = None self.label_actions = None self.button_reset = None self.button_undo = None self._bootloader_observer = STORAGE.get_observer(BOOTLOADER) self._bootloader_observer.connect() StorageCheckHandler.__init__(self) NormalSpoke.__init__(self, data, storage, payload)
def refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD_MD) if self.environment not in self.payload.environments: self.environment = None firstEnvironment = True firstRadio = None self._clear_listbox(self._environmentListBox) for environment in self.payload.environments: (name, desc) = self.payload.environmentDescription(environment) radio = Gtk.RadioButton(group=firstRadio) active = environment == self.environment or \ not self.environment and firstEnvironment radio.set_active(active) if active: self.environment = environment self._add_row(self._environmentListBox, name, desc, radio) firstRadio = firstRadio or radio firstEnvironment = False self.refreshAddons()
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) LangLocaleHandler.__init__(self, self.payload) self._selected_locales = set() self._l12_module = LOCALIZATION.get_observer() self._l12_module.connect()
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) self._currentIsoFile = None self._ready = False self._error = False self._proxyChange = False self._cdrom = None
def initialize(self): """ The initialize method that is called after the instance is created. The difference between __init__ and this method is that this may take a long time and thus could be called in a separated thread. :see: pyanaconda.ui.common.UIObject.initialize """ NormalSpoke.initialize(self) self.initialize_start() self._storage_playground = None config.log_dir = "/tmp" self.client = osinstall.BlivetGUIAnacondaClient() box = self.builder.get_object("BlivetGuiViewport") self.label_actions = self.builder.get_object("summary_label") self.button_reset = self.builder.get_object("resetAllButton") self.button_undo = self.builder.get_object("undoLastActionButton") config.default_fstype = self._storage.default_fstype self.blivetgui = osinstall.BlivetGUIAnaconda(self.client, self, box) # this needs to be done when the spoke is already "realized" self.entered.connect(self.blivetgui.ui_refresh) # set up keyboard shurtcuts for blivet-gui (and unset them after # user lefts the spoke) self.entered.connect(self.blivetgui.set_keyboard_shortcuts) self.exited.connect(self.blivetgui.unset_keyboard_shortcuts) self.initialize_done()
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) self.applyOnSkip = True self._ready = False self.selected_disks = self.data.ignoredisk.onlyuse[:] # This list contains all possible disks that can be included in the install. # All types of advanced disks should be set up for us ahead of time, so # there should be no need to modify this list. self.disks = [] if not flags.automatedInstall: # default to using autopart for interactive installs self.data.autopart.autopart = True self.autopart = self.data.autopart.autopart self.autoPartType = None self.clearPartType = CLEARPART_TYPE_NONE self._previous_autopart = False self._last_clicked_overview = None self._cur_clicked_overview = None # nkwin7 add begin self.hubClass = None self.spokeClass = None
def __init__(self, data, storage, payload, instclass): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing packaging-related information :type payload: pyanaconda.packaging.Payload :param instclass: distribution-specific information :type instclass: pyanaconda.installclass.BaseInstallClass """ NormalSpoke.__init__(self, data, storage, payload, instclass) self.logger = logging.getLogger("anaconda") self.main_box = self.builder.get_object("mainBox") self.thread_dialog = None self.qubes_user = None self.qubes_gid = None self.default_template = 'fedora-26' self.set_stage("Start-up") self.done = False self.__init_qubes_choices()
def initialize(self): from pyanaconda.ui.gui.utils import setViewportBackground NormalSpoke.initialize(self) # Wouldn't it be nice if glade knew how to do this? label = self.builder.get_object("summary_button").get_children()[0] markup = "<span foreground='blue'><u>%s</u></span>" % label.get_text() label.set_use_markup(True) label.set_markup(markup) specializedButton = self.builder.get_object("addSpecializedButton") # It's uh... uh... it's down there somewhere, let me take another look. label = specializedButton.get_children()[0].get_children()[0].get_children()[1] markup = "<span size='large'><b>%s</b></span>" % label.get_text() label.set_use_markup(True) label.set_markup(markup) specializedButton.show_all() self.local_disks_box = self.builder.get_object("local_disks_box") self.specialized_disks_box = self.builder.get_object("specialized_disks_box") threadMgr.add(AnacondaThread(name=constants.THREAD_STORAGE_WATCHER, target=self._initialize))
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) self._errorMsgs = None self._tx_id = None self._selectFlag = False self.selectedGroups = [] self.excludedGroups = [] self.environment = None self._environmentListBox = self.builder.get_object("environmentListBox") self._addonListBox = self.builder.get_object("addonListBox") # Connect viewport scrolling with listbox focus events environmentViewport = self.builder.get_object("environmentViewport") addonViewport = self.builder.get_object("addonViewport") self._environmentListBox.set_focus_vadjustment(environmentViewport.get_vadjustment()) self._addonListBox.set_focus_vadjustment(addonViewport.get_vadjustment()) # Used to store how the user has interacted with add-ons for the default add-on # selection logic. The dictionary keys are group IDs, and the values are selection # state constants. See refreshAddons for how the values are used. self._addonStates = {} # Used for detecting whether anything's changed in the spoke. self._origAddons = [] self._origEnvironment = None # Register event listeners to update our status on payload events payloadMgr.addListener(payloadMgr.STATE_PACKAGE_MD, self._downloading_package_md) payloadMgr.addListener(payloadMgr.STATE_GROUP_MD, self._downloading_group_md) payloadMgr.addListener(payloadMgr.STATE_FINISHED, self._payload_finished) payloadMgr.addListener(payloadMgr.STATE_ERROR, self._payload_error)
def initialize(self): """ The initialize method that is called after the instance is created. The difference between __init__ and this method is that this may take a long time and thus could be called in a separated thread. :see: pyanaconda.ui.common.UIObject.initialize """ NormalSpoke.initialize(self) import logging self.log = logging.getLogger("anaconda") self.log.info("Rocks was here") # self.builder.connect_signals(self) # Get the Main Window, and connect the "destroy" event # self.window = self.builder.get_object("RollsWindow") self.rollUrl = self.builder.get_object("rollUrl") self.rollUrl.set_text(self.defaultUrl) self.listStore = self.builder.get_object("listRoll") self.selectStore = self.builder.get_object("selectedRolls") self.rollSelectCombo = self.builder.get_object("rollSelectCombo") sys.path.append("/opt/rocks/lib/python2.7/site-packages") import rocks.media import rocks.installcgi self.media = rocks.media.Media() self.install = rocks.installcgi.InstallCGI(rootdir="/tmp/rocks")
def __init__(self, data, storage, payload, instclass): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing payload-related information :type payload: pyanaconda.payload.Payload :param instclass: distribution-specific information :type instclass: pyanaconda.installclass.BaseInstallClass """ self._error = None self._back_already_clicked = False self._storage_playground = None self.label_actions = None self.button_reset = None self.button_undo = None StorageCheckHandler.__init__(self) NormalSpoke.__init__(self, data, storage, payload, instclass)
def initialize(self): """ The initialize method that is called after the instance is created. The difference between __init__ and this method is that this may take a long time and thus could be called in a separated thread. :see: pyanaconda.ui.common.UIObject.initialize """ NormalSpoke.initialize(self) self.success = False self.complete = False self.data.addons.org_centos_cloud.env = "firstboot" self.button = self.builder.get_object("button1") self.progressbar = self.builder.get_object("progressbar1") if self.data.addons.org_centos_cloud.state == "False": # Addon is disabled self.complete = True elif self.data.addons.org_centos_cloud.state == "True": #print("--disable") if self.data.addons.org_centos_cloud.arguments == "--allinone": pass # call run packstack --allinone or activate click button elif self.data.addons.org_centos_cloud.arguments: # --answer-file pass # call packstack --answer-file () else: self.complete = False
def refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD_MD) self._environmentStore.clear() firstEnvironment = True for environment in self.payload.environments: (name, desc) = self.payload.environmentDescription(environment) itr = self._environmentStore.append([environment == self.environment, "<b>%s</b>\n%s" % (name, desc), environment]) # Either: # (1) Select the environment given by kickstart or selected last # time this spoke was displayed; or # (2) Select the first environment given by display order as the # default if nothing is selected. if (environment == self.environment) or \ (not self.environment and firstEnvironment): self.environment = environment sel = self.builder.get_object("environmentSelector") sel.select_iter(itr) firstEnvironment = False self.refreshAddons()
def __init__(self, data, storage, payload, instclass): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing packaging-related information :type payload: pyanaconda.packaging.Payload :param instclass: distribution-specific information :type instclass: pyanaconda.installclass.BaseInstallClass """ NormalSpoke.__init__(self, data, storage, payload, instclass) r = RocksEnv.RocksEnv() self.clientInstall = r.clientInstall self.defaultCentral ="beta7.rocksclusters.org" if r.central is not None: self.defaultCentral = r.central self.defaultUrl ="http://%s/install/rolls" % self.defaultCentral self.defaultCDPath = "/run/install/repo" self.selectAll = True self.rollSource = NETWORK self.version = '7.0' self.requireDB = True self.requiredRolls = ('core','base','kernel')
def __init__(self, *args, **kwargs): StorageChecker.__init__(self) NormalSpoke.__init__(self, *args, **kwargs) self.applyOnSkip = True self._ready = False self.autoPartType = None self.encrypted = False self.passphrase = "" self.selected_disks = self.data.ignoredisk.onlyuse[:] # This list contains all possible disks that can be included in the install. # All types of advanced disks should be set up for us ahead of time, so # there should be no need to modify this list. self.disks = [] if not flags.automatedInstall: # default to using autopart for interactive installs self.data.autopart.autopart = True self.autopart = self.data.autopart.autopart self.autoPartType = None self.clearPartType = CLEARPART_TYPE_NONE if self.data.zerombr.zerombr and arch.isS390(): # run dasdfmt on any unformatted DASDs automatically threadMgr.add(AnacondaThread(name=constants.THREAD_DASDFMT, target=self.run_dasdfmt)) self._previous_autopart = False self._last_clicked_overview = None self._cur_clicked_overview = None self._grabObjects()
def initialize(self): NormalSpoke.initialize(self) self._done = False init_dep_injection() facts = inj.require(inj.FACTS) backend = managergui.Backend() self._registergui = registergui.RegisterScreen(backend, facts, callbacks=[self.finished]) self._action_area = self.builder.get_object("RHSMSpokeWindow-action_area1") self._register_box = self._registergui.dialog_vbox6 # FIXME: close_window handling is kind of a mess. Standlone subman gui, # the firstboot screens, and initial-setup need it to do different # things. Potentially a 'Im done with this window now' signal, with # each attaching different handlers. self._registergui.close_window_callback = self._close_window_callback # we have a ref to _register_box, but need to remove it from # the regustergui.window (a GtkDialog), and add it to the main # box in the action area of our initial-setup screen. self._registergui.window.remove(self._register_box) self._action_area.pack_end(self._register_box, True, True, 0) self._action_area.show() self._register_box.show_all() self._registergui.initialize()
def __init__(self, data, storage, payload, instclass): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing packaging-related information :type payload: pyanaconda.packaging.Payload :param instclass: distribution-specific information :type instclass: pyanaconda.installclass.BaseInstallClass """ NormalSpoke.__init__(self, data, storage, payload, instclass) self.defaultUrl = "http://central-6-2-x86-64.rocksclusters.org/install/rolls" self.defaultCDPath = "/mnt/cdrom" self.selectAll = True self.rollSource = NETWORK self.version = "7.0" self.requireDB = True self.requiredRolls = ("core",)
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) self._errorMsgs = None self._tx_id = None self._selectFlag = False self.selectedGroups = [] self.excludedGroups = [] self.environment = None self._environmentListBox = self.builder.get_object("environmentListBox") self._addonListBox = self.builder.get_object("addonListBox") # Used to determine which add-ons to display for each environment. # The dictionary keys are environment IDs. The dictionary values are two-tuples # consisting of lists of add-on group IDs. The first list is the add-ons specific # to the environment, and the second list is the other add-ons possible for the # environment. self._environmentAddons = {} # Used to store how the user has interacted with add-ons for the default add-on # selection logic. The dictionary keys are group IDs, and the values are selection # state constants. See refreshAddons for how the values are used. self._addonStates = {} # Used for detecting whether anything's changed in the spoke. self._origAddons = [] self._origEnvironment = None
def initialize(self): NormalSpoke.initialize(self) self.initialize_start() self.pages = [SearchPage(self.storage, self.builder), MultipathPage(self.storage, self.builder), OtherPage(self.storage, self.builder), ZPage(self.storage, self.builder)] self._notebook = self.builder.get_object("advancedNotebook") if not arch.is_s390(): self._notebook.remove_page(-1) self.builder.get_object("addZFCPButton").destroy() self.builder.get_object("addDASDButton").destroy() if not has_fcoe(): self.builder.get_object("addFCOEButton").destroy() if not iscsi.available: self.builder.get_object("addISCSIButton").destroy() self._store = self.builder.get_object("diskStore") self._addDisksButton = self.builder.get_object("addDisksButton") # report that we are done self.initialize_done()
def on_back_clicked(self, button): # Clear any existing errors self.clear_errors() # If back has been clicked on once already and no other changes made on the screen, # run the storage check now. This handles displaying any errors in the info bar. if not self._back_already_clicked: self._back_already_clicked = True # If we hit any errors while saving things above, stop and let the # user think about what they have done if self._error is not None: return if not self._do_check(): return if len(self._storage_playground.devicetree.actions.find()) > 0: dialog = ActionSummaryDialog(self.data) dialog.refresh(self._storage_playground.devicetree.actions.find()) with self.main_window.enlightbox(dialog.window): rc = dialog.run() if rc != 1: # Cancel. Stay on the blivet-gui screen. return else: # remove redundant actions and sort them now self._storage_playground.devicetree.actions.prune() self._storage_playground.devicetree.actions.sort() NormalSpoke.on_back_clicked(self, button)
def initialize(self): """ The initialize method that is called after the instance is created. The difference between __init__ and this method is that this may take a long time and thus could be called in a separated thread. :see: pyanaconda.ui.common.UIObject.initialize """ NormalSpoke.initialize(self) self.button1 = self.builder.get_object("button1") self.button1a = self.builder.get_object("button1a") self.button1b = self.builder.get_object("button1b") self.button2 = self.builder.get_object("button2") self.link = self.builder.get_object("fileurl") # Check if Values Provided in KickStart if self.data.addons.org_centos_cloud.state == "False": # ADDON : DISABLED self.button2.set_active(True) else: # No Value Given choose : DEFAULT = ENABLED self.data.addons.org_centos_cloud.state = "True" self.button1.set_active(True) # If no argument provided DEFAULT --allinone is assumed if not (str (self.data.addons.org_centos_cloud.arguments).startswith("--answer-file")): self.data.addons.org_centos_cloud.arguments = "--allinone"
def __init__(self, *args): NormalSpoke.__init__(self, *args) # taking values from the kickstart file? self._kickstarted = flags.flags.automatedInstall self._update_datetime_timer_id = None self._start_updating_timer_id = None
def initialize(self): NormalSpoke.initialize(self) self.local_disks_box = self.builder.get_object("local_disks_box") self.specialized_disks_box = self.builder.get_object("specialized_disks_box") threadMgr.add(AnacondaThread(name=constants.THREAD_STORAGE_WATCHER, target=self._initialize))
def initialize(self): NormalSpoke.initialize(self) self.initialize_start() # set X keyboard defaults # - this needs to be done early in spoke initialization so that # the spoke status does not show outdated keyboard selection keyboard.set_x_keyboard_defaults(self.data, self._xkl_wrapper) # make sure the x_layouts list has at least one keyboard layout if not self.data.keyboard.x_layouts: self.data.keyboard.x_layouts.append(DEFAULT_KEYBOARD) self._add_dialog = AddLayoutDialog(self.data) self._add_dialog.initialize() if flags.can_touch_runtime_system("hide runtime keyboard configuration " "warning", touch_live=True): self.builder.get_object("warningBox").hide() # We want to store layouts' names but show layouts as # 'language (description)'. layoutColumn = self.builder.get_object("layoutColumn") layoutRenderer = self.builder.get_object("layoutRenderer") override_cell_property(layoutColumn, layoutRenderer, "text", _show_layout, self._xkl_wrapper) self._store = self.builder.get_object("addedLayoutStore") self._add_data_layouts() self._selection = self.builder.get_object("layoutSelection") self._switching_dialog = ConfigureSwitchingDialog(self.data) self._switching_dialog.initialize() self._layoutSwitchLabel = self.builder.get_object("layoutSwitchLabel") if not flags.can_touch_runtime_system("test X layouts", touch_live=True): # Disable area for testing layouts as we cannot make # it work without modifying runtime system widgets = [self.builder.get_object("testingLabel"), self.builder.get_object("testingWindow"), self.builder.get_object("layoutSwitchLabel")] # Use testingLabel's text to explain why this part is not # sensitive. widgets[0].set_text(_("Testing layouts configuration not " "available.")) for widget in widgets: widget.set_sensitive(False) hubQ.send_not_ready(self.__class__.__name__) hubQ.send_message(self.__class__.__name__, _("Getting list of layouts...")) threadMgr.add(AnacondaThread(name=THREAD_KEYBOARD_INIT, target=self._wait_ready))
def __init__(self, *args): NormalSpoke.__init__(self, *args) GUISpokeInputCheckHandler.__init__(self) self._users_module = USERS.get_observer() self._users_module.connect() self._services_module = SERVICES.get_observer() self._services_module.connect()
def on_back_clicked(self, button): """If the user entered duplicate repo names, keep them on the screen. Otherwise, do the usual thing.""" ui_repo_names = [r[REPO_OBJ].name for r in self._repoStore] if len(ui_repo_names) != len(frozenset(ui_repo_names)): return else: NormalSpoke.on_back_clicked(self, button)
def on_back_clicked(self, button): if self._validatePassword(): self.clear_info() NormalSpoke.on_back_clicked(self, button) else: self.clear_info() self.set_warning(self._error) self.pw.grab_focus() self.window.show_all()
def __init__(self, *args): NormalSpoke.__init__(self, *args) self._remove_last_attempt = False self._confirmed = False self._xkl_wrapper = keyboard.XklWrapper.get_instance() self._upButton = self.builder.get_object("upButton") self._downButton = self.builder.get_object("downButton") self._removeButton = self.builder.get_object("removeLayoutButton") self._previewButton = self.builder.get_object("previewButton")
def __init__(self, data, storage, payload, instclass): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing packaging-related information :type payload: pyanaconda.packaging.Payload :param instclass: distribution-specific information :type instclass: pyanaconda.installclass.BaseInstallClass """ NormalSpoke.__init__(self, data, storage, payload, instclass) self.clientInstall = RocksEnv.RocksEnv().clientInstall
def on_back_clicked(self, button): # If the failed check is for non-ASCII characters, # add a click to the counter and check again failed_check = next(self.failed_checks_with_message, None) if not self.policy.strict and failed_check == self._pwStrengthCheck: self._waiveStrengthClicks += 1 self._pwStrengthCheck.update_check_status() elif failed_check == self._pwASCIICheck: self._waiveASCIIClicks += 1 self._pwASCIICheck.update_check_status() # If there is no user set, skip the checks if not self.username.get_text(): for check in self.checks: check.enabled = False if GUISpokeInputCheckHandler.on_back_clicked(self, button): NormalSpoke.on_back_clicked(self, button)
def on_back_clicked(self, button): # If the failed check is for password strength or non-ASCII # characters, add a click to the counter and check again failed_check = next(self.failed_checks_with_message, None) if not self.policy.strict and failed_check == self._pwStrengthCheck: self._waiveStrengthClicks += 1 self._pwStrengthCheck.update_check_status() elif failed_check == self._pwASCIICheck: self._waiveASCIIClicks += 1 self._pwASCIICheck.update_check_status() # If neither the password nor the confirm field are set, skip the checks if (not self.pw.get_text()) and (not self.confirm.get_text()): for check in self.checks: check.enabled = False if GUISpokeInputCheckHandler.on_back_clicked(self, button): NormalSpoke.on_back_clicked(self, button)
def initialize(self): NormalSpoke.initialize(self) self.initialize_start() # Connect the viewport adjustments to the child widgets # See also https://bugzilla.gnome.org/show_bug.cgi?id=744721 self._local_disks_box.set_focus_hadjustment( Gtk.Scrollable.get_hadjustment(self._local_viewport)) self._specialized_disks_box.set_focus_hadjustment( Gtk.Scrollable.get_hadjustment(self._specialized_viewport)) self._main_box.set_focus_vadjustment( Gtk.Scrollable.get_vadjustment(self._main_viewport)) threadMgr.add( AnacondaThread(name=constants.THREAD_STORAGE_WATCHER, target=self._initialize))
def on_back_clicked(self, button): # If the failed check is for password strength or non-ASCII # characters, add a click to the counter and check again failed_check = next(self.failed_checks_with_message, None) if not self.policy.strict: if failed_check == self._pwStrengthCheck: self.waive_clicks += 1 self._pwStrengthCheck.update_check_status() elif failed_check == self._pwEmptyCheck: self.waive_clicks += 1 self._pwEmptyCheck.update_check_status() elif failed_check: # no failed checks -> failed_check == None failed_check.update_check_status() elif failed_check == self._pwASCIICheck: self.waive_ASCII_clicks += 1 self._pwASCIICheck.update_check_status() if GUISpokeInputCheckHandler.on_back_clicked(self, button): NormalSpoke.on_back_clicked(self, button)
def initialize(self): NormalSpoke.initialize(self) self._daysStore = self.builder.get_object("days") self._monthsStore = self.builder.get_object("months") self._yearsStore = self.builder.get_object("years") self._regionsStore = self.builder.get_object("regions") self._citiesStore = self.builder.get_object("cities") self._tzmap = self.builder.get_object("tzmap") # we need to know it the new value is the same as previous or not self._old_region = None self._old_city = None self._regionCombo = self.builder.get_object("regionCombobox") self._cityCombo = self.builder.get_object("cityCombobox") self._monthCombo = self.builder.get_object("monthCombobox") self._dayCombo = self.builder.get_object("dayCombobox") self._yearCombo = self.builder.get_object("yearCombobox") self._daysFilter = self.builder.get_object("daysFilter") self._daysFilter.set_visible_func(self.existing_date, None) self._citiesFilter = self.builder.get_object("citiesFilter") self._citiesFilter.set_visible_func(self.city_in_region, None) self._citiesSort = self.builder.get_object("citiesSort") self._citiesSort.set_sort_column_id(0, Gtk.SortType.ASCENDING) self._hoursLabel = self.builder.get_object("hoursLabel") self._minutesLabel = self.builder.get_object("minutesLabel") self._amPmUp = self.builder.get_object("amPmUpButton") self._amPmDown = self.builder.get_object("amPmDownButton") self._amPmLabel = self.builder.get_object("amPmLabel") self._radioButton24h = self.builder.get_object("timeFormatRB") self._ntpSwitch = self.builder.get_object("networkTimeSwitch") self._regions_zones = get_all_regions_and_timezones() self._months_nums = dict() threadMgr.add(AnacondaThread(name=constants.THREAD_DATE_TIME, target=self._initialize))
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) self._errorMsgs = None self._tx_id = None self._selectFlag = False self.selectedGroups = [] self.excludedGroups = [] self._environmentListBox = self.builder.get_object( "environmentListBox") self._addonListBox = self.builder.get_object("addonListBox") # Connect viewport scrolling with listbox focus events environmentViewport = self.builder.get_object("environmentViewport") addonViewport = self.builder.get_object("addonViewport") self._environmentListBox.set_focus_vadjustment( environmentViewport.get_vadjustment()) self._addonListBox.set_focus_vadjustment( addonViewport.get_vadjustment()) # Used to store how the user has interacted with add-ons for the default add-on # selection logic. The dictionary keys are group IDs, and the values are selection # state constants. See refreshAddons for how the values are used. self._addonStates = {} # Used for detecting whether anything's changed in the spoke. self._origAddons = [] self._origEnvironment = None # Register event listeners to update our status on payload events payloadMgr.addListener(payloadMgr.STATE_PACKAGE_MD, self._downloading_package_md) payloadMgr.addListener(payloadMgr.STATE_GROUP_MD, self._downloading_group_md) payloadMgr.addListener(payloadMgr.STATE_FINISHED, self._payload_finished) payloadMgr.addListener(payloadMgr.STATE_ERROR, self._payload_error) # Add an invisible radio button so that we can show the environment # list with no radio buttons ticked self._fakeRadio = Gtk.RadioButton(group=None) self._fakeRadio.set_active(True)
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) self._errorMsgs = None self._tx_id = None self._selectFlag = False self.selectedGroups = [] self.excludedGroups = [] self.environment = None self._addonStore = self.builder.get_object("addonStore") self._environmentStore = self.builder.get_object("environmentStore") # Used for detecting whether anything's changed in the spoke. self._origAddons = [] self._origEnvironment = None # We need to tell the addon view whether something is a separator or not. self.builder.get_object("addonView").set_row_separator_func(self._addon_row_is_separator, None)
def refresh(self): NormalSpoke.refresh(self) # Clear out the layout testing box every time the spoke is loaded. It # doesn't make sense to leave temporary data laying around. buf = self.builder.get_object("layoutTestBuffer") buf.set_text("") # Clear and repopulate addedLayoutStore with values from self.data self._store.clear() self._add_data_layouts() # Start with no buttons enabled, since nothing is selected. self._upButton.set_sensitive(False) self._downButton.set_sensitive(False) self._removeButton.set_sensitive(False) self._previewButton.set_sensitive(False) self._refresh_switching_info()
def should_run(cls, environment, data): """Should the spoke run?""" if not is_module_available(LOCALIZATION): return False if not NormalSpoke.should_run(environment, data): return False # Don't show the language support spoke on live media. return context.payload_type not in PAYLOAD_LIVE_TYPES
def initialize(self): NormalSpoke.initialize(self) if flags.can_touch_runtime_system( "hide runtime keyboard configuration " "warning", touch_live=True): self.builder.get_object("warningBox").hide() # We want to store layouts' names but show layouts as # 'language (description)'. layoutColumn = self.builder.get_object("layoutColumn") layoutRenderer = self.builder.get_object("layoutRenderer") layoutColumn.set_cell_data_func(layoutRenderer, _show_layout, self._xkl_wrapper) self._store = self.builder.get_object("addedLayoutStore") self._add_data_layouts() self._switching_dialog = ConfigureSwitchingDialog(self.data) self._switching_dialog.initialize() self._layoutSwitchLabel = self.builder.get_object("layoutSwitchLabel") if not flags.can_touch_runtime_system("test X layouts", touch_live=True): # Disable area for testing layouts as we cannot make # it work without modifying runtime system widgets = [ self.builder.get_object("testingLabel"), self.builder.get_object("testingWindow"), self.builder.get_object("layoutSwitchLabel") ] # Use testingLabel's text to explain why this part is not # sensitive. widgets[0].set_text( _("Testing layouts configuration not " "available.")) for widget in widgets: widget.set_sensitive(False)
def refresh(self): NormalSpoke.refresh(self) self.disks = getDisks(self.storage.devicetree) self.selected_disks = self.data.ignoredisk.onlyuse[:] self.ancestors = itertools.chain( *map(self._real_ancestors, self.disks)) self.ancestors = map(lambda d: d.name, self.ancestors) self._store.clear() allDisks = [] multipathDisks = [] otherDisks = [] raidDisks = [] zDisks = [] # Now all all the non-local disks to the store. Everything has been set up # ahead of time, so there's no need to configure anything. We first make # these lists of disks, then call setup on each individual page. This is # because there could be page-specific setup to do that requires a complete # view of all the disks on that page. for disk in itertools.ifilterfalse(isLocalDisk, self.disks): if self.pages[1].ismember(disk): multipathDisks.append(disk) elif self.pages[2].ismember(disk): otherDisks.append(disk) elif self.pages[3].ismember(disk): raidDisks.append(disk) elif self.pages[4].ismember(disk): zDisks.append(disk) allDisks.append(disk) self.pages[0].setup(self._store, self.selected_disks, allDisks) self.pages[1].setup(self._store, self.selected_disks, multipathDisks) self.pages[2].setup(self._store, self.selected_disks, otherDisks) self.pages[3].setup(self._store, self.selected_disks, raidDisks) self.pages[4].setup(self._store, self.selected_disks, zDisks) self._update_summary()
def initialize(self): NormalSpoke.initialize(self) self._enableButton = self.builder.get_object("enableKdumpCheck") self._fadumpButton = self.builder.get_object("fadumpCheck") if os.path.exists(FADUMP_CAPABLE_FILE): self._fadumpButton.show() else: self._fadumpButton.hide() self._toBeReservedLabel = self.builder.get_object("toBeReservedLabel") self._toBeReservedSpin = self.builder.get_object("toBeReservedSpin") self._totalMemLabel = self.builder.get_object("totalMemLabel") self._totalMemMB = self.builder.get_object("totalMemMB") self._usableMemLabel = self.builder.get_object("usableMemLabel") self._usableMemMB = self.builder.get_object("usableMemMB") # Set an initial value and adjustment on the spin button lower, upper, step = getMemoryBounds() adjustment = Gtk.Adjustment(lower, lower, upper, step, step, 0) self._toBeReservedSpin.set_adjustment(adjustment) self._toBeReservedSpin.set_value(lower)
def __init__(self, data, storage, payload, instclass): NormalSpoke.__init__(self, data, storage, payload, instclass) # Yubikey settings self._yubikey = None self._yubikeyActive = self.data.addons.se_nauman_yubikey.yubikey self._yubikeyVersion = 0 self._yubikeyCheckBox = None self._yubikeyError = "" self._encryption = False # Storage settings # Storage-spoke need to be synced. self._auto_part_observer = STORAGE.get_observer(AUTO_PARTITIONING) self._auto_part_observer.connect() # Passphrase to use # Real phrase is set to self.storage.encryption_passphrase later self._passphrase = self.data.addons.se_nauman_yubikey.passphrase self._newPassphrase = False
def initialize(self): NormalSpoke.initialize(self) self.pages = [SearchPage(self.storage, self.builder), MultipathPage(self.storage, self.builder), OtherPage(self.storage, self.builder), RaidPage(self.storage, self.builder), ZPage(self.storage, self.builder)] self._notebook = self.builder.get_object("advancedNotebook") if not arch.isS390(): self._notebook.remove_page(-1) self.builder.get_object("addZFCPButton").destroy() if not has_fcoe(): self.builder.get_object("addFCOEButton").destroy() self._store = self.builder.get_object("diskStore") self._addDisksButton = self.builder.get_object("addDisksButton")
def initialize(self): NormalSpoke.initialize(self) self.pages = [SearchPage(self.storage, self.builder), MultipathPage(self.storage, self.builder), OtherPage(self.storage, self.builder), ZPage(self.storage, self.builder)] self._notebook = self.builder.get_object("advancedNotebook") if not arch.isS390(): self._notebook.remove_page(-1) self.builder.get_object("addZFCPButton").destroy() self.builder.get_object("addDASDButton").destroy() if not has_fcoe(): self.builder.get_object("addFCOEButton").destroy() self._store = self.builder.get_object("diskStore") self._addDisksButton = self.builder.get_object("addDisksButton") # Connect focus events in scrolled viewport children to scrolling on the viewport searchScrolledViewport = self.builder.get_object("searchScrolledViewport") searchGrid = self.builder.get_object("searchGrid") searchGrid.set_focus_hadjustment(searchScrolledViewport.get_hadjustment()) searchGrid.set_focus_vadjustment(searchScrolledViewport.get_vadjustment()) multipathViewport = self.builder.get_object("multipathViewport") multipathGrid = self.builder.get_object("multipathGrid") multipathGrid.set_focus_hadjustment(multipathViewport.get_hadjustment()) multipathGrid.set_focus_vadjustment(multipathViewport.get_vadjustment()) otherViewport = self.builder.get_object("otherViewport") otherGrid = self.builder.get_object("otherGrid") otherGrid.set_focus_hadjustment(otherViewport.get_hadjustment()) otherGrid.set_focus_vadjustment(otherViewport.get_vadjustment()) zViewport = self.builder.get_object("zViewport") zGrid = self.builder.get_object("zGrid") zGrid.set_focus_hadjustment(zViewport.get_hadjustment()) zGrid.set_focus_vadjustment(zViewport.get_vadjustment())
def refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD) firstEnvironment = True self._clear_listbox(self._environmentListBox) # create rows for all valid environments for environmentid in self.payload.environments: (name, desc) = self.payload.environmentDescription(environmentid) # use the invisible radio button as a group for all environment # radio buttons radio = Gtk.RadioButton(group=self._fakeRadio) # automatically select the first environment if we are on # manual install and the install class does not specify one if firstEnvironment and not flags.automatedInstall: # manual installation # # Note about self.environment being None: # ======================================= # None indicates that an environment has not been set, which is a valid # value of the environment variable. # Only non existing environments are evaluated as invalid if not self.environment_valid or self.environment is None: self.environment = environmentid firstEnvironment = False # check if the selected environment (if any) does match the current row # and tick the radio button if it does radio.set_active(self.environment_valid and self.environmentid == environmentid) self._add_row(self._environmentListBox, name, desc, radio, self.on_radio_button_toggled) self.refreshAddons() self._environmentListBox.show_all() self._addonListBox.show_all()
def __init__(self, *args, **kwargs): StorageChecker.__init__(self, min_ram=isys.MIN_GUI_RAM) NormalSpoke.__init__(self, *args, **kwargs) self.applyOnSkip = True self._ready = False self.autoPartType = None self.encrypted = False self.passphrase = "" self.selected_disks = self.data.ignoredisk.onlyuse[:] self._last_selected_disks = None self._back_clicked = False self.autopart_missing_passphrase = False self.disks_errors = [] # This list contains all possible disks that can be included in the install. # All types of advanced disks should be set up for us ahead of time, so # there should be no need to modify this list. self.disks = [] if not flags.automatedInstall: # default to using autopart for interactive installs self.data.autopart.autopart = True self.autopart = self.data.autopart.autopart self.autoPartType = None self.clearPartType = CLEARPART_TYPE_NONE if self.data.zerombr.zerombr and arch.isS390(): # run dasdfmt on any unformatted DASDs automatically threadMgr.add( AnacondaThread(name=constants.THREAD_DASDFMT, target=self.run_dasdfmt)) self._previous_autopart = False self._last_clicked_overview = None self._cur_clicked_overview = None self._grabObjects()
def initialize(self): log.debug("initializing the EULA spoke") NormalSpoke.initialize(self) self._have_eula = True self._eula_buffer = self.builder.get_object("eulaBuffer") self._agree_check_button = self.builder.get_object("agreeCheckButton") self._agree_label = self._agree_check_button.get_child() self._agree_text = self._agree_label.get_text() log.debug("looking for the license file") license_file = get_license_file_name() if not license_file: log.error("no license found") self._have_eula = False self._eula_buffer.set_text( _("No license found. Please report this " "at http://bugzilla.redhat.com")) return self._eula_buffer.set_text("") itr = self._eula_buffer.get_iter_at_offset(0) log.debug("opening the license file") with open(license_file, "r") as fobj: # insert the first line without prefixing with space try: first_line = next(fobj) except StopIteration: # nothing in the file return self._eula_buffer.insert(itr, first_line.strip()) # EULA file is preformatted for the console, we want to let Gtk # format it (blank lines should be preserved) for line in fobj: stripped_line = line.strip() if stripped_line: self._eula_buffer.insert(itr, " " + stripped_line) else: self._eula_buffer.insert(itr, "\n\n")
def initialize(self): NormalSpoke.initialize(self) self._enableButton = self.builder.get_object("enableKdumpCheck") KdumpSpoke.OS = getOS() if KdumpSpoke.OS == "redhat": self._reservationTypeLabel = self.builder.get_object( "reservationTypeLabel") self._autoButton = self.builder.get_object("autoButton") self._manualButton = self.builder.get_object("manualButton") self._toBeReservedLabel = self.builder.get_object("toBeReservedLabel") self._toBeReservedSpin = self.builder.get_object("toBeReservedSpin") self._totalMemLabel = self.builder.get_object("totalMemLabel") self._totalMemMB = self.builder.get_object("totalMemMB") self._usableMemLabel = self.builder.get_object("usableMemLabel") self._usableMemMB = self.builder.get_object("usableMemMB") # Set an initial value and adjustment on the spin button lower, upper, step = getMemoryBounds() adjustment = Gtk.Adjustment(lower, lower, upper, step, step, 0) self._toBeReservedSpin.set_adjustment(adjustment) self._toBeReservedSpin.set_value(lower)
def __init__(self, data, storage, payload): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing payload-related information :type payload: pyanaconda.payload.Payload """ self._error = None self._back_already_clicked = False self._storage_playground = None self.label_actions = None self.button_reset = None self.button_undo = None StorageCheckHandler.__init__(self) NormalSpoke.__init__(self, data, storage, payload)
def refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD) if self.environment not in self.payload.environments: self.environment = None # If no environment is selected, use the default from the instclass. # If nothing is set in the instclass, the first environment will be # selected below. if not self.environment and self.payload.instclass and \ self.payload.instclass.defaultPackageEnvironment in self.payload.environments: self.environment = self.payload.instclass.defaultPackageEnvironment firstEnvironment = True self._clear_listbox(self._environmentListBox) for environment in self.payload.environments: (name, desc) = self.payload.environmentDescription(environment) radio = Gtk.RadioButton(group=self._firstRadio) # automatically select an environment if this is an interactive install active = environment == self.environment or \ not self._kickstarted and not self.environment and firstEnvironment radio.set_active(active) if active: self.environment = environment self._add_row(self._environmentListBox, name, desc, radio, self.on_radio_button_toggled) firstEnvironment = False self.refreshAddons() self._environmentListBox.show_all() self._addonListBox.show_all()
def __init__(self, *args, **kwargs): NormalSpoke.__init__(self, *args, **kwargs) self._errorMsgs = None self._tx_id = None self._selectFlag = False self.selectedGroups = [] self.excludedGroups = [] self.environment = None self._environmentListBox = self.builder.get_object( "environmentListBox") self._addonListBox = self.builder.get_object("addonListBox") # Used to store how the user has interacted with add-ons for the default add-on # selection logic. The dictionary keys are group IDs, and the values are selection # state constants. See refreshAddons for how the values are used. self._addonStates = {} # Used for detecting whether anything's changed in the spoke. self._origAddons = [] self._origEnvironment = None
def __init__(self, data, storage, payload, instclass): """ :see: pyanaconda.ui.common.Spoke.__init__ :param data: data object passed to every spoke to load/store data from/to it :type data: pykickstart.base.BaseHandler :param storage: object storing storage-related information (disks, partitioning, bootloader, etc.) :type storage: blivet.Blivet :param payload: object storing packaging-related information :type payload: pyanaconda.packaging.Payload :param instclass: distribution-specific information :type instclass: pyanaconda.installclass.BaseInstallClass """ NormalSpoke.__init__(self, data, storage, payload, instclass) self._addon_data = self.data.addons.org_fedora_oscap self._storage = storage self._ready = False # the first status provided self._unitialized_status = _("Not ready") self._content_handler = None self._content_handling_cls = None self._ds_checklists = None # used for changing profiles, stored as self._addon_data.rule_data when # leaving the spoke self._rule_data = None # used to check if the profile was changed or not self._active_profile = None # prevent multiple simultaneous data fetches self._fetching = False self._fetch_flag_lock = threading.Lock()
def initialize(self): NormalSpoke.initialize(self) self.local_disks_box = self.builder.get_object("local_disks_box") self.specialized_disks_box = self.builder.get_object( "specialized_disks_box") # Connect the viewport adjustments to the child widgets # See also https://bugzilla.gnome.org/show_bug.cgi?id=744721 localViewport = self.builder.get_object("localViewport") specializedViewport = self.builder.get_object("specializedViewport") self.local_disks_box.set_focus_hadjustment( localViewport.get_hadjustment()) self.specialized_disks_box.set_focus_hadjustment( specializedViewport.get_hadjustment()) mainViewport = self.builder.get_object("storageViewport") mainBox = self.builder.get_object("storageMainBox") mainBox.set_focus_vadjustment(mainViewport.get_vadjustment()) threadMgr.add( AnacondaThread(name=constants.THREAD_STORAGE_WATCHER, target=self._initialize))
def initialize(self): NormalSpoke.initialize(self) # Wouldn't it be nice if glade knew how to do this? label = self.builder.get_object("summary_button").get_children()[0] markup = "<span foreground='blue'><u>%s</u></span>" % label.get_text() label.set_use_markup(True) label.set_markup(markup) specializedButton = self.builder.get_object("addSpecializedButton") # It's uh... uh... it's down there somewhere, let me take another look. label = specializedButton.get_children()[0].get_children()[0].get_children()[1] markup = "<span size='large'><b>%s</b></span>" % label.get_text() label.set_use_markup(True) label.set_markup(markup) specializedButton.show_all() self.local_disks_box = self.builder.get_object("local_disks_box") self.specialized_disks_box = self.builder.get_object("specialized_disks_box") threadMgr.add(AnacondaThread(name=constants.THREAD_STORAGE_WATCHER, target=self._initialize))
def initialize(self): NormalSpoke.initialize(self) self._grabObjects() # I shouldn't have to do this outside GtkBuilder, but it really doesn't # want to let me pass in user data. self._autodetectButton.connect("toggled", self.on_source_toggled, self._autodetectBox) self._isoButton.connect("toggled", self.on_source_toggled, self._isoBox) self._networkButton.connect("toggled", self.on_source_toggled, self._networkBox) # Show or hide the updates option based on the installclass if self.instclass.installUpdates: really_show(self._updatesBox) else: really_hide(self._updatesBox) threadMgr.add( AnacondaThread(name=constants.THREAD_SOURCE_WATCHER, target=self._initialize))
def initialize(self): """ The initialize method that is called after the instance is created. The difference between __init__ and this method is that this may take a long time and thus could be called in a separated thread. :see: pyanaconda.ui.common.UIObject.initialize """ NormalSpoke.initialize(self) self.initialize_start() self._storage_playground = None self.client = osinstall.BlivetGUIAnacondaClient() box = self.builder.get_object("BlivetGuiViewport") self.label_actions = self.builder.get_object("summary_label") self.button_reset = self.builder.get_object("resetAllButton") self.button_undo = self.builder.get_object("undoLastActionButton") self.blivetgui = osinstall.BlivetGUIAnaconda(self.client, self, box) self.initialize_done()
def on_refresh_clicked(self, *args): dialog = RefreshDialog(self.data) ignoreEscape(dialog.window) with self.main_window.enlightbox(dialog.window): rc = dialog.run() dialog.window.destroy() if rc == 1: # User hit OK on the dialog, indicating they stayed on the dialog # until rescanning completed. self.refresh() return elif rc != 2: # User either hit cancel on the dialog or closed it via escape, so # there was no rescanning done. # NOTE: rc == 2 means the user clicked on the link that takes them # back to the hub. return # Can't use this spoke's on_back_clicked method as that will try to # save the right hand side, which is no longer valid. The user must # go back and select their disks all over again since whatever they # did on the shell could have changed what disks are available. NormalSpoke.on_back_clicked(self, None)
def initialize(self): """ The initialize method that is called after the instance is created. The difference between __init__ and this method is that this may take a long time and thus could be called in a separated thread. :see: pyanaconda.ui.common.UIObject.initialize """ NormalSpoke.initialize(self) import logging self.log = logging.getLogger('anaconda') self.log.info("Initialize Private Interface Config") self.MTUStore = self.builder.get_object("MTUstore") self.MTUComboBox = self.builder.get_object("MTUBox") self.deviceStore = self.builder.get_object("deviceStore") self.ifaceCombo = self.builder.get_object("ifaceCombo") self.privateDNS_Entry = self.builder.get_object("privateDNS") self.IPv4_Address = self.builder.get_object("IPv4_Address") self.IPv4_Netmask = self.builder.get_object("IPv4_Netmask") self.readyState = CONFIGURE # Populate the private interface combo self.ifaceSelected='' self.refresh() self.ifaceCombo.set_active(0) devString = 'eth0:0;virt' if self.ifaceCombo.get_active() >= 0 : devString = self.ifaceCombo.get_active_id() self.ifaceSelected = devString.split(';')[0] # intialize DNS,IPV4 addr/netmask self.formValues() self.derivedValues() self.visited = False