diff --git a/README.md b/README.md index 39dbc0a..cbf90df 100644 --- a/README.md +++ b/README.md @@ -219,10 +219,6 @@ If you are not using branching, make sure the `Use Git Branch` option is disable Note that a **branch is required for string-based** projects. -#### Automatic reload - -By default, the plugin will automatically reload files tree after each change in configuration file. To disable this, please uncheck the `Automatically reload on change` option. - #### Automatic uploads By default, the plugin will automatically upload source files to Crowdin on every change. To disable this, please uncheck the `Automatically upload on change` option. diff --git a/src/main/java/com/crowdin/event/FileChangeListener.java b/src/main/java/com/crowdin/event/FileChangeListener.java index 2cea858..4ad4c67 100644 --- a/src/main/java/com/crowdin/event/FileChangeListener.java +++ b/src/main/java/com/crowdin/event/FileChangeListener.java @@ -73,21 +73,19 @@ public void after(List events) { CrowdingSettingsState settings = CrowdingSettingsState.getInstance(project); - if (settings.autoReload) { - VirtualFile crowdinPropertyFile = CrowdinFileProvider.getCrowdinConfigFile(project); - boolean crowdinPropertiesFileUpdated = events.stream().anyMatch(e -> Objects.equals(e.getFile(), crowdinPropertyFile)); - if (crowdinPropertiesFileUpdated) { - try { - CrowdinPropertiesLoader.load(project); - } catch (Exception e) { - NotificationUtil.showErrorMessage(project, e.getMessage()); - return; - } - ApplicationManager.getApplication().invokeAndWait(() -> CrowdinPanelWindowFactory.reloadPanels(project, false)); - if (events.size() == 1) { - //no need to start task below as it's just an update in config file - return; - } + VirtualFile crowdinPropertyFile = CrowdinFileProvider.getCrowdinConfigFile(project); + boolean crowdinPropertiesFileUpdated = events.stream().anyMatch(e -> Objects.equals(e.getFile(), crowdinPropertyFile)); + if (crowdinPropertiesFileUpdated) { + try { + CrowdinPropertiesLoader.load(project); + } catch (Exception e) { + NotificationUtil.showErrorMessage(project, e.getMessage()); + return; + } + ApplicationManager.getApplication().invokeAndWait(() -> CrowdinPanelWindowFactory.reloadPanels(project, false)); + if (events.size() == 1) { + //no need to start task below as it's just an update in config file + return; } } diff --git a/src/main/java/com/crowdin/settings/CrowdinSettingsConfigurable.java b/src/main/java/com/crowdin/settings/CrowdinSettingsConfigurable.java index 6ed7317..9ca3c16 100644 --- a/src/main/java/com/crowdin/settings/CrowdinSettingsConfigurable.java +++ b/src/main/java/com/crowdin/settings/CrowdinSettingsConfigurable.java @@ -43,7 +43,6 @@ public boolean isModified() { !Objects.equals(this.settingsPanel.getProjectId(), instance.projectId) || !Objects.equals(this.settingsPanel.getCompletionFileExtensions(), instance.fileExtensions) || !Objects.equals(this.settingsPanel.getAutoUpload(), instance.autoUpload) || - !Objects.equals(this.settingsPanel.getAutoReload(), instance.autoReload) || !Objects.equals(this.settingsPanel.getUseGitBranch(), instance.useGitBranch) || !Objects.equals(this.settingsPanel.getEnableCompletion(), instance.enableCompletion) || !Objects.equals(this.settingsPanel.getDoNotShowConfirmation(), instance.doNotShowConfirmation); @@ -60,7 +59,6 @@ public void apply() { instance.fileExtensions = this.settingsPanel.getCompletionFileExtensions(); instance.doNotShowConfirmation = this.settingsPanel.getDoNotShowConfirmation(); instance.autoUpload = this.settingsPanel.getAutoUpload(); - instance.autoReload = this.settingsPanel.getAutoReload(); instance.useGitBranch = this.settingsPanel.getUseGitBranch(); instance.enableCompletion = this.settingsPanel.getEnableCompletion(); @@ -92,7 +90,6 @@ public void reset() { this.settingsPanel.setCompletionFileExtensions(instance.fileExtensions); this.settingsPanel.setDoNotShowConfirmation(instance.doNotShowConfirmation); this.settingsPanel.setAutoUpload(instance.autoUpload); - this.settingsPanel.setAutoReload(instance.autoReload); this.settingsPanel.setUseGitBranch(instance.useGitBranch); this.settingsPanel.setEnableCompletion(instance.enableCompletion); } diff --git a/src/main/java/com/crowdin/settings/CrowdingSettingsState.java b/src/main/java/com/crowdin/settings/CrowdingSettingsState.java index 2838675..b0ba909 100644 --- a/src/main/java/com/crowdin/settings/CrowdingSettingsState.java +++ b/src/main/java/com/crowdin/settings/CrowdingSettingsState.java @@ -22,7 +22,6 @@ public class CrowdingSettingsState implements PersistentStateComponent