]> git.0d.be Git - empathy.git/blob - tests/interactive/test-empathy-calendar-button.c
Updated Spanish Translation
[empathy.git] / tests / interactive / test-empathy-calendar-button.c
1 /*
2  * Copyright (C) 2012 Collabora Ltd.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  * Authors: Danielle Madeley <danielle.madeley@collabora.co.uk>
19  */
20
21 #include "config.h"
22
23 #include <tp-account-widgets/tpaw-calendar-button.h>
24
25 static void
26 date_changed_cb (TpawCalendarButton *button,
27     GDate *date,
28     gpointer user_data)
29 {
30   if (date == NULL)
31     {
32       g_print ("date changed: none\n");
33     }
34   else
35     {
36       gchar buffer[128];
37
38       g_date_strftime (buffer, 128, "%x", date);
39       g_print ("date changed: %s\n", buffer);
40     }
41 }
42
43 int
44 main (int argc,
45     char **argv)
46 {
47   GtkWidget *win, *button;
48   GDate *date;
49
50   gtk_init (&argc, &argv);
51
52   win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
53
54   g_signal_connect_swapped (win, "destroy",
55       G_CALLBACK (gtk_main_quit), NULL);
56
57   button = tpaw_calendar_button_new ();
58
59   date = g_date_new_dmy (30, 11, 1984);
60   tpaw_calendar_button_set_date (TPAW_CALENDAR_BUTTON (button), date);
61   g_date_free (date);
62
63   g_signal_connect (button, "date-changed",
64       G_CALLBACK (date_changed_cb), NULL);
65
66   gtk_container_add (GTK_CONTAINER (win), button);
67   gtk_widget_show_all (win);
68
69   gtk_main ();
70   return 0;
71 }