Skip to content

Commit

Permalink
release 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Nov 12, 2014
1 parent 48185c7 commit 6c346a1
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 4 deletions.
19 changes: 17 additions & 2 deletions META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>mobi.hsz.idea.gitignore</id>
<name>.gitignore support</name>
<version>0.5.4</version>
<version>0.6</version>
<vendor email="[email protected]" url="http://www.hsz.mobi">hsz</vendor>

<description><![CDATA[
Expand All @@ -20,6 +20,7 @@
<b>Features</b>
<ul>
<li><i>.gitignore</i> files syntax highlight</li>
<li>Gitignore templates filtering and selecting in rules generator by name and content</li>
<li>Show ignored files by specified Gitignore file (right click on <i>.gitignore</i> file)</li>
<li>Create <i>.gitignore</i> file in currently selected directory</li>
<li>Generate Gitignore rules basing on <a href="https://github.com/github/gitignore">GitHub's templates collection</a></li>
Expand All @@ -33,9 +34,11 @@
<b><i>Feature requests:</i></b>
<ul>
<li><i>Better Gitignore templates filtering and selecting in rules generator</i></li>
<li><i>Better ignored files list</i></li>
<li><i>Optional suggestion to add .gitignore file</i></li>
<li><i>User custom ignore templates</i></li>
<li><i>Node Packaged Modules support</i></li>
<li><i>Mercurial support</i></li>
</ul>
<br/>
Expand All @@ -49,6 +52,16 @@

<change-notes><![CDATA[
Version 0.6
<ul>
<li>Reimplemented templates generator (tree structure, checkboxes allow to add many templates at once)</li>
<li>Find template by its content</li>
<li>"Add template..." option in context menu</li>
<li>Fixed no search input by default (<a href="https://github.com/hsz/idea-gitignore/issues/27">#27</a>)</li>
<li>Fixed CommonDataKeys NoClassDefFoundError (<a href="https://github.com/hsz/idea-gitignore/issues/51">#51</a>)</li>
<li>Fixed "Cannot create .gitignore, file already exists." (<a href="https://github.com/hsz/idea-gitignore/issues/55">#55</a>)</li>
</ul>
Version 0.5.4
<ul>
<li>Better entries completion and references</li>
Expand Down Expand Up @@ -185,6 +198,8 @@

<editorNotificationProvider
implementation="mobi.hsz.idea.gitignore.daemon.MissingGitignoreNotificationProvider"/>
<editorNotificationProvider
implementation="mobi.hsz.idea.gitignore.daemon.DonateNotificationProvider"/>

<fileTypeFactory
implementation="mobi.hsz.idea.gitignore.file.GitignoreFileTypeFactory"/>
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@ Features
--------

- `.gitignore` files syntax highlight
- Gitignore templates filtering and selecting in rules generator by name and content
- Show ignored files by specified Gitignore file (right click on `.gitignore` file)
- Create `.gitignore` file in currently selected directory
- Generate Gitignore rules basing on [GitHub's templates collection][github-gitignore]
- Add selected file/directory to Gitignore rules from popup menu
- Suggesting `.gitignore` file creation for new project
- Entries inspection (duplicated, covered, unused) with fix actions
- Comments and brackets support
- Navigation to entries in Project view
- Renaming entries from Gitignore file

*Feature requests:*

- *Better Gitignore templates filtering and selecting in rules generator*
- *Gitignore rules cleanup (duplicates removing, ...)*
- *Better ignored files list*
- *Optional suggestion to add .gitignore file*
- *User custom ignore templates*
- *Node Packaged Modules support*
- *Mercurial support*


Installation
Expand All @@ -58,6 +66,15 @@ To generate new `.gitignore` file, just click on <kbd>File</kbd> > <kbd>New</kbd
Changelog
---------

Version 0.6

- Reimplemented templates generator (tree structure, checkboxes allow to add many templates at once)
- Find template by its content
- "Add template..." option in context menu
- Fixed no search input by default ([#27](https://github.com/hsz/idea-gitignore/issues/27))
- Fixed CommonDataKeys NoClassDefFoundError ([#51](https://github.com/hsz/idea-gitignore/issues/51))
- Fixed "Cannot create .gitignore, file already exists." ([#55](https://github.com/hsz/idea-gitignore/issues/55))

Version 0.5.4

- Better entries completion and references
Expand Down
2 changes: 2 additions & 0 deletions resources/messages/GitignoreBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ quick.fix.remove.entry=Remove entry
daemon.lineMarker.directory=Directory entry
daemon.missingGitignore=Missing .gitignore file in GIT project
daemon.missingGitignore.create=Create .gitignore
daemon.donate=I hope that you find my .gitignore support plugin helpful !
daemon.donate.me=Donate me

dialog.generator.title=Gitignore File Generator
dialog.generator.clearSelection=Clear selection
Expand Down
1 change: 1 addition & 0 deletions src/mobi/hsz/idea/gitignore/GitignoreBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.ResourceBundle;

public class GitignoreBundle {
public static final String VERSION = "0.6";
private static final String BUNDLE_NAME = "messages.GitignoreBundle";
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);

Expand Down
68 changes: 68 additions & 0 deletions src/mobi/hsz/idea/gitignore/daemon/DonateNotificationProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package mobi.hsz.idea.gitignore.daemon;

import com.intellij.ide.BrowserUtil;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.EditorNotificationPanel;
import com.intellij.ui.EditorNotifications;
import mobi.hsz.idea.gitignore.GitignoreBundle;
import mobi.hsz.idea.gitignore.util.Icons;
import mobi.hsz.idea.gitignore.util.Properties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class DonateNotificationProvider extends EditorNotifications.Provider<EditorNotificationPanel> {
private static final String DONATION_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SJAU4XWQ584QL";
private static final Key<EditorNotificationPanel> KEY = Key.create(GitignoreBundle.message("daemon.donate.me"));

private final Project project;
private final EditorNotifications notifications;

public DonateNotificationProvider(Project project, @NotNull EditorNotifications notifications) {
this.project = project;
this.notifications = notifications;
}

@Override
public Key<EditorNotificationPanel> getKey() {
return KEY;
}

@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(VirtualFile file, FileEditor fileEditor) {
if (Properties.isIgnoreDonation(project)) {
return null;
}

return createPanel(project);
}

private EditorNotificationPanel createPanel(@NotNull final Project project) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(GitignoreBundle.message("daemon.donate"));
panel.createActionLabel(GitignoreBundle.message("daemon.donate.me"), new Runnable() {
@Override
public void run() {
BrowserUtil.browse(DONATION_URL);
Properties.setIgnoreDonation(project);
notifications.updateAllNotifications();
}
});
panel.createActionLabel(GitignoreBundle.message("global.cancel"), new Runnable() {
@Override
public void run() {
Properties.setIgnoreDonation(project);
notifications.updateAllNotifications();
}
});

try { // ignore if older SDK does not support panel icon
panel.icon(Icons.FILE);
} catch (NoSuchMethodError ignored) {}

return panel;
}
}
10 changes: 10 additions & 0 deletions src/mobi/hsz/idea/gitignore/util/Properties.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.project.Project;
import mobi.hsz.idea.gitignore.GitignoreBundle;

public class Properties {
private static final String PROP_IGNORE_MISSING_GITIGNORE = "ignore_missing_gitignore";
private static final String PROP_IGNORE_DONATION = "ignore_donation_" + GitignoreBundle.VERSION;

private Properties() {
}
Expand All @@ -13,7 +15,15 @@ public static boolean isIgnoreMissingGitignore(Project project) {
return PropertiesComponent.getInstance(project).getBoolean(PROP_IGNORE_MISSING_GITIGNORE, false);
}

public static boolean isIgnoreDonation(Project project) {
return PropertiesComponent.getInstance(project).getBoolean(PROP_IGNORE_DONATION, false);
}

public static void setIgnoreMissingGitignore(Project project) {
PropertiesComponent.getInstance(project).setValue(PROP_IGNORE_MISSING_GITIGNORE, Boolean.TRUE.toString());
}

public static void setIgnoreDonation(Project project) {
PropertiesComponent.getInstance(project).setValue(PROP_IGNORE_DONATION, Boolean.TRUE.toString());
}
}

0 comments on commit 6c346a1

Please sign in to comment.