Permalink
Browse files

Trunk

* Configurator; Added support for root page and Yahoo Weather
* Renamed weather rss file, for better support when switching between weather units.

git-svn-id: https://videobrowser.googlecode.com/svn/trunk@1036 096cc86f-8a4c-0410-9b85-8b5e0eee1c45
  • Loading branch information...
1 parent ffe57ca commit 7adf92f64e3643c85ce553f39d09a29587ff890e jmanghera committed Apr 26, 2009
@@ -1,5 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <ProjectView>ShowAllFiles</ProjectView>
+ <ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
@@ -92,23 +92,21 @@
<CheckBox Margin="370,95,0,0" Name="cbxOptionUnwatchedOnVideo" HorizontalAlignment="Left" Width="195" Content="Watched Indicator on Items" Height="32" VerticalAlignment="Top" Click="cbxOptionUnwatchedOnVideo_Click" ToolTip="Display indicator for previously viewed items" />
<CheckBox Margin="370,119,0,0" Name="cbxOptionUnwatchedDetailView" HorizontalAlignment="Left" Width="243" Content="Watched Indicator in Detail View" Height="32" VerticalAlignment="Top" Click="cbxOptionUnwatchedDetailView_Click" ToolTip="Display indicator in detail view for previously viewed items" />
<CheckBox Margin="370,143,0,0" Name="cbxOptionDefaultToUnwatched" HorizontalAlignment="Left" Width="234" Content="Default to First Unwatched Item" Click="cbxOptionDefaultToUnwatched_Click" Height="32" VerticalAlignment="Top" ToolTip="Automatically highlight the first unwatched item" />
- <ComboBox Height="23" HorizontalAlignment="Left" Margin="146,0,0,81" Name="ddlOptionViewTheme" VerticalAlignment="Bottom" Width="120" SelectionChanged="ddlOptionViewTheme_SelectionChanged" ToolTip="Visual theme of Media Browser" />
- <Label Height="35.38" HorizontalAlignment="Left" Margin="37,0,0,72" VerticalAlignment="Bottom" Width="120" ToolTip="Visual theme of Media Browser">Visual Theme</Label>
- <Label HorizontalAlignment="Left" Margin="6,0,0,107" Width="182" Height="35.38" VerticalAlignment="Bottom">Theme Settings</Label>
- <ComboBox Height="23" HorizontalAlignment="Left" Margin="146,0,0,52" Name="ddlOptionThemeColor" VerticalAlignment="Bottom" Width="120" SelectionChanged="ddlOptionThemeColor_SelectionChanged" ToolTip="Change the color scheme of a theme" />
- <Label Height="35.38" HorizontalAlignment="Left" Margin="37,0,0,43" VerticalAlignment="Bottom" Width="120" ToolTip="Change the color scheme of a theme">Color Scheme</Label>
- <ComboBox Height="23" HorizontalAlignment="Left" Margin="146,0,0,23" Name="ddlOptionThemeFont" VerticalAlignment="Bottom" Width="120" SelectionChanged="ddlOptionThemeFont_SelectionChanged" ToolTip="Font size displayed within Media Browser" />
- <Label Height="35.38" HorizontalAlignment="Left" Margin="37,0,0,14" VerticalAlignment="Bottom" Width="120" ToolTip="Font size displayed within Media Browser">Font Size</Label>
- <Rectangle Height="2" Margin="37,184.38,31,0" Name="rectangle1" Stroke="#FFA8A8A8" VerticalAlignment="Top" />
- <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,0,40,52" Name="ddlWeatherUnits" ToolTip="Change the color scheme of a theme" VerticalAlignment="Bottom" Width="120">
- <ComboBoxItem IsSelected="True">Celsius</ComboBoxItem>
- <ComboBoxItem>Farenheit</ComboBoxItem>
+ <ComboBox Height="23" HorizontalAlignment="Left" Margin="146,0,0,118" Name="ddlOptionViewTheme" VerticalAlignment="Bottom" Width="120" SelectionChanged="ddlOptionViewTheme_SelectionChanged" ToolTip="Visual theme of Media Browser" />
+ <Label Height="35.38" HorizontalAlignment="Left" Margin="37,0,0,109" VerticalAlignment="Bottom" Width="120" ToolTip="Visual theme of Media Browser">Visual Theme</Label>
+ <Label HorizontalAlignment="Left" Margin="6,0,0,144" Width="182" Height="35.38" VerticalAlignment="Bottom">Theme Settings</Label>
+ <ComboBox Height="23" HorizontalAlignment="Left" Margin="146,0,0,89" Name="ddlOptionThemeColor" VerticalAlignment="Bottom" Width="120" SelectionChanged="ddlOptionThemeColor_SelectionChanged" ToolTip="Change the color scheme of a theme" />
+ <Label Height="35.38" HorizontalAlignment="Left" Margin="37,0,0,80" VerticalAlignment="Bottom" Width="120" ToolTip="Change the color scheme of a theme">Color Scheme</Label>
+ <ComboBox Height="23" HorizontalAlignment="Left" Margin="146,0,0,60" Name="ddlOptionThemeFont" VerticalAlignment="Bottom" Width="120" SelectionChanged="ddlOptionThemeFont_SelectionChanged" ToolTip="Font size displayed within Media Browser" />
+ <Label Height="35.38" HorizontalAlignment="Left" Margin="37,0,0,51" VerticalAlignment="Bottom" Width="120" ToolTip="Font size displayed within Media Browser">Font Size</Label>
+ <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,0,40,43" Name="ddlWeatherUnits" ToolTip="Change the color scheme of a theme" VerticalAlignment="Bottom" Width="120">
</ComboBox>
- <Label Height="35.38" HorizontalAlignment="Right" Margin="0,0,154,43" ToolTip="Change the color scheme of a theme" VerticalAlignment="Bottom" Width="120">Units</Label>
- <Label Height="35.38" HorizontalAlignment="Right" Margin="0,0,154,72" ToolTip="Change the color scheme of a theme" VerticalAlignment="Bottom" Width="120">Location ID</Label>
- <Button Height="23" HorizontalAlignment="Right" Margin="0,0,40,23" Name="btnWeatherID" VerticalAlignment="Bottom" Width="120">Save Weather</Button>
- <TextBox Height="23" HorizontalAlignment="Right" Margin="0,0,40,81" Name="tbxWeatherID" VerticalAlignment="Bottom" Width="120" />
- <Label Height="35.38" HorizontalAlignment="Right" Margin="0,0,137,110" VerticalAlignment="Bottom" Width="182">Weather Settings</Label>
+ <Label Height="35.38" HorizontalAlignment="Right" Margin="0,0,154,34" ToolTip="Change the color scheme of a theme" VerticalAlignment="Bottom" Width="120">Units</Label>
+ <Label Height="35.38" HorizontalAlignment="Right" Margin="0,0,154,61.62" ToolTip="Change the color scheme of a theme" VerticalAlignment="Bottom" Width="120">Location ID</Label>
+ <Button Height="23" HorizontalAlignment="Right" Margin="0,0,40,14" Name="btnWeatherID" VerticalAlignment="Bottom" Width="120" Click="btnWeatherID_Click">Save Weather</Button>
+ <TextBox Height="23" HorizontalAlignment="Right" Margin="0,0,40,72" Name="tbxWeatherID" VerticalAlignment="Bottom" Width="120" />
+ <Label HorizontalAlignment="Right" Margin="0,0,92,91" Width="182" Height="35.38" VerticalAlignment="Bottom">Weather Settings</Label>
+ <CheckBox Height="32" HorizontalAlignment="Right" Margin="0,0,40,118" Name="cbxRootPage" ToolTip="Automatically highlight the first unwatched item" VerticalAlignment="Bottom" Width="234" Click="cbxRootPage_Click">Enable Root Page</CheckBox>
</Grid>
</TabItem>
<TabItem Header="external players" x:Name="tabItem5" Foreground="#FF323232" FontSize="14" FontWeight="Normal" Visibility="Collapsed" >
@@ -34,6 +34,7 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();
+ LoadComboBoxes();
config = ConfigData.FromFile(Helper.ConfigFile);
@@ -74,7 +75,7 @@ public MainWindow()
daemonToolsLocation.Content = config.DaemonToolsLocation;
- LoadComboBoxes();
+
RefreshExtenderFormats();
RefreshDisplaySettings();
@@ -97,6 +98,7 @@ private void LoadConfigurationSettings()
cbxOptionUnwatchedOnVideo.IsChecked = config.ShowWatchTickInPosterView;
cbxOptionUnwatchedDetailView.IsChecked = config.EnableListViewTicks;
cbxOptionDefaultToUnwatched.IsChecked = config.DefaultToFirstUnwatched;
+ cbxRootPage.IsChecked = config.EnableRootPage;
if (config.MaximumAspectRatioDistortion == Constants.MAX_ASPECT_RATIO_STRETCH)
cbxOptionAspectRatio.IsChecked = true;
else
@@ -106,6 +108,12 @@ private void LoadConfigurationSettings()
ddlOptionViewTheme.SelectedItem = config.ViewTheme;
ddlOptionThemeColor.SelectedItem = config.Theme;
ddlOptionThemeFont.SelectedItem = config.FontTheme;
+
+ tbxWeatherID.Text = config.YahooWeatherFeed;
+ if (config.YahooWeatherUnit.ToLower() == "f")
+ ddlWeatherUnits.SelectedItem = "Farenheit";
+ else
+ ddlWeatherUnits.SelectedItem = "Celsius";
}
private void SaveConfig()
@@ -127,6 +135,9 @@ private void LoadComboBoxes()
// Fonts
ddlOptionThemeFont.Items.Add("Default");
ddlOptionThemeFont.Items.Add("Small");
+ // Weather Units
+ ddlWeatherUnits.Items.Add("Celsius");
+ ddlWeatherUnits.Items.Add("Farenheit");
}
#endregion
@@ -636,6 +647,11 @@ private void cbxOptionAspectRatio_Click(object sender, RoutedEventArgs e)
SaveConfig();
}
+ private void cbxRootPage_Click(object sender, RoutedEventArgs e)
+ {
+ config.EnableRootPage = (bool)cbxRootPage.IsChecked;
+ SaveConfig();
+ }
#endregion
#region ComboBox Events
@@ -694,6 +710,18 @@ private void SetHeader(Label label)
}
#endregion
+ private void btnWeatherID_Click(object sender, RoutedEventArgs e)
+ {
+ if (ddlWeatherUnits.SelectedItem.ToString() == "Farenheit")
+ config.YahooWeatherUnit = "f";
+ else
+ config.YahooWeatherUnit = "c";
+ config.YahooWeatherFeed = tbxWeatherID.Text;
+ SaveConfig();
+ }
+
+
+
}
#region FormatParser Class
@@ -18,7 +18,7 @@ namespace MediaBrowser
public class YahooWeather : ModelItem
{
#region static fields
- private static readonly string FileName = string.Format("weather_{0}.xml", Application.CurrentInstance.Config.YahooWeatherFeed);
+ private static readonly string FileName = string.Format("weather_{1}_{0}.xml", Application.CurrentInstance.Config.YahooWeatherFeed, Application.CurrentInstance.Config.YahooWeatherUnit);
private readonly string DownloadToFilePath = Path.Combine(LibraryManagement.Helper.AppRSSPath, FileName);
private readonly string Feed = string.Format("http://weather.yahooapis.com/forecastrss?p={0}&u={1}",
Application.CurrentInstance.Config.YahooWeatherFeed,

0 comments on commit 7adf92f

Please sign in to comment.