private void Login() {
    Runnable run = new Runnable() {
      @Override
      public void run() {
        tName.setEditable(false);
        tPassword.setEditable(false);
        Data.settings.username = tName.getText();
        Wiki w;

        if (pServer.getSelectedIndex() == 0) {
          //commons
          if (rCommons.isSelected()) {
            Data.settings.server = "commons.wikimedia.org";
            Data.settings.protocol = "https";
            Data.settings.path = "/w";
          } //sister projects
          else if (rWikimedia.isSelected()) {
            Data.settings.server = tPrefix.getText() + "." + cServer.getSelectedItem().toString();
            Data.settings.protocol = "https";
            Data.settings.path = "/w";
          }
        } //sth else
        else {
          Data.settings.protocol = tProtocol.getText();
          Data.settings.server = tServer.getText();
          Data.settings.path = tPath.getText();
        }

        w = new Wiki(Data.settings.server, Data.settings.path);
        w.setHttp(Data.settings.protocol);
        w.setUserAgent("VicunaUploader/" + Data.version + " (https://github.com/yarl/vicuna)");


        //login info
        lTextInfo.setIcon(new ImageIcon(getClass().getResource("/cuploader/resources/ui-progress-bar-indeterminate.gif")));
        lTextInfo.setText(bundle.getString("login-loggingin"));
        lTextInfo.setVisible(true);

        //login
        try {
          w.login(tName.getText(), tPassword.getPassword());
          Data.wiki = w;

          //TODO: pobieranie ustawień konta
          Data.setLoggedIn(true);

          if (startUpload) {
            new FUploadCheck(data);
          }
          dispose();
          Data.fLogin = null;
        } catch (IOException ex) {
          lTextInfo.setIcon(new ImageIcon(getClass().getResource("/cuploader/resources/cross.png")));
          lTextInfo.setText(bundle.getString("login-error-server"));
          tName.setEditable(true);
          tPassword.setEditable(true);
          tPassword.selectAll();

        } catch (FailedLoginException ex) {
          lTextInfo.setIcon(new ImageIcon(getClass().getResource("/cuploader/resources/cross.png")));
          lTextInfo.setText(bundle.getString("login-error-login"));
          tName.setEditable(true);
          tPassword.setEditable(true);
          tPassword.selectAll();
        }
      }
    };

    Thread t = new Thread(run);
    t.setName("FLogin: login window backend");
    t.start();
  }