[tasks] Add a Tomorrow button to the date combo



commit f2d1508c1d659f9b9b1df9b45c2d61e68bb0321f
Author: Ross Burton <ross linux intel com>
Date:   Mon Mar 1 17:03:00 2010 +0000

    Add a Tomorrow button to the date combo

 libkoto/koto-date-combo.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libkoto/koto-date-combo.c b/libkoto/koto-date-combo.c
index 8d5df3a..789a8d7 100644
--- a/libkoto/koto-date-combo.c
+++ b/libkoto/koto-date-combo.c
@@ -217,6 +217,23 @@ on_today_clicked (GtkButton *button, KotoDateCombo *combo)
 }
 
 /*
+ * The Tomorrow button was clicked.
+ */
+static void
+on_tomorrow_clicked (GtkButton *button, KotoDateCombo *combo)
+{
+  GDate date;
+
+  g_date_clear (&date, 1);
+  g_date_set_time_t (&date, time (NULL));
+  g_date_add_days (&date, 1);
+
+  koto_date_combo_set_date (combo, &date);
+
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo), FALSE);
+}
+
+/*
  * The None button was clicked.
  */
 static void
@@ -415,6 +432,9 @@ koto_date_combo_init (KotoDateCombo *self)
   button = gtk_button_new_with_label (_("Today"));
   g_signal_connect (button, "clicked", G_CALLBACK (on_today_clicked), self);
   gtk_container_add (GTK_CONTAINER (hbox), button);
+  button = gtk_button_new_with_label (_("Tomorrow"));
+  g_signal_connect (button, "clicked", G_CALLBACK (on_tomorrow_clicked), self);
+  gtk_container_add (GTK_CONTAINER (hbox), button);
   button = gtk_button_new_with_label (_("Never"));
   g_signal_connect (button, "clicked", G_CALLBACK (on_none_clicked), self);
   gtk_container_add (GTK_CONTAINER (hbox), button);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]