public static ProgressDialog checkAccount(final Account ac) throws Throwable {
    ProgressDialog pd =
        new ProgressDialog(
            new ProgressGetter() {
              public void run() throws Exception {
                final PluginForHost hostPlugin = new PluginFinder().assignPlugin(ac, true);
                if (hostPlugin != null) {
                  ac.setPlugin(hostPlugin);
                }
                AccountCheckJob job = AccountChecker.getInstance().check(ac, true);
                job.waitChecked();
              }

              public String getString() {
                return null;
              }

              public int getProgress() {
                return -1;
              }

              @Override
              public String getLabelString() {
                return null;
              }
            },
            0,
            _GUI.T.accountdialog_check(),
            _GUI.T.accountdialog_check_msg(),
            DomainInfo.getInstance(ac.getHosterByPlugin()).getFavIcon());
    try {
      Dialog.getInstance().showDialog(pd);
    } catch (DialogCanceledException e) {
      if (pd.getThrowable() == null) {
        throw e;
      } else {
        throw pd.getThrowable();
      }
    }
    return pd;
  }
Exemple #2
0
 public int compareTo(DomainInfo o) {
   return getTld().compareTo(o.getTld());
 }
    public ServicePanelDBCTooltip(ServicePanel owner, final DeathByCaptchaSolver solver) {

        super(new TooltipPanel("ins 0,wrap 1", "[grow,fill]", "[grow,fill]"));
        this.owner = owner;
        color = (LAFOptions.getInstance().getColorForTooltipForeground());
        JProgressBar progress = new JProgressBar();
        progress.setIndeterminate(true);
        panel.setLayout(new MigLayout("ins 0,wrap 1", "[grow,fill]", "[]"));
        JLabel header = new JLabel("DeathByCaptcha Solver", DomainInfo.getInstance("deathbycaptcha.eu").getFavIcon(), JLabel.LEFT);
        header.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, LAFOptions.getInstance().getColorForTooltipForeground()));
        SwingUtils.toBold(header);
        header.setForeground(LAFOptions.getInstance().getColorForTooltipForeground());
        panel.add(header, "gapbottom 5,spanx");
        panel.add(progress);
        // panel.setPreferredSize(new Dimension(300, 100));
        new Thread() {
            public void run() {

                final DBCAccount account = solver.loadAccount();
                new EDTRunner() {

                    @Override
                    protected void runInEDT() {
                        panel.removeAll();
                        // panel.setPreferredSize(null);
                        if (!account.isValid()) {
                            panel.setLayout(new MigLayout("ins 0,wrap 1", "[grow,fill]", "[]"));
                            JLabel header = new JLabel("deathbycaptcha.eu Captcha Solver", DomainInfo.getInstance("deathbycaptcha.eu").getFavIcon(), JLabel.LEFT);
                            header.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, LAFOptions.getInstance().getColorForTooltipForeground()));
                            SwingUtils.toBold(header);
                            header.setForeground(LAFOptions.getInstance().getColorForTooltipForeground());
                            panel.add(header, "gapbottom 5,spanx");
                            panel.add(lbl(_GUI._.ServicePanel9kwTooltip_runInEDT_error2(""), NewTheme.I().getIcon(IconKey.ICON_ERROR, 18), JLabel.LEFT));
                            panel.add(lbl(account.getError()), "gapleft 22");
                        } else {
                            panel.setLayout(new MigLayout("ins 0,wrap 2", "[][grow,align right]", "[]0"));
                            JLabel header = new JLabel("deathbycaptcha.eu Captcha Solver", DomainInfo.getInstance("deathbycaptcha.eu").getFavIcon(), JLabel.LEFT);
                            header.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, LAFOptions.getInstance().getColorForTooltipForeground()));
                            SwingUtils.toBold(header);
                            header.setForeground(LAFOptions.getInstance().getColorForTooltipForeground());
                            panel.add(header, "spanx,gapbottom 5,pushx,growx");

                            panel.add(lbl(_GUI._.lit_accountid(), NewTheme.I().getIcon(IconKey.ICON_PREMIUM, 18), JLabel.LEFT));
                            panel.add(lbl(account.getId() + ""));
                            panel.add(lbl(_GUI._.ServicePanel9kwTooltip_runInEDT_credits_(), NewTheme.I().getIcon(IconKey.ICON_MONEY, 18), JLabel.LEFT));
                            panel.add(lbl(account.getBalance() + " USD Cent"));

                            panel.add(lbl(_GUI._.lit_rate(), NewTheme.I().getIcon(IconKey.ICON_PLAY, 18), JLabel.LEFT));
                            panel.add(lbl(account.getRate() + " USD Cent/Captcha"));
                            panel.add(lbl(_GUI._.ServicePanelDBCTooltip_captcha_free(), NewTheme.I().getIcon(IconKey.ICON_OCR, 18), JLabel.LEFT));
                            panel.add(lbl((int) (account.getBalance() / account.getRate())));
                            if (account.isBanned()) {
                                panel.add(lbl(_GUI._.ServicePanel9kwTooltip_runInEDT_banned(), NewTheme.I().getIcon(IconKey.ICON_ERROR, 18), JLabel.LEFT));

                            }

                        }
                        // panel.revalidate();
                        // revalidate();
                        // repaint();
                        ToolTipController.getInstance().show(ServicePanelDBCTooltip.this);
                    }

                };

            }
        }.start();

    }