Skip to content

Commit

Permalink
confirm remove tag bank (stevencohn#1351)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn authored and weissm committed Apr 20, 2024
1 parent 009af6b commit 8662a78
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 0 deletions.
12 changes: 12 additions & 0 deletions OneMore/Commands/Tagging/TagBankCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ namespace River.OneMoreAddIn.Commands
{
using River.OneMoreAddIn.Models;
using River.OneMoreAddIn.Styles;
using River.OneMoreAddIn.UI;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using Resx = Properties.Resources;


internal class TagBankCommand : Command
Expand Down Expand Up @@ -130,6 +133,15 @@ private bool RemoveWordBank(OneNote one, Page page, XNamespace ns)
return false;
}

var text = outline.TextValue(true);
if (text?.Trim().Length > 0)
{
if (MoreMessageBox.ShowQuestion(owner, Resx.TagBankCommand_confirm) != DialogResult.Yes)
{
return false;
}
}

if (outline.GetAttributeValue("objectID", out string id))
{
one.DeleteContent(page.PageId, id);
Expand Down
9 changes: 9 additions & 0 deletions OneMore/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.ar-SA.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4702,6 +4702,10 @@ ISO-code then comma then language name</comment>
<value>موضوع جدول OneMore {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>يحتوي بنك العلامات على نص. هل أنت متأكد أنك تريد إزالته؟</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>تحقق من كل الصفحات</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4694,6 +4694,10 @@ Umkehren</value>
<value>OneMore-Tabellendesign {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>Die Tag-Bank enthält Text. Möchten Sie es wirklich entfernen?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>Alle wählen</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.es-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4702,6 +4702,10 @@ Invertir</value>
<value>Tema de mesa OneMore {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>El banco de etiquetas contiene texto. ¿Estás seguro de que quieres eliminarlo?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>Ver todas las páginas</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4699,6 +4699,10 @@ Inverser</value>
<value>Thème de table OneMore {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>La banque de balises contient du texte. Êtes-vous sûr de vouloir le supprimer ?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>Vérifiez toutes les pages</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.he-IL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4713,6 +4713,10 @@ ISO-code then comma then language name</comment>
<value>נושא טבלה onemore {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>בנק התגים מכיל טקסט. האם אתה בטוח שברצונך להסיר אותו?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>בדוק את כל העמודים</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.nl-NL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4702,6 +4702,10 @@ Omkeren</value>
<value>OneMore Table-thema {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>De tagbank bevat tekst. Weet je zeker dat je het wilt verwijderen?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>Controleer alle pagina's</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.pl-PL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4715,6 +4715,10 @@ Odwracać</value>
<value>Motyw tabeli OneMore {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>Bank znaczników zawiera tekst. Czy na pewno chcesz to usunąć?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>Sprawdź wszystkie strony.</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.pt-BR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4702,6 +4702,10 @@ Invertido</value>
<value>Tema de mesa OneMore {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>O banco de tags contém texto. Tem certeza de que deseja removê-lo?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>Verifique todas as páginas</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4740,6 +4740,10 @@ Invert</value>
<value>OneMore Table Theme {0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>The tag bank contains text. Are you sure you want to remove it?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>Check all pages</value>
<comment>check all nodes link label</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4695,6 +4695,10 @@ ISO-code then comma then language name</comment>
<value>OneMore 表格主题{0}</value>
<comment>Screentip for table theme gallery tiles</comment>
</data>
<data name="TagBankCommand_confirm" xml:space="preserve">
<value>标签库包含文本。您确定要删除它吗?</value>
<comment>messagebox</comment>
</data>
<data name="TaggedDialog_checkAllLabel.Text" xml:space="preserve">
<value>检查所有页面</value>
<comment>check all nodes link label</comment>
Expand Down

0 comments on commit 8662a78

Please sign in to comment.