Fix showing desensitive widgets if no documents are open when a
plugin is first loaded. Remove plugins_update_document_sensitive(). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3095 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
65768ef184
commit
e72e7c337a
@ -3,6 +3,10 @@
|
||||
* src/interface.c, src/callbacks.c, src/callbacks.h, src/plugins.c,
|
||||
src/plugins.h, geany.glade:
|
||||
Show the tools menu separator if there are any items below it.
|
||||
* src/plugins.c, src/plugins.h, src/ui_utils.c:
|
||||
Fix showing desensitive widgets if no documents are open when a
|
||||
plugin is first loaded.
|
||||
Remove plugins_update_document_sensitive().
|
||||
|
||||
|
||||
2008-10-14 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||
|
@ -515,8 +515,7 @@ plugin_init(Plugin *plugin)
|
||||
|
||||
if (plugin->fields.flags & PLUGIN_IS_DOCUMENT_SENSITIVE)
|
||||
{
|
||||
gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) ? TRUE : FALSE;
|
||||
gtk_widget_set_sensitive(plugin->fields.menu_item, enable);
|
||||
ui_add_document_sensitive(plugin->fields.menu_item);
|
||||
}
|
||||
|
||||
g_module_symbol(plugin->module, "plugin_callbacks", (void *) &callbacks);
|
||||
@ -911,20 +910,6 @@ void plugins_free(void)
|
||||
}
|
||||
|
||||
|
||||
void plugins_update_document_sensitive(gboolean enabled)
|
||||
{
|
||||
GList *item;
|
||||
|
||||
for (item = active_plugin_list; item != NULL; item = g_list_next(item))
|
||||
{
|
||||
Plugin *plugin = item->data;
|
||||
|
||||
if (plugin->fields.flags & PLUGIN_IS_DOCUMENT_SENSITIVE)
|
||||
gtk_widget_set_sensitive(plugin->fields.menu_item, enabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Plugin Manager */
|
||||
|
||||
enum
|
||||
@ -943,7 +928,8 @@ typedef struct
|
||||
GtkListStore *store;
|
||||
GtkWidget *description_label;
|
||||
GtkWidget *configure_button;
|
||||
} PluginManagerWidgets;
|
||||
}
|
||||
PluginManagerWidgets;
|
||||
|
||||
static PluginManagerWidgets pm_widgets;
|
||||
|
||||
|
@ -36,8 +36,6 @@ void plugins_save_prefs(GKeyFile *config);
|
||||
|
||||
void plugins_load_prefs(GKeyFile *config);
|
||||
|
||||
void plugins_update_document_sensitive(gboolean enabled);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -645,12 +645,9 @@ void ui_document_buttons_update(void)
|
||||
for (i = 0; i < widgets.document_buttons->len; i++)
|
||||
{
|
||||
GtkWidget *widget = g_ptr_array_index(widgets.document_buttons, i);
|
||||
|
||||
gtk_widget_set_sensitive(widget, enable);
|
||||
}
|
||||
|
||||
#ifdef HAVE_PLUGINS
|
||||
plugins_update_document_sensitive(enable);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -666,6 +663,10 @@ static void on_doc_sensitive_widget_destroy(GtkWidget *widget, G_GNUC_UNUSED gpo
|
||||
* @param widget The widget to add. */
|
||||
void ui_add_document_sensitive(GtkWidget *widget)
|
||||
{
|
||||
gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) ? TRUE : FALSE;
|
||||
|
||||
gtk_widget_set_sensitive(widget, enable);
|
||||
|
||||
g_ptr_array_add(widgets.document_buttons, widget);
|
||||
g_signal_connect(widget, "destroy", G_CALLBACK(on_doc_sensitive_widget_destroy), NULL);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user