aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-selection-dialog.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-09-26 05:40:17 +0800
committerDan Winship <danw@src.gnome.org>2002-09-26 05:40:17 +0800
commit82f2740249a309e51d19a7e5d539f41b74fa6a36 (patch)
tree4b51d1831363c8a805497be7e9afd6ad5fb07ac4 /shell/e-shell-folder-selection-dialog.c
parentcec75c7f59272daf6a6e38960a31e4957102fb83 (diff)
downloadgsoc2013-evolution-82f2740249a309e51d19a7e5d539f41b74fa6a36.tar
gsoc2013-evolution-82f2740249a309e51d19a7e5d539f41b74fa6a36.tar.gz
gsoc2013-evolution-82f2740249a309e51d19a7e5d539f41b74fa6a36.tar.bz2
gsoc2013-evolution-82f2740249a309e51d19a7e5d539f41b74fa6a36.tar.lz
gsoc2013-evolution-82f2740249a309e51d19a7e5d539f41b74fa6a36.tar.xz
gsoc2013-evolution-82f2740249a309e51d19a7e5d539f41b74fa6a36.tar.zst
gsoc2013-evolution-82f2740249a309e51d19a7e5d539f41b74fa6a36.zip
If one of the allowed types is "type/*", allow anything starting with
* e-shell-folder-selection-dialog.c (check_folder_type_valid): If one of the allowed types is "type/*", allow anything starting with "type/". (impl_clicked): If the first allowed type is "type/*", pass "type" to e_shell_show_folder_creation_dialog. * evolution-folder-selector-button.c (evolution_folder_selector_button_set_uri): Handle "type/*" as an allowed type. * e-shell-settings-dialog.c (e_shell_settings_dialog_show_type): If there are no pages for the current folder type, try the parent type (eg, "mail" for "mail/public"). * e-shell-config-autocompletion.c (e_shell_config_autocompletion_create_widget): Use "contacts/*" as the allowed folder type. svn path=/trunk/; revision=18220
Diffstat (limited to 'shell/e-shell-folder-selection-dialog.c')
-rw-r--r--shell/e-shell-folder-selection-dialog.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/shell/e-shell-folder-selection-dialog.c b/shell/e-shell-folder-selection-dialog.c
index f4300a2dd0..62a9b2bb08 100644
--- a/shell/e-shell-folder-selection-dialog.c
+++ b/shell/e-shell-folder-selection-dialog.c
@@ -88,11 +88,15 @@ check_folder_type_valid (EShellFolderSelectionDialog *folder_selection_dialog)
folder_type = e_folder_get_type_string (folder);
for (p = priv->allowed_types; p != NULL; p = p->next) {
- const char *type;
+ const char *type, *slash;
type = (const char *) p->data;
if (strcasecmp (folder_type, type) == 0)
return TRUE;
+ slash = strchr (type, '/');
+ if (slash && slash[1] == '*' &&
+ g_strncasecmp (folder_type, type, slash - type) == 0)
+ return TRUE;
}
return FALSE;
@@ -199,7 +203,8 @@ impl_clicked (GnomeDialog *dialog,
EShellFolderSelectionDialogPrivate *priv;
EStorageSetView *storage_set_view;
const char *default_parent_folder;
- const char *default_type;
+ const char *default_subtype;
+ char *default_type;
folder_selection_dialog = E_SHELL_FOLDER_SELECTION_DIALOG (dialog);
priv = folder_selection_dialog->priv;
@@ -224,15 +229,19 @@ impl_clicked (GnomeDialog *dialog,
first of the allowed types. If all types are allowed,
hardcode to "mail". */
if (priv->allowed_types == NULL)
- default_type = "mail";
- else
- default_type = (const char *) priv->allowed_types->data;
+ default_type = g_strdup ("mail");
+ else {
+ default_subtype = (const char *) priv->allowed_types->data;
+ default_type = g_strndup (default_subtype,
+ strcspn (default_subtype, "/"));
+ }
e_shell_show_folder_creation_dialog (priv->shell, GTK_WINDOW (dialog),
default_parent_folder,
default_type,
folder_creation_dialog_result_cb,
dialog);
+ g_free (default_type);
break;
}
@@ -316,16 +325,12 @@ double_click_cb (EStorageSetView *essv,
GdkEvent *event,
EShellFolderSelectionDialog *folder_selection_dialog)
{
- EShellFolderSelectionDialogPrivate *priv;
-
g_return_if_fail (folder_selection_dialog != NULL);
- priv = folder_selection_dialog->priv;
if (check_folder_type_valid (folder_selection_dialog)) {
gtk_signal_emit (GTK_OBJECT (folder_selection_dialog),
signals[FOLDER_SELECTED],
e_shell_folder_selection_dialog_get_selected_path (folder_selection_dialog));
-
gnome_dialog_close (GNOME_DIALOG (folder_selection_dialog));
}
}