mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-23 18:44:45 +01:00
Added the ability to reload the server and created a Plugins solution
This commit is contained in:
parent
f1770605ea
commit
fb88e4d5fc
@@ -1,4 +1,7 @@
|
||||
using System.Diagnostics;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
|
||||
namespace MediaBrowser.ServerApplication
|
||||
@@ -6,12 +9,38 @@ namespace MediaBrowser.ServerApplication
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
public partial class MainWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
//LoadKernel();
|
||||
Loaded += MainWindow_Loaded;
|
||||
}
|
||||
|
||||
void MainWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public void OnPropertyChanged(String info)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
||||
}
|
||||
}
|
||||
|
||||
private int _loadingImageIndex;
|
||||
public int LoadingImageIndex
|
||||
{
|
||||
get { return _loadingImageIndex; }
|
||||
set
|
||||
{
|
||||
_loadingImageIndex = value;
|
||||
OnPropertyChanged("LoadingImageIndex");
|
||||
}
|
||||
}
|
||||
|
||||
#region Context Menu events
|
||||
@@ -31,6 +60,36 @@ namespace MediaBrowser.ServerApplication
|
||||
Close();
|
||||
}
|
||||
|
||||
private async void cmdReloadServer_click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MbTaskbarIcon.ShowBalloonTip("Media Browser is reloading", "Please wait...", BalloonIcon.Info);
|
||||
|
||||
LoadingImageIndex = 0;
|
||||
|
||||
Timer timer = new Timer(LoadingIconTimerCallback, null, 0, 250);
|
||||
|
||||
await (Application.Current as App).ReloadKernel().ConfigureAwait(false);
|
||||
|
||||
timer.Dispose();
|
||||
|
||||
LoadingImageIndex = 0;
|
||||
}
|
||||
|
||||
private void LoadingIconTimerCallback(object stateInfo)
|
||||
{
|
||||
const int numImages = 4;
|
||||
|
||||
if (LoadingImageIndex < numImages)
|
||||
{
|
||||
LoadingImageIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadingImageIndex = 1;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user