Skip to content

Commit 22d7914

Browse files
committed
Start work on Linux version
1 parent 645b370 commit 22d7914

File tree

17 files changed

+404
-128
lines changed

17 files changed

+404
-128
lines changed

SmartImage 3/App/Integration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static bool HandleContextMenu(bool option)
9999

100100
try {
101101
regMenu = Registry.CurrentUser.CreateSubKey(R1.Reg_Shell);
102-
regMenu?.SetValue(String.Empty, R2.Name);
102+
regMenu?.SetValue(String.Empty, R1.Name);
103103
regMenu?.SetValue("Icon", $"\"{fullPath}\"");
104104

105105
regCmd = Registry.CurrentUser.CreateSubKey(R1.Reg_Shell_Cmd);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ private void AboutDialog()
3333
{
3434
var d = new Dialog()
3535
{
36-
Text = $"{R2.Name} {Integration.Version} by {R2.Author}\n" +
36+
Text = $"{R1.Name} {Integration.Version} by {R1.Author}\n" +
3737
$"Current directory: {Integration.CurrentAppFolder}",
3838

39-
Title = R2.Name,
39+
Title = R1.Name,
4040
AutoSize = true,
4141
Width = UI.Dim_30_Pct,
4242
Height = UI.Dim_30_Pct,
4343
};
4444

45-
var b1 = d.CreateLinkButton("Repo", R2.Repo_Url);
46-
var b2 = d.CreateLinkButton("Wiki", R2.Wiki_Url);
45+
var b1 = d.CreateLinkButton("Repo", R1.Repo_Url);
46+
var b2 = d.CreateLinkButton("Wiki", R1.Wiki_Url);
4747
var b3 = d.CreateLinkButton("Ok", null, () => Application.RequestStop());
4848

4949
d.AddButton(b1);
@@ -59,7 +59,7 @@ private void InfoDialog()
5959
{
6060
Text = $"{Environment.GetCommandLineArgs().QuickJoin("\n")}",
6161

62-
Title = R2.Name,
62+
Title = R1.Name,
6363
AutoSize = true,
6464
Width = UI.Dim_30_Pct,
6565
Height = UI.Dim_30_Pct,
@@ -466,7 +466,7 @@ void OnAction(ListView lv, Action<SearchEngineOptions> f)
466466
/*cbSendTo*/
467467
);
468468

469-
var btnHelp = dlCfg.CreateLinkButton("?", R2.Wiki_Url);
469+
var btnHelp = dlCfg.CreateLinkButton("?", R1.Wiki_Url);
470470

471471
dlCfg.AddButton(btnRefresh);
472472
dlCfg.AddButton(btnOk);

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

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private async void Input_TextChanging(TextChangingEventArgs eventArgs)
150150
/// <summary>
151151
/// <see cref="Btn_Restart" />
152152
/// </summary>
153-
private async void Restart_Clicked(bool force = false)
153+
private void Restart_Clicked(bool force = false)
154154
{
155155
if (!Client.IsComplete && !force) {
156156
return;
@@ -189,7 +189,6 @@ private async void Restart_Clicked(bool force = false)
189189
Tf_Input.EnsureFocus();
190190
Btn_Filter.Text = "Filter";
191191
_inputVerifying = false;
192-
await Client.ApplyConfigAsync();
193192
}
194193

195194
/// <summary>
@@ -303,73 +302,6 @@ await Parallel.ForEachAsync(res3, async (item, token) =>
303302

304303
}
305304

306-
/*void UpdateTable(IEnumerable<SearchResultItem> res)
307-
{
308-
IndexColors.Clear();
309-
Dt_Results.Clear();
310-
311-
var resx = res as SearchResultItem[] ?? res.ToArray();
312-
var rg = resx.GroupBy(r => r.Root);
313-
314-
foreach (var gg in rg) {
315-
int i = 0;
316-
317-
foreach (var sri in gg) {
318-
AddResultItemToTable(sri, i);
319-
i++;
320-
Tv_Results.Update();
321-
}
322-
323-
}
324-
}*/
325-
326-
/*private async void Filter_Clicked()
327-
{
328-
var dlFilter = new Dialog()
329-
{
330-
AutoSize = false,
331-
Width = UI.Dim_30_Pct,
332-
Height = UI.Dim_30_Pct
333-
};
334-
var cbCode = new CheckBox("Code");
335-
336-
cbCode.Toggled += async b =>
337-
{
338-
if (b) {
339-
return;
340-
}
341-
342-
var cb = new ConcurrentBag<SearchResultItem>();
343-
var res = m_results.SelectMany(r => r.AllResults).Where(r => r.Url != null);
344-
345-
await Parallel.ForEachAsync(res, async (item, token) =>
346-
{
347-
using var r = await item.Url.AllowAnyHttpStatus()
348-
.OnError(x => x.ExceptionHandled = true)
349-
.GetAsync(token);
350-
351-
switch (r.ResponseMessage.StatusCode) {
352-
case HttpStatusCode.NotFound:
353-
case HttpStatusCode.UnavailableForLegalReasons:
354-
case HttpStatusCode.Unauthorized:
355-
return;
356-
default:
357-
cb.Add(item);
358-
break;
359-
}
360-
});
361-
362-
UpdateTable(cb);
363-
};
364-
365-
var btnOk = new Button();
366-
btnOk.Clicked += () => { Application.RequestStop(); };
367-
368-
dlFilter.Add(cbCode);
369-
dlFilter.AddButton(btnOk);
370-
Application.Run(dlFilter);
371-
}*/
372-
373305
#endregion
374306

375307
private void Queue_Checked(bool b)

SmartImage 3/Mode/Shell/ShellMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static ShellMode() { }
5454

5555
private static readonly Toplevel Top = Application.Top;
5656

57-
private static readonly Window Win = new(R2.Name)
57+
private static readonly Window Win = new(R1.Name)
5858
{
5959
X = 0,
6060
Y = 1,

SmartImage 3/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ static Program() { }
4848
public static void Init()
4949
{
5050
Global.Setup();
51-
Trace.WriteLine("Init", R2.Name);
51+
Trace.WriteLine("Init", R1.Name);
5252
// Gui.Init();
53-
Console.Title = R2.Name;
53+
Console.Title = R1.Name;
5454

5555
if (Compat.IsWin) {
5656
ConsoleUtil.SetConsoleMode();
@@ -59,7 +59,7 @@ public static void Init()
5959

6060
AppDomain.CurrentDomain.ProcessExit += (sender, args) =>
6161
{
62-
Trace.WriteLine($"Exiting", R2.Name);
62+
Trace.WriteLine($"Exiting", R1.Name);
6363
};
6464

6565
AppDomain.CurrentDomain.UnhandledException += (sender, args) =>

SmartImage 3/Resources.Designer.cs

Lines changed: 0 additions & 36 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: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,12 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<data name="Name" xml:space="preserve">
121-
<value>SmartImage</value>
122-
</data>
123-
<data name="Repo_Url" xml:space="preserve">
124-
<value>https://github.com/Decimation/SmartImage</value>
125-
</data>
126120
<data name="C_Input" xml:space="preserve">
127121
<value>Input:</value>
128122
</data>
129-
<data name="Wiki_Url" xml:space="preserve">
130-
<value>https://github.com/Decimation/SmartImage/wiki</value>
131-
</data>
132123
<data name="Arg_Input" xml:space="preserve">
133124
<value>--i</value>
134125
</data>
135-
<data name="Author" xml:space="preserve">
136-
<value>Read Stanton</value>
137-
</data>
138126
<data name="Inf_Clipboard" xml:space="preserve">
139127
<value>Clipboard data</value>
140128
</data>

SmartImage.Lib 3/Resources.Designer.cs

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

SmartImage.Lib 3/Resources.resx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,16 @@
159159
<data name="S_SauceNaoKey" xml:space="preserve">
160160
<value>SauceNao Key</value>
161161
</data>
162+
<data name="Name" xml:space="preserve">
163+
<value>SmartImage</value>
164+
</data>
165+
<data name="Author" xml:space="preserve">
166+
<value>Read Stanton</value>
167+
</data>
168+
<data name="Repo_Url" xml:space="preserve">
169+
<value>https://github.com/Decimation/SmartImage</value>
170+
</data>
171+
<data name="Wiki_Url" xml:space="preserve">
172+
<value>https://github.com/Decimation/SmartImage/wiki</value>
173+
</data>
162174
</root>

SmartImage.Lib 3/SearchConfig.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using SmartImage.Lib.Engines;
99
using SmartImage.Lib.Engines.Impl.Search;
1010
using Configuration = System.Configuration.Configuration;
11+
1112
namespace SmartImage.Lib;
1213

1314
public sealed class SearchConfig : IDataTable, INotifyPropertyChanged
@@ -29,6 +30,11 @@ public sealed class SearchConfig : IDataTable, INotifyPropertyChanged
2930
/// </summary>
3031
public const bool ON_TOP_DEFAULT = true;
3132

33+
/// <summary>
34+
/// Default value for <see cref="AutoSearch"/>
35+
/// </summary>
36+
public const bool AUTOSEARCH_DEFAULT = true;
37+
3238
#endregion
3339

3440
/// <summary>
@@ -125,6 +131,7 @@ public bool Clipboard
125131
OnPropertyChanged();
126132
}
127133
}
134+
128135
public bool AutoSearch
129136
{
130137
get { return Configuration.ReadSetting(nameof(AutoSearch), false); }

0 commit comments

Comments
 (0)