implemented "clear ended" button, not enough spotted pacas.

This commit is contained in:
= 2020-09-04 23:42:22 +10:00
parent e486bce6de
commit 04f8e4dbdb
3 changed files with 23 additions and 2 deletions

3
.gitignore vendored
View file

@ -5,4 +5,5 @@ bin/
obj/ obj/
out/ out/
yahoo.html yahoo.html
.vs/ .vs/
/buypeeb.sln

View file

@ -26,6 +26,7 @@ using System.Threading.Tasks;
using System.Net; using System.Net;
using System.Diagnostics; using System.Diagnostics;
using Gtk; using Gtk;
using System.Linq;
namespace Buypeeb { namespace Buypeeb {
public struct ItemColumns { public struct ItemColumns {
@ -369,6 +370,25 @@ namespace Buypeeb {
private void ButtonClearEndedClicked(object sender, EventArgs a) { private void ButtonClearEndedClicked(object sender, EventArgs a) {
Console.WriteLine("ButtonClearEndedClicked"); Console.WriteLine("ButtonClearEndedClicked");
var md = this.OkCancelDialogue("Are you sure you want to remove all ended auctions from the list?");
var r = (ResponseType)md.Run();
md.Dispose();
if (r != ResponseType.Ok) {
return;
}
var removeMe = new List<string>();
foreach(var item in this.settings.watchlist) {
if (!item.Value.available) {
removeMe.Add(item.Key);
}
}
foreach(var id in removeMe) {
this.settings.watchlist.Remove(id);
}
this.RenderList();
} }
private void ButtonClearAllClicked(object sender, EventArgs a) { private void ButtonClearAllClicked(object sender, EventArgs a) {

View file

@ -115,7 +115,7 @@
<child> <child>
<object class="GtkToolButton" id="ButtonClearEnded"> <object class="GtkToolButton" id="ButtonClearEnded">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property> <property name="sensitive">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Clear ended</property> <property name="tooltip_text" translatable="yes">Clear ended</property>
<property name="label" translatable="yes">Clear ended</property> <property name="label" translatable="yes">Clear ended</property>