aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-13 23:08:00 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-16 17:27:21 +0800
commitf0154b61b01a8cfe1db948126d64508880116fa4 (patch)
treeccdb5b5018ad7856b88ca8be32af1a5dfdeac77b /tests
parent706a49f918e7ae2b0cd8acef45b7cde21f625571 (diff)
downloadgsoc2013-empathy-f0154b61b01a8cfe1db948126d64508880116fa4.tar
gsoc2013-empathy-f0154b61b01a8cfe1db948126d64508880116fa4.tar.gz
gsoc2013-empathy-f0154b61b01a8cfe1db948126d64508880116fa4.tar.bz2
gsoc2013-empathy-f0154b61b01a8cfe1db948126d64508880116fa4.tar.lz
gsoc2013-empathy-f0154b61b01a8cfe1db948126d64508880116fa4.tar.xz
gsoc2013-empathy-f0154b61b01a8cfe1db948126d64508880116fa4.tar.zst
gsoc2013-empathy-f0154b61b01a8cfe1db948126d64508880116fa4.zip
add EmpathyCalendarButton
https://bugzilla.gnome.org/show_bug.cgi?id=671981
Diffstat (limited to 'tests')
-rw-r--r--tests/interactive/.gitignore1
-rw-r--r--tests/interactive/Makefile.am4
-rw-r--r--tests/interactive/test-empathy-calendar-button.c72
3 files changed, 76 insertions, 1 deletions
diff --git a/tests/interactive/.gitignore b/tests/interactive/.gitignore
index ea3271654..535570e16 100644
--- a/tests/interactive/.gitignore
+++ b/tests/interactive/.gitignore
@@ -9,3 +9,4 @@ test-empathy-presence-chooser
test-empathy-status-preset-dialog
test-empathy-protocol-chooser
test-empathy-account-chooser
+test-empathy-calendar-button
diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am
index bb0f41548..5cb89bb10 100644
--- a/tests/interactive/Makefile.am
+++ b/tests/interactive/Makefile.am
@@ -19,7 +19,8 @@ noinst_PROGRAMS = \
test-empathy-presence-chooser \
test-empathy-status-preset-dialog \
test-empathy-protocol-chooser \
- test-empathy-account-chooser
+ test-empathy-account-chooser \
+ test-empathy-calendar-button
empathy_logs_SOURCES = empathy-logs.c
test_empathy_contact_blocking_dialog_SOURCES = test-empathy-contact-blocking-dialog.c
@@ -27,3 +28,4 @@ test_empathy_presence_chooser_SOURCES = test-empathy-presence-chooser.c
test_empathy_status_preset_dialog_SOURCES = test-empathy-status-preset-dialog.c
test_empathy_protocol_chooser_SOURCES = test-empathy-protocol-chooser.c
test_empathy_account_chooser_SOURCES = test-empathy-account-chooser.c
+test_empathy_calendar_button_SOURCES = test-empathy-calendar-button.c
diff --git a/tests/interactive/test-empathy-calendar-button.c b/tests/interactive/test-empathy-calendar-button.c
new file mode 100644
index 000000000..df91f1f2d
--- /dev/null
+++ b/tests/interactive/test-empathy-calendar-button.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2012 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors: Danielle Madeley <danielle.madeley@collabora.co.uk>
+ */
+
+#include "config.h"
+
+#include <libempathy-gtk/empathy-calendar-button.h>
+
+static void
+date_changed_cb (EmpathyCalendarButton *button,
+ GDate *date,
+ gpointer user_data)
+{
+ if (date == NULL)
+ {
+ g_print ("date changed: none\n");
+ }
+ else
+ {
+ gchar buffer[128];
+
+ g_date_strftime (buffer, 128, "%x", date);
+ g_print ("date changed: %s\n", buffer);
+ }
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ GtkWidget *win, *button;
+ GDate *date;
+
+ gtk_init (&argc, &argv);
+
+ win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ g_signal_connect_swapped (win, "destroy",
+ G_CALLBACK (gtk_main_quit), NULL);
+
+ button = empathy_calendar_button_new ();
+
+ date = g_date_new_dmy (30, 11, 1984);
+ empathy_calendar_button_set_date (EMPATHY_CALENDAR_BUTTON (button), date);
+ g_date_free (date);
+
+ g_signal_connect (button, "date-changed",
+ G_CALLBACK (date_changed_cb), NULL);
+
+ gtk_container_add (GTK_CONTAINER (win), button);
+ gtk_widget_show_all (win);
+
+ gtk_main ();
+ return 0;
+}