When specifying the --base option to work with reverse proxy
the WebUI is no longer accessible locally since it listens
on the server root, but serves on the path specified to work
for the reverse proxy.
Change this to also handle local requests to the base path
such that the WebUI will be available both for the reverse proxy
as well as locally on the interface/port which the twisted sever
listens on.
In GTKUI standalone mode, WebApi.enable would try to connect to
daemon if web.conf had the 'default_daemon' option set, causing
the client calls to break.
Fix by leaving shutdown procedure to gtkui.py:
* Daemon no longer calls component.shutdown() in GTKUI classic mode
* Mainwindow no longer calls reactor.stop but instead fires a
'gtkui_close' signal.
* gtkui.py installs custom SIGINT handler to initiate shutdown before
stopping reactor.
This should fix problems with errors occuring when failing to
enable plugins. Errors in plugin handling are handled better
and properly logged.
WebUI plugin in particular had issues when being enabled and disabled
multiple times because it was trying to create DelugeWeb component
each time it was enabled. If deluge-web is already listening on
the same port, enabling the WebUI plugin will fail, and the checkbox
will not be checked.
There are still some issues when enabling/disabling plugins by
clicking fast multiple times on the checkbox.
Add --profile to commonoptions making the option now available for
daemon and all UIs. --profile option now prints to stdout unless an
optional filename is specified.
Add entry points into setup for each of the UIs and then use this
information to determine which client UI to run.
This ensures that custom UIs may be written and run without
the need to modifify deluge source code.
Handle child args and -a args in a common way so that all children
accept the same input format. Modify UIs to pass through setup
arguments to the base class.
Instead of launching the UI directly launch the UI via the _UI
subclasses in the same way that the scripts launch the clients.
The only use of the ui.UI class is a base for Web which never calls
__init__ and at the beginning when choosing which UI to launch,
however that doesn't need to be an object.