Made dictionary inline, changed text on ended auctions to say ended, some silliness.

This commit is contained in:
= 2020-09-04 23:27:56 +10:00
parent 83bdd72bfe
commit e486bce6de
3 changed files with 33 additions and 24 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@ BuypeebApp.exe
bin/ bin/
obj/ obj/
out/ out/
yahoo.html yahoo.html
.vs/

View File

@ -250,18 +250,20 @@ namespace Buypeeb {
this.selectionViewBox.Sensitive = item.ready; this.selectionViewBox.Sensitive = item.ready;
infobox.Visible = true; infobox.Visible = true;
var info = new Dictionary<string, string>(); var info = new Dictionary<string, string>
info.Add("Name", item.name); {
info.Add("YahooName", item.originalName); { "Name", item.name },
info.Add("Price", item.PriceJPY()); { "YahooName", item.originalName },
info.Add("PriceAUD", item.PriceAUD()); { "Price", item.PriceJPY() },
info.Add("Ending", "..."); { "PriceAUD", item.PriceAUD() },
info.Add("Bids", $"{item.bids}"); { "Ending", "..." },
info.Add("BuyItNow", item.winPrice == 0 ? "No" : $"¥{item.PriceJPY(true)} (${item.PriceAUD(true)})"); { "Bids", $"{item.bids}" },
info.Add("AutoExtension", item.autoExtension ? "Yes" : "No"); { "BuyItNow", item.winPrice == 0 ? "No" : $"¥{item.PriceJPY(true)} (${item.PriceAUD(true)})" },
info.Add("LastUpdated", "Last updated: heeeenlo"); { "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}"); var l = (Label)this.builder.GetObject($"LabelSelected{row.Key}");
l.Text = row.Value; l.Text = row.Value;
} }
@ -487,17 +489,23 @@ namespace Buypeeb {
YahooAuctionsItem item = (YahooAuctionsItem)model.GetValue(iter, 0); YahooAuctionsItem item = (YahooAuctionsItem)model.GetValue(iter, 0);
string ending = ""; string ending = "";
if (item.ready) { if (item.ready) {
var now = DateTime.Now; if (!item.available) {
var end = item.endDate.ToLocalTime(); ending = "Ended";
// TODO: should we show the year if the auction ends next year? 0uo } else {
if (end.DayOfYear != now.DayOfYear) { var now = DateTime.Now;
// the auction isn't ending today, so we should show the day it's ending on for clarity var end = item.endDate.ToLocalTime();
ending += end.ToString("MMM d "); // TODO: should we show the year if the auction ends next year? 0uo
} if (end.DayOfYear != now.DayOfYear)
ending += end.ToString("HH:mm"); {
if (this.settings.displaySecondsInList) { // the auction isn't ending today, so we should show the day it's ending on for clarity
// add the seconds on to the end ending += end.ToString("MMM d ");
ending += end.ToString(":ss"); }
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 : "..."; (cell as Gtk.CellRendererText).Text = item.ready ? ending : "...";

View File

@ -355,7 +355,7 @@
<object class="GtkLabel" id="LabelSelectedName"> <object class="GtkLabel" id="LabelSelectedName">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">precious peebus polytonal player</property> <property name="label" translatable="yes">precious peebus polytonal player (paca edition)</property>
<property name="justify">center</property> <property name="justify">center</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="ellipsize">end</property> <property name="ellipsize">end</property>