use of com.biglybt.ui.console.multiuser.UserManager in project BiglyBT by BiglySoftware.
the class UI method startUI.
private void startUI() {
boolean created_console = false;
if (console == null || !console.isAlive()) {
// ConsoleInput.printconsolehelp(System.out);
System.out.println();
PrintStream this_out = System.out;
// Unless a system property tells us not to, we'll take stdout and stderr offline.
if (!"on".equals(System.getProperty(SystemProperties.SYSPROP_CONSOLE_NOISY)) && isFirst()) {
// We'll hide any output to stdout or stderr - we don't want to litter our
// view.
PrintStream ps = new PrintStream(new java.io.OutputStream() {
@Override
public void write(int c) {
}
@Override
public void write(byte[] b, int i1, int i2) {
}
});
System.setOut(ps);
System.setErr(ps);
com.biglybt.core.logging.Logger.allowLoggingToStdErr(false);
}
console = new ConsoleInput("Main", core, System.in, this_out, Boolean.TRUE);
console.printwelcome();
console.printconsolehelp();
created_console = true;
}
PluginInterface pi = core.getPluginManager().getDefaultPluginInterface();
UIManager ui_manager = pi.getUIManager();
ui_manager.addUIEventListener(this);
try {
ui_manager.attachUI(this);
} catch (UIException e) {
e.printStackTrace();
}
TorrentDownloaderFactory.initManager(core.getGlobalManager(), true, true, COConfigurationManager.getStringParameter("Default save path"));
if (created_console && System.getProperty(SystemProperties.SYSPROP_CONSOLE_MULTIUSER) != null) {
UserManager manager = UserManager.getInstance(pi);
console.registerCommand(new UserCommand(manager));
}
}
Aggregations