From 6c346a1bb7fd243f7f451d7c13b818d96f7b92a3 Mon Sep 17 00:00:00 2001 From: hsz Date: Wed, 12 Nov 2014 17:38:41 +0100 Subject: [PATCH] release 0.6 --- META-INF/plugin.xml | 19 +++++- README.md | 21 +++++- resources/messages/GitignoreBundle.properties | 2 + .../hsz/idea/gitignore/GitignoreBundle.java | 1 + .../daemon/DonateNotificationProvider.java | 68 +++++++++++++++++++ .../hsz/idea/gitignore/util/Properties.java | 10 +++ 6 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 src/mobi/hsz/idea/gitignore/daemon/DonateNotificationProvider.java diff --git a/META-INF/plugin.xml b/META-INF/plugin.xml index 4598ce91..8a0b9212 100644 --- a/META-INF/plugin.xml +++ b/META-INF/plugin.xml @@ -1,7 +1,7 @@ mobi.hsz.idea.gitignore .gitignore support - 0.5.4 + 0.6 hsz 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
  • @@ -33,9 +34,11 @@ Feature requests:
      -
    • Better Gitignore templates filtering and selecting in rules generator
    • Better ignored files list
    • Optional suggestion to add .gitignore file
    • +
    • User custom ignore templates
    • +
    • Node Packaged Modules support
    • +
    • Mercurial support

    @@ -49,6 +52,16 @@ +
  • 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)
  • +
  • Fixed CommonDataKeys NoClassDefFoundError (#51)
  • +
  • Fixed "Cannot create .gitignore, file already exists." (#55)
  • +
+ Version 0.5.4
  • Better entries completion and references
  • @@ -185,6 +198,8 @@ + diff --git a/README.md b/README.md index 0442fda9..85a5d98a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -58,6 +66,15 @@ To generate new `.gitignore` file, just click on File > New { + private static final String DONATION_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SJAU4XWQ584QL"; + private static final Key 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 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; + } +} diff --git a/src/mobi/hsz/idea/gitignore/util/Properties.java b/src/mobi/hsz/idea/gitignore/util/Properties.java index 5813ca32..53c35cc1 100644 --- a/src/mobi/hsz/idea/gitignore/util/Properties.java +++ b/src/mobi/hsz/idea/gitignore/util/Properties.java @@ -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() { } @@ -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()); + } }