示例#1
0
  private void initVariables() {
    isStarted = true;
    isPaused = false;
    isBroken = false;
    isTextSent = false;
    workingOn = 0;

    captchan.btnAction.setText("Pause");

    captchan.setComponentsEnabled(false);
    useConfirmStopListener();

    String board = captchan.tfBoard.getText();
    String thread = captchan.tfThread.getText();

    topicURL = "http://boards.4chan.org/" + board;
    postURL = "http://sys.4chan.org/" + board + "/post";
    boolean isThreadSpecified = (!thread.equals(""));
    if (isThreadSpecified) topicURL += "/res/" + thread;

    boolean isIntervalSpecified = (!captchan.tfSeconds.getText().equals(""));
    if (!isIntervalSpecified) captchan.tfSeconds.setText("60");

    MAX_FILE_SIZE = ChanBoard.getMaxFileSize(topicURL);

    solveCaptchas();

    // After solving captchas, allow pausing
    captchan.btnAction.setEnabled(true);
  }
示例#2
0
 private void done() {
   if (isBroken) {
     log("Broken");
   } else {
     captchan.btnSelect.setText("Select Files...");
     files = null;
     log("Done");
   }
   useFastCloseListener();
   isStarted = false;
   captchan.btnAction.setText("Start");
   captchan.setComponentsEnabled(true);
 }