コード例 #1
0
    def __init__(self, *args):
        GUIObject.__init__(self, *args)
        GUIDialogInputCheckHandler.__init__(self)

        #epoch is increased when serversStore is repopulated
        self._epoch = 0
        self._epoch_lock = threading.Lock()
コード例 #2
0
    def __init__(self, *args):
        GUIObject.__init__(self, *args)
        GUIDialogInputCheckHandler.__init__(self)

        #epoch is increased when serversStore is repopulated
        self._epoch = 0
        self._epoch_lock = threading.Lock()
コード例 #3
0
    def __init__(self, data, servers, states):
        GUIObject.__init__(self, data)
        self._servers = servers
        self._active_server = None
        self._states = states

        # Use GUIDIalogInputCheckHandler to manipulate the sensitivity of the
        # add button, and check for valid input in on_entry_activated
        add_button = self.builder.get_object("addButton")
        GUIDialogInputCheckHandler.__init__(self, add_button)

        self.window.set_size_request(500, 400)

        working_column = self.builder.get_object("workingColumn")
        working_renderer = self.builder.get_object("workingRenderer")
        override_cell_property(working_column, working_renderer, "icon-name",
                               self._render_working)

        self._serverEntry = self.builder.get_object("serverEntry")
        self._serversStore = self.builder.get_object("serversStore")
        self._addButton = self.builder.get_object("addButton")
        self._poolCheckButton = self.builder.get_object("poolCheckButton")
        self._ntsCheckButton = self.builder.get_object("ntsCheckButton")

        self._serverCheck = self.add_check(self._serverEntry,
                                           self._validate_server)
        self._serverCheck.update_check_status()

        self._update_timer = Timer()
コード例 #4
0
    def set_status(self, inputcheck):
        # Use GUIDialogInputCheckHandler to set the error message
        GUIDialogInputCheckHandler.set_status(self, inputcheck)

        # Set the sensitivity of the add button based on the result
        self._addButton.set_sensitive(
            inputcheck.check_status == InputCheck.CHECK_OK)
コード例 #5
0
ファイル: user.py プロジェクト: cyclefusion/anaconda
    def set_status(self, inputcheck):
        # Use the superclass set_status to set the error message
        GUIDialogInputCheckHandler.set_status(self, inputcheck)

        # Make the save button insensitive if the check fails
        if inputcheck.check_status == InputCheck.CHECK_OK:
            self._saveButton.set_sensitive(True)
        else:
            self._saveButton.set_sensitive(False)
コード例 #6
0
    def set_status(self, inputcheck):
        # Use the superclass set_status to set the error message
        GUIDialogInputCheckHandler.set_status(self, inputcheck)

        # Make the save button insensitive if the check fails
        if inputcheck.check_status == InputCheck.CHECK_OK:
            self._saveButton.set_sensitive(True)
        else:
            self._saveButton.set_sensitive(False)
コード例 #7
0
    def __init__(self, user, groupDict, data):
        GUIObject.__init__(self, data)
        GUIDialogInputCheckHandler.__init__(self)
        self._user = user
        self._groupDict = groupDict

        # Track whether the user has requested a home directory other
        # than the default.
        self._origHome = None
        self._homeSet = False
コード例 #8
0
ファイル: user.py プロジェクト: cyclefusion/anaconda
    def __init__(self, user, groupDict, data):
        GUIObject.__init__(self, data)
        GUIDialogInputCheckHandler.__init__(self)
        self._user = user
        self._groupDict = groupDict

        # Track whether the user has requested a home directory other
        # than the default.
        self._origHome = None
        self._homeSet = False
コード例 #9
0
ファイル: datetime_spoke.py プロジェクト: bwann/anaconda
    def __init__(self, *args):
        GUIObject.__init__(self, *args)

        # Use GUIDIalogInputCheckHandler to manipulate the sensitivity of the
        # add button, and check for valid input in on_entry_activated
        add_button = self.builder.get_object("addButton")
        GUIDialogInputCheckHandler.__init__(self, add_button)

        #epoch is increased when serversStore is repopulated
        self._epoch = 0
        self._epoch_lock = threading.Lock()
コード例 #10
0
    def __init__(self, *args):
        GUIObject.__init__(self, *args)

        # Use GUIDIalogInputCheckHandler to manipulate the sensitivity of the
        # add button, and check for valid input in on_entry_activated
        add_button = self.builder.get_object("addButton")
        GUIDialogInputCheckHandler.__init__(self, add_button)

        #epoch is increased when serversStore is repopulated
        self._epoch = 0
        self._epoch_lock = threading.Lock()
コード例 #11
0
    def __init__(self, user, data):
        GUIObject.__init__(self, data)

        self._saveButton = self.builder.get_object("save_button")
        GUIDialogInputCheckHandler.__init__(self, self._saveButton)

        self._user = user

        # Track whether the user has requested a home directory other
        # than the default.
        self._origHome = None
        self._homeSet = False
コード例 #12
0
ファイル: user.py プロジェクト: zhangsju/anaconda
    def __init__(self, user, data):
        GUIObject.__init__(self, data)

        saveButton = self.builder.get_object("save_button")
        GUIDialogInputCheckHandler.__init__(self, saveButton)

        self._user = user

        # Track whether the user has requested a home directory other
        # than the default. This way, if the home directory is left as
        # the default, the default will change if the username changes.
        # Otherwise, once the directory is set it stays that way.
        self._origHome = None
コード例 #13
0
    def __init__(self, user, data):
        GUIObject.__init__(self, data)

        saveButton = self.builder.get_object("save_button")
        GUIDialogInputCheckHandler.__init__(self, saveButton)

        self._user = user

        # Track whether the user has requested a home directory other
        # than the default. This way, if the home directory is left as
        # the default, the default will change if the username changes.
        # Otherwise, once the directory is set it stays that way.
        self._origHome = None
コード例 #14
0
    def __init__(self, data, device_tree, request: DeviceFactoryRequest,
                 permissions: DeviceFactoryPermissions, disks, names):
        GUIObject.__init__(self, data)
        self._device_tree = device_tree
        self._disks = disks
        self._request = request
        self._permissions = permissions
        self._original_name = request.container_name
        self._container_names = names
        self._original_luks_version = request.luks_version
        self._error = ""

        self._title_label = self.builder.get_object(
            "container_dialog_title_label")
        self._dialog_label = self.builder.get_object("container_dialog_label")
        self._error_label = self.builder.get_object("containerErrorLabel")
        self._name_entry = self.builder.get_object("container_name_entry")
        self._encryptCheckbutton = self.builder.get_object(
            "containerEncryptedCheckbox")
        self._luks_combo = self.builder.get_object("luksVersionCombo")
        self._luks_store = self.builder.get_object("luksVersionStore")
        self._luks_label = self.builder.get_object("luksVersionLabel")
        self._raidStoreFilter = self.builder.get_object(
            "containerRaidStoreFiltered")
        self._store = self.builder.get_object("disk_store")
        self._treeview = self.builder.get_object("container_disk_view")
        self._sizeCombo = self.builder.get_object("containerSizeCombo")
        self._sizeEntry = self.builder.get_object("containerSizeEntry")
        self._raidLevelCombo = self.builder.get_object(
            "containerRaidLevelCombo")
        self._raidLevelLabel = self.builder.get_object(
            "containerRaidLevelLabel")
        self._save_button = self.builder.get_object("container_save_button")

        GUIDialogInputCheckHandler.__init__(self, self._save_button)

        self._supported_raid_levels = get_supported_container_raid_levels(
            self._device_tree, self._request.device_type)

        self._set_labels()
        self._populate_disks()
        self._select_disks()
        self._populate_raid()
        self._set_name()
        self._set_size()
        self._set_encryption()
        self._populate_luks()
コード例 #15
0
    def __init__(self, data, proxy_url):
        GUIObject.__init__(self, data)

        self._proxy_ok_button = self.builder.get_object("proxyOkButton")
        GUIDialogInputCheckHandler.__init__(self, self._proxy_ok_button)

        self.proxy_url = proxy_url
        self._proxy_check = self.builder.get_object("enableProxyCheck")
        self._proxy_info_box = self.builder.get_object("proxyInfoBox")
        self._auth_check = self.builder.get_object("enableAuthCheck")
        self._proxy_auth_box = self.builder.get_object("proxyAuthBox")

        self._proxy_url_entry = self.builder.get_object("proxyURLEntry")
        self._proxy_username_entry = self.builder.get_object(
            "proxyUsernameEntry")
        self._proxy_password_entry = self.builder.get_object(
            "proxyPasswordEntry")

        self._proxy_validate = self.add_check(self._proxy_url_entry,
                                              self._check_proxy_url)
        self._proxy_validate.update_check_status()
コード例 #16
0
    def __init__(self, *args, **kwargs):
        # these are all absolutely required. not getting them is fatal.
        self._disks = kwargs.pop("disks")
        free = kwargs.pop("free")
        self.selected = kwargs.pop("selected")[:]
        self.name = kwargs.pop("name") or ""  # make sure it's a string
        self.device_type = kwargs.pop("device_type")
        self.storage = kwargs.pop("storage")

        # these are less critical
        self.raid_level = kwargs.pop("raid_level", None) or None  # not ""
        self.encrypted = kwargs.pop("encrypted", False)
        self.exists = kwargs.pop("exists", False)

        self.size_policy = kwargs.pop("size_policy", SIZE_POLICY_AUTO)
        self.size = kwargs.pop("size", Size(0))

        self._error = None
        GUIObject.__init__(self, *args, **kwargs)

        self._grabObjects()
        GUIDialogInputCheckHandler.__init__(self, self._save_button)

        # set up the dialog labels with device-type-specific text
        container_type = get_container_type(self.device_type)
        title_text = _(CONTAINER_DIALOG_TITLE) % {
            "container_type": _(container_type.name).upper()
        }
        self._title_label.set_text(title_text)

        dialog_text = _(CONTAINER_DIALOG_TEXT) % {
            "container_type": _(container_type.name).lower()
        }
        self._dialog_label.set_text(dialog_text)

        # populate the dialog widgets
        self._name_entry.set_text(self.name)

        # populate the store
        for disk in self._disks:
            self._store.append([
                disk.description,
                str(disk.size),
                str(free[disk.name][0]), disk.name, disk.id
            ])

        model = self._treeview.get_model()
        itr = model.get_iter_first()

        selected_ids = [d.id for d in self.selected]
        selection = self._treeview.get_selection()
        while itr:
            disk_id = model.get_value(itr, 4)
            if disk_id in selected_ids:
                selection.select_iter(itr)

            itr = model.iter_next(itr)

        # XXX how will this be related to the device encryption setting?
        self._encryptCheckbutton.set_active(self.encrypted)

        # set up the raid level combo
        # XXX how will this be related to the device raid level setting?
        self._raidStoreFilter.set_visible_func(self._raid_level_visible)
        self._raidStoreFilter.refilter()
        self._populate_raid()

        self._original_size = self.size
        self._original_size_text = self.size.human_readable(max_places=2)
        self._sizeEntry.set_text(self._original_size_text)
        if self.size_policy == SIZE_POLICY_AUTO:
            self._sizeCombo.set_active(0)
        elif self.size_policy == SIZE_POLICY_MAX:
            self._sizeCombo.set_active(1)
        else:
            self._sizeCombo.set_active(2)

        if self.exists:
            fancy_set_sensitive(self._name_entry, False)
            self._treeview.set_sensitive(False)
            fancy_set_sensitive(self._encryptCheckbutton, False)
            fancy_set_sensitive(self._sizeCombo, False)
            self._sizeEntry.set_sensitive(False)

        # Check that the container name configured is valid
        self.add_check(self._name_entry, self._checkNameEntry)
コード例 #17
0
    def set_status(self, inputcheck):
        # Use GUIDialogInputCheckHandler to set the error message
        GUIDialogInputCheckHandler.set_status(self, inputcheck)

        # Set the sensitivity of the add button based on the result
        self._addButton.set_sensitive(inputcheck.check_status == InputCheck.CHECK_OK)
コード例 #18
0
    def set_status(self, inputcheck):
        # Use the superclass set_status to set the error message
        GUIDialogInputCheckHandler.set_status(self, inputcheck)

        # Change the sensitivity of the Save button
        self._save_button.set_sensitive(next(self.failed_checks, None) == None)
コード例 #19
0
    def __init__(self, *args, **kwargs):
        GUIDialogInputCheckHandler.__init__(self)

        # these are all absolutely required. not getting them is fatal.
        self._disks = kwargs.pop("disks")
        free = kwargs.pop("free")
        self.selected = kwargs.pop("selected")[:]
        self.name = kwargs.pop("name") or "" # make sure it's a string
        self.device_type = kwargs.pop("device_type")
        self.storage = kwargs.pop("storage")

        # these are less critical
        self.raid_level = kwargs.pop("raid_level", None) or None # not ""
        self.encrypted = kwargs.pop("encrypted", False)
        self.exists = kwargs.pop("exists", False)

        self.size_policy = kwargs.pop("size_policy", SIZE_POLICY_AUTO)
        self.size = kwargs.pop("size", Size(0))

        self._error = None
        GUIObject.__init__(self, *args, **kwargs)

        self._grabObjects()

        # set up the dialog labels with device-type-specific text
        container_type = get_container_type(self.device_type)
        title_text = _(CONTAINER_DIALOG_TITLE) % {"container_type": container_type.name.upper()}
        self._title_label.set_text(title_text)

        dialog_text = _(CONTAINER_DIALOG_TEXT) % {"container_type": container_type.name.lower()}
        self._dialog_label.set_text(dialog_text)

        # populate the dialog widgets
        self._name_entry.set_text(self.name)

        # populate the store
        for disk in self._disks:
            self._store.append([disk.description,
                                str(disk.size),
                                str(free[disk.name][0]),
                                disk.serial,
                                disk.id])

        model = self._treeview.get_model()
        itr = model.get_iter_first()

        selected_ids = [d.id for d in self.selected]
        selection = self._treeview.get_selection()
        while itr:
            disk_id = model.get_value(itr, 4)
            if disk_id in selected_ids:
                selection.select_iter(itr)

            itr = model.iter_next(itr)

        # XXX how will this be related to the device encryption setting?
        self._encryptCheckbutton.set_active(self.encrypted)

        # set up the raid level combo
        # XXX how will this be related to the device raid level setting?
        self._raidStoreFilter.set_visible_func(self._raid_level_visible)
        self._raidStoreFilter.refilter()
        self._populate_raid()

        self._original_size = self.size
        self._original_size_text = self.size.humanReadable(max_places=2)
        self._sizeEntry.set_text(self._original_size_text)
        if self.size_policy == SIZE_POLICY_AUTO:
            self._sizeCombo.set_active(0)
        elif self.size_policy == SIZE_POLICY_MAX:
            self._sizeCombo.set_active(1)
        else:
            self._sizeCombo.set_active(2)

        if self.exists:
            fancy_set_sensitive(self._name_entry, False)
            self._treeview.set_sensitive(False)
            fancy_set_sensitive(self._encryptCheckbutton, False)
            fancy_set_sensitive(self._sizeCombo, False)
            self._sizeEntry.set_sensitive(False)

        # Check that the container name configured is valid
        self.add_check(self._name_entry, self._checkNameEntry)
コード例 #20
0
    def set_status(self, inputcheck):
        # Use the superclass set_status to set the error message
        GUIDialogInputCheckHandler.set_status(self, inputcheck)

        # Change the sensitivity of the Save button
        self._save_button.set_sensitive(next(self.failed_checks, None) == None)