aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-alert-dialog.c
diff options
context:
space:
mode:
authorJonathon Jongsma <jonathon@quotidian.org>2009-12-09 04:14:26 +0800
committerJonathon Jongsma <jonathon@quotidian.org>2009-12-09 04:38:00 +0800
commite0ee2c648c2b101c3e8f1600fe9dcadf34963a63 (patch)
tree8699065dd24ea9f9d044e0e66c2d2f7d303bfcfb /e-util/e-alert-dialog.c
parent5a90243de020efcc86e0a93698bdeaf932cc88ba (diff)
downloadgsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar
gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar.gz
gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar.bz2
gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar.lz
gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar.xz
gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar.zst
gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.zip
Use EAlert API in EAlertActivity rather than using g_object_get_data
previously we were storing the EAlert's primary and secondary text in the dialog object (using g_object_set_data_full). Since EAlertDialog encapsulates an EAlert and we have access to the underlying EAlert object, we can just use the EAlert API to get the primary and secondary text rather than storing duplicates copies of it in the dialog.
Diffstat (limited to 'e-util/e-alert-dialog.c')
-rw-r--r--e-util/e-alert-dialog.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index 5b8d2a8299..dd4d399f36 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -125,7 +125,6 @@ e_alert_dialog_constructed (GObject *obj)
GtkWidget *action_area;
GtkWidget *content_area;
GString *out;
- gchar *perr=NULL, *serr=NULL;
gchar *title, *primary, *secondary;
g_return_if_fail (self != NULL);
@@ -203,15 +202,11 @@ e_alert_dialog_constructed (GObject *obj)
g_string_append_printf (out,
"<span weight=\"bold\" size=\"larger\">%s</span>\n\n",
primary);
- /* FIXME: What is this used for? */
- perr = g_strdup (primary);
- } else
- perr = g_strdup (title); /* XXX: why? */
+ }
secondary = e_alert_get_secondary_text (alert);
if (secondary) {
g_string_append (out, secondary);
- serr = g_strdup (secondary);
}
g_free (secondary);
@@ -238,9 +233,6 @@ e_alert_dialog_constructed (GObject *obj)
gtk_widget_show_all(hbox);
gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
- /* FIXME: What is this used for? */
- g_object_set_data_full ((GObject *) self, "primary", perr, g_free);
- g_object_set_data_full ((GObject *) self, "secondary", serr, g_free);
}
static void
@@ -333,7 +325,7 @@ e_alert_run_dialog_for_args (GtkWindow *parent, const gchar *tag, const gchar *a
/**
* e_alert_dialog_count_buttons:
- * @dialog: a #GtkDialog
+ * @dialog: a #EAlertDialog
*
* Counts the number of buttons in @dialog's action area.
*
@@ -360,3 +352,24 @@ e_alert_dialog_count_buttons (EAlertDialog *dialog)
return n_buttons;
}
+
+/**
+ * e_alert_dialog_get_alert:
+ * @dialog: a #EAlertDialog
+ *
+ * Convenience API for getting the #EAlert associated with @dialog
+ *
+ * Return value: the #EAlert associated with @dialog. The alert should be
+ * unreffed when no longer needed.
+ */
+EAlert *
+e_alert_dialog_get_alert (EAlertDialog *dialog)
+{
+ EAlert *alert = NULL;
+
+ g_return_val_if_fail (dialog != NULL, NULL);
+
+ g_object_get (dialog, "alert", &alert,
+ NULL);
+ return alert;
+}