Revision: 1947
http://geany.svn.sourceforge.net/geany/?rev=1947&view=rev
Author: frlan
Date: 2007-10-15 11:30:26 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Saves document before executing svn diff
Modified Paths:
--------------
trunk/plugins/svndiff.c
Modified: trunk/plugins/svndiff.c
===================================================================
--- trunk/plugins/svndiff.c 2007-10-15 14:14:56 UTC (rev 1946)
+++ trunk/plugins/svndiff.c 2007-10-15 18:30:26 UTC (rev 1947)
@@ -21,11 +21,9 @@
/* SVNdiff plugin */
/* This small plugin uses svn to generate a diff against the current
- * version inside svn. Keep in mind, that it uses the last saved
- * version of workingcopy and _NOT_ the unsaved version, you might be
- * working on. */
+ * version inside svn. Keep in mind, that it saves your version you currently working
+ * on and some changes may get lost by accident. */
-
#include "geany.h"
#include "support.h"
#include "plugindata.h"
@@ -42,7 +40,7 @@
VERSION_CHECK(21)
-PLUGIN_INFO(_("SVNdiff"), _("Plugin to create a patch of a file against svn"), "0.0.1")
+PLUGIN_INFO(_("SVNdiff"), _("Plugin to create a patch of a file against svn"), "0.0.2")
/* Callback if menu item was acitvated */
@@ -65,6 +63,12 @@
gchar *short_name = utils->remove_ext_from_filename(base_name);
gchar *locale_filename = utils->get_locale_from_utf8(doc_list[idx].file_name);
+
+ if (! geany_data->document->save_file(idx, TRUE))
+ {
+ geany_data->msgwindow->status_add(_("File %s couldn't be saved."
+ "Will go on with last saved version."),base_name);
+ }
// use '' quotation for Windows compatibility
command = g_strdup_printf("svn diff --non-interactive '%s'", locale_filename);
@@ -107,8 +111,7 @@
else
{
geany_data->msgwindow->status_add(
- _("It looks like file doesn't have a suitable name. "
- "Maybe it's better to stop here and do nothing."));
+ _("File seems to don't have a name. Can't go on with processing."));
}
g_free(std_output);
g_free(std_err);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1946
http://geany.svn.sourceforge.net/geany/?rev=1946&view=rev
Author: eht16
Date: 2007-10-15 07:14:56 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Try to fix a bug with toggling of full path setting in the open files list.
Modified Paths:
--------------
trunk/src/treeviews.c
Modified: trunk/src/treeviews.c
===================================================================
--- trunk/src/treeviews.c 2007-10-15 08:53:26 UTC (rev 1945)
+++ trunk/src/treeviews.c 2007-10-15 14:14:56 UTC (rev 1946)
@@ -418,7 +418,7 @@
tv.popup_openfiles_fullpath = gtk_check_menu_item_new_with_mnemonic(_("Show _full path name"));
gtk_widget_show(tv.popup_openfiles_fullpath);
gtk_container_add(GTK_CONTAINER(tv.popup_openfiles), tv.popup_openfiles_fullpath);
- g_signal_connect((gpointer) tv.popup_openfiles_fullpath, "activate",
+ g_signal_connect((gpointer) tv.popup_openfiles_fullpath, "toggled",
G_CALLBACK(on_openfiles_tree_popup_clicked), GINT_TO_POINTER(OPENFILES_ACTION_FULLPATH));
item = gtk_image_menu_item_new_with_mnemonic(_("_Hide"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1944
http://geany.svn.sourceforge.net/geany/?rev=1944&view=rev
Author: frlan
Date: 2007-10-15 01:52:20 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Added new plugin svndiff
Modified Paths:
--------------
trunk/ChangeLog
trunk/plugins/Makefile.am
trunk/po/POTFILES.in
Added Paths:
-----------
trunk/plugins/svndiff.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-10-13 10:41:38 UTC (rev 1943)
+++ trunk/ChangeLog 2007-10-15 08:52:20 UTC (rev 1944)
@@ -1,3 +1,10 @@
+2007-10-15 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+
+ * plugins/svndiff.c, plugins/Makefile.am, plugins/makefile.win32,
+ po/POTFILES.in:
+ New Plugin: Plugin to create a diff of a file against svn.
+
+
2007-10-13 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* geany.glade, src/interface.c, src/keyfile.c, src/plugindata.h,
Modified: trunk/plugins/Makefile.am
===================================================================
--- trunk/plugins/Makefile.am 2007-10-13 10:41:38 UTC (rev 1943)
+++ trunk/plugins/Makefile.am 2007-10-15 08:52:20 UTC (rev 1944)
@@ -15,6 +15,7 @@
classbuilder_la_LDFLAGS = -module -avoid-version
htmlchars_la_LDFLAGS = -module -avoid-version
export_la_LDFLAGS = -module -avoid-version
+svndiff_la_LDFLAGS = -module -avoid-version
if PLUGINS
@@ -22,7 +23,8 @@
plugin_LTLIBRARIES = \
classbuilder.la \
htmlchars.la \
- export.la
+ export.la \
+ svndiff.la
# Plugins not to be installed
noinst_LTLIBRARIES = \
@@ -32,11 +34,13 @@
classbuilder_la_SOURCES = classbuilder.c
htmlchars_la_SOURCES = htmlchars.c
export_la_SOURCES = export.c
+svndiff_la_SOURCES = svndiff.c
demoplugin_la_LIBADD = $(GTK_LIBS)
classbuilder_la_LIBADD = $(GTK_LIBS)
htmlchars_la_LIBADD = $(GTK_LIBS)
export_la_LIBADD = $(GTK_LIBS)
+svndiff_la_LIBADD = $(GTK_LIBS)
endif # PLUGINS
Added: trunk/plugins/svndiff.c
===================================================================
--- trunk/plugins/svndiff.c (rev 0)
+++ trunk/plugins/svndiff.c 2007-10-15 08:52:20 UTC (rev 1944)
@@ -0,0 +1,140 @@
+/*
+ * svndiff.c - this file is part of Geany, a fast and lightweight IDE
+ *
+ * Copyright 2007 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+/* SVNdiff plugin */
+/* This small plugin uses svn to generate a diff against the current
+ * version inside svn. Keep in mind, that it uses the last saved
+ * version of workingcopy and _NOT_ the unsaved version, you might be
+ * working on. */
+
+
+#include "geany.h"
+#include "support.h"
+#include "plugindata.h"
+#include "document.h"
+#include "filetypes.h"
+
+
+PluginFields *plugin_fields;
+GeanyData *geany_data;
+
+#define utils geany_data->utils
+#define doc_array geany_data->doc_array
+
+
+VERSION_CHECK(21)
+
+PLUGIN_INFO(_("SVNdiff"), _("Plugin to create a patch of a file against svn"), "0.0.1")
+
+
+/* Callback if menu item was acitvated */
+static void item_activated(GtkMenuItem *menuitem, gpointer gdata)
+{
+ gchar *command;
+ gint idx;
+ gchar *diff_file_name = NULL;
+ gchar *std_output = NULL;
+ gchar *std_err = NULL;
+ gint exit_code;
+ GError *error_code = NULL;
+
+ idx = geany_data->document->get_cur_idx();
+
+ // Stolen from export.c. Thanks for it, Enrico ;)
+ if (doc_list[idx].file_name != NULL)
+ {
+ gchar *base_name = g_path_get_basename(doc_list[idx].file_name);
+ gchar *short_name = utils->remove_ext_from_filename(base_name);
+ gchar *locale_filename = utils->get_locale_from_utf8(doc_list[idx].file_name);
+
+ // use '' quotation for Windows compatibility
+ command = g_strdup_printf("svn diff --non-interactive '%s'", locale_filename);
+
+ diff_file_name = g_strconcat(short_name, ".svn.diff", NULL);
+
+ g_free(base_name);
+ g_free(short_name);
+ g_free(locale_filename);
+
+
+ if (g_spawn_command_line_sync(command, &std_output, &std_err, &exit_code, &error_code))
+ {
+ if (! exit_code)
+ {
+ if (std_output == NULL || std_output[0] != '\0')
+ {
+ geany_data->document->new_file(diff_file_name,
+ geany_data->filetypes[GEANY_FILETYPES_DIFF], std_output);
+ }
+ else
+ {
+ geany_data->msgwindow->status_add(_("Current file has no changes."));
+ }
+ }
+ else // SVN returns some error
+ {
+ // TODO print std_err or print detailed error messages based on exit_code
+ geany_data->msgwindow->status_add(
+ _("SVN exited with an error. Error code was: %d."), exit_code);
+ }
+ }
+ else
+ {
+ geany_data->msgwindow->status_add(
+ _("Something went really wrong. Is there any svn-binary in your path?"));
+ }
+ g_free(command);
+ g_free(diff_file_name);
+ }
+ else
+ {
+ geany_data->msgwindow->status_add(
+ _("It looks like file doesn't have a suitable name. "
+ "Maybe it's better to stop here and do nothing."));
+ }
+ g_free(std_output);
+ g_free(std_err);
+}
+
+
+/* Called by Geany to initialize the plugin */
+void init(GeanyData *data)
+{
+ GtkWidget *svndiff_item;
+
+ // Add an item to the Tools menu
+ svndiff_item = gtk_menu_item_new_with_mnemonic(_("_SVNdiff"));
+ gtk_widget_show(svndiff_item);
+ gtk_container_add(GTK_CONTAINER(geany_data->tools_menu), svndiff_item);
+ g_signal_connect(G_OBJECT(svndiff_item), "activate", G_CALLBACK(item_activated), NULL);
+
+ // keep a pointer to the menu item, so we can remove it when the
+ // plugin is unloaded
+ plugin_fields->menu_item = svndiff_item;
+}
+
+
+/* Called by Geany before unloading the plugin. */
+void cleanup()
+{
+ // remove the menu item added in init()
+ gtk_widget_destroy(plugin_fields->menu_item);
+}
Modified: trunk/po/POTFILES.in
===================================================================
--- trunk/po/POTFILES.in 2007-10-13 10:41:38 UTC (rev 1943)
+++ trunk/po/POTFILES.in 2007-10-15 08:52:20 UTC (rev 1944)
@@ -37,3 +37,4 @@
plugins/classbuilder.c
plugins/htmlchars.c
plugins/export.c
+plugins/svndiff.c
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1940
http://geany.svn.sourceforge.net/geany/?rev=1940&view=rev
Author: ntrel
Date: 2007-10-12 05:06:25 -0700 (Fri, 12 Oct 2007)
Log Message:
-----------
Add: tango symbol list icons, GTK+ 2.10 printing support.
Modified Paths:
--------------
trunk/TODO
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2007-10-10 16:27:47 UTC (rev 1939)
+++ trunk/TODO 2007-10-12 12:06:25 UTC (rev 1940)
@@ -30,6 +30,8 @@
o (better regex support)
o (better tags support for popular languages? - this is a moving
target...)
+ o (tango-like icons for the symbol list)
+ o (GTK+ 2.10 printing support)
Wishlist
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.