meld r1147 - trunk
- From: stevek svn gnome org
- To: svn-commits-list gnome org
- Subject: meld r1147 - trunk
- Date: Sun, 1 Feb 2009 12:56:12 +0000 (UTC)
Author: stevek
Date: Sun Feb 1 12:56:12 2009
New Revision: 1147
URL: http://svn.gnome.org/viewvc/meld?rev=1147&view=rev
Log:
Bug 315528 â Drag and drop support
Modified:
trunk/meldapp.py
Modified: trunk/meldapp.py
==============================================================================
--- trunk/meldapp.py (original)
+++ trunk/meldapp.py Sun Feb 1 12:56:12 2009
@@ -25,6 +25,7 @@
import gtk.glade
import gobject
import pango
+import gnomevfs
# project
import paths
@@ -564,6 +565,11 @@
elif 1:
def showPrefs(): PreferencesDialog(self)
gobject.idle_add(showPrefs)
+ dnd_targets = self.widget.drag_dest_set(
+ gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP,
+ [ ('text/uri-list', 0, 0) ],
+ gtk.gdk.ACTION_COPY)
+ self.widget.connect('drag_data_received', self.on_widget_drag_data_received)
self.toolbar.set_style( self.prefs.get_toolbar_style() )
self.prefs.notify_add(self.on_preference_changed)
self.idle_hooked = 0
@@ -573,6 +579,12 @@
self.ui.ensure_update()
self.widget.show()
+ def on_widget_drag_data_received(self, wid, context, x, y, selection_data, info, time):
+ if len(selection_data.get_uris()) != 0:
+ paths = [gnomevfs.get_local_path_from_uri(u) for u in selection_data.get_uris()]
+ self.open_paths(paths)
+ return True
+
def _on_uimanager_connect_proxy(self, ui, action, widget):
tooltip = action.props.tooltip
if not tooltip:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]