Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#3002 closed feature-request (Fixed)

Convert Deluge Plugins to GtkBuilder

Reported by: Cas Owned by: DjLegolas
Priority: trivial Milestone: 2.0.0
Component: Plugin Version: develop
Keywords: Cc:

Description

The plugins needs converting from libglade to Gtk Builder. It is a fairly simply process with the following steps:

Glade file conversion

  1. Open <filename>.glade file in Glade 3.8.1 UI designer.
  2. Choose Edit | Preferences
  3. Change Libglade to GtkBuilder and 2.24 toolkit.
  4. Then File | Save As... and change filename extension to .ui. (e.g. <filename>.ui)

PyGtk code conversion

  • Remove any gtk.glade imports
  • Replace glade.XML with Builder instance and add_from_file method, for example:
-      self.glade = gtk.glade.XML(get_resource('<filename>.glade'))
+      self.builder = gtk.Builder()
+      self.builder.add_from_file(get_resource('<filename>.ui'))
  • Ensure .glade files are renamed to .ui equivalents.
  • Replace glade.get_widget with builder.get_object
  • Replace glade.signal_autoconnect with builder.connect_signals
  • If the naming of handler methods match the signals it is possible to use builder.connect_signals(self) instead of specifying the mapping.

Also see: https://developer.gnome.org/gtk2/stable/gtk-migrating-GtkBuilder.html

Change History (6)

comment:1 Changed 7 years ago by Cas

Label plugin fixed: [665c047541]

Stats plugins fixed: [676574ff19]

comment:2 Changed 7 years ago by DjLegolas

  • Owner set to DjLegolas
  • Status changed from new to assigned
Version 0, edited 7 years ago by DjLegolas (next)

comment:3 Changed 7 years ago by DjLegolas

  • Resolution set to Fixed
  • Status changed from assigned to closed
Last edited 7 years ago by DjLegolas (previous) (diff)

comment:4 Changed 7 years ago by DjLegolas

  • Resolution Fixed deleted
  • Status changed from closed to reopened

Reopen cause: not my decision to close.

comment:5 Changed 6 years ago by Cas

  • Resolution set to Fixed
  • Status changed from reopened to closed

comment:6 Changed 6 years ago by Cas

  • Milestone changed from 2.0 to 2.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.