mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-02 06:36:15 +00:00
improvements to plugin dialog
This commit is contained in:
parent
6e5dfd7ddb
commit
98b3b4e7cc
@ -636,52 +636,51 @@ their share ratio reaches:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="show_tabs">False</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="plugins_options1">
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<widget class="GtkTextView" id="plugin_text">
|
||||
<property name="visible">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="x_padding">10</property>
|
||||
<property name="y_padding">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="plugin_conf">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="label" translatable="yes">gtk-preferences</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="plugin_pref"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</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>
|
||||
</child>
|
||||
<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>
|
||||
<child>
|
||||
<widget class="GtkTextView" id="plugin_text">
|
||||
<property name="visible">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||
<property name="cursor_visible">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="plugin_conf">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="label" translatable="yes">gtk-preferences</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="plugin_pref"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="padding">10</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</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)
|
||||
version = plugin['version']
|
||||
config = plugin['config']
|
||||
description = plugin['description']
|
||||
self.prf_glade.get_widget("plugin_conf").set_sensitive(config)
|
||||
|
||||
self.prf_glade.get_widget("plugin_text").get_buffer().set_text("%s\n%s"%(name, version))
|
||||
self.prf_glade.get_widget("plugin_text").get_buffer(
|
||||
).set_text("%s\nVersion: %s\n\n%s"%
|
||||
(name, version, description))
|
||||
return True
|
||||
|
||||
def plugin_toggled(self, renderer, path):
|
||||
|
Loading…
x
Reference in New Issue
Block a user