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
This commit is contained in:
Geert Janssens
2011-10-18 18:10:57 +00:00
parent ac3f924152
commit 43820fe81a
10 changed files with 624 additions and 529 deletions

View File

@@ -233,6 +233,7 @@ src/gnome/gtkbuilder/dialog-progress.glade
src/gnome/gtkbuilder/dialog-sx.glade src/gnome/gtkbuilder/dialog-sx.glade
src/gnome/gtkbuilder/gnc-plugin-page-budget.glade src/gnome/gtkbuilder/gnc-plugin-page-budget.glade
src/gnome/gtkbuilder/gnc-plugin-page-register.glade src/gnome/gtkbuilder/gnc-plugin-page-register.glade
src/gnome/gtkbuilder/sched-xact.glade
src/gnome/gtkbuilder/tax.glade src/gnome/gtkbuilder/tax.glade
src/gnome/gtkbuilder/window-autoclear.glade src/gnome/gtkbuilder/window-autoclear.glade
src/gnome/gtkbuilder/window-reconcile.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-gnc-xml-import.c
src/gnome-utils/druid-utils.c src/gnome-utils/druid-utils.c
src/gnome-utils/glade/dialog-book-close.glade 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-object-references.glade
src/gnome-utils/glade/dialog-query-list.glade src/gnome-utils/glade/dialog-query-list.glade
src/gnome-utils/glade/dialog-reset-warnings.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/exchange-dialog.glade
src/gnome-utils/glade/gnc-gui-query.glade src/gnome-utils/glade/gnc-gui-query.glade
src/gnome-utils/glade/preferences.glade src/gnome-utils/glade/preferences.glade
src/gnome-utils/glade/totd.glade
src/gnome-utils/gnc-account-sel.c src/gnome-utils/gnc-account-sel.c
src/gnome-utils/gnc-amount-edit.c src/gnome-utils/gnc-amount-edit.c
src/gnome-utils/gnc-autosave.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/gnc-window.c
src/gnome-utils/gtkbuilder/dialog-account.glade src/gnome-utils/gtkbuilder/dialog-account.glade
src/gnome-utils/gtkbuilder/dialog-commodity.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-transfer.glade
src/gnome-utils/gtkbuilder/dialog-userpass.glade src/gnome-utils/gtkbuilder/dialog-userpass.glade
src/gnome-utils/gtkbuilder/gnc-date-format.glade src/gnome-utils/gtkbuilder/gnc-date-format.glade

View File

@@ -26,7 +26,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <glade/glade.h>
#include "gnc-ui.h" #include "gnc-ui.h"
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
@@ -54,6 +53,7 @@ typedef struct FileAccessWindow
GtkWidget* frame_file; GtkWidget* frame_file;
GtkWidget* frame_database; GtkWidget* frame_database;
GtkFileChooser* fileChooser; GtkFileChooser* fileChooser;
gchar *starting_dir;
GtkComboBox* cb_uri_type; GtkComboBox* cb_uri_type;
GtkEntry* tf_host; GtkEntry* tf_host;
GtkEntry* tf_database; 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_show(faw->frame_file);
gtk_widget_hide(faw->frame_database); gtk_widget_hide(faw->frame_database);
gtk_file_chooser_set_current_folder(faw->fileChooser, faw->starting_dir);
} }
else else
{ {
@@ -231,11 +232,11 @@ static void
gnc_ui_file_access( int type ) gnc_ui_file_access( int type )
{ {
FileAccessWindow *faw; FileAccessWindow *faw;
GladeXML* xml; GtkBuilder* builder;
GtkWidget* box; GtkWidget* box;
GList* ds_node; GList* ds_node;
GtkButton* op; GtkButton* op;
GtkWidget* align; GtkWidget* file_chooser;
GtkFileChooserWidget* fileChooser; GtkFileChooserWidget* fileChooser;
GtkFileChooserAction fileChooserAction = GTK_FILE_CHOOSER_ACTION_OPEN; GtkFileChooserAction fileChooserAction = GTK_FILE_CHOOSER_ACTION_OPEN;
GList* list; GList* list;
@@ -252,7 +253,6 @@ gnc_ui_file_access( int type )
const gchar *button_label = NULL; const gchar *button_label = NULL;
const gchar *gconf_section = NULL; const gchar *gconf_section = NULL;
gchar *last; gchar *last;
gchar *starting_dir = NULL;
g_return_if_fail( type == FILE_ACCESS_OPEN || type == FILE_ACCESS_SAVE_AS || type == FILE_ACCESS_EXPORT ); 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 ); g_return_if_fail( faw != NULL );
faw->type = type; faw->type = type;
faw->starting_dir = NULL;
/* Open the dialog */ /* Open the dialog */
xml = gnc_glade_xml_new( "dialog-file-access.glade", "File Access" ); builder = gtk_builder_new();
faw->dialog = glade_xml_get_widget( xml, "File Access" ); 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_object_set_data_full( G_OBJECT(faw->dialog), "FileAccessWindow", faw,
g_free ); g_free );
faw->frame_file = glade_xml_get_widget( xml, "frame_file" ); faw->frame_file = GTK_WIDGET(gtk_builder_get_object (builder, "frame_file" ));
faw->frame_database = glade_xml_get_widget( xml, "frame_database" ); faw->frame_database = GTK_WIDGET(gtk_builder_get_object (builder, "frame_database" ));
faw->tf_host = GTK_ENTRY(glade_xml_get_widget( xml, "tf_host" )); faw->tf_host = GTK_ENTRY(gtk_builder_get_object (builder, "tf_host" ));
gtk_entry_set_text( faw->tf_host, DEFAULT_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(); default_db = get_default_database();
gtk_entry_set_text( faw->tf_database, default_db ); gtk_entry_set_text( faw->tf_database, default_db );
faw->tf_username = GTK_ENTRY(glade_xml_get_widget( xml, "tf_username" )); faw->tf_username = GTK_ENTRY(gtk_builder_get_object (builder, "tf_username" ));
faw->tf_password = GTK_ENTRY(glade_xml_get_widget( xml, "tf_password" )); faw->tf_password = GTK_ENTRY(gtk_builder_get_object (builder, "tf_password" ));
switch ( type ) switch ( type )
{ {
@@ -301,17 +303,17 @@ gnc_ui_file_access( int type )
break; break;
} }
op = GTK_BUTTON(glade_xml_get_widget( xml, "pb_op" )); op = GTK_BUTTON(gtk_builder_get_object (builder, "pb_op" ));
if ( op != NULL ) if ( op != NULL )
{ {
gtk_button_set_label( op, button_label ); gtk_button_set_label( op, button_label );
gtk_button_set_use_stock( op, TRUE ); 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 )); fileChooser = GTK_FILE_CHOOSER_WIDGET(gtk_file_chooser_widget_new( fileChooserAction ));
faw->fileChooser = GTK_FILE_CHOOSER(fileChooser); 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 */ /* Set the default directory */
if (type == FILE_ACCESS_OPEN || type == FILE_ACCESS_SAVE_AS) 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 ) ) if ( last && gnc_uri_is_file_uri ( last ) )
{ {
gchar *filepath = gnc_uri_get_path ( 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 ); g_free ( filepath );
} }
} }
if (!starting_dir) if (!faw->starting_dir)
starting_dir = gnc_get_default_directory(gconf_section); faw->starting_dir = gnc_get_default_directory(gconf_section);
gtk_file_chooser_set_current_folder(faw->fileChooser, starting_dir); gtk_file_chooser_set_current_folder(faw->fileChooser, faw->starting_dir);
g_object_connect( G_OBJECT(faw->fileChooser), "signal::file-activated", g_object_connect( G_OBJECT(faw->fileChooser), "signal::file-activated",
gnc_ui_file_access_file_activated_cb, faw, NULL ); 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()); 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_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), 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 ); NULL );
/* Autoconnect signals */ /* Autoconnect signals */
glade_xml_signal_autoconnect_full( xml, gnc_glade_autoconnect_full_func, gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, faw);
faw->dialog );
/* See what qof backends are available and add appropriate ones to the combo box */ /* See what qof backends are available and add appropriate ones to the combo box */
list = qof_backend_get_registered_access_method_list(); 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 ); g_assert( active_access_method_index >= 0 );
/* Clean up the xml data structure when the dialog is destroyed */ g_object_unref(G_OBJECT(builder));
g_object_set_data_full( G_OBJECT(faw->dialog), "dialog-file-access.glade",
xml, g_object_unref );
/* Run the dialog */ /* Run the dialog */
gtk_widget_show_all( faw->dialog ); gtk_widget_show_all( faw->dialog );

View File

@@ -1,32 +1,31 @@
/* /********************************************************************\
* dialog-totd.c : dialog to display a "tip of the day" * dialog-totd.c : dialog to display a "tip of the day" *
* * *
* Initial copyright not recorded. * Initial copyright not recorded. *
* Copyright (c) 2006 David Hampton <hampton@employees.org> * Copyright (c) 2006 David Hampton <hampton@employees.org> *
* * 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 * This program is free software; you can redistribute it and/or *
* published by the Free Software Foundation; either version 2 of * modify it under the terms of the GNU General Public License as *
* the License, or (at your option) any later version. * 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 * This program is distributed in the hope that it will be useful, *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* GNU General Public License for more details. * 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: * 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 * Free Software Foundation Voice: +1-617-542-5942 *
* Boston, MA 02110-1301, USA gnu@gnu.org * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
*/ * Boston, MA 02110-1301, USA gnu@gnu.org *
\********************************************************************/
#include "config.h" #include "config.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <glade/glade-xml.h>
#include "dialog-totd.h" #include "dialog-totd.h"
#include "dialog-utils.h" #include "dialog-utils.h"
@@ -35,7 +34,6 @@
#include "gnc-gnome-utils.h" #include "gnc-gnome-utils.h"
#include "gnc-engine.h" #include "gnc-engine.h"
#define GCONF_SECTION "dialogs/tip_of_the_day" #define GCONF_SECTION "dialogs/tip_of_the_day"
#define KEY_CURRENT_TIP "current_tip" #define KEY_CURRENT_TIP "current_tip"
#define KEY_SHOW_TIPS "show_at_startup" #define KEY_SHOW_TIPS "show_at_startup"
@@ -45,8 +43,8 @@
#define GNC_RESPONSE_BACK 2 #define GNC_RESPONSE_BACK 2
/* Callbacks */ /* Callbacks */
void gnc_totd_dialog_response (GtkDialog *dialog, gint reponse, gpointer user_data); void gnc_totd_dialog_response_cb (GtkDialog *dialog, gint reponse, gpointer user_data);
void gnc_totd_dialog_startup_toggled (GtkToggleButton *button, gpointer user_data); void gnc_totd_dialog_startup_toggled_cb (GtkToggleButton *button, gpointer user_data);
/* The Tips */ /* The Tips */
static gchar **tip_list; 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. */ /* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI; 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 * handles clamping the number to the range of tips available, saving
* the number in the GConf database, and updating the dialog window * the number in the GConf database, and updating the dialog window
* with the text of the newly selected tip. * with the text of the newly selected tip.
* *
* @param widget A pointer to any widget in the dialog. This widget * @param Tip of the day structure. This points to the dialog and
* is used as a starting point to find the GtkTextView widget that * the GtkTextView widget that holds the text of the tip.
* holds the text of the tip.
* *
* @param offset Which tip to show. If the value is zero then the * @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 * 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 * tip will be shown. If the value is positive the next tip will be
* shown. * shown.
*/ ************************************************************************/
static void static void
gnc_new_tip_number (GtkWidget *widget, gnc_new_tip_number (TotdDialog *totd_dialog, gint offset)
gint offset)
{ {
GtkWidget *textview;
gchar **tip_components; gchar **tip_components;
gchar *tip; gchar *tip;
ENTER("widget %p, offset %d", widget, offset); ENTER("TotdDialog %p, offset %d", totd_dialog, offset);
current_tip_number += offset; current_tip_number += offset;
DEBUG("clamp %d to '0 <= x < %d'", current_tip_number, tip_count); DEBUG("clamp %d to '0 <= x < %d'", current_tip_number, tip_count);
if (current_tip_number < 0) 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]); tip = g_strdup_printf( _(tip_components[0]), tip_components[1]);
} }
textview = gnc_glade_lookup_widget(widget, "tip_textview");
g_strfreev(tip_components); 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); tip, -1);
g_free(tip); g_free(tip);
LEAVE(""); LEAVE("");
} }
/********************/ /***************************/
/* Callbacks */ /* Dialog Callbacks */
/********************/ /***************************/
void gnc_totd_dialog_response_cb (GtkDialog *dialog,
void gnc_totd_dialog_response (GtkDialog *dialog,
gint response, gint response,
gpointer user_data) gpointer user_data)
{ {
TotdDialog *totd_dialog = user_data;
ENTER("dialog %p, response %d, user_data %p", dialog, response, user_data); ENTER("dialog %p, response %d, user_data %p", dialog, response, user_data);
switch (response) switch (response)
{ {
case GNC_RESPONSE_FORWARD: case GNC_RESPONSE_FORWARD:
gnc_new_tip_number(GTK_WIDGET(dialog), 1); gnc_new_tip_number(totd_dialog, 1);
break; break;
case GNC_RESPONSE_BACK: case GNC_RESPONSE_BACK:
gnc_new_tip_number(GTK_WIDGET(dialog), -1); gnc_new_tip_number(totd_dialog, -1);
break; break;
case GTK_RESPONSE_CLOSE: 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 */ /* fall through */
default: default:
gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, dialog); gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, totd_dialog->dialog);
gtk_widget_destroy(GTK_WIDGET(dialog)); gtk_widget_destroy(GTK_WIDGET(totd_dialog->dialog));
break; break;
} }
LEAVE(""); LEAVE("");
} }
void void
gnc_totd_dialog_startup_toggled (GtkToggleButton *button, gnc_totd_dialog_startup_toggled_cb (GtkToggleButton *button,
gpointer user_data) gpointer user_data)
{ {
gboolean active; gboolean active;
@@ -166,10 +166,10 @@ gnc_totd_dialog_startup_toggled (GtkToggleButton *button,
gnc_gconf_set_bool(GCONF_SECTION, KEY_SHOW_TIPS, active, NULL); gnc_gconf_set_bool(GCONF_SECTION, KEY_SHOW_TIPS, active, NULL);
} }
/********************/
/* Parser */
/********************/
/***********************************/
/* Tip of the Day Parser */
/***********************************/
static gboolean static gboolean
gnc_totd_initialize (void) gnc_totd_initialize (void)
{ {
@@ -242,7 +242,9 @@ gnc_totd_initialize (void)
return TRUE; 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 * function is called if the user attempts to create a second totd
* dialog. * dialog.
* *
@@ -252,53 +254,64 @@ gnc_totd_initialize (void)
* *
* @param component_id Unused. * @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. * @param iter_data Unused.
*/ ***********************************************************************/
static gboolean static gboolean
show_handler (const char *class, gint component_id, show_handler (const char *class, gint component_id,
gpointer user_data, gpointer iter_data) gpointer user_data, gpointer iter_data)
{ {
GtkWidget *dialog; TotdDialog *totd_dialog = user_data;
ENTER(" "); ENTER(" ");
dialog = GTK_WIDGET(user_data); if (!totd_dialog)
gtk_window_present(GTK_WINDOW(dialog)); {
LEAVE("no data strucure");
return(FALSE);
}
gtk_window_present(GTK_WINDOW(totd_dialog->dialog));
LEAVE(" "); LEAVE(" ");
return(TRUE); return(TRUE);
} }
/** Close the totd dialog.
/****************************************************
* Close the totd dialog.
* *
* @internal * @internal
* *
* @param user_data A pointer to the totd dialog. * @param user_data A pointer to the totd structure.
*/ ****************************************************/
static void static void
close_handler (gpointer user_data) close_handler (gpointer user_data)
{ {
GtkWidget *dialog; TotdDialog *totd_dialog = user_data;
ENTER(" "); ENTER(" ");
dialog = GTK_WIDGET(user_data);
gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, dialog); gnc_unregister_gui_component_by_data(DIALOG_TOTD_CM_CLASS, totd_dialog);
gtk_widget_destroy(dialog);
LEAVE(" "); LEAVE(" ");
} }
/********************/ /*************************************/
/* Main */ /* Create the TotD Dialog */
/********************/ /*************************************/
void void
gnc_totd_dialog (GtkWindow *parent, gboolean startup) gnc_totd_dialog (GtkWindow *parent, gboolean startup)
{ {
GladeXML *xml; TotdDialog *totd_dialog;
GtkBuilder *builder;
GtkWidget *dialog, *button; GtkWidget *dialog, *button;
GtkTextView *textview;
gboolean show_tips; gboolean show_tips;
totd_dialog = g_new0 (TotdDialog, 1);
show_tips = gnc_gconf_get_bool(GCONF_SECTION, KEY_SHOW_TIPS, NULL); show_tips = gnc_gconf_get_bool(GCONF_SECTION, KEY_SHOW_TIPS, NULL);
if (startup && !show_tips) if (startup && !show_tips)
return; return;
@@ -315,20 +328,34 @@ gnc_totd_dialog (GtkWindow *parent, gboolean startup)
return; return;
} }
xml = gnc_glade_xml_new ("totd.glade", "totd_dialog"); builder = gtk_builder_new();
dialog = glade_xml_get_widget (xml, "totd_dialog"); 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); 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); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (button), show_tips);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); textview = GTK_TEXT_VIEW(gtk_builder_get_object (builder, "tip_textview"));
gtk_widget_show(GTK_WIDGET (dialog)); 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, gnc_register_gui_component(DIALOG_TOTD_CM_CLASS,
NULL, close_handler, dialog); NULL, close_handler, totd_dialog);
g_object_unref(G_OBJECT(builder));
LEAVE("");
} }

View File

@@ -1,25 +1,26 @@
/* /********************************************************************\
* dialog-totd.h : dialog to display a "tip of the day" * dialog-totd.h : dialog to display a "tip of the day" *
* * *
* Copyright (c) 2005 David Hampton <hampton@employees.org> * Initial copyright not recorded. *
* * Copyright (c) 2006 David Hampton <hampton@employees.org> *
* This program is free software; you can redistribute it and/or * *
* modify it under the terms of the GNU General Public License as * This program is free software; you can redistribute it and/or *
* published by the Free Software Foundation; either version 2 of * modify it under the terms of the GNU General Public License as *
* the License, or (at your option) any later version. * 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 * This program is distributed in the hope that it will be useful, *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* GNU General Public License for more details. * 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: * 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 * Free Software Foundation Voice: +1-617-542-5942 *
* Boston, MA 02110-1301, USA gnu@gnu.org * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
*/ * Boston, MA 02110-1301, USA gnu@gnu.org *
\********************************************************************/
#ifndef DIALOG_TOTD_H #ifndef DIALOG_TOTD_H
#define DIALOG_TOTD_H #define DIALOG_TOTD_H

View File

@@ -1,7 +1,6 @@
gladedir = $(GNC_GLADE_DIR) gladedir = $(GNC_GLADE_DIR)
glade_DATA = \ glade_DATA = \
dialog-book-close.glade \ dialog-book-close.glade \
dialog-file-access.glade \
dialog-object-references.glade \ dialog-object-references.glade \
dialog-query-list.glade \ dialog-query-list.glade \
dialog-reset-warnings.glade \ dialog-reset-warnings.glade \
@@ -10,7 +9,6 @@ glade_DATA = \
druid-gconf-setup.glade \ druid-gconf-setup.glade \
druid-gnc-xml-import.glade \ druid-gnc-xml-import.glade \
gnc-gui-query.glade \ gnc-gui-query.glade \
preferences.glade \ preferences.glade
totd.glade
EXTRA_DIST = $(glade_DATA) EXTRA_DIST = $(glade_DATA)

View File

@@ -1,277 +0,0 @@
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.10 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="File Access">
<property name="border_width">5</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<signal name="response" handler="gnc_ui_file_access_response_cb"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<widget class="GtkLabel" id="uri_type_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Data Format:&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vb_uri_type_container">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame_file">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkAlignment" id="alignment_file_chooser">
<property name="width_request">550</property>
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="bottom_padding">3</property>
<property name="left_padding">3</property>
<property name="right_padding">3</property>
<child>
<placeholder/>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;File&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame_database">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="yscale">0</property>
<property name="bottom_padding">3</property>
<property name="left_padding">3</property>
<property name="right_padding">3</property>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<widget class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Host</property>
<property name="justify">right</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Database</property>
<property name="justify">right</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Username</property>
<property name="justify">right</property>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Password</property>
<property name="justify">right</property>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkEntry" id="tf_host">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="tf_database">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="tf_username">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="tf_password">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Database Connection&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area3">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="cancel_button">
<property name="label">gtk-cancel</property>
<property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="pb_op">
<property name="label">gtk-save-as</property>
<property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View File

@@ -579,6 +579,9 @@ gnc_file_query_save (gboolean can_cancel)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(GTK_DIALOG(dialog), gtk_dialog_add_button(GTK_DIALOG(dialog),
GTK_STOCK_SAVE, GTK_RESPONSE_YES); GTK_STOCK_SAVE, GTK_RESPONSE_YES);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
response = gtk_dialog_run(GTK_DIALOG(dialog)); response = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog); gtk_widget_destroy(dialog);

View File

@@ -2,11 +2,13 @@ gtkbuilderdir = $(GNC_GTKBUILDER_DIR)
gtkbuilder_DATA = \ gtkbuilder_DATA = \
dialog-account.glade \ dialog-account.glade \
dialog-commodity.glade \ dialog-commodity.glade \
dialog-file-access.glade \
dialog-totd.glade \
dialog-transfer.glade \ dialog-transfer.glade \
dialog-userpass.glade \ dialog-userpass.glade \
gnc-date-format.glade \ gnc-date-format.glade \
gnc-frequency.glade \ gnc-frequency.glade \
gnc-tree-view-owner.glade \ gnc-recurrence.glade \
gnc-recurrence.glade gnc-tree-view-owner.glade
EXTRA_DIST = $(gtkbuilder_DATA) EXTRA_DIST = $(gtkbuilder_DATA)

View File

@@ -0,0 +1,321 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="File Access">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property>
<property name="default_height">500</property>
<property name="type_hint">dialog</property>
<signal name="response" handler="gnc_ui_file_access_response_cb" swapped="no"/>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="cancel_button">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="pb_op">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="uri_type_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Data Format:&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vb_uri_type_container">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_file">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkVBox" id="file_chooser">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;File&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_database">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="spacing">3</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Host</property>
<property name="justify">right</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Database</property>
<property name="justify">right</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Username</property>
<property name="justify">right</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Password</property>
<property name="justify">right</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEntry" id="tf_host">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
<property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="tf_database">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
<property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="tf_username">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
<property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="tf_password">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
<property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Database Connection&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-5">pb_op</action-widget>
</action-widgets>
</object>
</interface>

View File

@@ -1,120 +1,36 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<glade-interface> <interface>
<!-- interface-requires gtk+ 2.10 --> <requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy project-wide -->
<widget class="GtkDialog" id="totd_dialog"> <object class="GtkDialog" id="totd_dialog">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">GnuCash Tip Of The Day</property> <property name="title" translatable="yes">GnuCash Tip Of The Day</property>
<property name="default_width">400</property> <property name="default_width">400</property>
<property name="default_height">300</property> <property name="default_height">300</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<signal name="response" handler="gnc_totd_dialog_response"/> <signal name="response" handler="gnc_totd_dialog_response_cb" swapped="no"/>
<child internal-child="vbox"> <child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1"> <object class="GtkVBox" id="dialog-vbox3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="can_focus">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child>
<widget class="GtkVBox" id="totd_vbox">
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Tip of the Day:&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label"> </property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkTextView" id="tip_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">6</property>
<property name="editable">False</property>
<property name="wrap_mode">word</property>
<property name="cursor_visible">False</property>
<property name="text">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</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="show_checkbutton">
<property name="label" translatable="yes">_Show tips at startup</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="gnc_totd_dialog_startup_toggled"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area"> <child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1"> <object class="GtkHButtonBox" id="dialog-action_area3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<widget class="GtkButton" id="button1"> <object class="GtkButton" id="back-button">
<property name="label">gtk-go-back</property> <property name="label">gtk-go-back</property>
<property name="response_id">2</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="receives_default">False</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@@ -122,15 +38,15 @@ the latest "stable" release of GnuCash. See http://www.gnucash.org</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button2"> <object class="GtkButton" id="forward-button">
<property name="label">gtk-go-forward</property> <property name="label">gtk-go-forward</property>
<property name="response_id">1</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="receives_default">False</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@@ -138,14 +54,14 @@ the latest "stable" release of GnuCash. See http://www.gnucash.org</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="hidden_button"> <object class="GtkButton" id="cancel-button">
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="response_id">-6</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="receives_default">False</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@@ -153,29 +69,133 @@ the latest "stable" release of GnuCash. See http://www.gnucash.org</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button3"> <object class="GtkButton" id="close-button">
<property name="label">gtk-close</property> <property name="label">gtk-close</property>
<property name="response_id">-7</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="receives_default">False</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
</widget> <child>
<object class="GtkVBox" id="totd_vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="spacing">18</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Tip of the Day:&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child> </child>
</widget> <child>
</glade-interface> <object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"> </property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTextView" id="tip_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">6</property>
<property name="editable">False</property>
<property name="wrap_mode">word</property>
<property name="left_margin">5</property>
<property name="right_margin">5</property>
<property name="cursor_visible">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="show_checkbutton">
<property name="label" translatable="yes">_Show tips at startup</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="gnc_totd_dialog_startup_toggled_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="2">back-button</action-widget>
<action-widget response="1">forward-button</action-widget>
<action-widget response="-6">cancel-button</action-widget>
<action-widget response="-7">close-button</action-widget>
</action-widgets>
</object>
</interface>