banshee r3996 - in trunk/banshee: . src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3996 - in trunk/banshee: . src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView
- Date: Wed, 28 May 2008 00:43:03 +0000 (UTC)
Author: abock
Date: Wed May 28 00:43:02 2008
New Revision: 3996
URL: http://svn.gnome.org/viewvc/banshee?rev=3996&view=rev
Log:
2008-05-27 Aaron Bockover <abock gnome org>
* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs:
Added support for the classic new item blue ball
* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs:
Implemented a cell data handler to set the opacity on text renderers
* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackInfo.cs:
Implemented a StatusText cell and some helper properties
* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs:
Added a Status column
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs:
Added a virtual ColumnCellDataProvider method that is called as soon as
a data item is bound to a cell so the view can configure the cell
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs:
Added an opacity property
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackInfo.cs
trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs
trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs Wed May 28 00:43:02 2008
@@ -123,6 +123,11 @@
<renderer type=""Banshee.Podcasting.Gui.ColumnCellPublished"" property=""PublishedDate"" />
<sort-key>PublishedDate</sort-key>
</column>
+ <column>
+ <visible>true</visible>
+ <title>Status</title>
+ <renderer type=""Hyena.Data.Gui.ColumnCellText"" property=""StatusText"" />
+ </column>
<sort-column direction=""desc"">published_date</sort-column>
</column-controller>
",
Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackInfo.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastTrackInfo.cs Wed May 28 00:43:02 2008
@@ -28,6 +28,7 @@
using System;
using System.Text;
+using Mono.Unix;
using System.Collections.Generic;
@@ -67,7 +68,6 @@
return Provider.FetchFirstMatching ("ExternalID = ?", item_id);
}
- private bool @new;
private int position;
private long item_id;
@@ -92,9 +92,12 @@
get { return Item.PubDate; }
}
- public bool New {
- get { return @new; }
- set { @new = value; }
+ public bool IsNew {
+ get { return !Item.IsRead; }
+ }
+
+ public bool IsDownloaded {
+ get { return !String.IsNullOrEmpty (Enclosure.LocalPath); }
}
public int Position {
@@ -156,6 +159,27 @@
get { return PodcastService.ArtworkIdFor (Feed); }
}
+ public string StatusText {
+ get {
+ switch (Activity) {
+ case PodcastItemActivity.Downloading: return Catalog.GetString ("Downloading");
+ case PodcastItemActivity.DownloadPending: return Catalog.GetString ("Waiting to download");
+ case PodcastItemActivity.DownloadPaused: return Catalog.GetString ("Download paused");
+ case PodcastItemActivity.DownloadFailed: return Catalog.GetString ("Download failed");
+ default:
+ string download_status = Activity == PodcastItemActivity.Downloaded
+ ? Catalog.GetString ("Downloaded")
+ : Catalog.GetString ("Stream Available");
+ string new_status = IsNew
+ ? Catalog.GetString ("New")
+ : ((MediaAttributes & TrackMediaAttributes.VideoStream) != 0
+ ? Catalog.GetString ("Watched")
+ : Catalog.GetString ("Heard"));
+ return String.Format ("{0} / {1}", download_status, new_status);
+ }
+ }
+ }
+
#endregion
#region Constructors
Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs Wed May 28 00:43:02 2008
@@ -49,7 +49,7 @@
}
protected override int PixbufCount {
- get { return base.PixbufCount + 1; }
+ get { return base.PixbufCount + 2; }
}
protected override void LoadPixbufs ()
@@ -58,6 +58,9 @@
// Downloading
Pixbufs[base.PixbufCount + 0] = IconThemeUtils.LoadIcon (PixbufSize, "document-save", "go-bottom");
+
+ // Podcast is New
+ Pixbufs[base.PixbufCount + 1] = IconThemeUtils.LoadIcon (PixbufSize, "podcast-new");
}
protected override int GetIconIndex (TrackInfo track)
@@ -72,7 +75,7 @@
case PodcastItemActivity.DownloadPending:
return base.PixbufCount + 0;
default:
- return -1;
+ return podcast.IsNew ? base.PixbufCount + 1 : -1;
}
}
Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs Wed May 28 00:43:02 2008
@@ -52,6 +52,21 @@
public PodcastItemView () : base ()
{
}
+
+ protected override void ColumnCellDataProvider (ColumnCell cell, object boundItem)
+ {
+ ColumnCellText text_cell = cell as ColumnCellText;
+ if (text_cell == null) {
+ return;
+ }
+
+ PodcastTrackInfo podcast = boundItem as PodcastTrackInfo;
+ if (podcast == null) {
+ return;
+ }
+
+ text_cell.Opacity = podcast.IsDownloaded ? 1.0 : 0.5;
+ }
}
/*public class PodcastItemView : ListView<TrackInfo>
{
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs Wed May 28 00:43:02 2008
@@ -42,6 +42,7 @@
private Pango.Weight font_weight = Pango.Weight.Normal;
private Pango.EllipsizeMode ellipsize_mode = Pango.EllipsizeMode.End;
private Pango.Alignment alignment = Pango.Alignment.Left;
+ private double opacity = 1.0;
private int text_width;
private int text_height;
@@ -69,7 +70,10 @@
context.TextAsForeground ? GtkColorClass.Foreground : GtkColorClass.Text, state);
if (!context.Sensitive) {
color.A = 0.3;
+ } else {
+ color.A = opacity;
}
+
context.Context.Color = color;
PangoCairoHelper.ShowLayout (context.Context, context.Layout);
}
@@ -101,6 +105,11 @@
set { ellipsize_mode = value; }
}
+ public virtual double Opacity {
+ get { return opacity; }
+ set { opacity = value; }
+ }
+
internal static int ComputeRowHeight (Widget widget)
{
int w_width, row_height;
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs Wed May 28 00:43:02 2008
@@ -309,6 +309,7 @@
{
ColumnCell cell = column_cache[column_index].Column.GetCell (0);
cell.BindListItem (item);
+ ColumnCellDataProvider (cell, item);
if (dragging) {
Cairo.Color fill_color = Theme.Colors.GetWidgetColor (GtkColorClass.Base, StateType.Normal);
@@ -372,6 +373,10 @@
}
}
+ protected virtual void ColumnCellDataProvider (ColumnCell cell, object boundItem)
+ {
+ }
+
private bool rules_hint = false;
public bool RulesHint {
get { return rules_hint; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]