Compare commits
No commits in common. "d04fe8106737836df46c5419ceb21b070ffec8e4" and "c77c2b34f3050e4c78defde6ca4ffc90c2882090" have entirely different histories.
d04fe81067
...
c77c2b34f3
11 changed files with 588 additions and 684 deletions
|
@ -1,15 +0,0 @@
|
|||
using Gtk;
|
||||
|
||||
namespace Buypeeb {
|
||||
public class AboutDialogue : AboutDialog {
|
||||
public AboutDialogue() : this(new Builder("about.glade")) { }
|
||||
|
||||
private AboutDialogue(Builder builder) : base(builder.GetObject("DialogueAbout").Handle) {
|
||||
builder.Autoconnect(this);
|
||||
}
|
||||
|
||||
public void ButtonCloseClicked(object sender, ResponseArgs args) {
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,9 @@ using Gtk;
|
|||
|
||||
namespace Buypeeb {
|
||||
internal class AddItemDialogue : Dialog {
|
||||
public Entry entryURL { get; }
|
||||
public Entry entryName { get; }
|
||||
|
||||
public AddItemDialogue() : this(new Builder("add.glade")) { }
|
||||
|
||||
private AddItemDialogue(Builder builder) : base(builder.GetObject("DialogueAdd").Handle) {
|
||||
|
@ -12,9 +15,6 @@ namespace Buypeeb {
|
|||
DeleteEvent += Window_Shutdown;
|
||||
}
|
||||
|
||||
public Entry entryURL { get; }
|
||||
public Entry entryName { get; }
|
||||
|
||||
private static void Window_Shutdown(object sender, DeleteEventArgs args) {
|
||||
Application.Quit();
|
||||
}
|
||||
|
|
235
MainWindow.cs
235
MainWindow.cs
|
@ -24,7 +24,6 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
|
@ -40,28 +39,65 @@ using Timeout = GLib.Timeout;
|
|||
namespace Buypeeb {
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
internal class MainWindow : Window {
|
||||
// ...to here.
|
||||
|
||||
private static readonly SemaphoreSlim TaskLimit = new(6);
|
||||
private readonly Builder builder;
|
||||
private readonly Label endingLabel;
|
||||
private readonly Dictionary<string, CheckButton> filterChecks = new();
|
||||
private readonly HttpClient httpClient;
|
||||
private readonly string location;
|
||||
private readonly JsonSerializerOptions jsonOptions;
|
||||
|
||||
private readonly ListStore items;
|
||||
private Settings settings;
|
||||
private readonly TreeView itemTreeView;
|
||||
private readonly JsonSerializerOptions jsonOptions;
|
||||
private readonly string location;
|
||||
private readonly SearchEntry searchEntry;
|
||||
private readonly Builder builder;
|
||||
|
||||
// TODO: whenever we get something from the builder, cache it for later
|
||||
// that way we don't need to constantly do "builder.GetObject"s
|
||||
// when that is done, you can use the cache array to replace everything from here...
|
||||
|
||||
private readonly Box selectionViewBox;
|
||||
private readonly Queue<string> updateQueue = new();
|
||||
private readonly Label endingLabel;
|
||||
private bool queueActive;
|
||||
private Settings settings;
|
||||
private readonly SearchEntry searchEntry;
|
||||
private readonly Dictionary<string, CheckButton> filterChecks = new Dictionary<string, CheckButton>();
|
||||
|
||||
// ...to here.
|
||||
|
||||
private static readonly SemaphoreSlim TaskLimit = new SemaphoreSlim(6);
|
||||
private readonly Queue<string> updateQueue = new Queue<string>();
|
||||
|
||||
private IEnumerable<YahooAuctionsItem> filterQuery =>
|
||||
// father forgive me for i have lynned
|
||||
from item in settings.watchlist.Values.ToList()
|
||||
where (item.favourite != filterChecks["Favourites"].Active ||
|
||||
item.favourite == filterChecks["NonFavourites"].Active) &&
|
||||
(item.Available != filterChecks["Active"].Active ||
|
||||
item.Available == filterChecks["Ended"].Active) &&
|
||||
(item.endingToday != filterChecks["EndingToday"].Active ||
|
||||
item.endingToday == filterChecks["EndingAfterToday"].Active) &&
|
||||
(item.hasWinPrice != filterChecks["WithWinPrice"].Active ||
|
||||
item.hasWinPrice == filterChecks["WithNoWinPrice"].Active) &&
|
||||
(string.IsNullOrWhiteSpace(searchEntry.Text) ||
|
||||
item.name.ToLower().Contains(searchEntry.Text.ToLower()) ||
|
||||
item.originalName.ToLower().Contains(searchEntry.Text.ToLower()))
|
||||
select item;
|
||||
|
||||
private IEnumerable<YahooAuctionsItem> outdatedItemQuery =>
|
||||
// only returns items that meet all of the following:
|
||||
// - marked as "ready", as in, they aren't in the process of updating
|
||||
// - not updated since the interval
|
||||
// - hasn't already ended
|
||||
from item in settings.watchlist.Values.ToList()
|
||||
where item.Ready && settings.ItemNotUpdatedSinceInterval(item) && item.endDate.CompareTo(DateTime.UtcNow) > 0
|
||||
select item;
|
||||
|
||||
private YahooAuctionsItem selectedItem {
|
||||
get {
|
||||
if (itemTreeView.Selection.CountSelectedRows() == 0) {
|
||||
// avoids incurring the wrath of Gtk-CRITICAL **
|
||||
return null;
|
||||
}
|
||||
|
||||
itemTreeView.Selection.GetSelected(out var iter);
|
||||
return (YahooAuctionsItem) itemTreeView.Model.GetValue(iter, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public MainWindow() : this(new Builder("main.glade")) {
|
||||
}
|
||||
|
@ -72,20 +108,16 @@ namespace Buypeeb {
|
|||
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All),
|
||||
};
|
||||
|
||||
if (Environment.OSVersion.Platform ==
|
||||
PlatformID.Win32NT) // C:\Users\Beebus\AppData\Roaming\Lynnear Software\buypeeb
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
|
||||
// C:\Users\Beebus\AppData\Roaming\Lynnear Software\buypeeb
|
||||
location = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
"Lynnear Software", "buypeeb");
|
||||
} else // ~/.config/Lynnear Software/buypeeb
|
||||
{
|
||||
} else {
|
||||
// ~/.config/Lynnear Software/buypeeb
|
||||
location = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config",
|
||||
"Lynnear Software", "buypeeb");
|
||||
}
|
||||
|
||||
// initialise http client
|
||||
httpClient = new HttpClient();
|
||||
|
||||
var userdata = System.IO.Path.Combine(location, "userdata.json");
|
||||
if (File.Exists(userdata)) {
|
||||
try {
|
||||
|
@ -156,43 +188,6 @@ namespace Buypeeb {
|
|||
DeleteEvent += WindowShutdown;
|
||||
}
|
||||
|
||||
private IEnumerable<YahooAuctionsItem> filterQuery =>
|
||||
// father forgive me for i have lynned
|
||||
from item in settings.watchlist.Values.ToList()
|
||||
where (item.favourite != filterChecks["Favourites"].Active ||
|
||||
item.favourite == filterChecks["NonFavourites"].Active) &&
|
||||
(item.Available != filterChecks["Active"].Active ||
|
||||
item.Available == filterChecks["Ended"].Active) &&
|
||||
(item.endingToday != filterChecks["EndingToday"].Active ||
|
||||
item.endingToday == filterChecks["EndingAfterToday"].Active) &&
|
||||
(item.hasWinPrice != filterChecks["WithWinPrice"].Active ||
|
||||
item.hasWinPrice == filterChecks["WithNoWinPrice"].Active) &&
|
||||
(string.IsNullOrWhiteSpace(searchEntry.Text) ||
|
||||
item.name.ToLower().Contains(searchEntry.Text.ToLower()) ||
|
||||
item.originalName.ToLower().Contains(searchEntry.Text.ToLower()))
|
||||
select item;
|
||||
|
||||
private IEnumerable<YahooAuctionsItem> outdatedItemQuery =>
|
||||
// only returns items that meet all of the following:
|
||||
// - marked as "ready", as in, they aren't in the process of updating
|
||||
// - not updated since the interval
|
||||
// - hasn't already ended
|
||||
from item in settings.watchlist.Values.ToList()
|
||||
where item.Ready && settings.ItemNotUpdatedSinceInterval(item) && item.endDate.CompareTo(DateTime.UtcNow) > 0
|
||||
select item;
|
||||
|
||||
private YahooAuctionsItem selectedItem {
|
||||
get {
|
||||
if (itemTreeView.Selection.CountSelectedRows() == 0) // avoids incurring the wrath of Gtk-CRITICAL **
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
itemTreeView.Selection.GetSelected(out var iter);
|
||||
return (YahooAuctionsItem) itemTreeView.Model.GetValue(iter, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void WindowShutdown(object sender, DeleteEventArgs args) {
|
||||
SaveSettings();
|
||||
Application.Quit();
|
||||
|
@ -201,7 +196,7 @@ namespace Buypeeb {
|
|||
// general behaviour
|
||||
|
||||
/// <summary>
|
||||
/// gets the path and iter for a given item id.
|
||||
/// gets the path and iter for a given item id.
|
||||
/// </summary>
|
||||
/// <param name="id">the item id to find in the treeview</param>
|
||||
/// <returns>a tuple of (TreePath, TreeIter)</returns>
|
||||
|
@ -224,7 +219,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// saves the settings to userdata.json.
|
||||
/// saves the settings to userdata.json.
|
||||
/// </summary>
|
||||
private void SaveSettings() {
|
||||
var j = JsonSerializer.Serialize(settings, jsonOptions);
|
||||
|
@ -239,10 +234,10 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// updates the item with the given id. this method blocks and is intended to be run from a task.
|
||||
/// updates the item with the given id. this method blocks and is intended to be run from a task.
|
||||
/// </summary>
|
||||
/// <param name="id">the id of the item to update</param>
|
||||
private async void UpdateThread(string id) {
|
||||
private void UpdateThread(string id) {
|
||||
var item = settings.watchlist[id];
|
||||
// Console.WriteLine($"Updating {id}...");
|
||||
// set item.ready to false to show that it's still being updated
|
||||
|
@ -258,13 +253,18 @@ namespace Buypeeb {
|
|||
}
|
||||
});
|
||||
|
||||
try {
|
||||
item.Update(await httpClient.GetStringAsync(item.url));
|
||||
} catch (HttpRequestException e) {
|
||||
if (e.StatusCode == HttpStatusCode.NotFound) {
|
||||
item.AuctionEnded();
|
||||
} else {
|
||||
Console.WriteLine($"Failed to update item ${id}! Status code ${e.StatusCode}: ${e.Message}");
|
||||
using (var client = new WebClient()) {
|
||||
// TODO: download should have timeout
|
||||
try {
|
||||
// item.Update(client.DownloadString("http://10.0.0.10/poop"));
|
||||
item.Update(client.DownloadString(item.url));
|
||||
} catch (WebException e) {
|
||||
if (((HttpWebResponse) e.Response).StatusCode == HttpStatusCode.NotFound) {
|
||||
// the auction has ended (or otherwise been removed)
|
||||
item.AuctionEnded();
|
||||
} else {
|
||||
Console.WriteLine($"Failed to update item ${id}!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// processes the update queue. this is a blocking function.
|
||||
/// processes the update queue. this is a blocking function.
|
||||
/// </summary>
|
||||
private void ProcessUpdateQueue() {
|
||||
queueActive = true;
|
||||
|
@ -297,7 +297,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// updates an item with the given id with a new task.
|
||||
/// updates an item with the given id with a new task.
|
||||
/// </summary>
|
||||
/// <param name="id">the id of the task to update</param>
|
||||
/// <param name="renderListWhenDone">whether or not to call this.RenderList() after updating the item</param>
|
||||
|
@ -319,8 +319,8 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// add every item in the watchlist to the update queue. if the update queue is already being processed
|
||||
/// (this.queueActive), this will do nothing.
|
||||
/// add every item in the watchlist to the update queue. if the update queue is already being processed
|
||||
/// (this.queueActive), this will do nothing.
|
||||
/// </summary>
|
||||
private void UpdateItems() {
|
||||
if (queueActive) {
|
||||
|
@ -347,7 +347,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// updates the selection view, displaying the id, name, etc. for the currently selected item.
|
||||
/// updates the selection view, displaying the id, name, etc. for the currently selected item.
|
||||
/// </summary>
|
||||
private void UpdateSelectionView() {
|
||||
// get the currently selected item
|
||||
|
@ -397,7 +397,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// opens a URL in the user's browser.
|
||||
/// opens a URL in the user's browser.
|
||||
/// </summary>
|
||||
/// <param name="url">the url to open</param>
|
||||
private static void OpenUrl(string url) {
|
||||
|
@ -409,25 +409,25 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// a simple MessageDialog constructor.
|
||||
/// a simple MessageDialog constructor.
|
||||
/// </summary>
|
||||
/// <param name="message">the MessageDialog's format</param>
|
||||
/// <param name="buttonsType">the MessageDialog's bt</param>
|
||||
/// <returns></returns>
|
||||
private MessageDialog MsgBox(string message, ButtonsType buttonsType = ButtonsType.OkCancel) {
|
||||
var md = new MessageDialog(
|
||||
this,
|
||||
DialogFlags.DestroyWithParent | DialogFlags.Modal,
|
||||
MessageType.Question,
|
||||
buttonsType,
|
||||
message
|
||||
parent_window: this,
|
||||
flags: DialogFlags.DestroyWithParent | DialogFlags.Modal,
|
||||
type: MessageType.Question,
|
||||
bt: buttonsType,
|
||||
format: message
|
||||
) {KeepAbove = true, Resizable = false, FocusOnMap = true, Title = "Buypeeb"};
|
||||
|
||||
return md;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// show a simple entry dialogue that allows the user to enter text and either cancel or submit it.
|
||||
/// show a simple entry dialogue that allows the user to enter text and either cancel or submit it.
|
||||
/// </summary>
|
||||
/// <param name="title">the title of the entry dialogue</param>
|
||||
/// <param name="message">the prompt that should be presented to the user</param>
|
||||
|
@ -437,9 +437,9 @@ namespace Buypeeb {
|
|||
string title = "Buypeeb", string message = "Hi there!", string prefill = null
|
||||
) {
|
||||
var ed = new Dialog(
|
||||
title,
|
||||
this,
|
||||
DialogFlags.DestroyWithParent | DialogFlags.Modal,
|
||||
title: title,
|
||||
parent: this,
|
||||
flags: DialogFlags.DestroyWithParent | DialogFlags.Modal,
|
||||
/* button_data: */ "Cancel", ResponseType.Cancel, "OK", ResponseType.Ok
|
||||
) {DefaultResponse = ResponseType.Ok, KeepAbove = true};
|
||||
|
||||
|
@ -470,7 +470,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// gets the sort type selected by the user - "NameDescending", "EndingAscending", etc.
|
||||
/// gets the sort type selected by the user - "NameDescending", "EndingAscending", etc.
|
||||
/// </summary>
|
||||
/// <returns>the id of the radiobutton without the "Sort" prefix</returns>
|
||||
private string GetSortType() {
|
||||
|
@ -487,8 +487,8 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// clears the treeview's liststore and adds everything in the watchlist to it, obeying sort order. tries to
|
||||
/// reselect the item that the user had selected, if possible.
|
||||
/// clears the treeview's liststore and adds everything in the watchlist to it, obeying sort order. tries to
|
||||
/// reselect the item that the user had selected, if possible.
|
||||
/// </summary>
|
||||
private void RenderList() {
|
||||
string id = null;
|
||||
|
@ -498,15 +498,21 @@ namespace Buypeeb {
|
|||
|
||||
items.Clear();
|
||||
var values = settings.watchlist.Values;
|
||||
IOrderedEnumerable<YahooAuctionsItem> sorted;
|
||||
var type = GetSortType();
|
||||
var sorted = type switch {
|
||||
"NameDescending" => values.OrderByDescending(item => item.name),
|
||||
"NameAscending" => values.OrderBy(item => item.name),
|
||||
"PriceDescending" => values.OrderByDescending(item => item.Price),
|
||||
"PriceAscending" => values.OrderBy(item => item.Price),
|
||||
"EndingDescending" => values.OrderByDescending(item => item.endDate),
|
||||
_ => values.OrderBy(item => item.endDate),
|
||||
};
|
||||
if (type == "NameDescending") {
|
||||
sorted = values.OrderByDescending(item => item.name);
|
||||
} else if (type == "NameAscending") {
|
||||
sorted = values.OrderBy(item => item.name);
|
||||
} else if (type == "PriceDescending") {
|
||||
sorted = values.OrderByDescending(item => item.Price);
|
||||
} else if (type == "PriceAscending") {
|
||||
sorted = values.OrderBy(item => item.Price);
|
||||
} else if (type == "EndingDescending") {
|
||||
sorted = values.OrderByDescending(item => item.endDate);
|
||||
} else {
|
||||
sorted = values.OrderBy(item => item.endDate);
|
||||
}
|
||||
|
||||
if (settings.showFavouritesAtTopOfList) {
|
||||
foreach (var item in sorted.Where(item => item.favourite)) {
|
||||
|
@ -597,9 +603,9 @@ namespace Buypeeb {
|
|||
|
||||
private void ButtonOpenClicked(object sender, EventArgs a) {
|
||||
var od = new FileChooserDialog(
|
||||
"Open userdata.json",
|
||||
this,
|
||||
FileChooserAction.Open,
|
||||
title: "Open userdata.json",
|
||||
parent: this,
|
||||
action: FileChooserAction.Open,
|
||||
"Cancel", ResponseType.Cancel, "Open", ResponseType.Accept
|
||||
);
|
||||
|
||||
|
@ -631,9 +637,9 @@ namespace Buypeeb {
|
|||
|
||||
private void ButtonSaveAsClicked(object sender, EventArgs a) {
|
||||
var sd = new FileChooserDialog(
|
||||
"Save userdata.json",
|
||||
this,
|
||||
FileChooserAction.Save,
|
||||
title: "Save userdata.json",
|
||||
parent: this,
|
||||
action: FileChooserAction.Save,
|
||||
"Cancel", ResponseType.Cancel, "Save", ResponseType.Accept
|
||||
) {CurrentName = "userdata.json"};
|
||||
|
||||
|
@ -670,9 +676,9 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
var sd = new FileChooserDialog(
|
||||
"Export watchlist as CSV",
|
||||
this,
|
||||
FileChooserAction.Save,
|
||||
title: "Export watchlist as CSV",
|
||||
parent: this,
|
||||
action: FileChooserAction.Save,
|
||||
"Cancel", ResponseType.Cancel, "Save", ResponseType.Accept
|
||||
) {CurrentName = "buypeeb.csv"};
|
||||
|
||||
|
@ -747,7 +753,9 @@ namespace Buypeeb {
|
|||
private void ButtonSelectedRemoveClicked(object sender, EventArgs a) {
|
||||
var item = selectedItem;
|
||||
|
||||
var md = MsgBox($"Are you sure you want to remove the item \"{item.name}\"?");
|
||||
var md = MsgBox(
|
||||
$"Are you sure you want to remove the item \"{item.name}\"?"
|
||||
);
|
||||
|
||||
var response = (ResponseType) md.Run();
|
||||
md.Dispose();
|
||||
|
@ -807,8 +815,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
private void TextViewSelectedNotesFocusOut(object sender, FocusOutEventArgs args) {
|
||||
// the "save" button does nothing, however, when you click the save button, you transfer focus to it, firing this
|
||||
// event!
|
||||
// the "save" button does nothing, however, when you click the save button, you transfer focus to it, firing this event!
|
||||
// how very sneaky
|
||||
var noteBuffer = (TextBuffer) builder.GetObject("TextBufferSelectedNotes");
|
||||
if (selectedItem != null) {
|
||||
|
@ -827,7 +834,7 @@ namespace Buypeeb {
|
|||
// timers
|
||||
|
||||
/// <summary>
|
||||
/// updates the end time displayed in the selection box. runs every second to update the countdown timer.
|
||||
/// updates the end time displayed in the selection box. runs every second to update the countdown timer.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
private bool UpdateSelectionEndTime() {
|
||||
|
@ -863,7 +870,7 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// updates all items that need updating. runs every ten seconds.
|
||||
/// updates all items that need updating. runs every ten seconds.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
private bool AutoUpdateItems() {
|
||||
|
@ -958,10 +965,10 @@ namespace Buypeeb {
|
|||
// first, check to see if any filters are set that would exclude everything, such as hiding both active and ended auctions
|
||||
// if so, there's no need to run the more expensive linq query
|
||||
if (
|
||||
Filtered("Favourites") && Filtered("NonFavourites") ||
|
||||
Filtered("Active") && Filtered("Ended") ||
|
||||
Filtered("EndingToday") && Filtered("EndingAfterToday") ||
|
||||
Filtered("WithWinPrice") && Filtered("WithNoWinPrice")
|
||||
(Filtered("Favourites") && Filtered("NonFavourites")) ||
|
||||
(Filtered("Active") && Filtered("Ended")) ||
|
||||
(Filtered("EndingToday") && Filtered("EndingAfterToday")) ||
|
||||
(Filtered("WithWinPrice") && Filtered("WithNoWinPrice"))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
|
12
Settings.cs
12
Settings.cs
|
@ -3,12 +3,6 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Buypeeb {
|
||||
internal class Settings {
|
||||
public Settings() {
|
||||
// create a new watchlist from an empty dictionary if it's null, which should only happen if either this is the
|
||||
// first time the program has been run, or there's something wrong with userdata.json
|
||||
watchlist ??= new Dictionary<string, YahooAuctionsItem>();
|
||||
}
|
||||
|
||||
public int updateInterval { get; set; } = 10 * 60;
|
||||
public int favouriteUpdateInterval { get; set; } = 5 * 60;
|
||||
public int updateIntervalCritical { get; set; } = 60;
|
||||
|
@ -19,6 +13,12 @@ namespace Buypeeb {
|
|||
|
||||
public Dictionary<string, YahooAuctionsItem> watchlist { get; set; }
|
||||
|
||||
public Settings() {
|
||||
// create a new watchlist from an empty dictionary if it's null, which should only happen if either this is the
|
||||
// first time the program has been run, or there's something wrong with userdata.json
|
||||
watchlist ??= new Dictionary<string, YahooAuctionsItem>();
|
||||
}
|
||||
|
||||
public YahooAuctionsItem Watch(string url, string name) {
|
||||
var id = BuypeebApp.IDFromURL(url);
|
||||
Console.WriteLine(id);
|
||||
|
|
|
@ -7,19 +7,19 @@ using Gtk;
|
|||
|
||||
namespace Buypeeb {
|
||||
internal class SettingsWindow : Window {
|
||||
private readonly Builder builder;
|
||||
private readonly List<Switch> generalSwitches = new();
|
||||
|
||||
private readonly List<string> generalSwitchNames =
|
||||
new() {"ShowSecondsInListView", "Autosave", "ShowFavouritesAtTopOfList"};
|
||||
|
||||
private readonly List<Switch> generalSwitches = new List<Switch>();
|
||||
private readonly List<Entry> updateIntervalEntries = new List<Entry>();
|
||||
private readonly Settings settings;
|
||||
private readonly List<Entry> updateIntervalEntries = new();
|
||||
private readonly Builder builder;
|
||||
|
||||
private readonly List<string> updateIntervalEntryNames = new()
|
||||
private readonly List<string> generalSwitchNames = new List<string>
|
||||
{"ShowSecondsInListView", "Autosave", "ShowFavouritesAtTopOfList"};
|
||||
|
||||
private readonly List<string> updateIntervalEntryNames = new List<string>
|
||||
{"UpdateInterval", "UpdateIntervalCritical", "FavouriteUpdateInterval", "FavouriteUpdateIntervalCritical"};
|
||||
|
||||
public SettingsWindow(Settings settings) : this(new Builder("settings.glade"), settings) { }
|
||||
public SettingsWindow(Settings settings) : this(new Builder("settings.glade"), settings) {
|
||||
}
|
||||
|
||||
private SettingsWindow(Builder builder, Settings settings) : base(builder.GetObject("WindowSettings").Handle) {
|
||||
Title = "Buypeeb - Settings";
|
||||
|
@ -41,11 +41,11 @@ namespace Buypeeb {
|
|||
}
|
||||
|
||||
private T GetSetting<T>(string property) {
|
||||
return (T) settings.GetType().GetProperty(property)?.GetValue(settings, null);
|
||||
return (T) settings.GetType().GetProperty(property).GetValue(settings, null);
|
||||
}
|
||||
|
||||
private void SetSetting<T>(string property, T value) {
|
||||
settings.GetType().GetProperty(property)?.SetValue(settings, value);
|
||||
settings.GetType().GetProperty(property).SetValue(settings, value);
|
||||
}
|
||||
|
||||
private string PropertyName(string property) {
|
||||
|
@ -93,11 +93,5 @@ namespace Buypeeb {
|
|||
private void ButtonCancelClicked(object sender, EventArgs args) {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
private void ButtonAboutClicked(object sender, EventArgs args) {
|
||||
var win = new AboutDialogue();
|
||||
Application.AddWindow(win);
|
||||
win.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
@ -10,25 +9,6 @@ using CsvHelper.Configuration.Attributes;
|
|||
|
||||
namespace Buypeeb {
|
||||
internal class YahooAuctionsItem {
|
||||
public bool AutoExtension;
|
||||
public bool Available;
|
||||
public int Bids;
|
||||
public DateTime LastUpdated;
|
||||
public int Price;
|
||||
public bool Ready;
|
||||
public DateTime StartDate;
|
||||
public bool UpdateFailed;
|
||||
public int WinPrice;
|
||||
|
||||
public YahooAuctionsItem(string id, string name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public YahooAuctionsItem() {
|
||||
// parameterless constructor for deserialisation
|
||||
}
|
||||
|
||||
[JsonIgnore] public string url => $"https://page.auctions.yahoo.co.jp/jp/auction/{id}";
|
||||
|
||||
[JsonIgnore] public string buyeeUrl => $"https://buyee.jp/item/yahoo/auction/{id}";
|
||||
|
@ -45,13 +25,21 @@ namespace Buypeeb {
|
|||
// you also don't want to private any of the setters, which will have a similar effect.
|
||||
[Ignore] public string id { get; set; }
|
||||
public string name { get; set; }
|
||||
public int Price;
|
||||
public int WinPrice;
|
||||
public string originalName { get; set; }
|
||||
public string notes { get; set; }
|
||||
public bool favourite { get; set; }
|
||||
public DateTime StartDate;
|
||||
public DateTime endDate { get; set; }
|
||||
public DateTime LastUpdated;
|
||||
public int Bids;
|
||||
public bool AutoExtension;
|
||||
public bool Ready;
|
||||
public bool Available;
|
||||
public bool UpdateFailed;
|
||||
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Ignore, JsonIgnore]
|
||||
public bool updatedRecently {
|
||||
get {
|
||||
var later = LastUpdated.AddSeconds(15);
|
||||
|
@ -63,18 +51,27 @@ namespace Buypeeb {
|
|||
|
||||
[JsonIgnore] public string winPriceJpy => $"¥{WinPrice}";
|
||||
|
||||
[Ignore] [JsonIgnore] public string priceAud => $"${Price / 75.0:f2}";
|
||||
[Ignore, JsonIgnore] public string priceAud => $"${(Price / 75.0):f2}";
|
||||
|
||||
[Ignore] [JsonIgnore] public string winPriceAud => $"${WinPrice / 75.0:f2}";
|
||||
[Ignore, JsonIgnore] public string winPriceAud => $"${(WinPrice / 75.0):f2}";
|
||||
|
||||
[Ignore] [JsonIgnore] public bool endingToday => endDate.DayOfYear == DateTime.UtcNow.DayOfYear;
|
||||
[Ignore, JsonIgnore] public bool endingToday => endDate.DayOfYear == DateTime.UtcNow.DayOfYear;
|
||||
|
||||
[Ignore] [JsonIgnore] public bool hasWinPrice => WinPrice != 0;
|
||||
[Ignore, JsonIgnore] public bool hasWinPrice => WinPrice != 0;
|
||||
|
||||
[Ignore] [JsonIgnore] public bool endingSoon => DateTime.Compare(DateTime.UtcNow.AddMinutes(10), endDate) > 0;
|
||||
[Ignore, JsonIgnore] public bool endingSoon => DateTime.Compare(DateTime.UtcNow.AddMinutes(10), endDate) > 0;
|
||||
|
||||
private bool success { get; set; } // TODO: custom setter that throws an exception if set to false or something idk
|
||||
|
||||
public YahooAuctionsItem(string id, string name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public YahooAuctionsItem() {
|
||||
// parameterless constructor for deserialisation
|
||||
}
|
||||
|
||||
public void AuctionEnded() {
|
||||
// the page 404'd. this probably means that the auction has ended, and the page has been removed.
|
||||
Available = false;
|
||||
|
@ -84,8 +81,8 @@ namespace Buypeeb {
|
|||
|
||||
public void Update(string html) {
|
||||
// TODO: handle all the parsing errors and weird interpretation that could possibly happen here
|
||||
// TODO: maybe compile and match the regex in another thread
|
||||
var rx = new Regex(@"var pageData ?= ?(\{.+?\});", RegexOptions.Singleline);
|
||||
var rx = new Regex(@"var pageData ?= ?(\{.+?\});",
|
||||
RegexOptions.Singleline); // TODO: maybe compile and match the regex in another thread
|
||||
var m = rx.Match(html);
|
||||
|
||||
Dictionary<string, Dictionary<string, string>> jFull;
|
||||
|
@ -101,7 +98,6 @@ namespace Buypeeb {
|
|||
var jst = TimeZoneInfo.CreateCustomTimeZone("JST", new TimeSpan(9, 0, 0), "Japan Standard Time",
|
||||
"Japan Standard Time");
|
||||
|
||||
Debug.Assert(jFull != null, nameof(jFull) + " != null");
|
||||
var j = jFull["items"];
|
||||
originalName = j["productName"];
|
||||
StartDate = TimeZoneInfo.ConvertTimeToUtc(
|
||||
|
@ -126,7 +122,7 @@ namespace Buypeeb {
|
|||
// whether or not it's equal to "ari" (japanese for "yes").
|
||||
rx = new Regex(@"自動延長.+\n.+>(.+)<");
|
||||
m = rx.Match(html);
|
||||
AutoExtension = m.Groups[1].Value == "あり";
|
||||
AutoExtension = (m.Groups[1].Value == "あり");
|
||||
|
||||
UpdateFailed = false;
|
||||
}
|
||||
|
|
|
@ -1,31 +1,22 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp5.0</TargetFramework>
|
||||
<StartupObject>Buypeeb.BuypeebApp</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp5.0</TargetFramework>
|
||||
<StartupObject>Buypeeb.BuypeebApp</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="**\*.glade"/>
|
||||
<EmbeddedResource Include="**\*.glade">
|
||||
<LogicalName>%(Filename)%(Extension)</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<None Remove="yahoo.html"/>
|
||||
<EmbeddedResource Remove="obj\**"/>
|
||||
<None Remove="obj\**"/>
|
||||
<EmbeddedResource Remove="out\**"/>
|
||||
<None Remove="out\**"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="**\*.glade" />
|
||||
<EmbeddedResource Include="**\*.glade">
|
||||
<LogicalName>%(Filename)%(Extension)</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<None Remove="yahoo.html" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CsvHelper" Version="27.1.1"/>
|
||||
<PackageReference Include="GtkSharp" Version="3.24.24.34"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="obj\**"/>
|
||||
<Compile Remove="out\**"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CsvHelper" Version="27.1.0" />
|
||||
<PackageReference Include="GtkSharp" Version="3.24.24.34" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkAboutDialog" id="DialogueAbout">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="title" translatable="yes">About Buypeeb</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window-position">center-on-parent</property>
|
||||
<property name="destroy-with-parent">True</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<property name="program-name">Buypeeb</property>
|
||||
<property name="version">1.0</property>
|
||||
<property name="website">https://git.bune.city/lynnesbian/buypeeb-cs</property>
|
||||
<property name="authors">Lynnesbian</property>
|
||||
<property name="logo-icon-name">dialog-information</property>
|
||||
<property name="license-type">gpl-3-0-only</property>
|
||||
<signal name="response" handler="ButtonCloseClicked" swapped="no"/>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<property name="width-request">-1</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
73
ui/add.glade
73
ui/add.glade
|
@ -1,34 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<!-- Generated with glade 3.22.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<object class="GtkDialog" id="DialogueAdd">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window-position">center-on-parent</property>
|
||||
<property name="default-width">320</property>
|
||||
<property name="destroy-with-parent">True</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="default_width">320</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="gravity">center</property>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-start">5</property>
|
||||
<property name="margin-end">5</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_start">5</property>
|
||||
<property name="margin_end">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="layout-style">end</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="ButtonAddCancel">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
|
@ -40,10 +43,10 @@
|
|||
<object class="GtkButton" id="ButtonAddOK">
|
||||
<property name="label" translatable="yes">OK</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="can-default">True</property>
|
||||
<property name="has-default">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="has_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
|
@ -61,15 +64,15 @@
|
|||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="label" translatable="yes">Add item</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
|
@ -85,7 +88,7 @@
|
|||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Enter the URL of the item you want to add.</property>
|
||||
</object>
|
||||
|
@ -98,12 +101,12 @@
|
|||
<child>
|
||||
<object class="GtkEntry" id="EntryAddURL">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="activates-default">True</property>
|
||||
<property name="placeholder-text" translatable="yes">URL</property>
|
||||
<property name="input-purpose">url</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">10</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="placeholder_text" translatable="yes">URL</property>
|
||||
<property name="input_purpose">url</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -114,7 +117,7 @@
|
|||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">You may also enter a custom name below.</property>
|
||||
</object>
|
||||
|
@ -127,10 +130,10 @@
|
|||
<child>
|
||||
<object class="GtkEntry" id="EntryAddName">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="activates-default">True</property>
|
||||
<property name="placeholder-text" translatable="yes">Name (optional)</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="placeholder_text" translatable="yes">Name (optional)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
511
ui/main.glade
511
ui/main.glade
File diff suppressed because it is too large
Load diff
|
@ -1,302 +1,294 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<!-- Generated with glade 3.22.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkWindow" id="WindowSettings">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="default-width">440</property>
|
||||
<property name="default_width">440</property>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkNotebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<!-- n-columns=3 n-rows=3 -->
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="row-spacing">5</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="row_spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Show seconds in list view</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="SwitchShowSecondsInListView">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Autosave</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="SwitchAutosave">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Show favourites at top of list</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="SwitchShowFavouritesAtTopOfList">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">General</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-fill">False</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<!-- n-columns=3 n-rows=4 -->
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="column-spacing">3</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">20</property>
|
||||
<property name="column_spacing">3</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Default</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Items ending soon</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Favourite items</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Favourite items ending soon</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">seconds</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">seconds</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">seconds</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">seconds</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="EntryUpdateInterval">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-bottom">2</property>
|
||||
<property name="max-length">3</property>
|
||||
<property name="width-chars">5</property>
|
||||
<property name="input-purpose">number</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="margin_bottom">2</property>
|
||||
<property name="max_length">3</property>
|
||||
<property name="width_chars">5</property>
|
||||
<property name="input_purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="EntryUpdateIntervalCritical">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-bottom">2</property>
|
||||
<property name="max-length">3</property>
|
||||
<property name="width-chars">5</property>
|
||||
<property name="input-purpose">number</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="margin_bottom">2</property>
|
||||
<property name="max_length">3</property>
|
||||
<property name="width_chars">5</property>
|
||||
<property name="input_purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="EntryFavouriteUpdateInterval">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-bottom">2</property>
|
||||
<property name="max-length">3</property>
|
||||
<property name="width-chars">5</property>
|
||||
<property name="input-purpose">number</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="margin_bottom">2</property>
|
||||
<property name="max_length">3</property>
|
||||
<property name="width_chars">5</property>
|
||||
<property name="input_purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="EntryFavouriteUpdateIntervalCritical">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-bottom">2</property>
|
||||
<property name="max-length">3</property>
|
||||
<property name="width-chars">5</property>
|
||||
<property name="input-purpose">number</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="margin_bottom">2</property>
|
||||
<property name="max_length">3</property>
|
||||
<property name="width_chars">5</property>
|
||||
<property name="input_purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -307,12 +299,12 @@
|
|||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Update intervals</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
<property name="tab-fill">False</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -325,15 +317,14 @@
|
|||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">About Buypeeb</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="clicked" handler="ButtonAboutClicked" swapped="no"/>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -345,14 +336,14 @@
|
|||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Save</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="ButtonSaveClicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -360,14 +351,14 @@
|
|||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="ButtonCancelClicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -376,7 +367,7 @@
|
|||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">2</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
Loading…
Reference in a new issue