summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-06-22 15:55:56 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-06-22 15:55:56 +0200
commit85723fc25e4f624ba2787cd63f9a84a55248edc9 (patch)
tree4b31a8066869a0a42819bc1f9f929336c8350e8b /pdf-over-gui/src/main/java/at
parent0b36d9f6835346692be29ef0a8337a04e94030e7 (diff)
downloadpdf-over-85723fc25e4f624ba2787cd63f9a84a55248edc9.tar.gz
pdf-over-85723fc25e4f624ba2787cd63f9a84a55248edc9.tar.bz2
pdf-over-85723fc25e4f624ba2787cd63f9a84a55248edc9.zip
move logs to logs/ subfolder, and add "Show log directory" button to "about" configuration tab
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java
index 7bd64ab4..a0a423c4 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java
@@ -1,6 +1,7 @@
package at.asit.pdfover.gui.composites.configuration;
import java.awt.Desktop;
+import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -10,6 +11,7 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
@@ -27,6 +29,7 @@ public class AboutComposite extends ConfigurationCompositeBase {
private Link lnkAbout;
private Link lnkDataProtection;
private Label lblDataProtection;
+ private Button btnOpenLogDirectory;
/**
* @param parent
* @param style
@@ -49,6 +52,10 @@ public class AboutComposite extends ConfigurationCompositeBase {
StateComposite.anchor(lnkDataProtection).top(lblDataProtection,10).left(0,5).right(100,-5).set();
StateComposite.setFontHeight(lnkDataProtection, Constants.TEXT_SIZE_NORMAL);
+ this.btnOpenLogDirectory = new Button(this, SWT.NONE);
+ StateComposite.anchor(btnOpenLogDirectory).bottom(100, -5).right(100, -5).set();
+ StateComposite.setFontHeight(btnOpenLogDirectory, Constants.TEXT_SIZE_BUTTON);
+
this.lnkAbout.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -89,6 +96,19 @@ public class AboutComposite extends ConfigurationCompositeBase {
}
});
+ this.btnOpenLogDirectory.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try
+ {
+ if (Desktop.isDesktopSupported())
+ Desktop.getDesktop().open(new File(Constants.CONFIG_DIRECTORY + File.separator + "logs"));
+ } catch (Exception ex) {
+ log.warn("Failed to open log directory: ", ex);
+ }
+ }
+ });
+
// Load localized strings
reloadResources();
}
@@ -110,6 +130,7 @@ public class AboutComposite extends ConfigurationCompositeBase {
this.lnkAbout.setText(Messages.getString("config.AboutText")); //$NON-NLS-1$
this.lblDataProtection.setText(Messages.getString("config.DataProtection"));
this.lnkDataProtection.setText(Messages.getString("config.DataProtectionStatement"));
+ this.btnOpenLogDirectory.setText(Messages.getString("config.ShowLogDirectory"));
}