2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License as
4 * published by the Free Software Foundation; either version 2 of the
5 * License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * General Public License for more details.
12 * You should have received a copy of the GNU General Public
13 * License along with this program; if not, write to the
14 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
15 * Boston, MA 02110-1301 USA
17 * Authors: Travis Reitter <treitter@gmail.com>
23 #include <glib/gi18n.h>
25 #include <hildon/hildon.h>
26 #include <hildon-uri.h>
28 #include "milk-dialogs.h"
29 #include "milk-main-window.h"
32 link_clicked_cb (GtkLinkButton *link,
35 GtkWidget *finish_button;
37 finish_button = GTK_WIDGET (g_object_get_data (G_OBJECT (link),
40 gtk_widget_set_sensitive (finish_button, TRUE);
41 hildon_uri_open (gtk_link_button_get_uri (link), NULL, NULL);
45 finish_button_clicked_cb (GtkButton *finish_button,
48 gtk_dialog_response (dialog, GTK_RESPONSE_OK);
52 milk_dialogs_auth_prompt (GtkWindow *parent,
58 GtkWidget *finish_button;
61 parent = GTK_WINDOW (milk_main_window_get_default ());
63 dialog = HILDON_DIALOG (hildon_dialog_new ());
64 gtk_window_set_title (GTK_WINDOW (dialog),
65 _("Log in to Remember The Milk"));
66 gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
68 label = gtk_label_new (_("Log in, then tap Finish"));
69 gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), label);
71 finish_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT,
72 HILDON_BUTTON_ARRANGEMENT_VERTICAL, _("Finish"), NULL);
73 gtk_widget_set_sensitive (finish_button, FALSE);
74 g_signal_connect (finish_button, "clicked",
75 G_CALLBACK (finish_button_clicked_cb), dialog);
77 link = gtk_link_button_new_with_label (uri, _("Log in"));
78 g_object_set_data (G_OBJECT (link), "finish-button", finish_button);
79 g_signal_connect (link, "clicked", G_CALLBACK (link_clicked_cb), NULL);
81 gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
83 gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
86 gtk_widget_show_all (GTK_WIDGET (dialog));
88 return GTK_DIALOG (dialog);