Compare commits
11 commits
562b1330c9
...
7bff17c859
Author | SHA1 | Date | |
---|---|---|---|
7bff17c859 | |||
a84e585d21 | |||
bc6d5b4fbb | |||
cc0d452ed1 | |||
409f337b86 | |||
45eba46c8e | |||
faeb2a6334 | |||
b20a2e29a0 | |||
b9b4253a5d | |||
e52cc5d7d8 | |||
341a13e523 |
6 changed files with 292 additions and 134 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@ BuypeebApp.exe
|
||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
out/
|
out/
|
||||||
|
yahoo.html
|
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.insertSpaces": false
|
||||||
|
}
|
65
Listing.cs
65
Listing.cs
|
@ -1,32 +1,75 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Buypeeb {
|
namespace Buypeeb {
|
||||||
class Listing {
|
class Listing {
|
||||||
public string url { get; set; }
|
public string url {
|
||||||
|
get {
|
||||||
|
return $"https://page.auctions.yahoo.co.jp/jp/auction/{this.id}";
|
||||||
|
}
|
||||||
|
}
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
public int price;
|
public int price = 0;
|
||||||
public int win_price;
|
public int win_price;
|
||||||
public string original_name;
|
public string original_name;
|
||||||
public bool favourite { get; set; } = false;
|
public bool favourite { get; set; } = false;
|
||||||
// start_date, end_date
|
// start_date, end_date
|
||||||
public int bids;
|
public int bids;
|
||||||
public bool auto_extension;
|
public bool auto_extension;
|
||||||
|
public bool ready;
|
||||||
|
|
||||||
public Listing(string url, string id, string name) {
|
private bool success { get; set; } // TODO: custom setter that throws an exception if set to false or something idk
|
||||||
this.url = url;
|
|
||||||
|
public Listing(string id, string name) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.ready = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update() {
|
public Listing() {
|
||||||
// use fake values for now
|
// parameterless constructor for deserialisation
|
||||||
var rnd = new Random();
|
}
|
||||||
this.price = rnd.Next(100, 5000);
|
|
||||||
this.bids = rnd.Next(0, 15);
|
public void Update(string html) {
|
||||||
this.name = "testing";
|
var rx = new Regex(@"var pageData ?= ?(\{.+?\});", RegexOptions.Singleline); // TODO: maybe compile and match the regex in another thread
|
||||||
this.original_name = "testing";
|
var m = rx.Match(html);
|
||||||
|
if (m == null) {
|
||||||
|
Console.WriteLine("no sir i don't like it");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, Dictionary<string, string>> j_full;
|
||||||
|
try {
|
||||||
|
// master forgive me, but i must go all out, just this once...
|
||||||
|
j_full = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(m.Groups[1].Value);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
var j = j_full["items"];
|
||||||
|
this.original_name = j["productName"];
|
||||||
|
this.success = int.TryParse(j["price"], out this.price);
|
||||||
|
this.success = int.TryParse(j["winPrice"], out this.win_price);
|
||||||
|
this.success = int.TryParse(j["bids"], out this.bids);
|
||||||
|
|
||||||
|
if (String.IsNullOrWhiteSpace(this.name)) {
|
||||||
|
this.name = this.original_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// as far as i can tell, neither the `pageData` nor the `conf` variables in the html seem to store whether or not the auction uses automatic extension
|
||||||
|
// the `conf` variable *does* store whether or not the auction has the "early end" feature enabled, in the key `earlyed`.
|
||||||
|
// unfortunately, it seems like the only way to get the auto extension info is to scrape the page for the info column that displays the auto ext status
|
||||||
|
// and check whether or not it's equal to "ari" (japanese for "yes").
|
||||||
|
var autoExtensionCheck = new Regex(@"自動延長.+\n.+>(.+)<");
|
||||||
|
m = rx.Match(html);
|
||||||
|
if (m.Groups[1].Value != null) {
|
||||||
|
this.auto_extension = (m.Groups[1].Value == "あり");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string PriceAUD() {
|
public string PriceAUD() {
|
||||||
|
|
204
MainWindow.cs
204
MainWindow.cs
|
@ -18,44 +18,184 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Net;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace Buypeeb {
|
namespace Buypeeb {
|
||||||
enum ItemColumns {
|
public struct ItemColumns {
|
||||||
Name,
|
public const int Name = 0;
|
||||||
PriceYen,
|
public const int PriceYen = 1;
|
||||||
PriceAUD,
|
public const int PriceAUD = 2;
|
||||||
Ending,
|
public const int Ending = 3;
|
||||||
Id
|
public const int Id = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainWindow : Window {
|
class MainWindow : Window {
|
||||||
|
|
||||||
|
private string location;
|
||||||
|
// private Queue<string> statuses;
|
||||||
|
|
||||||
private ListStore items;
|
private ListStore items;
|
||||||
private Settings settings;
|
private Settings settings;
|
||||||
|
private TreeView itemTreeView;
|
||||||
|
private Label statusLabel;
|
||||||
|
|
||||||
|
static SemaphoreSlim tasklimit = new SemaphoreSlim(4);
|
||||||
|
|
||||||
public MainWindow() : this(new Builder("main.glade")) { }
|
public MainWindow() : this(new Builder("main.glade")) { }
|
||||||
|
|
||||||
private MainWindow(Builder builder) : base(builder.GetObject("wndMain").Handle) {
|
private MainWindow(Builder builder) : base(builder.GetObject("wndMain").Handle) {
|
||||||
this.settings = new Settings();
|
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
|
||||||
this.settings.Save();
|
// C:\Users\Beebus\AppData\Roaming\Lynnear Software\buypeeb
|
||||||
this.Title = "Buypeeb";
|
this.location = System.IO.Path.Combine(Environment.ExpandEnvironmentVariables("%APPDATA%"), "Lynnear Software", "buypeeb");
|
||||||
builder.Autoconnect(this);
|
|
||||||
this.items = (ListStore)builder.GetObject("ListItems");
|
|
||||||
this.RenderList();
|
|
||||||
foreach (object[] row in this.items) {
|
|
||||||
Console.WriteLine(row[(int)ItemColumns.Name]);
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// ~/.config/Lynnear Software/buypeeb
|
||||||
|
this.location = System.IO.Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".config", "Lynnear Software", "buypeeb");
|
||||||
|
}
|
||||||
|
|
||||||
|
string userdata = System.IO.Path.Combine(location, "userdata.json");
|
||||||
|
if (File.Exists(userdata)) {
|
||||||
|
try {
|
||||||
|
string j = File.ReadAllText(userdata);
|
||||||
|
this.settings = JsonSerializer.Deserialize<Settings>(j);
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
// ???
|
||||||
|
Console.WriteLine("oops");
|
||||||
|
Application.Quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.settings = new Settings();
|
||||||
|
}
|
||||||
|
this.SaveSettings();
|
||||||
|
this.Title = "Buypeeb";
|
||||||
|
|
||||||
|
builder.Autoconnect(this);
|
||||||
|
|
||||||
|
this.statusLabel = (Label)builder.GetObject("LabelStatus");
|
||||||
|
|
||||||
|
// bind treeview columns to watchlist instead of needing to manually sync its liststore
|
||||||
|
this.itemTreeView = (TreeView)builder.GetObject("TreeViewItems");
|
||||||
|
this.items = new ListStore(typeof(Listing));
|
||||||
|
this.RenderList();
|
||||||
|
|
||||||
|
this.itemTreeView.Model = this.items;
|
||||||
|
TreeCellDataFunc[] funcs = {
|
||||||
|
new TreeCellDataFunc(this.RenderColumnName),
|
||||||
|
new TreeCellDataFunc(this.RenderColumnPriceYen),
|
||||||
|
new TreeCellDataFunc(this.RenderColumnPriceAUD),
|
||||||
|
new TreeCellDataFunc(this.RenderColumnEnding)
|
||||||
|
};
|
||||||
|
|
||||||
|
for (int i = 0; i < this.itemTreeView.Columns.Length; i++) {
|
||||||
|
var c = this.itemTreeView.Columns[i];
|
||||||
|
|
||||||
|
c.SetCellDataFunc(c.Cells[0], funcs[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.UpdateItems();
|
||||||
|
|
||||||
DeleteEvent += Window_Shutdown;
|
DeleteEvent += Window_Shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Shutdown(object sender, DeleteEventArgs args) {
|
private void Window_Shutdown(object sender, DeleteEventArgs args) {
|
||||||
|
SaveSettings();
|
||||||
Application.Quit();
|
Application.Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// general behaviour
|
// general behaviour
|
||||||
|
|
||||||
|
private void SetStatus(string status) {
|
||||||
|
this.statusLabel.Text = status ?? "Buypeeb";
|
||||||
|
}
|
||||||
|
|
||||||
|
private (TreePath path, TreeIter iter) GetRow(string id) {
|
||||||
|
// TODO: surely there's a better way to do this
|
||||||
|
TreeIter iter;
|
||||||
|
this.itemTreeView.Model.GetIterFirst(out iter);
|
||||||
|
|
||||||
|
for (int i = 0; i < this.itemTreeView.Model.IterNChildren(); i++) {
|
||||||
|
var x = (Listing)this.itemTreeView.Model.GetValue(iter, 0);
|
||||||
|
if (x.id == id) {
|
||||||
|
return (this.itemTreeView.Model.GetPath(iter), iter);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.itemTreeView.Model.IterNext(ref iter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"Couldn't find {id}!");
|
||||||
|
return (null, iter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveSettings() {
|
||||||
|
string j = JsonSerializer.Serialize(this.settings);
|
||||||
|
string p = System.IO.Path.Combine(this.location, "userdata.json");
|
||||||
|
Console.WriteLine(j);
|
||||||
|
if (!Directory.Exists(this.location)) {
|
||||||
|
Directory.CreateDirectory(this.location);
|
||||||
|
}
|
||||||
|
if (!File.Exists(p)) {
|
||||||
|
File.CreateText(p);
|
||||||
|
}
|
||||||
|
File.WriteAllText(System.IO.Path.Combine(this.location, "userdata.json"), j);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateThread(string id) {
|
||||||
|
var item = this.settings.watchlist[id];
|
||||||
|
Console.WriteLine($"Updating {id}...");
|
||||||
|
// set item.ready to false to show that it's still being updated
|
||||||
|
// this changes a few behaviours, such as displaying the price as "..." instead of whatever's currently stored
|
||||||
|
item.ready = false;
|
||||||
|
|
||||||
|
Gtk.Application.Invoke(delegate {
|
||||||
|
// TODO: find a way to not have to do this. i think we need to avoid actually modifying the items outside of the main thread :/
|
||||||
|
var pathAndIter = this.GetRow(id);
|
||||||
|
this.items.EmitRowChanged(pathAndIter.path, pathAndIter.iter);
|
||||||
|
});
|
||||||
|
|
||||||
|
using (WebClient client = new WebClient()) {
|
||||||
|
// TODO: download should have timeout
|
||||||
|
item.Update(client.DownloadString(item.url));
|
||||||
|
// item.Update(File.ReadAllText("yahoo.html"));
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk.Application.Invoke(delegate {
|
||||||
|
var pathAndIter = this.GetRow(id);
|
||||||
|
this.items.EmitRowChanged(pathAndIter.path, pathAndIter.iter);
|
||||||
|
});
|
||||||
|
|
||||||
|
item.ready = true;
|
||||||
|
Console.WriteLine($"{id} updated.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateItem(string id) {
|
||||||
|
// don't start a new task if there are more than [tasklimit] tasks currently running
|
||||||
|
// this makes sure we don't make 1000 simultaneous requests to yahoo auctions if there are 1000 items on the watchlist
|
||||||
|
this.settings.watchlist[id].ready = false;
|
||||||
|
tasklimit.Wait();
|
||||||
|
var t = Task.Factory.StartNew(() => {
|
||||||
|
this.UpdateThread(id);
|
||||||
|
}).ContinueWith(task => { tasklimit.Release(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateItems() {
|
||||||
|
var t = Task.Factory.StartNew(() => {
|
||||||
|
foreach (var item in this.settings.watchlist) {
|
||||||
|
this.UpdateItem(item.Key);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// show a simple entry dialogue that allows the user to enter text and either cancel or submit it
|
||||||
private (Boolean accepted, string response) EntryDialogue(string title = "Buypeeb", string message = "Hi there!") {
|
private (Boolean accepted, string response) EntryDialogue(string title = "Buypeeb", string message = "Hi there!") {
|
||||||
Dialog ed = new Dialog(title, null, Gtk.DialogFlags.DestroyWithParent, "Cancel", ResponseType.Cancel, "OK", ResponseType.Ok);
|
Dialog ed = new Dialog(title, null, Gtk.DialogFlags.DestroyWithParent, "Cancel", ResponseType.Cancel, "OK", ResponseType.Ok);
|
||||||
ed.DefaultResponse = ResponseType.Ok;
|
ed.DefaultResponse = ResponseType.Ok;
|
||||||
|
@ -75,15 +215,10 @@ namespace Buypeeb {
|
||||||
return (accepted == ResponseType.Ok, response);
|
return (accepted == ResponseType.Ok, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateItems() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RenderList() {
|
private void RenderList() {
|
||||||
this.items.Clear();
|
this.items.Clear();
|
||||||
foreach (KeyValuePair<string, Listing> entry in settings.watchlist) {
|
foreach (var item in this.settings.watchlist) {
|
||||||
string[] values = new[] { entry.Value.name, entry.Value.PriceJPY(), entry.Value.PriceAUD(), "whenever", entry.Value.id };
|
items.AppendValues(item.Value);
|
||||||
this.items.AppendValues(values);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +245,7 @@ namespace Buypeeb {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonUpdateAllClicked(object sender, EventArgs a) {
|
private void ButtonUpdateAllClicked(object sender, EventArgs a) {
|
||||||
Console.WriteLine("ButtonUpdateAllClicked");
|
this.UpdateItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonClearEndedClicked(object sender, EventArgs a) {
|
private void ButtonClearEndedClicked(object sender, EventArgs a) {
|
||||||
|
@ -122,7 +257,7 @@ namespace Buypeeb {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonSaveClicked(object sender, EventArgs a) {
|
private void ButtonSaveClicked(object sender, EventArgs a) {
|
||||||
Console.WriteLine("ButtonSaveClicked");
|
this.SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonQuitClicked(object sender, EventArgs a) {
|
private void ButtonQuitClicked(object sender, EventArgs a) {
|
||||||
|
@ -130,6 +265,7 @@ namespace Buypeeb {
|
||||||
ResponseType response = (ResponseType)md.Run();
|
ResponseType response = (ResponseType)md.Run();
|
||||||
md.Dispose();
|
md.Dispose();
|
||||||
if (response == ResponseType.Ok) {
|
if (response == ResponseType.Ok) {
|
||||||
|
this.SaveSettings();
|
||||||
Application.Quit();
|
Application.Quit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,5 +290,27 @@ namespace Buypeeb {
|
||||||
Console.WriteLine("ButtonSelectedRenameClicked");
|
Console.WriteLine("ButtonSelectedRenameClicked");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// column renderers
|
||||||
|
|
||||||
|
private void RenderColumnName(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) {
|
||||||
|
Listing item = (Listing)model.GetValue(iter, 0);
|
||||||
|
(cell as Gtk.CellRendererText).Text = item.name ?? "Loading...";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RenderColumnPriceYen(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) {
|
||||||
|
Listing item = (Listing)model.GetValue(iter, 0);
|
||||||
|
(cell as Gtk.CellRendererText).Text = item.ready ? item.PriceJPY() : "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RenderColumnPriceAUD(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) {
|
||||||
|
Listing item = (Listing)model.GetValue(iter, 0);
|
||||||
|
(cell as Gtk.CellRendererText).Text = item.ready ? item.PriceAUD() : "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RenderColumnEnding(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) {
|
||||||
|
Listing item = (Listing)model.GetValue(iter, 0);
|
||||||
|
(cell as Gtk.CellRendererText).Text = item.ready ? "whatever" : "...";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
36
Settings.cs
36
Settings.cs
|
@ -1,13 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace Buypeeb {
|
namespace Buypeeb {
|
||||||
|
|
||||||
class Settings {
|
class Settings {
|
||||||
private string location;
|
|
||||||
|
|
||||||
public int updateInterval { get; set; } = 10 * 60;
|
public int updateInterval { get; set; } = 10 * 60;
|
||||||
public int favouriteUpdateInterval { get; set; } = 5 * 60;
|
public int favouriteUpdateInterval { get; set; } = 5 * 60;
|
||||||
public int updateIntervalCritical { get; set; } = 60;
|
public int updateIntervalCritical { get; set; } = 60;
|
||||||
|
@ -18,36 +14,28 @@ namespace Buypeeb {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Settings() {
|
public Settings() {
|
||||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
|
if (this.watchlist == null) {
|
||||||
// C:\Users\Beebus\AppData\Roaming\Lynnear Software\buypeeb
|
// either this is the first time the program has been run, or there's something wrong with userdata.json
|
||||||
this.location = Path.Combine(Environment.ExpandEnvironmentVariables("%APPDATA%"), "Lynnear Software", "buypeeb");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// ~/.config/Lynnear Software/buypeeb
|
|
||||||
this.location = Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".config", "Lynnear Software", "buypeeb");
|
|
||||||
}
|
|
||||||
this.watchlist = new Dictionary<string, Listing>();
|
this.watchlist = new Dictionary<string, Listing>();
|
||||||
this.Watch("https://buypeeb.biz/whatever/k12345", "my thingy");
|
// this.Watch("https://buypeeb.biz/whatever/k12345", "my thingy");
|
||||||
this.watchlist["k12345"].Update();
|
// this.Watch("https://buypeeb.biz/whatever/z09876", "your thingy");
|
||||||
|
// this.Watch("https://buypeeb.biz/whatever/h55555", "our thingy");
|
||||||
|
// for (int i = 0; i < 10; i++) {
|
||||||
|
// this.Watch($"https://buypeeb.biz/whatever/x{i * 123}", $"filler {i}");
|
||||||
|
// }
|
||||||
|
// this.watchlist["k12345"].Update();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Watch(string url, string name) {
|
public void Watch(string url, string name) {
|
||||||
string id = BuypeebApp.IDFromURL(url);
|
string id = BuypeebApp.IDFromURL(url);
|
||||||
Console.WriteLine(id);
|
Console.WriteLine(id);
|
||||||
this.watchlist[id] = new Listing(url, id, name);
|
this.watchlist[id] = new Listing(id, name);
|
||||||
|
|
||||||
foreach (KeyValuePair<string, Listing> entry in this.watchlist) {
|
foreach (KeyValuePair<string, Listing> entry in this.watchlist) {
|
||||||
Console.WriteLine("{0} - {1}", entry.Value.name, entry.Value.price);
|
Console.WriteLine("{0} - {1}", entry.Value.name, entry.Value.price);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Save() {
|
|
||||||
string j = JsonSerializer.Serialize(this);
|
|
||||||
Console.WriteLine(j);
|
|
||||||
}
|
|
||||||
|
|
||||||
// public void Load() {
|
|
||||||
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
116
ui/main.glade
116
ui/main.glade
|
@ -1,33 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.36.0 -->
|
<!-- Generated with glade 3.22.2 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.22" />
|
<requires lib="gtk+" version="3.22"/>
|
||||||
<object class="GtkListStore" id="ListItems">
|
|
||||||
<columns>
|
|
||||||
<!-- column-name Name -->
|
|
||||||
<column type="gchararray" />
|
|
||||||
<!-- column-name PriceYen -->
|
|
||||||
<column type="gchararray" />
|
|
||||||
<!-- column-name PriceAUD -->
|
|
||||||
<column type="gchararray" />
|
|
||||||
<!-- column-name Ending -->
|
|
||||||
<column type="gchararray" />
|
|
||||||
<!-- column-name id -->
|
|
||||||
<column type="gchararray" />
|
|
||||||
</columns>
|
|
||||||
<data>
|
|
||||||
<row>
|
|
||||||
<col id="0" translatable="yes">The Stinchinator</col>
|
|
||||||
<col id="1" translatable="yes">¥599</col>
|
|
||||||
<col id="2" translatable="yes">$5.99</col>
|
|
||||||
<col id="3" translatable="yes">7 hours</col>
|
|
||||||
<col id="4" translatable="yes">12345</col>
|
|
||||||
</row>
|
|
||||||
</data>
|
|
||||||
</object>
|
|
||||||
<object class="GtkWindow" id="wndMain">
|
<object class="GtkWindow" id="wndMain">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="default_width">700</property>
|
<property name="default_width">700</property>
|
||||||
|
<child type="titlebar">
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -55,8 +35,8 @@
|
||||||
<property name="label" translatable="yes">Add new</property>
|
<property name="label" translatable="yes">Add new</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-add</property>
|
<property name="stock_id">gtk-add</property>
|
||||||
<signal name="clicked" handler="ButtonAddClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonAddClicked" swapped="no"/>
|
||||||
<accelerator key="n" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="n" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -71,8 +51,8 @@
|
||||||
<property name="label" translatable="yes">Update all</property>
|
<property name="label" translatable="yes">Update all</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-refresh</property>
|
<property name="stock_id">gtk-refresh</property>
|
||||||
<signal name="clicked" handler="ButtonUpdateAllClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonUpdateAllClicked" swapped="no"/>
|
||||||
<accelerator key="r" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="r" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -97,7 +77,7 @@
|
||||||
<property name="label" translatable="yes">Undo</property>
|
<property name="label" translatable="yes">Undo</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-undo</property>
|
<property name="stock_id">gtk-undo</property>
|
||||||
<accelerator key="z" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="z" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -112,7 +92,7 @@
|
||||||
<property name="label" translatable="yes">Redo</property>
|
<property name="label" translatable="yes">Redo</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-redo</property>
|
<property name="stock_id">gtk-redo</property>
|
||||||
<accelerator key="z" signal="clicked" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK" />
|
<accelerator key="z" signal="clicked" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -137,7 +117,7 @@
|
||||||
<property name="label" translatable="yes">Clear ended</property>
|
<property name="label" translatable="yes">Clear ended</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-clear</property>
|
<property name="stock_id">gtk-clear</property>
|
||||||
<signal name="clicked" handler="ButtonClearEndedClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonClearEndedClicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -152,7 +132,7 @@
|
||||||
<property name="label" translatable="yes">Clear all</property>
|
<property name="label" translatable="yes">Clear all</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-delete</property>
|
<property name="stock_id">gtk-delete</property>
|
||||||
<signal name="clicked" handler="ButtonClearAllClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonClearAllClicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -177,7 +157,7 @@
|
||||||
<property name="label" translatable="yes">Open</property>
|
<property name="label" translatable="yes">Open</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-open</property>
|
<property name="stock_id">gtk-open</property>
|
||||||
<accelerator key="o" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="o" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -192,8 +172,8 @@
|
||||||
<property name="label" translatable="yes">Save</property>
|
<property name="label" translatable="yes">Save</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-save</property>
|
<property name="stock_id">gtk-save</property>
|
||||||
<signal name="clicked" handler="ButtonSaveClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonSaveClicked" swapped="no"/>
|
||||||
<accelerator key="s" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="s" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -208,7 +188,7 @@
|
||||||
<property name="label" translatable="yes">Export as...</property>
|
<property name="label" translatable="yes">Export as...</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-save-as</property>
|
<property name="stock_id">gtk-save-as</property>
|
||||||
<accelerator key="e" signal="clicked" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK" />
|
<accelerator key="e" signal="clicked" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -233,7 +213,7 @@
|
||||||
<property name="label" translatable="yes">Help</property>
|
<property name="label" translatable="yes">Help</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-help</property>
|
<property name="stock_id">gtk-help</property>
|
||||||
<accelerator key="slash" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="slash" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -248,7 +228,7 @@
|
||||||
<property name="label" translatable="yes">Settings</property>
|
<property name="label" translatable="yes">Settings</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-preferences</property>
|
<property name="stock_id">gtk-preferences</property>
|
||||||
<accelerator key="comma" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="comma" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -263,8 +243,8 @@
|
||||||
<property name="label" translatable="yes">Quit</property>
|
<property name="label" translatable="yes">Quit</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="stock_id">gtk-quit</property>
|
<property name="stock_id">gtk-quit</property>
|
||||||
<signal name="clicked" handler="ButtonQuitClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonQuitClicked" swapped="no"/>
|
||||||
<accelerator key="q" signal="clicked" modifiers="GDK_CONTROL_MASK" />
|
<accelerator key="q" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -287,16 +267,15 @@
|
||||||
<property name="shadow_type">in</property>
|
<property name="shadow_type">in</property>
|
||||||
<property name="min_content_width">200</property>
|
<property name="min_content_width">200</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeView">
|
<object class="GtkTreeView" id="TreeViewItems">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="model">ListItems</property>
|
|
||||||
<property name="rules_hint">True</property>
|
<property name="rules_hint">True</property>
|
||||||
<property name="search_column">1</property>
|
<property name="search_column">1</property>
|
||||||
<property name="activate_on_single_click">True</property>
|
<property name="activate_on_single_click">True</property>
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection">
|
<object class="GtkTreeSelection">
|
||||||
<signal name="changed" handler="tveItemsSelectionChanged" swapped="no" />
|
<signal name="changed" handler="tveItemsSelectionChanged" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -308,10 +287,7 @@
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
<property name="clickable">True</property>
|
<property name="clickable">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText" />
|
<object class="GtkCellRendererText"/>
|
||||||
<attributes>
|
|
||||||
<attribute name="text">0</attribute>
|
|
||||||
</attributes>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
@ -320,10 +296,7 @@
|
||||||
<property name="resizable">True</property>
|
<property name="resizable">True</property>
|
||||||
<property name="title" translatable="yes">Price (¥)</property>
|
<property name="title" translatable="yes">Price (¥)</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText" />
|
<object class="GtkCellRendererText"/>
|
||||||
<attributes>
|
|
||||||
<attribute name="text">1</attribute>
|
|
||||||
</attributes>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
@ -332,10 +305,7 @@
|
||||||
<property name="resizable">True</property>
|
<property name="resizable">True</property>
|
||||||
<property name="title" translatable="yes">Price (AUD)</property>
|
<property name="title" translatable="yes">Price (AUD)</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText" />
|
<object class="GtkCellRendererText"/>
|
||||||
<attributes>
|
|
||||||
<attribute name="text">2</attribute>
|
|
||||||
</attributes>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
@ -345,10 +315,7 @@
|
||||||
<property name="title" translatable="yes">Ending at</property>
|
<property name="title" translatable="yes">Ending at</property>
|
||||||
<property name="clickable">True</property>
|
<property name="clickable">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText" />
|
<object class="GtkCellRendererText"/>
|
||||||
<attributes>
|
|
||||||
<attribute name="text">3</attribute>
|
|
||||||
</attributes>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
@ -385,8 +352,8 @@
|
||||||
<property name="max_width_chars">40</property>
|
<property name="max_width_chars">40</property>
|
||||||
<property name="lines">3</property>
|
<property name="lines">3</property>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="weight" value="bold" />
|
<attribute name="weight" value="bold"/>
|
||||||
<attribute name="scale" value="2" />
|
<attribute name="scale" value="2"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -597,22 +564,22 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder />
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder />
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder />
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder />
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder />
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder />
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -647,7 +614,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<signal name="clicked" handler="ButtonViewBuyeeClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonViewBuyeeClicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -661,7 +628,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<signal name="clicked" handler="ButtonViewYahooClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonViewYahooClicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -682,7 +649,7 @@
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="tooltip_text" translatable="yes">Remove</property>
|
<property name="tooltip_text" translatable="yes">Remove</property>
|
||||||
<signal name="clicked" handler="ButtonSelectedRemoveClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonSelectedRemoveClicked" swapped="no"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="image4">
|
<object class="GtkImage" id="image4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -704,7 +671,7 @@
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="tooltip_text" translatable="yes">Rename</property>
|
<property name="tooltip_text" translatable="yes">Rename</property>
|
||||||
<signal name="clicked" handler="ButtonSelectedRenameClicked" swapped="no" />
|
<signal name="clicked" handler="ButtonSelectedRenameClicked" swapped="no"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="image1">
|
<object class="GtkImage" id="image1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -795,7 +762,7 @@
|
||||||
<property name="margin_top">3</property>
|
<property name="margin_top">3</property>
|
||||||
<property name="margin_bottom">3</property>
|
<property name="margin_bottom">3</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel" id="LabelStatus">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
|
@ -828,8 +795,5 @@
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child type="titlebar">
|
|
||||||
<placeholder />
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
Loading…
Reference in a new issue