aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-selection-dialog.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-09-29 02:58:17 +0800
committerIain Holmes <iain@src.gnome.org>2001-09-29 02:58:17 +0800
commite6ab5554d4fe16cc816d8751b0206291ffeeccc5 (patch)
tree8b6ea8acb7336b8e37db01bae9cd3ae10969753e /shell/e-shell-folder-selection-dialog.c
parent03dcbdb743e9fd4d8490f60830545a88e58776ef (diff)
downloadgsoc2013-evolution-e6ab5554d4fe16cc816d8751b0206291ffeeccc5.tar.gz
gsoc2013-evolution-e6ab5554d4fe16cc816d8751b0206291ffeeccc5.tar.zst
gsoc2013-evolution-e6ab5554d4fe16cc816d8751b0206291ffeeccc5.zip
Allow callers to set the default type of folder to be created.
svn path=/trunk/; revision=13220
Diffstat (limited to 'shell/e-shell-folder-selection-dialog.c')
-rw-r--r--shell/e-shell-folder-selection-dialog.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/shell/e-shell-folder-selection-dialog.c b/shell/e-shell-folder-selection-dialog.c
index e113b540dc..016ef51cca 100644
--- a/shell/e-shell-folder-selection-dialog.c
+++ b/shell/e-shell-folder-selection-dialog.c
@@ -50,6 +50,7 @@ struct _EShellFolderSelectionDialogPrivate {
GList *allowed_types;
EStorageSet *storage_set;
GtkWidget *storage_set_view;
+ char *default_type;
gboolean allow_creation;
};
@@ -143,6 +144,7 @@ impl_destroy (GtkObject *object)
e_free_string_list (priv->allowed_types);
+ g_free (priv->default_type);
g_free (priv);
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -205,6 +207,7 @@ impl_clicked (GnomeDialog *dialog,
e_shell_show_folder_creation_dialog (priv->shell, GTK_WINDOW (dialog),
default_parent_folder,
+ priv->default_type,
folder_creation_dialog_result_cb,
dialog);
@@ -260,6 +263,7 @@ init (EShellFolderSelectionDialog *shell_folder_selection_dialog)
priv->storage_set_view = NULL;
priv->allowed_types = NULL;
priv->allow_creation = TRUE;
+ priv->default_type = NULL;
shell_folder_selection_dialog->priv = priv;
}
@@ -311,6 +315,8 @@ folder_selected_cb (EStorageSetView *storage_set_view,
* @caption: A brief text to be put on top of the storage view
* @default_uri: The URI of the folder to be selected by default
* @allowed_types: List of the names of the allowed types
+ * @default_type: The default type of folder that will be created if the
+ * New folder button is pressed.
*
* Construct @folder_selection_dialog.
**/
@@ -320,7 +326,8 @@ e_shell_folder_selection_dialog_construct (EShellFolderSelectionDialog *folder_s
const char *title,
const char *caption,
const char *default_uri,
- const char *allowed_types[])
+ const char *allowed_types[],
+ const char *default_type)
{
EShellFolderSelectionDialogPrivate *priv;
GtkWidget *scroll_frame;
@@ -335,6 +342,11 @@ e_shell_folder_selection_dialog_construct (EShellFolderSelectionDialog *folder_s
priv = folder_selection_dialog->priv;
+ if (default_type != NULL && *default_type != 0) {
+ priv->default_type = g_strdup (default_type);
+ } else {
+ priv->default_type = NULL;
+ }
/* Basic dialog setup. */
gtk_window_set_policy (GTK_WINDOW (folder_selection_dialog), TRUE, TRUE, FALSE);
@@ -437,7 +449,8 @@ e_shell_folder_selection_dialog_new (EShell *shell,
const char *title,
const char *caption,
const char *default_uri,
- const char *allowed_types[])
+ const char *allowed_types[],
+ const char *default_type)
{
EShellFolderSelectionDialog *folder_selection_dialog;
@@ -446,7 +459,7 @@ e_shell_folder_selection_dialog_new (EShell *shell,
folder_selection_dialog = gtk_type_new (e_shell_folder_selection_dialog_get_type ());
e_shell_folder_selection_dialog_construct (folder_selection_dialog, shell,
- title, caption, default_uri, allowed_types);
+ title, caption, default_uri, allowed_types, default_type);
return GTK_WIDGET (folder_selection_dialog);
}