SF.net SVN: geany: [2084] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sat Dec 1 17:53:37 UTC 2007


Revision: 2084
          http://geany.svn.sourceforge.net/geany/?rev=2084&view=rev
Author:   eht16
Date:     2007-12-01 09:53:36 -0800 (Sat, 01 Dec 2007)

Log Message:
-----------
Remove obsolete SVNdiff plugin, use the VC Diff plugin.
Add option for amount of characters to trigger symbol completion.
Add document_find_by_filename to the plugin API.		

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/geany.glade
    trunk/plugins/Makefile.am
    trunk/plugins/makefile.win32
    trunk/src/editor.c
    trunk/src/editor.h
    trunk/src/geany.h
    trunk/src/interface.c
    trunk/src/keyfile.c
    trunk/src/plugindata.h
    trunk/src/plugins.c
    trunk/src/prefs.c

Removed Paths:
-------------
    trunk/plugins/svndiff.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/ChangeLog	2007-12-01 17:53:36 UTC (rev 2084)
@@ -2,6 +2,13 @@
 
  * src/templates.c:
    Avoid inclusion of PHP tags in PHP function descriptions.
+ * plugins/Makefile.am, plugins/svndiff.c:
+   Remove obsolete SVNdiff plugin, use the VC Diff plugin.
+ * geany.glade, src /editor.c, src/editor.h, src/geany.h,
+   src/interface.c, src/keyfile.c, src/plugindata.h, src/plugins.c,
+   src/prefs.c:
+   Add option for amount of characters to trigger symbol completion.
+   Add document_find_by_filename to the plugin API.
 
 
 2007-11-30  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>

Modified: trunk/geany.glade
===================================================================
--- trunk/geany.glade	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/geany.glade	2007-12-01 17:53:36 UTC (rev 2084)
@@ -6050,12 +6050,65 @@
 			  </child>
 
 			  <child>
-			    <widget class="GtkHBox" id="hbox6">
+			    <widget class="GtkTable" id="table14">
 			      <property name="visible">True</property>
+			      <property name="n_rows">2</property>
+			      <property name="n_columns">2</property>
 			      <property name="homogeneous">False</property>
-			      <property name="spacing">12</property>
+			      <property name="row_spacing">3</property>
+			      <property name="column_spacing">12</property>
 
 			      <child>
+				<widget class="GtkSpinButton" id="spin_symbollistheight">
+				  <property name="visible">True</property>
+				  <property name="tooltip" translatable="yes">Number of rows to display in the autocompletion list.</property>
+				  <property name="can_focus">True</property>
+				  <property name="climb_rate">1</property>
+				  <property name="digits">0</property>
+				  <property name="numeric">True</property>
+				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+				  <property name="snap_to_ticks">False</property>
+				  <property name="wrap">False</property>
+				  <property name="adjustment">9 1 99 1 10 10</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label205">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Characters to type for completion:</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
 				<widget class="GtkLabel" id="label173">
 				  <property name="visible">True</property>
 				  <property name="label" translatable="yes">Rows of symbol completion list:</property>
@@ -6074,16 +6127,19 @@
 				  <property name="angle">0</property>
 				</widget>
 				<packing>
-				  <property name="padding">0</property>
-				  <property name="expand">False</property>
-				  <property name="fill">False</property>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
 				</packing>
 			      </child>
 
 			      <child>
-				<widget class="GtkSpinButton" id="spin_symbollistheight">
+				<widget class="GtkSpinButton" id="spin_symbol_complete_chars">
 				  <property name="visible">True</property>
-				  <property name="tooltip" translatable="yes">Number of rows to display in the autocompletion list.</property>
+				  <property name="tooltip" translatable="yes">The amount of characters which are necessary to show the symbol auto completion list.</property>
 				  <property name="can_focus">True</property>
 				  <property name="climb_rate">1</property>
 				  <property name="digits">0</property>
@@ -6091,12 +6147,14 @@
 				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				  <property name="snap_to_ticks">False</property>
 				  <property name="wrap">False</property>
-				  <property name="adjustment">10 1 99 1 10 10</property>
+				  <property name="adjustment">9 1 99 1 10 10</property>
 				</widget>
 				<packing>
-				  <property name="padding">0</property>
-				  <property name="expand">False</property>
-				  <property name="fill">True</property>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="y_options"></property>
 				</packing>
 			      </child>
 			    </widget>
@@ -6208,7 +6266,7 @@
 			      <property name="n_columns">2</property>
 			      <property name="homogeneous">False</property>
 			      <property name="row_spacing">3</property>
-			      <property name="column_spacing">12</property>
+			      <property name="column_spacing">0</property>
 
 			      <child>
 				<widget class="GtkEventBox" id="eventbox1">
@@ -6264,28 +6322,6 @@
 			      </child>
 
 			      <child>
-				<widget class="GtkCheckButton" id="check_open_encoding">
-				  <property name="visible">True</property>
-				  <property name="tooltip" translatable="yes">This option disables the automatic detection of the file encoding when opening files and opens the file with the specified encoding (usually not needed).</property>
-				  <property name="can_focus">True</property>
-				  <property name="label" translatable="yes">Use fixed encoding when opening files</property>
-				  <property name="use_underline">True</property>
-				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">False</property>
-				  <property name="active">False</property>
-				  <property name="inconsistent">False</property>
-				  <property name="draw_indicator">True</property>
-				</widget>
-				<packing>
-				  <property name="left_attach">0</property>
-				  <property name="right_attach">2</property>
-				  <property name="top_attach">2</property>
-				  <property name="bottom_attach">3</property>
-				  <property name="y_options"></property>
-				</packing>
-			      </child>
-
-			      <child>
 				<widget class="GtkLabel" id="label_open_encoding">
 				  <property name="visible">True</property>
 				  <property name="label" translatable="yes">Default encoding (existing files):</property>
@@ -6306,8 +6342,8 @@
 				<packing>
 				  <property name="left_attach">0</property>
 				  <property name="right_attach">1</property>
-				  <property name="top_attach">1</property>
-				  <property name="bottom_attach">2</property>
+				  <property name="top_attach">2</property>
+				  <property name="bottom_attach">3</property>
 				  <property name="x_options">fill</property>
 				  <property name="y_options"></property>
 				</packing>
@@ -6331,12 +6367,34 @@
 				<packing>
 				  <property name="left_attach">1</property>
 				  <property name="right_attach">2</property>
-				  <property name="top_attach">1</property>
-				  <property name="bottom_attach">2</property>
+				  <property name="top_attach">2</property>
+				  <property name="bottom_attach">3</property>
 				  <property name="x_options">fill</property>
 				  <property name="y_options">fill</property>
 				</packing>
 			      </child>
+
+			      <child>
+				<widget class="GtkCheckButton" id="check_open_encoding">
+				  <property name="visible">True</property>
+				  <property name="tooltip" translatable="yes">This option disables the automatic detection of the file encoding when opening files and opens the file with the specified encoding (usually not needed).</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">Use fixed encoding when opening files</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">False</property>
+				  <property name="active">False</property>
+				  <property name="inconsistent">False</property>
+				  <property name="draw_indicator">True</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
 			    </widget>
 			    <packing>
 			      <property name="padding">0</property>

Modified: trunk/plugins/Makefile.am
===================================================================
--- trunk/plugins/Makefile.am	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/plugins/Makefile.am	2007-12-01 17:53:36 UTC (rev 2084)
@@ -10,7 +10,6 @@
 classbuilder_la_LDFLAGS  = -module -avoid-version
 htmlchars_la_LDFLAGS     = -module -avoid-version
 export_la_LDFLAGS        = -module -avoid-version
-svndiff_la_LDFLAGS       = -module -avoid-version
 vcdiff_la_LDFLAGS        = -module -avoid-version
 autosave_la_LDFLAGS      = -module -avoid-version
 filebrowser_la_LDFLAGS   = -module -avoid-version
@@ -22,7 +21,6 @@
 	classbuilder.la \
 	htmlchars.la \
 	export.la \
-	svndiff.la \
 	vcdiff.la \
 	autosave.la \
 	filebrowser.la
@@ -35,7 +33,6 @@
 classbuilder_la_SOURCES  = classbuilder.c
 htmlchars_la_SOURCES     = htmlchars.c
 export_la_SOURCES        = export.c
-svndiff_la_SOURCES       = svndiff.c
 vcdiff_la_SOURCES        = vcdiff.c
 autosave_la_SOURCES      = autosave.c
 filebrowser_la_SOURCES   = filebrowser.c
@@ -44,7 +41,6 @@
 classbuilder_la_LIBADD  = $(GTK_LIBS)
 htmlchars_la_LIBADD     = $(GTK_LIBS)
 export_la_LIBADD        = $(GTK_LIBS)
-svndiff_la_LIBADD       = $(GTK_LIBS)
 vcdiff_la_LIBADD        = $(GTK_LIBS)
 autosave_la_LIBAD       = $(GTK_LIBS)
 filebrowser_la_LIBADD   = $(GTK_LIBS)

Modified: trunk/plugins/makefile.win32
===================================================================
--- trunk/plugins/makefile.win32	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/plugins/makefile.win32	2007-12-01 17:53:36 UTC (rev 2084)
@@ -45,7 +45,6 @@
 		demoplugin.dll \
 		classbuilder.dll \
 		export.dll \
-		svndiff.dll \
 		vcdiff.dll \
 		autosave.dll \
 		filebrowser.dll

Deleted: trunk/plugins/svndiff.c
===================================================================
--- trunk/plugins/svndiff.c	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/plugins/svndiff.c	2007-12-01 17:53:36 UTC (rev 2084)
@@ -1,390 +0,0 @@
-/*
- *      svndiff.c - this file is part of Geany, a fast and lightweight IDE
- *
- *      Copyright 2007 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
- *      Copyright 2007 Enrico Tröger <enrico.troeger at uvena.de>
- *      Copyright 2007 Nick Treleaven <nick.treleaven at btinternet.com>
- *
- *      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.*/
-
-#include "geany.h"
-#include "support.h"
-#include "plugindata.h"
-#include "document.h"
-#include "filetypes.h"
-#include "utils.h"
-#include "project.h"
-#include "pluginmacros.h"
-
-PluginFields	*plugin_fields;
-GeanyData		*geany_data;
-
-
-VERSION_CHECK(27)
-
-PLUGIN_INFO(_("SVNdiff"), _("Plugin to create a patch of a file against svn"), VERSION,
-	_("The Geany developer team"))
-
-static int find_by_filename(const gchar* filename)
-{
-	guint i;
-
-	for (i = 0; i < doc_array->len; i++)
-	{
-		if (doc_list[i].is_valid && doc_list[i].file_name &&
-		     strcmp(doc_list[i].file_name, filename) == 0)
-			return i;
-	}
-	return -1;
-}
-
-/* name_prefix should be in UTF-8, and can have a path. */
-static void show_output(const gchar *std_output, const gchar *name_prefix,
-		const gchar *force_encoding)
-{
-	gchar	*text, *detect_enc = NULL;
-	gint 	idx, page;
-	GtkNotebook *book;
-	gchar	*filename;
-
-	filename = g_path_get_basename(name_prefix);
-	setptr(filename, g_strconcat(filename, ".svn.diff", NULL));
-
-	// need to convert input text from the encoding of the original file into
-	// UTF-8 because internally Geany always needs UTF-8
-	if (force_encoding)
-	{
-		text = geany_data->encoding->convert_to_utf8_from_charset(
-			std_output, -1, force_encoding, TRUE);
-	}
-	else
-	{
-		text = geany_data->encoding->convert_to_utf8(std_output, -1, &detect_enc);
-	}
-	if (text)
-	{
-		idx = find_by_filename(filename);
-		if ( idx == -1)
-		{
-			idx = geany_data->document->new_file(filename,
-			geany_data->filetypes[GEANY_FILETYPES_DIFF], text);
-		}
-		else
-		{
-			scintilla->set_text(doc_list[idx].sci, text);
-			book = GTK_NOTEBOOK(app->notebook);
-			page = gtk_notebook_page_num(book, GTK_WIDGET(doc_list[idx].sci));
-			gtk_notebook_set_current_page(book, page);
-			doc_list[idx].changed = FALSE;
-			documents->set_text_changed(idx);
-		}
-
-		geany_data->document->set_encoding(idx,
-			force_encoding ? force_encoding : detect_enc);
-	}
-	else
-	{
-		ui->set_statusbar(FALSE, _("Could not parse the output of svn diff"));
-	}
-	g_free(text);
-	g_free(detect_enc);
-	g_free(filename);
-}
-
-static gboolean make_revert(const gchar *svn_file)
-{
-	gchar	*std_output = NULL;
-	gchar	*std_error = NULL;
-	gint	exit_code;
-	gchar	*command = NULL;
-
-	// use '' quotation for Windows compatibility
-	command = g_strdup_printf("svn revert '%s'", svn_file);
-
-	if (g_spawn_command_line_sync(command, &std_output, &std_error, &exit_code, NULL))
-	{
-		if (! exit_code)
-		{
-			if (NZV(std_output))
-			{
-				ui->set_statusbar(FALSE, std_output);
-			}
-			else
-			{
-				ui->set_statusbar(FALSE, _("No changes were made."));
-				return FALSE;
-			}
-		}
-		else
-		{	// SVN returns some error
-			dialogs->show_msgbox(1,
-				_("SVN exited with an error: \n%s."), g_strstrip(std_error));
-			return FALSE;
-		}
-	}
-	else
-	{
-		ui->set_statusbar(FALSE,
-			_("Something went really wrong. Is there any svn-binary in your path?"));
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-static gchar *make_diff(const gchar *svn_file)
-{
-	gchar	*std_output = NULL;
-	gchar	*std_error = NULL;
-	gint	exit_code;
-	gchar	*command, *text = NULL;
-
-	// use '' quotation for Windows compatibility
-	command = g_strdup_printf("svn diff --non-interactive '%s'", svn_file);
-
-	if (g_spawn_command_line_sync(command, &std_output, &std_error, &exit_code, NULL))
-	{
-		if (! exit_code)
-		{
-			if (NZV(std_output))
-			{
-				text = std_output;
-			}
-			else
-			{
-				ui->set_statusbar(FALSE, _("No changes were made."));
-			}
-		}
-		else
-		{	// SVN returns some error
-			dialogs->show_msgbox(1,
-				_("SVN exited with an error: \n%s."), g_strstrip(std_error));
-		}
-	}
-	else
-	{
-		ui->set_statusbar(FALSE,
-			_("Something went really wrong. Is there any svn-binary in your path?"));
-	}
-	g_free(std_error);
-	g_free(command);
-	return text;
-}
-
-
-/* Make a diff from the current directory */
-static void svndirectory_activated(GtkMenuItem *menuitem, gpointer gdata)
-{
-	gint	idx;
-	gchar	*base_name = NULL;
-	gchar	*locale_filename = NULL;
-	gchar	*text;
-
-	idx = documents->get_cur_idx();
-
-	g_return_if_fail(DOC_IDX_VALID(idx) && doc_list[idx].file_name != NULL);
-
-	if (doc_list[idx].changed)
-	{
-		documents->save_file(idx, FALSE);
-	}
-
-	locale_filename = utils->get_locale_from_utf8(doc_list[idx].file_name);
-	base_name = g_path_get_dirname(locale_filename);
-
-	text = make_diff(base_name);
-	if (text)
-		show_output(text, base_name, NULL);
-	g_free(text);
-
-	g_free(base_name);
-	g_free(locale_filename);
-}
-
-
-/* Callback if menu item for the current project was activated */
-static void svnproject_activated(GtkMenuItem *menuitem, gpointer gdata)
-{
-	gint	idx;
-	gchar	*locale_filename = NULL;
-	gchar	*text;
-
-	idx = documents->get_cur_idx();
-
-	g_return_if_fail(project != NULL && NZV(project->base_path));
-
-	if (DOC_IDX_VALID(idx) && doc_list[idx].changed && doc_list[idx].file_name != NULL)
-	{
-		documents->save_file(idx, FALSE);
-	}
-
-	locale_filename = utils->get_locale_from_utf8(project->base_path);
-	text = make_diff(locale_filename);
-	if (text)
-		show_output(text, project->name, NULL);
-	g_free(text);
-	g_free(locale_filename);
-}
-
-
-/* Callback if menu item for a single file was activated */
-static void svnfile_activated(GtkMenuItem *menuitem, gpointer gdata)
-{
-	gint	idx;
-	gchar	*locale_filename, *text;
-
-	idx = documents->get_cur_idx();
-
-	g_return_if_fail(DOC_IDX_VALID(idx) && doc_list[idx].file_name != NULL);
-
-	if (doc_list[idx].changed)
-	{
-		documents->save_file(idx, FALSE);
-	}
-
-	locale_filename = utils->get_locale_from_utf8(doc_list[idx].file_name);
-
-	text = make_diff(locale_filename);
-	if (text)
-		show_output(text, doc_list[idx].file_name, doc_list[idx].encoding);
-	g_free(text);
-	g_free(locale_filename);
-}
-
-/* Callback if menu item for a single file was activated */
-static void svnrevert_activated(GtkMenuItem *menuitem, gpointer gdata)
-{
-	gint	idx;
-	gchar	*locale_filename;
-
-	idx = documents->get_cur_idx();
-
-	g_return_if_fail(DOC_IDX_VALID(idx) && doc_list[idx].file_name != NULL);
-
-	if (dialogs->show_question(_("Do you realy want to revert '%s'?"), doc_list[idx].file_name))
-	{
-		locale_filename = utils->get_locale_from_utf8(doc_list[idx].file_name);
-
-		if (make_revert(locale_filename))
-		{
-			documents->reload_file(idx, NULL);
-		}
-		g_free(locale_filename);
-	}
-}
-
-static GtkWidget *menu_svndiff_file = NULL;
-static GtkWidget *menu_svndiff_dir = NULL;
-static GtkWidget *menu_svndiff_project = NULL;
-static GtkWidget *menu_svndiff_revert = NULL;
-
-static void update_menu_items()
-{
-	document	*doc;
-	gboolean	have_file;
-
-	doc = documents->get_current();
-	have_file = doc && doc->file_name && g_path_is_absolute(doc->file_name);
-
-	gtk_widget_set_sensitive(menu_svndiff_file, have_file);
-	gtk_widget_set_sensitive(menu_svndiff_dir, have_file);
-	gtk_widget_set_sensitive(menu_svndiff_revert, have_file);
-	gtk_widget_set_sensitive(menu_svndiff_project,
-		project != NULL && NZV(project->base_path));
-}
-
-
-/* Called by Geany to initialize the plugin */
-void init(GeanyData *data)
-{
-	GtkWidget	*menu_svndiff = NULL;
-	GtkWidget	*menu_svndiff_menu = NULL;
- 	GtkTooltips	*tooltips = NULL;
-	gchar		*tmp = NULL;
-	gboolean	have_svn = FALSE;
-
-	// Check for svn inside $PATH. Thanks to Yura Siamashka <yurand2 at gmail.com>
-	tmp = g_find_program_in_path("svn");
-	have_svn = (tmp != NULL);
-	g_free(tmp);
-
-	tooltips = gtk_tooltips_new();
-
-	menu_svndiff = gtk_image_menu_item_new_with_mnemonic(_("_SVNdiff"));
-	gtk_container_add(GTK_CONTAINER(data->tools_menu), menu_svndiff);
-
-	g_signal_connect((gpointer) menu_svndiff, "activate",
-		G_CALLBACK(update_menu_items), NULL);
-
-	menu_svndiff_menu = gtk_menu_new ();
-	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_svndiff), menu_svndiff_menu);
-
-	// Single file
-	menu_svndiff_file = gtk_menu_item_new_with_mnemonic(_("From Current _File"));
-	gtk_container_add(GTK_CONTAINER (menu_svndiff_menu), menu_svndiff_file);
-	gtk_tooltips_set_tip (tooltips, menu_svndiff_file,
-		_("Make a diff from the current active file"), NULL);
-
-	g_signal_connect((gpointer) menu_svndiff_file, "activate",
-		G_CALLBACK(svnfile_activated), NULL);
-
-	// Directory
-	menu_svndiff_dir = gtk_menu_item_new_with_mnemonic(_("From Current _Directory"));
-	gtk_container_add(GTK_CONTAINER (menu_svndiff_menu), menu_svndiff_dir);
-	gtk_tooltips_set_tip (tooltips, menu_svndiff_dir,
-		_("Make a diff from the directory of the current active file"), NULL);
-
-	g_signal_connect((gpointer) menu_svndiff_dir, "activate",
-		G_CALLBACK(svndirectory_activated), NULL);
-
-	// Project
-	menu_svndiff_project = gtk_menu_item_new_with_mnemonic(_("From Current _Project"));
-	gtk_container_add(GTK_CONTAINER (menu_svndiff_menu), menu_svndiff_project);
-	gtk_tooltips_set_tip (tooltips, menu_svndiff_project,
-		_("Make a diff from the current project's base path"), NULL);
-
-	g_signal_connect((gpointer) menu_svndiff_project, "activate",
-		G_CALLBACK(svnproject_activated), NULL);
-
-	gtk_container_add(GTK_CONTAINER (menu_svndiff_menu),
-		gtk_separator_menu_item_new());
-
-	// SVN revert
-	menu_svndiff_revert = gtk_menu_item_new_with_mnemonic(_("Revert Changes"));
-	gtk_container_add(GTK_CONTAINER (menu_svndiff_menu), menu_svndiff_revert);
-	gtk_tooltips_set_tip(tooltips, menu_svndiff_revert, _("Revert all made changes at this file"), NULL);
-	g_signal_connect((gpointer) menu_svndiff_revert, "activate", G_CALLBACK(svnrevert_activated), NULL);
-
-	gtk_widget_show_all(menu_svndiff);
-
-	plugin_fields->menu_item = menu_svndiff;
-	if (have_svn)
-		plugin_fields->flags = PLUGIN_IS_DOCUMENT_SENSITIVE;
-	else
-		gtk_widget_set_sensitive(plugin_fields->menu_item, FALSE);
-}
-
-
-/* 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/src/editor.c
===================================================================
--- trunk/src/editor.c	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/editor.c	2007-12-01 17:53:36 UTC (rev 2084)
@@ -1030,8 +1030,9 @@
 		ret = autocomplete_html(sci, root, rootlen);
 	else
 	{
-		// force is set when called by keyboard shortcut, otherwise start at the 4th char
-		if (force || rootlen >= 4)
+		// force is set when called by keyboard shortcut, otherwise start at the
+		// editor_prefs.symbolcompletion_min_chars'th char
+		if (force || rootlen >= editor_prefs.symbolcompletion_min_chars)
 			ret = autocomplete_tags(idx, root, rootlen);
 	}
 

Modified: trunk/src/editor.h
===================================================================
--- trunk/src/editor.h	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/editor.h	2007-12-01 17:53:36 UTC (rev 2084)
@@ -70,6 +70,7 @@
 	gboolean	auto_complete_symbols;
 	gboolean	auto_close_xml_tags;
 	gboolean	complete_snippets;
+	gint		symbolcompletion_min_chars;
 	gint		symbolcompletion_max_height;
 	GHashTable	*snippets;
 	gboolean	brace_match_ltgt;	// whether to highlight < and > chars (hidden pref)

Modified: trunk/src/geany.h
===================================================================
--- trunk/src/geany.h	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/geany.h	2007-12-01 17:53:36 UTC (rev 2084)
@@ -55,6 +55,7 @@
 #define GEANY_MAX_WORD_LENGTH			192
 #define GEANY_MAX_AUTOCOMPLETE_WORDS	30
 #define GEANY_MAX_SYMBOLLIST_HEIGHT		10
+#define GEANY_MIN_SYMBOLLIST_CHARS		4
 #define GEANY_STRING_UNTITLED			_("untitled")
 #define GEANY_MSGWIN_HEIGHT				208
 #define GEANY_WINDOW_MINIMAL_WIDTH		620

Modified: trunk/src/interface.c
===================================================================
--- trunk/src/interface.c	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/interface.c	2007-12-01 17:53:36 UTC (rev 2084)
@@ -2611,10 +2611,13 @@
   GtkWidget *check_complete_snippets;
   GtkWidget *check_xmltag;
   GtkWidget *check_symbol_auto_completion;
-  GtkWidget *hbox6;
-  GtkWidget *label173;
+  GtkWidget *table14;
   GtkObject *spin_symbollistheight_adj;
   GtkWidget *spin_symbollistheight;
+  GtkWidget *label205;
+  GtkWidget *label173;
+  GtkObject *spin_symbol_complete_chars_adj;
+  GtkWidget *spin_symbol_complete_chars;
   GtkWidget *label177;
   GtkWidget *label95;
   GtkWidget *vbox18;
@@ -2625,10 +2628,10 @@
   GtkWidget *eventbox1;
   GtkWidget *combo_new_encoding;
   GtkWidget *label153;
-  GtkWidget *check_open_encoding;
   GtkWidget *label_open_encoding;
   GtkWidget *eventbox3;
   GtkWidget *combo_open_encoding;
+  GtkWidget *check_open_encoding;
   GtkWidget *label109;
   GtkWidget *frame2;
   GtkWidget *alignment3;
@@ -3702,22 +3705,44 @@
   gtk_tooltips_set_tip (tooltips, check_symbol_auto_completion, _("Automatic completion of known symbols in open files (function names, global variables, ...)"), NULL);
   gtk_button_set_focus_on_click (GTK_BUTTON (check_symbol_auto_completion), FALSE);
 
-  hbox6 = gtk_hbox_new (FALSE, 12);
-  gtk_widget_show (hbox6);
-  gtk_box_pack_start (GTK_BOX (vbox19), hbox6, FALSE, FALSE, 0);
+  table14 = gtk_table_new (2, 2, FALSE);
+  gtk_widget_show (table14);
+  gtk_box_pack_start (GTK_BOX (vbox19), table14, FALSE, FALSE, 0);
+  gtk_table_set_row_spacings (GTK_TABLE (table14), 3);
+  gtk_table_set_col_spacings (GTK_TABLE (table14), 12);
 
-  label173 = gtk_label_new (_("Rows of symbol completion list:"));
-  gtk_widget_show (label173);
-  gtk_box_pack_start (GTK_BOX (hbox6), label173, FALSE, FALSE, 0);
-  gtk_misc_set_alignment (GTK_MISC (label173), 0, 0.5);
-
-  spin_symbollistheight_adj = gtk_adjustment_new (10, 1, 99, 1, 10, 10);
+  spin_symbollistheight_adj = gtk_adjustment_new (9, 1, 99, 1, 10, 10);
   spin_symbollistheight = gtk_spin_button_new (GTK_ADJUSTMENT (spin_symbollistheight_adj), 1, 0);
   gtk_widget_show (spin_symbollistheight);
-  gtk_box_pack_start (GTK_BOX (hbox6), spin_symbollistheight, FALSE, TRUE, 0);
+  gtk_table_attach (GTK_TABLE (table14), spin_symbollistheight, 1, 2, 1, 2,
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                    (GtkAttachOptions) (0), 0, 0);
   gtk_tooltips_set_tip (tooltips, spin_symbollistheight, _("Number of rows to display in the autocompletion list."), NULL);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin_symbollistheight), TRUE);
 
+  label205 = gtk_label_new (_("Characters to type for completion:"));
+  gtk_widget_show (label205);
+  gtk_table_attach (GTK_TABLE (table14), label205, 0, 1, 0, 1,
+                    (GtkAttachOptions) (GTK_FILL),
+                    (GtkAttachOptions) (0), 0, 0);
+  gtk_misc_set_alignment (GTK_MISC (label205), 0, 0.5);
+
+  label173 = gtk_label_new (_("Rows of symbol completion list:"));
+  gtk_widget_show (label173);
+  gtk_table_attach (GTK_TABLE (table14), label173, 0, 1, 1, 2,
+                    (GtkAttachOptions) (GTK_FILL),
+                    (GtkAttachOptions) (0), 0, 0);
+  gtk_misc_set_alignment (GTK_MISC (label173), 0, 0.5);
+
+  spin_symbol_complete_chars_adj = gtk_adjustment_new (9, 1, 99, 1, 10, 10);
+  spin_symbol_complete_chars = gtk_spin_button_new (GTK_ADJUSTMENT (spin_symbol_complete_chars_adj), 1, 0);
+  gtk_widget_show (spin_symbol_complete_chars);
+  gtk_table_attach (GTK_TABLE (table14), spin_symbol_complete_chars, 1, 2, 0, 1,
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                    (GtkAttachOptions) (0), 0, 0);
+  gtk_tooltips_set_tip (tooltips, spin_symbol_complete_chars, _("The amount of characters which are necessary to show the symbol auto completion list."), NULL);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin_symbol_complete_chars), TRUE);
+
   label177 = gtk_label_new (_("<b>Completions</b>"));
   gtk_widget_show (label177);
   gtk_frame_set_label_widget (GTK_FRAME (frame18), label177);
@@ -3749,7 +3774,6 @@
   gtk_widget_show (table5);
   gtk_box_pack_start (GTK_BOX (vbox8), table5, FALSE, TRUE, 0);
   gtk_table_set_row_spacings (GTK_TABLE (table5), 3);
-  gtk_table_set_col_spacings (GTK_TABLE (table5), 12);
 
   eventbox1 = gtk_event_box_new ();
   gtk_widget_show (eventbox1);
@@ -3769,24 +3793,16 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_misc_set_alignment (GTK_MISC (label153), 0, 0.5);
 
-  check_open_encoding = gtk_check_button_new_with_mnemonic (_("Use fixed encoding when opening files"));
-  gtk_widget_show (check_open_encoding);
-  gtk_table_attach (GTK_TABLE (table5), check_open_encoding, 0, 2, 2, 3,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_tooltips_set_tip (tooltips, check_open_encoding, _("This option disables the automatic detection of the file encoding when opening files and opens the file with the specified encoding (usually not needed)."), NULL);
-  gtk_button_set_focus_on_click (GTK_BUTTON (check_open_encoding), FALSE);
-
   label_open_encoding = gtk_label_new (_("Default encoding (existing files):"));
   gtk_widget_show (label_open_encoding);
-  gtk_table_attach (GTK_TABLE (table5), label_open_encoding, 0, 1, 1, 2,
+  gtk_table_attach (GTK_TABLE (table5), label_open_encoding, 0, 1, 2, 3,
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (0), 0, 0);
   gtk_misc_set_alignment (GTK_MISC (label_open_encoding), 0, 0.5);
 
   eventbox3 = gtk_event_box_new ();
   gtk_widget_show (eventbox3);
-  gtk_table_attach (GTK_TABLE (table5), eventbox3, 1, 2, 1, 2,
+  gtk_table_attach (GTK_TABLE (table5), eventbox3, 1, 2, 2, 3,
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_FILL), 0, 0);
   gtk_tooltips_set_tip (tooltips, eventbox3, _("Sets the default encoding for opening existing files."), NULL);
@@ -3795,6 +3811,14 @@
   gtk_widget_show (combo_open_encoding);
   gtk_container_add (GTK_CONTAINER (eventbox3), combo_open_encoding);
 
+  check_open_encoding = gtk_check_button_new_with_mnemonic (_("Use fixed encoding when opening files"));
+  gtk_widget_show (check_open_encoding);
+  gtk_table_attach (GTK_TABLE (table5), check_open_encoding, 0, 2, 1, 2,
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                    (GtkAttachOptions) (0), 0, 0);
+  gtk_tooltips_set_tip (tooltips, check_open_encoding, _("This option disables the automatic detection of the file encoding when opening files and opens the file with the specified encoding (usually not needed)."), NULL);
+  gtk_button_set_focus_on_click (GTK_BUTTON (check_open_encoding), FALSE);
+
   label109 = gtk_label_new (_("<b>New files</b>"));
   gtk_widget_show (label109);
   gtk_frame_set_label_widget (GTK_FRAME (frame6), label109);
@@ -4536,9 +4560,11 @@
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_complete_snippets, "check_complete_snippets");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_xmltag, "check_xmltag");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_symbol_auto_completion, "check_symbol_auto_completion");
-  GLADE_HOOKUP_OBJECT (prefs_dialog, hbox6, "hbox6");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, table14, "table14");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, spin_symbollistheight, "spin_symbollistheight");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, label205, "label205");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label173, "label173");
-  GLADE_HOOKUP_OBJECT (prefs_dialog, spin_symbollistheight, "spin_symbollistheight");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, spin_symbol_complete_chars, "spin_symbol_complete_chars");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label177, "label177");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label95, "label95");
   GLADE_HOOKUP_OBJECT (prefs_dialog, vbox18, "vbox18");
@@ -4549,10 +4575,10 @@
   GLADE_HOOKUP_OBJECT (prefs_dialog, eventbox1, "eventbox1");
   GLADE_HOOKUP_OBJECT (prefs_dialog, combo_new_encoding, "combo_new_encoding");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label153, "label153");
-  GLADE_HOOKUP_OBJECT (prefs_dialog, check_open_encoding, "check_open_encoding");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label_open_encoding, "label_open_encoding");
   GLADE_HOOKUP_OBJECT (prefs_dialog, eventbox3, "eventbox3");
   GLADE_HOOKUP_OBJECT (prefs_dialog, combo_open_encoding, "combo_open_encoding");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, check_open_encoding, "check_open_encoding");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label109, "label109");
   GLADE_HOOKUP_OBJECT (prefs_dialog, frame2, "frame2");
   GLADE_HOOKUP_OBJECT (prefs_dialog, alignment3, "alignment3");

Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/keyfile.c	2007-12-01 17:53:36 UTC (rev 2084)
@@ -198,6 +198,7 @@
 
 	// editor
 	g_key_file_set_integer(config, PACKAGE, "symbolcompletion_max_height", editor_prefs.symbolcompletion_max_height);
+	g_key_file_set_integer(config, PACKAGE, "symbolcompletion_min_chars", editor_prefs.symbolcompletion_min_chars);
 	g_key_file_set_boolean(config, PACKAGE, "use_folding", editor_prefs.folding);
 	g_key_file_set_boolean(config, PACKAGE, "unfold_all_children", editor_prefs.unfold_all_children);
 	g_key_file_set_integer(config, PACKAGE, "indent_mode", editor_prefs.indent_mode);
@@ -487,6 +488,7 @@
 	editor_prefs.long_line_type = utils_get_setting_integer(config, PACKAGE, "long_line_type", 0);
 	editor_prefs.long_line_color = utils_get_setting_string(config, PACKAGE, "long_line_color", "#C2EBC2");
 	editor_prefs.long_line_column = utils_get_setting_integer(config, PACKAGE, "long_line_column", 72);
+	editor_prefs.symbolcompletion_min_chars = utils_get_setting_integer(config, PACKAGE, "symbolcompletion_min_chars", GEANY_MIN_SYMBOLLIST_CHARS);
 	editor_prefs.symbolcompletion_max_height = utils_get_setting_integer(config, PACKAGE, "symbolcompletion_max_height", GEANY_MAX_SYMBOLLIST_HEIGHT);
 	editor_prefs.line_wrapping = utils_get_setting_boolean(config, PACKAGE, "line_breaking", FALSE); // default is off for better performance
 	editor_prefs.indent_mode = utils_get_setting_integer(config, PACKAGE, "indent_mode", INDENT_CURRENTCHARS);

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/plugindata.h	2007-12-01 17:53:36 UTC (rev 2084)
@@ -93,12 +93,12 @@
 
 /* The API version should be incremented whenever any plugin data types below are
  * modified or appended to. */
-static const gint api_version = 32;
+static const gint api_version = 33;
 
 /* The ABI version should be incremented whenever existing fields in the plugin
  * data types below have to be changed or reordered. It should stay the same if fields
  * are only appended, as this doesn't affect existing fields. */
-static const gint abi_version = 16;
+static const gint abi_version = 17;
 
 /* This performs runtime checks that try to ensure:
  * 1. Geany ABI data types are compatible with this plugin.
@@ -211,6 +211,7 @@
 	gint	(*new_file) (const gchar *filename, struct filetype *ft, const gchar *text);
 	gint	(*get_cur_idx) ();
 	gint	(*get_n_idx) (guint i);
+	gint	(*find_by_filename) (const gchar *filename, gboolean is_tm_filename);
 	struct document* (*get_current) ();
 	gboolean (*save_file)(gint idx, gboolean force);
 	gint	(*open_file)(const gchar *locale_filename, gboolean readonly,

Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/plugins.c	2007-12-01 17:53:36 UTC (rev 2084)
@@ -87,6 +87,7 @@
 	&document_new_file,
 	&document_get_cur_idx,
 	&document_get_n_idx,
+	&document_find_by_filename,
 	&document_get_current,
 	&document_save_file,
 	&document_open_file,

Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c	2007-12-01 11:27:03 UTC (rev 2083)
+++ trunk/src/prefs.c	2007-12-01 17:53:36 UTC (rev 2084)
@@ -403,7 +403,10 @@
 	widget = lookup_widget(ui_widgets.prefs_dialog, "spin_symbollistheight");
 	gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), editor_prefs.symbolcompletion_max_height);
 
+	widget = lookup_widget(ui_widgets.prefs_dialog, "spin_symbol_complete_chars");
+	gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), editor_prefs.symbolcompletion_min_chars);
 
+
 	// Tools Settings
 	if (prefs.tools_make_cmd)
 			gtk_entry_set_text(GTK_ENTRY(lookup_widget(ui_widgets.prefs_dialog, "entry_com_make")), prefs.tools_make_cmd);
@@ -774,6 +777,9 @@
 		widget = lookup_widget(ui_widgets.prefs_dialog, "check_symbol_auto_completion");
 		editor_prefs.auto_complete_symbols = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
+		widget = lookup_widget(ui_widgets.prefs_dialog, "spin_symbol_complete_chars");
+		editor_prefs.symbolcompletion_min_chars = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
+
 		widget = lookup_widget(ui_widgets.prefs_dialog, "spin_symbollistheight");
 		editor_prefs.symbolcompletion_max_height = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list