From dd6f9d619008b4e3bcd5b163a25d3cf91836bf03 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Mon, 13 Sep 2021 14:57:00 +0200 Subject: fixed issue 43 --- .../composites/SimpleConfigurationComposite.java | 26 +++++++--------------- 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 2ec6d80c..abed9e93 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -753,9 +753,9 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { void alignSignatureNoteTextToProfile(Profile profile){ if (detectChanges(profile) == false){ - this.txtSignatureNote.setText(getSignatureBlockNoteTextAccordingToProfile(profile)); + this.txtSignatureNote.setText(getSignatureBlockNoteTextAccordingToProfile(profile, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())); this.configurationContainer.setSignatureNote( - Messages.getString(getSignatureBlockNoteTextAccordingToProfile(profile)) + Messages.getString(getSignatureBlockNoteTextAccordingToProfile(profile, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) ); } @@ -765,29 +765,19 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { String note = this.txtSignatureNote.getText(); note = note.replace("!",""); - if (note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.AMTSSIGNATURBLOCK)) || - note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.SIGNATURBLOCK_SMALL)) || - note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.INVISIBLE)) || - note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.BASE_LOGO))){ + if (note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.AMTSSIGNATURBLOCK, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) || + note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.SIGNATURBLOCK_SMALL, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) || + note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.INVISIBLE, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) || + note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.BASE_LOGO, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale()))){ return false; } return true; } - //TODO FIX ME - String getSignatureBlockNoteTextAccordingToProfile(Profile profile, Locale locale){ - if (profile.equals(Profile.SIGNATURBLOCK_SMALL)){ - return Messages.getString("simple_config.Note_Default_Standard", locale); - } else if (profile.equals(Profile.AMTSSIGNATURBLOCK)){ - return Messages.getString("simple_config.Note_Default_OfficialSignature", locale); - } else { - return ""; - } - } - String getSignatureBlockNoteTextAccordingToProfile(Profile profile){ - return getSignatureBlockNoteTextAccordingToProfile(profile, this.configurationContainer.getSignatureLocale()); + String getSignatureBlockNoteTextAccordingToProfile(Profile profile, Locale signatureLocale){ + return Profile.getSignatureBlockNoteTextAccordingToProfile(profile, this.configurationContainer.getSignatureLocale()); } void setSignatureProfileSetting(){ -- cgit v1.2.3