diff --git a/.gitignore b/.gitignore
index a9e7e1f..5f51670 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ out/
yahoo.html
.vs/
/buypeeb.sln
+\#*.glade#
diff --git a/MainWindow.cs b/MainWindow.cs
index a0cfb43..ec062af 100755
--- a/MainWindow.cs
+++ b/MainWindow.cs
@@ -336,6 +336,12 @@ namespace Buypeeb {
l.Text = row.Value;
}
+ var noteBuffer = (TextBuffer)this.builder.GetObject("TextBufferSelectedNotes");
+ noteBuffer.Clear();
+ if (!String.IsNullOrWhiteSpace(item.notes)) {
+ noteBuffer.Text = item.notes;
+ }
+
var f = (ToggleButton)this.builder.GetObject("ButtonSelectedFavourite");
f.Active = item.favourite;
@@ -651,6 +657,26 @@ namespace Buypeeb {
}
}
+ private void ButtonSelectedNotesClearClicked(object sender, EventArgs args) {
+ var item = this.selectedItem;
+ var md = this.MsgBox($"Are you sure you want to clear the notes for \"{item.name}\"?");
+ if (md.Run() == (int)ResponseType.Ok) {
+ var noteBuffer = (TextBuffer)this.builder.GetObject("TextBufferSelectedNotes");
+ noteBuffer.Clear();
+ this.selectedItem.notes = null;
+ }
+ md.Dispose();
+ }
+
+ private void TextViewSelectedNotesFocusOut(object sender, FocusOutEventArgs args) {
+ // the "save" button does nothing, however, when you click the save button, you transfer focus to it, firing this event!
+ // how very sneaky
+ var noteBuffer = (TextBuffer)this.builder.GetObject("TextBufferSelectedNotes");
+ if (this.selectedItem != null) {
+ this.selectedItem.notes = String.IsNullOrWhiteSpace(noteBuffer.Text) ? null : noteBuffer.Text;
+ }
+ }
+
// timers
private bool UpdateSelectionEndTime() {
diff --git a/ui/main.glade b/ui/main.glade
index 8f45d2d..b53ce11 100644
--- a/ui/main.glade
+++ b/ui/main.glade
@@ -232,48 +232,6 @@
False
-
-
-
- False
- True
-
-
-
-
-
- False
- True
-
-
-
-
-
- False
- True
-
-