[gnome-control-center/extensible-shell] [appearance] Handle dialog responses
- From: William Jon McCann <mccann src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-control-center/extensible-shell] [appearance] Handle dialog responses
- Date: Wed, 27 Jan 2010 00:47:03 +0000 (UTC)
commit 824cd26389ea03bd7d5dd1b5dd3bbe213ecaf2c2
Author: William Jon McCann <jmccann redhat com>
Date: Tue Jan 26 19:32:14 2010 -0500
[appearance] Handle dialog responses
capplets/appearance/cc-theme-customize-dialog.c | 27 ---------------------
capplets/appearance/cc-theme-page.c | 29 +++++++++++++++++++++++
2 files changed, 29 insertions(+), 27 deletions(-)
---
diff --git a/capplets/appearance/cc-theme-customize-dialog.c b/capplets/appearance/cc-theme-customize-dialog.c
index 36328f3..83324d3 100644
--- a/capplets/appearance/cc-theme-customize-dialog.c
+++ b/capplets/appearance/cc-theme-customize-dialog.c
@@ -138,30 +138,6 @@ cc_theme_customize_dialog_get_property (GObject *object,
}
}
-static gboolean
-do_customize (CcThemeCustomizeDialog *dialog)
-{
- gboolean ret;
- ret = FALSE;
- return ret;
-}
-
-static void
-cc_theme_customize_dialog_response (GtkDialog *dialog,
- int response_id)
-{
- switch (response_id) {
- case GTK_RESPONSE_OK:
- if (!do_customize (CC_THEME_CUSTOMIZE_DIALOG (dialog))) {
- g_signal_stop_emission_by_name (dialog, "response");
- gtk_dialog_response (dialog, GTK_RESPONSE_CANCEL);
- }
- break;
- default:
- break;
- }
-}
-
static void
on_info_bar_response (GtkWidget *w,
int response_id,
@@ -1361,15 +1337,12 @@ static void
cc_theme_customize_dialog_class_init (CcThemeCustomizeDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
object_class->get_property = cc_theme_customize_dialog_get_property;
object_class->set_property = cc_theme_customize_dialog_set_property;
object_class->constructor = cc_theme_customize_dialog_constructor;
object_class->finalize = cc_theme_customize_dialog_finalize;
- dialog_class->response = cc_theme_customize_dialog_response;
-
g_type_class_add_private (klass, sizeof (CcThemeCustomizeDialogPrivate));
}
diff --git a/capplets/appearance/cc-theme-page.c b/capplets/appearance/cc-theme-page.c
index 0eafe71..6cb1da3 100644
--- a/capplets/appearance/cc-theme-page.c
+++ b/capplets/appearance/cc-theme-page.c
@@ -997,6 +997,16 @@ load_model (CcThemePage *page)
g_list_free (theme_list);
}
+static void
+on_customize_dialog_response (GtkDialog *dialog,
+ int response_id,
+ CcThemePage *page)
+{
+ if (page->priv->theme_details != NULL) {
+ gtk_widget_destroy (page->priv->theme_details);
+ page->priv->theme_details = NULL;
+ }
+}
static void
on_theme_customize_clicked (GtkWidget *button,
@@ -1011,6 +1021,10 @@ on_theme_customize_clicked (GtkWidget *button,
if (page->priv->theme_details == NULL) {
page->priv->theme_details = cc_theme_customize_dialog_new ();
+ g_signal_connect (page->priv->theme_details,
+ "response",
+ G_CALLBACK (on_customize_dialog_response),
+ page);
}
gtk_window_set_transient_for (GTK_WINDOW (page->priv->theme_details),
@@ -1019,6 +1033,17 @@ on_theme_customize_clicked (GtkWidget *button,
}
static void
+on_save_dialog_response (GtkDialog *dialog,
+ int response_id,
+ CcThemePage *page)
+{
+ if (page->priv->save_dialog != NULL) {
+ gtk_widget_destroy (page->priv->save_dialog);
+ page->priv->save_dialog = NULL;
+ }
+}
+
+static void
on_theme_save_clicked (GtkWidget *button,
CcThemePage *page)
{
@@ -1031,6 +1056,10 @@ on_theme_save_clicked (GtkWidget *button,
if (page->priv->save_dialog == NULL) {
page->priv->save_dialog = cc_theme_save_dialog_new ();
+ g_signal_connect (page->priv->save_dialog,
+ "response",
+ G_CALLBACK (on_save_dialog_response),
+ page);
}
cc_theme_save_dialog_set_theme_info (CC_THEME_SAVE_DIALOG (page->priv->save_dialog),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]