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 refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD_MD) self._environmentStore = self.builder.get_object("environmentStore") self._environmentStore.clear() if self.environment not in self.payload.environments: self.environment = None clasess = [] 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 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 refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD) firstEnvironment = True self._clear_listbox(self._environmentListBox) # 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 # 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 an environment if this is an interactive install if flags.automatedInstall: # kickstart installation # tick the radio button if the environment from kickstart is both valid # and equal to the environment corresponding to the current row radio.set_active(self.environment_valid and self.environmentid == environmentid) elif firstEnvironment: # manual installation # for manual installs that don't have a default provided by the install class # just tick the first radio button and select the first environment # # None indicates that an environment has not been set, which is a valid # value of the environment variable. # Only non existing environments are evaluate as invalid if not self.environment_valid or self.environment is None: radio.set_active(True) self.environment = environmentid firstEnvironment = False self._add_row(self._environmentListBox, name, desc, radio, self.on_radio_button_toggled) self.refreshAddons() self._environmentListBox.show_all() self._addonListBox.show_all()
def refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD) firstEnvironment = True self._clear_listbox(self._environmentListBox) # 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 # 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 refresh(self): NormalSpoke.refresh(self) threadMgr.wait(constants.THREAD_PAYLOAD) firstEnvironment = True self._clear_listbox(self._environmentListBox) # 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 # 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 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 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 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 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 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 firstRadio = None self._clear_listbox(self._environmentListBox) for environment in self.payload.environments: (name, desc) = self.payload.environmentDescription(environment) radio = Gtk.RadioButton(group=firstRadio) # automatically select an environment if this is an interactive install active = environment == self.environment or \ not flags.automatedInstall 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) firstRadio = firstRadio or radio firstEnvironment = False self.refreshAddons() self._environmentListBox.show_all() self._addonListBox.show_all()
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 refresh(self): NormalSpoke.refresh(self) # Find all hard drive partitions that could hold an ISO and add each # to the partitionStore. This has to be done here because if the user # has done partitioning first, they may have blown away partitions # found during _initialize on the partitioning spoke. store = self.builder.get_object("partitionStore") store.clear() added = False active = 0 idx = 0 for dev in potentialHdisoSources(self.storage.devicetree): # path model size format type uuid of format dev_info = { "model" : self._sanitize_model(dev.disk.model), "path" : dev.path, "size" : dev.size, "format": dev.format.name or "", "label" : dev.format.label or dev.format.uuid or "" } store.append([dev, "%(model)s %(path)s (%(size)s MB) %(format)s %(label)s" % dev_info]) if self.data.method.method == "harddrive" and self.data.method.partition in [dev.path, dev.name]: active = idx added = True idx += 1 # Again, only display these widgets if an HDISO source was found. self._isoBox.set_no_show_all(not added) self._isoBox.set_visible(added) self._isoButton.set_no_show_all(not added) self._isoButton.set_visible(added) if added: combo = self.builder.get_object("isoPartitionCombo") combo.set_active(active) # We default to the mirror list, and then if the method tells us # something different later, we can change it. self._protocolComboBox.set_active(PROTOCOL_MIRROR) self._urlEntry.set_sensitive(False) # Set up the default state of UI elements. if self.data.method.method == "url": self._networkButton.set_active(True) proto = self.data.method.url or self.data.method.mirrorlist if proto.startswith("http:"): self._protocolComboBox.set_active(PROTOCOL_HTTP) l = 7 elif proto.startswith("https:"): self._protocolComboBox.set_active(PROTOCOL_HTTPS) l = 8 elif proto.startswith("ftp:"): self._protocolComboBox.set_active(PROTOCOL_FTP) l = 6 else: self._protocolComboBox.set_active(PROTOCOL_HTTP) l = 0 self._urlEntry.set_sensitive(True) self._urlEntry.set_text(proto[l:]) self._mirrorlistCheckbox.set_active(bool(self.data.method.mirrorlist)) self._proxyUrl = self.data.method.proxy elif self.data.method.method == "nfs": self._networkButton.set_active(True) self._protocolComboBox.set_active(PROTOCOL_NFS) self._urlEntry.set_text("%s:%s" % (self.data.method.server, self.data.method.dir)) self._urlEntry.set_sensitive(True) self.builder.get_object("nfsOptsEntry").set_text(self.data.method.opts or "") elif self.data.method.method == "harddrive": self._isoButton.set_active(True) self._isoBox.set_sensitive(True) self._verifyIsoButton.set_sensitive(True) if self._currentIsoFile: self._isoChooserButton.set_label(os.path.basename(self._currentIsoFile)) else: self._isoChooserButton.set_label("") self._isoChooserButton.set_use_underline(False) else: # No method was given in advance, so now we need to make a sensible # guess. Go with autodetected media if that was provided, and then # fall back to closest mirror. if not self._autodetectButton.get_no_show_all(): self._autodetectButton.set_active(True) self.data.method.method = "cdrom" else: self._networkButton.set_active(True) self.data.method.method = None self._proxyUrl = self.data.method.proxy self._setup_no_updates() # Setup the addon repos self._reset_repoStore() # Then, some widgets get enabled/disabled/greyed out depending on # how others are set up. We can use the signal handlers to handle # that condition here too. self.on_protocol_changed(self._protocolComboBox)
def refresh(self): NormalSpoke.refresh(self) # Find all hard drive partitions that could hold an ISO and add each # to the partitionStore. This has to be done here because if the user # has done partitioning first, they may have blown away partitions # found during _initialize on the partitioning spoke. store = self.builder.get_object("partitionStore") store.clear() added = False active = 0 idx = 0 for dev in potentialHdisoSources(self.storage.devicetree): # path model size format type uuid of format dev_info = { "model": self._sanitize_model(dev.disk.model), "path": dev.path, "size": dev.size, "format": dev.format.name or "", "label": dev.format.label or dev.format.uuid or "" } store.append([ dev, "%(model)s %(path)s (%(size)s MB) %(format)s %(label)s" % dev_info ]) if self.data.method.method == "harddrive" and self.data.method.partition in [ dev.path, dev.name ]: active = idx added = True idx += 1 # Again, only display these widgets if an HDISO source was found. self._isoBox.set_no_show_all(not added) self._isoBox.set_visible(added) self._isoButton.set_no_show_all(not added) self._isoButton.set_visible(added) if added: combo = self.builder.get_object("isoPartitionCombo") combo.set_active(active) # We default to the mirror list, and then if the method tells us # something different later, we can change it. self._protocolComboBox.set_active(PROTOCOL_MIRROR) self._urlEntry.set_sensitive(False) # Set up the default state of UI elements. if self.data.method.method == "url": self._networkButton.set_active(True) proto = self.data.method.url or self.data.method.mirrorlist if proto.startswith("http:"): self._protocolComboBox.set_active(PROTOCOL_HTTP) l = 7 elif proto.startswith("https:"): self._protocolComboBox.set_active(PROTOCOL_HTTPS) l = 8 elif proto.startswith("ftp:"): self._protocolComboBox.set_active(PROTOCOL_FTP) l = 6 else: self._protocolComboBox.set_active(PROTOCOL_HTTP) l = 0 self._urlEntry.set_sensitive(True) self._urlEntry.set_text(proto[l:]) self._mirrorlistCheckbox.set_active( bool(self.data.method.mirrorlist)) self._proxyUrl = self.data.method.proxy elif self.data.method.method == "nfs": self._networkButton.set_active(True) self._protocolComboBox.set_active(PROTOCOL_NFS) self._urlEntry.set_text( "%s:%s" % (self.data.method.server, self.data.method.dir)) self._urlEntry.set_sensitive(True) self.builder.get_object("nfsOptsEntry").set_text( self.data.method.opts or "") elif self.data.method.method == "harddrive": self._isoButton.set_active(True) self._isoBox.set_sensitive(True) self._verifyIsoButton.set_sensitive(True) if self._currentIsoFile: self._isoChooserButton.set_label( os.path.basename(self._currentIsoFile)) else: self._isoChooserButton.set_label("") self._isoChooserButton.set_use_underline(False) else: # No method was given in advance, so now we need to make a sensible # guess. Go with autodetected media if that was provided, and then # fall back to closest mirror. if not self._autodetectButton.get_no_show_all(): self._autodetectButton.set_active(True) self.data.method.method = "cdrom" else: self._networkButton.set_active(True) self.data.method.method = None self._proxyUrl = self.data.method.proxy self._setup_no_updates() # Setup the addon repos self._reset_repoStore() # Then, some widgets get enabled/disabled/greyed out depending on # how others are set up. We can use the signal handlers to handle # that condition here too. self.on_protocol_changed(self._protocolComboBox)