Preferences Dialog
[Dialogs]


Files

file  dialog-preferences.c
 Dialog for handling user preferences.
file  dialog-preferences.h
 Dialog for handling user preferences.

Data Structures

struct  addition_t
struct  copy_data

Defines

#define GLADE_FILENAME   "preferences.glade"
#define DIALOG_PREFERENCES_CM_CLASS   "dialog-newpreferences"
#define GCONF_SECTION   "dialogs/preferences"
#define PREFIX_LEN   sizeof("gconf/") - 1
#define WIDGET_HASH   "widget_hash"
#define NOTEBOOK   "notebook"

Typedefs

typedef addition_t addition

Functions

void gnc_preferences_response_cb (GtkDialog *dialog, gint response, GtkDialog *unused)
void gnc_reset_warnings_select_all_cb (GtkButton *button, gpointer user_data)
void gnc_reset_warnings_unselect_all_cb (GtkButton *button, gpointer user_data)
void gnc_reset_warnings_response_cb (GtkDialog *dialog, gint arg1, gpointer user_data)
void gnc_preferences_add_page (const gchar *filename, const gchar *widgetname, const gchar *tabname)
void gnc_preferences_add_to_page (const gchar *filename, const gchar *widgetname, const gchar *tabname)
void gnc_preferences_dialog (void)

Variables

GSList * add_ins = NULL


Typedef Documentation

typedef struct addition_t addition

This data structure holds the information for a single addition to the preferences dialog.


Function Documentation

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. When the dialog is created, the specified widget will be pulled from the specified glade file and added to the preferences dialog with the specified tab name. The tab name may not be duplicated. For example, the Business code might have a full page of its own preferences.

Parameters:
filename The name of a glade file.
widgetname The name of the widget to extract from the glade file.
tabname The name this page of preferences should have in the dialog notebook.

Definition at line 261 of file dialog-preferences.c.

00264 {
00265   gnc_preferences_add_page_internal(filename, widgetname, tabname, TRUE);
00266 }

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. When the dialog is created, the specified widget will be pulled from the specified glade file and added to the preferences dialog with the specified tab name. The tab name may be duplicated. For example, the HBCI preferences may share a "Data Import" page with QIF and other methods.

Parameters:
filename The name of a glade file.
widgetname The name of the widget to extract from the glade file.
tabname The name this page of preferences should have in the dialog notebook.

Definition at line 276 of file dialog-preferences.c.

00279 {
00280   gnc_preferences_add_page_internal(filename, widgetname, tabname, FALSE);
00281 }

void gnc_preferences_dialog ( void   ) 

This function creates the preferences dialog and presents it to the user. The preferences dialog is a singletone, so if a preferences dialog already exists it will be raised to the top of the window stack instead of creating a new dialog.

Definition at line 1706 of file dialog-preferences.c.

01707 {
01708   GtkWidget *dialog;
01709 
01710   ENTER("");
01711   if (gnc_forall_gui_components(DIALOG_PREFERENCES_CM_CLASS,
01712                                 show_handler, NULL)) {
01713     LEAVE("existing window");
01714     return;
01715   }
01716 
01717   dialog = gnc_preferences_dialog_create();
01718 
01719   gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
01720   gtk_widget_show(dialog);
01721 
01722   gnc_gconf_add_notification(G_OBJECT(dialog), NULL,
01723                              gnc_preferences_gconf_changed,
01724                              DIALOG_PREFERENCES_CM_CLASS);
01725   gnc_gconf_general_register_cb(KEY_ACCOUNT_SEPARATOR,
01726                                 (GncGconfGeneralCb)gnc_account_separator_prefs_cb,
01727                                 dialog);
01728   gnc_register_gui_component(DIALOG_PREFERENCES_CM_CLASS,
01729                              NULL, close_handler, dialog);
01730 
01731   LEAVE(" ");
01732 }

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. Also handles delete_window events, which have conveniently converted to a response by GtkDialog.

Definition at line 1351 of file dialog-preferences.c.

01352 {
01353   switch (response) {
01354    case GTK_RESPONSE_HELP:
01355      gnc_gnome_help(HF_HELP, HL_GLOBPREFS);
01356      break;
01357 
01358    default:
01359      gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
01360      gnc_unregister_gui_component_by_data(DIALOG_PREFERENCES_CM_CLASS,
01361                                           dialog);
01362      gnc_gconf_general_remove_cb(
01363        KEY_ACCOUNT_SEPARATOR,
01364        (GncGconfGeneralCb)gnc_account_separator_prefs_cb,
01365        dialog);
01366      gnc_gconf_remove_notification(G_OBJECT(dialog), NULL,
01367                                    DIALOG_PREFERENCES_CM_CLASS);
01368      gtk_widget_destroy(GTK_WIDGET(dialog));
01369      break;
01370   }
01371 }


Variable Documentation

GSList* add_ins = NULL

A list of all additions that have been made to the preferences dialog. The data fields for this list are addition data structures.

Definition at line 114 of file dialog-preferences.c.


Generated on Mon Sep 8 05:04:39 2008 for GnuCash by  doxygen 1.5.2