From d53938f07310ad4c5d6f6971669f9822511ec385 Mon Sep 17 00:00:00 2001 From: Shark Date: Wed, 10 Nov 2021 16:01:03 +0300 Subject: [PATCH 1/5] fix #3148736320 try fix #624686845 --- src/Kebler.Services/Log.cs | 2 +- .../ViewModels/KeblerViewModel/ConnectionThings.cs | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Kebler.Services/Log.cs b/src/Kebler.Services/Log.cs index 032d606e..98c37283 100644 --- a/src/Kebler.Services/Log.cs +++ b/src/Kebler.Services/Log.cs @@ -133,7 +133,7 @@ private static string Format(string message, LogType type, int lineNumber = 0, s private static string FormatException(Exception ex) { - return $"{ex.Message}{Environment.NewLine}{ex.StackTrace}"; + return $"{ex.Message}{Environment.NewLine}{ex.StackTrace}{Environment.NewLine}{ex.InnerException}"; } private static string GetClassName(string path) diff --git a/src/Kebler/ViewModels/KeblerViewModel/ConnectionThings.cs b/src/Kebler/ViewModels/KeblerViewModel/ConnectionThings.cs index fac5d7f5..1c6b0be5 100644 --- a/src/Kebler/ViewModels/KeblerViewModel/ConnectionThings.cs +++ b/src/Kebler/ViewModels/KeblerViewModel/ConnectionThings.cs @@ -215,11 +215,16 @@ private void StartCycle() _transmissionClient.GetSessionSettingsAsync(_cancelTokenSource.Token), LocalizationProvider.GetLocalizedValue( nameof(Resources.Strings.MW_StatusText_Settings)))).Value; - ParseTransmissionServerSettings(); - ParseStats(); - if (allTorrents.Clone() is TransmissionTorrents data) - ProcessParsingTransmissionResponse(data); + if (allTorrents != null) + { + ParseTransmissionServerSettings(); + ParseStats(); + + if (allTorrents?.Clone() is TransmissionTorrents data) + ProcessParsingTransmissionResponse(data); + } + } else { From 304455bec4d2bb5cdd380cfe4d085ab4d83df5b2 Mon Sep 17 00:00:00 2001 From: T1me <27355911+T1me@users.noreply.github.com> Date: Sat, 13 Nov 2021 06:55:38 +0800 Subject: [PATCH 2/5] bug fix fix cannot open config path including blank --- src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs index 8f4815ab..2eb9eb22 100644 --- a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs +++ b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs @@ -100,7 +100,7 @@ public IEnumerable ReInitServers( /// public void Settings() { - Process.Start(new ProcessStartInfo("cmd", $"/c start {ConstStrings.CONFIGPATH}") { CreateNoWindow = true }); + Process.Start(new ProcessStartInfo("cmd", $@"/c start "{ConstStrings.CONFIGPATH}"") { CreateNoWindow = true }); } From 2f61814a4e674f2b5911c28464df9c8cedce6d80 Mon Sep 17 00:00:00 2001 From: Shark Date: Mon, 15 Nov 2021 12:01:49 +0300 Subject: [PATCH 3/5] fix --- src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs index 2eb9eb22..22ebdb2d 100644 --- a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs +++ b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs @@ -100,7 +100,7 @@ public IEnumerable ReInitServers( /// public void Settings() { - Process.Start(new ProcessStartInfo("cmd", $@"/c start "{ConstStrings.CONFIGPATH}"") { CreateNoWindow = true }); + Process.Start(new ProcessStartInfo("cmd", $@"/c start {ConstStrings.CONFIGPATH}") { CreateNoWindow = true }); } From af6ff6cb793816bf344aa32b42690b2132a08fd6 Mon Sep 17 00:00:00 2001 From: Shark Date: Mon, 15 Nov 2021 12:19:37 +0300 Subject: [PATCH 4/5] fix path --- src/ClearBinObjFolders.bat | 1 + src/Kebler.Services/Log.cs | 2 +- src/Kebler/Kebler.csproj | 2 +- .../KeblerViewModel/TitleHeaderMenuActions.cs | 10 +++++++++- src/Kebler/Views/TopBarView.xaml.cs | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/ClearBinObjFolders.bat diff --git a/src/ClearBinObjFolders.bat b/src/ClearBinObjFolders.bat new file mode 100644 index 00000000..6950dbd0 --- /dev/null +++ b/src/ClearBinObjFolders.bat @@ -0,0 +1 @@ +start for /d /r . %%d in (bin,obj, ClientBin,Generated_Code) do @if exist "%%d" rd /s /q "%%d" \ No newline at end of file diff --git a/src/Kebler.Services/Log.cs b/src/Kebler.Services/Log.cs index 98c37283..6e9b7d86 100644 --- a/src/Kebler.Services/Log.cs +++ b/src/Kebler.Services/Log.cs @@ -173,7 +173,7 @@ private static void CheckFileLength() } catch (Exception ex) { - File.AppendAllTextAsync(FilePath, $"Log file size more than 200mb, but error occured when deleting it.{Environment.NewLine}{ex.Message}"); + //File.AppendAllTextAsync(FilePath, $"Log file size more than 200mb, but error occured when deleting it.{Environment.NewLine}{ex.Message}"); } } } diff --git a/src/Kebler/Kebler.csproj b/src/Kebler/Kebler.csproj index 0d4228c1..2ad75f28 100644 --- a/src/Kebler/Kebler.csproj +++ b/src/Kebler/Kebler.csproj @@ -21,7 +21,6 @@ Debug;Release;Portable KeblerD.ico x64 - false @@ -48,6 +47,7 @@ portable true x64 + DEBUG;TRACE diff --git a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs index 22ebdb2d..c7b0fabb 100644 --- a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs +++ b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs @@ -100,7 +100,9 @@ public IEnumerable ReInitServers( /// public void Settings() { - Process.Start(new ProcessStartInfo("cmd", $@"/c start {ConstStrings.CONFIGPATH}") { CreateNoWindow = true }); + Log.Ui(); + var args = $@"/c start ""{ConstStrings.CONFIGPATH}"""; + Process.Start(new ProcessStartInfo("cmd", args) { CreateNoWindow = true }); } @@ -109,6 +111,8 @@ public void Settings() /// public void Preferences() { + Log.Ui(); + if (_settings != null) manager.ShowDialogAsync(new ServerPreferencesViewModel(_settings)); else @@ -123,6 +127,8 @@ public void Preferences() /// private void ServerClicked(object sender, RoutedEventArgs e) { + Log.Ui(); + if (!(sender is MenuItem menuItem) || !(menuItem.Tag is Server server)) return; @@ -136,6 +142,8 @@ private void ServerClicked(object sender, RoutedEventArgs e) /// private void LanguageChanged(object sender, RoutedEventArgs e) { + Log.Ui(); + if (!(sender is MenuItem menuItem) || !(menuItem.Tag is CultureInfo cultureInfo)) return; diff --git a/src/Kebler/Views/TopBarView.xaml.cs b/src/Kebler/Views/TopBarView.xaml.cs index 3b04edbf..77f6e7cc 100644 --- a/src/Kebler/Views/TopBarView.xaml.cs +++ b/src/Kebler/Views/TopBarView.xaml.cs @@ -56,7 +56,8 @@ private void OpenLogs(object sender, RoutedEventArgs e) try { - Process.Start(new ProcessStartInfo("explorer.exe", $"{Log.LogFileInfo.DirectoryName}") { CreateNoWindow = true }); + var args = $@"/c start ""{Log.LogFileInfo.DirectoryName}"""; + Process.Start(new ProcessStartInfo("explorer.exe", args) { CreateNoWindow = true }); } catch (Exception ex) { From 5b44919a450e231fd59664c5744b099d7ecd2b65 Mon Sep 17 00:00:00 2001 From: Rebell Date: Thu, 19 May 2022 14:28:21 +0300 Subject: [PATCH 5/5] try fix settings path --- .../ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs | 9 +++++++-- src/Kebler/Views/TopBarView.xaml.cs | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs index c7b0fabb..f98261a7 100644 --- a/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs +++ b/src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs @@ -101,8 +101,13 @@ public IEnumerable ReInitServers( public void Settings() { Log.Ui(); - var args = $@"/c start ""{ConstStrings.CONFIGPATH}"""; - Process.Start(new ProcessStartInfo("cmd", args) { CreateNoWindow = true }); + Log.Info($"Try start => cmd {ConstStrings.CONFIGPATH}"); + var p = new Process(); + p.StartInfo = new ProcessStartInfo(@ConstStrings.CONFIGPATH) + { + UseShellExecute = true + }; + p.Start(); } diff --git a/src/Kebler/Views/TopBarView.xaml.cs b/src/Kebler/Views/TopBarView.xaml.cs index 77f6e7cc..ec05443d 100644 --- a/src/Kebler/Views/TopBarView.xaml.cs +++ b/src/Kebler/Views/TopBarView.xaml.cs @@ -56,8 +56,13 @@ private void OpenLogs(object sender, RoutedEventArgs e) try { - var args = $@"/c start ""{Log.LogFileInfo.DirectoryName}"""; - Process.Start(new ProcessStartInfo("explorer.exe", args) { CreateNoWindow = true }); + App.Log.Info($"Try start => cmd {Log.LogFileInfo.DirectoryName}"); + var p = new Process(); + p.StartInfo = new ProcessStartInfo(@Log.LogFileInfo.DirectoryName) + { + UseShellExecute = true + }; + p.Start(); } catch (Exception ex) {