diff --git a/src/gitflow/GitflowConfigurable.java b/src/gitflow/GitflowConfigurable.java index 3394c38..95ebfce 100644 --- a/src/gitflow/GitflowConfigurable.java +++ b/src/gitflow/GitflowConfigurable.java @@ -20,6 +20,8 @@ public class GitflowConfigurable implements Configurable { public static final String GITFLOW_DONT_TAG_RELEASE = "Gitflow.dontTagRelease"; public static final String GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE = "Gitflow.useCustomTagCommitMessage"; public static final String GITFLOW_CUSTOM_TAG_COMMIT_MESSAGE = "Gitflow.customTagCommitMessage"; + + public static final String DEFAULT_TAG_COMMIT_MESSAGE ="Tagging version %name%"; Project project; GitflowOptionsForm gitflowOptionsForm; @@ -53,8 +55,8 @@ public boolean isModified() { return PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_RELEASE, false) != gitflowOptionsForm.isPushOnFinishRelease() || PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_HOTFIX, false) != gitflowOptionsForm.isPushOnFinishHotfix() || PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_RELEASE, false) != gitflowOptionsForm.isDontTagRelease() || - PropertiesComponent.getInstance(project).getBoolean(GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE, false) != gitflowOptionsForm.isDontTagRelease() || - PropertiesComponent.getInstance(project).getBoolean(GITFLOW_CUSTOM_TAG_COMMIT_MESSAGE, false) != gitflowOptionsForm.isDontTagRelease() + PropertiesComponent.getInstance(project).getBoolean(GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE, false) != gitflowOptionsForm.isUseCustomTagCommitMessage() || + PropertiesComponent.getInstance(project).getValue(GITFLOW_CUSTOM_TAG_COMMIT_MESSAGE, DEFAULT_TAG_COMMIT_MESSAGE).equals(gitflowOptionsForm.getCustomTagCommitMessage())==false ; } @@ -71,6 +73,8 @@ public void reset() { gitflowOptionsForm.setPushOnFinishRelease(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_RELEASE, false)); gitflowOptionsForm.setPushOnFinishHotfix(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_HOTFIX, false)); gitflowOptionsForm.setDontTagRelease(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_RELEASE, false)); + gitflowOptionsForm.setUseCustomTagCommitMessage(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE, false)); + gitflowOptionsForm.setCustomTagCommitMessage(PropertiesComponent.getInstance(project).getValue(GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE, DEFAULT_TAG_COMMIT_MESSAGE)); } @Override diff --git a/src/gitflow/ui/GitflowOptionsForm.java b/src/gitflow/ui/GitflowOptionsForm.java index 3c6b583..cd50229 100644 --- a/src/gitflow/ui/GitflowOptionsForm.java +++ b/src/gitflow/ui/GitflowOptionsForm.java @@ -17,6 +17,7 @@ public class GitflowOptionsForm implements ItemListener { private JTextField customTagCommitMessage; public JPanel getContentPane() { + useCustomTagCommitMessage.addItemListener(this); return contentPane; } @@ -28,10 +29,10 @@ public void itemStateChanged(ItemEvent e) { //disable\enable the tag commit message according to the checkbox state if (source == useCustomTagCommitMessage) { if (e.getStateChange() == ItemEvent.SELECTED) { - customTagCommitMessage.setEnabled(true); + customTagCommitMessage.setEditable(true); } else{ - customTagCommitMessage.setEnabled(false); + customTagCommitMessage.setEditable(false); } }