summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-04 13:53:14 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-04 13:53:14 +0200
commit671d24d8e638b073b3aa5da00526978af2ebd06b (patch)
tree252998ce7e44d6db1c862c4ed9b7083d6aea5213 /pdf-over-gui/src/main/java
parent03b80912dc888296647412b0276e7610315fef13 (diff)
downloadpdf-over-671d24d8e638b073b3aa5da00526978af2ebd06b.tar.gz
pdf-over-671d24d8e638b073b3aa5da00526978af2ebd06b.tar.bz2
pdf-over-671d24d8e638b073b3aa5da00526978af2ebd06b.zip
pass Profile instead of String around
(in a bunch of different places)
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java4
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java4
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationManager.java18
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java2
5 files changed, 15 insertions, 15 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
index e24aa9a8..7316b91e 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
@@ -663,7 +663,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
}
this.configurationContainer.proxyUser = provider.getProxyUserPersistent();
this.configurationContainer.proxyPass = provider.getProxyPassPersistent();
- this.configurationContainer.setSignatureProfile(Profile.getProfile(provider.getSignatureProfile()));
+ this.configurationContainer.setSignatureProfile(provider.getSignatureProfile());
}
/*
@@ -745,7 +745,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
store.setUpdateCheckPersistent(this.configurationContainer.updateCheck);
- store.setSignatureProfilePersistent(this.configurationContainer.getSignatureProfile().name());
+ store.setSignatureProfilePersistent(this.configurationContainer.getSignatureProfile());
String hostOld = store.getProxyHostPersistent();
String hostNew = this.configurationContainer.proxyHost;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
index 52c78e9d..8f652603 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
@@ -348,7 +348,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase {
try {
PdfAs4SignatureParameter param = new PdfAs4SignatureParameter();
- param.signatureProfileName = this.configurationContainer.getSignatureProfile().name();
+ param.signatureProfile = this.configurationContainer.getSignatureProfile();
if(this.configurationContainer.signatureNote != null && !this.configurationContainer.signatureNote.isEmpty()) {
param.setProperty("SIG_NOTE", this.configurationContainer.signatureNote);
}
@@ -612,7 +612,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase {
store.setDefaultEmblemPersistent(this.configurationContainer.getEmblemPath());
store.setSignatureLocalePersistent(this.configurationContainer.signatureLocale);
store.setSignatureNotePersistent(this.configurationContainer.signatureNote);
- store.setSignatureProfilePersistent(this.configurationContainer.getSignatureProfile().name());
+ store.setSignatureProfilePersistent(this.configurationContainer.getSignatureProfile());
}
/*
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 df059e68..25353ac4 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
@@ -127,12 +127,12 @@ public class ConfigurationManager {
String signatureProfileName = diskConfig.getProperty(Constants.SIGNATURE_PROFILE);
if (signatureProfileName != null)
- setSignatureProfilePersistent(signatureProfileName);
+ setSignatureProfilePersistent(Profile.getProfile(signatureProfileName));
if (diskConfig.containsKey(Constants.CFG_SIGNATURE_NOTE))
setSignatureNotePersistent(diskConfig.getProperty(Constants.CFG_SIGNATURE_NOTE));
else
- setSignatureNotePersistent(Profile.getProfile(getSignatureProfile()).getDefaultSignatureBlockNote(getSignatureLocale()));
+ setSignatureNotePersistent(getSignatureProfile().getDefaultSignatureBlockNote(getSignatureLocale()));
String compat = diskConfig.getProperty(Constants.CFG_SIGNATURE_PDFA_COMPAT);
if (compat != null)
@@ -373,7 +373,7 @@ public class ConfigurationManager {
if (!getUpdateCheck())
props.setProperty(Constants.CFG_UPDATE_CHECK, Constants.FALSE);
- props.setProperty(Constants.SIGNATURE_PROFILE, getSignatureProfile());
+ props.setProperty(Constants.SIGNATURE_PROFILE, getSignatureProfile().name());
FileOutputStream outputstream = new FileOutputStream(configFile, false);
@@ -955,10 +955,6 @@ public class ConfigurationManager {
if (useMarker) setUseSignatureFieldsPersistent(false);
}
- public void setSignatureProfilePersistent(String profile) {
- this.configuration.setSignatureProfile(Profile.getProfile(profile));
- }
-
public void setSaveFilePostFixPersistent(String postFix) {
this.configuration.saveFilePostFix = postFix;
}
@@ -967,8 +963,12 @@ public class ConfigurationManager {
return this.configuration.saveFilePostFix;
}
- public String getSignatureProfile() {
- return this.configuration.getSignatureProfile().name();
+ public Profile getSignatureProfile() {
+ return this.configuration.getSignatureProfile();
+ }
+
+ public void setSignatureProfilePersistent(Profile profile) {
+ this.configuration.setSignatureProfile(profile);
}
public void setEnablePlaceholderUsagePersistent(boolean bool) {
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java
index 15a67876..29a37970 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java
@@ -107,7 +107,7 @@ public class PositioningState extends State {
ConfigurationManager config = stateMachine.configProvider;
PdfAs4SignatureParameter param = new PdfAs4SignatureParameter();
- param.signatureProfileName = config.getSignatureProfile();
+ param.signatureProfile = config.getSignatureProfile();
Emblem emblem = new Emblem(config.getDefaultEmblemPath());
param.emblem = emblem;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java
index bb3190ef..b0cfa71e 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java
@@ -150,7 +150,7 @@ public class PrepareSigningState extends State {
this.state.signatureParameter.enablePDFACompat = configuration.getSignaturePdfACompat();
- this.state.signatureParameter.signatureProfileName = configuration.getSignatureProfile();
+ this.state.signatureParameter.signatureProfile = configuration.getSignatureProfile();
this.state.signingState = PdfAs4Signer.prepare(this.state.signatureParameter);