Skip to content

Commit

Permalink
Merge pull request #393 from veraPDF/show-user-location
Browse files Browse the repository at this point in the history
Show config location
  • Loading branch information
MaximPlusov authored and Git User committed Apr 16, 2024
1 parent ca30147 commit 2d1dd02
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
files: greenfield-apps/target/site/jacoco/jacoco.xml, gui/target/site/jacoco/jacoco.xml, pdfbox-apps/target/site/jacoco/jacoco.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }}
- name: Codacy coverage reporting
uses: codacy/codacy-coverage-reporter-action@v1
with:
Expand Down
1 change: 1 addition & 0 deletions gui/src/main/java/org/verapdf/cli/VeraPdfCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public static void main(final String[] args) throws VeraPDFException {
JCommander jCommander = new JCommander(cliArgParser);
if (Arrays.asList(args).contains(VeraCliArgParser.USE_CONFIG)) {
cliArgParser.setValuesFromConfig(configManager);
logger.config("Config location: " + configManager.getConfigDir().toPath().toString());
}
jCommander.setUsageFormatter(new FormatterHelper(jCommander));
jCommander.setProgramName(CliConstants.APP_NAME);
Expand Down
22 changes: 18 additions & 4 deletions gui/src/main/java/org/verapdf/gui/PDFValidationApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void actionPerformed(ActionEvent actionEvent) {

file.add(quit);

final JMenu policy = new JMenu("Configs");
final JMenu configs = new JMenu("Configs");

this.featuresPanel = new FeaturesConfigPanel();

Expand All @@ -201,8 +201,8 @@ public void actionPerformed(ActionEvent e) {
}
});

menuBar.add(policy);
policy.add(features);
menuBar.add(configs);
configs.add(features);

this.policyConfig = new PolicyPanel();
final JMenuItem policyPanel = new JMenuItem("Policy Config");
Expand Down Expand Up @@ -233,7 +233,21 @@ public void actionPerformed(ActionEvent e) {
}
});

policy.add(policyPanel);
configs.add(policyPanel);

final JMenuItem showConfigLocation = new JMenuItem(GUIConstants.SHOW_CONFIG_LOCATION);
showConfigLocation.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
Desktop.getDesktop().open(configManager.getConfigDir());
} catch (IOException ex) {
logger.log(Level.WARNING, "Exception in opening config location", ex);
}
}
});

configs.add(showConfigLocation);

JMenuItem about = new JMenuItem("About");
about.addActionListener(new ActionListener() {
Expand Down
1 change: 1 addition & 0 deletions gui/src/main/java/org/verapdf/gui/utils/GUIConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public final class GUIConstants {
public static final String SELECTED_PROFILES_WIKI_PATH = "Validation Profiles wiki root:";
public static final String CHECK_FOR_UPDATES_TEXT = "Check for Updates...";
public static final String UNSUPPORTED_OPERATION_EXC_BROWSE = "Couldn't open online help. Please, try opening this link manually %s";
public static final String SHOW_CONFIG_LOCATION = "Open config location";

public static final int EMPTY_BORDER_INSETS = 5;
public static final int FRAME_COORD_X = 100;
Expand Down

0 comments on commit 2d1dd02

Please sign in to comment.