Changes

Jump to navigation Jump to search
Line 119: Line 119:  
  activity.add_alert(alert)
 
  activity.add_alert(alert)
 
  alert.show()
 
  alert.show()
 +
 +
== Gtk.Widget.drag_source_set() ==
 +
 +
* Python docs: http://python-gtk-3-tutorial.readthedocs.org/en/latest/drag_and_drop.html
 +
* C docs: http://developer.gnome.org/gtk3/3.5/gtk3-Drag-and-Drop.html
 +
* '''Good example''' about how drang-n-drop on Gtk3 works http://bugs.sugarlabs.org/raw-attachment/ticket/3742/drag-n-drop-example.tar.gz
 +
** The ''drag_data_received_event'' method is called ONLY if in ''drag_data_get_event'' method we modify the argument ''data''
 +
 +
 +
In Gtk3 the way to call this function is a bit different. Instead of passing a tuple we should pass a list of Gtk.TargetEntry's. So, we should replace this:
 +
 +
self.imagebox = Gtk.EventBox()
 +
self.imagebox.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, ("text/plain", Gtk.TargetFlags.SAME_APP, 80), Gdk.DragAction.COPY)
 +
 +
by this:
 +
 +
self.imagebox = Gtk.EventBox()
 +
self.imagebox.drag_source_set(
 +
        Gdk.ModifierType.BUTTON1_MASK,
 +
        [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 80)],
 +
        Gdk.DragAction.COPY)
 +
 +
== Gtk.TextView.scroll_to_iter ==
 +
 +
* gtk2: http://www.pygtk.org/docs/pygtk/class-gtktextview.html#method-gtktextview--scroll-to-iter
 +
* Gtk3: http://developer.gnome.org/gtk3/3.5/GtkTextView.html#gtk-text-view-scroll-to-iter
 +
 +
This method in gtk2 takes only 2 required arguments but in Gtk3 all of them (5) are required. So, I had to change the call to this method:
 +
 +
self.scroll_to_iter(mouseiter, 0)
 +
 +
by:
 +
 +
self.scroll_to_iter(mouseiter, 0, False, 0.5, 0.5)
    
= Gdk.atom_intern =
 
= Gdk.atom_intern =
Line 135: Line 169:  
= Missing / Problematic things (not ported yet) =
 
= Missing / Problematic things (not ported yet) =
   −
* Select text from the ''Edit View'' (TextView) and the Home View. This error happens in many places of the code.
+
* [<span style="color: green;">DONE</span>] <del>Select text from the ''Edit View'' (TextView) and the Home View. This error happens in many places of the code.</del>
 
** http://developer.gnome.org/gdk3/stable/gdk3-Event-Structures.html#GdkEventMotion
 
** http://developer.gnome.org/gdk3/stable/gdk3-Event-Structures.html#GdkEventMotion
 +
** https://bugzilla.gnome.org/show_bug.cgi?id=679795
    
  Traceback (most recent call last):
 
  Traceback (most recent call last):
Line 143: Line 178:  
  TypeError: could not convert type EventMotion to GdkEvent required for parameter 0
 
  TypeError: could not convert type EventMotion to GdkEvent required for parameter 0
   −
* Issue related with "adding columns to the TreeView": https://bugzilla.gnome.org/show_bug.cgi?id=679415
+
* [<span style="color: orange;">ALTERNATIVE</span>] Issue related with "adding columns to the TreeView": https://bugzilla.gnome.org/show_bug.cgi?id=679415
* Drag and Drop Images from the Edit View is not working. Line #52 (''infoslicer/widgets/Gallery_View.py'')
+
** There is a workaround on the code to solve this issue
 +
* [<span style="color: red;">IMPORTANT</span>] Drag and Drop Images from the Edit View is not working. Line #52 (''infoslicer/widgets/Gallery_View.py'')
 
** Example about how to use the drag-n-drop http://git.gnome.org/browse/pygobject/tree/demos/gtk-demo/demos/clipboard.py#n96
 
** Example about how to use the drag-n-drop http://git.gnome.org/browse/pygobject/tree/demos/gtk-demo/demos/clipboard.py#n96
 
+
** Walter Bender helped me to solve this issue. Thanks!
# FIXME
+
** [<span style="color: orange;">ALTERNATIVE</span>] Drag and drop is working but the image is being added twice. This is because the SIGNAL is being emitted twice. The same happens with the text, but there is an error related with the index of the selection on the second time that the signal is called, so it fails and add just once the text [http://bugs.sugarlabs.org/ticket/3766 ticket]
# http://developer.gnome.org/gtk3/3.5/gtk3-Drag-and-Drop.html#gtk-drag-source-set
  −
# self.imagebox.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, ("text/plain", Gtk.TargetFlags.SAME_APP, 80), Gdk.DragAction.COPY)
  −
 
   
* After drag-n-drop an arrow is added inside the article (right side) that is being edited. This is not working due: https://bugzilla.gnome.org/show_bug.cgi?id=651962
 
* After drag-n-drop an arrow is added inside the article (right side) that is being edited. This is not working due: https://bugzilla.gnome.org/show_bug.cgi?id=651962
 
** Line #641 (''infoslicer/processing/Article.py'')
 
** Line #641 (''infoslicer/processing/Article.py'')
 +
** http://bugs.sugarlabs.org/ticket/3767
 
* On "Home View" under the ''Custom'' TreeView if I add some articles there I cannot move them up or down
 
* On "Home View" under the ''Custom'' TreeView if I add some articles there I cannot move them up or down
 
** The same happens on the ''Wiki'' TreeView
 
** The same happens on the ''Wiki'' TreeView
 +
** http://bugs.sugarlabs.org/ticket/3768
 +
** ''TODO: This is not working because of the port to Gtk3. TreePath object does not support indexing''
 
* Check boxes on "Home View" ''Custom'' TreeView don't show the tick after clicking (Is this related with the theme?)
 
* Check boxes on "Home View" ''Custom'' TreeView don't show the tick after clicking (Is this related with the theme?)
 
** After clicking on all the articles under this TreeView I see the ''Custom'' check box is checked automatically
 
** After clicking on all the articles under this TreeView I see the ''Custom'' check box is checked automatically
266

edits

Navigation menu