コード例 #1
0
 // TODO: login to github must be merged with tasks server settings
 public GithubLoginDialog(final Project project) {
   super(project, true);
   myProject = project;
   myGithubLoginPanel = new GithubLoginPanel(this);
   final GithubSettings settings = GithubSettings.getInstance();
   myGithubLoginPanel.setLogin(settings.getLogin());
   myGithubLoginPanel.setPassword(settings.getPassword());
   setTitle("Login to GitHub");
   setOKButtonText("Login");
   init();
 }
コード例 #2
0
 @Override
 protected void doOKAction() {
   final String login = myGithubLoginPanel.getLogin();
   final String password = myGithubLoginPanel.getPassword();
   if (GithubUtil.checkCredentials(myProject, login, password)) {
     final GithubSettings settings = GithubSettings.getInstance();
     settings.setLogin(login);
     settings.setPassword(password);
     super.doOKAction();
   } else {
     setErrorText("Cannot login with given credentials");
   }
 }