aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2003-04-18 04:55:22 +0800
committerDan Winship <danw@src.gnome.org>2003-04-18 04:55:22 +0800
commit46b0e7c73d4347b7fcfd39231a74c6e88db0cad0 (patch)
treef907f9e2ca69162c3a7301790f24f924d148ecbc
parent5b1e2041c1c453d8fc70aa1b20be97de5d44fa70 (diff)
downloadgsoc2013-evolution-46b0e7c73d4347b7fcfd39231a74c6e88db0cad0.tar
gsoc2013-evolution-46b0e7c73d4347b7fcfd39231a74c6e88db0cad0.tar.gz
gsoc2013-evolution-46b0e7c73d4347b7fcfd39231a74c6e88db0cad0.tar.bz2
gsoc2013-evolution-46b0e7c73d4347b7fcfd39231a74c6e88db0cad0.tar.lz
gsoc2013-evolution-46b0e7c73d4347b7fcfd39231a74c6e88db0cad0.tar.xz
gsoc2013-evolution-46b0e7c73d4347b7fcfd39231a74c6e88db0cad0.tar.zst
gsoc2013-evolution-46b0e7c73d4347b7fcfd39231a74c6e88db0cad0.zip
If the default_type is "foo/bar" and "foo" appears in the list but
* e-shell-folder-creation-dialog.c (add_folder_types): If the default_type is "foo/bar" and "foo" appears in the list but "foo/bar" doesn't, use "foo" as the default type. [#41468] Also, remove a workaround for a gtk 1.2 bug. svn path=/trunk/; revision=20885
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/e-shell-folder-creation-dialog.c24
2 files changed, 18 insertions, 13 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index d4788c3a82..61bc06f773 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,10 @@
+2003-04-17 Dan Winship <danw@ximian.com>
+
+ * e-shell-folder-creation-dialog.c (add_folder_types): If the
+ default_type is "foo/bar" and "foo" appears in the list but
+ "foo/bar" doesn't, use "foo" as the default type. [#41468] Also,
+ remove a workaround for a gtk 1.2 bug.
+
2003-04-16 Dan Winship <danw@ximian.com>
* e-corba-storage.c (async_create_folder): If the new folder's
diff --git a/shell/e-shell-folder-creation-dialog.c b/shell/e-shell-folder-creation-dialog.c
index b4bc19208b..97e3e0edaa 100644
--- a/shell/e-shell-folder-creation-dialog.c
+++ b/shell/e-shell-folder-creation-dialog.c
@@ -400,21 +400,11 @@ add_folder_types (GtkWidget *dialog,
GList *types_with_display_names;
GList *p;
int default_item;
- int i;
+ int i, len;
folder_type_option_menu = glade_xml_get_widget (gui, "folder_type_option_menu");
- /* KLUDGE. So, GtkOptionMenu is badly broken. It calculates its size
- in `gtk_option_menu_set_menu()' instead of using `size_request()' as
- any sane widget would do. So, in order to avoid the "narrow
- GtkOptionMenu" bug, we have to destroy the existing associated menu
- and create a new one. Life sucks. */
-
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (folder_type_option_menu));
- g_assert (menu != NULL);
- gtk_widget_destroy (menu);
-
- menu = gtk_menu_new ();
folder_type_registry = e_shell_get_folder_type_registry (shell);
g_assert (folder_type_registry != NULL);
@@ -438,7 +428,7 @@ add_folder_types (GtkWidget *dialog,
/* FIXME: Add icon (I don't feel like writing an alpha-capable thingie again). */
- default_item = 0;
+ default_item = -1;
i = 0;
for (p = types_with_display_names; p != NULL; p = p->next) {
const TypeWithDisplayName *type;
@@ -455,11 +445,19 @@ add_folder_types (GtkWidget *dialog,
g_object_set_data_full (G_OBJECT (menu_item), "folder_type", g_strdup (type->type), g_free);
- if (strcmp (type->type, default_type ? default_type : "mail") == 0)
+ if (strcmp (type->type, default_type) == 0)
default_item = i;
+ else if (default_item == -1) {
+ len = strlen (type->type);
+ if (strncmp (type->type, default_type, len) == 0 &&
+ default_type[len] == '/')
+ default_item = i;
+ }
i ++;
}
+ if (default_item == -1)
+ default_item = 0;
for (p = types_with_display_names; p != NULL; p = p->next)
g_free (p->data);