diff --git a/.gitignore b/.gitignore index dd4e239..bea7283 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ BuypeebApp.exe bin/ obj/ out/ -yahoo.html \ No newline at end of file +yahoo.html +.vs/ \ No newline at end of file diff --git a/MainWindow.cs b/MainWindow.cs index fe78527..a45493e 100755 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -250,18 +250,20 @@ namespace Buypeeb { this.selectionViewBox.Sensitive = item.ready; infobox.Visible = true; - var info = new Dictionary(); - info.Add("Name", item.name); - info.Add("YahooName", item.originalName); - info.Add("Price", item.PriceJPY()); - info.Add("PriceAUD", item.PriceAUD()); - info.Add("Ending", "..."); - info.Add("Bids", $"{item.bids}"); - info.Add("BuyItNow", item.winPrice == 0 ? "No" : $"¥{item.PriceJPY(true)} (${item.PriceAUD(true)})"); - info.Add("AutoExtension", item.autoExtension ? "Yes" : "No"); - info.Add("LastUpdated", "Last updated: heeeenlo"); + var info = new Dictionary + { + { "Name", item.name }, + { "YahooName", item.originalName }, + { "Price", item.PriceJPY() }, + { "PriceAUD", item.PriceAUD() }, + { "Ending", "..." }, + { "Bids", $"{item.bids}" }, + { "BuyItNow", item.winPrice == 0 ? "No" : $"¥{item.PriceJPY(true)} (${item.PriceAUD(true)})" }, + { "AutoExtension", item.autoExtension ? "Yes" : "No" }, + { "LastUpdated", "Last updated: heeeenlo" } + }; - foreach (var row in info) { + foreach (var row in info) { var l = (Label)this.builder.GetObject($"LabelSelected{row.Key}"); l.Text = row.Value; } @@ -487,17 +489,23 @@ namespace Buypeeb { YahooAuctionsItem item = (YahooAuctionsItem)model.GetValue(iter, 0); string ending = ""; if (item.ready) { - var now = DateTime.Now; - var end = item.endDate.ToLocalTime(); - // TODO: should we show the year if the auction ends next year? 0uo - if (end.DayOfYear != now.DayOfYear) { - // the auction isn't ending today, so we should show the day it's ending on for clarity - ending += end.ToString("MMM d "); - } - ending += end.ToString("HH:mm"); - if (this.settings.displaySecondsInList) { - // add the seconds on to the end - ending += end.ToString(":ss"); + if (!item.available) { + ending = "Ended"; + } else { + var now = DateTime.Now; + var end = item.endDate.ToLocalTime(); + // TODO: should we show the year if the auction ends next year? 0uo + if (end.DayOfYear != now.DayOfYear) + { + // the auction isn't ending today, so we should show the day it's ending on for clarity + ending += end.ToString("MMM d "); + } + ending += end.ToString("HH:mm"); + if (this.settings.displaySecondsInList) + { + // add the seconds on to the end + ending += end.ToString(":ss"); + } } } (cell as Gtk.CellRendererText).Text = item.ready ? ending : "..."; diff --git a/ui/main.glade b/ui/main.glade index 9de5837..8ff9364 100644 --- a/ui/main.glade +++ b/ui/main.glade @@ -355,7 +355,7 @@ True False - precious peebus polytonal player + precious peebus polytonal player (paca edition) center True end