Commit 73a99500 authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Sjoerd Simons

Implement first page in the assistant

parent a1382ef2
......@@ -24,6 +24,7 @@ BUILT_SOURCES = \
lib_LTLIBRARIES = libempathy-gtk.la
libempathy_gtk_handwritten_source = \
empathy-account-assistant.c \
empathy-account-chooser.c \
empathy-account-widget.c \
empathy-account-widget-irc.c \
......@@ -86,6 +87,7 @@ libempathy_gtk_la_LDFLAGS = \
-export-symbols-regex ^empathy_
libempathy_gtk_headers = \
empathy-account-assistant.h \
empathy-account-chooser.h \
empathy-account-widget.h \
empathy-account-widget-irc.h \
......
......@@ -23,6 +23,7 @@
#include <glib/gi18n.h>
#include "empathy-account-assistant.h"
#include "empathy-ui-utils.h"
G_DEFINE_TYPE (EmpathyAccountAssistant, empathy_account_assistant,
GTK_TYPE_ASSISTANT)
......@@ -30,26 +31,63 @@ G_DEFINE_TYPE (EmpathyAccountAssistant, empathy_account_assistant,
static GtkWidget *
account_assistant_build_introduction_page (void)
{
GtkWidget *main_vbox, *hbox_1, *w;
GtkWidget *main_vbox, *hbox_1, *w, *radio, *vbox_1;
GdkPixbuf *pix;
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_widget_show (main_vbox);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
hbox_1 = gtk_hbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (main_vbox), hbox_1, TRUE, TRUE, 6);
gtk_box_pack_start (GTK_BOX (main_vbox), hbox_1, TRUE, TRUE, 0);
gtk_widget_show (hbox_1);
w = gtk_label_new (_("With Empathy you can chat with people online nearby "
"and with friends and colleagues who use Google Talk, AIM, "
"Windows Live and many other chat programs. With a microphone "
w = gtk_label_new (_("With Empathy you can chat with people \nonline nearby "
"and with friends and colleagues \nwho use Google Talk, AIM, "
"Windows Live \nand many other chat programs. With a microphone \n"
"or a webcam you can also have audio or video calls."));
gtk_box_pack_start (GTK_BOX (hbox_1), w, TRUE, TRUE, 6);
gtk_misc_set_alignment (GTK_MISC (w), 0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox_1), w, TRUE, TRUE, 0);
gtk_widget_show (w);
w = gtk_image_new_from_icon_name ("empathy", GTK_ICON_SIZE_DIALOG);
pix = empathy_pixbuf_from_icon_name_sized ("empathy", 96);
w = gtk_image_new_from_pixbuf (pix);
gtk_box_pack_start (GTK_BOX (hbox_1), w, TRUE, TRUE, 6);
gtk_widget_show (w);
g_object_unref (pix);
w = gtk_label_new (_("Do you have an account you've been using with another "
"chat program?"));
gtk_misc_set_alignment (GTK_MISC (w), 0, 0);
gtk_box_pack_start (GTK_BOX (main_vbox), w, FALSE, FALSE, 0);
gtk_widget_show (w);
w = gtk_alignment_new (0, 0, 0, 0);
gtk_alignment_set_padding (GTK_ALIGNMENT (w), 0, 0, 12, 0);
gtk_box_pack_start (GTK_BOX (main_vbox), w, TRUE, TRUE, 0);
gtk_widget_show (w);
vbox_1 = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (w), vbox_1);
gtk_widget_show (vbox_1);
radio = gtk_radio_button_new_with_label (NULL, _("Yes, import my account details from "));
gtk_box_pack_start (GTK_BOX (vbox_1), radio, TRUE, TRUE, 0);
gtk_widget_show (radio);
w = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio), _("Yes, I'll enter my account details now"));
gtk_box_pack_start (GTK_BOX (vbox_1), w, TRUE, TRUE, 0);
gtk_widget_show (w);
w = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio), _("No, I want a new account"));
gtk_box_pack_start (GTK_BOX (vbox_1), w, TRUE, TRUE, 0);
gtk_widget_show (w);
w = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio), _("No, I just want to see people online nearby for now"));
gtk_box_pack_start (GTK_BOX (vbox_1), w, TRUE, TRUE, 0);
gtk_widget_show (w);
return main_vbox;
}
......@@ -66,9 +104,12 @@ empathy_account_assistant_init (EmpathyAccountAssistant *self)
page = account_assistant_build_introduction_page ();
gtk_assistant_append_page (GTK_ASSISTANT (self), page);
gtk_assistant_set_page_title (GTK_ASSISTANT (self), page, _("Welcome to Empathy"));
gtk_assistant_set_page_type (GTK_ASSISTANT (self), page, GTK_ASSISTANT_PAGE_INTRO);
gtk_assistant_set_page_complete (GTK_ASSISTANT (self), page, TRUE);
}
EmpathyAccountAssistant*
GtkWidget *
empathy_account_assistant_new (void)
{
return g_object_new (EMPATHY_TYPE_ACCOUNT_ASSISTANT, NULL);
......
......@@ -53,7 +53,7 @@ typedef struct {
GType empathy_account_assistant_get_type (void);
EmpathyAccountAssistant* empathy_account_assistant_new (void);
GtkWidget *empathy_account_assistant_new (void);
G_END_DECLS
......
......@@ -31,7 +31,6 @@ BUILT_SOURCES= \
empathy_handwritten_source = \
empathy.c \
empathy-about-dialog.c empathy-about-dialog.h \
empathy-account-assistant.c empathy-account-assistant.h \
empathy-accounts-dialog.c empathy-accounts-dialog.h \
empathy-call-window.c empathy-call-window.h \
empathy-call-window-fullscreen.c empathy-call-window-fullscreen.h \
......
......@@ -5,7 +5,7 @@
#include <libempathy-gtk/empathy-ui-utils.h>
#include <libempathy-gtk/empathy-account-assistant.h>
int main (int argc, char *argv)
int main (int argc, char **argv)
{
GtkWidget *assistant;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment