Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.1-20230403230235+0000-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion src/main/java/com/codedead/opal/OpalApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@

public class OpalApplication extends Application {

private static final Logger logger = LogManager.getLogger(OpalApplication.class);
private static Logger logger;

/**
* Initialize the application
*
* @param args The application arguments
*/
public static void main(final String[] args) {
System.setProperty("logBasePath", SharedVariables.PROPERTIES_BASE_PATH);
logger = LogManager.getLogger(OpalApplication.class);

Level logLevel = Level.ERROR;
try (final FileInputStream fis = new FileInputStream(SharedVariables.PROPERTIES_FILE_LOCATION)) {
final Properties prop = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public void setResourceBundle(final ResourceBundle resourceBundle) {

/**
* Method that is called when the close button is selected
*
* @param event The {@link ActionEvent} object
*/
@FXML
private void closeAction(final ActionEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void setControllers(final SettingsController settingsController, final Up
/**
* Load the media button visibility for all {@link SoundPane} objects
*
* @param visible True if the media button should be visible, otherwise false
* @param visible True if the media buttons should be visible, otherwise false
*/
public void loadMediaButtonVisibility(final boolean visible) {
getAllSoundPanes(grpControls).forEach(s -> s.setMediaButton(visible));
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/codedead/opal/utils/SharedVariables.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ public final class SharedVariables {
public static final boolean PORTABLE = false;
public static final String DEFAULT_LOCALE = "en-US";

public static final String PROPERTIES_BASE_PATH = PORTABLE
? System.getProperty("user.dir") + "/.opal"
: System.getProperty("user.home") + "/.opal";

public static final String PROPERTIES_RESOURCE_LOCATION = "default.properties";
public static final String PROPERTIES_FILE_LOCATION = System.getProperty("user.home") + "/.opal/opal.properties";
public static final String PROPERTIES_FILE_LOCATION = PROPERTIES_BASE_PATH + "/opal.properties";

public static final String HELP_DOCUMENTATION_RESOURCE_LOCATION = "/documents/help.pdf";
public static final String HELP_DOCUMENTATION_FILE_LOCATION = System.getProperty("user.home") + "/.opal/help.pdf";
public static final String HELP_DOCUMENTATION_FILE_LOCATION = PROPERTIES_BASE_PATH + "/help.pdf";

public static final String LICENSE_RESOURCE_LOCATION = "/documents/license.pdf";
public static final String LICENSE_FILE_LOCATION = System.getProperty("user.home") + "/.opal/license.pdf";
public static final String LICENSE_FILE_LOCATION = PROPERTIES_BASE_PATH + "/license.pdf";

/**
* Initialize a new SharedVariables
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Properties>
<Property name="basePath">.opal/logs</Property>
<Property name="basePath">/logs</Property>
</Properties>

<Appenders>
<RollingFile name="fileLogger" fileName="${sys:user.home}/${basePath}/opal-info.log"
filePattern="${sys:user.home}/${basePath}/opal-info-%d{yyyy-MM-dd}.log.gz"
<RollingFile name="fileLogger" fileName="${sys:logBasePath}/${basePath}/opal-info.log"
filePattern="${sys:logBasePath}/${basePath}/opal-info-%d{yyyy-MM-dd}.log.gz"
ignoreExceptions="false">
<PatternLayout>
<pattern>[%level][%d{yyyy-MM-dd HH:mm:ss.SSS}][%t] %c{1}\t-\t%msg%n</pattern>
Expand All @@ -15,7 +15,7 @@
<TimeBasedTriggeringPolicy interval="1"/>
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="${sys:user.home}/${basePath}/" maxDepth="1">
<Delete basePath="${sys:logBasePath}/${basePath}/" maxDepth="1">
<IfFileName glob="opal-info-????-??-??.log.gz">
<IfAny>
<IfAccumulatedFileSize exceeds="10 MB"/>
Expand Down