Skip to content

Commit

Permalink
Final preperations for v1.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ffes committed Jun 30, 2013
1 parent 909164c commit 98cc42b
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 165 deletions.
13 changes: 7 additions & 6 deletions DlgAbout.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
// //
// NppSnippets - Code Snippets plugin for Notepad++ //
// Copyright (C) 2010-2012 Frank Fesevur //
// Copyright (C) 2010-2013 Frank Fesevur //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
Expand Down Expand Up @@ -38,10 +38,11 @@ struct VersionInfo
WCHAR* text;
};

#define MAX_VERSION_INFO 10
#define MAX_VERSION_INFO 11

static VersionInfo s_info[MAX_VERSION_INFO] =
{
{ {1,3,0,0}, {2013, 6,30}, L"- Fixed problem with inserting UTF snippets.\n- Fixed wrong title of Import Library dialog.\n- Fixed some potential bugs found when trying to fix GCC compilation.\n- Converted the documentation from ODT to DocBook.\n- Upgrade to SQLite version 3.7.17" },
{ {1,2,0,0}, {2013, 1, 8}, L"- There was an inconsistency between the documentation and code about the name of the option to specify your custom path for the database. Use DBFile from now on. For backwards compatibility the DBPath entry will still be recognized.\n- When a snippets creates a new document and the current document is empty, it reuses the current one and does not start a new.\n- Added Duplicate snippet function to context menu.\n- New (simple) templates library.\n- Upgrade to SQLite version 3.7.15.1" },
{ {1,1,0,0}, {2012, 1, 2}, L"- You can now add a new snippet to a library based upon the current selection or based upon the content of the clipboard.\n- Installation has been improved. A template database is provided and when the plugin tries to find the database and it can't find it, it copies this template database to the AppData plugin-config directory.\n- The About dialog now shows the changelog.\n- When you upgrade the very first time the changelog for the current version will be shown.\n- When you didn't select a specific library for a certain language, the automatic selection of the library is improved. The first language specific library is preferred over the first general library.\n- Resized the edit snippet dialog.\n- Upgrade to SQLite version 3.7.9" },
{ {1,0,0,0}, {2011, 9, 6}, L"- The selection or cursor position are now restored after inserting a snippet." },
Expand All @@ -56,7 +57,7 @@ static VersionInfo s_info[MAX_VERSION_INFO] =

static int s_showTill = MAX_VERSION_INFO;

///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//

static BOOL OnInitDialog(HWND hDlg)
Expand Down Expand Up @@ -98,7 +99,7 @@ static BOOL OnInitDialog(HWND hDlg)
return TRUE;
}

///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//

static BOOL CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Expand Down Expand Up @@ -141,7 +142,7 @@ static BOOL CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
return FALSE;
}

///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Show the About Dialog, with all version information

void ShowAboutDlg()
Expand All @@ -150,7 +151,7 @@ void ShowAboutDlg()
DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), g_nppData._nppHandle, (DLGPROC) DlgProc);
}

///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Show the About Dialog, with version information until 'prevVer'

void ShowAboutDlgVersion(Version prevVer)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
NppSnippets
===========

NppSnippets is an easy to use snippet / template plug-in: Similarity with the TextPad Clip Library is no accident. To insert a snippet simply double click on the item in the list and the snippet is inserted at the current cursor position. To edit right-click on that item.
NppSnippets is an easy to use snippet / template plug-in. Similarity with the TextPad Clip Library is no accident. To insert a snippet simply double click on the item in the list and the snippet is inserted at the current cursor position. To edit right-click on that item.

The project page, with downloads and issue tracker, is at https://code.google.com/p/nppsnippets/

Version 1.2.0 (8 January 2013)
* There was an inconsistency between the documentation and code about the name of the option to specify your custom path for the database. Use DBFile from now on. For backwards compatibility the DBPath entry will still be recognized.
* When a snippets creates a new document and the current document is empty, it reuses the current one and does not start a new.
* Added Duplicate snippet function to context menu.
* New (simple) templates library.
* Upgrade to SQLite version 3.7.15.1
Version 1.3.0 (30 June 2013)
* Fixed problem with inserting UTF snippets.
* Fixed wrong title of Import Library dialog.
* Fixed some potential bugs found when trying to fix GCC compilation.
* Converted the documentation from ODT to DocBook.
* Upgrade to SQLite version 3.7.17
8 changes: 4 additions & 4 deletions Version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
// //
// NppSnippets - Code Snippets plugin for Notepad++ //
// Copyright (C) 2010-2012 Frank Fesevur //
// Copyright (C) 2010-2013 Frank Fesevur //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
Expand All @@ -22,9 +22,9 @@
#ifndef __VERSION_H__
#define __VERSION_H__

#define VERSION_NUMBER 1,2,0,0
#define VERSION_NUMBER_STR "1.2.0"
#define VERSION_NUMBER_WSTR L"1.2.0"
#define VERSION_NUMBER 1,3,0,0
#define VERSION_NUMBER_STR "1.3.0"
#define VERSION_NUMBER_WSTR L"1.3.0"
#define COPYRIGHT_STR "Copyright 2010-2013 by Frank Fesevur"

#define VERSION_DIGITS 4
Expand Down
Binary file removed __Docs/ReadMe.odt
Binary file not shown.
161 changes: 13 additions & 148 deletions __Docs/ReadMe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY app_lic SYSTEM "gpl-2.0.xml">
<!ENTITY app_tabdef SYSTEM "tabledef.xml">
]>

<article lang="en">
Expand All @@ -10,7 +11,7 @@
<title>NppSnippets, Snippets plug-in for Notepad++</title>
<titleabbrev>NppSnippets</titleabbrev>
<author><firstname>Frank</firstname><surname>Fesevur</surname></author>
<pubdate>2013-01-08</pubdate>
<pubdate>2013-06-27</pubdate>
</articleinfo>

<sect1 id="introduction">
Expand All @@ -23,7 +24,7 @@
<para>The easiest way to install this plugin is by using the Plugin Manager: from the "Plugins" menu, choose the "Plugin Manager" and "Show Plugin Manager". Select the "Snippets" plugin and choose "install" and follow the instructions on the screen.</para>
<para>To manually install the plugin, copy <computeroutput>NppSnippets.dll</computeroutput> to the <computeroutput>plugins</computeroutput> directory and copy <computeroutput>Template.sqlite</computeroutput> to the <computeroutput>plugins/config</computeroutput> directory in the user's "Application Data" directory and name it <computeroutput>NppSnippets.sqlite</computeroutput>. On my Windows&nbsp;7 machine this directory is <computeroutput>C:\Users\Frank\AppData\Roaming\Notepad++\plugins\config</computeroutput>. Then (re)start Notepad++.</para>
<para>You can place the database in the <computeroutput>plugins/config</computeroutput> directory in the Notepad++ installation directory typically in the "Program Files" directory, but this could result in a read-only database due to file permissions and/or User Account Control (UAC). Therefore it is advised to put it in your "Application Data" directory.</para>
<para>You can also specify a custom path (like a shared network path or your Dropbox directory) for your database by manually editing the <computeroutput>NppSnippets.ini</computeroutput> file and adding a <computeroutput>DBFile</computeroutput> entry pointing to the full path name of the database.</para>
<para>You can also specify a custom path (like a shared network path or your Dropbox directory) for your database by manually editing the <computeroutput>NppSnippets.ini</computeroutput> file and adding a <computeroutput>DBFile</computeroutput> entry pointing to the full path name of the database. The <computeroutput>NppSnippets.ini</computeroutput> is in your "Application Data" directory.</para>
<para>When you automatically upgrade through the Plugin Manager your database is not touched. If you are manually upgrading at least replace the existing dll. It is up to you if you override your own database with the template database provided in the archive. If you have not changed existing snippets or added your own, it is recommended to use the database in the archive.</para>
<para>Note that this is a Unicode plug-in, so it doesn't work with an ANSI versions of Notepad++. The <ulink url="http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1a-4a14-984d-389c36f85647">Microsoft Visual C++ 2005 Redistributable Package</ulink> needs to be installed on the computer as well.</para>
</sect1>
Expand All @@ -43,159 +44,22 @@

<sect1 id="database">
<title>Database</title>
<para>NppSnippets uses a <ulink url="http://www.sqlite.org/">SQLite</ulink> database to store the content. In the archive is a file named NppSnippets.sql. With this you can generate a new (almost empty) SQLite database. At least SQLite 3.6.19 is needed because a foreign key constrains are used and the plug-in will need this when the editing the data through the GUI. So be sure not to create the database with an older SQLite management tool that breaks this.</para>
<para>NppSnippets uses a <ulink url="http://www.sqlite.org/">SQLite</ulink> database named <computeroutput>NppSnippets.sqlite</computeroutput> to store all the content.</para>
<para>In the archive is a file named <computeroutput>NppSnippets.sql</computeroutput>. With this you can generate a new (almost empty) SQLite database. At least SQLite 3.6.19 is needed because a foreign key constrains are used and the plug-in will need this when editing the data through the GUI. So be sure not to create the database with an older SQLite management tool that breaks this.</para>
<para>You should only update, insert or delete records and not modify the structure of the database. That can cause the plug-in (and as a result of that Notepad++ itself) to crash.</para>
<para>The database structure is quite simple. There are four tables Library, LibraryLang, Snippets and LangLastUsed. There is a one-to-many relation between Library and LibraryLang, between Library and Snippets and between Library and LangLastUsed. They are all linked to each other with the LibraryID field. It is possible to have multiple libraries per language and one library can be used for many languages.</para>
<para>For every library at least one record in the LibraryLang and Snippets tables is needed.</para>

<table id="table_library">
<title>Table Library</title>
<tgroup cols="2">
<thead>
<row>
<entry><para>Field</para></entry>
<entry><para>Description</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>LibraryID</para></entry>
<entry><para>The unique identifier of this library</para></entry>
</row>
<row>
<entry><para>Name</para></entry>
<entry><para>Name of the library</para></entry>
</row>
<row>
<entry><para>CreatedBy</para></entry>
<entry><para>Who created this library</para></entry>
</row>
<row>
<entry><para>Comments</para></entry>
<entry><para>Comments about this library</para></entry>
</row>
<row>
<entry><para>SortBy</para></entry>
<entry><para>Which fields of Snippets are used to sort 0 = "Name, Sort" 1 = "Sort, Name"</para></entry>
</row>
</tbody>
</tgroup>
</table>

<table id="table_librarylang">
<title>Table LibraryLang</title>
<tgroup cols="2">
<thead>
<row>
<entry><para>Field</para></entry>
<entry><para>Description</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>LibraryID</para></entry>
<entry><para>The library this item is part of</para></entry>
</row>
<row>
<entry><para>Lang</para></entry>
<entry>
<para>LangType from Notepad_plus_msgs.h. There are two special cases:</para>
<itemizedlist>
<listitem><para>Libs with Lang = -1 are shown when there is no library for the current language</para></listitem>
<listitem><para>Libs with Lang = -2 are shown for every language</para></listitem>
</itemizedlist>
</entry>
</row>
</tbody>
</tgroup>
</table>

<table id="table_snippets">
<title>Table Snippets</title>
<tgroup cols="2">
<thead>
<row>
<entry><para>Field</para></entry>
<entry><para>Description</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>SnippetID</para></entry>
<entry><para>The unique identifier of this snippet</para></entry>
</row>
<row>
<entry><para>LibraryID</para></entry>
<entry><para>The library this item is part of</para></entry>
</row>
<row>
<entry><para>Name</para></entry>
<entry><para>The name of the snippet</para></entry>
</row>
<row>
<entry><para>BeforeSelection</para></entry>
<entry><para>The text inserted before the current cursor / selection</para></entry>
</row>
<row>
<entry><para>AfterSelection</para></entry>
<entry><para>The text inserted after the current cursor / selection</para></entry>
</row>
<row>
<entry><para>ReplaceSelection</para></entry>
<entry><para>Replace a selection or ignore the selection and insert</para></entry>
</row>
<row>
<entry><para>NewDocument</para></entry>
<entry><para>Create a new document before inserting this snippet?</para></entry>
</row>
<row>
<entry><para>NewDocumentLang</para></entry>
<entry><para>Change the language of the new document to this language</para></entry>
</row>
<row>
<entry><para>Sort</para></entry>
<entry><para>Can determine the order of the snipping in the list. Depends on Library(SortBy) how the list is sorted</para></entry>
</row>
</tbody>
</tgroup>
</table>

<table id="table_langlastused">
<title>Table LangLastUsed</title>
<tgroup cols="2">
<thead>
<row>
<entry><para>Field</para></entry>
<entry><para>Description</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>Lang</para></entry>
<entry><para>LangType from Notepad_plus_msgs.h</para></entry>
</row>
<row>
<entry><para>LibraryID</para></entry>
<entry><para>This library is the last one used for this language</para></entry>
</row>
</tbody>
</tgroup>
</table>

<para>The current schema <computeroutput>user_version</computeroutput> of the database is 3.</para>

<para>The database structure is quite simple. There are four tables <computeroutput>Library</computeroutput>, <computeroutput>LibraryLang</computeroutput>, <computeroutput>Snippets</computeroutput> and <computeroutput>LangLastUsed</computeroutput>. There is a one-to-many relation between Library and LibraryLang, between Library and Snippets and between Library and LangLastUsed. They are all linked to each other with the LibraryID field. It is possible to have multiple libraries per language and one library can be used for many languages. For every library at least one record in the LibraryLang and Snippets tables is needed.</para>
<para>There is a more detailed description of the fields in the tables in <xref linkend="tabledefs"/>. The current schema <computeroutput>user_version</computeroutput> of the database is&nbsp;3.</para>
</sect1>

<sect1 id="sqlite">
<title>Why a SQLite database and not plain text files?</title>
<para>All the snippets are in one <ulink url="http://www.sqlite.org/">SQLite</ulink> database. SQLite is fast and easy to use. With SQLite most of the file and storage handling is taken care of. This is much more efficient then designing my own (complex) file format and implementing a parser and a writer, although I understand that editing a SQLite database is not as easy to edit for some as editing plain text files. But there is a user interface for editing the snippets.</para>
<para>All the snippets are stored in one <ulink url="http://www.sqlite.org/">SQLite</ulink> database. SQLite is fast and easy to use. With SQLite most of the file and storage handling is taken care of. This is much more efficient then designing my own (complex) file format and implementing a parser and a writer, although I understand that editing a SQLite database is not as easy to edit for some as editing plain text files. But there is a user interface for editing the snippets.</para>
</sect1>

<sect1 id="libraries">
<title>Provided Snippets Libraries</title>
<para>At this moment the template database is filled with these libraries. If you upgrade from a previous version your databases is not changed. If you want to try any of the new libraries, you must manually import those libraries from the template database.</para>
<informaltable>
<!--title>Libraries</title-->
<tgroup cols="3">
<thead>
<row>
Expand Down Expand Up @@ -285,7 +149,7 @@
<itemizedlist>
<listitem><para>Real template handling: variables in the snippets</para></listitem>
<listitem><para>Select a text, right-click that selection and add as new snippet.</para></listitem>
<listitem><para>If anyone can fix the MinGW compatible makefile, I can eliminate the need for the Visual C++ Redistributable Package.</para></listitem>
<listitem><para>If anyone can fix the MinGW compatible makefile, I can eliminate the need for the Visual C++ Redistributable Package and provide nightly builds.</para></listitem>
<listitem><para>If possible, drag-and-drop from the list to the active document.</para></listitem>
<listitem><para>Add keyboard shortcut keys to a snippet. It seems to be impossible to change shortcut keys on the fly. If anybody know how to get this to work, let me know!</para></listitem>
<listitem><para>Remember the last select snippet from the list. Useful when switching between different languages.</para></listitem>
Expand Down Expand Up @@ -329,12 +193,12 @@
<title>Release history</title>

<sect2 id="v1_3_0">
<title>Version 1.3.0 (xx XXXXX 2013)</title>
<title>Version 1.3.0 (30 June 2013)</title>
<itemizedlist>
<listitem><para>Fixed problem with inserting UTF snippets.</para></listitem>
<listitem><para>Fixed problem with inserting UTF snippets (<ulink url="http://code.google.com/p/nppsnippets/issues/detail?id=3">issue #3</ulink>).</para></listitem>
<listitem><para>Fixed wrong title of Import Library dialog.</para></listitem>
<listitem><para>Fixed some potential bugs found when trying to fix GCC compilation.</para></listitem>
<listitem><para>Converted the documentation from ODT to DocBook.</para></listitem>
<listitem><para>Converted the documentation from ODT to DocBook. Because of that an <ulink url="http://www.fesevur.com/docbook/nppsnippets">on-line version</ulink> of the documentation is available as well.</para></listitem>
<listitem><para>Upgrade to SQLite version 3.7.17</para></listitem>
</itemizedlist>
</sect2>
Expand Down Expand Up @@ -441,6 +305,7 @@

</sect1>

&app_tabdef;
&app_lic;

</article>
Loading

0 comments on commit 98cc42b

Please sign in to comment.