public MainForm() { DiffScriptingAdapter = new JsAdapter(this); Updater.UpdateUpdaterFile(); SplashScreen.Show(this); RightToLeft = System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? RightToLeft.Yes : RightToLeft.No; SplashScreen.SetProgress(1); InitializeComponent(); SplashScreen.SetProgress(5); try { btntsShowHide.Image = Resources.Showhide; btntsShowHideParameters.Image = Resources.Showhideparameters; btntsSave.Image = Resources.Save; btntsIgnore.Image = Resources.RightArrow; btntsStop.Image = Resources.Stop; btntsPreview.Image = Resources.preview; btntsChanges.Image = Resources.changes; btntsFalsePositive.Image = Resources.RollBack; btntsStart.Image = Resources.Run; btntsDelete.Image = Resources.Vista_trashcan_empty; SplashScreen.SetProgress(10); try { Parser = new Parsers(Properties.Settings.Default.StubMaxWordCount, Properties.Settings.Default.AddHummanKeyToCats); } catch (Exception ex) { Parser = new Parsers(); ErrorHandler.Handle(ex); } addToWatchList.SelectedIndex = 3; cmboCategorise.SelectedIndex = 0; cmboImages.SelectedIndex = 0; listMaker.UserInputTextBox.ContextMenuStrip = mnuMakeFromTextBox; listMaker.BusyStateChanged += SetProgressBar; listMaker.NoOfArticlesChanged += UpdateButtons; listMaker.StatusTextChanged += UpdateListStatus; listMaker.cmboSourceSelect.SelectedIndexChanged += ListMakerSourceSelectHandler; TheSession = new Session(this); CreateEditor(); Profiles = new WikiFunctions.Profiles.AWBProfilesForm(TheSession); Profiles.LoggedIn += ProfileLoggedIn; SplashScreen.SetProgress(15); _pasteMoreItems = new[] { PasteMore1, PasteMore2, PasteMore3, PasteMore4, PasteMore5, PasteMore6, PasteMore7, PasteMore8, PasteMore9, PasteMore10 }; // to avoid saving to app data saveXML.InitialDirectory = openXML.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); } catch (Exception ex) { ErrorHandler.Handle(ex); } }
public MainForm() { SplashScreen.Show(this); RightToLeft = System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? RightToLeft.Yes : RightToLeft.No; InitializeComponent(); SplashScreen.SetProgress(5); try { btntsShowHide.Image = Resources.Showhide; btntsShowHideParameters.Image = Resources.Showhideparameters; btntsSave.Image = Resources.Save; btntsIgnore.Image = Resources.RightArrow; btntsStop.Image = Resources.Stop; btntsPreview.Image = Resources.preview; btntsChanges.Image = Resources.changes; btntsFalsePositive.Image = Resources.RollBack; btntsStart.Image = Resources.Run; btntsDelete.Image = Resources.Vista_trashcan_empty; SplashScreen.SetProgress(10); try { Parser = new Parsers(Properties.Settings.Default.StubMaxWordCount, Properties.Settings.Default.AddHummanKeyToCats); } catch (Exception ex) { Parser = new Parsers(); ErrorHandler.Handle(ex); } toolStripComboOnLoad.SelectedIndex = 0; cmboCategorise.SelectedIndex = 0; cmboImages.SelectedIndex = 0; Variables.User.UserNameChanged += UpdateUserName; Variables.User.BotStatusChanged += UpdateBotStatus; Variables.User.AdminStatusChanged += UpdateAdminStatus; //Variables.User.WikiStatusChanged += UpdateWikiStatus; Variables.User.WebBrowserLogin.DocumentCompleted += WebLoginCompleted; Variables.User.WebBrowserLogin.Navigating += WebLoginStarting; webBrowserEdit.Deleted += CaseWasDelete; webBrowserEdit.Loaded += CaseWasLoad; webBrowserEdit.Saved += CaseWasSaved; webBrowserEdit.None += CaseWasNull; webBrowserEdit.Fault += StartDelayedRestartTimer; webBrowserEdit.StatusChanged += UpdateWebBrowserStatus; listMaker.UserInputTextBox.ContextMenuStrip = mnuMakeFromTextBox; listMaker.BusyStateChanged += SetProgressBar; listMaker.NoOfArticlesChanged += UpdateButtons; listMaker.StatusTextChanged += UpdateListStatus; listMaker.cmboSourceSelect.SelectedIndexChanged += ListMakerSourceSelectHandler; Profiles = new WikiFunctions.Profiles.AWBProfilesForm(webBrowserEdit); Profiles.LoadProfile += LoadProfileSettings; SplashScreen.SetProgress(15); } catch (Exception ex) { ErrorHandler.Handle(ex); } }
public MainForm() { splash.Show(this); RightToLeft = System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? RightToLeft.Yes : RightToLeft.No; InitializeComponent(); Tools.RegistryMigration(); splash.SetProgress(5); try { Icon = WikiFunctions.Properties.Resources.AWBIcon; lblUserName.Alignment = ToolStripItemAlignment.Right; lblProject.Alignment = ToolStripItemAlignment.Right; lblTimer.Alignment = ToolStripItemAlignment.Right; lblEditsPerMin.Alignment = ToolStripItemAlignment.Right; lblIgnoredArticles.Alignment = ToolStripItemAlignment.Right; lblEditCount.Alignment = ToolStripItemAlignment.Right; btntsShowHide.Image = Resources.Showhide; btntsShowHideParameters.Image = Resources.Showhideparameters; btntsSave.Image = Resources.Save; btntsIgnore.Image = Resources.RightArrow; btntsStop.Image = Resources.Stop; btntsPreview.Image = Resources.preview; btntsChanges.Image = Resources.changes; btntsFalsePositive.Image = Resources.RollBack; btntsStart.Image = Resources.Run; btntsDelete.Image = Resources.Vista_trashcan_empty; splash.SetProgress(10); int stubcount = 500; bool catkey = false; try { stubcount = AutoWikiBrowser.Properties.Settings.Default.StubMaxWordCount; catkey = AutoWikiBrowser.Properties.Settings.Default.AddHummanKeyToCats; parsers = new Parsers(stubcount, catkey); } catch (Exception ex) { parsers = new Parsers(); ErrorHandler.Handle(ex); } toolStripComboOnLoad.SelectedIndex = 0; cmboCategorise.SelectedIndex = 0; cmboImages.SelectedIndex = 0; lblStatusText.AutoSize = true; lblBotTimer.AutoSize = true; Variables.User.UserNameChanged += UpdateUserName; Variables.User.BotStatusChanged += UpdateBotStatus; Variables.User.AdminStatusChanged += UpdateAdminStatus; Variables.User.WikiStatusChanged += UpdateWikiStatus; Variables.User.webBrowserLogin.DocumentCompleted += web4Completed; Variables.User.webBrowserLogin.Navigating += web4Starting; webBrowserEdit.Deleted += CaseWasDelete; webBrowserEdit.Loaded += CaseWasLoad; webBrowserEdit.Saved += CaseWasSaved; webBrowserEdit.None += CaseWasNull; webBrowserEdit.Fault += StartDelayedRestartTimer; webBrowserEdit.StatusChanged += UpdateWebBrowserStatus; listMaker.UserInputTextBox.ContextMenuStrip = mnuMakeFromTextBox; listMaker.BusyStateChanged += SetProgressBar; listMaker.NoOfArticlesChanged += UpdateButtons; listMaker.StatusTextChanged += UpdateListStatus; listMaker.cmboSourceSelect.SelectedIndexChanged += new EventHandler(ListMakerSourceSelectHandler); profiles = new WikiFunctions.Profiles.AWBProfilesForm(webBrowserEdit); profiles.LoadProfile += LoadProfileSettings; splash.SetProgress(15); WikiFunctions.Profiles.AWBProfiles.ResetTempPassword(); } catch (Exception ex) { ErrorHandler.Handle(ex); } }
/// <summary> /// This form demonstates usage of the WikiIRC framework. /// </summary> public IRCMonitor() { InitializeComponent(); LoadIrcChannels(); cmboEditIP.SelectedIndex = 0; cmboEditMinor.SelectedIndex = 0; cmboEditNamespace.SelectedIndex = 0; cmboNewStuffNamespace.SelectedIndex = 0; cmboPageMoveNamespace.SelectedIndex = 0; btnBack.Image = WikiFunctions.Properties.Resources.LeftArrow; btnFoward.Image = WikiFunctions.Properties.Resources.RightArrow; btnStop.Image = WikiFunctions.Properties.Resources.Stop; btnOpenInBrowser.Image = WikiFunctions.Properties.Resources.NewWindow; Variables.SetProject(LangCodeEnum.en, ProjectEnum.wikipedia); btnIPColour.BackColor = ColourIP; btnRegisteredUserColour.BackColor = UserColour; btnSetWhiteListColour.BackColor = whitelistcolour; btnSetBlackListColour.BackColor = BlackListColour; btnSetWatchedColour.BackColor = WatchListColour; btnSetCheckedColour.BackColor = CheckedColour; foreach (LangCodeEnum l in Enum.GetValues(typeof(LangCodeEnum))) cmboLang.Items.Add(l.ToString().ToLower()); foreach (ProjectEnum l in Enum.GetValues(typeof(ProjectEnum))) cmboProject.Items.Add(l); webBrowser.Saved += new WikiFunctions.Browser.WebControlDel(WebBrowserSaved); Variables.User.UserNameChanged += UpdateUserName; Variables.User.BotStatusChanged += UpdateBotStatus; Variables.User.AdminStatusChanged += UpdateAdminStatus; Variables.User.WikiStatusChanged += UpdateWikiStatus; profiles = new WikiFunctions.Profiles.AWBProfilesForm(webBrowser); profiles.LoadProfile += LoadProfileSettings; }
private void profilesToolStripMenuItem_Click(object sender, EventArgs e) { WikiFunctions.Profiles.AWBProfilesForm profiles = new WikiFunctions.Profiles.AWBProfilesForm(webBrowser); profiles.LoadProfile += LoadProfileSettings; profiles.Show(this); }
private void MainForm_Load(object sender, EventArgs e) { StatusLabelText = "Initialising..."; splash.SetProgress(20); Variables.MainForm = this; lblOnlyBots.BringToFront(); Updater.UpdateAWB(new Tools.SetProgress(splash.SetProgress)); // progress 22-29 in UpdateAWB() splash.SetProgress(30); Program.MyTrace.LS = loggingSettings1; try { //check that we are not using an old OS. 98 seems to mangled some unicode if (Environment.OSVersion.Version.Major < 5) { MessageBox.Show("You appear to be using an older operating system, this software may have trouble with some unicode fonts on operating systems older than Windows 2000, the start button has been disabled.", "Operating system", MessageBoxButtons.OK, MessageBoxIcon.Warning); SetStartButton(false); } else listMaker1.MakeListEnabled = true; webBrowserDiff.Navigate("about:blank"); webBrowserDiff.ObjectForScripting = this; splash.SetProgress(35); if (Properties.Settings.Default.LogInOnStart) CheckStatus(false); LogControl1.Initialise(listMaker1); if (Properties.Settings.Default.WindowLocation != null) this.Location = Properties.Settings.Default.WindowLocation; if (Properties.Settings.Default.WindowSize != null) this.Size = Properties.Settings.Default.WindowSize; this.WindowState = Properties.Settings.Default.WindowState; Debug(); Plugin.LoadPluginsStartup(this, splash); // progress 65-79 in LoadPlugins() LoadPrefs(); // progress 80-85 in LoadPrefs() splash.SetProgress(86); UpdateButtons(null, null); splash.SetProgress(88); LoadRecentSettingsList(); // progress 89-94 in LoadRecentSettingsList() splash.SetProgress(95); WikiStatusResult res = Variables.User.CheckEnabled(); if (res == WikiStatusResult.OldVersion) OldVersion(); else if (res == WikiStatusResult.Error) { lblUserName.BackColor = Color.Red; MessageBox.Show(this, "Cannot load version check page from Wikipedia. " + "Please verify that you're connected to Internet.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (userProfileToLoad != -1) { profiles = new WikiFunctions.Profiles.AWBProfilesForm(webBrowserEdit); profiles.LoadProfile += LoadProfileSettings; profiles.login(userProfileToLoad); } } catch (Exception ex) { ErrorHandler.Handle(ex); } UsageStats.Initialise(); StatusLabelText = ""; splash.SetProgress(100); splash.Close(); #if DEBUG && INSTASTATS UsageStats.Do(false); #endif }