Kaydet (Commit) 7c78e6a4 authored tarafından Enrico Tröger's avatar Enrico Tröger

Fix wrong callback signatures in Export plugin and make menu item document sensitive.

Add dialogs_show_save_as() to the plugin API.   


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1950 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 97def873
......@@ -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>
......
......@@ -38,7 +38,7 @@ PluginFields *plugin_fields;
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 create_file_save_as_dialog(const gchar *extension, ExportFunc func,
}
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 @@ void init(GeanyData *data)
g_signal_connect((gpointer) menu_create_latex, "activate",
G_CALLBACK(on_menu_create_latex_activate), NULL);
gtk_widget_show_all(menu_export);
// 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);
}
......
......@@ -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 @@ typedef struct UtilsFuncs
{
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 @@ typedef struct DialogFuncs
{
gboolean (*show_question) (const gchar *text, ...);
void (*show_msgbox) (gint type, const gchar *text, ...);
gboolean (*show_save_as) (void);
}
DialogFuncs;
......
......@@ -160,7 +160,8 @@ static UIUtilsFuncs uiutils_funcs = {
static DialogFuncs dialog_funcs = {
&dialogs_show_question,
&dialogs_show_msgbox
&dialogs_show_msgbox,
&dialogs_show_save_as
};
static SupportFuncs support_funcs = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment