implemented "clear ended" button, not enough spotted pacas.
This commit is contained in:
parent
e486bce6de
commit
04f8e4dbdb
3 changed files with 23 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -5,4 +5,5 @@ bin/
|
|||
obj/
|
||||
out/
|
||||
yahoo.html
|
||||
.vs/
|
||||
.vs/
|
||||
/buypeeb.sln
|
||||
|
|
|
@ -26,6 +26,7 @@ using System.Threading.Tasks;
|
|||
using System.Net;
|
||||
using System.Diagnostics;
|
||||
using Gtk;
|
||||
using System.Linq;
|
||||
|
||||
namespace Buypeeb {
|
||||
public struct ItemColumns {
|
||||
|
@ -369,6 +370,25 @@ namespace Buypeeb {
|
|||
|
||||
private void ButtonClearEndedClicked(object sender, EventArgs a) {
|
||||
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) {
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
<child>
|
||||
<object class="GtkToolButton" id="ButtonClearEnded">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="sensitive">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Clear ended</property>
|
||||
<property name="label" translatable="yes">Clear ended</property>
|
||||
|
|
Loading…
Reference in a new issue