[geany/geany-plugins] 3f966c: Merge pull request #443 from frlan/feature/rename_geanysendmail

Frank Lanitz git-noreply at xxxxx
Sun Jun 12 17:48:58 UTC 2016


Branch:      refs/heads/master
Author:      Frank Lanitz <frank at frank.uvena.de>
Committer:   GitHub <noreply at github.com>
Date:        Sun, 12 Jun 2016 17:48:58 UTC
Commit:      3f966c93951344bc9f8e28da80dd9116a75bec0f
             https://github.com/geany/geany-plugins/commit/3f966c93951344bc9f8e28da80dd9116a75bec0f

Log Message:
-----------
Merge pull request #443 from frlan/feature/rename_geanysendmail

Rename GeanySendMail to plain SendMail


Modified Paths:
--------------
    Makefile.am
    README
    build/geany-plugins.nsi
    build/geanysendmail.m4
    build/sendmail.m4
    configure.ac
    geanysendmail/src/Makefile.am
    po/POTFILES.in
    sendmail/AUTHORS
    sendmail/COPYING
    sendmail/ChangeLog
    sendmail/Makefile.am
    sendmail/NEWS
    sendmail/README
    sendmail/TODO
    sendmail/src/Makefile.am
    sendmail/src/mail-icon.xpm
    sendmail/src/sendmail.c

Modified: Makefile.am
7 lines changed, 4 insertions(+), 3 deletions(-)
===================================================================
@@ -91,9 +91,6 @@ if ENABLE_GEANYPY
 SUBDIRS += geanypy
 endif
 
-if ENABLE_GEANYSENDMAIL
-SUBDIRS += geanysendmail
-endif
 
 if ENABLE_GEANYVC
 SUBDIRS += geanyvc
@@ -143,6 +140,10 @@ if ENABLE_SCOPE
 SUBDIRS += scope
 endif
 
+if ENABLE_SENDMAIL
+SUBDIRS += sendmail
+endif
+
 if ENABLE_SHIFTCOLUMN
 SUBDIRS += shiftcolumn
 endif


Modified: README
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -68,7 +68,6 @@ Available plugins are:
 * ``geanypg`` -- the geanypg plugin
 * ``geanyprj`` -- the GeanyPrj plugin
 * ``geanypy`` -- the Geanypy plugin
-* ``geanysendmail`` -- the GeanySendmail plugin
 * ``geanyvc`` -- the GeanyVC plugin
 * ``geniuspaste`` -- the paste to a pastebin plugin
 * ``gitchangebar`` -- the GitChangeBar plugin
@@ -83,6 +82,7 @@ Available plugins are:
 * ``pretty_printer`` -- the pretty-printer plugin
 * ``projectorganizer`` -- the ProjectOrganizer plugin
 * ``scope`` -- the Scope plugin
+* ``sendmail`` -- the GeanySendmail plugin
 * ``shiftcolumn`` -- the ShiftColumn plugin
 * ``spellcheck`` -- the spellcheck plugin
 * ``treebrowser`` -- the Treebrowser plugin


Modified: build/geany-plugins.nsi
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -173,6 +173,7 @@ Section Uninstall
 	Delete "$INSTDIR\lib\geany\geanynumberedbookmarks.dll"
 	Delete "$INSTDIR\lib\geany\geanypg.dll"
 	Delete "$INSTDIR\lib\geany\geanyprj.dll"
+	; Keep for geanysendmail propper deleting old dll some time
 	Delete "$INSTDIR\lib\geany\geanysendmail.dll"
 	Delete "$INSTDIR\lib\geany\geanyvc.dll"
 	Delete "$INSTDIR\lib\geany\geniuspaste.dll"
@@ -185,6 +186,7 @@ Section Uninstall
 	Delete "$INSTDIR\lib\geany\pretty-printer.dll"
 	Delete "$INSTDIR\lib\geany\projectorganizer.dll"
 	Delete "$INSTDIR\lib\geany\scope.dll"
+	Delete "$INSTDIR\lib\geany\sendmail.dll"
 	Delete "$INSTDIR\lib\geany\shiftcolumn.dll"
 	Delete "$INSTDIR\lib\geany\spellcheck.dll"
 	Delete "$INSTDIR\lib\geany\tableconvert.dll"


Modified: build/geanysendmail.m4
9 lines changed, 0 insertions(+), 9 deletions(-)
===================================================================
@@ -1,9 +0,0 @@
-AC_DEFUN([GP_CHECK_GEANYSENDMAIL],
-[
-    GP_ARG_DISABLE([GeanySendmail], [yes])
-    GP_COMMIT_PLUGIN_STATUS([GeanySendmail])
-    AC_CONFIG_FILES([
-        geanysendmail/Makefile
-        geanysendmail/src/Makefile
-    ])
-])


Modified: build/sendmail.m4
9 lines changed, 9 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,9 @@
+AC_DEFUN([GP_CHECK_SENDMAIL],
+[
+    GP_ARG_DISABLE([Sendmail], [yes])
+    GP_COMMIT_PLUGIN_STATUS([Sendmail])
+    AC_CONFIG_FILES([
+        sendmail/Makefile
+        sendmail/src/Makefile
+    ])
+])


Modified: configure.ac
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -50,7 +50,6 @@ GP_CHECK_GEANYMINISCRIPT
 GP_CHECK_GEANYNUMBEREDBOOKMARKS
 GP_CHECK_GEANYPRJ
 GP_CHECK_GEANYPY
-GP_CHECK_GEANYSENDMAIL
 GP_CHECK_GEANYVC
 GP_CHECK_GEANYPG
 GP_CHECK_GENIUSPASTE
@@ -64,6 +63,7 @@ GP_CHECK_POHELPER
 GP_CHECK_PRETTYPRINTER
 GP_CHECK_PROJECTORGANIZER
 GP_CHECK_SCOPE
+GP_CHECK_SENDMAIL
 GP_CHECK_SHIFTCOLUMN
 GP_CHECK_SPELLCHECK
 GP_CHECK_TREEBROWSER


Modified: geanysendmail/src/Makefile.am
10 lines changed, 0 insertions(+), 10 deletions(-)
===================================================================
@@ -1,10 +0,0 @@
-include $(top_srcdir)/build/vars.build.mk
-plugin = geanysendmail
-
-geanyplugins_LTLIBRARIES = geanysendmail.la
-
-geanysendmail_la_SOURCES = geanysendmail.c mail-icon.xpm
-geanysendmail_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"GeanySendMail\"
-geanysendmail_la_LIBADD = $(COMMONLIBS)
-
-include $(top_srcdir)/build/cppcheck.mk


Modified: po/POTFILES.in
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -200,9 +200,6 @@ geanyprj/src/xproject.c
 # Geanypy
 geanypy/src/geanypy-plugin.c
 
-# geanysendmail
-geanysendmail/src/geanysendmail.c
-
 # geanyvc
 geanyvc/src/geanyvc.c
 geanyvc/src/geanyvc.h
@@ -283,6 +280,9 @@ scope/src/utils.c
 scope/src/views.c
 scope/src/store/scptreestore.c
 
+# sendmail
+sendmail/src/sendmail.c
+
 # Spell Check
 spellcheck/src/speller.c
 spellcheck/src/scplugin.c


Modified: sendmail/AUTHORS
0 lines changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online


Modified: sendmail/COPYING
0 lines changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online


Modified: sendmail/ChangeLog
0 lines changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online


Modified: sendmail/Makefile.am
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1,4 +1,4 @@
 include $(top_srcdir)/build/vars.auxfiles.mk
 
 SUBDIRS = src
-plugin = geanysendmail
+plugin = sendmail


Modified: sendmail/NEWS
0 lines changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online


Modified: sendmail/README
20 lines changed, 11 insertions(+), 9 deletions(-)
===================================================================
@@ -1,16 +1,18 @@
-GeanySendMail
-=============
+SendMail
+========
 
 .. contents::
 
 About
 ------
 
-GeanySendMail is a little plugin to send a document as attachment
+SendMail is a little plugin to send a document as attachment
 using the preferred mail client from inside Geany. It is similar to
 the envelope symbol of most office tools and requires a mail client
 that is supporting remote calls.
 
+This is not a direct binding to sendmail, even if it could be used for.
+
 
 Requirements
 ------------
@@ -25,7 +27,7 @@ installed from the sources, you should be ready to go. If you used a
 prepared package e.g. from your distribution you probably need to
 install an additional package, this might be called geany-dev or
 geany-devel. Please note that in order to compile and use this plugin,
-you need Geany 0.20 or later (Geany Plugin API v199 or higher).
+you need Geany 1.26 or later (Geany Plugin API v224 or higher).
 
 Furthermore you need, of course, a C compiler and the Make tool. The
 GNU versions of these tools are recommended.
@@ -37,7 +39,7 @@ Installation
 This version of the plugin is installed with the combined
 geany-plugins release. Please check README of this package or download
 stand alone version of plugin from
-http://frank.uvena.de/en/Geany/geanysendmail/
+http://frank.uvena.de/en/Geany/SendMail/
 
 
 Usage
@@ -96,9 +98,9 @@ github.com. Get the code by:
 git clone https://github.com/geany/geany-plugins.git
 
 If you want to create a patch, please respect the license of
-GeanySendMail (GPLv2 or above) as well as intellectual property of
+SendMail (GPLv2 or above) as well as intellectual property of
 third. Patches that should be included to the default distribution
-must be licensed under the same conditions as GeanySendMail by the
+must be licensed under the same conditions as SendMail by the
 copyright owner.
 
 
@@ -117,7 +119,7 @@ https://github.com/geany/geany-plugins/issues
 License
 -------
 
-GeanySendMail and all its parts is distributed under the terms of the
+SendMail and all its parts is distributed under the terms of the
 GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any
 later version. A copy of this license can be found in the file COPYING
@@ -131,6 +133,6 @@ Bugs, questions, bugs, homepage
 
 If you found any bugs or want to provide a patch, please contact Frank
 Lanitz (frank(at)geany(dot)org). Please also do so, if you got any
-questions and visiting http://frank.uvena.de/en/Geany/geanysendmail
+questions and visiting http://frank.uvena.de/en/Geany/SendMail
 didn't help you to figure out the answer. Visiting the website is also
 a good start if you want to check for any update on this plugin.


Modified: sendmail/TODO
0 lines changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online


Modified: sendmail/src/Makefile.am
10 lines changed, 10 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,10 @@
+include $(top_srcdir)/build/vars.build.mk
+plugin = sendmail
+
+geanyplugins_LTLIBRARIES = sendmail.la
+
+sendmail_la_SOURCES = sendmail.c mail-icon.xpm
+sendmail_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"SendMail\"
+sendmail_la_LIBADD = $(COMMONLIBS)
+
+include $(top_srcdir)/build/cppcheck.mk


Modified: sendmail/src/mail-icon.xpm
0 lines changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online


Modified: sendmail/src/sendmail.c
68 lines changed, 65 insertions(+), 3 deletions(-)
===================================================================
@@ -1,7 +1,7 @@
 /*
- *      geanysendmail.c
+ *      sendmail.c
  *
- *      Copyright 2007-2015 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+ *      Copyright 2007-2016 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
  *      Copyright 2007 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
  *      Copyright 2007, 2008 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
  *      Copyright 2008, 2009 Timothy Boronczyk <tboronczyk(at)gmail(dot)com>
@@ -30,6 +30,9 @@
 
 #include <geanyplugin.h>
 #include "mail-icon.xpm"
+#include <glib.h>
+#include <glib/gstdio.h>
+#include <errno.h>
 
 GeanyPlugin		*geany_plugin;
 GeanyData		*geany_data;
@@ -39,7 +42,7 @@ PLUGIN_VERSION_CHECK(224)
 PLUGIN_SET_TRANSLATABLE_INFO(
 	LOCALEDIR,
 	GETTEXT_PACKAGE,
-	_("GeanySendMail"),
+	_("SendMail"),
 	_("Sends the current file as attachment with your favorite mailer"),
 	VERSION,
 	"Frank Lanitz <frank at frank.uvena.de>")
@@ -116,6 +119,8 @@ send_as_attachment(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer g
 				}
 
 				config_dir = g_path_get_dirname(config_file);
+
+
 				if (! g_file_test(config_dir, G_FILE_TEST_IS_DIR) &&
 				      utils_mkdir(config_dir, TRUE) != 0)
  				{
@@ -354,12 +359,69 @@ GtkWidget *plugin_configure(GtkDialog *dialog)
 void plugin_init(GeanyData G_GNUC_UNUSED *data)
 {
 	GKeyFile *config = g_key_file_new();
+	gchar *config_file_old = NULL;
+	gchar *config_dir = NULL;
+	gchar *config_dir_old = NULL;
 	gchar *kb_label = _("Send file by mail");
 	GtkWidget *menu_mail = NULL;
 	GeanyKeyGroup *key_group;
 
 	config_file = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, "plugins", G_DIR_SEPARATOR_S,
+		"sendmail", G_DIR_SEPARATOR_S, "mail.conf", NULL);
+
+	#ifndef G_OS_WIN32
+	/* We try only to move if we are on not Windows platform */
+	config_file_old = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S,
+		"plugins", G_DIR_SEPARATOR_S,
 		"geanysendmail", G_DIR_SEPARATOR_S, "mail.conf", NULL);
+	config_dir = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S,
+		"plugins", G_DIR_SEPARATOR_S, "sendmail", NULL);
+	config_dir_old = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S,
+		"plugins", G_DIR_SEPARATOR_S, "geanysendmail", NULL);
+
+	if (g_file_test(config_file_old, G_FILE_TEST_EXISTS))
+	{
+		if (dialogs_show_question(
+			_("Renamed plugin detected!\n"
+			  "\n"
+			  "GeanySendMail has been renamed to sendmail -- you surely have "
+			  "already recognised it. \n"
+			  "Geany is able to migrate your old plugin configuration by "
+			  "moving the old configuration file to new location.\n"
+			  "Move now?")))
+		{
+			if (g_rename(config_dir_old, config_dir) == 0)
+			{
+				dialogs_show_msgbox(GTK_MESSAGE_INFO,
+					_("Your configuration directory has been "
+					  "successfully moved from \"%s\" to \"%s\"."),
+					config_dir_old, config_dir);
+			}
+			else
+			{
+				/* If there was an error on migrating we need
+				 * to load from original one.
+				 * When saving new configuration it will go to
+				 * new folder so migration should
+				 * be implicit. */
+				g_free(config_file);
+				config_file = g_strdup(config_file_old);
+				dialogs_show_msgbox(
+					GTK_MESSAGE_WARNING,
+					_("Your old configuration directory \"%s\" could "
+					  "not be moved to \"%s\" (%s). "
+					  "Please move manually the directory to the new location."),
+					config_dir_old,
+					config_dir,
+					g_strerror(errno));
+			}
+		}
+	}
+
+	g_free(config_dir_old);
+	g_free(config_dir);
+	g_free(config_file_old);
+	#endif
 
 	/* Initialising options from config file */
 	g_key_file_load_from_file(config, config_file, G_KEY_FILE_NONE, NULL);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list