clang-format again
This commit is contained in:
@ -461,7 +461,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
|
|||||||
<exec executable="clang-format">
|
<exec executable="clang-format">
|
||||||
<arg value="-i"/>
|
<arg value="-i"/>
|
||||||
<arg value="src/java/net/i2p/i2pfirefox/I2PBrowser.java"/>
|
<arg value="src/java/net/i2p/i2pfirefox/I2PBrowser.java"/>
|
||||||
<arg value="src/java/net/i2p/i2pfirefox/I2PBrowserPlugin.java"/>
|
<arg value="src/plugin/net/i2p/i2pfirefox/plugin/plugin/I2PBrowserPlugin.java"/>
|
||||||
<arg value="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java"/>
|
<arg value="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java"/>
|
||||||
<arg value="src/java/net/i2p/i2pfirefox/I2PChromium.java"/>
|
<arg value="src/java/net/i2p/i2pfirefox/I2PChromium.java"/>
|
||||||
<arg value="src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java"/>
|
<arg value="src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java"/>
|
||||||
|
@ -2,7 +2,6 @@ package net.i2p.i2pfirefox.plugin;
|
|||||||
|
|
||||||
import java.awt.GraphicsEnvironment;
|
import java.awt.GraphicsEnvironment;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
import net.i2p.app.ClientApp;
|
import net.i2p.app.ClientApp;
|
||||||
import net.i2p.app.ClientAppManager;
|
import net.i2p.app.ClientAppManager;
|
||||||
@ -83,15 +82,16 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
|
|||||||
}
|
}
|
||||||
public void shutdown(String[] args) {
|
public void shutdown(String[] args) {
|
||||||
if (!isSystrayEnabled()) {
|
if (!isSystrayEnabled()) {
|
||||||
i2pBrowser.logger.info("I2P Browser tray manager not supported");
|
_log.info("I2P Browser tray manager not supported");
|
||||||
i2pBrowser.stop();
|
i2pBrowser.stop();
|
||||||
changeState(ClientAppState.STOPPED);
|
changeState(ClientAppState.STOPPED);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void startup() {
|
public void startup() {
|
||||||
if (!isSystrayEnabled()) {
|
if (!isSystrayEnabled()) {
|
||||||
i2pBrowser.logger.info("I2P Browser tray manager not supported");
|
_log.info("I2P Browser tray manager not supported");
|
||||||
try {
|
try {
|
||||||
String url = "http://proxy.i2p";
|
String url = "http://proxy.i2p";
|
||||||
i2pBrowser.launchFirefox(0, new String[] {url});
|
i2pBrowser.launchFirefox(0, new String[] {url});
|
||||||
@ -99,23 +99,24 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
try {
|
|
||||||
String url = "http://proxy.i2p";
|
|
||||||
i2pBrowser.logger.info(
|
|
||||||
"Starting I2P Browser tray manager by testing http://proxy.i2p");
|
|
||||||
MenuService dtg = startTrayApp();
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
String url = "http://proxy.i2p";
|
||||||
} catch (InterruptedException ie) {
|
_log.info(
|
||||||
|
"Starting I2P Browser tray manager by testing http://proxy.i2p");
|
||||||
|
MenuService dtg = startTrayApp();
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
|
}
|
||||||
|
i2pBrowser.launchFirefox(0, new String[] {url});
|
||||||
|
if (dtg != null) {
|
||||||
|
dtg.addMenu("Launch I2P Browser", new Starter(dtg));
|
||||||
|
dtg.addMenu("Quit I2P Browser", new Stopper(dtg));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
i2pBrowser.launchFirefox(0, new String[] {url});
|
|
||||||
if (dtg != null) {
|
|
||||||
dtg.addMenu("Launch I2P Browser", new Starter(dtg));
|
|
||||||
dtg.addMenu("Quit I2P Browser", new Stopper(dtg));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,9 +137,9 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copied directly from I2PSnark-standalone where it is used to determine
|
// Copied directly from I2PSnark-standalone where it is used to determine
|
||||||
// whether to launchFirefox the tray app Our environment should basically never be
|
// whether to launchFirefox the tray app Our environment should basically
|
||||||
// headless, that doesn't make any sense, but something tells me I should
|
// never be headless, that doesn't make any sense, but something tells me I
|
||||||
// leave that check in.
|
// should leave that check in.
|
||||||
private boolean isSystrayEnabled() {
|
private boolean isSystrayEnabled() {
|
||||||
if (GraphicsEnvironment.isHeadless())
|
if (GraphicsEnvironment.isHeadless())
|
||||||
return false;
|
return false;
|
||||||
@ -176,7 +177,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
|
|||||||
*/
|
*/
|
||||||
public class StarterThread implements Runnable {
|
public class StarterThread implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
i2pBrowser.launchFirefox(0, null);
|
i2pBrowser.launchFirefox(0, null);
|
||||||
changeState(ClientAppState.RUNNING);
|
changeState(ClientAppState.RUNNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,16 +203,16 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
|
|||||||
* @since 0.9.61
|
* @since 0.9.61
|
||||||
*/
|
*/
|
||||||
public class StopperThread implements Runnable {
|
public class StopperThread implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
i2pBrowser.stop();
|
i2pBrowser.stop();
|
||||||
changeState(ClientAppState.STOPPED);
|
changeState(ClientAppState.STOPPED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void changeState(ClientAppState state) {
|
private synchronized void changeState(ClientAppState state) {
|
||||||
if (_mgr != null)
|
if (_mgr != null)
|
||||||
_mgr.notify(this, state, null, null);
|
_mgr.notify(this, state, null, null);
|
||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
I2PBrowserPlugin plugin = new I2PBrowserPlugin();
|
I2PBrowserPlugin plugin = new I2PBrowserPlugin();
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user