Search in sources :

Example 1 with ResetGlusterVolumeOptionsParameters

use of org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters in project ovirt-engine by oVirt.

the class VolumeParameterListModel method onResetAllParameters.

private void onResetAllParameters() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (getEntity() == null) {
        return;
    }
    GlusterVolumeEntity volume = getEntity();
    ResetGlusterVolumeOptionsParameters parameters = new ResetGlusterVolumeOptionsParameters(volume.getId(), null, false);
    model.startProgress();
    Frontend.getInstance().runAction(ActionType.ResetGlusterVolumeOptions, parameters, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ResetGlusterVolumeOptionsParameters(org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters)

Example 2 with ResetGlusterVolumeOptionsParameters

use of org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters in project ovirt-engine by oVirt.

the class VolumeParameterListModel method onResetParameter.

private void onResetParameter() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (getSelectedItem() == null) {
        return;
    }
    GlusterVolumeOptionEntity selectedOption = getSelectedItem();
    ResetGlusterVolumeOptionsParameters parameters = new ResetGlusterVolumeOptionsParameters(selectedOption.getVolumeId(), selectedOption, false);
    model.startProgress();
    Frontend.getInstance().runAction(ActionType.ResetGlusterVolumeOptions, parameters, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : GlusterVolumeOptionEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ResetGlusterVolumeOptionsParameters(org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters)

Aggregations

ResetGlusterVolumeOptionsParameters (org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters)2 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)2 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)1 GlusterVolumeOptionEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity)1