From 719b73cfa0440af37a31d29799fe10ceb0f61158 Mon Sep 17 00:00:00 2001 From: Kq Date: Mon, 29 Jun 2026 20:33:24 +0200 Subject: [PATCH] Add zenity notifications for invalid game files and successful additions --- PKGBUILD | 4 ++-- src/online-fix-importer/Program.cs | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index bdfb02c..ba0d749 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,12 +1,12 @@ # PKGBUILD pkgname=online-fix-importer -pkgver=1.0.6 +pkgver=1.0.7 pkgrel=1 pkgdesc="Onlinefix-launcher auto game installer" arch=('x86_64') license=('MIT') depends=('icoextract') -makedepends=('dotnet-sdk' 'git' '7zip' 'icoextract' 'icoutils') +makedepends=('dotnet-sdk' 'git' '7zip' 'icoextract' 'icoutils' 'zenity') source=("$pkgname::git+https://github.com/kqnori/online-fix.git") sha256sums=('SKIP') diff --git a/src/online-fix-importer/Program.cs b/src/online-fix-importer/Program.cs index 42ad387..8b56c02 100644 --- a/src/online-fix-importer/Program.cs +++ b/src/online-fix-importer/Program.cs @@ -38,7 +38,9 @@ if (args[0].EndsWith(".exe")) AddToFix(args[0]); if (Directory.GetFiles(gamepath, "OnlineFix.ini", SearchOption.AllDirectories).Length == 0) { + Notify("This is not a valid OnlineFix game","error"); Environment.Exit(1); + } } @@ -47,6 +49,7 @@ else if (args[0].EndsWith(".rar")) unrarfix(args[0]); if (!Directory.Exists(Directory.GetCurrentDirectory() + "/Fix Repair")) { + Notify("This is not a valid OnlineFix rar file or Fix Repair folder is missing","error"); Environment.Exit(1); } } @@ -234,6 +237,7 @@ fixPath= banner={userProfilePath}/.config/OFME-Linux/banners/{gameid}header.png"+"\n\n"; File.AppendAllText(userProfilePath + "/.config/OFME-Linux/Games.ini", prefix); + Notify($"Game {gamename} has been added to OnlineFix Linux Launcher","info"); } @@ -267,7 +271,20 @@ void unrar(string archivePath, string outputDir) - +void Notify(string message, string type) +{ + // string type = typeI switch + // { + // 0 => "info", + // 1 => "error", + // }; + Process.Start(new ProcessStartInfo + { + FileName = "zenity", + Arguments = $"--{type} --title=\"Onlinefix importer\" --text=\"{message}\" --no-wrap", + UseShellExecute = false + })?.WaitForExit(); +} void ExtractIcon(string exePath, string outputPngPath)