mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Added '-s', '--set-default-ui' option to deluge
This commit is contained in:
parent
d8447aea72
commit
b258a9c340
3 changed files with 33 additions and 17 deletions
|
@ -6,13 +6,16 @@ Deluge 1.1.0_RC4 (In Development)
|
||||||
GtkUI:
|
GtkUI:
|
||||||
* Fix translation setting in remove torrent dialog
|
* Fix translation setting in remove torrent dialog
|
||||||
* Fix notification bug on startup for already finished torrents
|
* Fix notification bug on startup for already finished torrents
|
||||||
|
|
||||||
Ajaxui:
|
Ajaxui:
|
||||||
* Fix loading on iPods.
|
* Fix loading on iPods.
|
||||||
* Fix sorting on the name column.
|
* Fix sorting on the name column.
|
||||||
* Add "Not Implemented" alerts to some functions.
|
* Add "Not Implemented" alerts to some functions.
|
||||||
* Improve the options tab on the Add Torrent dialog
|
* Improve the options tab on the Add Torrent dialog
|
||||||
|
|
||||||
|
Misc:
|
||||||
|
* Added '-s', '--set-default-ui' option to deluge
|
||||||
|
|
||||||
Deluge 1.1.0_RC3 (05 January 2009)
|
Deluge 1.1.0_RC3 (05 January 2009)
|
||||||
Core:
|
Core:
|
||||||
* Fix applying proxy settings
|
* Fix applying proxy settings
|
||||||
|
|
|
@ -34,6 +34,7 @@ import sys
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
import deluge.common
|
import deluge.common
|
||||||
|
import deluge.configmanager
|
||||||
|
|
||||||
def start_ui():
|
def start_ui():
|
||||||
"""Entry point for ui script"""
|
"""Entry point for ui script"""
|
||||||
|
@ -58,10 +59,22 @@ def start_ui():
|
||||||
help="Set the log level: none, info, warning, error, critical, debug", action="store", type="str")
|
help="Set the log level: none, info, warning, error, critical, debug", action="store", type="str")
|
||||||
parser.add_option("-q", "--quiet", dest="quiet",
|
parser.add_option("-q", "--quiet", dest="quiet",
|
||||||
help="Sets the log level to 'none', this is the same as `-L none`", action="store_true", default=False)
|
help="Sets the log level to 'none', this is the same as `-L none`", action="store_true", default=False)
|
||||||
|
parser.add_option("-s", "--set-default-ui", dest="default_ui",
|
||||||
|
help="Sets the default UI to be run when no UI is specified", action="store", type="str")
|
||||||
|
|
||||||
# Get the options and args from the OptionParser
|
# Get the options and args from the OptionParser
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if options.default_ui:
|
||||||
|
if options.config:
|
||||||
|
deluge.configmanager.set_config_dir(options.config)
|
||||||
|
|
||||||
|
config = deluge.configmanager.ConfigManager("ui.conf")
|
||||||
|
config["default_ui"] = options.default_ui
|
||||||
|
config.save()
|
||||||
|
print "The default UI has been changed to", options.default_ui
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if options.quiet:
|
if options.quiet:
|
||||||
options.loglevel = "none"
|
options.loglevel = "none"
|
||||||
|
|
||||||
|
|
|
@ -48,19 +48,19 @@ class UI:
|
||||||
config.save()
|
config.save()
|
||||||
del config
|
del config
|
||||||
|
|
||||||
if selected_ui == "gtk":
|
try:
|
||||||
log.info("Starting GtkUI..")
|
if selected_ui == "gtk":
|
||||||
from deluge.ui.gtkui.gtkui import GtkUI
|
log.info("Starting GtkUI..")
|
||||||
ui = GtkUI(args)
|
from deluge.ui.gtkui.gtkui import GtkUI
|
||||||
elif selected_ui == "web":
|
ui = GtkUI(args)
|
||||||
log.info("Starting WebUI..")
|
elif selected_ui == "web":
|
||||||
from deluge.ui.webui.webui import WebUI
|
log.info("Starting WebUI..")
|
||||||
ui = WebUI(args)
|
from deluge.ui.webui.webui import WebUI
|
||||||
elif selected_ui == "null":
|
ui = WebUI(args)
|
||||||
log.info("Starting NullUI..")
|
elif selected_ui == "console":
|
||||||
from deluge.ui.null.deluge_shell import NullUI
|
log.info("Starting ConsoleUI..")
|
||||||
ui = NullUI(args)
|
from deluge.ui.console.main import ConsoleUI
|
||||||
elif selected_ui == "console":
|
ui = ConsoleUI(ui_args).run()
|
||||||
log.info("Starting ConsoleUI..")
|
except ImportError:
|
||||||
from deluge.ui.console.main import ConsoleUI
|
log.error("Unable to find the requested UI. Please select a different UI with the '-u' option or alternatively use the '-s' option to select a different default UI.")
|
||||||
ui = ConsoleUI(ui_args).run()
|
sys.exit(0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue