Exemplo n.º 1
0
static gboolean
quick_open_plugin_activate(AnjutaPlugin *plugin)
{
    QuickOpenPlugin *self = ANJUTA_PLUGIN_QUICK_OPEN(plugin);

    AnjutaUI* ui;

    DEBUG_PRINT("%s", "Quick Open Plugin: Activating plugin…");

    /* Add actions */
    ui = anjuta_shell_get_ui(plugin->shell, NULL);
    self->action_group = anjuta_ui_add_action_group_entries(ui,
        "ActionsQuickOpen", _("Quick open operations"),
        actions_quick_open, G_N_ELEMENTS(actions_quick_open),
        GETTEXT_PACKAGE, TRUE, self);

    self->uiid = anjuta_ui_merge(ui, UI_FILE);


    /* Create the dialog. */
    self->dialog = quick_open_dialog_new();
    gtk_window_set_transient_for(GTK_WINDOW(self->dialog), GTK_WINDOW(plugin->shell));

    g_signal_connect(self->dialog, "delete-event",
        G_CALLBACK(gtk_widget_hide_on_delete), NULL);
    g_signal_connect(self->dialog, "response",
        G_CALLBACK(on_dialog_response), self);

    quick_open_plugin_setup_project_handling(self);
    quick_open_plugin_setup_document_handling(self);


    return TRUE;
}
Exemplo n.º 2
0
static gboolean activate_plugin(AnjutaPlugin *plugin) {
    AnjutaUI *ui;
    GtkActionGroup* action_group;

    info_display_plugin = (InfoDisplayPlugin*) plugin;
    ui = anjuta_shell_get_ui(plugin->shell, NULL);

    /* Add our info_actions */
    action_group
        = anjuta_ui_add_action_group_entries(ui, "ActionGroupInfoDisplay", _("Info Display"), info_actions, G_N_ELEMENTS (info_actions), GETTEXT_PACKAGE, TRUE, plugin);
    info_display_plugin->action_group = action_group;

    /* Merge UI */
    gchar *uipath = g_build_filename(get_ui_dir(), "info_display.ui", NULL);
    info_display_plugin->uiid = anjuta_ui_merge(ui, uipath);
    g_free(uipath);

    info_display_init();

    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_SELECTED, G_CALLBACK (info_display_playlist_selected_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_ADDED, G_CALLBACK (info_display_playlist_added_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_REMOVED, G_CALLBACK (info_display_playlist_removed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_TRACK_UPDATED, G_CALLBACK (info_display_track_updated_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_TRACK_REMOVED, G_CALLBACK (info_display_track_removed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_TRACKS_DISPLAYED, G_CALLBACK (info_display_tracks_displayed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_TRACKS_SELECTED, G_CALLBACK (info_display_tracks_selected_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_CHANGED, G_CALLBACK (info_display_itdb_changed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_SAVED, G_CALLBACK (info_display_itdb_changed_cb), NULL);

    return TRUE; /* FALSE if activation failed */
}
Exemplo n.º 3
0
static gboolean activate_plugin(AnjutaPlugin *plugin) {
    AnjutaUI *ui;
    GtkActionGroup* action_group;

    /* Prepare the icons for the playlist */
    register_icon_path(get_plugin_dir(), "sjcd");
    register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID);

    sjcd_plugin = (SJCDPlugin*) plugin;
    ui = anjuta_shell_get_ui(plugin->shell, NULL);

    /* Add actions */
    action_group
            = anjuta_ui_add_action_group_entries(ui, "ActionGroupSjCd", _("Sound Juicer"), sjcd_actions, G_N_ELEMENTS (sjcd_actions), GETTEXT_PACKAGE, TRUE, plugin);
    sjcd_plugin->action_group = action_group;

    /* Merge UI */
    gchar *uipath = g_build_filename(get_ui_dir(), "sjcd.ui", NULL);
    sjcd_plugin->uiid = anjuta_ui_merge(ui, uipath);
    g_free(uipath);

    sjcd_plugin->sj_view = sj_create_sound_juicer();
    gtk_widget_show_all(sjcd_plugin->sj_view);
    // Add widget directly as scrolling is handled internally by the widget
    anjuta_shell_add_widget(plugin->shell, sjcd_plugin->sj_view, "SJCDPlugin", _("  Sound Juicer"), NULL, ANJUTA_SHELL_PLACEMENT_TOP, NULL);


    return TRUE; /* FALSE if activation failed */
}
Exemplo n.º 4
0
static gboolean
activate_plugin (AnjutaPlugin * plugin)
{
	//AnjutaPreferences *prefs;
	AnjutaUI *ui;
	MacroPlugin *macro_plugin;

	DEBUG_PRINT ("%s", "MacroPlugin: Activating Macro plugin…");

	macro_plugin = ANJUTA_PLUGIN_MACRO (plugin);
	ui = anjuta_shell_get_ui (plugin->shell, NULL);

	/* Add all our actions */
	macro_plugin->action_group = 
		anjuta_ui_add_action_group_entries (ui, "ActionGroupMacro",
											_("Macro operations"),
											actions_macro,
											G_N_ELEMENTS (actions_macro),
											GETTEXT_PACKAGE, TRUE, plugin);
	macro_plugin->uiid = anjuta_ui_merge (ui, UI_FILE);

	macro_plugin->editor_watch_id =
		anjuta_plugin_add_watch (plugin,
					 IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT,
					 value_added_current_editor,
					 value_removed_current_editor, NULL);
					 
	macro_plugin->macro_db = macro_db_new();
	
	return TRUE;
}
Exemplo n.º 5
0
static gboolean activate_plugin(AnjutaPlugin *plugin) {
    AnjutaUI *ui;
    GtkActionGroup* action_group;

    photo_editor_plugin = (PhotoEditorPlugin*) plugin;

    register_icon_path(get_plugin_dir(), "photo_editor");
    register_stock_icon(DEFAULT_PHOTO_EDITOR_ICON, DEFAULT_PHOTO_EDITOR_STOCK_ID);
    register_stock_icon(PHOTO_TOOLBAR_ALBUM_ICON, PHOTO_TOOLBAR_ALBUM_STOCK_ID);
    register_stock_icon(PHOTO_TOOLBAR_PHOTOS_ICON, PHOTO_TOOLBAR_PHOTOS_STOCK_ID);

    ui = anjuta_shell_get_ui(plugin->shell, NULL);

    /* Add our playlist_actions */
    action_group
            = anjuta_ui_add_action_group_entries(ui, "ActionGroupPhotoEditor", _("Photo Editor"), photo_editor_actions, G_N_ELEMENTS (photo_editor_actions), GETTEXT_PACKAGE, TRUE, plugin);
    photo_editor_plugin->action_group = action_group;

    /* Merge UI */
    gchar *uipath = g_build_filename(get_ui_dir(), "photo_editor.ui", NULL);
    photo_editor_plugin->uiid = anjuta_ui_merge(ui, uipath);
    g_free(uipath);

    g_return_val_if_fail(PHOTO_EDITOR_IS_EDITOR(photo_editor_plugin), TRUE);

    gtkpod_register_photo_editor (PHOTO_EDITOR(photo_editor_plugin));

    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_SELECTED, G_CALLBACK (photo_editor_select_playlist_cb), NULL);

    return TRUE; /* FALSE if activation failed */
}
Exemplo n.º 6
0
static gboolean activate_plugin(AnjutaPlugin *plugin) {
    AnjutaUI *ui;
    ExternalPlayerPlugin *external_player_plugin;
    GtkActionGroup* action_group;

    /* Set preferences */
    set_default_preferences();

    external_player_plugin = (ExternalPlayerPlugin*) plugin;
    ui = anjuta_shell_get_ui(plugin->shell, NULL);

    /* Add our cover_actions */
    action_group
            = anjuta_ui_add_action_group_entries(ui, "ActionGroupExternalPlayer", _("External Player"), external_player_actions, G_N_ELEMENTS (external_player_actions), GETTEXT_PACKAGE, TRUE, plugin);
    external_player_plugin->action_group = action_group;

    /* Merge UI */
    gchar *uipath = g_build_filename(get_ui_dir(), "external_player.ui", NULL);
    external_player_plugin->uiid = anjuta_ui_merge(ui, uipath);
    g_free(uipath);

    gtkpod_register_track_command(TRACK_COMMAND(external_player_plugin));

    return TRUE; /* FALSE if activation failed */
}
Exemplo n.º 7
0
static gboolean activate_plugin(AnjutaPlugin *plugin) {
    AnjutaUI *ui;
    PlaylistDisplayPlugin *playlist_display_plugin;
    GtkActionGroup* action_group;
    GtkAction *new_playlist_action;
    GtkAction *load_ipods_action;

    /* Set preferences */
    set_default_preferences();

    /* Prepare the icons for the playlist */
    register_icon_path(get_plugin_dir(), "playlist_display");
    register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID);

    register_stock_icon("playlist_display-photo", PLAYLIST_DISPLAY_PHOTO_ICON_STOCK_ID);
    register_stock_icon("playlist_display-playlist", PLAYLIST_DISPLAY_PLAYLIST_ICON_STOCK_ID);
    register_stock_icon("playlist_display-read", PLAYLIST_DISPLAY_READ_ICON_STOCK_ID);
    register_stock_icon("playlist_display-add-dirs", PLAYLIST_DISPLAY_ADD_DIRS_ICON_STOCK_ID);
    register_stock_icon("playlist_display-add-files", PLAYLIST_DISPLAY_ADD_FILES_ICON_STOCK_ID);
    register_stock_icon("playlist_display-add-playlists", PLAYLIST_DISPLAY_ADD_PLAYLISTS_ICON_STOCK_ID);
    register_stock_icon("playlist_display-sync", PLAYLIST_DISPLAY_SYNC_ICON_STOCK_ID);

    playlist_display_plugin = (PlaylistDisplayPlugin*) plugin;
    ui = anjuta_shell_get_ui(plugin->shell, NULL);

    /* Add our playlist_actions */
    action_group
        = anjuta_ui_add_action_group_entries(ui, "ActionGroupPlaylistDisplay", _("Playlist Display"), playlist_actions, G_N_ELEMENTS (playlist_actions), GETTEXT_PACKAGE, TRUE, plugin);
    playlist_display_plugin->action_group = action_group;

    new_playlist_action = tool_menu_action_new (ACTION_NEW_PLAYLIST, _("New Playlist"), _("Create a new playlist for the selected iPod"), GTK_STOCK_NEW);
    g_signal_connect(new_playlist_action, "activate", G_CALLBACK(on_new_playlist_activate), NULL);
    gtk_action_group_add_action (playlist_display_plugin->action_group, GTK_ACTION (new_playlist_action));

    load_ipods_action = tool_menu_action_new (ACTION_DISPLAY_LOAD_IPODS, _("Load iPods"), _("Load all or selected iPods"), PLAYLIST_DISPLAY_READ_ICON_STOCK_ID);
    g_signal_connect(load_ipods_action, "activate", G_CALLBACK(on_load_ipods_mi), NULL);
    gtk_action_group_add_action (playlist_display_plugin->action_group, GTK_ACTION (load_ipods_action));

    /* Merge UI */
    gchar *uipath = g_build_filename(get_ui_dir(), "playlist_display.ui", NULL);
    playlist_display_plugin->uiid = anjuta_ui_merge(ui, uipath);
    g_free(uipath);

    playlist_display_plugin->playlist_view = pm_create_playlist_view(action_group);

    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_ADDED, G_CALLBACK (playlist_display_playlist_added_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_REMOVED, G_CALLBACK (playlist_display_playlist_removed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_ADDED, G_CALLBACK (playlist_display_itdb_added_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_REMOVED, G_CALLBACK (playlist_display_itdb_removed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_UPDATED, G_CALLBACK (playlist_display_update_itdb_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_PREFERENCE_CHANGE, G_CALLBACK (playlist_display_preference_changed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_CHANGED, G_CALLBACK (playlist_display_itdb_data_changed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_SAVED, G_CALLBACK (playlist_display_itdb_data_changed_cb), NULL);

    gtk_widget_show_all(playlist_display_plugin->playlist_view);
    // Add widget directly as scrolling is handled internally by the widget
    anjuta_shell_add_widget(plugin->shell, playlist_display_plugin->playlist_view, "PlaylistDisplayPlugin", _("  iPod Repositories"), PLAYLIST_DISPLAY_PLAYLIST_ICON_STOCK_ID, ANJUTA_SHELL_PLACEMENT_LEFT, NULL);

    return TRUE; /* FALSE if activation failed */
}
Exemplo n.º 8
0
static void
anjuta_test_shell_instance_init (AnjutaTestShell *shell)
{
	GtkWidget *plugins;
	GList *plugins_dirs = NULL;
	
	shell->values = g_hash_table_new (g_str_hash, g_str_equal);
	shell->widgets = g_hash_table_new (g_str_hash, g_str_equal);
	
	shell->box = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (shell->box);
	gtk_container_add (GTK_CONTAINER (shell), shell->box);
	
	/* Status bar */
	shell->status = ANJUTA_STATUS (anjuta_status_new ());
	gtk_widget_show (GTK_WIDGET (shell->status));
	gtk_box_pack_end (GTK_BOX (shell->box), GTK_WIDGET (shell->status),
					  FALSE, FALSE, 0);
	
	/* Initialize plugins */
	plugins_dirs = g_list_prepend (plugins_dirs, PACKAGE_PLUGIN_DIR);
	shell->plugin_manager = anjuta_plugin_manager_new (G_OBJECT (shell),
													   shell->status,
													   plugins_dirs);
	g_list_free (plugins_dirs);
	
	plugins = anjuta_plugin_manager_get_plugins_page (shell->plugin_manager);
	gtk_box_pack_end (GTK_BOX (shell->box), plugins, TRUE, TRUE, 0);
	
	/* Preferencesnces */
	shell->preferences = ANJUTA_PREFERENCES (anjuta_preferences_new (shell->plugin_manager));
	
	/* UI engine */
	shell->ui = anjuta_ui_new ();
	gtk_window_add_accel_group (GTK_WINDOW (shell),
								anjuta_ui_get_accel_group (shell->ui));
	g_signal_connect (G_OBJECT (shell->ui),
					  "add_widget", G_CALLBACK (on_add_merge_widget),
					  shell);
	
	/*gtk_window_add_accel_group (GTK_WINDOW (shell),
	 						anjuta_ui_get_accel_group (shell->ui));*/
	/* Register actions */
	anjuta_ui_add_action_group_entries (shell->ui, "ActionGroupTestShell",
										_("Test shell action group"),
										action_entries,
										G_N_ELEMENTS (action_entries),
										GETTEXT_PACKAGE, TRUE, shell);
	/* Merge UI */
	shell->merge_id = anjuta_ui_merge (shell->ui, UI_FILE);

	gtk_window_set_default_size (GTK_WINDOW (shell), 300, 400);
}
Exemplo n.º 9
0
static gboolean
activate_plugin (AnjutaPlugin *plugin)
{
	TerminalPlugin *term_plugin;
	static gboolean initialized = FALSE;
	AnjutaUI *ui;
	
	DEBUG_PRINT ("%s", "TerminalPlugin: Activating Terminal plugin ...");
	
	term_plugin = ANJUTA_PLUGIN_TERMINAL (plugin);
	term_plugin->widget_added_to_shell = FALSE;
	ui = anjuta_shell_get_ui (plugin->shell, NULL);
	term_plugin->action_group = anjuta_ui_add_action_group_entries (ui,
										"ActionGroupTerminal",
										_("terminal operations"),
										actions_terminal,
										G_N_ELEMENTS (actions_terminal),
										GETTEXT_PACKAGE, TRUE, term_plugin);
	term_plugin->uiid = anjuta_ui_merge (ui, UI_FILE);
	
	terminal_create (term_plugin);
	
	if (!initialized)
	{
		register_stock_icons (plugin);
	}
	
	/* Setup prefs callbacks */
	prefs_init (term_plugin);
	
	/* Added widget in shell */
	anjuta_shell_add_widget (plugin->shell, term_plugin->frame,
							 "AnjutaTerminal", _("Terminal"),
							 "terminal-plugin-icon",
							 ANJUTA_SHELL_PLACEMENT_BOTTOM, NULL);
	/* terminal_focus_cb (term_plugin->term, NULL, term_plugin); */
	term_plugin->widget_added_to_shell = TRUE;
	initialized = TRUE;

	/* Set all terminal preferences, at that time the terminal widget is
	 * not realized, a few vte functions are not working. Another
	 * possibility could be to call this when the widget is realized */
	preferences_changed (term_plugin->settings, term_plugin);
	
	/* set up project directory watch */
	term_plugin->root_watch_id = anjuta_plugin_add_watch (plugin,
														  IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI,
														  on_project_root_added,
														  0, NULL);
	
	return TRUE;
}
Exemplo n.º 10
0
static gboolean
sourceview_plugin_activate (AnjutaPlugin *obj)
{
	SourceviewPlugin* plugin = ANJUTA_PLUGIN_SOURCEVIEW (obj);
	AnjutaUI *ui;

	DEBUG_PRINT ("%s", "SourceviewPlugin: Activating SourceviewPlugin plugin ...");

	/* Add menu entries */
	ui = anjuta_shell_get_ui (ANJUTA_PLUGIN (plugin)->shell, NULL);
	plugin->group = anjuta_ui_add_toggle_action_group_entries (ui, "ActionGroupEditorView",
	                                                           _("Editor view settings"),
	                                                           actions_view,
	                                                           G_N_ELEMENTS (actions_view),
	                                                           GETTEXT_PACKAGE, TRUE, plugin);
	ui_states_init (plugin, ui);
	plugin->uiid = anjuta_ui_merge (ui, UI_FILE);

	return TRUE;
}
Exemplo n.º 11
0
static gboolean
python_plugin_activate (AnjutaPlugin *plugin)
{
	AnjutaUI *ui;

	PythonPlugin *python_plugin;
	static gboolean initialized = FALSE;

	python_plugin = (PythonPlugin*) plugin;
	
	python_plugin->prefs = anjuta_shell_get_preferences (plugin->shell, NULL);
	
	/* Add all UI actions and merge UI */
	ui = anjuta_shell_get_ui (plugin->shell, NULL);
	
	python_plugin->action_group = 

	anjuta_ui_add_action_group_entries (ui, "ActionGroupPythonAssist",
											_("Python Assistance"),
											actions,
											G_N_ELEMENTS (actions),
											GETTEXT_PACKAGE, TRUE,
											plugin);
	python_plugin->uiid = anjuta_ui_merge (ui, UI_FILE);

	initialized = FALSE;

	/* Add watches */
	python_plugin->project_root_watch_id = anjuta_plugin_add_watch (plugin,
																 IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI,
																 on_project_root_added,
																 on_project_root_removed,
																 NULL);
	
	python_plugin->editor_watch_id = anjuta_plugin_add_watch (plugin,
														   IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT,
														   on_editor_added,
														   on_editor_removed,
														   NULL);
	return TRUE;
}
Exemplo n.º 12
0
static gboolean
activate_plugin (AnjutaPlugin *plugin)
{
	AnjutaUI *ui;
	SearchPlugin* splugin = ANJUTA_PLUGIN_SEARCH (plugin);
	IAnjutaDocumentManager* docman = anjuta_shell_get_interface(ANJUTA_PLUGIN(plugin)->shell,
																IAnjutaDocumentManager, NULL);
	
	ui = anjuta_shell_get_ui (plugin->shell, NULL);
	splugin->action_group = anjuta_ui_add_action_group_entries (ui, "ActionGroupSearch",
	                                                            _("Searching…"),
	                                                            actions_search,
	                                                            G_N_ELEMENTS (actions_search),
	                                                            GETTEXT_PACKAGE, TRUE, plugin);

	
	splugin->uiid = anjuta_ui_merge (ui, UI_FILE);
	splugin->docman = docman;
	search_and_replace_init(docman);
	
	return TRUE;
}
Exemplo n.º 13
0
static gboolean
cpp_java_plugin_activate_plugin (AnjutaPlugin *plugin)
{
    AnjutaUI *ui;
    CppJavaPlugin *lang_plugin;
    static gboolean initialized = FALSE;

    lang_plugin = ANJUTA_PLUGIN_CPP_JAVA (plugin);

    DEBUG_PRINT ("%s", "AnjutaLanguageCppJavaPlugin: Activating plugin ...");

    if (!initialized)
    {
        register_stock_icons (plugin);
    }

    ui = anjuta_shell_get_ui (plugin->shell, NULL);
    lang_plugin->action_group =
        anjuta_ui_add_action_group_entries (ui, "ActionGroupCppJavaAssist",
                                            _("C++/Java Assistance"),
                                            actions,
                                            G_N_ELEMENTS (actions),
                                            GETTEXT_PACKAGE, TRUE,
                                            plugin);
    lang_plugin->uiid = anjuta_ui_merge (ui, UI_FILE);

    lang_plugin->editor_watch_id =
        anjuta_plugin_add_watch (plugin,
                                 IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT,
                                 on_value_added_current_editor,
                                 on_value_removed_current_editor,
                                 plugin);

    initialized = FALSE;
    return TRUE;
}
Exemplo n.º 14
0
static gboolean
file_manager_activate (AnjutaPlugin *plugin)
{
	AnjutaUI *ui;
	AnjutaFileManager *file_manager;
	
	DEBUG_PRINT ("%s", "AnjutaFileManager: Activating AnjutaFileManager plugin ...");
	file_manager = (AnjutaFileManager*) plugin;
	
	/* Add all UI actions and merge UI */
	ui = anjuta_shell_get_ui (plugin->shell, NULL);
	
	/* Add action group */
	file_manager->action_group = 
		anjuta_ui_add_action_group_entries (ui, "ActionGroupFileManager",
											_("File manager popup actions"),
											popup_actions, 1,
											GETTEXT_PACKAGE, FALSE,
											plugin);
	
	file_manager->uiid = anjuta_ui_merge (ui, UI_FILE);
	
	file_manager->sw = gtk_scrolled_window_new (NULL, NULL);
	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (file_manager->sw),
								    GTK_POLICY_AUTOMATIC,
								    GTK_POLICY_AUTOMATIC);
	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (file_manager->sw),
										 GTK_SHADOW_IN);
	
	file_manager->fv = ANJUTA_FILE_VIEW (file_view_new ());
	
	g_signal_connect (G_OBJECT (file_manager->fv), "file-open",
					  G_CALLBACK (on_file_view_open_file), file_manager);
	g_signal_connect (G_OBJECT(file_manager->fv), "show-popup-menu",
					  G_CALLBACK (on_file_view_show_popup_menu), file_manager);
	g_signal_connect (G_OBJECT(file_manager->fv), "current-file-changed",
					  G_CALLBACK (on_file_view_current_file_changed),
					  file_manager);
	file_manager_set_default_uri (file_manager);
	file_view_refresh (file_manager->fv);
	
	gtk_container_add (GTK_CONTAINER (file_manager->sw), 
					   GTK_WIDGET (file_manager->fv));
	
	gtk_widget_show_all (file_manager->sw);
	
	anjuta_shell_add_widget (plugin->shell, file_manager->sw,
							 "AnjutaFileManager",
							 _("Files"), GTK_STOCK_OPEN,
							 ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
	
	file_manager->root_watch_id =
		anjuta_plugin_add_watch (plugin, IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI,
								 project_root_added,
								 project_root_removed, NULL);
	

	g_signal_connect (file_manager->settings, "changed::" PREF_ROOT, 
	                  G_CALLBACK (on_notify_root), file_manager);
	g_signal_connect (file_manager->settings, "changed::" PREF_FILTER_BINARY, 
	                  G_CALLBACK (on_notify), file_manager);
	g_signal_connect (file_manager->settings, "changed::" PREF_FILTER_HIDDEN, 
	                  G_CALLBACK (on_notify), file_manager);
	g_signal_connect (file_manager->settings, "changed::" PREF_FILTER_BACKUP, 
	                  G_CALLBACK (on_notify), file_manager);
	g_signal_connect (file_manager->settings, "changed::" PREF_FILTER_UNVERSIONED, 
	                  G_CALLBACK (on_notify), file_manager);
	on_notify (file_manager->settings, NULL, file_manager);
	
	return TRUE;
}
Exemplo n.º 15
0
static gboolean
snippets_manager_activate (AnjutaPlugin * plugin)
{
    SnippetsManagerPlugin *snippets_manager_plugin = ANJUTA_PLUGIN_SNIPPETS_MANAGER (plugin);
    AnjutaUI *anjuta_ui = NULL;

    /* Assertions */
    g_return_val_if_fail (ANJUTA_IS_PLUGIN_SNIPPETS_MANAGER (snippets_manager_plugin),
                          FALSE);

    /* Link the AnjutaShell to the SnippetsDB and load the SnippetsDB*/
    snippets_manager_plugin->snippets_db->anjuta_shell = plugin->shell;
    snippets_db_load (snippets_manager_plugin->snippets_db);

    /* Link the AnjutaShell to the SnippetsProvider and load if necessary */
    snippets_manager_plugin->snippets_provider->anjuta_shell = plugin->shell;

    /* Load the SnippetsBrowser with the snippets in the SnippetsDB */
    snippets_manager_plugin->snippets_browser->anjuta_shell = plugin->shell;
    snippets_browser_load (snippets_manager_plugin->snippets_browser,
                           snippets_manager_plugin->snippets_db,
                           snippets_manager_plugin->snippets_interaction);
    anjuta_shell_add_widget (plugin->shell,
                             GTK_WIDGET (snippets_manager_plugin->snippets_browser),
                             "snippets_browser",
                             _("Snippets"),
                             GTK_STOCK_FILE,
                             ANJUTA_SHELL_PLACEMENT_LEFT,
                             NULL);
    snippets_manager_plugin->browser_maximized = FALSE;

    /* Initialize the Interaction Interpreter */
    snippets_interaction_start (snippets_manager_plugin->snippets_interaction,
                                plugin->shell);

    /* Add a watch for the current document */
    snippets_manager_plugin->cur_editor_watch_id =
        anjuta_plugin_add_watch (plugin,
                                 IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT,
                                 on_added_current_document,
                                 on_removed_current_document,
                                 NULL);

    /* Merge the Menu UI */
    anjuta_ui = anjuta_shell_get_ui (plugin->shell, FALSE);

    snippets_manager_plugin->action_group =
        anjuta_ui_add_action_group_entries (anjuta_ui,
                                            "ActionGroupSnippetsManager",
                                            _("Snippets Manager actions"),
                                            actions_snippets,
                                            G_N_ELEMENTS (actions_snippets),
                                            GETTEXT_PACKAGE,
                                            TRUE,
                                            snippets_manager_plugin);

    snippets_manager_plugin->uiid = anjuta_ui_merge (anjuta_ui, MENU_UI);

    DEBUG_PRINT ("%s", "SnippetsManager: Activating SnippetsManager plugin …");

    return TRUE;
}
Exemplo n.º 16
0
static gboolean
activate_plugin (AnjutaPlugin *plugin)
{
	static IAnjutaSymbolField query_fields[] = {
		IANJUTA_SYMBOL_FIELD_ID,
		IANJUTA_SYMBOL_FIELD_NAME,
		IANJUTA_SYMBOL_FIELD_KIND,
		IANJUTA_SYMBOL_FIELD_TYPE
	};
	EditorPlugin* editor = ANJUTA_PLUGIN_EDITOR (plugin);
	IAnjutaSymbolManager *manager;
	IAnjutaSymbolQuery *query_project;
	IAnjutaSymbolQuery *query_system;
	AnjutaUI *ui;
	
	manager = anjuta_shell_get_interface (plugin->shell, 
	    IAnjutaSymbolManager, NULL);

	/* query project */
	query_project =
		ianjuta_symbol_manager_create_query (manager,
		                                     IANJUTA_SYMBOL_QUERY_SEARCH_ALL,
		                                     IANJUTA_SYMBOL_QUERY_DB_PROJECT,
		                                     NULL);

	ianjuta_symbol_query_set_fields (query_project,
	                                 G_N_ELEMENTS (query_fields),
	                                 query_fields, NULL);
	ianjuta_symbol_query_set_file_scope (query_project,
	                                     IANJUTA_SYMBOL_QUERY_SEARCH_FS_IGNORE, NULL);
	ianjuta_symbol_query_set_mode (query_project,
	                               IANJUTA_SYMBOL_QUERY_MODE_QUEUED, NULL);
	ianjuta_symbol_query_set_filters (query_project, IANJUTA_SYMBOL_TYPE_CLASS | IANJUTA_SYMBOL_TYPE_ENUM | IANJUTA_SYMBOL_TYPE_STRUCT | IANJUTA_SYMBOL_TYPE_TYPEDEF | IANJUTA_SYMBOL_TYPE_UNION,  
	    							  TRUE, NULL);	
	g_signal_connect (query_project, "async-result",
	                  G_CALLBACK (project_symbol_found), plugin->shell);
	
	/* query system */
	query_system =
		ianjuta_symbol_manager_create_query (manager,
		                                     IANJUTA_SYMBOL_QUERY_SEARCH_ALL,
		                                     IANJUTA_SYMBOL_QUERY_DB_SYSTEM,
		                                     NULL);

	ianjuta_symbol_query_set_fields (query_system,
	                                 G_N_ELEMENTS (query_fields),
	                                 query_fields, NULL);
	ianjuta_symbol_query_set_file_scope (query_system,
	                                     IANJUTA_SYMBOL_QUERY_SEARCH_FS_IGNORE, NULL);
	ianjuta_symbol_query_set_mode (query_system,
	                               IANJUTA_SYMBOL_QUERY_MODE_QUEUED, NULL);
	ianjuta_symbol_query_set_filters (query_system, IANJUTA_SYMBOL_TYPE_CLASS | IANJUTA_SYMBOL_TYPE_ENUM | IANJUTA_SYMBOL_TYPE_STRUCT | IANJUTA_SYMBOL_TYPE_TYPEDEF | IANJUTA_SYMBOL_TYPE_UNION,  
	    							  TRUE, NULL);	
	
	g_signal_connect (query_system, "async-result",
	                  G_CALLBACK (system_symbol_found), plugin->shell);


	/* Get notified when scan end, to update type list */
	g_signal_connect (G_OBJECT (manager), "prj_scan_end", G_CALLBACK (on_project_symbol_scanned), query_project);
	g_signal_connect (G_OBJECT (manager), "sys_scan_end", G_CALLBACK (on_system_symbol_scanned), query_system);
	
	/* Initialize type list */
	on_project_symbol_scanned (manager, 0, query_project);
	on_system_symbol_scanned (manager, 0, query_system);

	/* Keep queries to be able to unref them when needed */
	editor->query_project = query_project;
	editor->query_system = query_system;

	/* Add menu entries */
	ui = anjuta_shell_get_ui (plugin->shell, NULL);
	editor->group = anjuta_ui_add_toggle_action_group_entries (ui, "ActionGroupEditorView",
	                                                           _("Editor view settings"),
	                                                           actions_view,
	                                                           G_N_ELEMENTS (actions_view),
	                                                           GETTEXT_PACKAGE, TRUE, editor);
	ui_states_init (editor, ui);
	editor->uiid = anjuta_ui_merge (ui, UI_FILE);

	return TRUE;
}
Exemplo n.º 17
0
static void
anjuta_window_instance_init (AnjutaWindow *win)
{
	GtkWidget *menubar, *about_menu;
	GtkWidget *view_menu, *hbox;
	GtkWidget *main_box;
	GtkWidget *dockbar;
	GtkAction* action;
	GList *plugins_dirs = NULL;
	GdkGeometry size_hints = {
    	100, 100, 0, 0, 100, 100, 1, 1, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
  	};

	DEBUG_PRINT ("%s", "Initializing Anjuta...");

	gtk_window_set_geometry_hints (GTK_WINDOW (win), GTK_WIDGET (win),
								   &size_hints, GDK_HINT_RESIZE_INC);
	gtk_window_set_resizable (GTK_WINDOW (win), TRUE);

	/*
	 * Main box
	 */
	main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_container_add (GTK_CONTAINER (win), main_box);
	gtk_widget_show (main_box);

	win->values = NULL;
	win->widgets = NULL;
	win->maximized = FALSE;

	/* Settings */
	win->settings = g_settings_new (PREF_SCHEMA);

	/* Status bar */
	win->status = ANJUTA_STATUS (anjuta_status_new ());
	anjuta_status_set_title_window (win->status, GTK_WIDGET (win));
	gtk_widget_show (GTK_WIDGET (win->status));
	gtk_box_pack_end (GTK_BOX (main_box),
					  GTK_WIDGET (win->status), FALSE, TRUE, 0);
	g_object_ref (G_OBJECT (win->status));
	g_object_add_weak_pointer (G_OBJECT (win->status), (gpointer)&win->status);

	/* configure dock */
	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_show (hbox);
	win->dock = gdl_dock_new ();
	gtk_widget_show (win->dock);
	gtk_box_pack_end(GTK_BOX (hbox), win->dock, TRUE, TRUE, 0);

	dockbar = gdl_dock_bar_new (G_OBJECT (win->dock));
	gtk_widget_show (dockbar);
	gtk_box_pack_start(GTK_BOX (hbox), dockbar, FALSE, FALSE, 0);

	win->layout_manager = gdl_dock_layout_new (G_OBJECT (win->dock));
	g_signal_connect (win->layout_manager, "notify::dirty",
					  G_CALLBACK (on_layout_dirty_notify), win);
	g_signal_connect (gdl_dock_layout_get_master (win->layout_manager), "notify::locked",
					  G_CALLBACK (on_layout_locked_notify), win);

	/* UI engine */
	win->ui = anjuta_ui_new ();
	g_object_add_weak_pointer (G_OBJECT (win->ui), (gpointer)&win->ui);
	/* show tooltips in the statusbar */
	g_signal_connect (win->ui,
			  "connect_proxy",
			  G_CALLBACK (connect_proxy_cb),
			  win);
	g_signal_connect (win->ui,
			  "disconnect_proxy",
			  G_CALLBACK (disconnect_proxy_cb),
			  win);

	/* Plugin Manager */
	plugins_dirs = g_list_prepend (plugins_dirs, PACKAGE_PLUGIN_DIR);
	win->plugin_manager = anjuta_plugin_manager_new (G_OBJECT (win),
													 win->status,
													 plugins_dirs);
	win->profile_manager = anjuta_profile_manager_new (win->plugin_manager);
	g_list_free (plugins_dirs);

	/* Preferences */
	win->preferences = anjuta_preferences_new (win->plugin_manager, PREF_SCHEMA);
	g_object_add_weak_pointer (G_OBJECT (win->preferences),
							   (gpointer)&win->preferences);

	g_signal_connect (win->settings, "changed::" GDL_STYLE,
	                  G_CALLBACK (on_gdl_style_changed), win);
	on_gdl_style_changed (win->settings, GDL_STYLE, win);

	/* Register actions */
	anjuta_ui_add_action_group_entries (win->ui, "ActionGroupFile", _("File"),
										menu_entries_file,
										G_N_ELEMENTS (menu_entries_file),
										GETTEXT_PACKAGE, TRUE, win);
	anjuta_ui_add_action_group_entries (win->ui, "ActionGroupEdit", _("Edit"),
										menu_entries_edit,
										G_N_ELEMENTS (menu_entries_edit),
										GETTEXT_PACKAGE, TRUE, win);
	anjuta_ui_add_action_group_entries (win->ui, "ActionGroupView", _("View"),
										menu_entries_view,
										G_N_ELEMENTS (menu_entries_view),
										GETTEXT_PACKAGE, TRUE, win);
	anjuta_ui_add_toggle_action_group_entries (win->ui, "ActionGroupToggleView",
										_("View"),
										menu_entries_toggle_view,
										G_N_ELEMENTS (menu_entries_toggle_view),
										GETTEXT_PACKAGE, TRUE, win);
	anjuta_ui_add_action_group_entries (win->ui, "ActionGroupHelp", _("Help"),
										menu_entries_help,
										G_N_ELEMENTS (menu_entries_help),
										GETTEXT_PACKAGE, TRUE, win);

	/* Merge UI */
	anjuta_ui_merge (win->ui, UI_FILE);

	/* Adding accels group */
	gtk_window_add_accel_group (GTK_WINDOW (win),
								gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (win->ui)));

	/* create main menu */
	menubar = gtk_ui_manager_get_widget (GTK_UI_MANAGER (win->ui),
										 "/MenuMain");
	gtk_box_pack_start (GTK_BOX (main_box), menubar, FALSE, FALSE, 0);
	gtk_widget_show (menubar);

	/* create toolbar */
	win->toolbar = gtk_ui_manager_get_widget (GTK_UI_MANAGER (win->ui),
										 "/ToolbarMain");
    if (!g_settings_get_boolean (win->settings, TOOLBAR_VISIBLE))
		gtk_widget_hide (win->toolbar);
	gtk_style_context_add_class (gtk_widget_get_style_context (win->toolbar),
	                             GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
	gtk_toolbar_set_icon_size (GTK_TOOLBAR (win->toolbar),
	                           GTK_ICON_SIZE_MENU);
	gtk_box_pack_start (GTK_BOX (main_box), win->toolbar, FALSE, FALSE, 0);
	action = gtk_ui_manager_get_action (GTK_UI_MANAGER (win->ui),
										"/MenuMain/MenuView/Toolbar");
	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action),
								  g_settings_get_boolean (win->settings,
								                          TOOLBAR_VISIBLE));
	g_signal_connect (win->settings, "changed::" TOOLBAR_STYLE,
	                  G_CALLBACK (on_toolbar_style_changed), win);
	on_toolbar_style_changed (win->settings, TOOLBAR_STYLE, win);

	/* Create widgets menu */
	view_menu =
		gtk_ui_manager_get_widget (GTK_UI_MANAGER(win->ui),
								  "/MenuMain/MenuView");
	win->view_menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (view_menu));

	/* Create about plugins menu */
	about_menu =
		gtk_ui_manager_get_widget (GTK_UI_MANAGER(win->ui),
								   "/MenuMain/PlaceHolderHelpMenus/MenuHelp/"
								   "PlaceHolderHelpAbout/AboutPlugins");
	about_create_plugins_submenu (ANJUTA_SHELL (win), about_menu);

	/* Add main view */
	gtk_box_pack_start (GTK_BOX (main_box), hbox, TRUE, TRUE, 0);

	/* Connect to session */
	g_signal_connect (G_OBJECT (win), "save_session",
					  G_CALLBACK (on_session_save), win);
	g_signal_connect (G_OBJECT (win), "load_session",
					  G_CALLBACK (on_session_load), win);

	/* Loading accels */
	anjuta_ui_load_accels (NULL);

	win->save_count = 0;
}
Exemplo n.º 18
0
static void
anjuta_app_instance_init (AnjutaApp *app)
{
	gint merge_id;
	GtkWidget *menubar, *about_menu;
	GtkWidget *view_menu, *hbox;
	GtkWidget *main_box;
	GtkWidget *dockbar;
	GtkAction* action;
	GList *plugins_dirs = NULL;
	gchar* style;
	GdkGeometry size_hints = {
    	100, 100, 0, 0, 100, 100, 1, 1, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
  	};
	
	DEBUG_PRINT ("%s", "Initializing Anjuta...");
	
	gtk_window_set_geometry_hints (GTK_WINDOW (app), GTK_WIDGET (app),
								   &size_hints, GDK_HINT_RESIZE_INC);
	gtk_window_set_resizable (GTK_WINDOW (app), TRUE);
	
	/*
	 * Main box
	 */
	main_box = gtk_vbox_new (FALSE, 0);
	gtk_container_add (GTK_CONTAINER (app), main_box);
	gtk_widget_show (main_box);
	
	app->values = NULL;
	app->widgets = NULL;
	
	/* Status bar */
	app->status = ANJUTA_STATUS (anjuta_status_new ());
	anjuta_status_set_title_window (app->status, GTK_WIDGET (app));
	gtk_widget_show (GTK_WIDGET (app->status));
	gtk_box_pack_end (GTK_BOX (main_box),
					  GTK_WIDGET (app->status), FALSE, TRUE, 0);
	g_object_ref (G_OBJECT (app->status));
	g_object_add_weak_pointer (G_OBJECT (app->status), (gpointer)&app->status);
	
	/* configure dock */
	hbox = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox);
	app->dock = gdl_dock_new ();
	gtk_widget_show (app->dock);
	gtk_box_pack_end(GTK_BOX (hbox), app->dock, TRUE, TRUE, 0);
	
	dockbar = gdl_dock_bar_new (GDL_DOCK(app->dock));
	gtk_widget_show (dockbar);
	gtk_box_pack_start(GTK_BOX (hbox), dockbar, FALSE, FALSE, 0);
	
	app->layout_manager = gdl_dock_layout_new (GDL_DOCK (app->dock));
	g_signal_connect (app->layout_manager, "notify::dirty",
					  G_CALLBACK (on_layout_dirty_notify), app);
	g_signal_connect (app->layout_manager->master, "notify::locked",
					  G_CALLBACK (on_layout_locked_notify), app);
	
	/* UI engine */
	app->ui = anjuta_ui_new ();
	g_object_add_weak_pointer (G_OBJECT (app->ui), (gpointer)&app->ui);
	/* show tooltips in the statusbar */
	g_signal_connect (app->ui,
			  "connect_proxy",
			  G_CALLBACK (connect_proxy_cb),
			  app);
	g_signal_connect (app->ui,
			  "disconnect_proxy",
			  G_CALLBACK (disconnect_proxy_cb),
			  app);
	
	/* Plugin Manager */
	plugins_dirs = g_list_prepend (plugins_dirs, PACKAGE_PLUGIN_DIR);
	app->plugin_manager = anjuta_plugin_manager_new (G_OBJECT (app),
													 app->status,
													 plugins_dirs);
	app->profile_manager = anjuta_profile_manager_new (app->plugin_manager);
	g_list_free (plugins_dirs);
	
	/* Preferences */
	app->preferences = anjuta_preferences_new (app->plugin_manager);
	g_object_add_weak_pointer (G_OBJECT (app->preferences),
							   (gpointer)&app->preferences);
	
	anjuta_preferences_notify_add_string (app->preferences, "anjuta.gdl.style",
	                                      on_gdl_style_changed, app, NULL);
	style = anjuta_preferences_get (app->preferences, "anjuta.gdl.style");
	
	on_gdl_style_changed (app->preferences, NULL, 
	                      style, app);
	g_free (style);
	
	/* Register actions */
	anjuta_ui_add_action_group_entries (app->ui, "ActionGroupFile", _("File"),
										menu_entries_file,
										G_N_ELEMENTS (menu_entries_file),
										GETTEXT_PACKAGE, TRUE, app);
	anjuta_ui_add_action_group_entries (app->ui, "ActionGroupEdit", _("Edit"),
										menu_entries_edit,
										G_N_ELEMENTS (menu_entries_edit),
										GETTEXT_PACKAGE, TRUE, app);
	anjuta_ui_add_action_group_entries (app->ui, "ActionGroupView", _("View"),
										menu_entries_view,
										G_N_ELEMENTS (menu_entries_view),
										GETTEXT_PACKAGE, TRUE, app);
	anjuta_ui_add_toggle_action_group_entries (app->ui, "ActionGroupToggleView",
										_("View"),
										menu_entries_toggle_view,
										G_N_ELEMENTS (menu_entries_toggle_view),
										GETTEXT_PACKAGE, TRUE, app);
	anjuta_ui_add_action_group_entries (app->ui, "ActionGroupHelp", _("Help"),
										menu_entries_help,
										G_N_ELEMENTS (menu_entries_help),
										GETTEXT_PACKAGE, TRUE, app);

	/* Merge UI */
	merge_id = anjuta_ui_merge (app->ui, UI_FILE);
	
	/* Adding accels group */
	gtk_window_add_accel_group (GTK_WINDOW (app), 
								gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (app->ui)));
	
	/* create main menu */
	menubar = gtk_ui_manager_get_widget (GTK_UI_MANAGER (app->ui),
										 "/MenuMain");
	gtk_box_pack_start (GTK_BOX (main_box), menubar, FALSE, FALSE, 0);
	gtk_widget_show (menubar);
	
	/* create toolbar */	
	app->toolbar = gtk_ui_manager_get_widget (GTK_UI_MANAGER (app->ui),
										 "/ToolbarMain");
    if (!anjuta_preferences_get_bool (app->preferences, "anjuta.toolbar.visible"))
		gtk_widget_hide (app->toolbar);
	gtk_box_pack_start (GTK_BOX (main_box), app->toolbar, FALSE, FALSE, 0);
	action = gtk_ui_manager_get_action (GTK_UI_MANAGER (app->ui),
										"/MenuMain/MenuView/Toolbar");
	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action),
								  anjuta_preferences_get_bool_with_default (app->preferences,
																		   "anjuta.toolbar.visible",
																		   TRUE));
	anjuta_preferences_notify_add_string (app->preferences, "anjuta.toolbar.style",
								   on_toolbar_style_changed, app, NULL);
	style = anjuta_preferences_get (app->preferences, "anjuta.toolbar.style");
	on_toolbar_style_changed (app->preferences, NULL, style, app);
	g_free (style);

	/* Create widgets menu */
	view_menu = 
		gtk_ui_manager_get_widget (GTK_UI_MANAGER(app->ui),
								  "/MenuMain/MenuView");
	app->view_menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (view_menu));	

	/* Disable unavailible tutorials */
	action = anjuta_ui_get_action(app->ui, "ActionGroupHelp", "ActionHelpTutorial");
	g_object_set(G_OBJECT(action), "visible", FALSE, NULL);
	action = anjuta_ui_get_action(app->ui, "ActionGroupHelp", "ActionHelpAdvancedTutorial");
	g_object_set(G_OBJECT(action), "visible", FALSE, NULL);
	
	/* Create about plugins menu */
	about_menu = 
		gtk_ui_manager_get_widget (GTK_UI_MANAGER(app->ui),
								   "/MenuMain/PlaceHolderHelpMenus/MenuHelp/"
								   "PlaceHolderHelpAbout/AboutPlugins");
	about_create_plugins_submenu (ANJUTA_SHELL (app), about_menu);
	
	/* Add main view */
	gtk_box_pack_start (GTK_BOX (main_box), hbox, TRUE, TRUE, 0);
						
	/* Connect to session */
	g_signal_connect (G_OBJECT (app), "save_session",
					  G_CALLBACK (on_session_save), app);
	g_signal_connect (G_OBJECT (app), "load_session",
					  G_CALLBACK (on_session_load), app);
	
	/* Loading accels */
	anjuta_ui_load_accels (NULL);

	app->save_count = 0;
}