[evolution-patches] Patch for #42518 (shell)
- From: Ettore Perazzoli <ettore ximian com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] Patch for #42518 (shell)
- Date: 08 May 2003 12:12:29 -0400
This also includes a one-line fix to give the folder creation dialog a
default button.
-- Ettore
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1268
diff -u -p -r1.1268 ChangeLog
--- ChangeLog 7 May 2003 19:38:18 -0000 1.1268
+++ ChangeLog 8 May 2003 15:55:49 -0000
@@ -1,3 +1,20 @@
+2003-05-08 Ettore Perazzoli <ettore ximian com>
+
+ [#42518]
+ * e-shell-view.c (handle_current_folder_removed): Casefold the
+ Inbox name only once, instead of once per iteration. Removed the
+ spurious slash that was being passed in the path in the Inbox case
+ and prevented it from working. Added missing slash in the path
+ for the storage case. Casefold the path including the slash,
+ since we compare against a string that does include the slash.
+ (storage_set_removed_folder_callback): Remove the notebook page
+ before calling handle_current_folder_removed(), instead of after;
+ otherwise, the notebook page number we have might not be valid
+ anymore.
+
+ * e-shell-folder-creation-dialog.c (setup_dialog): Set the default
+ response for the dialog to GTK_RESPONSE_OK.
+
2003-05-07 Ettore Perazzoli <ettore ximian com>
* e-shell-folder-commands.c (e_shell_command_add_to_shortcut_bar):
Index: e-shell-folder-creation-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-folder-creation-dialog.c,v
retrieving revision 1.49
diff -u -p -r1.49 e-shell-folder-creation-dialog.c
--- e-shell-folder-creation-dialog.c 21 Apr 2003 19:27:34 -0000 1.49
+++ e-shell-folder-creation-dialog.c 8 May 2003 15:55:49 -0000
@@ -307,6 +307,8 @@ setup_dialog (GtkWidget *dialog,
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_window_set_title (GTK_WINDOW (dialog), _("Create New Folder"));
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
gtk_widget_show (dialog);
Index: e-shell-view.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-view.c,v
retrieving revision 1.281
diff -u -p -r1.281 e-shell-view.c
--- e-shell-view.c 18 Apr 2003 17:46:26 -0000 1.281
+++ e-shell-view.c 8 May 2003 15:55:50 -0000
@@ -468,6 +468,7 @@ find_inbox_in_storage (EShellView *shell
EShellViewPrivate *priv;
EStorageSet *storage_set;
EStorage *storage;
+ char *casefold_i18n_inbox_name;
GList *subfolder_paths;
GList *p;
@@ -475,23 +476,22 @@ find_inbox_in_storage (EShellView *shell
storage_set = e_shell_get_storage_set (priv->shell);
storage = e_storage_set_get_storage (storage_set, storage_name);
+ casefold_i18n_inbox_name = g_utf8_casefold (_("Inbox"), -1);
+
subfolder_paths = e_storage_get_subfolder_paths (storage, "/");
for (p = subfolder_paths; p != NULL; p = p->next) {
const char *path;
- char *casefold_i18n_inbox_name;
char *casefold_path;
path = (const char *) p->data;
- casefold_i18n_inbox_name = g_utf8_casefold (_("Inbox"), -1);
- casefold_path = g_utf8_casefold (path + 1, -1);
+ casefold_path = g_utf8_casefold (path, -1);
if (g_utf8_collate (casefold_path, "/inbox") == 0
- || g_utf8_collate (casefold_path + 1, _("Inbox")) == 0) {
+ || g_utf8_collate (casefold_path + 1, casefold_i18n_inbox_name) == 0) {
char *return_path;
- return_path = g_strconcat ("/", storage_name, "/", path,
- NULL);
+ return_path = g_strconcat ("/", storage_name, path, NULL);
e_free_string_list (subfolder_paths);
g_free (casefold_i18n_inbox_name);
@@ -499,10 +499,10 @@ find_inbox_in_storage (EShellView *shell
return return_path;
}
- g_free (casefold_i18n_inbox_name);
g_free (casefold_path);
}
+ g_free (casefold_i18n_inbox_name);
e_free_string_list (subfolder_paths);
return NULL;
@@ -552,7 +552,7 @@ handle_current_folder_removed (EShellVie
char *storage_uri;
/* No Inbox in this storage -- fallback to the storage. */
- storage_uri = g_strconcat (E_SHELL_URI_PREFIX, storage_name, NULL);
+ storage_uri = g_strconcat (E_SHELL_URI_PREFIX, "/", storage_name, NULL);
e_shell_view_display_uri (shell_view, storage_uri, TRUE);
g_free (storage_uri);
@@ -652,12 +652,6 @@ storage_set_removed_folder_callback (ESt
page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), view->control);
- /* Check if it's the URI that we are currently displaying. */
- if (strncmp (priv->uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0
- && strcmp (priv->uri + E_SHELL_URI_PREFIX_LEN, path) == 0) {
- handle_current_folder_removed (shell_view);
- }
-
bonobo_control_frame_control_deactivate (BONOBO_CONTROL_FRAME (bonobo_widget_get_control_frame (BONOBO_WIDGET (view->control))));
gtk_widget_destroy (view->control);
@@ -665,6 +659,12 @@ storage_set_removed_folder_callback (ESt
view_destroy (view);
gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), page_num);
+
+ /* Check if it was the URI that was being displayed. */
+ if (strncmp (priv->uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0
+ && strcmp (priv->uri + E_SHELL_URI_PREFIX_LEN, path) == 0) {
+ handle_current_folder_removed (shell_view);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]