Compare commits

..

No commits in common. "5103ff424131027633f5d5994b03ca885b164421" and "9c983d82f4d2a6c4b5b62624c35c4f3d680e7811" have entirely different histories.

View file

@ -270,7 +270,7 @@ namespace Buypeeb {
}
}
private void UpdateItem(string id, bool renderListWhenDone = false) {
private void UpdateItem(string id, bool refilterWhenDone = false) {
var item = this.settings.watchlist[id];
if (item.updatedRecently) {
// the item has been updated recently, and force is not true
@ -284,10 +284,9 @@ namespace Buypeeb {
this.UpdateThread(id);
}).ContinueWith(task => {
taskLimit.Release();
if (renderListWhenDone) {
Gtk.Application.Invoke(delegate {
this.RenderList();
});
if (refilterWhenDone) {
var m = (TreeModelFilter)this.itemTreeView.Model;
m.Refilter();
}
});
}
@ -442,11 +441,6 @@ namespace Buypeeb {
}
private void RenderList() {
string id = null;
if (this.selectedItem != null) {
id = this.selectedItem.id;
}
this.items.Clear();
var values = this.settings.watchlist.Values;
IOrderedEnumerable<YahooAuctionsItem> sorted;
@ -487,14 +481,6 @@ namespace Buypeeb {
var m = (TreeModelFilter)this.itemTreeView.Model;
m.Refilter();
if (id != null) {
// attempt to reselect the item we were just looking at
var pathAndIter = this.GetRow(id);
if (pathAndIter.path != null) {
this.itemTreeView.Selection.SelectPath(pathAndIter.path);
}
}
}
// event handlers
@ -512,7 +498,7 @@ namespace Buypeeb {
// TODO: better. do better.
Regex rx = new Regex(@"^http.+yahoo.+");
if (rx.IsMatch(url)) {
this.UpdateItem(this.settings.Watch(url, name).id, true);
this.UpdateItem(this.settings.Watch(url, name).id);
this.RenderList();
}
else {
@ -744,7 +730,11 @@ namespace Buypeeb {
if (this.settings.displayFavouritesAtTopOfList) {
var id = this.selectedItem.id;
// re-render the list, to ensure the favourites get pushed to the top
this.RenderList();
// attempt to reselect the item we were just looking at
var pathAndIter = this.GetRow(id);
this.itemTreeView.Selection.SelectPath(pathAndIter.path);
}
else {
// i don't know why this is necessary