#3002 closed feature-request (Fixed)
Convert Deluge Plugins to GtkBuilder
Reported by: | Calum | 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
- Open
<filename>.glade
file in Glade 3.8.1 UI designer. - Choose
Edit | Preferences
- Change
Libglade
toGtkBuilder
and2.24
toolkit. - 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
withBuilder
instance andadd_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
withbuilder.get_object
- Replace
glade.signal_autoconnect
withbuilder.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 by , 8 years ago
comment:2 by , 7 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Changed the remaining plugins and all tests passes in the PR. See PR: https://github.com/deluge-torrent/deluge/pull/169
comment:3 by , 7 years ago
Resolution: | → Fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 7 years ago
Resolution: | Fixed |
---|---|
Status: | closed → reopened |
Reopen cause: not my decision to close.
comment:5 by , 7 years ago
Resolution: | → Fixed |
---|---|
Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.
Label plugin fixed: [665c047541]
Stats plugins fixed: [676574ff19]