Skip to content

Commit

Permalink
1.0.4 Allow installation of Gtk if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
boiscljo committed Mar 8, 2021
1 parent dc2ba64 commit 031f507
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 4 additions & 2 deletions DRAL_UI/DRAL_GTK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<AssemblyName>DRAL</AssemblyName>
<RepositoryUrl>https://github.com/boiscljo/DRAL</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3.0</FileVersion>
<AssemblyVersion>1.0.4.0</AssemblyVersion>
<FileVersion>1.0.4.0</FileVersion>
<Nullable>annotations</Nullable>
<PackageProjectUrl>https://github.com/boiscljo/DRAL</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
17 changes: 16 additions & 1 deletion DRAL_UI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Globalization;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Reflection;
Expand Down Expand Up @@ -55,7 +56,20 @@ static void Main(string[] args)
}
if (args.Contains("-v") || args.Contains("--verbose"))
verbose = true;
Gtk.Application.Init();
try
{
Gtk.Application.Init();
}
catch
{
Console.WriteLine("Installing Gtk libraries for current user");
WebClient wc = new WebClient();
wc.DownloadFile("https://zergling.moyskleytech.com/dataset/DRAL/Gtk.zip" , "Gtk.zip");
ZipFile.ExtractToDirectory("Gtk.zip" , Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
System.IO.File.Delete("Gtk.zip");
Console.WriteLine("Please run DRAL again.");
return;
}

if (args.Contains("--out"))
{
Expand Down Expand Up @@ -106,6 +120,7 @@ static void Main(string[] args)
return;
}


if (withWindow)
window.Show();
if (args.Contains("--fix") || args.Contains("-f") || args.Contains("--fix-dataset") ||
Expand Down
4 changes: 2 additions & 2 deletions DRAL_UI/UI/NewTagWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ private void Left_MotionNotifyEvent(object o, MotionNotifyEventArgs args)
private void Previous(bool v)
{
attentionHandler.Previous();
var lbl = manager.GetLabel(attentionHandler.Filename);
/*var lbl = manager.GetLabel(attentionHandler.Filename);
while (lbl == null)
{
attentionHandler.Previous();
}
}*/
LoadImageInformation();
if (v)
{
Expand Down

0 comments on commit 031f507

Please sign in to comment.