? abi-plugin-config-dlg.diff ? plugin.status ? tools/abigochart/GNUmakefile ? tools/abigochart/GNUmakefile.in ? tools/abigochart/unix/.deps ? tools/abigochart/unix/.libs ? tools/abigochart/unix/AbiGOChart.lo ? tools/abigochart/unix/GNUmakefile ? tools/abigochart/unix/GNUmakefile.in ? tools/abigochart/unix/ie_imp_GOChart.lo ? tools/abigochart/unix/libAbiGOChart.la ? tools/abigoffice/unix/AbiGOChart.loT Index: tools/abigoffice/unix/AbiGOffice.cpp =================================================================== RCS file: /cvsroot/abiword-plugins/tools/abigoffice/unix/AbiGOffice.cpp,v retrieving revision 1.12 diff -u -r1.12 AbiGOffice.cpp --- tools/abigoffice/unix/AbiGOffice.cpp 24 Sep 2006 08:18:48 -0000 1.12 +++ tools/abigoffice/unix/AbiGOffice.cpp 25 Sep 2006 22:22:21 -0000 @@ -1,3 +1,5 @@ +/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ + /* * Copyright (C) 2004 Luca Padovani * Copyright (C) 2005 Martin Sevior @@ -26,6 +28,8 @@ #endif #include "xap_Module.h" +#include "xap_DialogFactory.h" +#include "ap_Dialog_Id.h" #include "ie_imp_GOChart.h" #include "ie_imp_GOComponent.h" #include "xap_App.h" @@ -377,6 +381,50 @@ } } +static XAP_NotebookDialog::Page *AbiGOffice_PrefsPage = NULL; + +static void +remove_cb (GtkButton *button, + gpointer data) +{ + XAP_App *app; + XAP_DialogFactory *factory; + gboolean ret; + + app = XAP_App::getApp (); + factory = app->getDialogFactory (); + + ret = factory->unregisterNotebookPage (AP_DIALOG_ID_OPTIONS, AbiGOffice_PrefsPage); + printf ("unregister: %d\n", ret); + g_object_unref (G_OBJECT (AbiGOffice_PrefsPage->widget)); + delete AbiGOffice_PrefsPage; + AbiGOffice_PrefsPage = NULL; +} + +static void +AbiGOffice_addPrefsPage (void) +{ + XAP_App *app; + XAP_DialogFactory *factory; + GtkWidget *button; + gboolean ret; + + app = XAP_App::getApp (); + factory = app->getDialogFactory (); + + button = gtk_button_new_with_label ("remove page (reopen dialog)"); + g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (remove_cb), NULL); + gtk_widget_show (button); + /* the abstract abiword infrastructure doesn't know of gtk and refcounting + * therefore i'm keeping one for myself */ + g_object_ref (G_OBJECT (button)); + gtk_object_sink (GTK_OBJECT(button)); + + AbiGOffice_PrefsPage = new XAP_NotebookDialog::Page ("GOffice", button); + ret = factory->registerNotebookPage (AP_DIALOG_ID_OPTIONS, AbiGOffice_PrefsPage); + printf ("register: %d\n", ret); +} + static UT_uint32 GOChartManagerUID = 0; static GR_GOChartManager *pGOChartManager = NULL; @@ -453,6 +501,7 @@ mime_types = go_components_get_mime_types (); g_slist_foreach (mime_types, (GFunc) create_manager_cb, pApp); AbiGOffice_addToMenus(); + AbiGOffice_addPrefsPage(); return 1; }