clang-format again

This commit is contained in:
eyedeekay
2024-03-05 18:06:04 -05:00
parent da5ae47278
commit 616a839c8b
2 changed files with 28 additions and 27 deletions

View File

@ -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"/>

View File

@ -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;
@ -210,8 +211,8 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
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 {