Compare commits
No commits in common. "1ef003354708ea7e48e63fdcef5502d0642456a8" and "f9664795f5ecd8dd24ae297f8f5de2378f36232b" have entirely different histories.
1ef0033547
...
f9664795f5
8 changed files with 10 additions and 78 deletions
|
@ -1,4 +1,6 @@
|
||||||
|
using System;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
using UI = Gtk.Builder.ObjectAttribute;
|
||||||
|
|
||||||
namespace Buypeeb {
|
namespace Buypeeb {
|
||||||
|
|
||||||
|
|
|
@ -184,11 +184,6 @@ namespace Buypeeb {
|
||||||
|
|
||||||
// general behaviour
|
// general behaviour
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 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>
|
|
||||||
private (TreePath path, TreeIter iter) GetRow(string id) {
|
private (TreePath path, TreeIter iter) GetRow(string id) {
|
||||||
// TODO: surely there's a better way to do this
|
// TODO: surely there's a better way to do this
|
||||||
TreeIter iter;
|
TreeIter iter;
|
||||||
|
@ -209,9 +204,6 @@ namespace Buypeeb {
|
||||||
return (null, iter);
|
return (null, iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// saves the settings to userdata.json.
|
|
||||||
/// </summary>
|
|
||||||
private void SaveSettings() {
|
private void SaveSettings() {
|
||||||
string j = JsonSerializer.Serialize(this.settings, this.jsonOptions);
|
string j = JsonSerializer.Serialize(this.settings, this.jsonOptions);
|
||||||
string p = System.IO.Path.Combine(this.location, "userdata.json");
|
string p = System.IO.Path.Combine(this.location, "userdata.json");
|
||||||
|
@ -226,10 +218,6 @@ namespace Buypeeb {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 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 void UpdateThread(string id) {
|
private void UpdateThread(string id) {
|
||||||
var item = this.settings.watchlist[id];
|
var item = this.settings.watchlist[id];
|
||||||
// Console.WriteLine($"Updating {id}...");
|
// Console.WriteLine($"Updating {id}...");
|
||||||
|
@ -268,10 +256,9 @@ namespace Buypeeb {
|
||||||
// Console.WriteLine($"{id} updated.");
|
// Console.WriteLine($"{id} updated.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// recursively processes the update queue. this is a blocking function.
|
|
||||||
/// </summary>
|
|
||||||
private void ProcessUpdateQueue() {
|
private void ProcessUpdateQueue() {
|
||||||
|
// recursively process the updatequeue
|
||||||
|
// this is a BLOCKING FUNCTION
|
||||||
this.queueActive = true;
|
this.queueActive = true;
|
||||||
this.UpdateItem(this.updateQueue.Dequeue());
|
this.UpdateItem(this.updateQueue.Dequeue());
|
||||||
if (this.updateQueue.TryPeek(out string _)) {
|
if (this.updateQueue.TryPeek(out string _)) {
|
||||||
|
@ -282,11 +269,6 @@ namespace Buypeeb {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 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>
|
|
||||||
private void UpdateItem(string id, bool renderListWhenDone = false) {
|
private void UpdateItem(string id, bool renderListWhenDone = false) {
|
||||||
var item = this.settings.watchlist[id];
|
var item = this.settings.watchlist[id];
|
||||||
if (item.updatedRecently) {
|
if (item.updatedRecently) {
|
||||||
|
@ -309,9 +291,6 @@ 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.
|
|
||||||
/// </summary>
|
|
||||||
private void UpdateItems() {
|
private void UpdateItems() {
|
||||||
if (this.queueActive) {
|
if (this.queueActive) {
|
||||||
return;
|
return;
|
||||||
|
@ -339,9 +318,6 @@ namespace Buypeeb {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// updates the selection view, displaying the id, name, etc. for the currently selected item.
|
|
||||||
/// </summary>
|
|
||||||
private void UpdateSelectionView() {
|
private void UpdateSelectionView() {
|
||||||
// get the currently selected item
|
// get the currently selected item
|
||||||
var item = this.selectedItem;
|
var item = this.selectedItem;
|
||||||
|
@ -383,11 +359,6 @@ namespace Buypeeb {
|
||||||
(this.builder.GetObject("ButtonSelectedFavourite") as ToggleButton).Active = item.favourite;
|
(this.builder.GetObject("ButtonSelectedFavourite") as ToggleButton).Active = item.favourite;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// opens a URL in the user's browser.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="url">the url to open</param>
|
|
||||||
private void OpenUrl(string url) {
|
private void OpenUrl(string url) {
|
||||||
// https://github.com/dotnet/runtime/issues/17938
|
// https://github.com/dotnet/runtime/issues/17938
|
||||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
|
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
|
||||||
|
@ -403,12 +374,6 @@ namespace Buypeeb {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 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) {
|
private MessageDialog MsgBox(string message, ButtonsType buttonsType = ButtonsType.OkCancel) {
|
||||||
var md = new MessageDialog(
|
var md = new MessageDialog(
|
||||||
parent_window: this,
|
parent_window: this,
|
||||||
|
@ -425,13 +390,7 @@ namespace Buypeeb {
|
||||||
return md;
|
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>
|
|
||||||
/// <param name="prefill">a string to prefill the input box with</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private (Boolean accepted, string response) EntryDialogue(string title = "Buypeeb", string message = "Hi there!", string prefill = null) {
|
private (Boolean accepted, string response) EntryDialogue(string title = "Buypeeb", string message = "Hi there!", string prefill = null) {
|
||||||
Dialog ed = new Dialog(
|
Dialog ed = new Dialog(
|
||||||
title: title,
|
title: title,
|
||||||
|
@ -467,10 +426,6 @@ namespace Buypeeb {
|
||||||
return (accepted == ResponseType.Ok, response);
|
return (accepted == ResponseType.Ok, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 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() {
|
private string GetSortType() {
|
||||||
foreach (var name in new List<string> { "NameDescending", "NameAscending", "PriceDescending", "PriceAscending", "EndingDescending", "EndingAscending" }) {
|
foreach (var name in new List<string> { "NameDescending", "NameAscending", "PriceDescending", "PriceAscending", "EndingDescending", "EndingAscending" }) {
|
||||||
var radio = (RadioMenuItem)this.builder.GetObject($"Sort{name}");
|
var radio = (RadioMenuItem)this.builder.GetObject($"Sort{name}");
|
||||||
|
@ -482,9 +437,6 @@ namespace Buypeeb {
|
||||||
return "NameAscending";
|
return "NameAscending";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <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.
|
|
||||||
/// </summary>
|
|
||||||
private void RenderList() {
|
private void RenderList() {
|
||||||
string id = null;
|
string id = null;
|
||||||
if (this.selectedItem != null) {
|
if (this.selectedItem != null) {
|
||||||
|
@ -825,10 +777,6 @@ namespace Buypeeb {
|
||||||
|
|
||||||
// timers
|
// timers
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// updates the end time displayed in the selection box. runs every second to update the countdown timer.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>true</returns>
|
|
||||||
private bool UpdateSelectionEndTime() {
|
private bool UpdateSelectionEndTime() {
|
||||||
if (!this.selectionViewBox.IsSensitive) {
|
if (!this.selectionViewBox.IsSensitive) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -861,10 +809,6 @@ namespace Buypeeb {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// updates all items that need updating. runs every ten seconds.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>true</returns>
|
|
||||||
private bool AutoUpdateItems() {
|
private bool AutoUpdateItems() {
|
||||||
if (this.queueActive) {
|
if (this.queueActive) {
|
||||||
// don't autoupdate if the queue is active
|
// don't autoupdate if the queue is active
|
||||||
|
|
3
PKGBUILD
3
PKGBUILD
|
@ -4,7 +4,6 @@ pkgname=buypeeb-git # '-bzr', '-git', '-hg' or '-svn'
|
||||||
_srcname=buypeeb-cs
|
_srcname=buypeeb-cs
|
||||||
pkgver=r89.d548d75
|
pkgver=r89.d548d75
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
options=('!strip')
|
|
||||||
pkgdesc="A simple desktop program for keeping track of Yahoo! Auctions Japan items"
|
pkgdesc="A simple desktop program for keeping track of Yahoo! Auctions Japan items"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="https://git.bune.city/lynnesbian/buypeeb-cs"
|
url="https://git.bune.city/lynnesbian/buypeeb-cs"
|
||||||
|
@ -27,8 +26,6 @@ build() {
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir/${_srcname}"
|
|
||||||
install -D -m755 ./buypeeb.desktop -t "${pkgdir}/usr/share/applications"
|
|
||||||
cd "$srcdir/${_srcname}/build"
|
cd "$srcdir/${_srcname}/build"
|
||||||
install -D -m755 ./buypeeb -t "${pkgdir}/usr/bin"
|
install -D -m755 ./buypeeb -t "${pkgdir}/usr/bin"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
<PublishTrimmed>false</PublishTrimmed>
|
<PublishTrimmed>false</PublishTrimmed>
|
||||||
<!-- <SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings> -->
|
<!-- <SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings> -->
|
||||||
<PublishDir>out/release/linux</PublishDir>
|
<PublishDir>out/linux/release</PublishDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
<PublishTrimmed>false</PublishTrimmed>
|
<PublishTrimmed>false</PublishTrimmed>
|
||||||
<!-- <SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings> -->
|
<!-- <SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings> -->
|
||||||
<PublishDir>out/release/windows</PublishDir>
|
<PublishDir>out/windows/release</PublishDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Version=1.0
|
|
||||||
Name=Buypeeb
|
|
||||||
Comment=Keep track of Yahoo! Japan Auctions
|
|
||||||
Keywords=Yahoo;Auctions
|
|
||||||
Exec=buypeeb
|
|
||||||
Icon=application-x-executable
|
|
||||||
Terminal=false
|
|
||||||
X-MultipleArgs=false
|
|
||||||
Type=Application
|
|
||||||
Categories=Network;
|
|
|
@ -11,12 +11,13 @@ sudo pacman -S dotnet-sdk
|
||||||
dotnet run
|
dotnet run
|
||||||
```
|
```
|
||||||
|
|
||||||
## quick install (arch linux)
|
<!-- ## quick install (arch linux)
|
||||||
|
this doesn't work 0uo
|
||||||
```bash
|
```bash
|
||||||
curl https://git.bune.city/lynnesbian/buypeeb-cs/raw/branch/master/PKGBUILD
|
curl https://git.bune.city/lynnesbian/buypeeb-cs/raw/branch/master/PKGBUILD
|
||||||
makepkg -si # installs to /usr/bin/buypeeb
|
makepkg -si # installs to /usr/bin/buypeeb
|
||||||
buypeeb
|
buypeeb
|
||||||
```
|
``` -->
|
||||||
---
|
---
|
||||||
|
|
||||||
## installing prerequisites
|
## installing prerequisites
|
||||||
|
|
|
@ -2,6 +2,5 @@ dotnet publish -p:PublishProfile=Windows
|
||||||
$compress = @{
|
$compress = @{
|
||||||
Path = "out\release\windows\buypeeb.exe"
|
Path = "out\release\windows\buypeeb.exe"
|
||||||
DestinationPath = "out\release\windows\buypeeb.zip"
|
DestinationPath = "out\release\windows\buypeeb.zip"
|
||||||
Force = $True
|
|
||||||
}
|
}
|
||||||
Compress-Archive @compress
|
Compress-Archive @compress
|
||||||
|
|
Loading…
Reference in a new issue