2
* Copyright (C) 2000 S�bastien LECACHEUR
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#include "../gwsupport.h"
21
#include "gwsettingsgeneral.h"
23
#include "gwsettingswindowbox.h"
25
#include "../gwapplicationmanager.h"
28
/*! @define GW_PLUGIN_SETTINGS_WINDOW The parent window */
29
#define GW_PLUGIN_SETTINGS_WINDOW "gw_plugin_settings_window"
32
gint gw_plugin_settings_general_pane_create ( GtkWindow *settings, GtkContainer *parent, GtkWidget **pane);
33
gint gw_plugin_settings_general_pane_load ( GtkWidget *pane);
34
gint gw_plugin_settings_general_pane_on_change ( GtkEntry *entry, GtkWidget *pane);
35
gint gw_plugin_settings_general_pane_apply ( GtkWidget *pane);
38
gint gw_plugin_settings_general_init ( GWSettingsModule **module)
42
if ( (*module = gw_settings_module_new ( )) != NULL )
44
(*module)->name = g_strdup ( _( "Generals options"));
45
(*module)->create = &gw_plugin_settings_general_pane_create;
46
(*module)->load = &gw_plugin_settings_general_pane_load;
47
(*module)->on_change = &gw_plugin_settings_general_pane_on_change;
48
(*module)->apply = &gw_plugin_settings_general_pane_apply;
57
gint gw_plugin_settings_general_pane_create ( GtkWindow *settings, GtkContainer *parent, GtkWidget **pane)
60
GtkWidget *table_pane;
61
GtkTooltips *tooltips;
64
#ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT
65
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
68
tooltips = gtk_tooltips_new ( );
70
if ( settings != NULL && parent != NULL )
72
table_pane = gtk_table_new ( 0, 2, FALSE);
73
gtk_widget_ref ( GTK_WIDGET ( settings));
74
gtk_object_set_data_full ( GTK_OBJECT ( table_pane), GW_PLUGIN_SETTINGS_WINDOW, settings, (GtkDestroyNotify) gtk_widget_unref);
75
gtk_container_set_border_width ( GTK_CONTAINER ( table_pane), 5);
76
gtk_table_set_row_spacings ( GTK_TABLE (table_pane), 5);
77
gtk_table_set_col_spacings ( GTK_TABLE (table_pane), 5);
81
gw_plugin_settings_general_pane_load ( table_pane);
90
gint gw_plugin_settings_general_pane_load ( GtkWidget *pane)
95
#ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT
96
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
108
gint gw_plugin_settings_general_pane_on_change ( GtkEntry *entry, GtkWidget *pane)
111
GtkWindow *settings = NULL;
114
#ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT
115
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
120
if ( (settings = GTK_WINDOW ( gtk_object_get_data ( GTK_OBJECT ( pane), GW_PLUGIN_SETTINGS_WINDOW))) != NULL )
122
gw_settings_window_box_set_modified ( settings, TRUE);
132
gint gw_plugin_settings_general_pane_apply ( GtkWidget *pane)
135
GtkWindow *settings = NULL;
138
#ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT
139
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
144
if ( (settings = GTK_WINDOW ( gtk_object_get_data ( GTK_OBJECT ( pane), GW_PLUGIN_SETTINGS_WINDOW))) != NULL )
146
gw_settings_window_box_set_modified ( settings, FALSE);