Skip to content

Commit 0112336

Browse files
committed
Restart application fixed
1 parent c811018 commit 0112336

4 files changed

Lines changed: 21 additions & 14 deletions

File tree

Source/NETworkManager/MainWindow.xaml.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,14 @@ private void LoadApplicationList()
281281

282282
private async void MetroWindowMain_Closing(object sender, CancelEventArgs e)
283283
{
284+
// Force restart (if user has reset the settings or import them)
285+
if (SettingsManager.ForceRestart || ImportExportManager.ForceRestart)
286+
{
287+
RestartApplication(false);
288+
289+
_closeApplication = true;
290+
}
291+
284292
// Hide the application to tray
285293
if (!_closeApplication && SettingsManager.Current.Window_MinimizeInsteadOfTerminating)
286294
{
@@ -657,13 +665,6 @@ private async void CloseSettingsAction()
657665
MetroWindowMain.HideOverlay();
658666
}
659667

660-
// Force restart (if user has reset the settings or import them)
661-
if (SettingsManager.ForceRestart || ImportExportManager.ForceRestart)
662-
{
663-
RestartApplication();
664-
return;
665-
}
666-
667668
// Ask the user to restart (if he has changed the language)
668669
if ((_cultureCode != SettingsManager.Current.Localization_CultureCode) || (AllowsTransparency != SettingsManager.Current.Appearance_EnableTransparency))
669670
{
@@ -730,7 +731,7 @@ private void CloseApplicationAction()
730731
Close();
731732
}
732733

733-
private void RestartApplication()
734+
private void RestartApplication(bool closeApplication = true)
734735
{
735736
new Process
736737
{
@@ -741,8 +742,11 @@ private void RestartApplication()
741742
}
742743
}.Start();
743744

744-
_closeApplication = true;
745-
Close();
745+
if (closeApplication)
746+
{
747+
_closeApplication = true;
748+
Close();
749+
}
746750
}
747751

748752
public ICommand TextBoxSearchCommand

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
<system:String x:Key="String_Header_AddProfile">Profil hinzufügen</system:String>
6161
<system:String x:Key="String_Header_WakeUp">Aufwecken</system:String>
6262
<system:String x:Key="String_Header_AddClient">Client hinzufügen</system:String>
63+
<system:String x:Key="String_Header_Libraries">Bibliotheken</system:String>
64+
<system:String x:Key="String_Header_License">Lizenz</system:String>
6365

6466
<!-- Normal strings -->
6567
<system:String x:Key="String_ProductName">NETworkManager</system:String>
@@ -117,7 +119,6 @@
117119
<system:String x:Key="String_AddTemplate">Template hinzufügen</system:String>
118120
<system:String x:Key="String_EnterHostnameForClient">Geben Sie den Hostnamen ein, um den Client später zu identifizieren.</system:String>
119121
<system:String x:Key="String_AllRightReserved">Alle Rechte vorbehalten.</system:String>
120-
<system:String x:Key="String_Libraries">Bibliotheken</system:String>
121122
<system:String x:Key="String_Administrator">Administrator</system:String>
122123
<system:String x:Key="String_RestartAsAdministrator">Neustart als Administrator</system:String>
123124
<system:String x:Key="String_RestartAsAdministratorMessage">Zum ändern dieser Konfiguration werden administrative Rechte benötigt.</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
<system:String x:Key="String_Header_AddProfile">Add profile</system:String>
6161
<system:String x:Key="String_Header_WakeUp">Wake up</system:String>
6262
<system:String x:Key="String_Header_AddClient">Add client</system:String>
63+
<system:String x:Key="String_Header_Libraries">Libraries</system:String>
64+
<system:String x:Key="String_Header_License">License</system:String>
6365

6466
<!-- Normal strings -->
6567
<system:String x:Key="String_ProductName">NETworkManager</system:String>
@@ -117,7 +119,6 @@
117119
<system:String x:Key="String_AddTemplate">Add template</system:String>
118120
<system:String x:Key="String_EnterHostnameForClient">Enter the hostname to identify the client later.</system:String>
119121
<system:String x:Key="String_AllRightReserved">All rights reserved.</system:String>
120-
<system:String x:Key="String_Libraries">Libraries</system:String>
121122
<system:String x:Key="String_Administrator">Administrator</system:String>
122123
<system:String x:Key="String_RestartAsAdministrator">Restart as Administrator</system:String>
123124
<system:String x:Key="String_RestartAsAdministratorMessage">Administrative rights are required to change this configuration.</system:String>

Source/NETworkManager/Views/Settings/AboutView.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<TextBlock Text="{DynamicResource String_AllRightReserved}" Style="{StaticResource DefaultTextBlock}" />
2222
</StackPanel>
2323
</Grid>
24-
<TextBlock Text="{DynamicResource String_Libraries}" Style="{StaticResource HeaderTextBlock}"/>
25-
<Grid>
24+
<TextBlock Text="{DynamicResource String_Header_Libraries}" Style="{StaticResource HeaderTextBlock}"/>
25+
<Grid Margin="0,0,0,20">
2626
<Grid.ColumnDefinitions>
2727
<ColumnDefinition Width="Auto" />
2828
<ColumnDefinition Width="10" />
@@ -62,5 +62,6 @@
6262
</TextBlock>
6363
<TextBlock Grid.Column="2" Grid.Row="6" Text="{DynamicResource String_Libary_HeijdenDNSDescription}" Style="{StaticResource WrapTextBlock}" />
6464
</Grid>
65+
<TextBlock Text="{DynamicResource String_Header_License}" Style="{StaticResource HeaderTextBlock}"/>
6566
</StackPanel>
6667
</UserControl>

0 commit comments

Comments
 (0)