mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-20 06:02:23 +00:00
Fix Linux restore backup function
Fixed the issue that the guiNConfig.json file cannot be restored in the backup and restore function
This commit is contained in:
parent
626ebfe65d
commit
4a7bafd011
4 changed files with 11 additions and 11 deletions
|
@ -154,7 +154,7 @@ namespace ServiceLib.ViewModels
|
||||||
ProcUtils.ProcessStart(upgradeFileName, Global.RebootAs, Utils.StartupPath());
|
ProcUtils.ProcessStart(upgradeFileName, Global.RebootAs, Utils.StartupPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
service?.Shutdown();
|
service?.Shutdown(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -303,7 +303,7 @@ namespace ServiceLib.ViewModels
|
||||||
{
|
{
|
||||||
if (!blWindowsShutDown)
|
if (!blWindowsShutDown)
|
||||||
{
|
{
|
||||||
_updateView?.Invoke(EViewAction.Shutdown, null);
|
_updateView?.Invoke(EViewAction.Shutdown, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,9 +329,9 @@ namespace ServiceLib.ViewModels
|
||||||
_updateView?.Invoke(EViewAction.ShowHideWindow, blShow);
|
_updateView?.Invoke(EViewAction.ShowHideWindow, blShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Shutdown()
|
public void Shutdown(bool byUser)
|
||||||
{
|
{
|
||||||
_updateView?.Invoke(EViewAction.Shutdown, null);
|
_updateView?.Invoke(EViewAction.Shutdown, byUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Actions
|
#endregion Actions
|
||||||
|
|
|
@ -70,13 +70,9 @@ public partial class App : Application
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void MenuExit_Click(object? sender, EventArgs e)
|
private async void MenuExit_Click(object? sender, EventArgs e)
|
||||||
{
|
|
||||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
|
||||||
{
|
{
|
||||||
var service = Locator.Current.GetService<MainWindowViewModel>();
|
var service = Locator.Current.GetService<MainWindowViewModel>();
|
||||||
if (service != null) await service.MyAppExitAsync(false);
|
if (service != null) await service.MyAppExitAsync(true);
|
||||||
|
service?.Shutdown(true);
|
||||||
desktop.Shutdown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -223,6 +223,10 @@ namespace v2rayN.Desktop.Views
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.Shutdown:
|
case EViewAction.Shutdown:
|
||||||
|
if (obj != null && _blCloseByUser == false)
|
||||||
|
{
|
||||||
|
_blCloseByUser = (bool)obj;
|
||||||
|
}
|
||||||
StorageUI();
|
StorageUI();
|
||||||
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue