[gnome-calendar] source-dialog: forbid empty source names
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] source-dialog: forbid empty source names
- Date: Mon, 25 May 2015 16:56:46 +0000 (UTC)
commit 2ffa2ecf6e176f2865251166e484b27440a0654d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Apr 9 00:14:29 2015 -0300
source-dialog: forbid empty source names
src/gcal-source-dialog.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 843a91b..fdb43d1 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -535,8 +535,15 @@ name_entry_text_changed (GObject *object,
gpointer user_data)
{
GcalSourceDialogPrivate *priv = GCAL_SOURCE_DIALOG (user_data)->priv;
+ gboolean valid;
- e_source_set_display_name (priv->source, gtk_entry_get_text (GTK_ENTRY (priv->name_entry)));
+ valid = g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (object)), -1) > 0;
+
+ gtk_widget_set_sensitive (priv->back_button, valid);
+ gtk_widget_set_sensitive (priv->add_button, valid);
+
+ if (valid)
+ e_source_set_display_name (priv->source, gtk_entry_get_text (GTK_ENTRY (priv->name_entry)));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]