Updated Spanish translation
[anjuta-git-plugin.git] / plugins / glade / plugin.c
blob2323f2a02872c0a024d8380d3e4a2986916b63e7
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 plugin.c
4 Copyright (C) 2000 Naba Kumar
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <config.h>
23 #include <libgnomevfs/gnome-vfs-utils.h>
24 #include <libanjuta/anjuta-shell.h>
25 #include <libanjuta/anjuta-debug.h>
26 #include <libanjuta/interfaces/ianjuta-file.h>
27 #include <libanjuta/interfaces/ianjuta-file-savable.h>
28 #include <libanjuta/interfaces/ianjuta-wizard.h>
29 #include <libanjuta/interfaces/ianjuta-help.h>
30 #include <libanjuta/interfaces/ianjuta-document-manager.h>
32 #include "plugin.h"
33 #include "anjuta-design-document.h"
35 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-glade.ui"
37 static gpointer parent_class;
39 /* This is variable required from libdevhelp */
40 gchar *geometry = NULL;
42 struct _GladePluginPriv
44 gint uiid;
45 GtkActionGroup *action_group;
46 GladeApp *gpw;
47 GtkWidget *inspector;
48 GtkWidget *view_box;
49 GtkWidget *projects_combo;
50 gint editor_watch_id;
51 gboolean destroying;
54 enum {
55 NAME_COL,
56 PROJECT_COL,
57 N_COLUMNS
60 static void
61 value_added_current_editor (AnjutaPlugin *plugin, const char *name,
62 const GValue *value, gpointer data)
64 GladePlugin* glade_plugin = ANJUTA_PLUGIN_GLADE(plugin);
65 GObject *editor;
66 editor = g_value_get_object (value);
67 if (ANJUTA_IS_DESIGN_DOCUMENT(editor))
69 AnjutaDesignDocument* view = ANJUTA_DESIGN_DOCUMENT(editor);
70 GladeProject* project = glade_design_view_get_project(GLADE_DESIGN_VIEW(view));
71 /* Update current project */
72 GtkTreeIter iter;
73 GtkTreeModel* model =
74 gtk_combo_box_get_model (GTK_COMBO_BOX (glade_plugin->priv->projects_combo));
75 if (gtk_tree_model_get_iter_first (model, &iter))
79 GladeProject *cur_project;
80 gtk_tree_model_get (model, &iter, PROJECT_COL, &cur_project, -1);
81 if (project == cur_project)
83 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (glade_plugin->priv->projects_combo), &iter);
84 glade_app_set_project(project);
85 break;
88 while (gtk_tree_model_iter_next (model, &iter));
93 static void
94 value_removed_current_editor (AnjutaPlugin *plugin,
95 const char *name, gpointer data)
100 static void
101 glade_update_ui (GladeApp *app, GladePlugin *plugin)
103 GtkTreeModel *model;
104 GtkTreeIter iter;;
105 IAnjutaDocument* doc;
106 IAnjutaDocumentManager* docman =
107 anjuta_shell_get_interface(ANJUTA_PLUGIN(plugin)->shell,
108 IAnjutaDocumentManager, NULL);
110 /* Update current project */
111 model = gtk_combo_box_get_model (GTK_COMBO_BOX (plugin->priv->projects_combo));
112 if (gtk_tree_model_get_iter_first (model, &iter))
116 GladeProject *project;
117 gtk_tree_model_get (model, &iter, PROJECT_COL, &project, -1);
118 if (project == glade_app_get_project ())
120 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (plugin->priv->projects_combo), &iter);
121 break;
124 while (gtk_tree_model_iter_next (model, &iter));
126 /* Emit IAnjutaDocument signal */
127 doc = ianjuta_document_manager_get_current_document(docman, NULL);
128 if (doc && ANJUTA_IS_DESIGN_DOCUMENT(doc))
130 gboolean dirty = ianjuta_file_savable_is_dirty(IANJUTA_FILE_SAVABLE(doc), NULL);
131 g_signal_emit_by_name (G_OBJECT(doc), "update_ui");
132 g_signal_emit_by_name (G_OBJECT(doc), "save_point", !dirty);
137 static void
138 on_api_help (GladeEditor* editor,
139 const gchar* book,
140 const gchar* page,
141 const gchar* search,
142 GladePlugin* plugin)
144 gchar *book_comm = NULL, *page_comm = NULL;
145 gchar *string;
147 AnjutaPlugin* aplugin = ANJUTA_PLUGIN(plugin);
148 AnjutaShell* shell = aplugin->shell;
149 IAnjutaHelp* help;
151 help = anjuta_shell_get_interface(shell, IAnjutaHelp, NULL);
153 /* No API Help Plugin */
154 if (help == NULL)
155 return;
157 if (book) book_comm = g_strdup_printf ("book:%s ", book);
158 if (page) page_comm = g_strdup_printf ("page:%s ", page);
160 string = g_strdup_printf ("%s%s%s",
161 book_comm ? book_comm : "",
162 page_comm ? page_comm : "",
163 search ? search : "");
165 ianjuta_help_search(help, string, NULL);
167 g_free (string);
170 static void
171 glade_do_close (GladePlugin *plugin, GladeProject *project)
173 glade_app_remove_project (project);
176 static void
177 on_close_activated (GtkWidget* document, GladePlugin *plugin)
179 GladeProject *project;
180 GtkTreeModel *model;
181 GtkTreeIter iter;
183 DEBUG_PRINT(__FUNCTION__);
185 if (plugin->priv->destroying)
187 return;
190 project = glade_design_view_get_project(GLADE_DESIGN_VIEW(document));
192 if (!project)
194 return;
197 /* Remove project from our list */
198 model = gtk_combo_box_get_model (GTK_COMBO_BOX (plugin->priv->projects_combo));
199 if (gtk_tree_model_get_iter_first (model, &iter))
203 GladeProject *project_node;
205 gtk_tree_model_get (model, &iter, PROJECT_COL, &project_node, -1);
206 if (project == project_node)
208 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
209 break;
212 while (gtk_tree_model_iter_next (model, &iter));
214 glade_do_close (plugin, project);
216 if (gtk_tree_model_iter_n_children (model, NULL) <= 0)
217 anjuta_plugin_deactivate (ANJUTA_PLUGIN (plugin));
219 DEBUG_PRINT(__FUNCTION__);
222 static void
223 on_shell_destroy (AnjutaShell* shell, GladePlugin *glade_plugin)
225 glade_plugin->priv->destroying = TRUE;
228 static void
229 on_glade_project_changed (GtkComboBox *combo, GladePlugin *plugin)
231 GtkTreeModel *model;
232 GtkTreeIter iter;
233 IAnjutaDocumentManager* docman =
234 anjuta_shell_get_interface(ANJUTA_PLUGIN(plugin)->shell,
235 IAnjutaDocumentManager, NULL);
237 model = gtk_combo_box_get_model (GTK_COMBO_BOX (plugin->priv->projects_combo));
238 if (gtk_combo_box_get_active_iter (combo, &iter))
240 GladeProject *project;
242 GtkWidget *design_view;
243 gtk_tree_model_get (model, &iter, PROJECT_COL, &project, -1);
244 glade_app_set_project (project);
246 design_view = g_object_get_data (G_OBJECT (project), "design_view");
247 ianjuta_document_manager_set_current_document(docman, IANJUTA_DOCUMENT(design_view), NULL);
249 # if (GLADEUI_VERSION >= 330)
250 glade_inspector_set_project (GLADE_INSPECTOR (plugin->priv->inspector), project);
251 # endif
256 static void
257 register_stock_icons (AnjutaPlugin *plugin)
259 static gboolean registered = FALSE;
261 if (registered)
262 return;
263 registered = TRUE;
265 /* Register stock icons */
266 BEGIN_REGISTER_ICON (plugin);
267 REGISTER_ICON (PACKAGE_PIXMAPS_DIR"/anjuta-glade-plugin.png",
268 "glade-plugin-icon");
269 END_REGISTER_ICON;
272 static void
273 on_session_save (AnjutaShell *shell, AnjutaSessionPhase phase,
274 AnjutaSession *session, GladePlugin *plugin)
276 GList *files;
277 GtkTreeModel *model;
278 GtkTreeIter iter;
280 if (phase != ANJUTA_SESSION_PHASE_NORMAL)
281 return;
283 files = anjuta_session_get_string_list (session, "File Loader", "Files");
284 files = g_list_reverse (files);
286 model = gtk_combo_box_get_model (GTK_COMBO_BOX (plugin->priv->projects_combo));
287 if (gtk_tree_model_get_iter_first (model, &iter))
291 gchar *uri;
292 GladeProject *project;
293 gtk_tree_model_get (model, &iter, PROJECT_COL, &project, -1);
294 #if (GLADEUI_VERSION >= 330)
295 if (glade_project_get_path(project))
296 #else
297 if (project->path)
298 #endif
300 #if (GLADEUI_VERSION >= 330)
301 uri = gnome_vfs_get_uri_from_local_path
302 (glade_project_get_path(project));
303 #else
304 uri = gnome_vfs_get_uri_from_local_path (project->path);
305 #endif
306 if (uri)
307 files = g_list_prepend (files, uri);
308 /* URI is not freed here */
311 while (gtk_tree_model_iter_next (model, &iter));
313 files = g_list_reverse (files);
314 anjuta_session_set_string_list (session, "File Loader", "Files", files);
315 g_list_foreach (files, (GFunc)g_free, NULL);
316 g_list_free (files);
319 static void
320 glade_plugin_add_project (GladePlugin *glade_plugin, GladeProject *project)
322 GtkWidget *view;
323 GladePluginPriv *priv;
324 IAnjutaDocumentManager* docman =
325 anjuta_shell_get_interface(ANJUTA_PLUGIN(glade_plugin)->shell,
326 IAnjutaDocumentManager, NULL);
328 g_return_if_fail (GLADE_IS_PROJECT (project));
330 priv = glade_plugin->priv;
331 view = anjuta_design_document_new(glade_plugin, project);
332 g_signal_connect(G_OBJECT(view), "destroy", G_CALLBACK(on_close_activated), glade_plugin);
333 gtk_widget_show (view);
334 g_object_set_data (G_OBJECT (project), "design_view", view);
335 glade_app_add_project (project);
337 ianjuta_document_manager_add_document(docman, IANJUTA_DOCUMENT(view), NULL);
340 #if (GLADEUI_VERSION >= 330)
341 static void
342 inspector_item_activated_cb (GladeInspector *inspector,
343 AnjutaPlugin *plugin)
345 GList *item = glade_inspector_get_selected_items (inspector);
346 g_assert (GLADE_IS_WIDGET (item->data) && (item->next == NULL));
348 /* switch to this widget in the workspace */
349 glade_widget_show (GLADE_WIDGET (item->data));
351 g_list_free (item);
353 #endif
355 static gboolean
356 activate_plugin (AnjutaPlugin *plugin)
358 AnjutaUI *ui;
359 GladePlugin *glade_plugin;
360 GladePluginPriv *priv;
361 // GtkAction *action;
362 GtkListStore *store;
363 GtkCellRenderer *renderer;
365 DEBUG_PRINT ("GladePlugin: Activating Glade plugin...");
367 glade_plugin = ANJUTA_PLUGIN_GLADE (plugin);
369 ui = anjuta_shell_get_ui (plugin->shell, NULL);
370 priv = glade_plugin->priv;
372 register_stock_icons (plugin);
374 if (!priv->gpw)
376 priv->gpw = g_object_new(GLADE_TYPE_APP, NULL);
378 glade_app_set_window (GTK_WIDGET (ANJUTA_PLUGIN(plugin)->shell));
379 glade_app_set_transient_parent (GTK_WINDOW (ANJUTA_PLUGIN(plugin)->shell));
381 /* Create a view for us */
382 priv->view_box = gtk_vbox_new (FALSE, 0);
383 store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING,
384 G_TYPE_POINTER, NULL);
386 priv->projects_combo = gtk_combo_box_new ();
387 renderer = gtk_cell_renderer_text_new ();
388 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->projects_combo),
389 renderer, TRUE);
390 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->projects_combo),
391 renderer, "text", NAME_COL, NULL);
392 gtk_combo_box_set_model (GTK_COMBO_BOX (priv->projects_combo),
393 GTK_TREE_MODEL (store));
394 g_object_unref (G_OBJECT (store));
395 gtk_box_pack_start (GTK_BOX (priv->view_box), priv->projects_combo,
396 FALSE, FALSE, 0);
398 #if (GLADEUI_VERSION >= 330)
399 priv->inspector = glade_inspector_new ();
401 g_signal_connect (priv->inspector, "item-activated",
402 G_CALLBACK (inspector_item_activated_cb),
403 plugin);
404 #else
405 priv->inspector = glade_project_view_new ();
406 #endif
408 #if (GLADEUI_VERSION < 330)
409 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->inspector),
410 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
412 glade_app_add_project_view (GLADE_PROJECT_VIEW (priv->inspector));
413 #endif
414 gtk_box_pack_start (GTK_BOX (priv->view_box), GTK_WIDGET (priv->inspector),
415 TRUE, TRUE, 0);
417 gtk_widget_show_all (priv->view_box);
418 gtk_notebook_set_scrollable (GTK_NOTEBOOK (glade_app_get_editor ()->notebook),
419 TRUE);
420 gtk_notebook_popup_enable (GTK_NOTEBOOK (glade_app_get_editor ()->notebook));
423 g_signal_connect(G_OBJECT(plugin->shell), "destroy",
424 G_CALLBACK(on_shell_destroy), plugin);
426 g_signal_connect (G_OBJECT (priv->projects_combo), "changed",
427 G_CALLBACK (on_glade_project_changed), plugin);
428 g_signal_connect (G_OBJECT (priv->gpw), "update-ui",
429 G_CALLBACK (glade_update_ui), plugin);
431 g_signal_connect(G_OBJECT(glade_app_get_editor()), "gtk-doc-search",
432 G_CALLBACK(on_api_help), plugin);
434 /* FIXME: Glade doesn't want to die these widget, so
435 * hold a permenent refs on them
437 g_object_ref (glade_app_get_palette ());
438 g_object_ref (glade_app_get_editor ());
439 g_object_ref (priv->view_box);
441 gtk_widget_show (GTK_WIDGET (glade_app_get_palette ()));
442 gtk_widget_show (GTK_WIDGET (glade_app_get_editor ()));
444 /* Add widgets */
445 anjuta_shell_add_widget (ANJUTA_PLUGIN (plugin)->shell,
446 GTK_WIDGET (priv->view_box),
447 "AnjutaGladeTree", _("Widgets"),
448 "glade-plugin-icon",
449 ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
450 anjuta_shell_add_widget (ANJUTA_PLUGIN (plugin)->shell,
451 GTK_WIDGET (glade_app_get_palette ()),
452 "AnjutaGladePalette", _("Palette"),
453 "glade-plugin-icon",
454 ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
455 anjuta_shell_add_widget (ANJUTA_PLUGIN (plugin)->shell,
456 GTK_WIDGET (glade_app_get_editor ()),
457 "AnjutaGladeEditor", _("Properties"),
458 "glade-plugin-icon",
459 ANJUTA_SHELL_PLACEMENT_CENTER, NULL);
460 /* Connect to save session */
461 g_signal_connect (G_OBJECT (plugin->shell), "save_session",
462 G_CALLBACK (on_session_save), plugin);
464 /* Watch documents */
465 glade_plugin->priv->editor_watch_id =
466 anjuta_plugin_add_watch (plugin, "document_manager_current_editor",
467 value_added_current_editor,
468 value_removed_current_editor, NULL);
470 return TRUE;
473 static gboolean
474 deactivate_plugin (AnjutaPlugin *plugin)
476 GladePluginPriv *priv;
478 priv = ANJUTA_PLUGIN_GLADE (plugin)->priv;
480 DEBUG_PRINT ("GladePlugin: Dectivating Glade plugin...");
482 /* Disconnect signals */
483 g_signal_handlers_disconnect_by_func (G_OBJECT (plugin->shell),
484 G_CALLBACK (on_shell_destroy),
485 plugin);
487 g_signal_handlers_disconnect_by_func (G_OBJECT (plugin->shell),
488 G_CALLBACK (on_session_save), plugin);
490 g_signal_handlers_disconnect_by_func (G_OBJECT (priv->projects_combo),
491 G_CALLBACK (on_glade_project_changed),
492 plugin);
493 g_signal_handlers_disconnect_by_func (G_OBJECT (priv->gpw),
494 G_CALLBACK (glade_update_ui),
495 plugin);
497 g_signal_handlers_disconnect_by_func (G_OBJECT(glade_app_get_editor()),
498 G_CALLBACK(on_api_help), plugin);
500 /* Remove widgets */
501 anjuta_shell_remove_widget (plugin->shell,
502 GTK_WIDGET (glade_app_get_palette ()),
503 NULL);
504 anjuta_shell_remove_widget (plugin->shell,
505 GTK_WIDGET (glade_app_get_editor ()),
506 NULL);
507 anjuta_shell_remove_widget (plugin->shell,
508 GTK_WIDGET (priv->view_box),
509 NULL);
510 /* FIXME: Don't destroy glade, since it doesn't want to */
511 /* g_object_unref (G_OBJECT (priv->gpw)); */
512 /* priv->gpw = NULL */
514 priv->uiid = 0;
515 priv->action_group = NULL;
516 priv->gpw = NULL;
518 return TRUE;
521 static void
522 glade_plugin_dispose (GObject *obj)
524 /* GladePlugin *plugin = ANJUTA_PLUGIN_GLADE (obj); */
526 /* FIXME: Glade widgets should be destroyed */
527 GNOME_CALL_PARENT (G_OBJECT_CLASS, dispose, (obj));
530 static void
531 glade_plugin_finalize (GObject *obj)
533 GladePlugin *plugin = ANJUTA_PLUGIN_GLADE (obj);
534 g_free (plugin->priv);
535 GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (obj));
538 static void
539 glade_plugin_instance_init (GObject *obj)
541 GladePluginPriv *priv;
542 GladePlugin *plugin = ANJUTA_PLUGIN_GLADE (obj);
544 plugin->priv = (GladePluginPriv *) g_new0 (GladePluginPriv, 1);
545 priv = plugin->priv;
546 priv->destroying = FALSE;
548 DEBUG_PRINT ("Intializing Glade plugin");
551 static void
552 glade_plugin_class_init (GObjectClass *klass)
554 AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass);
556 parent_class = g_type_class_peek_parent (klass);
558 plugin_class->activate = activate_plugin;
559 plugin_class->deactivate = deactivate_plugin;
560 klass->dispose = glade_plugin_dispose;
561 klass->dispose = glade_plugin_finalize;
564 gchar* glade_get_filename(GladePlugin *plugin)
566 #if (GLADEUI_VERSION >= 330)
567 return glade_project_get_name(glade_app_get_project());
568 #else
569 GladeProject* project = glade_app_get_project();
570 if (project)
571 return project->name;
572 else
573 return NULL;
574 #endif
577 static void
578 ifile_open (IAnjutaFile *ifile, const gchar *uri, GError **err)
580 GladePluginPriv *priv;
581 GladeProject *project;
582 GtkListStore *store;
583 GtkTreeIter iter;
584 gchar *filename;
585 IAnjutaDocumentManager* docman;
586 GList* docs;
587 GList* cur_doc;
589 g_return_if_fail (uri != NULL);
591 priv = ANJUTA_PLUGIN_GLADE (ifile)->priv;
593 filename = gnome_vfs_get_local_path_from_uri (uri);
594 if (!filename)
596 anjuta_util_dialog_warning (GTK_WINDOW (ANJUTA_PLUGIN (ifile)->shell),
597 _("Not local file: %s"), uri);
598 return;
601 docman = anjuta_shell_get_interface(ANJUTA_PLUGIN(ifile)->shell, IAnjutaDocumentManager,
602 NULL);
603 docs = ianjuta_document_manager_get_documents(docman, NULL);
604 for (cur_doc = docs; cur_doc != NULL; cur_doc = g_list_next(cur_doc))
606 if (ANJUTA_IS_DESIGN_DOCUMENT(cur_doc->data))
608 gchar *cur_uri;
609 cur_uri = ianjuta_file_get_uri (IANJUTA_FILE (cur_doc->data), NULL);
610 if (cur_uri)
612 DEBUG_PRINT("%s = %s", uri, cur_uri);
613 if (g_str_equal (uri, cur_uri))
615 ianjuta_document_manager_set_current_document (docman,
616 IANJUTA_DOCUMENT (cur_doc->data), NULL);
617 g_free (cur_uri);
618 return;
620 g_free (cur_uri);
625 #if (GLADEUI_VERSION >= 330)
626 project = glade_project_load (filename);
627 #else
628 project = glade_project_open (filename);
629 #endif
630 g_free (filename);
631 if (!project)
633 anjuta_util_dialog_warning (GTK_WINDOW (ANJUTA_PLUGIN (ifile)->shell),
634 _("Could not open: %s"), uri);
635 return;
637 store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->projects_combo)));
638 gtk_list_store_append (store, &iter);
639 #if (GLADEUI_VERSION >= 330)
640 gtk_list_store_set (store, &iter, NAME_COL, glade_project_get_name(project),
641 PROJECT_COL, project, -1);
642 #else
643 gtk_list_store_set (store, &iter, NAME_COL, project->name,
644 PROJECT_COL, project, -1);
645 #endif
646 glade_plugin_add_project (ANJUTA_PLUGIN_GLADE (ifile), project);
647 anjuta_shell_present_widget (ANJUTA_PLUGIN (ifile)->shell, priv->view_box, NULL);
650 static gchar*
651 ifile_get_uri (IAnjutaFile* file, GError** e)
653 #if (GLADEUI_VERSION >= 330)
654 const gchar* path = glade_project_get_path(glade_app_get_project());
655 if (path != NULL)
656 return gnome_vfs_get_uri_from_local_path(path);
657 else
658 return NULL;
659 #else
660 GladeProject* project = glade_app_get_project();
661 if (project && project->path)
662 return project->path;
663 else
664 return NULL;
665 #endif
668 static void
669 ifile_iface_init(IAnjutaFileIface *iface)
671 iface->open = ifile_open;
672 iface->get_uri = ifile_get_uri;
675 static void
676 iwizard_activate (IAnjutaWizard *iwizard, GError **err)
678 GladePluginPriv *priv;
679 GladeProject *project;
680 GtkListStore *store;
681 GtkTreeIter iter;
683 priv = ANJUTA_PLUGIN_GLADE (iwizard)->priv;
685 #if (GLADEUI_VERSION >= 330)
686 project = glade_project_new ();
687 #else
688 project = glade_project_new (TRUE);
689 #endif
690 if (!project)
692 anjuta_util_dialog_warning (GTK_WINDOW (ANJUTA_PLUGIN (iwizard)->shell),
693 _("Could not create a new glade project."));
694 return;
696 store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->projects_combo)));
697 gtk_list_store_append (store, &iter);
698 #if (GLADEUI_VERSION >= 330)
699 gtk_list_store_set (store, &iter, NAME_COL, glade_project_get_name(project),
700 PROJECT_COL, project, -1);
701 #else
702 gtk_list_store_set (store, &iter, NAME_COL, project->name,
703 PROJECT_COL, project, -1);
704 #endif
705 glade_plugin_add_project (ANJUTA_PLUGIN_GLADE (iwizard), project);
706 anjuta_shell_present_widget (ANJUTA_PLUGIN (iwizard)->shell,
707 GTK_WIDGET (glade_app_get_palette ()), NULL);
710 static void
711 iwizard_iface_init(IAnjutaWizardIface *iface)
713 iface->activate = iwizard_activate;
716 ANJUTA_PLUGIN_BEGIN (GladePlugin, glade_plugin);
717 ANJUTA_PLUGIN_ADD_INTERFACE (ifile, IANJUTA_TYPE_FILE);
718 ANJUTA_PLUGIN_ADD_INTERFACE (iwizard, IANJUTA_TYPE_WIZARD);
719 ANJUTA_PLUGIN_END;
721 ANJUTA_SIMPLE_PLUGIN (GladePlugin, glade_plugin);