[banshee] Fix DAP Content page title not changing when device is renamed (bgo#589290)
- From: Alexander Kojevnikov <alexk src gnome org>
- To: svn-commits-list gnome org
- Subject: [banshee] Fix DAP Content page title not changing when device is renamed (bgo#589290)
- Date: Tue, 28 Jul 2009 09:56:17 +0000 (UTC)
commit a0e1eb6ec56994b0ac1cb587fe1d84f76b3c34fd
Author: Alex Launi <alex launi gmail com>
Date: Tue Jul 28 19:54:31 2009 +1000
Fix DAP Content page title not changing when device is renamed (bgo#589290)
Signed-off-by: Alexander Kojevnikov <alexander kojevnikov com>
src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapContent.cs | 18 ++++++++++++++++--
src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs | 6 ++++++
2 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapContent.cs b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapContent.cs
index 9d385e1..08498aa 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapContent.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapContent.cs
@@ -31,6 +31,7 @@ using System;
using Gtk;
using Hyena;
+using Hyena.Data;
using Hyena.Widgets;
using Banshee.Dap;
@@ -41,6 +42,7 @@ namespace Banshee.Dap.Gui
{
public class DapContent : DapPropertiesDisplay
{
+ private Label title;
private DapSource dap;
// Ugh, this is to avoid the GLib.MissingIntPtrCtorException seen by some; BGO #552169
@@ -53,6 +55,7 @@ namespace Banshee.Dap.Gui
dap = source;
BuildWidgets ();
BuildActions ();
+ dap.Properties.PropertyChanged += OnPropertyChanged;
}
private void BuildWidgets ()
@@ -62,8 +65,8 @@ namespace Banshee.Dap.Gui
content_box.BorderWidth = 5;
- Label title = new Label ();
- title.Markup = String.Format ("<span size=\"x-large\" weight=\"bold\">{0}</span>", dap.Name);
+ title = new Label ();
+ SetTitleText (dap.Name);
title.Xalign = 0.0f;
Banshee.Preferences.Gui.NotebookPage properties = new Banshee.Preferences.Gui.NotebookPage (dap.Preferences);
@@ -89,6 +92,17 @@ namespace Banshee.Dap.Gui
}
}
+ private void SetTitleText (string name)
+ {
+ title.Markup = String.Format ("<span size=\"x-large\" weight=\"bold\">{0}</span>", name);
+ }
+
+ private void OnPropertyChanged (object o, PropertyChangeEventArgs args)
+ {
+ if (args.PropertyName == "UnmapSourceActionLabel")
+ SetTitleText (args.NewValue.ToString ());
+ }
+
private static Banshee.Gui.BansheeActionGroup actions;
}
}
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
index 886787a..e020c7c 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
@@ -143,6 +143,12 @@ namespace Banshee.Dap
{
}
+ public override void Rename (string newName)
+ {
+ Name = newName;
+ base.Rename (newName);
+ }
+
private bool supports_video = true;
public bool SupportsVideo {
get { return supports_video; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]