[gnome-online-accounts] exchange: Adjust the UI so that we can use a header bar in the dialog
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] exchange: Adjust the UI so that we can use a header bar in the dialog
- Date: Thu, 22 May 2014 16:12:01 +0000 (UTC)
commit 7d7a2b7651dbbe5ae053954aa67c8d66fc926d8b
Author: Debarshi Ray <debarshir gnome org>
Date: Wed May 21 12:56:58 2014 +0200
exchange: Adjust the UI so that we can use a header bar in the dialog
Using a header bar means that the dialog can emit both
GTK_RESPONSE_CANCEL (from the cancel button) and
GTK_RESPONSE_DELETE_EVENT (from the Esc key), so we should account for
that. This is also a good opportunity to stop using the action area.
Fixes: https://bugzilla.gnome.org/729638
src/goabackend/goaexchangeprovider.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/goabackend/goaexchangeprovider.c b/src/goabackend/goaexchangeprovider.c
index 32ba8bd..abcd6dd 100644
--- a/src/goabackend/goaexchangeprovider.c
+++ b/src/goabackend/goaexchangeprovider.c
@@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
- * Copyright (C) 2012, 2013 Red Hat, Inc.
+ * Copyright (C) 2012, 2013, 2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -456,7 +456,6 @@ create_account_details_ui (GoaProvider *provider,
gboolean new_account,
AddAccountData *data)
{
- GtkWidget *action_area;
GtkWidget *grid0;
GtkWidget *grid1;
GtkWidget *label;
@@ -516,19 +515,16 @@ create_account_details_ui (GoaProvider *provider,
g_signal_connect (data->email_address, "changed", G_CALLBACK (on_email_address_or_password_changed), data);
g_signal_connect (data->password, "changed", G_CALLBACK (on_email_address_or_password_changed), data);
+ gtk_dialog_add_button (data->dialog, _("_Cancel"), GTK_RESPONSE_CANCEL);
data->connect_button = gtk_dialog_add_button (data->dialog, _("C_onnect"), GTK_RESPONSE_OK);
gtk_dialog_set_default_response (data->dialog, GTK_RESPONSE_OK);
gtk_dialog_set_response_sensitive (data->dialog, GTK_RESPONSE_OK, FALSE);
- action_area = gtk_dialog_get_action_area (data->dialog);
-
data->progress_grid = gtk_grid_new ();
gtk_widget_set_no_show_all (data->progress_grid, TRUE);
gtk_orientable_set_orientation (GTK_ORIENTABLE (data->progress_grid), GTK_ORIENTATION_HORIZONTAL);
gtk_grid_set_column_spacing (GTK_GRID (data->progress_grid), 3);
- gtk_box_pack_end (GTK_BOX (action_area), data->progress_grid, FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (action_area), data->progress_grid, 0);
- gtk_button_box_set_child_non_homogeneous (GTK_BUTTON_BOX (action_area), data->progress_grid, TRUE);
+ gtk_container_add (GTK_CONTAINER (grid0), data->progress_grid);
spinner = gtk_spinner_new ();
gtk_widget_set_size_request (spinner, 20, 20);
@@ -591,7 +587,7 @@ dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
{
AddAccountData *data = user_data;
- if (response_id == GTK_RESPONSE_CANCEL)
+ if (response_id == GTK_RESPONSE_CANCEL || response_id == GTK_RESPONSE_DELETE_EVENT)
g_cancellable_cancel (data->cancellable);
}
@@ -801,8 +797,10 @@ refresh_account (GoaProvider *provider,
dialog = gtk_dialog_new_with_buttons (NULL,
parent,
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- _("_Cancel"), GTK_RESPONSE_CANCEL,
+ GTK_DIALOG_MODAL
+ | GTK_DIALOG_DESTROY_WITH_PARENT
+ | GTK_DIALOG_USE_HEADER_BAR,
+ NULL,
NULL);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]