Skip to content

Commit 375e6fe

Browse files
committed
fix start minimized (titlebar was not hidden from taskbar), fix check updates: did not filter results, if checked updates twice on same unity version
1 parent e654870 commit 375e6fe

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+11-12
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ void Start()
152152
ApplyTheme(txtCustomThemeFile.Text);
153153

154154
// for autostart with minimized
155-
if (Properties.Settings.Default.runAutomatically == true && Properties.Settings.Default.runAutomaticallyMinimized == true)
155+
if (Settings.Default.runAutomatically == true && Settings.Default.runAutomaticallyMinimized == true)
156156
{
157-
// if application got started by the system, then hide, otherwise dont hide (user started it)
157+
// if application was system started, then hide, otherwise dont hide (when user started it)
158158
if (Directory.GetCurrentDirectory().ToLower() == @"c:\windows\system32")
159159
{
160+
this.ShowInTaskbar = false; // for some reason, otherwise it will show in taskbar only at start
160161
notifyIcon.Visible = true;
161162
this.Hide();
162163
}
163-
164164
}
165165

166166
// TEST
@@ -749,11 +749,10 @@ async void GoLookForUpdatesForThisUnity()
749749
var unity = GetSelectedUnity();
750750
if (unity == null) return;
751751

752-
753-
// NOTE if updates are not loaded, should wait for that
754752
if (dataGridUpdates.ItemsSource != null)
755753
{
756754
tabControl.SelectedIndex = 2;
755+
txtSearchBoxUpdates.Text = ""; // need to clear old results first
757756

758757
// NOTE for now, just set filter to current version, minus patch version "2021.1.7f1" > "2021.1"
759758
txtSearchBoxUpdates.Text = unity.Version.Substring(0, unity.Version.LastIndexOf('.'));
@@ -799,6 +798,7 @@ void NotifyIcon_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
799798
{
800799
this.Show();
801800
this.WindowState = WindowState.Normal;
801+
this.ShowInTaskbar = true;
802802
notifyIcon.Visible = false;
803803
// NOTE workaround for grid not focused when coming back from minimized window
804804
Tools.SetFocusToGrid(gridRecent, gridRecent.SelectedIndex);
@@ -2314,11 +2314,9 @@ void RefreshBuildReports()
23142314
r.Percentage = line2.Substring(space1 + 2, space2 - space1 - 1);
23152315
r.Path = line2.Substring(space2 + 2, line2.Length - space2 - 2);
23162316
r.Format = Path.GetExtension(r.Path);
2317-
23182317
singleReport.Items.Add(r);
23192318
}
23202319

2321-
23222320
if (collectStats == true)
23232321
{
23242322

@@ -2351,9 +2349,10 @@ void RefreshBuildReports()
23512349

23522350
singleReport.Stats.Add(r);
23532351
}
2354-
}
2355-
}
2356-
}
2352+
2353+
} // while endofstream
2354+
} // streamreader
2355+
} // filestream
23572356
}
23582357
catch (Exception e)
23592358
{
@@ -2780,8 +2779,8 @@ private void ChkRunAutomaticallyMinimized_Checked(object sender, RoutedEventArgs
27802779
if (this.IsActive == false) return; // dont run code on window init
27812780
var isChecked = (bool)((CheckBox)sender).IsChecked;
27822781

2783-
Properties.Settings.Default.runAutomaticallyMinimized = isChecked;
2784-
Properties.Settings.Default.Save();
2782+
Settings.Default.runAutomaticallyMinimized = isChecked;
2783+
Settings.Default.Save();
27852784
}
27862785

27872786
private void MenuItemEditPackages_Click(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)