banshee r3153 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Sources.Gui
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3153 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Sources.Gui
- Date: Tue, 5 Feb 2008 23:02:26 +0000 (GMT)
Author: abock
Date: Tue Feb 5 23:02:26 2008
New Revision: 3153
URL: http://svn.gnome.org/viewvc/banshee?rev=3153&view=rev
Log:
2008-02-05 Aaron Bockover <abock gnome org>
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs:
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs:
Some minor reorg, finish the DnD split
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs Tue Feb 5 23:02:26 2008
@@ -28,9 +28,9 @@
using System;
using System.Collections.Generic;
+
using Gtk;
using Cairo;
-using Mono.Unix;
using Hyena.Data.Gui;
using Hyena.Gui.Theatrics;
@@ -49,10 +49,6 @@
public partial class SourceView : TreeView
{
- private Source new_playlist_source = new PlaylistSource (Catalog.GetString ("New Playlist"));
- private TreeIter new_playlist_iter = TreeIter.Zero;
- private bool new_playlist_visible = false;
-
private SourceRowRenderer renderer;
private ListViewGraphics graphics;
private Cairo.Context cr;
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs Tue Feb 5 23:02:26 2008
@@ -29,6 +29,8 @@
using System;
using System.Collections.Generic;
+using Mono.Unix;
+
using Gtk;
using Gdk;
@@ -52,6 +54,10 @@
Banshee.Gui.DragDrop.DragDropTarget.ModelSelection
};
+ private Source new_playlist_source = new PlaylistSource (Catalog.GetString ("New Playlist"));
+ private TreeIter new_playlist_iter = TreeIter.Zero;
+ private bool new_playlist_visible = false;
+
private Source final_drag_source = null;
private uint final_drag_start_time = 0;
@@ -63,6 +69,35 @@
EnableModelDragDest (dnd_dest_entries, DragAction.Copy | DragAction.Copy);
}
+ private void HideNewPlaylistRow ()
+ {
+ if (!new_playlist_visible) {
+ return;
+ }
+
+ store.Remove (ref new_playlist_iter);
+ new_playlist_visible = false;
+
+ UpdateView ();
+ }
+
+ private void ShowNewPlaylistRow ()
+ {
+ if (new_playlist_visible) {
+ return;
+ }
+
+ TreeIter library = FindSource (ServiceManager.SourceManager.DefaultSource);
+ new_playlist_iter = store.AppendNode (library);
+
+ store.SetValue (new_playlist_iter, 0, new_playlist_source);
+ store.SetValue (new_playlist_iter, 1, 999);
+ new_playlist_visible = true;
+
+ UpdateView ();
+ Expand (library);
+ }
+
protected override bool OnDragMotion (Gdk.DragContext context, int x, int y, uint time)
{
TreePath path;
@@ -74,14 +109,7 @@
if (!new_playlist_visible && active_source != null &&
new_playlist_source.AcceptsInputFromSource (active_source) &&
((self_drag && active_source.SupportedMergeTypes != SourceMergeType.None) || !self_drag)) {
- TreeIter library = FindSource (ServiceManager.SourceManager.DefaultSource);
- new_playlist_iter = store.AppendNode (library);
- store.SetValue (new_playlist_iter, 0, new_playlist_source);
- store.SetValue (new_playlist_iter, 1, 999);
- new_playlist_visible = true;
-
- UpdateView ();
- Expand (library);
+ ShowNewPlaylistRow ();
}
if (!GetDestRowAtPos (x, y, out path, out pos)) {
@@ -117,10 +145,13 @@
final_drag_source = GetSource (path);
final_drag_start_time = context.StartTime;
- if (new_playlist_visible) {
- store.Remove (ref new_playlist_iter);
- new_playlist_visible = false;
- UpdateView ();
+ HideNewPlaylistRow ();
+ }
+
+ protected override void OnDragBegin (Gdk.DragContext context)
+ {
+ if (ServiceManager.SourceManager.ActiveSource.SupportedMergeTypes != SourceMergeType.None) {
+ base.OnDragBegin (context);
}
}
@@ -154,18 +185,7 @@
Gtk.Drag.Finish (context, true, false, time);
} finally {
- if (new_playlist_visible) {
- store.Remove (ref new_playlist_iter);
- new_playlist_visible = false;
- UpdateView ();
- }
- }
- }
-
- protected override void OnDragBegin (Gdk.DragContext context)
- {
- if (ServiceManager.SourceManager.ActiveSource.SupportedMergeTypes != SourceMergeType.None) {
- base.OnDragBegin (context);
+ HideNewPlaylistRow ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]