Skip to content

Commit

Permalink
Added UI functionality for #22, #23
Browse files Browse the repository at this point in the history
  • Loading branch information
OpherV committed Feb 1, 2014
1 parent 2e92adf commit b6f9ad0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/gitflow/GitflowConfigurable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
;
}

Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/gitflow/ui/GitflowOptionsForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class GitflowOptionsForm implements ItemListener {
private JTextField customTagCommitMessage;

public JPanel getContentPane() {
useCustomTagCommitMessage.addItemListener(this);
return contentPane;
}

Expand All @@ -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);
}
}

Expand Down

0 comments on commit b6f9ad0

Please sign in to comment.