diff options
author | Alessandro Ghedini <al3xbio@gmail.com> | 2012-11-03 16:15:11 +0100 |
---|---|---|
committer | Alessandro Ghedini <al3xbio@gmail.com> | 2012-11-03 16:15:11 +0100 |
commit | 1f6f24308e96040962794c5a9ffd81597b5e072a (patch) | |
tree | 7d719e21bf759d20ace53bcac13325048aa21a8c /src/gui/pieList.vala | |
parent | 87a5b11d7598fc1e5239e11972c5e03a38bbb672 (diff) |
Imported Upstream version 0.5.4upstream/0.5.4
Diffstat (limited to 'src/gui/pieList.vala')
-rw-r--r-- | src/gui/pieList.vala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/pieList.vala b/src/gui/pieList.vala index 474e5f5..f9fb54b 100644 --- a/src/gui/pieList.vala +++ b/src/gui/pieList.vala @@ -94,6 +94,7 @@ class PieList : Gtk.TreeView { this.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, entries, Gdk.DragAction.LINK); this.enable_model_drag_dest(entries, Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK); this.drag_data_get.connect(this.on_dnd_source); + this.drag_data_received.connect(this.on_dnd_received); this.drag_begin.connect_after(this.on_start_drag); this.drag_motion.connect(this.on_drag_move); this.drag_leave.connect(() => { @@ -238,6 +239,29 @@ class PieList : Gtk.TreeView { return true; } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user finishes a drag operation on this widget. + /// Only used for external drags. + ///////////////////////////////////////////////////////////////////// + + private void on_dnd_received(Gdk.DragContext context, int x, int y, + Gtk.SelectionData selection_data, uint info, uint time_) { + + Gtk.TreeIter active; + if (this.get_selection().get_selected(null, out active)) { + string id = ""; + this.data.get(active, DataPos.ID, out id); + + var pie = PieManager.all_pies[id]; + + foreach (var uri in selection_data.get_uris()) { + pie.add_action(ActionRegistry.new_for_uri(uri), 0); + } + + this.on_select(id); + } + } } } |