Update (main): Use a GtkDialog rather than a GnomeDialog; don't place a

2001-12-20  Bradford Hovinen  <hovinen@ximian.com>

	* *-properties*.c (dialog_button_clicked_cb): Update
	(main): Use a GtkDialog rather than a GnomeDialog; don't place a
	weak ref on gtk_main_quit
This commit is contained in:
Bradford Hovinen 2001-12-20 18:21:12 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent cb0a578f7e
commit 2dd5ccf964
10 changed files with 91 additions and 32 deletions

View file

@ -1,6 +1,9 @@
2001-12-20 Bradford Hovinen <hovinen@ximian.com> 2001-12-20 Bradford Hovinen <hovinen@ximian.com>
* background-properties-capplet.c: Update * background-properties-capplet.c: Update
(main): Use a GtkDialog rather than a GnomeDialog
(main): Don't put weak ref on gtk_main_quit
(dialog_button_clicked_cb): Update
* Makefile.am: Update * Makefile.am: Update

View file

@ -11,6 +11,9 @@ Glade_DATA = background-properties.glade
iconsdir = $(GNOMECC_ICONS_DIR) iconsdir = $(GNOMECC_ICONS_DIR)
icons_DATA = background-capplet.png icons_DATA = background-capplet.png
desktopdir = $(GNOMECC_DESKTOP_DIR)
desktop_DATA = background.desktop
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) -I$(top_srcdir)/libbackground INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) -I$(top_srcdir)/libbackground
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
EXTRA_DIST = $(Glade_DATA) $(icons_DATA) EXTRA_DIST = $(Glade_DATA) $(icons_DATA)

View file

@ -265,12 +265,17 @@ create_dialog (BGApplier *bg_applier)
/* Callback issued when a button is clicked on the dialog */ /* Callback issued when a button is clicked on the dialog */
static void static void
dialog_button_clicked_cb (GnomeDialog *dialog, gint button_number, GConfChangeSet *changeset) dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset)
{ {
if (button_number == 0) switch (response_id) {
case GTK_RESPONSE_APPLY:
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL); gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
else if (button_number == 1) break;
gnome_dialog_close (dialog);
case GTK_RESPONSE_CLOSE:
gtk_main_quit ();
break;
}
} }
int int
@ -310,11 +315,16 @@ main (int argc, char **argv)
dialog = create_dialog (BG_APPLIER (bg_applier)); dialog = create_dialog (BG_APPLIER (bg_applier));
setup_dialog (dialog, changeset, BG_APPLIER (bg_applier)); setup_dialog (dialog, changeset, BG_APPLIER (bg_applier));
dialog_win = gnome_dialog_new (_("Background properties"), GTK_STOCK_APPLY, GTK_STOCK_CLOSE, NULL); dialog_win = gtk_dialog_new_with_buttons
g_signal_connect (G_OBJECT (dialog_win), "clicked", (GCallback) dialog_button_clicked_cb, changeset); (_("Background properties"), NULL, -1,
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
g_signal_connect (G_OBJECT (dialog_win), "response", (GCallback) dialog_button_clicked_cb, changeset);
g_object_weak_ref (G_OBJECT (dialog_win), (GWeakNotify) g_object_unref, bg_applier); g_object_weak_ref (G_OBJECT (dialog_win), (GWeakNotify) g_object_unref, bg_applier);
g_object_weak_ref (G_OBJECT (dialog_win), (GWeakNotify) gtk_main_quit, NULL); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL);
gtk_widget_show_all (dialog_win); gtk_widget_show_all (dialog_win);
gtk_main (); gtk_main ();

View file

@ -1,5 +1,9 @@
2001-12-20 Bradford Hovinen <hovinen@ximian.com> 2001-12-20 Bradford Hovinen <hovinen@ximian.com>
* keyboard-properties.c (dialog_button_clicked_cb): Update
(main): Use a GtkDialog rather than a GnomeDialog; don't place a
weak ref on gtk_main_quit
* Makefile.am: Update * Makefile.am: Update
* keyboard.desktop.in.in (Exec): Update * keyboard.desktop.in.in (Exec): Update

View file

@ -11,6 +11,9 @@ Glade_DATA = keyboard-properties.glade
iconsdir = $(GNOMECC_ICONS_DIR) iconsdir = $(GNOMECC_ICONS_DIR)
icons_DATA = keyboard-capplet.png icons_DATA = keyboard-capplet.png
desktopdir = $(GNOMECC_DESKTOP_DIR)
desktop_DATA = keyboard.desktop
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS)
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
EXTRA_DIST = $(Glade_DATA) $(icons_DATA) EXTRA_DIST = $(Glade_DATA) $(icons_DATA)

View file

@ -222,12 +222,17 @@ create_dialog (void)
} }
static void static void
dialog_button_clicked_cb (GnomeDialog *dialog, gint button_number, GConfChangeSet *changeset) dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset)
{ {
if (button_number == 0) switch (response_id) {
case GTK_RESPONSE_APPLY:
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL); gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
else if (button_number == 1) break;
gnome_dialog_close (dialog);
case GTK_RESPONSE_CLOSE:
gtk_main_quit ();
break;
}
} }
int int
@ -273,10 +278,14 @@ main (int argc, char **argv)
(GNOMECC_ICONS_DIR "keyboard-capplet.png"); (GNOMECC_ICONS_DIR "keyboard-capplet.png");
#endif #endif
dialog_win = gnome_dialog_new (_("Keyboard properties"), GTK_STOCK_APPLY, GTK_STOCK_CLOSE, NULL); dialog_win = gtk_dialog_new_with_buttons
g_signal_connect (G_OBJECT (dialog_win), "clicked", (GCallback) dialog_button_clicked_cb, changeset); (_("Keyboard properties"), NULL, -1,
g_object_weak_ref (G_OBJECT (dialog_win), (GWeakNotify) gtk_main_quit, NULL); GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL); GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
g_signal_connect (G_OBJECT (dialog_win), "response", (GCallback) dialog_button_clicked_cb, changeset);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL);
gtk_widget_show_all (dialog_win); gtk_widget_show_all (dialog_win);
gtk_main (); gtk_main ();

View file

@ -1,3 +1,9 @@
2001-12-20 Bradford Hovinen <hovinen@ximian.com>
* mouse-properties-capplet.c (dialog_button_clicked_cb): Update
(main): Use a GtkDialog rather than GnomeDialog; don't place weak
ref on gtk_main_quit
2001-12-20 Hans Petter Jansson <hpj@ximian.com> 2001-12-20 Hans Petter Jansson <hpj@ximian.com>
* Makefile.am: Remove rule that prevented install. * Makefile.am: Remove rule that prevented install.

View file

@ -19,6 +19,9 @@ Glade_DATA = mouse-properties.glade
iconsdir = $(GNOMECC_ICONS_DIR) iconsdir = $(GNOMECC_ICONS_DIR)
icons_DATA = mouse-capplet.png icons_DATA = mouse-capplet.png
desktopdir = $(GNOMECC_DESKTOP_DIR)
desktop_DATA = mouse.desktop
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS)
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
EXTRA_DIST = $(Glade_DATA) $(icons_DATA) $(pixmap_DATA) EXTRA_DIST = $(Glade_DATA) $(icons_DATA) $(pixmap_DATA)

View file

@ -390,12 +390,17 @@ create_dialog (void)
/* Callback issued when a button is clicked on the dialog */ /* Callback issued when a button is clicked on the dialog */
static void static void
dialog_button_clicked_cb (GnomeDialog *dialog, gint button_number, GConfChangeSet *changeset) dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset)
{ {
if (button_number == 0) switch (response_id) {
case GTK_RESPONSE_APPLY:
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL); gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
else if (button_number == 1) break;
gnome_dialog_close (dialog);
case GTK_RESPONSE_CLOSE:
gtk_main_quit ();
break;
}
} }
int int
@ -433,10 +438,14 @@ main (int argc, char **argv)
load_pixbufs (); load_pixbufs ();
setup_dialog (dialog, changeset); setup_dialog (dialog, changeset);
dialog_win = gnome_dialog_new (_("Mouse properties"), GTK_STOCK_APPLY, GTK_STOCK_CLOSE, NULL); dialog_win = gtk_dialog_new_with_buttons
g_signal_connect (G_OBJECT (dialog_win), "clicked", (GCallback) dialog_button_clicked_cb, changeset); (_("Keyboard properties"), NULL, -1,
g_object_weak_ref (G_OBJECT (dialog_win), (GWeakNotify) gtk_main_quit, NULL); GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL); GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
g_signal_connect (G_OBJECT (dialog_win), "response", (GCallback) dialog_button_clicked_cb, changeset);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL);
gtk_widget_show_all (dialog_win); gtk_widget_show_all (dialog_win);
gtk_main (); gtk_main ();

View file

@ -390,12 +390,17 @@ create_dialog (void)
/* Callback issued when a button is clicked on the dialog */ /* Callback issued when a button is clicked on the dialog */
static void static void
dialog_button_clicked_cb (GnomeDialog *dialog, gint button_number, GConfChangeSet *changeset) dialog_button_clicked_cb (GnomeDialog *dialog, gint response_id, GConfChangeSet *changeset)
{ {
if (button_number == 0) switch (response_id) {
case GTK_RESPONSE_APPLY:
gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL); gconf_client_commit_change_set (gconf_client_get_default (), changeset, TRUE, NULL);
else if (button_number == 1) break;
gnome_dialog_close (dialog);
case GTK_RESPONSE_CLOSE:
gtk_main_quit ();
break;
}
} }
int int
@ -433,10 +438,14 @@ main (int argc, char **argv)
load_pixbufs (); load_pixbufs ();
setup_dialog (dialog, changeset); setup_dialog (dialog, changeset);
dialog_win = gnome_dialog_new (_("Mouse properties"), GTK_STOCK_APPLY, GTK_STOCK_CLOSE, NULL); dialog_win = gtk_dialog_new_with_buttons
g_signal_connect (G_OBJECT (dialog_win), "clicked", (GCallback) dialog_button_clicked_cb, changeset); (_("Keyboard properties"), NULL, -1,
g_object_weak_ref (G_OBJECT (dialog_win), (GWeakNotify) gtk_main_quit, NULL); GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL); GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
g_signal_connect (G_OBJECT (dialog_win), "response", (GCallback) dialog_button_clicked_cb, changeset);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_win)->vbox), WID ("prefs_widget"), TRUE, TRUE, GNOME_PAD_SMALL);
gtk_widget_show_all (dialog_win); gtk_widget_show_all (dialog_win);
gtk_main (); gtk_main ();