banshee r3529 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.ServiceStack src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Banshee.ThickClient/Banshee.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 r3529 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.ServiceStack src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Banshee.ThickClient/Banshee.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView
- Date: Tue, 25 Mar 2008 00:52:55 +0000 (GMT)
Author: abock
Date: Tue Mar 25 00:52:55 2008
New Revision: 3529
URL: http://svn.gnome.org/viewvc/banshee?rev=3529&view=rev
Log:
2008-03-24 Aaron Bockover <abock gnome org>
* src/Clients/Nereid/Nereid/Client.cs: Implement new ClientId property
* src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs: Support
a stack of client objects; ideally we'll be able to run multiple clients
in a single application instance (think mini mode) - this is probably
not well thought out, but it's a start
* src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs: Added a new
base Client class that is not GUI based
* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs:
Support loading/saving the column widths
* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs:
Set up some good visibility defaults for the columns
* src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs: Extend the
new Client class and push itself into the application client stack
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/SortableColumn.cs: Some new ctor
signatures
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs: Some new ctor signatures
and removed the IsVisible property
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnController.cs: Added a
QueueUpdate method
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs:
Call QueueUpdate on the column controller when a column is resized
Added:
trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Clients/Nereid/Nereid/Client.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
trunk/banshee/src/Core/Banshee.Services/Makefile.am
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnController.cs
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/SortableColumn.cs
Modified: trunk/banshee/src/Clients/Nereid/Nereid/Client.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/Client.cs (original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/Client.cs Tue Mar 25 00:52:55 2008
@@ -50,6 +50,10 @@
// Register the main interface
Banshee.ServiceStack.ServiceManager.RegisterService <PlayerInterface> ();
}
+
+ public override string ClientId {
+ get { return "nereid"; }
+ }
}
}
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs Tue Mar 25 00:52:55 2008
@@ -29,6 +29,7 @@
using System;
using System.Reflection;
+using System.Collections.Generic;
using Mono.Unix;
using Banshee.Library;
@@ -50,7 +51,9 @@
public static class Application
{
public static event ShutdownRequestHandler ShutdownRequested;
-
+
+ private static Stack<Client> running_clients = new Stack<Client> ();
+
public static void Run ()
{
Banshee.Base.PlatformHacks.TrapMonoJitSegv ();
@@ -89,12 +92,30 @@
}
}
- private static bool OnShutdownRequested()
+ public static void PushClient (Client client)
+ {
+ lock (running_clients) {
+ running_clients.Push (client);
+ }
+ }
+
+ public static Client PopClient ()
+ {
+ lock (running_clients) {
+ return running_clients.Pop ();
+ }
+ }
+
+ public static Client ActiveClient {
+ get { lock (running_clients) { return running_clients.Peek (); } }
+ }
+
+ private static bool OnShutdownRequested ()
{
ShutdownRequestHandler handler = ShutdownRequested;
if (handler != null) {
foreach (ShutdownRequestHandler del in handler.GetInvocationList ()) {
- if(!del ()) {
+ if (!del ()) {
return false;
}
}
@@ -143,6 +164,12 @@
private static void Dispose ()
{
ServiceManager.Shutdown ();
+
+ lock (running_clients) {
+ while (running_clients.Count > 0) {
+ running_clients.Pop ().Dispose ();
+ }
+ }
}
private static ShutdownRequestHandler shutdown_prompt_handler = null;
Added: trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs Tue Mar 25 00:52:55 2008
@@ -0,0 +1,47 @@
+//
+// Client.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Banshee.ServiceStack
+{
+ public abstract class Client : IDisposable
+ {
+ public Client ()
+ {
+ }
+
+ public virtual void Dispose ()
+ {
+ }
+
+ public abstract string ClientId {
+ get;
+ }
+ }
+}
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp Tue Mar 25 00:52:55 2008
@@ -131,6 +131,7 @@
<File name="Banshee.Sources/MessageAction.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Library/MusicLibrarySource.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Library/VideoLibrarySource.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.ServiceStack/Client.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
Modified: trunk/banshee/src/Core/Banshee.Services/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Makefile.am (original)
+++ trunk/banshee/src/Core/Banshee.Services/Makefile.am Tue Mar 25 00:52:55 2008
@@ -92,6 +92,7 @@
Banshee.Query/SmartPlaylistQueryValue.cs \
Banshee.Query/YearQueryValue.cs \
Banshee.ServiceStack/Application.cs \
+ Banshee.ServiceStack/Client.cs \
Banshee.ServiceStack/DBusServiceManager.cs \
Banshee.ServiceStack/IDBusExportable.cs \
Banshee.ServiceStack/IExtensionService.cs \
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs Tue Mar 25 00:52:55 2008
@@ -53,8 +53,9 @@
lock (this) {
foreach (Column column in this) {
if (column.Id != null) {
- column.Visible = ConfigurationClient.Get<bool> (MakeNamespace (column.Id),
- "visible", column.Visible);
+ string @namespace = MakeNamespace (column.Id);
+ column.Visible = ConfigurationClient.Get<bool> (@namespace, "visible", column.Visible);
+ column.Width = ConfigurationClient.Get<double> (@namespace, "width", column.Width);
}
}
@@ -92,6 +93,7 @@
string @namespace = MakeNamespace (column.Id);
ConfigurationClient.Set<int> (@namespace, "order", index);
ConfigurationClient.Set<bool> (@namespace, "visible", column.Visible);
+ ConfigurationClient.Set<double> (@namespace, "width", column.Width);
}
protected override void OnUpdated ()
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs Tue Mar 25 00:52:55 2008
@@ -49,28 +49,29 @@
public TrackListView () : base ()
{
- column_controller = new PersistentColumnController ("track_view_columns");
+ column_controller = new PersistentColumnController (String.Format ("{0}.{1}",
+ Banshee.ServiceStack.Application.ActiveClient.ClientId, "track_view_columns"));
- SortableColumn artist_column = new SortableColumn (Catalog.GetString ("Artist"), new ColumnCellText ("ArtistName", true), 0.225, "Artist");
+ SortableColumn artist_column = new SortableColumn (Catalog.GetString ("Artist"), new ColumnCellText ("ArtistName", true), 0.225, "Artist", true);
column_controller.AddRange (
- new Column (null, "indicator", new ColumnCellPlaybackIndicator (null), 0.05),
- new SortableColumn (Catalog.GetString ("Track"), new ColumnCellTrackNumber ("TrackNumber", true), 0.10, "Track"),
- new SortableColumn (Catalog.GetString ("Title"), new ColumnCellText ("TrackTitle", true), 0.25, "Title"),
+ new Column (null, "indicator", new ColumnCellPlaybackIndicator (null), 0.05, true),
+ new SortableColumn (Catalog.GetString ("Track"), new ColumnCellTrackNumber ("TrackNumber", true), 0.10, "Track", true),
+ new SortableColumn (Catalog.GetString ("Title"), new ColumnCellText ("TrackTitle", true), 0.25, "Title", true),
artist_column,
- new SortableColumn (Catalog.GetString ("Album"), new ColumnCellText ("AlbumTitle", true), 0.225, "Album"),
- new SortableColumn (Catalog.GetString ("Duration"), new ColumnCellDuration ("Duration", true), 0.15, "Duration"),
+ new SortableColumn (Catalog.GetString ("Album"), new ColumnCellText ("AlbumTitle", true), 0.225, "Album", true),
+ new SortableColumn (Catalog.GetString ("Composer"), new ColumnCellText ("Composer", true), 0.25, "Composer", false),
+ new SortableColumn (Catalog.GetString ("Duration"), new ColumnCellDuration ("Duration", true), 0.15, "Duration", true),
- new SortableColumn (Catalog.GetString ("Year"), new ColumnCellText ("Year", true), 0.15, "Year"),
- new SortableColumn (Catalog.GetString ("Genre"), new ColumnCellText ("Genre", true), 0.25, "Genre"),
- new SortableColumn (Catalog.GetString ("Play Count"), new ColumnCellText ("PlayCount", true), 0.15, "PlayCount"),
- new SortableColumn (Catalog.GetString ("Skip Count"), new ColumnCellText ("SkipCount", true), 0.15, "SkipCount"),
+ new SortableColumn (Catalog.GetString ("Year"), new ColumnCellText ("Year", true), 0.15, "Year", false),
+ new SortableColumn (Catalog.GetString ("Genre"), new ColumnCellText ("Genre", true), 0.25, "Genre", false),
+ new SortableColumn (Catalog.GetString ("Play Count"), new ColumnCellText ("PlayCount", true), 0.15, "PlayCount", false),
+ new SortableColumn (Catalog.GetString ("Skip Count"), new ColumnCellText ("SkipCount", true), 0.15, "SkipCount", false),
//new SortableColumn ("Rating", new RatingColumnCell (null, true), 0.15, "Rating"),
- new SortableColumn (Catalog.GetString ("Last Played"), new ColumnCellDateTime ("LastPlayed", true), 0.15, "LastPlayedStamp"),
- new SortableColumn (Catalog.GetString ("Last Skipped"), new ColumnCellDateTime ("LastSkipped", true), 0.15, "LastSkippedStamp"),
- new SortableColumn (Catalog.GetString ("Date Added"), new ColumnCellDateTime ("DateAdded", true), 0.15, "DateAddedStamp"),
- new SortableColumn (Catalog.GetString ("Location"), new ColumnCellText ("Uri", true), 0.15, "Uri"),
- new SortableColumn (Catalog.GetString ("Composer"), new ColumnCellText ("Composer", true), 0.25, "Composer")
+ new SortableColumn (Catalog.GetString ("Last Played"), new ColumnCellDateTime ("LastPlayed", true), 0.15, "LastPlayedStamp", false),
+ new SortableColumn (Catalog.GetString ("Last Skipped"), new ColumnCellDateTime ("LastSkipped", true), 0.15, "LastSkippedStamp", false),
+ new SortableColumn (Catalog.GetString ("Date Added"), new ColumnCellDateTime ("DateAdded", true), 0.15, "DateAddedStamp", false),
+ new SortableColumn (Catalog.GetString ("Location"), new ColumnCellText ("Uri", true), 0.15, "Uri", false)
);
column_controller.Load ();
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs Tue Mar 25 00:52:55 2008
@@ -36,7 +36,7 @@
namespace Banshee.Gui
{
- public abstract class GtkBaseClient
+ public abstract class GtkBaseClient : Client
{
private static Type client_type;
@@ -101,6 +101,8 @@
Application.IdleTimeoutRemoveHandler = IdleTimeoutRemove;
// Start the core boot process
+
+ Application.PushClient (this);
Application.Run ();
Log.Notify += OnLogNotify;
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Column.cs Tue Mar 25 00:52:55 2008
@@ -44,8 +44,7 @@
private int minWidth = 0;
private int maxWidth = Int32.MaxValue;
private double minRelativeWidth = 0;
- private double relativeWidth = 0;
- private bool isVisible = true;
+ private double relativeWidth = 0;
public Column (ColumnDescription description) :
this (description, new ColumnCellText (description.Property, true))
@@ -53,18 +52,28 @@
}
public Column (ColumnDescription description, ColumnCell cell) :
- this (description.Title, cell, description.Width)
+ this (description.Title, cell, description.Width, description.Visible)
{
- Visible = description.Visible;
}
- public Column (string title, ColumnCell cell, double width) : this (null, title, cell, width)
+ public Column (string title, ColumnCell cell, double width)
+ : this (null, title, cell, width, true)
+ {
+ }
+
+ public Column (string title, ColumnCell cell, double width, bool visible)
+ : this (null, title, cell, width, visible)
{
this.header_cell = new ColumnHeaderCellText(HeaderCellDataHandler);
}
- public Column (ColumnCell header_cell, string title, ColumnCell cell, double width) :
- base (cell.Property, title, width, true)
+ public Column (ColumnCell header_cell, string title, ColumnCell cell, double width)
+ : this (header_cell, title, cell, width, true)
+ {
+ }
+
+ public Column (ColumnCell header_cell, string title, ColumnCell cell, double width, bool visible)
+ : base (cell.Property, title, width, visible)
{
this.header_cell = header_cell;
PackStart(cell);
@@ -127,21 +136,7 @@
get { return relativeWidth; }
set { relativeWidth = value; }
}
-
- public bool IsVisible
- {
- get { return isVisible; }
- set
- {
- bool old = isVisible;
- isVisible = value;
-
- if (value != old) {
- OnVisibilityChanged ();
- }
- }
- }
-
+
public string Id {
get { return StringUtil.CamelCaseToUnderCase (GetCell (0).Property); }
}
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnController.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnController.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnController.cs Tue Mar 25 00:52:55 2008
@@ -51,6 +51,11 @@
}
}
+ public virtual void QueueUpdate ()
+ {
+ OnUpdated ();
+ }
+
public void Clear ()
{
lock (this) {
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs Tue Mar 25 00:52:55 2008
@@ -214,6 +214,8 @@
even_distribution) / (double)list_rendering_alloc.Width;
}
+ ColumnController.QueueUpdate ();
+
RegenerateColumnCache ();
InvalidateListView ();
}
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/SortableColumn.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/SortableColumn.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/SortableColumn.cs Tue Mar 25 00:52:55 2008
@@ -38,14 +38,14 @@
private string sort_key;
private SortType sort_type;
- public SortableColumn(string title, ColumnCell cell, double width, string sort_key) :
- base(title, cell, width)
+ public SortableColumn(string title, ColumnCell cell, double width, string sort_key, bool visible) :
+ base(title, cell, width, visible)
{
this.sort_key = sort_key;
}
- public SortableColumn(ColumnCell header_cell, string title, ColumnCell cell, double width, string sort_key) :
- base(header_cell, title, cell, width)
+ public SortableColumn(ColumnCell header_cell, string title, ColumnCell cell, double width, string sort_key, bool visible) :
+ base(header_cell, title, cell, width, visible)
{
this.sort_key = sort_key;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]