// Single with Preview Action private void Load_Thread_Preview() { ClearUI(); thread = new ThreadObj(textNewURL.Text); if (!thread.PageFound()) { MessageBox.Show("Failed to fetch thread!"); return; } textThreadTitle.Text = thread.GetThreadname(); textLoadedURL.Text = textNewURL.Text; itemURLs = thread.GetItemList(); foreach (string pic in itemURLs) { checkBoxFiles.Items.Add(pic, true); } thumbnailURLs = thread.GetThumbList(); FileUtilities.ThumbFolderSetup(thumbnailPath); SetFoundLabel(itemURLs.Count); SetCheckedLabel(itemURLs.Count); if (checkBoxFiles.Items.Count > 0) { checkBoxFiles.SelectedIndex = 0; } }
// Inintiate New Thread Grab private void buttonGrab_Click(object sender, EventArgs e) { if (textOutputPath.Text == "") { MessageBox.Show("Please select output path before continuing."); return; } if (textNewURL.Text == "") { return; } if (mode == 0) { Load_Thread_Preview(); } else if (mode == 1) { if (Load_Thread(textNewURL.Text)) { ToggleControlLock(); Download_Loaded_Thread(); } } else if (mode == 2) { if (!threadURLs.Contains(textNewURL.Text)) { ThreadObj threadCheck = new ThreadObj(textNewURL.Text); if (threadCheck.PageFound()) { int count = threadCheck.GetItemList().Count; threadURLs.Add(textNewURL.Text); listMultiLinks.Items.Add(textNewURL.Text); listMultiNames.Items.Add(threadCheck.GetThreadname()); listMultiStatus.Items.Add(threadCheck.GetItemList().Count); int thumbCount = threadCheck.GetThumbList().Count; if (count != thumbCount) { MessageBox.Show("Possible Error: " + count + " images vs " + thumbCount + " thumbs found."); } textNewURL.Text = ""; } else { MessageBox.Show("Thread not found. (404)"); } } } }