advanced; debug

This commit is contained in:
sirjonasxx 2019-01-30 00:13:58 +01:00
parent e093297ed2
commit 716a6545e9
3 changed files with 17 additions and 5 deletions

View File

@ -101,7 +101,7 @@ public class HConnection {
} }
public final static boolean DEBUG = false; public static boolean DEBUG = false;
private static final HostReplacer hostsReplacer = HostReplacerFactory.get(); private static final HostReplacer hostsReplacer = HostReplacerFactory.get();
private volatile boolean hostRedirected = false; private volatile boolean hostRedirected = false;

View File

@ -1,12 +1,11 @@
package gearth.ui.extra; package gearth.ui.extra;
import gearth.Main;
import gearth.misc.Cacher; import gearth.misc.Cacher;
import gearth.protocol.HConnection;
import gearth.ui.SubForm; import gearth.ui.SubForm;
import gearth.ui.info.Info; import gearth.ui.info.Info;
import javafx.beans.InvalidationListener; import javafx.beans.InvalidationListener;
import javafx.beans.Observable; import javafx.beans.Observable;
import javafx.event.ActionEvent;
import javafx.scene.control.*; import javafx.scene.control.*;
/** /**
@ -30,7 +29,7 @@ public class Extra extends SubForm {
public TextField txt_mitmPort; public TextField txt_mitmPort;
public CheckBox cbx_disableDecryption; public CheckBox cbx_disableDecryption;
public CheckBox txt_debug; public CheckBox cbx_debug;
public void initialize() { public void initialize() {
url_troubleshooting.setTooltip(new Tooltip("https://github.com/sirjonasxx/G-Earth/wiki/Troubleshooting")); url_troubleshooting.setTooltip(new Tooltip("https://github.com/sirjonasxx/G-Earth/wiki/Troubleshooting"));
@ -40,16 +39,29 @@ public class Extra extends SubForm {
if (notepadInitValue != null) { if (notepadInitValue != null) {
txtarea_notepad.setText(notepadInitValue); txtarea_notepad.setText(notepadInitValue);
} }
cbx_debug.selectedProperty().addListener(observable -> HConnection.DEBUG = cbx_debug.isSelected());
} }
@Override @Override
protected void onParentSet() { protected void onParentSet() {
parentController.getStage().setAlwaysOnTop(cbx_alwaysOnTop.isSelected()); parentController.getStage().setAlwaysOnTop(cbx_alwaysOnTop.isSelected());
cbx_alwaysOnTop.selectedProperty().addListener(observable -> parentController.getStage().setAlwaysOnTop(cbx_alwaysOnTop.isSelected())); cbx_alwaysOnTop.selectedProperty().addListener(observable -> parentController.getStage().setAlwaysOnTop(cbx_alwaysOnTop.isSelected()));
cbx_advanced.selectedProperty().addListener(observable -> updateAdvancedUI());
getHConnection().addStateChangeListener((oldState, newState) -> {
if (oldState == HConnection.State.NOT_CONNECTED || newState == HConnection.State.NOT_CONNECTED) {
updateAdvancedUI();
}
});
} }
@Override @Override
protected void onExit() { protected void onExit() {
Cacher.put(NOTEPAD_CACHE_KEY, txtarea_notepad.getText()); Cacher.put(NOTEPAD_CACHE_KEY, txtarea_notepad.getText());
} }
private void updateAdvancedUI() {
}
} }

View File

@ -109,7 +109,7 @@
</padding> </padding>
</GridPane> </GridPane>
<CheckBox fx:id="cbx_disableDecryption" mnemonicParsing="false" text="Disable decryption" GridPane.rowIndex="2" /> <CheckBox fx:id="cbx_disableDecryption" mnemonicParsing="false" text="Disable decryption" GridPane.rowIndex="2" />
<CheckBox fx:id="txt_debug" mnemonicParsing="false" text="Debug to stdout" GridPane.rowIndex="3" /> <CheckBox fx:id="cbx_debug" mnemonicParsing="false" text="Debug to stdout" GridPane.rowIndex="3" />
</children> </children>
</GridPane> </GridPane>
<CheckBox fx:id="cbx_advanced" mnemonicParsing="false" text="Advanced" textFill="#000000ba"> <CheckBox fx:id="cbx_advanced" mnemonicParsing="false" text="Advanced" textFill="#000000ba">