GnuCash  5.6-150-g038405b370+
Data Structures | Macros | Functions | Variables
dialog-preferences.c File Reference

Dialog for handling user preferences. More...

#include <config.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "dialog-utils.h"
#include "gnc-currency-edit.h"
#include "gnc-date-edit.h"
#include "gnc-gobject-utils.h"
#include "gnc-period-select.h"
#include "gnc-engine.h"
#include "Account.h"
#include "gnc-prefs.h"
#include "gnc-ui.h"
#include "gnc-ui-util.h"
#include <gnc-session.h>
#include "gnc-component-manager.h"
#include "dialog-preferences.h"
#include "dialog-doclink-utils.h"

Go to the source code of this file.

Data Structures

struct  addition
 This data structure holds the information for a single addition to the preferences dialog. More...
 
struct  copy_data
 This data structure is used while building the preferences dialog to copy a grid from a glade file to the dialog under construction. More...
 

Macros

#define DIALOG_PREFERENCES_CM_CLASS   "dialog-newpreferences"
 
#define GNC_PREFS_GROUP   "dialogs.preferences"
 
#define PREF_PREFIX_LEN   sizeof("pref/") - 1
 
#define PREFS_WIDGET_HASH   "prefs_widget_hash"
 
#define NOTEBOOK   "notebook"
 

Functions

void gnc_preferences_response_cb (GtkDialog *dialog, gint response, GtkDialog *unused)
 Handle a user click on one of the buttons at the bottom of the preference dialog. More...
 
void gnc_account_separator_pref_changed_cb (GtkEntry *entry, GtkWidget *dialog)
 This function is called whenever the account separator is changed in the preferences dialog. More...
 
void gnc_save_on_close_expires_cb (GtkToggleButton *button, GtkWidget *dialog)
 Called when the save-on-close checkbutton is toggled.
 
gboolean gnc_preferences_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
 
void gnc_preferences_add_page (const gchar *filename, const gchar *widgetname, const gchar *tabname)
 This function adds a full page of preferences to the preferences dialog. More...
 
void gnc_preferences_add_to_page (const gchar *filename, const gchar *widgetname, const gchar *tabname)
 This function adds a partial page of preferences to the preferences dialog. More...
 
void gnc_preferences_dialog (GtkWindow *parent)
 This function creates the preferences dialog and presents it to the user. More...
 

Variables

GSList * add_ins = NULL
 A list of all additions that have been made to the preferences dialog. More...
 

Detailed Description

Dialog for handling user preferences.

Author
Copyright (c) 2005 David Hampton hampt.nosp@m.on@e.nosp@m.mploy.nosp@m.ees..nosp@m.org

These functions are the external API available for the user preference dialog. This dialog allows a user to modify several user preferences in the gnucash preferences database. Any module may add a page (or partial page) of preferences to the dialog. These additions are done by providing the name of a glade file and the content to load from that file along with a widget in that file. If a partial page is added, the widget name provided must be that of a GtkGrid containing four columns. If a full page is added, the widget name provided to this code can be any kind of widget, but for consistency it should probably be the same.

If a widget name is in the form pref/aaa.bbb/ccc... and it is a type of widget this code knows how to handle, then the widget is bound to the preference named ccc in group aaa.bbb. This means that if the widget's value changes, the preference is automatically updated. The same goes the other way around. This code currently knows about font buttons, radio buttons, check buttons, spin boxes, combo boxes, gnucash currency select widgets, gnucash accounting period widgets, and a gnucash date edit widget. (Combo boxes should not be used for less than five choices. Use a radio button group instead.)

The argument is a glade file, so if your code has special requirements (e.g. make one widget insensitive until another is selected) feel free to go ahead and add your own callbacks to the glade file. This code will connect any callbacks that exist in the glade file.

Definition in file dialog-preferences.c.