Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
9a591d6e by Cédric Krier at 2023-01-14T23:42:30+01:00
Use Gdk.drag_status to set COPY action

In Gtk 3.0 the method is now in Gdk instead of the context.

Closes #11514
- - - - -
92319638 by Cédric Krier at 2023-01-14T23:44:34+01:00
Use get_data on SelectionData to retrieve raw data

In Gtk 3.0 there is no more data property.

Closes #11514
- - - - -


2 changed files:

- tryton/tryton/gui/window/view_form/view/form_gtk/image.py
- tryton/tryton/gui/window/win_csv.py


Changes:

=====================================
tryton/tryton/gui/window/view_form/view/form_gtk/image.py
=====================================
@@ -71,7 +71,7 @@
     def drag_motion(self, widget, context, x, y, timestamp):
         if self._readonly:
             return False
-        context.drag_status(Gdk.DragAction.COPY, timestamp)
+        Gdk.drag_status(context, Gdk.DragAction.COPY, timestamp)
         return True
 
     def drag_data_received(self, widget, context, x, y, selection,
@@ -84,7 +84,7 @@
                 self.field.set_client(self.record, url_open(uri).read())
             self.update_img()
         elif info == 1:
-            uri = selection.data.split('\r\n')[0]
+            uri = selection.get_data().split('\r\n')[0]
             if uri:
                 self.field.set_client(self.record, url_open(uri).read())
             self.update_img()


=====================================
tryton/tryton/gui/window/win_csv.py
=====================================
@@ -278,10 +278,7 @@
     def drag_data_received(self, treeview, context, x, y, selection,
             info, etime):
         treeview.stop_emission_by_name('drag-data-received')
-        try:
-            selection_data = selection.data
-        except AttributeError:
-            selection_data = selection.get_data()
+        selection_data = selection.get_data()
         if not selection_data:
             return
         selection_data = selection_data.decode('utf-8')



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/5ea05f86a16cb48505f9fdc02c41f35b18fc91f3...9231963800b548fcb65b3f100a9da04429cfd632

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/5ea05f86a16cb48505f9fdc02c41f35b18fc91f3...9231963800b548fcb65b3f100a9da04429cfd632
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to