Skip to content

Commit

Permalink
Config editor: show a progress dialog during service connection
Browse files Browse the repository at this point in the history
- Also hide taskbar icon for progress dialog by default
  • Loading branch information
Sparronator9999 committed Jan 5, 2025
1 parent f5c35ec commit 442d84e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion YAMDCC.Common/Dialogs/ProgressDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions YAMDCC.Common/Dialogs/ProgressDialog.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@
<metadata name="flwButtons.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="flwButtons.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
7 changes: 6 additions & 1 deletion YAMDCC.ConfigEditor/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ private void MainWindow_Load(object sender, EventArgs e)
IPCClient.ServerMessage += IPC_MessageReceived;
IPCClient.Error += IPCClient_Error;
IPCClient.Start();
if (!IPCClient.WaitForConnection(5000))

ProgressDialog dlg = new("Connecting to YAMDCC service...",
(e) => e.Result = !IPCClient.WaitForConnection(5000));
dlg.ShowDialog();

if (dlg.Result is bool b && b)
{
throw new TimeoutException(Strings.GetString("exSvcTimeout"));
}
Expand Down

0 comments on commit 442d84e

Please sign in to comment.