Skip to content

Commit 4f6cbf5

Browse files
committed
v3.0.3 RC* (fixes)
1 parent 412f179 commit 4f6cbf5

File tree

8 files changed

+41
-13
lines changed

8 files changed

+41
-13
lines changed

SmartImage 3/App/Integration.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ public static string[] OpenFile(OpenFileNameFlags flags = 0)
362362
files.Add(pd);
363363
goto ret;
364364
}
365+
else {
366+
if (File.Exists(pd)) {
367+
pd = Path.GetDirectoryName(pd);
368+
}
369+
}
365370

366371
var ofs = (ofn.nFileOffset * 2);
367372
var ptr1 = (((byte*) p1p.Pointer) + ofs);

SmartImage 3/Mode/Shell/Assets/UI.Styles.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ internal static partial class UI
123123
Normal = Atr_Red_Black,
124124
Focus = Atr_BrightRed_Black
125125
};
126-
126+
internal static readonly ColorScheme Cs_Lbl4 = new()
127+
{
128+
Normal = Atr_Red_Black,
129+
HotNormal = Atr_Red_Black,
130+
};
127131
internal static readonly ColorScheme Cs_Win2 = new()
128132
{
129133
Normal = Atr_White_Black,

SmartImage 3/Mode/Shell/ShellMode.Handlers.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ private void Browse_Clicked()
163163
foreach (string fs in files) {
164164
Queue.Enqueue(fs);
165165
}
166+
166167
if (!IsQueryReady()) {
167168
NextQueue();
168169

@@ -227,11 +228,13 @@ private void Cancel_Clicked()
227228
{
228229
m_token.Cancel();
229230
m_tokenu.Cancel();
231+
Lbl_Status2.ColorScheme = UI.Cs_Lbl4;
230232
Lbl_Status2.Text = R2.Inf_Cancel;
231233
Lbl_Status2.SetNeedsDisplay();
232234
Btn_Restart.Enabled = true;
233235
Application.MainLoop.RemoveIdle(m_runIdleTok);
234236
Tv_Results.SetFocus();
237+
Lbl_Status2.ColorScheme = UI.Cs_Lbl1;
235238

236239
}
237240

@@ -282,11 +285,11 @@ private void Delete_Clicked()
282285

283286
private void Next_Clicked()
284287
{
285-
if (!Client.IsComplete) {
288+
if (Client.IsRunning) {
286289
Cancel_Clicked();
287290
}
288291

289-
Dispose(false);
292+
// Dispose(false);
290293

291294
Restart_Clicked(true);
292295

SmartImage 3/Mode/Shell/ShellMode.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,6 @@ private void PostSearch()
478478
Btn_Cancel.Enabled = false;
479479
}
480480

481-
Lbl_Status2.ColorScheme = UI.Cs_Lbl1_Success;
482-
Lbl_Status2.Text = "Complete";
483481
}
484482

485483
#region SearchClient callbacks
@@ -525,8 +523,11 @@ private void OnResult(object o, SearchResult result)
525523

526524
private void OnComplete(object sender, SearchResult[] results)
527525
{
528-
Btn_Restart.Enabled = true;
529-
Btn_Cancel.Enabled = false;
526+
Btn_Restart.Enabled = true;
527+
Btn_Cancel.Enabled = false;
528+
Lbl_Status2.ColorScheme = UI.Cs_Lbl1_Success;
529+
Lbl_Status2.Text = R2.Inf_Complete;
530+
530531
}
531532

532533
[SupportedOSPlatform(Compat.OS)]
@@ -627,11 +628,7 @@ private async Task<bool> SetQuery(ustring text)
627628
try {
628629
Pbr_Status.Pulse();
629630

630-
Lbl_Status2.WithScheme(_ =>
631-
{
632-
Lbl_Status2.Text = $"Verifying...";
633-
return;
634-
}, UI.Cs_Lbl1_Neutral);
631+
Lbl_Status2.Text = $"Verifying...";
635632

636633
lock (Btn_Run) {
637634
Btn_Run.Enabled = false;

SmartImage 3/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SmartImage 3/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,7 @@
157157
<data name="Arg_NoUI" xml:space="preserve">
158158
<value>--noui</value>
159159
</data>
160+
<data name="Inf_Complete" xml:space="preserve">
161+
<value>Complete</value>
162+
</data>
160163
</root>

SmartImage 3/SmartImage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
</ItemGroup>
140140
<PropertyGroup>
141141
<PackageId>SmartImage</PackageId>
142-
<Version>3.0.2</Version>
142+
<Version>3.0.3</Version>
143143
<Authors>Read Stanton (Decimation)</Authors>
144144
<PackageTags>Image reverse search identification source sauce</PackageTags>
145145
<RepositoryUrl>https://github.com/Decimation/SmartImage</RepositoryUrl>

SmartImage.Lib 3/SearchClient.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ public sealed class SearchClient : IDisposable
3434

3535
public bool ConfigApplied { get; private set; }
3636

37+
public bool IsRunning { get; private set; }
38+
3739
private static readonly ILogger Logger = LogUtil.Factory.CreateLogger(nameof(SearchClient));
3840

3941
public SearchClient(SearchConfig cfg)
4042
{
4143
Config = cfg;
4244
ConfigApplied = false;
45+
IsRunning = false;
4346
LoadEngines();
4447
}
4548

@@ -88,6 +91,7 @@ static SearchClient()
8891
public async Task<SearchResult[]> RunSearchAsync(SearchQuery query, CancellationToken token = default,
8992
[CBN] IProgress<int> p = null)
9093
{
94+
IsRunning = true;
9195
if (!ConfigApplied) {
9296
await ApplyConfigAsync();
9397
}
@@ -141,6 +145,8 @@ public async Task<SearchResult[]> RunSearchAsync(SearchQuery query, Cancellation
141145

142146
}
143147

148+
IsRunning = false;
149+
144150
return results;
145151
}
146152

@@ -283,5 +289,6 @@ public void Dispose()
283289

284290
ConfigApplied = false;
285291
IsComplete = false;
292+
IsRunning = false;
286293
}
287294
}

0 commit comments

Comments
 (0)