Compare commits
No commits in common. "5103ff424131027633f5d5994b03ca885b164421" and "9c983d82f4d2a6c4b5b62624c35c4f3d680e7811" have entirely different histories.
5103ff4241
...
9c983d82f4
1 changed files with 9 additions and 19 deletions
|
@ -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];
|
var item = this.settings.watchlist[id];
|
||||||
if (item.updatedRecently) {
|
if (item.updatedRecently) {
|
||||||
// the item has been updated recently, and force is not true
|
// the item has been updated recently, and force is not true
|
||||||
|
@ -284,10 +284,9 @@ namespace Buypeeb {
|
||||||
this.UpdateThread(id);
|
this.UpdateThread(id);
|
||||||
}).ContinueWith(task => {
|
}).ContinueWith(task => {
|
||||||
taskLimit.Release();
|
taskLimit.Release();
|
||||||
if (renderListWhenDone) {
|
if (refilterWhenDone) {
|
||||||
Gtk.Application.Invoke(delegate {
|
var m = (TreeModelFilter)this.itemTreeView.Model;
|
||||||
this.RenderList();
|
m.Refilter();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -442,11 +441,6 @@ namespace Buypeeb {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RenderList() {
|
private void RenderList() {
|
||||||
string id = null;
|
|
||||||
if (this.selectedItem != null) {
|
|
||||||
id = this.selectedItem.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.items.Clear();
|
this.items.Clear();
|
||||||
var values = this.settings.watchlist.Values;
|
var values = this.settings.watchlist.Values;
|
||||||
IOrderedEnumerable<YahooAuctionsItem> sorted;
|
IOrderedEnumerable<YahooAuctionsItem> sorted;
|
||||||
|
@ -487,14 +481,6 @@ namespace Buypeeb {
|
||||||
|
|
||||||
var m = (TreeModelFilter)this.itemTreeView.Model;
|
var m = (TreeModelFilter)this.itemTreeView.Model;
|
||||||
m.Refilter();
|
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
|
// event handlers
|
||||||
|
@ -512,7 +498,7 @@ namespace Buypeeb {
|
||||||
// TODO: better. do better.
|
// TODO: better. do better.
|
||||||
Regex rx = new Regex(@"^http.+yahoo.+");
|
Regex rx = new Regex(@"^http.+yahoo.+");
|
||||||
if (rx.IsMatch(url)) {
|
if (rx.IsMatch(url)) {
|
||||||
this.UpdateItem(this.settings.Watch(url, name).id, true);
|
this.UpdateItem(this.settings.Watch(url, name).id);
|
||||||
this.RenderList();
|
this.RenderList();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -744,7 +730,11 @@ namespace Buypeeb {
|
||||||
|
|
||||||
if (this.settings.displayFavouritesAtTopOfList) {
|
if (this.settings.displayFavouritesAtTopOfList) {
|
||||||
var id = this.selectedItem.id;
|
var id = this.selectedItem.id;
|
||||||
|
// re-render the list, to ensure the favourites get pushed to the top
|
||||||
this.RenderList();
|
this.RenderList();
|
||||||
|
// attempt to reselect the item we were just looking at
|
||||||
|
var pathAndIter = this.GetRow(id);
|
||||||
|
this.itemTreeView.Selection.SelectPath(pathAndIter.path);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// i don't know why this is necessary
|
// i don't know why this is necessary
|
||||||
|
|
Loading…
Reference in a new issue