static gboolean deactivate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; PlaylistDisplayPlugin *playlist_display_plugin; playlist_display_plugin = (PlaylistDisplayPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_playlist_added_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_playlist_removed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_added_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_removed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_update_itdb_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_preference_changed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_data_changed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_data_changed_cb), plugin); /* Unmerge UI */ anjuta_ui_unmerge(ui, playlist_display_plugin->uiid); /* Remove Action groups */ anjuta_ui_remove_action_group(ui, playlist_display_plugin->action_group); /* Remove widgets from Shell */ anjuta_shell_remove_widget(plugin->shell, playlist_display_plugin->playlist_view, NULL); /* Destroy the treeview */ pm_destroy_playlist_view(); playlist_display_plugin->playlist_view = NULL; /* FALSE if plugin doesn't want to deactivate */ return TRUE; }
static gboolean deactivate_plugin (AnjutaPlugin *plugin) { StarterPlugin* splugin = ANJUTA_PLUGIN_STARTER (plugin); DEBUG_PRINT ("StarterPlugin: Deactivating starter plugin..."); if (splugin->priv->starter) anjuta_shell_remove_widget (anjuta_plugin_get_shell (plugin), splugin->priv->starter, NULL); anjuta_plugin_remove_watch (plugin, splugin->priv->editor_watch_id, FALSE); anjuta_plugin_remove_watch (plugin, splugin->priv->project_watch_id, FALSE); return TRUE; }
static gboolean file_manager_deactivate (AnjutaPlugin *plugin) { AnjutaUI *ui; AnjutaFileManager *file_manager; DEBUG_PRINT ("%s", "AnjutaFileManager: Dectivating AnjutaFileManager plugin ..."); file_manager = (AnjutaFileManager*) plugin; ui = anjuta_shell_get_ui (plugin->shell, NULL); anjuta_plugin_remove_watch (plugin, file_manager->root_watch_id, TRUE); anjuta_ui_remove_action_group (ui, ((AnjutaFileManager*)plugin)->action_group); anjuta_ui_unmerge (ui, ((AnjutaFileManager*)plugin)->uiid); anjuta_shell_remove_widget (plugin->shell, file_manager->sw, NULL); return TRUE; }
static gboolean snippets_manager_deactivate (AnjutaPlugin *plugin) { SnippetsManagerPlugin *snippets_manager_plugin = NULL; AnjutaUI *anjuta_ui = NULL; /* Assertions */ g_return_val_if_fail (ANJUTA_IS_PLUGIN_SNIPPETS_MANAGER (plugin), FALSE); snippets_manager_plugin = ANJUTA_PLUGIN_SNIPPETS_MANAGER (plugin); DEBUG_PRINT ("%s", "SnippetsManager: Deactivating SnippetsManager plugin …"); anjuta_plugin_remove_watch (plugin, snippets_manager_plugin->cur_editor_watch_id, FALSE); /* Remove the Menu UI */ anjuta_ui = anjuta_shell_get_ui (plugin->shell, NULL); anjuta_ui_unmerge (anjuta_ui, snippets_manager_plugin->uiid); anjuta_ui_remove_action_group (anjuta_ui, snippets_manager_plugin->action_group); /* Unload the SnippetsBrowser */ if (snippets_manager_plugin->browser_maximized) on_snippets_browser_unmaximize_request (snippets_manager_plugin->snippets_browser, snippets_manager_plugin); snippets_browser_unload (snippets_manager_plugin->snippets_browser); g_object_ref (snippets_manager_plugin->snippets_browser); anjuta_shell_remove_widget (plugin->shell, GTK_WIDGET (snippets_manager_plugin->snippets_browser), NULL); /* Destroy the SnippetsDB */ snippets_db_close (snippets_manager_plugin->snippets_db); /* Destroy the Interaction Interpreter */ snippets_interaction_destroy (snippets_manager_plugin->snippets_interaction); /* Unload the SnippetsProvider */ snippets_provider_unload (snippets_manager_plugin->snippets_provider); return TRUE; }
/* Remove the starter plugin once a document was opened */ static void on_value_added_current_editor (AnjutaPlugin *plugin, const gchar *name, const GValue *value, gpointer data) { GObject *doc; AnjutaShell *shell; StarterPlugin *splugin; doc = g_value_get_object (value); shell = ANJUTA_PLUGIN(plugin)->shell; splugin = ANJUTA_PLUGIN_STARTER (plugin); if (doc) { if (splugin->priv->starter) { DEBUG_PRINT ("Hiding starter"); anjuta_shell_remove_widget (shell, splugin->priv->starter, NULL); } splugin->priv->starter = NULL; } }
static gboolean deactivate_plugin (AnjutaPlugin *plugin) { TerminalPlugin *term_plugin; AnjutaUI *ui; term_plugin = ANJUTA_PLUGIN_TERMINAL (plugin); ui = anjuta_shell_get_ui (plugin->shell, NULL); anjuta_ui_unmerge (ui, term_plugin->uiid); if (term_plugin->action_group) { anjuta_ui_remove_action_group (ui, term_plugin->action_group); term_plugin->action_group = NULL; } /* terminal plugin widgets are destroyed as soon as it is removed */ anjuta_shell_remove_widget (plugin->shell, term_plugin->frame, NULL); g_object_unref (term_plugin->shell_box); g_object_unref (term_plugin->term_box); g_signal_handlers_disconnect_by_func (vte_reaper_get (), terminal_child_exited_cb, term_plugin); /* remove watch */ anjuta_plugin_remove_watch (plugin, term_plugin->root_watch_id, FALSE); term_plugin->child_pid = 0; #if OLD_VTE == 1 g_signal_handlers_disconnect_by_func (G_OBJECT (term_plugin->term), G_CALLBACK (terminal_unrealize_cb), term_plugin); term_plugin->first_time_realization = TRUE; #endif return TRUE; }