Beispiel #1
0
static void
hide_dialog(GncGWENGui *gui)
{
    g_return_if_fail(gui);

    ENTER("gui=%p", gui);

    /* Hide the dialog */
    gtk_widget_hide(gui->dialog);

    /* Remember whether the dialog is to be closed when finished */
    gnc_gconf_set_bool(
        GCONF_SECTION_AQBANKING, KEY_CLOSE_ON_FINISH,
        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gui->close_checkbutton)),
        NULL);

    /* Remember size and position of the dialog */
    gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW(gui->dialog));

    /* Do not serve as GUI anymore */
    gui->state = HIDDEN;
    unregister_callbacks(gui);

    LEAVE(" ");
}
Beispiel #2
0
void gnc_totd_dialog_response_cb (GtkDialog *dialog,
                                  gint       response,
                                  gpointer   user_data)
{
    TotdDialog *totd_dialog = user_data;

    ENTER("dialog %p, response %d, user_data %p", dialog, response, user_data);
    switch (response)
    {
    case GNC_RESPONSE_FORWARD:
        gnc_new_tip_number(totd_dialog, 1);
        break;

    case GNC_RESPONSE_BACK:
        gnc_new_tip_number(totd_dialog, -1);
        break;

    case GTK_RESPONSE_CLOSE:
        gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(totd_dialog->dialog));
        /* fall through */

    default:
        gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, totd_dialog->dialog);
        gtk_widget_destroy(GTK_WIDGET(totd_dialog->dialog));
        break;
    }
    LEAVE("");
}
void
gnc_reset_warnings_response_cb (GtkDialog *dialog,
                                gint response,
                                gpointer user_data)
{
    switch (response)
    {
    case GTK_RESPONSE_APPLY:
        gnc_reset_warnings_apply_changes(dialog);
        break;

    case GTK_RESPONSE_OK:
        gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS,
                                      DIALOG_RESET_WARNINGS_CM_CLASS);
        gnc_reset_warnings_apply_changes(dialog);
        gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
        gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
                                             dialog);
        gtk_widget_destroy(GTK_WIDGET(dialog));
        break;

    default:
        gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS,
                                      DIALOG_RESET_WARNINGS_CM_CLASS);
        gnc_reset_warnings_revert_changes(dialog);
        gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
                                             dialog);
        gtk_widget_destroy(GTK_WIDGET(dialog));
    }
}
void
tax_table_window_close (GtkWidget *widget, gpointer data)
{
    TaxTableWindow *ttw = data;

    gnc_save_window_size (GCONF_SECTION, GTK_WINDOW (ttw->dialog));
    gnc_ui_tax_table_window_destroy (ttw);
}
static void
close_handler(gpointer user_data)
{
    GncSxSinceLastRunDialog *app_dialog = user_data;

    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(app_dialog->dialog));
    gtk_widget_destroy(app_dialog->dialog);
}
static void
close_handler(gpointer user_data)
{
    GncSxSinceLastRunDialog *app_dialog = user_data;

    gnc_save_window_size(GNC_PREFS_GROUP_STARTUP, GTK_WINDOW(app_dialog->dialog));
    gtk_widget_destroy(app_dialog->dialog);
}
void
custom_report_dialog_close_cb(GtkWidget* widget, gpointer data)
{
    CustomReportDialog *crd = data;
    gnc_save_window_size(GNC_PREFS_GROUP_REPORT_SAVED_CONFIGS, GTK_WINDOW(crd->dialog));

    gtk_widget_destroy(crd->dialog);
    g_free(crd);
}
Beispiel #8
0
static void
close_handler (gpointer user_data)
{
    FindAccountDialog *facc_dialog = user_data;

    ENTER(" ");
    gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->dialog));
    gtk_widget_destroy (GTK_WIDGET(facc_dialog->dialog));
    LEAVE(" ");
}
static void
close_handler (gpointer user_data)
{
    CommoditiesDialog *cd = user_data;

    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(cd->dialog));

    gnc_gconf_set_bool(GCONF_SECTION, "include_iso", cd->show_currencies, NULL);

    gtk_widget_destroy(cd->dialog);
}
Beispiel #10
0
static void
csv_export_close_handler (gpointer user_data)
{
    CsvExportInfo *info = user_data;

    g_free (info->file_name);
    g_free (info->starting_dir);

    gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
    gtk_widget_destroy (info->window);
}
Beispiel #11
0
static void
close_handler (gpointer user_data)
{
    CommoditiesDialog *cd = user_data;

    gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(cd->dialog));

    gnc_prefs_set_bool(GNC_PREFS_GROUP, GNC_PREF_INCL_ISO, cd->show_currencies);

    gtk_widget_destroy(cd->dialog);
}
static void
csv_import_close_handler (gpointer user_data)
{
    CsvImportInfo *info = user_data;

    g_free(info->starting_dir);
    g_free(info->file_name);
    g_string_free(info->regexp, TRUE);

    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
    gtk_widget_destroy (info->window);
}
Beispiel #13
0
/** Handle a user click on one of the buttons at the bottom of the
 *  preference dialog.  Also handles delete_window events, which have
 *  conveniently converted to a response by GtkDialog.
 *
 *  @internal
 *
 *  @param dialog A pointer to the preferences dialog.
 *
 *  @param response Indicates which button was pressed by the user.
 *  The only expected values are HELP, CLOSE, and DELETE_EVENT.
 *
 *  @param unused
 */
void
gnc_preferences_response_cb(GtkDialog *dialog, gint response, GtkDialog *unused)
{
    switch (response)
    {
    case GTK_RESPONSE_HELP:
        gnc_gnome_help(HF_HELP, HL_GLOBPREFS);
        break;

    default:
        gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
        gnc_unregister_gui_component_by_data(DIALOG_PREFERENCES_CM_CLASS,
                                             dialog);
        gtk_widget_destroy(GTK_WIDGET(dialog));
        break;
    }
}
void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
{
    GtkTreeModel *model;
    GtkTreeIter iter;
    GNCImportTransInfo *trans_info;

    if (info == NULL)
        return;

    model = gtk_tree_view_get_model(info->view);
    if (gtk_tree_model_get_iter_first(model, &iter))
    {
        do
        {
            gtk_tree_model_get(model, &iter,
                               DOWNLOADED_COL_DATA, &trans_info,
                               -1);

            if (info->transaction_processed_cb)
            {
                info->transaction_processed_cb(trans_info,
                                               FALSE,
                                               info->user_data);
            }

            gnc_import_TransInfo_delete(trans_info);
        }
        while (gtk_tree_model_iter_next (model, &iter));
    }


    if (!(info->dialog == NULL))
    {
        gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog));
        gnc_import_Settings_delete (info->user_settings);
        gtk_widget_destroy (GTK_WIDGET (info->dialog));
    }
    else
        gnc_import_Settings_delete (info->user_settings);
    g_free (info);
}
Beispiel #15
0
void fincalc_response_cb (GtkDialog *dialog,
                          gint response,
                          FinCalcDialog *fcd)
{
    switch (response)
    {
    case GTK_RESPONSE_OK:
        /* Do something here whenever the hidden schedule button is clicked. */
        /* Fall through */

    case GTK_RESPONSE_CLOSE:
        gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
        break;

    default:
        /* Cancel, destroy, etc.  Do nothing. */
        break;
    }

    gnc_close_gui_component_by_data (DIALOG_FINCALC_CM_CLASS, fcd);
}
/**
 * Run a match_picker dialog so that the selected-MatchInfo in the
 * given trans_info is updated accordingly. This functions will only
 * return after the user clicked Ok, Cancel, or Window-Close.
 */
void
gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info)
{
    GNCImportMatchPicker *matcher;
    gint response;
    GNCImportMatchInfo *old;
    g_assert (transaction_info);

    /* Create a new match_picker, even though it's stored in a
       transmatcher struct :-) */
    matcher = g_new0(GNCImportMatchPicker, 1);
    /* DEBUG("Init match_picker"); */
    init_match_picker_gui(matcher);

    /* Append this single transaction to the view and select it */
    downloaded_transaction_append(matcher, transaction_info);

    old = gnc_import_TransInfo_get_selected_match(transaction_info);

    /* Let this dialog run and close. */
    /*DEBUG("Right before run and close");*/
    gtk_window_set_modal(GTK_WINDOW(matcher->transaction_matcher), TRUE);
    response = gtk_dialog_run (GTK_DIALOG (matcher->transaction_matcher));
    gnc_save_window_size(GCONF_SECTION,
                         GTK_WINDOW (matcher->transaction_matcher));
    gtk_widget_destroy (matcher->transaction_matcher);
    /*DEBUG("Right after run and close");*/
    /* DEBUG("Response was %d.", response); */
    if (response == GTK_RESPONSE_OK && matcher->selected_match_info != old)
    {
        /* OK was pressed */
        gnc_import_TransInfo_set_selected_match (transaction_info,
                matcher->selected_match_info,
                TRUE);
    }
}
static void
delete_hierarchy_dialog (hierarchy_data *data)
{
    gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(data->dialog));
    gtk_widget_destroy (data->dialog);
}