Show the Web Identities panel when on HTTP authentication

This way users can see and manage additional mailto: links.
However, we hide the "Link Another Identity" button as it
is not supported unless OpenID is available.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-02-24 13:57:24 -08:00
parent e98904a162
commit c5774a6da7
2 changed files with 19 additions and 19 deletions

View File

@@ -130,17 +130,13 @@ public class AccountSettings extends AccountScreen {
}, Util.C.tabSshKeys());
tabTokens.add(Link.SETTINGS_SSHKEYS);
switch (Common.getGerritConfig().getLoginType()) {
case OPENID:
tabs.add(new LazyTabChild<ExternalIdPanel>() {
@Override
protected ExternalIdPanel create() {
return new ExternalIdPanel();
}
}, Util.C.tabWebIdentities());
tabTokens.add(Link.SETTINGS_WEBIDENT);
break;
}
tabs.add(new LazyTabChild<ExternalIdPanel>() {
@Override
protected ExternalIdPanel create() {
return new ExternalIdPanel();
}
}, Util.C.tabWebIdentities());
tabTokens.add(Link.SETTINGS_WEBIDENT);
if (Common.getGerritConfig().isUseContributorAgreements()) {
tabs.add(new LazyTabChild<AgreementPanel>() {

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.client.account;
import com.google.gerrit.client.FormatUtil;
import com.google.gerrit.client.SignInDialog;
import com.google.gerrit.client.reviewdb.AccountExternalId;
import com.google.gerrit.client.rpc.Common;
import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.FancyFlexTable;
import com.google.gwt.user.client.ui.Button;
@@ -33,21 +34,24 @@ import java.util.List;
class ExternalIdPanel extends Composite {
private IdTable identites;
private Button linkIdentity;
ExternalIdPanel() {
final FlowPanel body = new FlowPanel();
identites = new IdTable();
body.add(identites);
linkIdentity = new Button(Util.C.buttonLinkIdentity());
linkIdentity.addClickListener(new ClickListener() {
public void onClick(final Widget sender) {
doLinkIdentity();
switch (Common.getGerritConfig().getLoginType()) {
case OPENID: {
final Button linkIdentity = new Button(Util.C.buttonLinkIdentity());
linkIdentity.addClickListener(new ClickListener() {
public void onClick(final Widget sender) {
doLinkIdentity();
}
});
body.add(linkIdentity);
break;
}
});
body.add(linkIdentity);
}
initWidget(body);
}