def refresh(self): # If a reserve amount is requested, set it in the spin button # Strip the trailing 'M' reserveMB = self.data.addons.com_redhat_kdump.reserveMB if reserveMB and reserveMB[-1] == 'M': reserveMB = reserveMB[:-1] if reserveMB: self._toBeReservedSpin.set_value(int(reserveMB)) # Set the various labels. Use the spin button signal handler to set the # usable memory label once the other two have been set. self._totalMemMB.set_text("%d" % getTotalMemory()) self._toBeReservedSpin.emit("value-changed") # Set the states on the toggle buttons and let the signal handlers set # the sensitivities on the related widgets. Set the radio button first, # since the radio buttons' bailiwick is a subset of that of the # enable/disable checkbox. if self.data.addons.com_redhat_kdump.enabled: self._enableButton.set_active(True) else: self._enableButton.set_active(False) _fadump = self.data.addons.com_redhat_kdump.enablefadump self._fadumpButton.set_active(_fadump) # Force a toggled signal on the button in case it's state has not changed self._enableButton.emit("toggled")
def refresh(self): # If a reserve amount is requested, set it in the spin button if self.data.addons.com_redhat_kdump.reserveMB != "auto": # Strip the trailing 'M' reserveMB = self.data.addons.com_redhat_kdump.reserveMB if reserveMB and reserveMB[-1] == 'M': reserveMB = reserveMB[:-1] if reserveMB: self._toBeReservedSpin.set_value(int(reserveMB)) # Set the various labels. Use the spin button signal handler to set the # usable memory label once the other two have been set. self._totalMemMB.set_text("%d" % getTotalMemory()) self._toBeReservedSpin.emit("value-changed") # Set the states on the toggle buttons and let the signal handlers set # the sensitivities on the related widgets. Set the radio button first, # since the radio buttons' bailiwick is a subset of that of the # enable/disable checkbox. if KdumpSpoke.OS == "redhat": if self.data.addons.com_redhat_kdump.reserveMB == "auto": self._autoButton.set_active(True) self._manualButton.set_active(False) else: self._autoButton.set_active(False) self._manualButton.set_active(True) if self.data.addons.com_redhat_kdump.enabled: self._enableButton.set_active(True) else: self._enableButton.set_active(False) # Force a toggled signal on the button in case it's state has not changed self._enableButton.emit("toggled")
def refresh(self): # If a reserve amount is requested, set it in the spin button # Strip the trailing 'M' reserveMB = self._proxy.ReservedMemory if reserveMB and reserveMB[-1] == 'M': reserveMB = reserveMB[:-1] if reserveMB: self._toBeReservedSpin.set_value(int(reserveMB)) # Set the various labels. Use the spin button signal handler to set the # usable memory label once the other two have been set. self._totalMemMB.set_text("%d" % getTotalMemory()) self._toBeReservedSpin.emit("value-changed") # Set the states on the toggle buttons and let the signal handlers set # the sensitivities on the related widgets. Set the radio button first, # since the radio buttons' bailiwick is a subset of that of the # enable/disable checkbox. if self._proxy.KdumpEnabled: self._enableButton.set_active(True) else: self._enableButton.set_active(False) _fadump = self._proxy.FadumpEnabled self._fadumpButton.set_active(_fadump) # Force a toggled signal on the button in case it's state has not changed self._enableButton.emit("toggled")
def refresh(self): # If a reserve amount is requested, set it in the spin button if self.data.addons.com_redhat_kdump.reserveMB != "auto": # Strip the trailing 'M' reserveMB = self.data.addons.com_redhat_kdump.reserveMB if reserveMB and reserveMB[-1] == 'M': reserveMB = reserveMB[:-1] if reserveMB: self._toBeReservedSpin.set_value(int(reserveMB)) # Set the various labels. Use the spin button signal handler to set the # usable memory label once the other two have been set. self._currentlyReservedMB.set_text("%d" % getReservedMemory()) self._totalMemMB.set_text("%d" % getTotalMemory()) self._toBeReservedSpin.emit("value-changed") # Set the states on the toggle buttons and let the signal handlers set # the sensitivities on the related widgets. Set the radio button first, # since the radio buttons' bailiwick is a subset of that of the # enable/disable checkbox. if self.data.addons.com_redhat_kdump.reserveMB == "auto": self._autoButton.set_active(True) self._manualButton.set_active(False) else: self._autoButton.set_active(False) self._manualButton.set_active(True) if self.data.addons.com_redhat_kdump.enabled: self._enableButton.set_active(True) else: self._enableButton.set_active(False) # Force a toggled signal on the button in case it's state has not changed self._enableButton.emit("toggled") # Fill the advanced configuration area with the current state start, end = self._config_buffer.get_bounds() self.data.addons.com_redhat_kdump.content = self._config_buffer.get_text(start, end, True)