Search in sources :

Example 1 with ConfigInfo

use of com.google.gerrit.client.projects.ConfigInfo in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method doSave.

private void doSave() {
    enableForm(false);
    saveProject.setEnabled(false);
    InheritableBoolean esp = enableSignedPush != null ? getBool(enableSignedPush) : null;
    InheritableBoolean rsp = requireSignedPush != null ? getBool(requireSignedPush) : null;
    ProjectApi.setConfig(getProjectKey(), descTxt.getText().trim(), getBool(contributorAgreements), getBool(contentMerge), getBool(signedOffBy), getBool(newChangeForAllNotInTarget), getBool(requireChangeID), esp, rsp, getBool(rejectImplicitMerges), getBool(enableReviewerByEmail), maxObjectSizeLimit.getText().trim(), SubmitType.valueOf(submitType.getValue(submitType.getSelectedIndex())), ProjectState.valueOf(state.getValue(state.getSelectedIndex())), getPluginConfigValues(), new GerritCallback<ConfigInfo>() {

        @Override
        public void onSuccess(ConfigInfo result) {
            enableForm();
            display(result);
        }

        @Override
        public void onFailure(Throwable caught) {
            enableForm();
            super.onFailure(caught);
        }
    });
}
Also used : InheritableBoolean(com.google.gerrit.extensions.client.InheritableBoolean) ConfigInfo(com.google.gerrit.client.projects.ConfigInfo)

Example 2 with ConfigInfo

use of com.google.gerrit.client.projects.ConfigInfo in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method onLoad.

@Override
protected void onLoad() {
    super.onLoad();
    Project.NameKey project = getProjectKey();
    CallbackGroup cbg = new CallbackGroup();
    AccessMap.get(project, cbg.add(new GerritCallback<ProjectAccessInfo>() {

        @Override
        public void onSuccess(ProjectAccessInfo result) {
            isOwner = result.isOwner();
            configVisible = result.configVisible();
            enableForm();
            saveProject.setVisible(isOwner);
        }
    }));
    ProjectApi.getConfig(project, cbg.addFinal(new ScreenLoadCallback<ConfigInfo>(this) {

        @Override
        public void preDisplay(ConfigInfo result) {
            display(result);
        }
    }));
    savedPanel = INFO;
}
Also used : Project(com.google.gerrit.reviewdb.client.Project) GerritCallback(com.google.gerrit.client.rpc.GerritCallback) ProjectAccessInfo(com.google.gerrit.client.access.ProjectAccessInfo) CallbackGroup(com.google.gerrit.client.rpc.CallbackGroup) ScreenLoadCallback(com.google.gerrit.client.rpc.ScreenLoadCallback) ConfigInfo(com.google.gerrit.client.projects.ConfigInfo)

Aggregations

ConfigInfo (com.google.gerrit.client.projects.ConfigInfo)2 ProjectAccessInfo (com.google.gerrit.client.access.ProjectAccessInfo)1 CallbackGroup (com.google.gerrit.client.rpc.CallbackGroup)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 ScreenLoadCallback (com.google.gerrit.client.rpc.ScreenLoadCallback)1 InheritableBoolean (com.google.gerrit.extensions.client.InheritableBoolean)1 Project (com.google.gerrit.reviewdb.client.Project)1