Removed -DGLADE_DATADIR

2001-07-17  Bradford Hovinen  <hovinen@ximian.com>

	* Makefile.am (INCLUDES): Removed -DGLADE_DATADIR

	* capplet-util.c (create_dialog_cb): Use create_widget_cb rather
	than loading from Glade
	(capplet_init): Accept CreateDialogFn and initialize
	create_dialog_cb
	(close_cb): Don't call gtk_object_destroy (dialog)
	(get_control_cb): Rename from create_dialog_cb

	* sound-properties-capplet.c (create_dialog): Implement
	(main): Call glade_gnome_init; pass create_dialog to capplet_init
	(setup_dialog): Retrieve the Glade data from the widget passed to
	this function
	(create_dialog): Make sure dialog is destroyed when widget is

	* Makefile.am (EXTRA_DIST): Changed Applications_DATA to
	Applications_in_files
	(INCLUDES): Add -DGLADE_DATADIR
This commit is contained in:
Bradford Hovinen 2001-07-17 18:34:44 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 63fbbec13b
commit 43d56c8e68
7 changed files with 70 additions and 56 deletions

View file

@ -1,7 +1,14 @@
2001-07-17 Bradford Hovinen <hovinen@ximian.com>
* sound-properties-capplet.c (create_dialog): Implement
(main): Call glade_gnome_init; pass create_dialog to capplet_init
(setup_dialog): Retrieve the Glade data from the widget passed to
this function
(create_dialog): Make sure dialog is destroyed when widget is
* Makefile.am (EXTRA_DIST): Changed Applications_DATA to
Applications_in_files
(INCLUDES): Add -DGLADE_DATADIR
* sound-properties-capplet.c (setup_dialog): Sensitize events
check box only if ESD is already enabled

View file

@ -20,12 +20,13 @@ oaf_DATA = \
EXTRA_DIST = ChangeLog $(Applications_in_files) $(Glade_DATA) $(oaf_DATA) $(defaults_DATA)
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DG_LOG_DOMAIN=\"sound-properties\" \
-I$(top_srcdir)/ \
-I$(top_srcdir)/intl \
-I$(top_srcdir)/capplets/common \
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DG_LOG_DOMAIN=\"sound-properties\" \
-DGLADE_DATADIR=\""$(datadir)/control-center/interfaces"\" \
-I$(top_srcdir)/ \
-I$(top_srcdir)/intl \
-I$(top_srcdir)/capplets/common \
@CAPPLET_CFLAGS@
bin_PROGRAMS = sound-properties-capplet

View file

@ -27,6 +27,8 @@
#include "capplet-util.h"
#include <glade/glade.h>
/* Needed only for the sound capplet */
#include <stdlib.h>
@ -97,14 +99,40 @@ start_esd (void)
#endif
}
/* create_dialog
*
* Create the dialog box and return it as a GtkWidget
*/
static GtkWidget *
create_dialog (void)
{
GladeXML *data;
GtkWidget *widget;
data = glade_xml_new (GLADE_DATADIR "/sound-properties.glade", "prefs_widget");
widget = glade_xml_get_widget (data, "prefs_widget");
gtk_object_set_data (GTK_OBJECT (widget), "glade-data", data);
gtk_signal_connect_object (GTK_OBJECT (widget), "destroy",
GTK_SIGNAL_FUNC (gtk_object_destroy),
GTK_OBJECT (data));
return widget;
}
/* setup_dialog
*
* Set up the property editors for our dialog
*/
static void
setup_dialog (GladeXML *dialog, Bonobo_PropertyBag bag)
setup_dialog (GtkWidget *widget, Bonobo_PropertyBag bag)
{
GladeXML *dialog;
dialog = gtk_object_get_data (GTK_OBJECT (widget), "glade-data");
CREATE_PEDITOR (boolean, "enable_esd", "enable_toggle");
CREATE_PEDITOR (boolean, "event_sounds", "events_toggle");
@ -132,7 +160,8 @@ get_legacy_settings (Bonobo_ConfigDatabase db)
int
main (int argc, char **argv)
{
capplet_init (argc, argv, apply_settings, setup_dialog, get_legacy_settings);
glade_gnome_init ();
capplet_init (argc, argv, apply_settings, create_dialog, setup_dialog, get_legacy_settings);
return 0;
}