Developing a plugin - need some help with WebUI part
Posted: Sat Jun 09, 2012 11:11 pm
As the title says, I'm developing a plugin. The core functionality is working great, and the GtkUI part is functioning fine too.
The WebUI part is really throwing me off however, as I don't often use JavaScript and I have never used the ExtJS framework before and don't really have any idea what I'm doing for it.
I have looked over the code for official and 3rd party plugins that have WebUI sections, but it differs greatly from the skeleton code that gets generated that I don't even know where to start taking it apart!
All I need is a preferences page that can modify the config data used by the plugin. So far I can have the basic preferences page, but I can't use the exported get_config and set_config to change the plugin's profile data.
The current source is: https://github.com/TimJones/Deluge-Move ... ee/develop
and my diff just to try and load & display a config setting:
This is pretty much grafted from what I could understand of the official plugins, stripped to the bare minimum. It fails trying to access the deluge.client.moveonremove object and a little console.log'ing reveals that deluge.client doesn't have a moveonremove object. I get no warnings or errors from registering the plugin and the preferences page loads and displays as it should...
Any help is appreciated.
The WebUI part is really throwing me off however, as I don't often use JavaScript and I have never used the ExtJS framework before and don't really have any idea what I'm doing for it.
I have looked over the code for official and 3rd party plugins that have WebUI sections, but it differs greatly from the skeleton code that gets generated that I don't even know where to start taking it apart!
All I need is a preferences page that can modify the config data used by the plugin. So far I can have the basic preferences page, but I can't use the exported get_config and set_config to change the plugin's profile data.
The current source is: https://github.com/TimJones/Deluge-Move ... ee/develop
and my diff just to try and load & display a config setting:
Code: Select all
onRender: function(ct, position) {
Deluge.ux.preferences.MoveOnRemovePage.superclass.onRender.call(this, ct, position);
this.form.layout = new Ext.layout.FormLayout();
this.form.layout.setContainer(this);
this.form.doLayout();
},
onApply: function() {
// build settings object
var config = { }
config['move_to'] = this.moveTo.getValue();
deluge.client.moveonremove.set_config(config);
},
onOk: function() {
this.onApply();
},
afterRender: function() {
Deluge.ux.preferences.MoveOnRemovePage.superclass.afterRender.call(this);
this.updateConfig();
},
updateConfig: function() {
deluge.client.moveonremove.get_config({
success: function(config) {
this.moveTo.setValue(config['move_to']);
},
scope: this
});
}
Any help is appreciated.