/// <summary> /// Set up form page according to saved settings /// </summary> private void Suggest_Load(object sender, EventArgs e) { delResults = DisplayResults; ResizeLV(); //remove active border on form AcceptButton AcceptButton.NotifyDefault(false); //set-up user choices lvDetails.GridLines = (bool)SQL.GetSetting(SQL.Setting.ShowGrid); for (int i = 0; i < csSearch.Options.Length; i++) { (ddmGallery.DropDownItems[i] as ToolStripMenuItem).Checked = csSearch.Options[i]; } //get system icon for help button tsbtnHelp.Image = SystemIcons.Information.ToBitmap(); //input user credentials string memberID = ((int)SQL.GetSetting(SQL.Setting.member_id)).ToString(); txbxPass.Text = (string)SQL.GetSetting(SQL.Setting.pass_hash); if (memberID != "-1") { txbxID.Text = memberID; } //auto-format search terms where applicable if (sTrySearch.Contains("[")) { StringBuilder sb = new StringBuilder(""); GalleryTitle stGallery = new GalleryTitle(sTrySearch); //check for artist/title fields and set formatting if (!string.IsNullOrWhiteSpace(stGallery.Artist)) { sb.AppendFormat("\"{0}\" \"{1}\"", stGallery.Artist, stGallery.Title); txbxSearch.Text = sb.ToString() + " language:english"; } } txbxSearch.Select(); txbxSearch.SelectionStart = txbxSearch.Text.Length; }
/// <summary> /// Set up form page according to saved settings /// </summary> private void Suggest_Load(object sender, EventArgs e) { delResults = DisplayResults; ResizeLV(); //remove active border on form AcceptButton AcceptButton.NotifyDefault(false); //set-up user choices lvDetails.GridLines = SQL.GetSetting(SQL.Setting.ShowGrid) == "1"; for (int i = 0; i < csSearch.Options.Length; i++) { (ddmGallery.DropDownItems[i] as ToolStripMenuItem).Checked = csSearch.Options[i]; } //get system icon for help button tsbtnHelp.Image = SystemIcons.Information.ToBitmap(); //input user credentials string memberID = SQL.GetSetting(SQL.Setting.member_id); txbxPass.Text = SQL.GetSetting(SQL.Setting.pass_hash); if (memberID != "-1") txbxID.Text = memberID; //auto-format search terms where applicable if (sTrySearch.Contains("[")) { StringBuilder sb = new StringBuilder(""); GalleryTitle stGallery = new GalleryTitle(sTrySearch); //check for artist/title fields and set formatting if (!string.IsNullOrWhiteSpace(stGallery.Artist)) { sb.AppendFormat("\"{0}\" \"{1}\"", stGallery.Artist, stGallery.Title); txbxSearch.Text = sb.ToString() + " language:english"; } } txbxSearch.Select(); txbxSearch.SelectionStart = txbxSearch.Text.Length; }
/// <summary> /// Parse dropped text into TxBx(s) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DragDropTxBx(object sender, DragEventArgs e) { string sAdd = (string)e.Data.GetData(DataFormats.Text); switch ((sender as Control).Name) { case "frTxBx_Desc": frTxBx_Desc.SelectionStart = Ext.InsertText( frTxBx_Desc, sAdd, frTxBx_Desc.SelectionStart); break; case "frTxBx_Notes": frTxBx_Notes.SelectionStart = Ext.InsertText( frTxBx_Notes, sAdd, frTxBx_Notes.SelectionStart); break; case "acTxBx_Artist": if (sAdd.Contains('[') && sAdd.Contains(']')) acTxBx_Artist.BeginInvoke(new DelString(InvokeSetTitle), sAdd); else acTxBx_Artist.BeginInvoke(new DelString(InvokeSetArtistTextRaw), sAdd); break; case "acTxBx_Title": if (sAdd.Contains('[') && sAdd.Contains(']')) acTxBx_Title.BeginInvoke(new DelString(InvokeSetTitle), sAdd); else acTxBx_Title.BeginInvoke(new DelString(InvokeSetTitleTextRaw), sAdd); break; case "acTxBx_Tags": if (sAdd.Contains("\r\n")) acTxBx_Tags.BeginInvoke(new DelString(InvokeSetTags), sAdd); else acTxBx_Tags.BeginInvoke(new DelString(InvokeSetTagTextRaw), sAdd); break; case "TxBx_Search": GalleryTitle stGallery = new GalleryTitle(sAdd); TxBx_Search.SelectionStart = Ext.InsertText(TxBx_Search, stGallery.LocalSearch, TxBx_Search.SelectionStart); UpdateLV(); break; } }
/// <summary> /// Populates manga details from a filepath /// </summary> /// <param name="_Path">The path of the manga</param> public csEntry(string _Path) { //Try to format raw title string GalleryTitle stGallery = new GalleryTitle(Ext.GetNameSansExtension(_Path)); Artist = stGallery.Artist; Title = stGallery.Title; Location = _Path; PostedDate = DateTime.Now; Category = SQL.GetDefaultType(); SetPageCountFromFile(_Path); }
/// <summary> /// Parses the input string directly into the Artist and Title fields /// </summary> /// <param name="sRaw">The string to parse</param> private void SetTitle(string sRaw) { GalleryTitle stGallery = new GalleryTitle(sRaw); if (string.IsNullOrWhiteSpace(acTxBx_Artist.Text)) { acTxBx_Artist.Text = stGallery.Artist; } if (string.IsNullOrWhiteSpace(acTxBx_Title.Text)) { acTxBx_Title.Text = stGallery.Title; } }
/// <summary> /// Run the paste action on the selected field /// </summary> private void MnTx_Paste_Click(object sender, EventArgs e) { string sAdd = Clipboard.GetText(); switch (mnTxBx.SourceControl.GetType().Name) { case "FixedRichTextBox": case "AutoCompleteTagger": if (ActiveControl.Name == acTxBx_Tags.Name) { if (sAdd.Contains("\r\n")) { UpdateTags(sAdd); } else { InvokeSetTagTextRaw(sAdd); } } else { FixedRichTextBox fr = ((FixedRichTextBox)ActiveControl); if (fr.Name == frTxBx_Notes.Name) { fr.SelectedText = sAdd; bSavNotes = false; } else if ((fr.Name == acTxBx_Artist.Name || fr.Name == acTxBx_Title.Name) && sAdd.Contains('[') && sAdd.Contains(']')) { SetTitle(sAdd.Replace("\r\n", "")); } else { fr.SelectedText = sAdd.Replace("\r\n", ""); } } break; case "TextBox": if (ActiveControl.Name == TxBx_Search.Name) { GalleryTitle stGallery = new GalleryTitle(sAdd); TxBx_Search.SelectedText = stGallery.LocalSearch; UpdateLV(); break; } else { ((TextBox)ActiveControl).SelectedText = sAdd; } break; case "ComboBox": ((ComboBox)ActiveControl).SelectedText = sAdd; break; } }
private void btnAddDirectory_Click(object sender, EventArgs e) { using (ExtFolderBrowserDialog xfbd = new ExtFolderBrowserDialog()) { xfbd.Description = "Please select the manga you'd like to exclude from future search results:"; xfbd.ShowBothFilesAndFolders = true; xfbd.RootFolder = Environment.SpecialFolder.MyComputer; xfbd.SelectedPath = Environment.CurrentDirectory; if (xfbd.ShowDialog() == DialogResult.OK) { GalleryTitle stGallery = new GalleryTitle(Ext.GetNameSansExtension(xfbd.SelectedPath)); lvIgnoredPaths.Items.Add(string.Join("", stGallery.Artist, stGallery.Title)); SettingsChanged(stCurrent.SearchIgnoreChanged(GetIgnoredPaths())); } } }