Commit c82c61fa authored by Naba Kumar's avatar Naba Kumar

Shows plugins in a nicer dialog.

	* libanjuta/plugins.c: Shows plugins in a nicer dialog.

	* libanjuta/interfaces/libanjuta.idl,
	plugins/editor/text_editor.c: Added get_length()
	and get_current_word() methods in IAnjutaEditor interface.

	* libegg/Makefile.am: Added test_actions target.

	* libegg/egg-combo-action.c: Fixed combo-action and made it usable.

	* plugins/build-basic-autotools/build-basic-autotools.c,
	plugins/file-loader/plugin.c,
	plugins/message-view/message-view.c: Added code to go to file and
	line number,

	* plugins/devhelp/plugin.c: Context sensitive help now works.
	* plugins/editor/anjuta-docman.c: Reads the fragment id from file
	uri as line number and goes to that line number.

	* plugins/gtodo/interface.c, plugins/gtodo/libgtodo.c,
	plugins/gtodo/plugin.c: Creates a default gtodo client and implemented
	gtodo_client_load() method to load from a diffrent file. Watched
	project root directory in plugin to open TODO.tasks of the project.

	* plugins/project-manager/plugin.c: Updates project UI
	sensitive/insensitive.

	* src/Makefile.am, src/shell.[c,h], src/anjuta-shell.ui: Added
	anjuta-shell program to test plugins.

	* src/anjuta-app.c: Registered UI accels.
parent 86a892f7
2004-10-06 Naba Kumar <naba@gnome.org>
* libanjuta/plugins.c: Shows plugins in a nicer dialog.
* libanjuta/interfaces/libanjuta.idl,
plugins/editor/text_editor.c: Added get_length()
and get_current_word() methods in IAnjutaEditor interface.
* libegg/Makefile.am: Added test_actions target.
* libegg/egg-combo-action.c: Fixed combo-action and made it usable.
* plugins/build-basic-autotools/build-basic-autotools.c,
plugins/file-loader/plugin.c,
plugins/message-view/message-view.c: Added code to go to file and
line number,
* plugins/devhelp/plugin.c: Context sensitive help now works.
* plugins/editor/anjuta-docman.c: Reads the fragment id from file
uri as line number and goes to that line number.
* plugins/gtodo/interface.c, plugins/gtodo/libgtodo.c,
plugins/gtodo/plugin.c: Creates a default gtodo client and implemented
gtodo_client_load() method to load from a diffrent file. Watched
project root directory in plugin to open TODO.tasks of the project.
* plugins/project-manager/plugin.c: Updates project UI
sensitive/insensitive.
* src/Makefile.am, src/shell.[c,h], src/anjuta-shell.ui: Added
anjuta-shell program to test plugins.
* src/anjuta-app.c: Registered UI accels.
2004-09-28 Naba Kumar <naba@gnome.org>
* libanjuta/anjuta-shell.[c,h]: Added anjuta_shell_present_widget()
......
......@@ -353,13 +353,15 @@ interface IAnjutaEditor
DOESNT_EXIST
}
void insert (int position, const gchar *text, gint length);
void goto_line (gint lineno);
void goto_position (gint position);
gchar* get_selection ();
gchar* get_text (gint start, gint end);
gchar* get_attributes (gint start, gint end);
gint get_position ();
void insert (int position, const gchar *text, gint length);
gint get_length ();
gchar* get_current_word ();
}
interface IAnjutaDocumentManager
......
......@@ -53,8 +53,10 @@ typedef struct {
enum {
COL_ENABLED,
COL_ICON,
COL_NAME,
COL_TOOL
COL_TOOL,
N_COLS
};
static GList *plugin_dirs = NULL;
......@@ -768,6 +770,7 @@ plugin_toggled (GtkCellRendererToggle *cell, char *path_str, gpointer data)
gtk_tree_path_free (path);
}
#if 0
static void
selection_changed (GtkTreeSelection *selection, GtkListStore *store)
{
......@@ -796,6 +799,7 @@ selection_changed (GtkTreeSelection *selection, GtkListStore *store)
}
}
}
#endif
static GtkWidget *
create_plugin_tree (void)
......@@ -805,28 +809,39 @@ create_plugin_tree (void)
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
store = gtk_list_store_new (3,
G_TYPE_BOOLEAN,
G_TYPE_STRING,
G_TYPE_POINTER);
store = gtk_list_store_new (N_COLS,
G_TYPE_BOOLEAN,
GDK_TYPE_PIXBUF,
G_TYPE_STRING,
G_TYPE_POINTER);
tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (renderer), "toggled",
G_CALLBACK (plugin_toggled), store);
column = gtk_tree_view_column_new_with_attributes (_("Load"),
renderer,
"active",
COL_ENABLED, NULL);
renderer,
"active",
COL_ENABLED, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
gtk_tree_view_column_set_sizing (column,
GTK_TREE_VIEW_COLUMN_AUTOSIZE);
column = gtk_tree_view_column_new ();
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_add_attribute (column, renderer, "pixbuf",
COL_ICON);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Plugin"),
renderer,
"text",
COL_NAME, NULL);
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_add_attribute (column, renderer, "markup",
COL_NAME);
gtk_tree_view_column_set_sizing (column,
GTK_TREE_VIEW_COLUMN_AUTOSIZE);
gtk_tree_view_column_set_title (column, _("Available Plugins"));
gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
gtk_tree_view_set_expander_column (GTK_TREE_VIEW (tree), column);
g_object_unref (store);
return tree;
}
......@@ -838,7 +853,6 @@ populate_plugin_model (GtkListStore *store,
{
GSList *l;
for (l = available_tools; l != NULL; l = l->next) {
GtkTreeIter iter;
AvailableTool *tool = l->data;
/* If tools to show is NULL, show all available tools */
......@@ -849,13 +863,32 @@ populate_plugin_model (GtkListStore *store,
if (g_hash_table_lookup (installed_tools, tool))
enable = TRUE;
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COL_ENABLED,
enable,
COL_NAME, tool->name,
COL_TOOL, tool,
-1);
if (tool->name && tool->description)
{
GtkTreeIter iter;
gchar *text;
text = g_markup_printf_escaped ("<span size=\"larger\" weight=\"bold\">%s</span>\n%s", tool->name, tool->about);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COL_ENABLED,
enable,
COL_NAME, text,
COL_TOOL, tool,
-1);
if (tool->icon_path) {
GdkPixbuf *icon;
icon = gdk_pixbuf_new_from_file_at_size (tool->icon_path,
48, 48, NULL);
if (icon) {
gtk_list_store_set (store, &iter,
COL_ICON, icon, -1);
gdk_pixbuf_unref (icon);
}
}
g_free (text);
}
}
}
}
......@@ -864,80 +897,41 @@ static GtkWidget *
create_plugin_page (AnjutaShell *shell)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *image;
GtkWidget *label;
GtkWidget *tree;
GtkWidget *frame;
GtkWidget *text;
GtkWidget *scrolled;
GtkListStore *store;
GtkTreeSelection *selection;
GHashTable *installed_tools;
vbox = gtk_vbox_new (FALSE, 0);
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
image = anjuta_res_get_image ("plugins.png");
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 3);
label = gtk_label_new (_("This dialog displays all the available plugins for Anjuta. You can select which plugins you want to use by clicking on the plugin in the list."));
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 3);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_IN);
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
scrolled, TRUE, TRUE, 3);
tree = create_plugin_tree ();
store = GTK_LIST_STORE(gtk_tree_view_get_model (GTK_TREE_VIEW (tree)));
store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (tree)));
installed_tools = g_object_get_data (G_OBJECT(shell), "InstalledTools");
/* FIXME: This should be moved to a proper location */
if (!installed_tools)
{
installed_tools = g_hash_table_new (g_str_hash, g_str_equal);
g_object_set_data (G_OBJECT (shell), "InstalledTools",
installed_tools);
}
populate_plugin_model (GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (tree))),
NULL, installed_tools);
gtk_container_add (GTK_CONTAINER (scrolled), tree);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
hbox = gtk_hbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (vbox),
hbox, TRUE, TRUE, 3);
frame = gtk_frame_new ("About");
gtk_box_pack_start (GTK_BOX (hbox),
frame, TRUE, TRUE, 3);
gtk_container_add (GTK_CONTAINER (frame), scrolled);
text = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (scrolled), text);
g_object_set_data (G_OBJECT (store), "AboutText", text);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 3);
image = gtk_image_new ();
gtk_container_add (GTK_CONTAINER (frame), image);
g_object_set_data (G_OBJECT (store), "Icon", image);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
g_signal_connect (G_OBJECT (selection), "changed",
G_CALLBACK (selection_changed), store);
g_object_set_data (G_OBJECT (store), "Shell", shell);
gtk_widget_show_all (vbox);
gtk_widget_hide (image);
return vbox;
}
......@@ -1220,9 +1214,8 @@ anjuta_plugins_select (AnjutaShell *shell, gchar *title, gchar *description,
GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
gtk_widget_show (dlg);
gtk_widget_set_size_request (dlg, 400, 300);
gtk_window_set_default_size (GTK_WINDOW (dlg), 600, 500);
gtk_window_set_default_size (GTK_WINDOW (dlg), 400, 300);
label = gtk_label_new (description);
gtk_widget_show (label);
......
......@@ -50,7 +50,8 @@ libanjuta_egg_la_SOURCES = \
noinst_PROGRAMS = \
test-tree-utils \
test-multi-drag \
test-union
test-union \
test-actions
test_tree_utils_SOURCES = test-tree-utils.c
test_tree_utils_LDADD = libanjuta-egg.la $(ANJUTA_LIBS)
......@@ -64,6 +65,10 @@ test_union_SOURCES = test-union.c
test_union_LDADD = libanjuta-egg.la $(ANJUTA_LIBS)
test_union_DEPENDENCIES = libanjuta-egg.la
test_actions_SOURCES = test-actions.c
test_actions_LDADD = libanjuta-egg.la $(ANJUTA_LIBS)
test_actions_DEPENDENCIES = libanjuta-egg.la
EXTRA_DIST = \
eggmarshalers.list \
layout.glade
#include <gtk/gtkwidget.h>
#include <gtk/gtkentry.h>
// #include <libegg/toolbar/eggtoolitem.h>
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* egg-combo-action widget
*
* Copyright (C) 2001 Naba Kumar <kh_naba@yahoo.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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gtk/gtkwidget.h>
#include "egg-combo-action.h"
#ifndef _
# define _(s) (s)
#endif
struct _EggComboActionPriv
{
GtkTreeModel *model;
GtkTreeIter *active_iter;
gint width;
};
enum {
PROP_0,
PROP_MODEL,
PROP_WIDTH
};
static void egg_combo_action_init (EggComboAction *action);
static void egg_combo_action_class_init (EggComboActionClass *class);
static GtkWidget * create_tool_item (GtkAction *action);
static void connect_proxy (GtkAction *action,
GtkWidget *proxy);
static void disconnect_proxy (GtkAction *action,
GtkWidget *proxy);
static void egg_combo_action_finalize (GObject *object);
static void egg_combo_action_despose (GObject *object);
static void egg_combo_action_update (EggComboAction *combo);
static void egg_combo_action_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void egg_combo_action_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void on_change (GtkComboBox *combo, EggComboAction *action);
static GObjectClass *parent_class = NULL;
GType
egg_combo_action_get_type (void)
{
......@@ -32,22 +83,13 @@ egg_combo_action_get_type (void)
(GInstanceInitFunc) egg_combo_action_init,
};
type = g_type_register_static (EGG_TYPE_ENTRY_ACTION,
type = g_type_register_static (GTK_TYPE_ACTION,
"EggComboAction",
&type_info, 0);
}
return type;
}
static GtkWidget * create_tool_item (GtkAction *action);
static void connect_proxy (GtkAction *action,
GtkWidget *proxy);
static void disconnect_proxy (GtkAction *action,
GtkWidget *proxy);
static void egg_combo_action_finalize (GObject *object);
static GObjectClass *parent_class = NULL;
static void
egg_combo_action_class_init (EggComboActionClass *class)
{
......@@ -59,43 +101,164 @@ egg_combo_action_class_init (EggComboActionClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->finalize = egg_combo_action_finalize;
//action_class->activate = egg_combo_action_activate;
object_class->finalize = egg_combo_action_despose;
object_class->set_property = egg_combo_action_set_property;
object_class->get_property = egg_combo_action_get_property;
action_class->connect_proxy = connect_proxy;
action_class->disconnect_proxy = disconnect_proxy;
action_class->menu_item_type = GTK_TYPE_CHECK_MENU_ITEM;
action_class->toolbar_item_type = GTK_TYPE_TOOL_ITEM;
action_class->create_tool_item = create_tool_item;
g_object_class_install_property (object_class,
PROP_MODEL,
g_param_spec_pointer ("model",
_("Model"),
_("Model for the combo box"),
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
PROP_WIDTH,
g_param_spec_int ("width",
_("Width"),
_("Width of the entry."),
5, 500, 100,
G_PARAM_READWRITE));
}
static void
egg_combo_action_init (EggComboAction *action)
{
/* action->list = NULL; */
action->priv = g_new0 (EggComboActionPriv, 1);
action->priv->model = NULL;
action->priv->active_iter = NULL;
action->priv->width = 100;
}
static void
egg_combo_action_finalize (GObject *object)
egg_combo_action_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
/*
GList *node;
EggComboAction *combo_action;
EggComboAction *action;
action = EGG_COMBO_ACTION (object);
switch (prop_id)
{
case PROP_MODEL:
egg_combo_action_set_model (action,
GTK_TREE_MODEL (g_value_get_pointer (value)));
break;
case PROP_WIDTH:
action->priv->width = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
egg_combo_action_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
EggComboAction *action;
g_return_if_fail (EGG_IS_ENTRY_ACTION (object));
combo_action = EGG_COMBO_ACTION (object);
action = EGG_COMBO_ACTION (object);
node = combo_action->list;
while (node)
switch (prop_id)
{
g_free (node->data);
node = g_list_next (node);
case PROP_MODEL:
g_value_set_pointer (value, action->priv->model);
break;
case PROP_WIDTH:
g_value_set_int (value, action->priv->width);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
g_list_free (combo_action->list);
combo_action->list = NULL;
if (parent_class->finalize)
(* parent_class->finalize) (object);
*/
}
void static
egg_combo_action_update (EggComboAction *action)
{
GSList *slist;
for (slist = gtk_action_get_proxies (GTK_ACTION (action));
slist; slist = slist->next)
{
GtkWidget *proxy = slist->data;
gtk_action_block_activate_from (GTK_ACTION (action), proxy);
if (GTK_IS_TOOL_ITEM (proxy))
{
GtkWidget *combo;
combo = gtk_bin_get_child (GTK_BIN (proxy));
if (GTK_IS_COMBO_BOX (combo))
{
g_signal_handlers_block_by_func (combo,
G_CALLBACK (on_change),
action);
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo),
action->priv->active_iter);
g_signal_handlers_unblock_by_func (combo,
G_CALLBACK (on_change),
action);
}
else
{
g_warning ("Don't know how to change `%s' widgets",
G_OBJECT_TYPE_NAME (proxy));
}
}
else
{
g_warning ("Don't know how to change `%s' widgets",
G_OBJECT_TYPE_NAME (proxy));
}
gtk_action_unblock_activate_from (GTK_ACTION (action), proxy);
}
}
static void
egg_combo_action_finalize (GObject *object)
{
EggComboActionPriv *priv;
priv = EGG_COMBO_ACTION (object)->priv;
if (priv->model)
g_object_unref (priv->model);
priv->model = NULL;
if (parent_class->finalize)
(* parent_class->finalize) (object);
}
static void
egg_combo_action_despose (GObject *object)
{
if (EGG_COMBO_ACTION (object)->priv->active_iter)
gtk_tree_iter_free (EGG_COMBO_ACTION (object)->priv->active_iter);
g_free (EGG_COMBO_ACTION (object)->priv);
if (parent_class->dispose)
(* parent_class->dispose) (object);
}
static void
on_change (GtkComboBox *combo, EggComboAction *action)
{
GtkTreeIter iter;
if (action->priv->active_iter)
gtk_tree_iter_free (action->priv->active_iter);
gtk_combo_box_get_active_iter (combo, &iter);
action->priv->active_iter = gtk_tree_iter_copy (&iter);
egg_combo_action_update (action);
gtk_action_activate (GTK_ACTION (action));
}
static GtkWidget *
......@@ -103,14 +266,34 @@ create_tool_item (GtkAction *action)
{
GtkToolItem *item;
GtkWidget *combo;
GtkCellRenderer *renderer;
g_return_val_if_fail (EGG_IS_COMBO_ACTION (action), NULL);
g_message ("Creating combo toolitem");
item = gtk_tool_item_new ();
combo = gtk_combo_new();
gtk_widget_set_size_request (combo, EGG_ENTRY_ACTION (action)->width, -1);
gtk_widget_show(combo);
combo = gtk_combo_box_new ();
gtk_widget_show (combo);
if (EGG_COMBO_ACTION (action)->priv->model)
gtk_combo_box_set_model (GTK_COMBO_BOX (combo),
EGG_COMBO_ACTION (action)->priv->model);
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo),
renderer, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
renderer,
"pixbuf", 0,
NULL);
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo),
renderer, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
renderer,
"text", 1,
NULL);
gtk_container_add (GTK_CONTAINER (item), combo);
gtk_widget_show(GTK_WIDGET (item));
return GTK_WIDGET (item);
}
......@@ -129,12 +312,16 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
{
GtkWidget *combo;
combo = gtk_bin_get_child (GTK_BIN (proxy));
if (GTK_IS_COMBO (combo))
{
(* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action,
GTK_COMBO(combo)->entry);
}
if (GTK_IS_COMBO_BOX (combo))
{
if (EGG_COMBO_ACTION (action)->priv->model)
gtk_combo_box_set_model (GTK_COMBO_BOX (combo),
EGG_COMBO_ACTION (action)->priv->model);
g_signal_connect (G_OBJECT (combo), "changed",
G_CALLBACK (on_change), action);
}
}
(* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy);
}
static void
......@@ -149,26 +336,33 @@ disconnect_proxy (GtkAction *action, GtkWidget *proxy)
GtkWidget *combo;
combo = gtk_bin_get_child (GTK_BIN (proxy));
if (GTK_IS_COMBO (combo))
{
(* GTK_ACTION_CLASS (parent_class)->disconnect_proxy) (action,
GTK_COMBO(combo)->entry);
}
{
g_signal_connect (combo, "changed",
G_CALLBACK (on_change), action);
}
}
(* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy);
}
/**
* egg_combo_action_set_popdown_strings:
* egg_combo_action_set_model:
* @action: the action object
* @text: List of Text to set in the combo
* @model: a GtkTreeModel
*
* Sets a list of strings in the action.
* Sets a model in the action.
*/
void
egg_combo_action_set_popdown_strings (EggComboAction *action, GList *strs)
egg_combo_action_set_model (EggComboAction *action, GtkTreeModel *model)
{
GSList *slist;
g_return_if_fail (EGG_IS_ENTRY_ACTION (action));
g_return_if_fail (EGG_IS_COMBO_ACTION (action));
if (action->priv->model) {
g_object_unref (action->priv->model);
}
g_object_ref (model);
action->priv->model = model;
for (slist = gtk_action_get_proxies (GTK_ACTION(action));
slist; slist = slist->next)
......@@ -177,32 +371,35 @@ egg_combo_action_set_popdown_strings (EggComboAction *action, GList *strs)
gtk_action_block_activate_from (GTK_ACTION (action), proxy);
if (GTK_IS_CHECK_MENU_ITEM (proxy))
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (proxy),
TRUE);
else if (GTK_IS_TOOL_ITEM (proxy))
{
GtkWidget *combo;
combo = gtk_bin_get_child (GTK_BIN (proxy));
if (GTK_IS_COMBO (combo))
{
//g_signal_handlers_block_by_func (entry,
// G_CALLBACK (entry_changed),
// action);
gtk_combo_set_popdown_strings (GTK_COMBO (combo), strs);
//g_signal_handlers_unblock_by_func (entry,
// G_CALLBACK (entry_changed),
// action);
}
else
{
g_warning ("Don't know how to set popdown for `%s' widgets",
G_OBJECT_TYPE_NAME (proxy));
}
}
else {
g_warning ("Don't know how to set popdown for `%s' widgets",
G_OBJECT_TYPE_NAME (proxy));
{
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (proxy),
TRUE);
}
else if (GTK_IS_TOOL_ITEM (proxy))
{
GtkWidget *combo;
combo = gtk_bin_get_child (GTK_BIN (proxy));
if (GTK_IS_COMBO (combo))
{
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), model);
}
else