James Moger
2011-10-26 8b76369fb44bfd863b27bcede453d676905f52e5
src/com/gitblit/client/GitblitManager.java
@@ -29,6 +29,7 @@
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.net.ConnectException;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -64,6 +65,7 @@
import org.eclipse.jgit.util.FS;
import com.gitblit.Constants;
import com.gitblit.GitBlitException.ForbiddenException;
import com.gitblit.utils.StringUtils;
/**
@@ -272,7 +274,19 @@
               registrations.put(reg.name, reg);
               rebuildRecentMenu();
            } catch (Throwable t) {
               Utils.showException(GitblitManager.this, t);
               Throwable cause = t.getCause();
               if (cause instanceof ConnectException) {
                  JOptionPane.showMessageDialog(GitblitManager.this, cause.getMessage(),
                        Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);
               } else if (cause instanceof ForbiddenException) {
                  JOptionPane
                        .showMessageDialog(
                              GitblitManager.this,
                              "This Gitblit server does not allow RPC Management or Administration",
                              Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);
               } else {
                  Utils.showException(GitblitManager.this, t);
               }
            } finally {
               setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
@@ -338,7 +352,7 @@
         StoredConfig config = getConfig();
         config.setString("servers", reg.name, "url", reg.url);
         config.setString("servers", reg.name, "account", reg.account);
         // FIXME this is pretty lame
         // FIXME this is pretty lame
         config.setString("servers", reg.name, "password",
               Base64.encodeBytes(new String(reg.password).getBytes("UTF-8")));
         config.setString("servers", reg.name, "lastLogin", dateFormat.format(reg.lastLogin));