예제 #1
0
static void
gnc_query_list_destroy (GtkObject *object)
{
    GNCQueryList *list = GNC_QUERY_LIST(object);
    GNCQueryListPriv *priv;

    priv = GNC_QUERY_LIST_GET_PRIVATE(list);
    if (priv->component_id > 0)
    {
        gnc_unregister_gui_component (priv->component_id);
        priv->component_id = 0;
    }
    if (list->query)
    {
        qof_query_destroy(list->query);
        list->query = NULL;
    }
    if (list->column_params)
    {
        /* XXX: free the params list??? */
    }
    if (list->title_arrows)
    {
        g_free(list->title_arrows);
        list->title_arrows = NULL;
    }
    if (list->title_widths)
    {
        g_free(list->title_widths);
        list->title_widths = NULL;
    }

    if (GTK_OBJECT_CLASS(parent_class)->destroy)
        GTK_OBJECT_CLASS(parent_class)->destroy (object);
}
static void
gnc_main_window_summary_destroy_cb(GNCMainSummary *summary, gpointer data)
{
    gnc_gconf_remove_anon_notification(GCONF_SECTION, summary->cnxn_id);
    gnc_unregister_gui_component(summary->component_id);
    g_free(summary);
}
static void
gnc_plugin_page_invoice_destroy_widget (GncPluginPage *plugin_page)
{
    GncPluginPageInvoice *page;
    GncPluginPageInvoicePrivate *priv;

    ENTER("page %p", plugin_page);
    page = GNC_PLUGIN_PAGE_INVOICE (plugin_page);
    priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);

    gnc_gconf_general_remove_cb(KEY_SUMMARYBAR_POSITION,
                                gnc_plugin_page_invoice_summarybar_position_changed, page);

    if (priv->widget == NULL)
    {
        LEAVE("");
        return;
    }

    if (priv->component_manager_id)
    {
        gnc_unregister_gui_component(priv->component_manager_id);
        priv->component_manager_id = 0;
    }

    gtk_widget_hide(priv->widget);
    gnc_invoice_window_destroy_cb(priv->widget, priv->iw);
    priv->widget = NULL;
    LEAVE("");
}
예제 #4
0
static void
gnc_main_window_summary_destroy_cb(GNCMainSummary *summary, gpointer data)
{
    gnc_prefs_remove_cb_by_id (GNC_PREFS_GROUP, summary->cnxn_id);
    gnc_unregister_gui_component(summary->component_id);
    g_free(summary);
}
예제 #5
0
static void
gnc_general_search_destroy (GtkObject *object)
{
    GNCGeneralSearch *gsl;
    GNCGeneralSearchPrivate *priv;

    g_return_if_fail (object != NULL);
    g_return_if_fail (GNC_IS_GENERAL_SEARCH (object));

    gsl = GNC_GENERAL_SEARCH (object);

    gsl->entry = NULL;
    gsl->button = NULL;

    priv = _PRIVATE(gsl);
    /* Clear the callbacks */
    if (priv->sw)
    {
        gnc_search_dialog_set_select_cb (priv->sw, NULL, NULL, FALSE);
        gnc_search_dialog_disconnect (priv->sw, gsl);
        priv->sw = NULL;
    }
    if (priv->component_id)
    {
        /* Unregister ourselves */
        gnc_unregister_gui_component (priv->component_id);
        priv->component_id = 0;
    }

    if (GTK_OBJECT_CLASS (parent_class)->destroy)
        GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
예제 #6
0
static void
close_handler (gpointer user_data)
{
    GNCLedgerDisplay2 *ld = user_data;

    if (!ld)
        return;

    ENTER(" ");

    gnc_unregister_gui_component (ld->component_id);

    if (ld->destroy)
        ld->destroy (ld);

    gnc_tree_model_split_reg_destroy (ld->model);
    ld->model = NULL;
    ld->view = NULL;

    qof_query_destroy (ld->query);
    ld->query = NULL;

    LEAVE(" ");
    g_free (ld);
}
예제 #7
0
static void
dialog_destroy_cb(GtkObject *object, GncSxSinceLastRunDialog *app_dialog)
{
    gnc_unregister_gui_component(app_dialog->component_id);

    g_object_unref(G_OBJECT(app_dialog->editing_model));
    app_dialog->editing_model = NULL;
}
예제 #8
0
static void
gnc_simple_combo_destroy_cb (GtkWidget *widget, gpointer data)
{
    ListStoreData *lsd = data;

    gnc_unregister_gui_component (lsd->component_id);
    g_free (lsd);
}
예제 #9
0
void
gnc_entry_ledger_display_fini (GncEntryLedger *ledger)
{
    if (!ledger) return;

    gnc_unregister_gui_component (ledger->component_id);
    gnc_gconf_general_remove_cb(KEY_ACCOUNT_SEPARATOR,
                                gnc_entry_ledger_gconf_changed, ledger);
}
예제 #10
0
void
tax_table_window_destroy_cb (GtkWidget *widget, gpointer data)
{
    TaxTableWindow *ttw = data;

    if (!ttw) return;

    gnc_unregister_gui_component (ttw->component_id);

    g_free (ttw);
}
예제 #11
0
void
gnc_payment_window_destroy_cb (GtkWidget *widget, gpointer data)
{
    PaymentWindow *pw = data;

    if (!pw) return;

    gnc_unregister_gui_component (pw->component_id);

    g_list_free (pw->acct_types);
    g_list_free (pw->acct_commodities);
    g_free (pw);
}
예제 #12
0
void
gnc_bi_import_gui_destroy_cb (GtkWidget *widget, gpointer data)
{
    BillImportGui *gui = data;

    gnc_suspend_gui_refresh ();
    gnc_unregister_gui_component (gui->component_id);
    gnc_resume_gui_refresh ();

    g_object_unref (gui->store);
    g_string_free (gui->regexp, TRUE);
    g_free (gui);
}
예제 #13
0
static int
gnc_dialog_query_view_delete_cb (GtkDialog *dialog, GdkEvent  *event, DialogQueryView *dqv)
{
    g_return_val_if_fail (dqv, TRUE);

    gnc_unregister_gui_component (dqv->component_id);

    /* destroy the book list */
    dqv_clear_booklist (dqv);

    /* Destroy and exit */
    gtk_widget_destroy(dqv->dialog);
    g_free (dqv);
    return FALSE;
}
예제 #14
0
static int
gnc_dialog_query_list_delete_cb (GtkDialog *dialog, GdkEvent  *event, DialogQueryList *dql)
{
    g_return_val_if_fail (dql, TRUE);

    gnc_unregister_gui_component (dql->component_id);

    /* XXX: Clear/destroy the param_list? */

    /* destroy the book list */
    dql_clear_booklist (dql);

    /* Destroy and exit */
    gtk_widget_destroy(dql->dialog);
    g_free (dql);
    return FALSE;
}
예제 #15
0
void
gnc_job_window_destroy_cb (GtkWidget *widget, gpointer data)
{
    JobWindow *jw = data;
    GncJob *job = jw_get_job (jw);

    gnc_suspend_gui_refresh ();

    if (jw->dialog_type == NEW_JOB && job != NULL)
    {
        gncJobBeginEdit (job);
        gncJobDestroy (job);
        jw->job_guid = *guid_null ();
    }

    gnc_unregister_gui_component (jw->component_id);
    gnc_resume_gui_refresh ();

    g_free (jw);
}
예제 #16
0
void
gnc_employee_window_destroy_cb (GtkWidget *widget, gpointer data)
{
    EmployeeWindow *ew = data;
    GncEmployee *employee = ew_get_employee (ew);

    gnc_suspend_gui_refresh ();

    if (ew->dialog_type == NEW_EMPLOYEE && employee != NULL)
    {
        gncEmployeeBeginEdit (employee);
        gncEmployeeDestroy (employee);
        ew->employee_guid = *guid_null ();
    }

    gnc_unregister_gui_component (ew->component_id);
    gnc_resume_gui_refresh ();

    g_free (ew);
}
static void
gnc_plugin_page_sx_list_destroy_widget (GncPluginPage *plugin_page)
{
    GncPluginPageSxList *page;
    GncPluginPageSxListPrivate *priv;

    page = GNC_PLUGIN_PAGE_SX_LIST (plugin_page);
    priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);

    if (priv->widget)
    {
        g_object_unref(G_OBJECT(priv->widget));
        priv->widget = NULL;
    }

    if (priv->gnc_component_id)
    {
        gnc_unregister_gui_component(priv->gnc_component_id);
        priv->gnc_component_id = 0;
    }
}
예제 #18
0
static void
close_handler (gpointer user_data)
{
    GNCLedgerDisplay *ld = user_data;

    if (!ld)
        return;

    gnc_unregister_gui_component (ld->component_id);

    if (ld->destroy)
        ld->destroy (ld);

    gnc_split_register_destroy (ld->reg);
    ld->reg = NULL;

    qof_query_destroy (ld->query);
    ld->query = NULL;

    g_free (ld);
}
예제 #19
0
static void
gnc_plugin_page_invoice_destroy_widget (GncPluginPage *plugin_page)
{
    GncPluginPageInvoice *page;
    GncPluginPageInvoicePrivate *priv;

    ENTER("page %p", plugin_page);
    page = GNC_PLUGIN_PAGE_INVOICE (plugin_page);
    priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);

    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
                                 GNC_PREF_SUMMARYBAR_POSITION_TOP,
                                 gnc_plugin_page_invoice_summarybar_position_changed,
                                 page);
    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
                                 GNC_PREF_SUMMARYBAR_POSITION_BOTTOM,
                                 gnc_plugin_page_invoice_summarybar_position_changed,
                                 page);

    // Remove the page focus idle function if present
    g_idle_remove_by_data (priv->iw);

    if (priv->widget == NULL)
    {
        LEAVE("");
        return;
    }

    if (priv->component_manager_id)
    {
        gnc_unregister_gui_component(priv->component_manager_id);
        priv->component_manager_id = 0;
    }

    gtk_widget_hide(priv->widget);
    gnc_invoice_window_destroy_cb(priv->widget, priv->iw);
    priv->widget = NULL;
    LEAVE("");
}
예제 #20
0
void
gnc_unregister_gui_component_by_data (const char *component_class,
                                      gpointer user_data)
{
    GList *list;
    GList *node;

    list = find_components_by_data (user_data);

    for (node = list; node; node = node->next)
    {
        ComponentInfo *ci = node->data;

        if (component_class &&
                g_strcmp0 (component_class, ci->component_class) != 0)
            continue;

        gnc_unregister_gui_component (ci->component_id);
    }

    g_list_free (list);
}
예제 #21
0
void
gnc_customer_window_destroy_cb (GtkWidget *widget, gpointer data)
{
    CustomerWindow *cw = data;
    GncCustomer *customer = cw_get_customer (cw);

    gnc_suspend_gui_refresh ();

    if (cw->dialog_type == NEW_CUSTOMER && customer != NULL)
    {
        gncCustomerBeginEdit (customer);
        gncCustomerDestroy (customer);
        cw->customer_guid = *guid_null ();
    }

    if (cw->addrX_selection_source_id)
        g_source_remove (cw->addrX_selection_source_id);

    gnc_unregister_gui_component (cw->component_id);
    gnc_resume_gui_refresh ();

    g_free (cw);
}
static void
gnc_plugin_page_owner_tree_destroy_widget (GncPluginPage *plugin_page)
{
    GncPluginPageOwnerTree *page;
    GncPluginPageOwnerTreePrivate *priv;

    ENTER("page %p", plugin_page);
    page = GNC_PLUGIN_PAGE_OWNER_TREE (plugin_page);
    priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);

    if (priv->widget)
    {
        g_object_unref(G_OBJECT(priv->widget));
        priv->widget = NULL;
    }

    if (priv->component_id)
    {
        gnc_unregister_gui_component(priv->component_id);
        priv->component_id = 0;
    }

    LEAVE("widget destroyed");
}