From 43820fe81a9fd0f99cbdd74a3ab5fa4b3b9eb6fb Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Tue, 18 Oct 2011 18:10:57 +0000 Subject: [PATCH] Bug #661852 - Migrate Totd and file access dialog from GladeXML to Builder Patch by Robert Fewell git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21458 57a11ea4-9604-0410-9ed3-97b8803252fd --- po/POTFILES.in | 5 +- src/gnome-utils/dialog-file-access.c | 49 ++- src/gnome-utils/dialog-totd.c | 195 ++++++----- src/gnome-utils/dialog-totd.h | 45 +-- src/gnome-utils/glade/Makefile.am | 4 +- .../glade/dialog-file-access.glade | 277 --------------- src/gnome-utils/gnc-file.c | 3 + src/gnome-utils/gtkbuilder/Makefile.am | 6 +- .../gtkbuilder/dialog-file-access.glade | 321 ++++++++++++++++++ .../dialog-totd.glade} | 248 +++++++------- 10 files changed, 624 insertions(+), 529 deletions(-) delete mode 100644 src/gnome-utils/glade/dialog-file-access.glade create mode 100644 src/gnome-utils/gtkbuilder/dialog-file-access.glade rename src/gnome-utils/{glade/totd.glade => gtkbuilder/dialog-totd.glade} (64%) diff --git a/po/POTFILES.in b/po/POTFILES.in index 3d3c2713ea..520493285f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -233,6 +233,7 @@ src/gnome/gtkbuilder/dialog-progress.glade src/gnome/gtkbuilder/dialog-sx.glade src/gnome/gtkbuilder/gnc-plugin-page-budget.glade src/gnome/gtkbuilder/gnc-plugin-page-register.glade +src/gnome/gtkbuilder/sched-xact.glade src/gnome/gtkbuilder/tax.glade src/gnome/gtkbuilder/window-autoclear.glade src/gnome/gtkbuilder/window-reconcile.glade @@ -283,7 +284,6 @@ src/gnome-utils/druid-gconf-setup.c src/gnome-utils/druid-gnc-xml-import.c src/gnome-utils/druid-utils.c src/gnome-utils/glade/dialog-book-close.glade -src/gnome-utils/glade/dialog-file-access.glade src/gnome-utils/glade/dialog-object-references.glade src/gnome-utils/glade/dialog-query-list.glade src/gnome-utils/glade/dialog-reset-warnings.glade @@ -293,7 +293,6 @@ src/gnome-utils/glade/druid-provider-multifile.glade src/gnome-utils/glade/exchange-dialog.glade src/gnome-utils/glade/gnc-gui-query.glade src/gnome-utils/glade/preferences.glade -src/gnome-utils/glade/totd.glade src/gnome-utils/gnc-account-sel.c src/gnome-utils/gnc-amount-edit.c src/gnome-utils/gnc-autosave.c @@ -350,6 +349,8 @@ src/gnome-utils/gnc-tree-view-sx-list.c src/gnome-utils/gnc-window.c src/gnome-utils/gtkbuilder/dialog-account.glade src/gnome-utils/gtkbuilder/dialog-commodity.glade +src/gnome-utils/gtkbuilder/dialog-file-access.glade +src/gnome-utils/gtkbuilder/dialog-totd.glade src/gnome-utils/gtkbuilder/dialog-transfer.glade src/gnome-utils/gtkbuilder/dialog-userpass.glade src/gnome-utils/gtkbuilder/gnc-date-format.glade diff --git a/src/gnome-utils/dialog-file-access.c b/src/gnome-utils/dialog-file-access.c index 3e11522d34..1853856bbe 100644 --- a/src/gnome-utils/dialog-file-access.c +++ b/src/gnome-utils/dialog-file-access.c @@ -26,7 +26,6 @@ #include #include -#include #include "gnc-ui.h" #include "gnc-ui-util.h" @@ -54,6 +53,7 @@ typedef struct FileAccessWindow GtkWidget* frame_file; GtkWidget* frame_database; GtkFileChooser* fileChooser; + gchar *starting_dir; GtkComboBox* cb_uri_type; GtkEntry* tf_host; GtkEntry* tf_database; @@ -167,6 +167,7 @@ set_widget_sensitivity( FileAccessWindow* faw, gboolean is_file_based_uri ) { gtk_widget_show(faw->frame_file); gtk_widget_hide(faw->frame_database); + gtk_file_chooser_set_current_folder(faw->fileChooser, faw->starting_dir); } else { @@ -231,11 +232,11 @@ static void gnc_ui_file_access( int type ) { FileAccessWindow *faw; - GladeXML* xml; + GtkBuilder* builder; GtkWidget* box; GList* ds_node; GtkButton* op; - GtkWidget* align; + GtkWidget* file_chooser; GtkFileChooserWidget* fileChooser; GtkFileChooserAction fileChooserAction = GTK_FILE_CHOOSER_ACTION_OPEN; GList* list; @@ -252,7 +253,6 @@ gnc_ui_file_access( int type ) const gchar *button_label = NULL; const gchar *gconf_section = NULL; gchar *last; - gchar *starting_dir = NULL; g_return_if_fail( type == FILE_ACCESS_OPEN || type == FILE_ACCESS_SAVE_AS || type == FILE_ACCESS_EXPORT ); @@ -260,22 +260,24 @@ gnc_ui_file_access( int type ) g_return_if_fail( faw != NULL ); faw->type = type; + faw->starting_dir = NULL; /* Open the dialog */ - xml = gnc_glade_xml_new( "dialog-file-access.glade", "File Access" ); - faw->dialog = glade_xml_get_widget( xml, "File Access" ); + builder = gtk_builder_new(); + gnc_builder_add_from_file (builder, "dialog-file-access.glade", "File Access" ); + faw->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "File Access" )); g_object_set_data_full( G_OBJECT(faw->dialog), "FileAccessWindow", faw, g_free ); - faw->frame_file = glade_xml_get_widget( xml, "frame_file" ); - faw->frame_database = glade_xml_get_widget( xml, "frame_database" ); - faw->tf_host = GTK_ENTRY(glade_xml_get_widget( xml, "tf_host" )); + faw->frame_file = GTK_WIDGET(gtk_builder_get_object (builder, "frame_file" )); + faw->frame_database = GTK_WIDGET(gtk_builder_get_object (builder, "frame_database" )); + faw->tf_host = GTK_ENTRY(gtk_builder_get_object (builder, "tf_host" )); gtk_entry_set_text( faw->tf_host, DEFAULT_HOST ); - faw->tf_database = GTK_ENTRY(glade_xml_get_widget( xml, "tf_database" )); + faw->tf_database = GTK_ENTRY(gtk_builder_get_object (builder, "tf_database" )); default_db = get_default_database(); gtk_entry_set_text( faw->tf_database, default_db ); - faw->tf_username = GTK_ENTRY(glade_xml_get_widget( xml, "tf_username" )); - faw->tf_password = GTK_ENTRY(glade_xml_get_widget( xml, "tf_password" )); + faw->tf_username = GTK_ENTRY(gtk_builder_get_object (builder, "tf_username" )); + faw->tf_password = GTK_ENTRY(gtk_builder_get_object (builder, "tf_password" )); switch ( type ) { @@ -301,17 +303,17 @@ gnc_ui_file_access( int type ) break; } - op = GTK_BUTTON(glade_xml_get_widget( xml, "pb_op" )); + op = GTK_BUTTON(gtk_builder_get_object (builder, "pb_op" )); if ( op != NULL ) { gtk_button_set_label( op, button_label ); gtk_button_set_use_stock( op, TRUE ); } - align = glade_xml_get_widget( xml, "alignment_file_chooser" ); + file_chooser = GTK_WIDGET(gtk_builder_get_object (builder, "file_chooser" )); fileChooser = GTK_FILE_CHOOSER_WIDGET(gtk_file_chooser_widget_new( fileChooserAction )); faw->fileChooser = GTK_FILE_CHOOSER(fileChooser); - gtk_container_add( GTK_CONTAINER(align), GTK_WIDGET(fileChooser) ); + gtk_box_pack_start( GTK_BOX(file_chooser), GTK_WIDGET(fileChooser),TRUE, TRUE, 6 ); /* Set the default directory */ if (type == FILE_ACCESS_OPEN || type == FILE_ACCESS_SAVE_AS) @@ -320,18 +322,18 @@ gnc_ui_file_access( int type ) if ( last && gnc_uri_is_file_uri ( last ) ) { gchar *filepath = gnc_uri_get_path ( last ); - starting_dir = g_path_get_dirname( filepath ); + faw->starting_dir = g_path_get_dirname( filepath ); g_free ( filepath ); } } - if (!starting_dir) - starting_dir = gnc_get_default_directory(gconf_section); - gtk_file_chooser_set_current_folder(faw->fileChooser, starting_dir); + if (!faw->starting_dir) + faw->starting_dir = gnc_get_default_directory(gconf_section); + gtk_file_chooser_set_current_folder(faw->fileChooser, faw->starting_dir); g_object_connect( G_OBJECT(faw->fileChooser), "signal::file-activated", gnc_ui_file_access_file_activated_cb, faw, NULL ); - uri_type_container = glade_xml_get_widget( xml, "vb_uri_type_container" ); + uri_type_container = GTK_WIDGET(gtk_builder_get_object (builder, "vb_uri_type_container" )); faw->cb_uri_type = GTK_COMBO_BOX(gtk_combo_box_new_text()); gtk_container_add( GTK_CONTAINER(uri_type_container), GTK_WIDGET(faw->cb_uri_type) ); gtk_box_set_child_packing( GTK_BOX(uri_type_container), GTK_WIDGET(faw->cb_uri_type), @@ -341,8 +343,7 @@ gnc_ui_file_access( int type ) NULL ); /* Autoconnect signals */ - glade_xml_signal_autoconnect_full( xml, gnc_glade_autoconnect_full_func, - faw->dialog ); + gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, faw); /* See what qof backends are available and add appropriate ones to the combo box */ list = qof_backend_get_registered_access_method_list(); @@ -420,9 +421,7 @@ gnc_ui_file_access( int type ) } g_assert( active_access_method_index >= 0 ); - /* Clean up the xml data structure when the dialog is destroyed */ - g_object_set_data_full( G_OBJECT(faw->dialog), "dialog-file-access.glade", - xml, g_object_unref ); + g_object_unref(G_OBJECT(builder)); /* Run the dialog */ gtk_widget_show_all( faw->dialog ); diff --git a/src/gnome-utils/dialog-totd.c b/src/gnome-utils/dialog-totd.c index 65352e082c..6aa3bb75c6 100644 --- a/src/gnome-utils/dialog-totd.c +++ b/src/gnome-utils/dialog-totd.c @@ -1,32 +1,31 @@ -/* - * dialog-totd.c : dialog to display a "tip of the day" - * - * Initial copyright not recorded. - * Copyright (c) 2006 David Hampton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ +/********************************************************************\ + * dialog-totd.c : dialog to display a "tip of the day" * + * * + * Initial copyright not recorded. * + * Copyright (c) 2006 David Hampton * + * Copyright (c) 2011 Robert Fewell * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * + * Boston, MA 02110-1301, USA gnu@gnu.org * +\********************************************************************/ #include "config.h" - #include #include -#include #include "dialog-totd.h" #include "dialog-utils.h" @@ -35,7 +34,6 @@ #include "gnc-gnome-utils.h" #include "gnc-engine.h" - #define GCONF_SECTION "dialogs/tip_of_the_day" #define KEY_CURRENT_TIP "current_tip" #define KEY_SHOW_TIPS "show_at_startup" @@ -45,8 +43,8 @@ #define GNC_RESPONSE_BACK 2 /* Callbacks */ -void gnc_totd_dialog_response (GtkDialog *dialog, gint reponse, gpointer user_data); -void gnc_totd_dialog_startup_toggled (GtkToggleButton *button, gpointer user_data); +void gnc_totd_dialog_response_cb (GtkDialog *dialog, gint reponse, gpointer user_data); +void gnc_totd_dialog_startup_toggled_cb (GtkToggleButton *button, gpointer user_data); /* The Tips */ static gchar **tip_list; @@ -56,34 +54,36 @@ static gint current_tip_number = -1; /* This static indicates the debugging module that this .o belongs to. */ static QofLogModule log_module = GNC_MOD_GUI; +typedef struct +{ + GtkWidget *dialog; + GtkTextView *textview; + GtkWidget *showcheck_button; +}TotdDialog; -/*********************/ -/* Utility Functions */ -/*********************/ -/** This function should be called to change the tip number. It +/*********************************************************************** + * This function should be called to change the tip number. It * handles clamping the number to the range of tips available, saving * the number in the GConf database, and updating the dialog window * with the text of the newly selected tip. * - * @param widget A pointer to any widget in the dialog. This widget - * is used as a starting point to find the GtkTextView widget that - * holds the text of the tip. + * @param Tip of the day structure. This points to the dialog and + * the GtkTextView widget that holds the text of the tip. * * @param offset Which tip to show. If the value is zero then the * current tip will be shown. If the value is negative the previous * tip will be shown. If the value is positive the next tip will be * shown. - */ + ************************************************************************/ static void -gnc_new_tip_number (GtkWidget *widget, - gint offset) +gnc_new_tip_number (TotdDialog *totd_dialog, gint offset) { - GtkWidget *textview; + gchar **tip_components; gchar *tip; - ENTER("widget %p, offset %d", widget, offset); + ENTER("TotdDialog %p, offset %d", totd_dialog, offset); current_tip_number += offset; DEBUG("clamp %d to '0 <= x < %d'", current_tip_number, tip_count); if (current_tip_number < 0) @@ -115,49 +115,49 @@ gnc_new_tip_number (GtkWidget *widget, tip = g_strdup_printf( _(tip_components[0]), tip_components[1]); } - - textview = gnc_glade_lookup_widget(widget, "tip_textview"); g_strfreev(tip_components); - gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)), + gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(totd_dialog->textview)), tip, -1); g_free(tip); LEAVE(""); } -/********************/ -/* Callbacks */ -/********************/ - -void gnc_totd_dialog_response (GtkDialog *dialog, +/***************************/ +/* Dialog Callbacks */ +/***************************/ +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(GTK_WIDGET(dialog), 1); + gnc_new_tip_number(totd_dialog, 1); break; case GNC_RESPONSE_BACK: - gnc_new_tip_number(GTK_WIDGET(dialog), -1); + gnc_new_tip_number(totd_dialog, -1); break; case GTK_RESPONSE_CLOSE: - gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); + gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(totd_dialog->dialog)); /* fall through */ default: - gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, dialog); - gtk_widget_destroy(GTK_WIDGET(dialog)); + 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_totd_dialog_startup_toggled (GtkToggleButton *button, +gnc_totd_dialog_startup_toggled_cb (GtkToggleButton *button, gpointer user_data) { gboolean active; @@ -166,10 +166,10 @@ gnc_totd_dialog_startup_toggled (GtkToggleButton *button, gnc_gconf_set_bool(GCONF_SECTION, KEY_SHOW_TIPS, active, NULL); } -/********************/ -/* Parser */ -/********************/ +/***********************************/ +/* Tip of the Day Parser */ +/***********************************/ static gboolean gnc_totd_initialize (void) { @@ -242,7 +242,9 @@ gnc_totd_initialize (void) return TRUE; } -/** Raise the totd dialog to the top of the window stack. This + +/*********************************************************************** + * Raise the totd dialog to the top of the window stack. This * function is called if the user attempts to create a second totd * dialog. * @@ -252,53 +254,64 @@ gnc_totd_initialize (void) * * @param component_id Unused. * - * @param user_data A pointer to the totd dialog. + * @param user_data A pointer to the totd structure. * * @param iter_data Unused. - */ + ***********************************************************************/ static gboolean show_handler (const char *class, gint component_id, gpointer user_data, gpointer iter_data) { - GtkWidget *dialog; + TotdDialog *totd_dialog = user_data; ENTER(" "); - dialog = GTK_WIDGET(user_data); - gtk_window_present(GTK_WINDOW(dialog)); + if (!totd_dialog) + { + LEAVE("no data strucure"); + return(FALSE); + } + + gtk_window_present(GTK_WINDOW(totd_dialog->dialog)); LEAVE(" "); return(TRUE); } -/** Close the totd dialog. + +/**************************************************** + * Close the totd dialog. * * @internal * - * @param user_data A pointer to the totd dialog. - */ + * @param user_data A pointer to the totd structure. + ****************************************************/ static void close_handler (gpointer user_data) { - GtkWidget *dialog; + TotdDialog *totd_dialog = user_data; ENTER(" "); - dialog = GTK_WIDGET(user_data); - gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, dialog); - gtk_widget_destroy(dialog); + + gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, totd_dialog); + LEAVE(" "); } -/********************/ -/* Main */ -/********************/ - +/*************************************/ +/* Create the TotD Dialog */ +/*************************************/ void gnc_totd_dialog (GtkWindow *parent, gboolean startup) { - GladeXML *xml; + TotdDialog *totd_dialog; + + GtkBuilder *builder; GtkWidget *dialog, *button; + GtkTextView *textview; gboolean show_tips; + totd_dialog = g_new0 (TotdDialog, 1); + show_tips = gnc_gconf_get_bool(GCONF_SECTION, KEY_SHOW_TIPS, NULL); if (startup && !show_tips) return; @@ -315,20 +328,34 @@ gnc_totd_dialog (GtkWindow *parent, gboolean startup) return; } - xml = gnc_glade_xml_new ("totd.glade", "totd_dialog"); - dialog = glade_xml_get_widget (xml, "totd_dialog"); + builder = gtk_builder_new(); + gnc_builder_add_from_file (builder,"dialog-totd.glade", "totd_dialog"); + dialog = GTK_WIDGET(gtk_builder_get_object (builder, "totd_dialog")); gtk_window_set_transient_for(GTK_WINDOW (dialog), parent); - glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, - dialog); - gnc_new_tip_number(dialog, 1); + totd_dialog->dialog = dialog; + + ENTER("totd_dialog %p, dialog %p", totd_dialog, dialog); + + gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, totd_dialog); + + button = GTK_WIDGET(gtk_builder_get_object (builder, "show_checkbutton")); + totd_dialog->showcheck_button = button; - button = glade_xml_get_widget(xml, "show_checkbutton"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (button), show_tips); - gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); - gtk_widget_show(GTK_WIDGET (dialog)); + textview = GTK_TEXT_VIEW(gtk_builder_get_object (builder, "tip_textview")); + totd_dialog->textview = textview; + + gnc_new_tip_number(totd_dialog, 1); + + gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(totd_dialog->dialog)); + gtk_widget_show(GTK_WIDGET (totd_dialog->dialog)); gnc_register_gui_component(DIALOG_TOTD_CM_CLASS, - NULL, close_handler, dialog); + NULL, close_handler, totd_dialog); + + g_object_unref(G_OBJECT(builder)); + + LEAVE(""); } diff --git a/src/gnome-utils/dialog-totd.h b/src/gnome-utils/dialog-totd.h index 1248d7a038..7a5ea73999 100644 --- a/src/gnome-utils/dialog-totd.h +++ b/src/gnome-utils/dialog-totd.h @@ -1,25 +1,26 @@ -/* - * dialog-totd.h : dialog to display a "tip of the day" - * - * Copyright (c) 2005 David Hampton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ +/********************************************************************\ + * dialog-totd.h : dialog to display a "tip of the day" * + * * + * Initial copyright not recorded. * + * Copyright (c) 2006 David Hampton * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * + * Boston, MA 02110-1301, USA gnu@gnu.org * +\********************************************************************/ #ifndef DIALOG_TOTD_H #define DIALOG_TOTD_H diff --git a/src/gnome-utils/glade/Makefile.am b/src/gnome-utils/glade/Makefile.am index 0e9f69931f..af769fc286 100644 --- a/src/gnome-utils/glade/Makefile.am +++ b/src/gnome-utils/glade/Makefile.am @@ -1,7 +1,6 @@ gladedir = $(GNC_GLADE_DIR) glade_DATA = \ dialog-book-close.glade \ - dialog-file-access.glade \ dialog-object-references.glade \ dialog-query-list.glade \ dialog-reset-warnings.glade \ @@ -10,7 +9,6 @@ glade_DATA = \ druid-gconf-setup.glade \ druid-gnc-xml-import.glade \ gnc-gui-query.glade \ - preferences.glade \ - totd.glade + preferences.glade EXTRA_DIST = $(glade_DATA) diff --git a/src/gnome-utils/glade/dialog-file-access.glade b/src/gnome-utils/glade/dialog-file-access.glade deleted file mode 100644 index fe9741980c..0000000000 --- a/src/gnome-utils/glade/dialog-file-access.glade +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - 5 - center-on-parent - dialog - False - - - - True - vertical - 5 - - - True - 3 - - - True - 0 - <b>Data Format:</b> - True - - - False - 0 - - - - - True - vertical - - - - - - 1 - - - - - False - 1 - - - - - True - 0 - in - - - 550 - True - 0 - 0 - 3 - 3 - 3 - - - - - - - - True - <b>File</b> - True - - - label_item - - - - - 2 - - - - - True - 0 - in - - - True - 0 - 0 - 0 - 3 - 3 - 3 - - - True - 3 - - - True - vertical - - - True - 1 - Host - right - - - 0 - - - - - True - 1 - Database - right - - - 1 - - - - - True - 1 - Username - right - - - 2 - - - - - True - 1 - Password - right - - - 3 - - - - - False - 0 - - - - - True - vertical - - - True - True - - True - - - 0 - - - - - True - True - - True - - - 1 - - - - - True - True - - True - - - 2 - - - - - True - True - False - - True - - - 3 - - - - - 1 - - - - - - - - - True - <b>Database Connection</b> - True - - - label_item - - - - - False - False - 2 - - - - - True - end - - - gtk-cancel - -6 - True - True - True - True - - - False - False - 0 - - - - - gtk-save-as - -5 - True - True - True - True - True - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - diff --git a/src/gnome-utils/gnc-file.c b/src/gnome-utils/gnc-file.c index 7447498c8a..515e0b210d 100644 --- a/src/gnome-utils/gnc-file.c +++ b/src/gnome-utils/gnc-file.c @@ -579,6 +579,9 @@ gnc_file_query_save (gboolean can_cancel) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_SAVE, GTK_RESPONSE_YES); + + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES); + response = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); diff --git a/src/gnome-utils/gtkbuilder/Makefile.am b/src/gnome-utils/gtkbuilder/Makefile.am index fd21844986..21d0fe0cac 100644 --- a/src/gnome-utils/gtkbuilder/Makefile.am +++ b/src/gnome-utils/gtkbuilder/Makefile.am @@ -2,11 +2,13 @@ gtkbuilderdir = $(GNC_GTKBUILDER_DIR) gtkbuilder_DATA = \ dialog-account.glade \ dialog-commodity.glade \ + dialog-file-access.glade \ + dialog-totd.glade \ dialog-transfer.glade \ dialog-userpass.glade \ gnc-date-format.glade \ gnc-frequency.glade \ - gnc-tree-view-owner.glade \ - gnc-recurrence.glade + gnc-recurrence.glade \ + gnc-tree-view-owner.glade EXTRA_DIST = $(gtkbuilder_DATA) diff --git a/src/gnome-utils/gtkbuilder/dialog-file-access.glade b/src/gnome-utils/gtkbuilder/dialog-file-access.glade new file mode 100644 index 0000000000..085fae190d --- /dev/null +++ b/src/gnome-utils/gtkbuilder/dialog-file-access.glade @@ -0,0 +1,321 @@ + + + + + + False + 5 + center-on-parent + 600 + 500 + dialog + + + + True + False + 5 + + + True + False + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + gtk-save-as + True + True + True + True + True + False + True + + + False + False + 1 + + + + + False + True + end + 0 + + + + + True + False + 3 + + + True + False + 0 + <b>Data Format:</b> + True + + + False + True + 0 + + + + + True + False + + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 0 + in + + + True + False + 6 + + + + + + + + True + False + <b>File</b> + True + + + + + True + True + 2 + + + + + True + False + 0 + in + + + True + False + 6 + 3 + + + True + False + + + True + False + 1 + Host + right + + + True + True + 0 + + + + + True + False + 1 + Database + right + + + True + True + 1 + + + + + True + False + 1 + Username + right + + + True + True + 2 + + + + + True + False + 1 + Password + right + + + True + True + 3 + + + + + False + True + 0 + + + + + True + False + + + True + True + + True + True + False + False + True + True + + + True + True + 0 + + + + + True + True + + True + True + False + False + True + True + + + True + True + 1 + + + + + True + True + + True + True + False + False + True + True + + + True + True + 2 + + + + + True + True + False + + True + True + False + False + True + True + + + True + True + 3 + + + + + True + True + 1 + + + + + + + True + False + <b>Database Connection</b> + True + + + + + False + False + 3 + + + + + + cancel_button + pb_op + + + diff --git a/src/gnome-utils/glade/totd.glade b/src/gnome-utils/gtkbuilder/dialog-totd.glade similarity index 64% rename from src/gnome-utils/glade/totd.glade rename to src/gnome-utils/gtkbuilder/dialog-totd.glade index 5329589b86..a5711ff7e4 100644 --- a/src/gnome-utils/glade/totd.glade +++ b/src/gnome-utils/gtkbuilder/dialog-totd.glade @@ -1,120 +1,36 @@ - - - - + + + + True + False 6 GnuCash Tip Of The Day 400 300 dialog - + - + True - vertical + False 6 - - - True - 12 - vertical - 18 - - - True - vertical - 6 - - - True - 0 - <b>Tip of the Day:</b> - True - True - - - False - False - 0 - - - - - True - - - True - - - - False - False - 0 - - - - - True - True - 6 - False - word - False - The text of the tip goes here. Some example placeholder text: -If you are looking for a stable personal finance application, you should use -the latest "stable" release of GnuCash. See http://www.gnucash.org - - - 1 - - - - - 1 - - - - - 0 - - - - - _Show tips at startup - True - True - False - True - True - - - - False - False - 1 - - - - - 2 - - - + True + False end - + gtk-go-back - 2 True True True - False + True + False True - + False False @@ -122,15 +38,15 @@ the latest "stable" release of GnuCash. See http://www.gnucash.org - + gtk-go-forward - 1 True True True - False + True + False True - + False False @@ -138,14 +54,14 @@ the latest "stable" release of GnuCash. See http://www.gnucash.org - + gtk-cancel - -6 True True - False + True + False True - + False False @@ -153,29 +69,133 @@ the latest "stable" release of GnuCash. See http://www.gnucash.org - + gtk-close - -7 True True True - False + True + False True - + False False 3 - + False + True end 0 - + + + True + False + 12 + 18 + + + True + False + 6 + + + True + False + 0 + <b>Tip of the Day:</b> + True + True + + + False + False + 0 + + + + + True + False + + + True + False + + + + False + False + 0 + + + + + True + True + 6 + False + word + 5 + 5 + False + + + True + True + 1 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + _Show tips at startup + True + True + False + False + True + True + + + + False + False + 1 + + + + + True + True + 2 + + + - - + + back-button + forward-button + cancel-button + close-button + + +