From 1f614332bcd103229f15f51157a52824005fba96 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Thu, 22 Sep 2016 17:28:56 +0200 Subject: Automatically update signature note when changing language if it's the default --- .../java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java | 2 +- .../gui/composites/SimpleConfigurationComposite.java | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java index c0d06b7c..32ad1741 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java @@ -144,7 +144,7 @@ public class ATrustHandler extends MobileBKUHandler { status.setErrorMessage(null); if (responseData.contains("ExpiresInfo.aspx?sid=")) { //$NON-NLS-1$ - // Certification expiration interstitial - skip + // Certificate expiration interstitial - skip String notice = Messages.getString("mobileBKU.notice") + " " + //$NON-NLS-1$ //$NON-NLS-2$ StringEscapeUtils.unescapeHtml4(MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "id", "Label2")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ .replaceAll("\\<.*?\\>", ""); //$NON-NLS-1$ //$NON-NLS-2$ 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 d02d9258..a124c86d 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 @@ -427,7 +427,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { SUPPORTED_LOCALES[SimpleConfigurationComposite.this.cmbSignatureLang .getSelectionIndex()]; if (!currentLocale.equals(selectedLocale)) { - performSignatureLangSelectionChanged(selectedLocale); + performSignatureLangSelectionChanged(selectedLocale, currentLocale); } } }); @@ -682,10 +682,17 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { return 0; } - void performSignatureLangSelectionChanged(Locale selected) { + void performSignatureLangSelectionChanged(Locale selected, Locale previous) { log.debug("Selected Sign Locale: " + selected); //$NON-NLS-1$ this.configurationContainer.setSignatureLocale(selected); this.cmbSignatureLang.select(this.getLocaleElementIndex(selected)); + if (previous != null) { + String prev_default_note = Messages.getString("simple_config.Note_Default", previous); //$NON-NLS-1$ + if (this.txtSignatureNote.getText().equals(prev_default_note)) { + this.txtSignatureNote.setText(Messages.getString("simple_config.Note_Default", selected)); //$NON-NLS-1$); + processSignatureNoteChanged(); + } + } } /* @@ -792,7 +799,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.setVisibleImage(); - this.performSignatureLangSelectionChanged(this.configurationContainer.getSignatureLocale()); + this.performSignatureLangSelectionChanged(this.configurationContainer.getSignatureLocale(), null); } /* (non-Javadoc) -- cgit v1.2.3