diff options
5 files changed, 21 insertions, 0 deletions
diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java index e2f46166..fb60f532 100644 --- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java @@ -158,6 +158,7 @@ public class Constants { /** The mobile number config parameter */ public static final String CFG_MOBILE_NUMBER = "MOBILE_NUMBER"; + public static final String CFG_MOBILE_PASSWORD_REMEMBER = "MOBILE_REMEMBER_PASSWORD"; /** The signature note config parameter */ public static final String CFG_SIGNATURE_NOTE = "SIGNATURE_NOTE"; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java index 7edcd359..db37502a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java @@ -143,6 +143,9 @@ public class MobileBKUEnterNumberComposite extends StateComposite { }
}
+ public boolean isRememberPassword() { return this.btn_remember.getSelection(); }
+ public void setRememberPassword(boolean state) { this.btn_remember.setSelection(state); }
+
/**
* Create the composite.
*
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java index c6a50c0b..7fb08602 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java @@ -85,6 +85,8 @@ public class ConfigurationDataInMemory { /** The mobile phone password */ public String mobilePassword = null; + public boolean rememberPassword = false; + /** Holds the proxy host */ public String proxyHost = null; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationManager.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationManager.java index 3d5ebfff..d467178a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationManager.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationManager.java @@ -87,6 +87,7 @@ public class ConfigurationManager { setDefaultEmblemPersistent(diskConfig.getProperty(Constants.CFG_EMBLEM)); setDefaultMobileNumberPersistent(diskConfig.getProperty(Constants.CFG_MOBILE_NUMBER)); + setRememberMobilePasswordPersistent(Constants.TRUE.equals(diskConfig.getProperty(Constants.CFG_MOBILE_PASSWORD_REMEMBER))); setProxyHostPersistent(diskConfig.getProperty(Constants.CFG_PROXY_HOST)); setProxyUserPersistent(diskConfig.getProperty(Constants.CFG_PROXY_USER)); @@ -284,6 +285,8 @@ public class ConfigurationManager { props.setProperty(Constants.CFG_EMBLEM, getDefaultEmblemPersistent()); props.setProperty(Constants.CFG_SIGNATURE_NOTE, getSignatureNote()); props.setProperty(Constants.CFG_MOBILE_NUMBER, getDefaultMobileNumberPersistent()); + if (getRememberMobilePassword()) + props.setProperty(Constants.CFG_MOBILE_PASSWORD_REMEMBER, Constants.TRUE); props.setProperty(Constants.CFG_OUTPUT_FOLDER, getDefaultOutputFolderPersistent()); props.setProperty(Constants.CFG_POSTFIX, getSaveFilePostFix()); props.setProperty(Constants.CFG_SIGNATURE_PLACEHOLDER_TRANSPARENCY, @@ -476,6 +479,14 @@ public class ConfigurationManager { return this.configurationOverlay.mobilePassword; } + public boolean getRememberMobilePassword() { + return this.configuration.rememberPassword; + } + + public void setRememberMobilePasswordPersistent(boolean state) { + this.configuration.rememberPassword = state; + } + public void setDefaultEmblemPersistent(String emblem) { try { if (emblem == null || emblem.trim().isEmpty()) { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java index 0d0018dd..d5f5cbe0 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java @@ -221,6 +221,9 @@ public class MobileBKUState extends State { // set possible password
ui.setMobilePassword(mobileStatus.mobilePassword);
}
+
+ ui.setRememberPassword(getStateMachine().configProvider.getRememberMobilePassword());
+
ui.enableButton();
getStateMachine().display(ui);
@@ -244,6 +247,7 @@ public class MobileBKUState extends State { // get number and password from UI
mobileStatus.phoneNumber = ui.getMobileNumber();
mobileStatus.mobilePassword = ui.getMobilePassword();
+ getStateMachine().configProvider.setRememberMobilePasswordPersistent(ui.isRememberPassword());
// show waiting composite
getStateMachine().display(this.getWaitingComposite());
|