mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +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:
|
||||
* Fix translation setting in remove torrent dialog
|
||||
* Fix notification bug on startup for already finished torrents
|
||||
|
||||
|
||||
Ajaxui:
|
||||
* Fix loading on iPods.
|
||||
* Fix sorting on the name column.
|
||||
* Add "Not Implemented" alerts to some functions.
|
||||
* 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)
|
||||
Core:
|
||||
* Fix applying proxy settings
|
||||
|
|
|
@ -34,6 +34,7 @@ import sys
|
|||
from optparse import OptionParser
|
||||
|
||||
import deluge.common
|
||||
import deluge.configmanager
|
||||
|
||||
def start_ui():
|
||||
"""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")
|
||||
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)
|
||||
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
|
||||
(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:
|
||||
options.loglevel = "none"
|
||||
|
||||
|
|
|
@ -48,19 +48,19 @@ class UI:
|
|||
config.save()
|
||||
del config
|
||||
|
||||
if selected_ui == "gtk":
|
||||
log.info("Starting GtkUI..")
|
||||
from deluge.ui.gtkui.gtkui import GtkUI
|
||||
ui = GtkUI(args)
|
||||
elif selected_ui == "web":
|
||||
log.info("Starting WebUI..")
|
||||
from deluge.ui.webui.webui import WebUI
|
||||
ui = WebUI(args)
|
||||
elif selected_ui == "null":
|
||||
log.info("Starting NullUI..")
|
||||
from deluge.ui.null.deluge_shell import NullUI
|
||||
ui = NullUI(args)
|
||||
elif selected_ui == "console":
|
||||
log.info("Starting ConsoleUI..")
|
||||
from deluge.ui.console.main import ConsoleUI
|
||||
ui = ConsoleUI(ui_args).run()
|
||||
try:
|
||||
if selected_ui == "gtk":
|
||||
log.info("Starting GtkUI..")
|
||||
from deluge.ui.gtkui.gtkui import GtkUI
|
||||
ui = GtkUI(args)
|
||||
elif selected_ui == "web":
|
||||
log.info("Starting WebUI..")
|
||||
from deluge.ui.webui.webui import WebUI
|
||||
ui = WebUI(args)
|
||||
elif selected_ui == "console":
|
||||
log.info("Starting ConsoleUI..")
|
||||
from deluge.ui.console.main import ConsoleUI
|
||||
ui = ConsoleUI(ui_args).run()
|
||||
except ImportError:
|
||||
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.")
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Add table
Reference in a new issue