Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharkboy-j committed May 19, 2022
2 parents 2dff098 + 5b44919 commit cb3d791
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/ClearBinObjFolders.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
start for /d /r . %%d in (bin,obj, ClientBin,Generated_Code) do @if exist "%%d" rd /s /q "%%d"
4 changes: 2 additions & 2 deletions src/Kebler.Services/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}");
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Kebler/Kebler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Remove="Kebler.ico" />
Expand Down
13 changes: 9 additions & 4 deletions src/Kebler/ViewModels/KeblerViewModel/ConnectionThings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
15 changes: 14 additions & 1 deletion src/Kebler/ViewModels/KeblerViewModel/TitleHeaderMenuActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,14 @@ public IEnumerable<MenuItem> ReInitServers(
/// </summary>
public void Settings()
{
Process.Start(new ProcessStartInfo("cmd", $"/c start {ConstStrings.CONFIGPATH}") { CreateNoWindow = true });
Log.Ui();
Log.Info($"Try start => cmd {ConstStrings.CONFIGPATH}");
var p = new Process();
p.StartInfo = new ProcessStartInfo(@ConstStrings.CONFIGPATH)
{
UseShellExecute = true
};
p.Start();
}


Expand All @@ -109,6 +116,8 @@ public void Settings()
/// </summary>
public void Preferences()
{
Log.Ui();

if (_settings != null)
manager.ShowDialogAsync(new ServerPreferencesViewModel(_settings));
else
Expand All @@ -123,6 +132,8 @@ public void Preferences()
/// </summary>
private void ServerClicked(object sender, RoutedEventArgs e)
{
Log.Ui();

if (!(sender is MenuItem menuItem) || !(menuItem.Tag is Server server))
return;

Expand All @@ -136,6 +147,8 @@ private void ServerClicked(object sender, RoutedEventArgs e)
/// </summary>
private void LanguageChanged(object sender, RoutedEventArgs e)
{
Log.Ui();

if (!(sender is MenuItem menuItem) || !(menuItem.Tag is CultureInfo cultureInfo))
return;

Expand Down
8 changes: 7 additions & 1 deletion src/Kebler/Views/TopBarView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ private void OpenLogs(object sender, RoutedEventArgs e)

try
{
Process.Start(new ProcessStartInfo("explorer.exe", $"{Log.LogFileInfo.DirectoryName}") { 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)
{
Expand Down

0 comments on commit cb3d791

Please sign in to comment.