Skip to content

Commit

Permalink
Big Update! Added Pano as Submodule and Upgraded Metro to newest Vers…
Browse files Browse the repository at this point in the history
…ion. Added more

settings + implemented statistics request. Added More Theme Options. Some
Design Changes.
  • Loading branch information
Dreamcooled committed Aug 16, 2014
1 parent d0b6a6a commit c582537
Show file tree
Hide file tree
Showing 21 changed files with 490 additions and 274 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "MahApps.Metro"]
path = MahApps.Metro
url = https://github.com/Dreamcooled/MahApps.Metro.git
1 change: 1 addition & 0 deletions MahApps.Metro
Submodule MahApps.Metro added at bf7b05
6 changes: 6 additions & 0 deletions SjUpdater.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SjUpdater", "SjUpdater\SjUpdater.csproj", "{96123159-7974-4FEB-BD8C-7AB562DF3E01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MahApps.Metro", "MahApps.Metro\MahApps.Metro\MahApps.Metro.csproj", "{5B1710D2-5DC8-4754-91B2-19165DE49B3D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -13,6 +15,10 @@ Global
{96123159-7974-4FEB-BD8C-7AB562DF3E01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96123159-7974-4FEB-BD8C-7AB562DF3E01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96123159-7974-4FEB-BD8C-7AB562DF3E01}.Release|Any CPU.Build.0 = Release|Any CPU
{5B1710D2-5DC8-4754-91B2-19165DE49B3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B1710D2-5DC8-4754-91B2-19165DE49B3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B1710D2-5DC8-4754-91B2-19165DE49B3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B1710D2-5DC8-4754-91B2-19165DE49B3D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
11 changes: 2 additions & 9 deletions SjUpdater/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@
</startup>
<userSettings>
<SjUpdater.Properties.Settings>
<setting name="Shows" serializeAs="Xml">
<value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>How I Met your Mother</string>
<string>Orange is the new Black</string>
<string>The Big Bang Theory</string>
</ArrayOfString>
</value>
<setting name="uid" serializeAs="String">
<value />
</setting>
</SjUpdater.Properties.Settings>
</userSettings>
Expand Down
10 changes: 9 additions & 1 deletion SjUpdater/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Binary file not shown.
261 changes: 137 additions & 124 deletions SjUpdater/MainWindow.xaml

Large diffs are not rendered by default.

62 changes: 37 additions & 25 deletions SjUpdater/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public partial class MainWindow
public MainWindow()
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
Application.Current.SessionEnding += Current_SessionEnding;

DownloadCommand = new SimpleCommand<object, String>(DownloadCommandExecute);
EpisodeClickedCommand = new SimpleCommand<object, EpisodeViewModel>(OnEpisodeViewClicked);
Expand All @@ -45,7 +47,8 @@ public MainWindow()
TerminateCommand = new SimpleCommand<object, object>(Terminate);

_setti = Settings.Instance;
_currentAccent = ThemeManager.DefaultAccents.First(x => x.Name == _setti.ThemeAccent);
_currentAccent = ThemeManager.GetAccent(_setti.ThemeAccent);
_currentTheme = ThemeManager.GetAppTheme(_setti.ThemeBase);


InitializeComponent();
Expand All @@ -69,6 +72,8 @@ public MainWindow()
{
Hide();
}

StaticInstance.SmartThreadPool.QueueWorkItem(() => Stats.SendStats(!_setti.NoPersonalData));//Todo: Make Optional?
}

void t_Elapsed(object sender, ElapsedEventArgs e)
Expand Down Expand Up @@ -140,9 +145,6 @@ private void SettingsClicked(object o)
return;
}

AddShowFlyout.IsOpen = false;
FilterFlyout.IsOpen = false;
_lastpage = CurrentPage();
SwitchPage(3);
}

Expand Down Expand Up @@ -181,12 +183,24 @@ public String CurrentAccent
get { return _currentAccent.Name; }
set
{
_currentAccent = ThemeManager.DefaultAccents.First(x => x.Name == value);
ThemeManager.ChangeTheme(this, _currentAccent, Theme.Dark);
_currentAccent = ThemeManager.GetAccent(value);
ThemeManager.ChangeAppStyle(Application.Current, _currentAccent,_currentTheme);
_setti.ThemeAccent = _currentAccent.Name;
}
}

private AppTheme _currentTheme;
public String CurrentTheme
{
get { return _currentTheme.Name; }
set
{
_currentTheme = ThemeManager.GetAppTheme(value);
ThemeManager.ChangeAppStyle(Application.Current, _currentAccent, _currentTheme);
_setti.ThemeBase = _currentTheme.Name;
}
}

public ICommand AddShowCommand { get; private set; }
public ICommand SettingsCommand { get; private set; }
public ICommand EpisodeClickedCommand { get; private set; }
Expand Down Expand Up @@ -219,13 +233,16 @@ void SwitchPage(int page)
if (g.Visibility ==Visibility.Visible)
{
g.Visibility = Visibility.Collapsed;
_lastpage = i;
}
if (i++ == page)
{
g.Visibility = Visibility.Visible;
}

}
AddShowFlyout.IsOpen = false;
FilterFlyout.IsOpen = false;

}

Expand Down Expand Up @@ -265,6 +282,8 @@ private void UpdateShowSearch(string query)
private void OnEpisodeViewClicked(EpisodeViewModel episodeView)
{
EpisodeGrid.DataContext = episodeView;
episodeView.Episode.NewEpisode = false;
episodeView.Episode.NewUpdate = false;
SwitchPage(2);
}

Expand All @@ -273,14 +292,11 @@ void on_ShowViewClicked(object sender, ShowViewModel showView)
{
if(!IsVisible)
Show();
AddShowFlyout.IsOpen = false;
FilterFlyout.IsOpen = false;
showView.Show.NewEpisodes = false;
OnShowViewClicked(showView);
}
private void OnShowViewClicked(ShowViewModel showView)
{
showView.Show.Notified = false;
showView.Show.NewEpisodes = false;
ShowGrid.DataContext = showView;
FilterFlyout.DataContext = showView;
SwitchPage(1);
Expand Down Expand Up @@ -323,8 +339,6 @@ private void EpisodesBack(object sender, RoutedEventArgs e)

private void NavBack(object sender, ExecutedRoutedEventArgs e)
{
AddShowFlyout.IsOpen = false;
FilterFlyout.IsOpen = false;
switch (CurrentPage())
{
case 1:
Expand Down Expand Up @@ -374,30 +388,28 @@ private void MainWindow_OnClosing(object sender, CancelEventArgs e)
Environment.Exit(0);
}
}


/*var fadeAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.6f)));
fadeAnimation.AccelerationRatio = 0.2f;
fadeAnimation.Completed += (Sender, Args) =>
{
Visibility = Visibility.Collapsed;
Settings.Save();
Environment.Exit(0);
};
e.Cancel = true;
BeginAnimation(OpacityProperty, fadeAnimation);*/
}


private void Terminate(object obj)
{
Settings.Save();
if (Debugger.IsAttached)
if (Debugger.IsAttached)
Environment.Exit(0);
else
Application.Current.Shutdown(0);
}

void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
Settings.Save();
}

void Current_SessionEnding(object sender, SessionEndingCancelEventArgs e)
{
Settings.Save();
}


private void ShowFilter(object sender, RoutedEventArgs e)
{
Expand Down
37 changes: 37 additions & 0 deletions SjUpdater/Model/FavEpisodeData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using SjUpdater.Utils;

namespace SjUpdater.Model
Expand All @@ -8,6 +9,8 @@ public class FavEpisodeData : PropertyChangedImpl
{
private string _name;
private int _number;
private bool _newEpisode;
private bool _newUpdate;
private ObservableCollection<DownloadData> _downloads;
private FavSeasonData _season;
private SjDeReview _reviewInfoReview;
Expand All @@ -18,6 +21,8 @@ public FavEpisodeData()
_name = "";
_number = -1;
_reviewInfoReview = null;
_newEpisode = false;
_newUpdate = false;
}


Expand Down Expand Up @@ -61,6 +66,38 @@ public int Number
}
}

/// <summary>
/// Is set to true when the episode is new. Reset this to false, yourself
/// </summary>
[XmlIgnore]
public bool NewEpisode
{
get { return _newEpisode; }
internal set
{
if (value == _newEpisode) return;
_newEpisode = value;
OnPropertyChanged();
}
}

/// <summary>
/// Is set to true when the episode received a new Download. Reset this to false, yourself
/// </summary>
[XmlIgnore]
public bool NewUpdate
{
get { return _newUpdate; }
internal set
{
if (value == _newUpdate || _newEpisode) return;
_newUpdate = value;
OnPropertyChanged();
}
}



public ObservableCollection<DownloadData> Downloads
{
get { return _downloads; }
Expand Down
Loading

0 comments on commit c582537

Please sign in to comment.