|
|
@ -80,7 +80,7 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DataContext = this;
|
|
|
|
DataContext = this;
|
|
|
|
|
|
|
|
|
|
|
|
Instance_ConfigurationUpdated(null, EventArgs.Empty);
|
|
|
|
UpdateButtons();
|
|
|
|
|
|
|
|
|
|
|
|
_logManager.LoggerLoaded += LoadLogWindow;
|
|
|
|
_logManager.LoggerLoaded += LoadLogWindow;
|
|
|
|
_configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated;
|
|
|
|
_configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated;
|
|
|
@ -92,6 +92,21 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
/// <param name="sender">The source of the event.</param>
|
|
|
|
/// <param name="sender">The source of the event.</param>
|
|
|
|
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
|
|
|
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
|
|
|
void Instance_ConfigurationUpdated(object sender, EventArgs e)
|
|
|
|
void Instance_ConfigurationUpdated(object sender, EventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UpdateButtons();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dispatcher.InvokeAsync(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var logWindow = App.Instance.Windows.OfType<LogWindow>().FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((logWindow == null && _configurationManager.Configuration.ShowLogWindow) || (logWindow != null && !_configurationManager.Configuration.ShowLogWindow))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logManager.ReloadLogger(_configurationManager.Configuration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateButtons()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Dispatcher.InvokeAsync(() =>
|
|
|
|
Dispatcher.InvokeAsync(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -102,13 +117,6 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
separatorDeveloperTools.Visibility = developerToolsVisibility;
|
|
|
|
separatorDeveloperTools.Visibility = developerToolsVisibility;
|
|
|
|
cmdReloadServer.Visibility = developerToolsVisibility;
|
|
|
|
cmdReloadServer.Visibility = developerToolsVisibility;
|
|
|
|
cmOpenExplorer.Visibility = developerToolsVisibility;
|
|
|
|
cmOpenExplorer.Visibility = developerToolsVisibility;
|
|
|
|
|
|
|
|
|
|
|
|
var logWindow = App.Instance.Windows.OfType<LogWindow>().FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((logWindow == null && _configurationManager.Configuration.ShowLogWindow) || (logWindow != null && !_configurationManager.Configuration.ShowLogWindow))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logManager.ReloadLogger(_configurationManager.Configuration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -120,6 +128,7 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
void LoadLogWindow(object sender, EventArgs args)
|
|
|
|
void LoadLogWindow(object sender, EventArgs args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CloseLogWindow();
|
|
|
|
CloseLogWindow();
|
|
|
|
|
|
|
|
|
|
|
|
Dispatcher.InvokeAsync(() =>
|
|
|
|
Dispatcher.InvokeAsync(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Add our log window if specified
|
|
|
|
// Add our log window if specified
|
|
|
|