From 8d29bb62e4dfbe00c3ae0e8a9cd480c6054c7602 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 24 Jul 2012 19:34:28 +0000 Subject: [PATCH] GTK3: make sure clipboard opens correctly. Still crashes on use. svn: r20070 --- src/gui/clipboard.py | 16 +++++---- src/gui/glade/clipboard.glade | 66 +++++++++++++++++++++-------------- 2 files changed, 49 insertions(+), 33 deletions(-) diff --git a/src/gui/clipboard.py b/src/gui/clipboard.py index 8326cb777..c11a15621 100644 --- a/src/gui/clipboard.py +++ b/src/gui/clipboard.py @@ -36,8 +36,9 @@ from time import strftime as strftime # GTK/Gnome modules # #------------------------------------------------------------------------- -from gi.repository import Gtk +from gi.repository import GObject from gi.repository import Gdk +from gi.repository import Gtk from gi.repository import GdkPixbuf #------------------------------------------------------------------------- @@ -874,7 +875,7 @@ class ClipDropHandleList(ClipDropList): class ClipboardListModel(Gtk.ListStore): def __init__(self): - GObject.GObject.__init__(self, + Gtk.ListStore.__init__(self, str, # 0: object type object, # 1: object object, # 2: tooltip callback @@ -892,7 +893,8 @@ class ClipboardListModel(Gtk.ListStore): #------------------------------------------------------------------------- class ClipboardListView(object): - LOCAL_DRAG_TARGET = ('MY_TREE_MODEL_ROW', Gtk.TargetFlags.SAME_WIDGET, 0) + LOCAL_DRAG_TARGET = Gtk.TargetEntry.new('MY_TREE_MODEL_ROW', + Gtk.TargetFlags.SAME_WIDGET, 0) LOCAL_DRAG_TYPE = 'MY_TREE_MODEL_ROW' def __init__(self, dbstate, widget): @@ -933,7 +935,7 @@ class ClipboardListView(object): self._col4_cell = Gtk.CellRendererText() # Add cells to view - self._col1.pack_start(self._col1_cellpb, False, True, 0) + self._col1.pack_start(self._col1_cellpb, False) self._col1.pack_start(self._col1_cell, True) self._col2.pack_start(self._col2_cell, True) self._col3.pack_start(self._col3_cell, True) @@ -950,9 +952,9 @@ class ClipboardListView(object): self._widget.set_enable_search(True) #self._widget.set_search_column(3) - self._widget.drag_dest_set(Gtk.DestDefaults.ALL, - (ClipboardListView.LOCAL_DRAG_TARGET,) + \ - DdTargets.all_targets(), + targ_data = (ClipboardListView.LOCAL_DRAG_TARGET,) + \ + DdTargets.all_targets() + self._widget.drag_dest_set(Gtk.DestDefaults.ALL, targ_data, Gdk.DragAction.COPY) self._widget.connect('drag_data_get', self.object_drag_data_get) diff --git a/src/gui/glade/clipboard.glade b/src/gui/glade/clipboard.glade index d667da9d7..dce6aef81 100644 --- a/src/gui/glade/clipboard.glade +++ b/src/gui/glade/clipboard.glade @@ -1,48 +1,34 @@ - + - - + True + False Clipboard 500 300 dialog - + True + False vertical - - - True - True - automatic - automatic - in - - - True - True - - - - - 2 - - - + True + False end gtk-help + False True True True False + False True - + False @@ -53,10 +39,12 @@ Clear _All + False True True True False + False True @@ -68,12 +56,14 @@ gtk-clear + False True True True False + False True - + False @@ -84,12 +74,14 @@ gtk-close + False True True True False + False True - + False @@ -100,10 +92,32 @@ False + True end 0 + + + True + True + in + + + True + True + + + + + + + + True + True + 2 + +