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"
33 GtkWidget *finish_button;
37 link_clicked_cb (GtkButton *link,
38 LinkClickedClosure *closure)
40 gtk_widget_set_sensitive (closure->finish_button, TRUE);
42 hildon_uri_open (closure->uri, NULL, NULL);
48 finish_button_clicked_cb (GtkButton *finish_button,
51 gtk_dialog_response (dialog, GTK_RESPONSE_OK);
55 milk_dialogs_auth_prompt (GtkWindow *parent,
61 GtkWidget *finish_button;
62 LinkClickedClosure *closure;
65 parent = GTK_WINDOW (milk_main_window_get_default ());
67 dialog = HILDON_DIALOG (hildon_dialog_new ());
68 gtk_window_set_title (GTK_WINDOW (dialog),
69 _("Log in to Remember The Milk"));
70 gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
72 label = gtk_label_new (_("Log in, then tap Finish"));
73 gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), label);
75 finish_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT,
76 HILDON_BUTTON_ARRANGEMENT_VERTICAL, _("Finish"), NULL);
77 gtk_widget_set_sensitive (finish_button, FALSE);
78 g_signal_connect (finish_button, "clicked",
79 G_CALLBACK (finish_button_clicked_cb), dialog);
81 link = gtk_link_button_new_with_label (uri, _("Log in"));
82 closure = g_new0 (LinkClickedClosure, 1);
84 closure->finish_button = finish_button;
85 g_signal_connect (link, "clicked", G_CALLBACK (link_clicked_cb),
88 gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
90 gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
93 gtk_widget_show_all (GTK_WIDGET (dialog));
95 return GTK_DIALOG (dialog);