mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 23:48:40 +00:00
improvements to plugin dialog
This commit is contained in:
parent
6e5dfd7ddb
commit
98b3b4e7cc
3 changed files with 68 additions and 42 deletions
|
@ -636,21 +636,26 @@ their share ratio reaches:</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="show_tabs">False</property>
|
<property name="show_tabs">False</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkTable" id="plugins_options1">
|
<widget class="GtkHBox" id="hbox1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="homogeneous">True</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkTreeView" id="plugin_view">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkVBox" id="vbox3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="n_rows">2</property>
|
|
||||||
<property name="n_columns">2</property>
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkTextView" id="plugin_text">
|
<widget class="GtkTextView" id="plugin_text">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="editable">False</property>
|
<property name="editable">False</property>
|
||||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||||
|
<property name="cursor_visible">False</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="padding">10</property>
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="x_padding">10</property>
|
|
||||||
<property name="y_padding">10</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -668,20 +673,14 @@ their share ratio reaches:</property>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="expand">False</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="position">1</property>
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
<property name="y_options">GTK_FILL</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<widget class="GtkTreeView" id="plugin_view">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="padding">10</property>
|
||||||
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
25
plugins/HelloWorld/plugin.py
Normal file
25
plugins/HelloWorld/plugin.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
class plugin_Hello:
|
||||||
|
def __init__(self, path, deluge_core, deluge_interface):
|
||||||
|
self.path = path
|
||||||
|
self.core = deluge_core
|
||||||
|
self.interface = deluge_interface
|
||||||
|
print "Hello World loaded"
|
||||||
|
|
||||||
|
def unload(self):
|
||||||
|
print "Hello World unloaded"
|
||||||
|
|
||||||
|
def update(self):
|
||||||
|
print "Hello, World!"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
register_plugin("Hello World",
|
||||||
|
plugin_Hello,
|
||||||
|
"1.0",
|
||||||
|
'Displays "Hello, World"',
|
||||||
|
config=False,
|
||||||
|
default=False,
|
||||||
|
requires="0.5.0",
|
||||||
|
interface=None,
|
||||||
|
required_plugins=None)
|
|
@ -201,9 +201,11 @@ class DelugeGTK(dbus.service.Object):
|
||||||
plugin = self.plugins.get_plugin(name)
|
plugin = self.plugins.get_plugin(name)
|
||||||
version = plugin['version']
|
version = plugin['version']
|
||||||
config = plugin['config']
|
config = plugin['config']
|
||||||
|
description = plugin['description']
|
||||||
self.prf_glade.get_widget("plugin_conf").set_sensitive(config)
|
self.prf_glade.get_widget("plugin_conf").set_sensitive(config)
|
||||||
|
self.prf_glade.get_widget("plugin_text").get_buffer(
|
||||||
self.prf_glade.get_widget("plugin_text").get_buffer().set_text("%s\n%s"%(name, version))
|
).set_text("%s\nVersion: %s\n\n%s"%
|
||||||
|
(name, version, description))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def plugin_toggled(self, renderer, path):
|
def plugin_toggled(self, renderer, path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue