aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/e-shell-folder-commands.c')
-rw-r--r--shell/e-shell-folder-commands.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/shell/e-shell-folder-commands.c b/shell/e-shell-folder-commands.c
index 38b934057e..4aa6e43055 100644
--- a/shell/e-shell-folder-commands.c
+++ b/shell/e-shell-folder-commands.c
@@ -44,6 +44,7 @@
#include "e-shell-constants.h"
#include "e-shell-folder-creation-dialog.h"
#include "e-shell-folder-selection-dialog.h"
+#include "e-shell-utils.h"
/* Utility functions. */
@@ -535,13 +536,24 @@ e_shell_command_rename_folder (EShell *shell,
prompt = g_strdup_printf (_("Rename the \"%s\" folder to:"), old_name);
- new_name = e_request_string (shell_view != NULL ? GTK_WINDOW (shell_view) : NULL,
- _("Rename folder"), prompt, old_name);
+ while (1) {
+ const char *reason;
- g_free (prompt);
+ new_name = e_request_string (shell_view != NULL ? GTK_WINDOW (shell_view) : NULL,
+ _("Rename folder"), prompt, old_name);
- if (new_name == NULL)
- return;
+ if (new_name == NULL)
+ return;
+
+ if (e_shell_folder_name_is_valid (new_name, &reason))
+ break;
+
+ e_notice (shell_view != NULL ? GTK_WINDOW (shell_view) : NULL,
+ GNOME_MESSAGE_BOX_ERROR,
+ _("The specified folder name is not valid: %s"), reason);
+ }
+
+ g_free (prompt);
if (strcmp (old_name, new_name) == 0) {
g_free (new_name);