aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-dateedit.c14
-rw-r--r--widgets/misc/e-dateedit.h3
3 files changed, 25 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 9b7eb344a5..c25fcfc9b4 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-05 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #351932
+
+ * e-dateedit.h: (e_date_edit_have_time):
+ * e-dateedit.c: (e_date_edit_have_time): Extend API to be able
+ to check if time is set independently of date part.
+
2007-10-29 Kjartan Maraas <kmaraas@gnome.org>
* e-activity-handler.c: (e_activity_handler_new):
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index d1598074e7..c5399d8637 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -1953,6 +1953,20 @@ e_date_edit_time_is_valid (EDateEdit *dedit)
return TRUE;
}
+/**
+ * e_date_edit_have_time
+ * Check if time is set, i.e. it isn't 'None'/empty. Date can be set in this case.
+ *
+ * @param dedit an EDateEdit widget.
+ * @return TRUE is time is set, FALSE otherwise.
+ **/
+gboolean
+e_date_edit_have_time (EDateEdit *dedit)
+{
+ g_return_val_if_fail (dedit != NULL, FALSE);
+
+ return !dedit->priv->date_set_to_none && !dedit->priv->time_set_to_none;
+}
static gboolean
e_date_edit_set_date_internal (EDateEdit *dedit,
diff --git a/widgets/misc/e-dateedit.h b/widgets/misc/e-dateedit.h
index ffc6d87ac1..1e9aa4142c 100644
--- a/widgets/misc/e-dateedit.h
+++ b/widgets/misc/e-dateedit.h
@@ -86,6 +86,9 @@ void e_date_edit_set_editable (EDateEdit *dedit, gboolean
gboolean e_date_edit_date_is_valid (EDateEdit *dedit);
gboolean e_date_edit_time_is_valid (EDateEdit *dedit);
+/* Returns TRUE if time was set, FALSE otherwise. */
+gboolean e_date_edit_have_time (EDateEdit *dedit);
+
/* Returns the last valid date & time set, or -1 if the date & time was set to
'None' and this is permitted via e_date_edit_set_allow_no_date_set. */
time_t e_date_edit_get_time (EDateEdit *dedit);