Revision: 1950 http://geany.svn.sourceforge.net/geany/?rev=1950&view=rev Author: eht16 Date: 2007-10-16 02:01:13 -0700 (Tue, 16 Oct 2007)
Log Message: ----------- Fix wrong callback signatures in Export plugin and make menu item document sensitive. Add dialogs_show_save_as() to the plugin API.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/export.c trunk/src/plugindata.h trunk/src/plugins.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-10-16 08:58:43 UTC (rev 1949) +++ trunk/ChangeLog 2007-10-16 09:01:13 UTC (rev 1950) @@ -3,6 +3,10 @@ * geany.glade, src/callbacks.c, src/callbacks.h, src/interface.c: Suppress selection changed signal when switching between open files and symbol list. + * src/plugins.c, src/plugindata.h, plugins/export.c: + Add dialogs_show_save_as() to the plugin API. + Fix wrong callback signatures in Export plugin and make menu item + document sensitive.
2007-10-15 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Modified: trunk/plugins/export.c =================================================================== --- trunk/plugins/export.c 2007-10-16 08:58:43 UTC (rev 1949) +++ trunk/plugins/export.c 2007-10-16 09:01:13 UTC (rev 1950) @@ -38,7 +38,7 @@ GeanyData *geany_data;
VERSION_CHECK(20) -PLUGIN_INFO(_("Export"), _("Exports the current file into different formats."), "0.1") +PLUGIN_INFO(_("Export"), _("Exports the current file into different formats."), "0.2")
#define doc_array geany_data->doc_array #define scintilla geany_data->sci @@ -248,13 +248,13 @@ }
-static void on_menu_create_latex_activate(gint idx, const gchar *filename, gboolean use_zoom) +static void on_menu_create_latex_activate(GtkMenuItem *menuitem, gpointer user_data) { create_file_save_as_dialog(".tex", write_latex_file, FALSE); }
-static void on_menu_create_html_activate(gint idx, const gchar *filename, gboolean use_zoom) +static void on_menu_create_html_activate(GtkMenuItem *menuitem, gpointer user_data) { create_file_save_as_dialog(".html", write_html_file, TRUE); } @@ -722,9 +722,11 @@ g_signal_connect((gpointer) menu_create_latex, "activate", G_CALLBACK(on_menu_create_latex_activate), NULL);
+ // disable menu_item when there are no documents open + plugin_fields->menu_item = menu_export; + plugin_fields->flags = PLUGIN_IS_DOCUMENT_SENSITIVE; + gtk_widget_show_all(menu_export); - - plugin_fields->menu_item = menu_export; }
Modified: trunk/src/plugindata.h =================================================================== --- trunk/src/plugindata.h 2007-10-16 08:58:43 UTC (rev 1949) +++ trunk/src/plugindata.h 2007-10-16 09:01:13 UTC (rev 1950) @@ -71,12 +71,12 @@
/* The API version should be incremented whenever any plugin data types below are * modified. */ -static const gint api_version = 21; +static const gint api_version = 22;
/* 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 = 11; +static const gint abi_version = 12;
/* This performs runtime checks that try to ensure: * 1. Geany ABI data types are compatible with this plugin. @@ -235,7 +235,7 @@ { gboolean (*str_equal) (const gchar *a, const gchar *b); gboolean (*string_replace_all) (GString *haystack, const gchar *needle, - const gchar *replacement); + const gchar *replacement); GSList* (*get_file_list) (const gchar *path, guint *length, GError **error); gint (*write_file) (const gchar *filename, const gchar *text); gchar* (*get_locale_from_utf8) (const gchar *utf8_text); @@ -258,6 +258,7 @@ { gboolean (*show_question) (const gchar *text, ...); void (*show_msgbox) (gint type, const gchar *text, ...); + gboolean (*show_save_as) (void); } DialogFuncs;
Modified: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c 2007-10-16 08:58:43 UTC (rev 1949) +++ trunk/src/plugins.c 2007-10-16 09:01:13 UTC (rev 1950) @@ -160,7 +160,8 @@
static DialogFuncs dialog_funcs = { &dialogs_show_question, - &dialogs_show_msgbox + &dialogs_show_msgbox, + &dialogs_show_save_as };
static SupportFuncs support_funcs = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.