aboutsummaryrefslogtreecommitdiff
path: root/src/gtkutils.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-04-10 08:24:31 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-04-10 08:24:31 +0000
commit8ad18e775be48cb52a6b182b88a831255793f465 (patch)
treee57a405ae675a07d9811fa6d7cfe686320efcf27 /src/gtkutils.c
parent62406eb470f36addb2ccdca581d9a58ef6c3cbb8 (diff)
spaces in address and server entries are automatically removed at applying account configuration.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1974 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/gtkutils.c')
-rw-r--r--src/gtkutils.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gtkutils.c b/src/gtkutils.c
index 9294587b..367a5919 100644
--- a/src/gtkutils.c
+++ b/src/gtkutils.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2008 Hiroyuki Yamamoto
*
* 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
@@ -40,6 +40,7 @@
#include <gtk/gtktreestore.h>
#include <gtk/gtkversion.h>
#include <stdlib.h>
+#include <string.h>
#include <stdarg.h>
#ifdef G_OS_WIN32
@@ -750,6 +751,19 @@ void gtkut_editable_disable_im(GtkEditable *editable)
#endif
}
+void gtkut_entry_strip_text(GtkEntry *entry)
+{
+ gchar *text;
+ gint len;
+
+ text = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
+ len = strlen(text);
+ g_strstrip(text);
+ if (len > strlen(text))
+ gtk_entry_set_text(entry, text);
+ g_free(text);
+}
+
void gtkut_container_remove(GtkContainer *container, GtkWidget *widget)
{
gtk_container_remove(container, widget);