[muine] 2009-07-22 Priit Laes <plaes plaes org>



commit a6b0592c25c1a3c2254e75dbcce6f9424b8e418d
Author: Priit Laes <plaes plaes org>
Date:   Wed Jul 22 08:46:06 2009 +0300

    2009-07-22  Priit Laes  <plaes plaes org>
    
    	Bug 573172 â?? [PATCH] Get rid of deprecated APIs
    
    	* src/PlaylistWindow.cs, src/VolumeButton.cs: Port to newer GtkTooltip API.

 ChangeLog             |    6 ++++++
 src/PlaylistWindow.cs |   21 ++++++++++-----------
 src/VolumeButton.cs   |    4 +---
 3 files changed, 17 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 96d6097..75ff3ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-07-22  Priit Laes  <plaes plaes org>
 
+	Bug 573172 â?? [PATCH] Get rid of deprecated APIs
+
+	* src/PlaylistWindow.cs, src/VolumeButton.cs: Port to newer GtkTooltip API.
+
+2009-07-22  Priit Laes  <plaes plaes org>
+
 	* configure.in: Change gtk-sharp version from 2.19.2 to 2.12.9 :(
 
 2009-07-22  Iain Lane <laney ubuntu com>
diff --git a/src/PlaylistWindow.cs b/src/PlaylistWindow.cs
index b5417f7..88104d0 100644
--- a/src/PlaylistWindow.cs
+++ b/src/PlaylistWindow.cs
@@ -166,7 +166,6 @@ namespace Muine
 		[Glade.Widget] private Box            menu_bar_box  ;
 		[Glade.Widget] private ScrolledWindow scrolledwindow;
 
-		private Tooltips           tooltips       ;
 		private Gdk.Pixbuf         empty_pixbuf   ;
 		private CellRendererPixbuf pixbuf_renderer;
 		private CellRendererText   text_renderer  ;
@@ -882,13 +881,12 @@ namespace Muine
 			volume_button.VolumeChanged += OnVolumeChanged;
 
 			// Tooltips
-			tooltips = new Tooltips ();
-			tooltips.SetTip (toggle_play_button, string_tooltip_toggle_play, null);
-			tooltips.SetTip (previous_button   , string_tooltip_previous   , null);
-			tooltips.SetTip (next_button       , string_tooltip_next       , null);
-			tooltips.SetTip (add_album_button  , string_tooltip_add_album  , null);
-			tooltips.SetTip (add_song_button   , string_tooltip_add_song   , null);
-			tooltips.SetTip (volume_button     , string_tooltip_volume     , null);
+			next_button.TooltipText	       = string_tooltip_next;
+			volume_button.TooltipText      = string_tooltip_volume;
+			add_song_button.TooltipText    = string_tooltip_add_song;
+			previous_button.TooltipText    = string_tooltip_previous;
+			add_album_button.TooltipText   = string_tooltip_add_album;
+			toggle_play_button.TooltipText = string_tooltip_toggle_play;
 		}
 
 		// Methods :: Private :: SetupPlaylist
@@ -1195,11 +1193,12 @@ namespace Muine
 		private void SongChanged (bool restart, bool fire_signal)
 		{
 			if (playlist.Model.Playing != IntPtr.Zero) {
+				string tip;
 				Song song = Song.FromHandle (playlist.Model.Playing);
 
 				cover_image.Song = song;
 
-				string tip;
+				cover_image.HasTooltip = true;
 
 				if (song.Album.Length > 0)
 					tip = String.Format (string_from_album, song.Album);
@@ -1219,7 +1218,7 @@ namespace Muine
 					tip += string_tooltip_cover;
 				}
 				
-				tooltips.SetTip (cover_image, tip, null);
+				cover_image.TooltipText = tip;
 				
 				// Song label
 				string title = StringUtils.EscapeForPango (song.Title);
@@ -1246,7 +1245,7 @@ namespace Muine
 			} else {
 				cover_image.Song = null;
 
-				tooltips.SetTip (cover_image, null, null);
+				cover_image.HasTooltip = false;
 
 				song_label.Markup = String.Empty;
 				time_label.Text   = String.Empty;
diff --git a/src/VolumeButton.cs b/src/VolumeButton.cs
index bbe44bd..076a387 100644
--- a/src/VolumeButton.cs
+++ b/src/VolumeButton.cs
@@ -52,8 +52,6 @@ namespace Bacon
         private const int SCALE_SIZE = 100;
         private const int CLICK_TIMEOUT = 250;
     
-        private Tooltips tooltips = new Tooltips();
-        
         private Window dock;
         private VolumeScale slider;
         private Image image;
@@ -495,7 +493,7 @@ namespace Bacon
                     (slider.Adjustment.Upper - slider.Adjustment.Lower) * 100.0));
             }
             
-            tooltips.SetTip(this, tip, null);
+	    this.TooltipText = tip;
         }
         
         private bool AdjustVolume(int direction) 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]