aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
authorJonathan Tellier <jonathan.tellier@gmail.com>2009-08-27 00:52:45 +0800
committerjtellier <jonathan.tellier@collabora.co.uk>2009-08-29 02:27:43 +0800
commit435a811e440c3a5a79f504fa6f2850e63673f49a (patch)
tree0b3631df59ac2f7f935612b2e076e9ad0c2c7773 /libempathy-gtk/empathy-ui-utils.c
parent36e602e834790033aed3c8b82a93404efb1585ad (diff)
downloadgsoc2013-empathy-435a811e440c3a5a79f504fa6f2850e63673f49a.tar
gsoc2013-empathy-435a811e440c3a5a79f504fa6f2850e63673f49a.tar.gz
gsoc2013-empathy-435a811e440c3a5a79f504fa6f2850e63673f49a.tar.bz2
gsoc2013-empathy-435a811e440c3a5a79f504fa6f2850e63673f49a.tar.lz
gsoc2013-empathy-435a811e440c3a5a79f504fa6f2850e63673f49a.tar.xz
gsoc2013-empathy-435a811e440c3a5a79f504fa6f2850e63673f49a.tar.zst
gsoc2013-empathy-435a811e440c3a5a79f504fa6f2850e63673f49a.zip
Asking for confirmation before losing pending accounts changes.
If an account has pending changes, we now ask for a confirmation before: - Adding a new account - Closing the accounts dialog - Selecting a new account. Those are all options which discard pending changes.
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 3089c46ea..e7b8fce74 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1551,3 +1551,31 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
gtk_widget_show (widget);
}
+
+/** empathy_show_yes_no_question_dialog:
+ * @parent: The parent of the message dialog
+ * @message: The question message
+ * @response_callback: The callback connected to the "response" signal of
+ * the message dialog.
+ * @user_data: User data to pass to the @response_callback.
+ *
+ * A simple utility function to create a modal yes/no question message dialog
+ * and hooking to its "response" signal.
+ */
+void empathy_show_yes_no_question_dialog (GtkWindow *parent,
+ gchar *message,
+ GCallback response_callback,
+ gpointer user_data)
+{
+ GtkWidget *message_dialog;
+
+ message_dialog = gtk_message_dialog_new (parent,
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ message);
+
+ g_signal_connect (message_dialog, "response", response_callback, user_data);
+
+ gtk_widget_show (message_dialog);
+}