summaryrefslogtreecommitdiff
path: root/pdf-over-gui
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-14 11:09:38 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-14 11:09:38 +0200
commitc98c1a5932f2cb396fc8c9fb20983895e62e652e (patch)
treead3a61de7fd4cb1fd1c35689c3dee8e5e9fdea81 /pdf-over-gui
parent80be9e308410b22c4b3eb0beb4b933e6c208f928 (diff)
downloadpdf-over-c98c1a5932f2cb396fc8c9fb20983895e62e652e.tar.gz
pdf-over-c98c1a5932f2cb396fc8c9fb20983895e62e652e.tar.bz2
pdf-over-c98c1a5932f2cb396fc8c9fb20983895e62e652e.zip
add necessary config switches to persist "remember" checkbox (no functionality still)
Diffstat (limited to 'pdf-over-gui')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java3
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationManager.java11
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java4
4 files changed, 20 insertions, 0 deletions
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());