[banshee/gtk3: 40/40] Stop using the now removed TooltipSetter wrapper



commit 369f74567b95c8110c9a76fa771712e8832412b5
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sat Dec 17 12:53:35 2011 +0100

    Stop using the now removed TooltipSetter wrapper
    
    Widgets now use their TooltipText property directly.

 .../Banshee.ContextPane/ContextPane.cs             |    8 +++-----
 .../Banshee.Equalizer.Gui/EqualizerBandScale.cs    |    5 +----
 .../Banshee.Gui.TrackEditor/AlbumArtistEntry.cs    |    9 ++++-----
 .../Banshee.Gui.TrackEditor/FieldPage.cs           |    5 +----
 .../Banshee.Gui.TrackEditor/PageNavigationEntry.cs |    3 +--
 .../Banshee.Gui.TrackEditor/RangeEntry.cs          |    2 +-
 .../Banshee.Gui.TrackEditor/TrackEditorDialog.cs   |   13 +++++--------
 .../Banshee.Gui.Widgets/UserJobTile.cs             |    4 +---
 .../Banshee.Preferences.Gui/SectionBox.cs          |   10 ++--------
 src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs |   12 +++---------
 .../Banshee.MiniMode/MiniModeWindow.cs             |   12 ++----------
 src/Hyena                                          |    2 +-
 12 files changed, 25 insertions(+), 60 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.ContextPane/ContextPane.cs b/src/Core/Banshee.ThickClient/Banshee.ContextPane/ContextPane.cs
index da9abc3..71dd9f6 100644
--- a/src/Core/Banshee.ThickClient/Banshee.ContextPane/ContextPane.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.ContextPane/ContextPane.cs
@@ -48,8 +48,6 @@ namespace Banshee.ContextPane
 {
     public class ContextPane : Gtk.HBox
     {
-        private object tooltip_host = TooltipSetter.CreateHost ();
-
         private Gtk.Notebook notebook;
         private VBox vbox;
         private bool large = false;
@@ -116,11 +114,11 @@ namespace Banshee.ContextPane
             HBox hbox = new HBox ();
             var max = new Button (new Image (IconThemeUtils.LoadIcon ("context-pane-maximize", 7)));
             max.Clicked += (o, a) => { large = !large; expand_handler (large); };
-            TooltipSetter.Set (tooltip_host, max, Catalog.GetString ("Make the context pane larger or smaller"));
+            max.TooltipText = Catalog.GetString ("Make the context pane larger or smaller");
 
             var close = new Button (new Image (IconThemeUtils.LoadIcon ("context-pane-close", 7)));
             close.Clicked += (o, a) => ShowAction.Activate ();
-            TooltipSetter.Set (tooltip_host, close, Catalog.GetString ("Hide context pane"));
+            close.TooltipText = Catalog.GetString ("Hide context pane");
 
             max.Relief = close.Relief = ReliefStyle.None;
             hbox.PackStart (max, false, false, 0);
@@ -268,7 +266,7 @@ namespace Banshee.ContextPane
                 DrawIndicator = false,
                 Relief = ReliefStyle.None
             };
-            TooltipSetter.Set (tooltip_host, toggle_button, page.Name);
+            toggle_button.TooltipText = page.Name;
             toggle_button.Clicked += (s, e) => {
                 if (pane_pages.ContainsKey (page)) {
                     if (page.State == ContextState.Loaded) {
diff --git a/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerBandScale.cs b/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerBandScale.cs
index 248a85f..3b3359c 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerBandScale.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerBandScale.cs
@@ -36,7 +36,6 @@ namespace Banshee.Equalizer.Gui
         private uint band;
         private Scale scale;
         private Label label;
-        private object tooltip_host;
 
         public event EventHandler ValueChanged;
 
@@ -61,8 +60,6 @@ namespace Banshee.Equalizer.Gui
 
             PackStart (scale, false, false, 0);
             PackStart (label, false, false, 0);
-
-            tooltip_host = Hyena.Gui.TooltipSetter.CreateHost ();
         }
 
         private void OnValueChanged (object o, EventArgs args)
@@ -72,7 +69,7 @@ namespace Banshee.Equalizer.Gui
                 handler(this, new EventArgs ());
             }
 
-            Hyena.Gui.TooltipSetter.Set (tooltip_host, scale, ((int)Math.Round (scale.Value / 10.0)).ToString ());
+            scale.TooltipText = ((int)Math.Round (scale.Value / 10.0)).ToString ();
         }
 
         public int Value {
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs
index 988c14a..cde9841 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs
@@ -40,7 +40,6 @@ namespace Banshee.Gui.TrackEditor
 
         private CheckButton enable_compilation = new CheckButton ();
         private TextEntry entry = new TextEntry ("CoreAlbums", "ArtistName");
-        private object tooltip_host = Hyena.Gui.TooltipSetter.CreateHost ();
         private Button track_artist_sync_button;
         private PageNavigationEntry track_artist_entry;
 
@@ -53,10 +52,10 @@ namespace Banshee.Gui.TrackEditor
             enable_compilation.Label = Catalog.GetString ("Com_pilation Album Artist:");
             enable_compilation.UseUnderline = true;
 
-            Hyena.Gui.TooltipSetter.Set (tooltip_host, enable_compilation,
-                Catalog.GetString ("Check this if this track is part of an album with tracks by various artists"));
-            Hyena.Gui.TooltipSetter.Set (tooltip_host, entry,
-                Catalog.GetString ("This value will affect how this album is sorted; if you enter 'Various Artists' then the album will located with other albums that start with 'V'."));
+            enable_compilation.TooltipText = Catalog.GetString (
+                "Check this if this track is part of an album with tracks by various artists");
+            entry.TooltipText = Catalog.GetString (
+                "This value will affect how this album is sorted; if you enter 'Various Artists' then the album will located with other albums that start with 'V'.");
 
             PackStart (enable_compilation, false, false, 0);
             PackStart (entry, false, false, 0);
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs
index 32bf23e..2c563af 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs
@@ -66,8 +66,6 @@ namespace Banshee.Gui.TrackEditor
             public System.Action Sync;
         }
 
-        private object tooltip_host;
-
         private List<FieldSlot> field_slots = new List<FieldSlot> ();
         public IEnumerable<FieldSlot> FieldSlots {
             get { return field_slots; }
@@ -76,7 +74,6 @@ namespace Banshee.Gui.TrackEditor
         public FieldPage ()
         {
             Spacing = EditorUtilities.RowSpacing;
-            tooltip_host = TooltipSetter.CreateHost ();
         }
 
         public void Initialize (TrackEditorDialog dialog)
@@ -161,7 +158,7 @@ namespace Banshee.Gui.TrackEditor
             if (MultipleTracks && (options & FieldOptions.NoSync) == 0 && (options & FieldOptions.NoShowSync) == 0) {
                 slot.SyncButton = new SyncButton ();
                 if (syncTooltip != null) {
-                    TooltipSetter.Set (tooltip_host, slot.SyncButton, syncTooltip);
+                    slot.SyncButton.TooltipText = syncTooltip;
                 }
 
                 slot.SyncButton.Clicked += delegate { slot.Sync (); };
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/PageNavigationEntry.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/PageNavigationEntry.cs
index 6d80d78..dfdaf10 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/PageNavigationEntry.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/PageNavigationEntry.cs
@@ -70,8 +70,7 @@ namespace Banshee.Gui.TrackEditor
                     forward_button.Sensitive = dialog.CanGoForward;
                 };
                 forward_button = EditorUtilities.CreateSmallStockButton (Stock.GoForward);
-                object tooltip_host = Hyena.Gui.TooltipSetter.CreateHost ();
-                Hyena.Gui.TooltipSetter.Set (tooltip_host, forward_button, Catalog.GetString ("Advance to the next track and edit its title"));
+                forward_button.TooltipText = Catalog.GetString ("Advance to the next track and edit its title");
                 forward_button.Sensitive = dialog.CanGoForward;
                 forward_button.Show ();
                 forward_button.Clicked += EditNextTitle;
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/RangeEntry.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/RangeEntry.cs
index 2d8e012..257783e 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/RangeEntry.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/RangeEntry.cs
@@ -63,7 +63,7 @@ namespace Banshee.Gui.TrackEditor
                 PackStart (auto_order_button = new AutoOrderButton (), false, false, 1);
                 auto_order_button.Clicked += delegate { orderClosure (this); };
                 if (orderTooltip != null) {
-                    TooltipSetter.Set (TooltipSetter.CreateHost (), auto_order_button, orderTooltip);
+                    auto_order_button.TooltipText = orderTooltip;
                 }
             }
 
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
index 5fc5048..4fd80a4 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
@@ -64,7 +64,6 @@ namespace Banshee.Gui.TrackEditor
         private Label header_artist_label;
         private Label header_album_label;
         private Label edit_notif_label;
-        private object tooltip_host;
 
         private DateTime dialog_launch_datetime = DateTime.Now;
 
@@ -115,8 +114,6 @@ namespace Banshee.Gui.TrackEditor
                 AddStockButton (Stock.Close, ResponseType.Close, true);
             }
 
-            tooltip_host = TooltipSetter.CreateHost ();
-
             AddNavigationButtons ();
 
             main_vbox = new VBox ();
@@ -146,15 +143,15 @@ namespace Banshee.Gui.TrackEditor
 
             nav_backward_button = new Button (Stock.GoBack);
             nav_backward_button.UseStock = true;
+            nav_backward_button.TooltipText = Catalog.GetString ("Show the previous track");
             nav_backward_button.Clicked += delegate { NavigateBackward (); };
             nav_backward_button.Show ();
-            TooltipSetter.Set (tooltip_host, nav_backward_button, Catalog.GetString ("Show the previous track"));
 
             nav_forward_button = new Button (Stock.GoForward);
             nav_forward_button.UseStock = true;
+            nav_forward_button.TooltipText = Catalog.GetString ("Show the next track");
             nav_forward_button.Clicked += delegate { NavigateForward (); };
             nav_forward_button.Show ();
-            TooltipSetter.Set (tooltip_host, nav_forward_button, Catalog.GetString ("Show the next track"));
 
             ActionArea.PackStart (nav_backward_button, false, false, 0);
             ActionArea.PackStart (nav_forward_button, false, false, 0);
@@ -315,9 +312,9 @@ namespace Banshee.Gui.TrackEditor
                 alignment.Add (box);
                 sync_all_button.Add (alignment);
 
-                TooltipSetter.Set (tooltip_host, sync_all_button, Catalog.GetString (
-                    "Apply the values of all common fields set for this track to all of the tracks selected in this editor"));
-
+                sync_all_button.TooltipText = Catalog.GetString (
+                    "Apply the values of all common fields set for this track to all of the tracks selected in this editor");
+                
                 button_box.PackStart (sync_all_button, false, false, 0);
 
                 foreach (Widget child in ActionArea.Children) {
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/UserJobTile.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/UserJobTile.cs
index e3ff98d..b8176ab 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/UserJobTile.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/UserJobTile.cs
@@ -54,7 +54,6 @@ namespace Banshee.Gui.Widgets
         private Button cancel_button;
         private uint update_delay_id;
         private uint progress_bounce_id;
-        private object tooltips;
 
         Hyena.Widgets.HigMessageDialog cancel_dialog;
 
@@ -75,7 +74,6 @@ namespace Banshee.Gui.Widgets
 
             icon = new Image ();
 
-            tooltips = TooltipSetter.CreateHost ();
             title_label = new Label ();
             title_label.Xalign = 0.0f;
             title_label.Ellipsize = Pango.EllipsizeMode.End;
@@ -194,7 +192,7 @@ namespace Banshee.Gui.Widgets
                 } else {
                     never_had_status = false;
                     status_label.Markup = String.Format ("<small>{0}</small>", GLib.Markup.EscapeText (job.Status ?? String.Empty));
-                    TooltipSetter.Set (tooltips, status_label, job.Status ?? String.Empty);
+                    status_label.TooltipText = job.Status ?? String.Empty;
                     status_label.Show ();
                 }
                 status = job.Status;
diff --git a/src/Core/Banshee.ThickClient/Banshee.Preferences.Gui/SectionBox.cs b/src/Core/Banshee.ThickClient/Banshee.Preferences.Gui/SectionBox.cs
index d104966..3c8fad9 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Preferences.Gui/SectionBox.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Preferences.Gui/SectionBox.cs
@@ -36,8 +36,6 @@ namespace Banshee.Preferences.Gui
 {
     public class SectionBox : Table
     {
-        private object tp_host;
-
         public SectionBox (Section section) : base (1, 2, false)
         {
             ColumnSpacing = 10;
@@ -75,13 +73,9 @@ namespace Banshee.Preferences.Gui
             }
 
             if (!String.IsNullOrEmpty (preference.Description)) {
-                if (tp_host == null) {
-                     tp_host = TooltipSetter.CreateHost ();
-                }
-
-                TooltipSetter.Set (tp_host, widget, preference.Description);
+                widget.TooltipText = preference.Description;
                 if (label != null) {
-                    TooltipSetter.Set (tp_host, label, preference.Description);
+                    label.TooltipText = preference.Description;
                 }
             }
         }
diff --git a/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs b/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs
index 00d6805..935b103 100644
--- a/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs
+++ b/src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmEntry.cs
@@ -106,15 +106,9 @@ namespace Banshee.Bpm
             tap_adapter.BpmChanged += OnTapBpmChanged;
             Add (tap_button);
 
-            object tooltip_host = TooltipSetter.CreateHost ();
-
-            TooltipSetter.Set (tooltip_host, detect_button,
-                Catalog.GetString ("Have Banshee attempt to auto-detect the BPM of this song"));
-
-            TooltipSetter.Set (tooltip_host, play_button, Catalog.GetString ("Play this song"));
-
-            TooltipSetter.Set (tooltip_host, tap_button,
-                Catalog.GetString ("Tap this button to the beat to set the BPM for this song manually"));
+            detect_button.TooltipText = Catalog.GetString ("Have Banshee attempt to auto-detect the BPM of this song");
+            play_button.TooltipText = Catalog.GetString ("Play this song");
+            tap_button.TooltipText = Catalog.GetString ("Tap this button to the beat to set the BPM for this song manually");
 
             ShowAll ();
         }
diff --git a/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs b/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs
index 5a78be4..f7960fb 100644
--- a/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs
+++ b/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs
@@ -53,7 +53,6 @@ namespace Banshee.MiniMode
         private ConnectedVolumeButton volume_button;
         private SourceComboBox source_combo_box;
         private ConnectedSeekSlider seek_slider;
-        private object tooltip_host;
 
         private BaseClientWindow default_main_window;
 
@@ -64,8 +63,6 @@ namespace Banshee.MiniMode
             BorderWidth = 12;
             Resizable = false;
 
-            tooltip_host = TooltipSetter.CreateHost ();
-
             Build ();
             ShowAll ();
 
@@ -118,8 +115,8 @@ namespace Banshee.MiniMode
             repeat_align.Add (repeat_toggle_button);
             bot.PackEnd (repeat_align, false, false, 0);
 
-            SetTip (fullmode_button, Catalog.GetString ("Switch back to full mode"));
-            SetTip (repeat_toggle_button, Catalog.GetString ("Change repeat playback mode"));
+            fullmode_button.TooltipText = Catalog.GetString ("Switch back to full mode");
+            repeat_toggle_button.TooltipText = Catalog.GetString ("Change repeat playback mode");
 
             Add (vbox);
         }
@@ -128,11 +125,6 @@ namespace Banshee.MiniMode
         {
         }
 
-        private void SetTip (Widget widget, string tip)
-        {
-            TooltipSetter.Set (tooltip_host, widget, tip);
-        }
-
         private void SetHeightLimit ()
         {
             Gdk.Geometry limits = new Gdk.Geometry ();
diff --git a/src/Hyena b/src/Hyena
index 1431ef5..8d284e8 160000
--- a/src/Hyena
+++ b/src/Hyena
@@ -1 +1 @@
-Subproject commit 1431ef51be35e7061e2efbce94c4a179479be9e3
+Subproject commit 8d284e886ad113f0c6b9bd0cb5653eb769c04c51



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