static void on_dialog_response(GtkDialog* dialog, gint response_id, gpointer user_data) { QuickOpenPlugin* self = user_data; gtk_widget_hide(GTK_WIDGET(dialog)); if (response_id == GTK_RESPONSE_ACCEPT) { GObject* object; object = quick_open_dialog_get_selected_object(self->dialog); if (!object) return; if (IANJUTA_IS_DOCUMENT(object)) { ianjuta_document_manager_set_current_document(self->docman, IANJUTA_DOCUMENT(object), NULL); } else if (G_IS_FILE(object)) { IAnjutaFileLoader* loader; loader = anjuta_shell_get_interface (ANJUTA_PLUGIN (self)->shell, IAnjutaFileLoader, NULL); g_return_if_fail (loader != NULL); ianjuta_file_loader_load (loader, G_FILE(object), FALSE, NULL); } g_object_unref(object); } }
void vim_signal_buf_enter_cb (DBusGProxy *proxy, const guint bufno, const gchar* filename, VimWidget *widget) { IAnjutaDocumentManager *docman; VimEditor *editor = vim_widget_get_document_bufno (widget, bufno, NULL); if (!editor) return; editor->priv->bufno = bufno; if (widget->priv->current_editor != editor) { widget->priv->current_editor = editor; /* Set the current editor */ docman = anjuta_shell_get_interface (ANJUTA_PLUGIN(widget->priv->plugin)->shell, IAnjutaDocumentManager, NULL); ianjuta_document_manager_set_current_document (docman, IANJUTA_DOCUMENT(editor), NULL); } }