Skip to content

Commit 884daa8

Browse files
committed
added --show-statistics command-line switch that will show the statistics window instead of just starting the app in system tray
1 parent 9ea1d73 commit 884daa8

4 files changed

Lines changed: 21 additions & 6 deletions

File tree

GabNetStats/Forms/FormMain.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ private void OnLoad(object sender, EventArgs e)
126126
FormStatsOverlay.frmAdv.Show();
127127
}
128128

129-
showBalloon(true);
129+
showBalloon(preload: !Program.ShowStatisticsOnStart);
130+
131+
if (Program.ShowStatisticsOnStart)
132+
{
133+
fBal.DisableAutoClose();
134+
}
130135
}
131136

132137
private void OnAbout(object sender, EventArgs e)
@@ -441,7 +446,7 @@ private void notifyIconActivity_MouseClick(object sender, MouseEventArgs e)
441446
{
442447
if (e.Button == MouseButtons.Left)
443448
{
444-
showBalloon(false);
449+
showBalloon(preload: false);
445450
}
446451
}
447452

@@ -471,7 +476,7 @@ private void notifyIconPing_MouseClick(object sender, MouseEventArgs e)
471476
{
472477
if (e.Button == MouseButtons.Left)
473478
{
474-
showBalloon(false);
479+
showBalloon(preload: false);
475480
}
476481
}
477482
}

GabNetStats/Forms/FormStatsOverlay.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ private void btnAdvanced_Click(object sender, EventArgs e)
220220
frmAdv.Show();
221221
}
222222

223+
internal void DisableAutoClose()
224+
{
225+
chkAutoClose.Checked = false;
226+
}
227+
223228
private void chkAutoClose_CheckStateChanged(object sender, EventArgs e)
224229
{
225230
counter = 0;

GabNetStats/GabNetStats.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@
9090
<AssemblyTitle>GabNetStats</AssemblyTitle>
9191
<BaseOutputPath>bin\</BaseOutputPath>
9292
<Nullable>disable</Nullable>
93-
<AssemblyVersion>1.1.2.2</AssemblyVersion>
94-
<FileVersion>1.1.2.2</FileVersion>
95-
<Version>1.1.2.2</Version>
93+
<AssemblyVersion>1.1.2.3</AssemblyVersion>
94+
<FileVersion>1.1.2.3</FileVersion>
95+
<Version>1.1.2.3</Version>
9696
</PropertyGroup>
9797
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
9898
<Exec Command="echo Configuration: $(Configuration)&#xD;&#xA;echo DevEnvDir: $(DevEnvDir)&#xD;&#xA;echo OutDir: $(OutDir)&#xD;&#xA;echo ProjectDir: $(ProjectDir)&#xD;&#xA;echo VisualStudioVersion: $(VisualStudioVersion)&#xD;&#xA;echo AssemblySearchPaths: $(AssemblySearchPaths)&#xD;&#xA;echo AssemblyName: $(AssemblyName)&#xD;&#xA;echo BaseIntermediateOutputPath: $(BaseIntermediateOutputPath)&#xD;&#xA;echo CscToolPath: $(CscToolPath)&#xD;&#xA;echo MSBuildProjectDirectory: $(MSBuildProjectDirectory)&#xD;&#xA;del /F &quot;$(OutDir)\License.*.txt&quot;" />

GabNetStats/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ static class Program
1717
/// <summary>Set to true when --show-network-details was passed on the command line.</summary>
1818
public static bool ShowNetworkDetailsOnStart { get; private set; }
1919

20+
/// <summary>Set to true when --show-statistics was passed on the command line.</summary>
21+
public static bool ShowStatisticsOnStart { get; private set; }
22+
2023
[STAThread]
2124
static void Main()
2225
{
@@ -26,6 +29,8 @@ static void Main()
2629
{
2730
if (arg.Equals("--show-network-details", StringComparison.OrdinalIgnoreCase))
2831
ShowNetworkDetailsOnStart = true;
32+
if (arg.Equals("--show-statistics", StringComparison.OrdinalIgnoreCase))
33+
ShowStatisticsOnStart = true;
2934
}
3035

3136
Application.EnableVisualStyles();

0 commit comments

Comments
 (0)