aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-selection-dialog.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-07-01 17:10:36 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-07-01 17:10:36 +0800
commit2990822b331d03ae98a2dbbc5fe07622aba5f005 (patch)
treeb04990e37ae2d93f56fc9cf5572596fc621c5137 /shell/e-shell-folder-selection-dialog.c
parent8b6c94e7cd38d3ee58fe9dfeb0d3ffd03eefd6cb (diff)
downloadgsoc2013-evolution-2990822b331d03ae98a2dbbc5fe07622aba5f005.tar
gsoc2013-evolution-2990822b331d03ae98a2dbbc5fe07622aba5f005.tar.gz
gsoc2013-evolution-2990822b331d03ae98a2dbbc5fe07622aba5f005.tar.bz2
gsoc2013-evolution-2990822b331d03ae98a2dbbc5fe07622aba5f005.tar.lz
gsoc2013-evolution-2990822b331d03ae98a2dbbc5fe07622aba5f005.tar.xz
gsoc2013-evolution-2990822b331d03ae98a2dbbc5fe07622aba5f005.tar.zst
gsoc2013-evolution-2990822b331d03ae98a2dbbc5fe07622aba5f005.zip
Implemented the `File -> New -> Shortcut' command.
I have also implemented a "no-new-button" mode for the folder selection dialog widget. svn path=/trunk/; revision=10655
Diffstat (limited to 'shell/e-shell-folder-selection-dialog.c')
-rw-r--r--shell/e-shell-folder-selection-dialog.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/shell/e-shell-folder-selection-dialog.c b/shell/e-shell-folder-selection-dialog.c
index 0096462ab7..8ef598c50b 100644
--- a/shell/e-shell-folder-selection-dialog.c
+++ b/shell/e-shell-folder-selection-dialog.c
@@ -50,6 +50,8 @@ struct _EShellFolderSelectionDialogPrivate {
GList *allowed_types;
EStorageSet *storage_set;
GtkWidget *storage_set_view;
+
+ gboolean allow_creation;
};
enum {
@@ -252,6 +254,7 @@ init (EShellFolderSelectionDialog *shell_folder_selection_dialog)
priv->storage_set = NULL;
priv->storage_set_view = NULL;
priv->allowed_types = NULL;
+ priv->allow_creation = TRUE;
shell_folder_selection_dialog->priv = priv;
}
@@ -426,6 +429,56 @@ e_shell_folder_selection_dialog_new (EShell *shell,
}
+/**
+ * e_shell_folder_selection_dialog_set_allow_creation:
+ * @folder_selection_dialog: An EShellFolderSelectionDialog widget
+ * @allow_creation: Boolean specifying whether the "New..." button should be
+ * displayed
+ *
+ * Specify whether @folder_selection_dialog should have a "New..." button to
+ * create a new folder or not.
+ **/
+void
+e_shell_folder_selection_dialog_set_allow_creation (EShellFolderSelectionDialog *folder_selection_dialog,
+ gboolean allow_creation)
+{
+ GList *button_list_item;
+ GtkWidget *button;
+
+ g_return_if_fail (folder_selection_dialog != NULL);
+ g_return_if_fail (E_IS_SHELL_FOLDER_SELECTION_DIALOG (folder_selection_dialog));
+
+ folder_selection_dialog->priv->allow_creation = !! allow_creation;
+
+ button_list_item = g_list_nth (GNOME_DIALOG (folder_selection_dialog)->buttons, 2);
+ g_assert (button_list_item != NULL);
+
+ button = GTK_WIDGET (button_list_item->data);
+
+ if (allow_creation)
+ gtk_widget_show (button);
+ else
+ gtk_widget_hide (button);
+}
+
+/**
+ * e_shell_folder_selection_dialog_get_allow_creation:
+ * @folder_selection_dialog: An EShellFolderSelectionDialog widget
+ *
+ * Get whether the "New..." button is displayed.
+ *
+ * Return value: %TRUE if the "New..." button is displayed, %FALSE otherwise.
+ **/
+gboolean
+e_shell_folder_selection_dialog_get_allow_creation (EShellFolderSelectionDialog *folder_selection_dialog)
+{
+ g_return_val_if_fail (folder_selection_dialog != NULL, FALSE);
+ g_return_val_if_fail (E_IS_SHELL_FOLDER_SELECTION_DIALOG (folder_selection_dialog), FALSE);
+
+ return folder_selection_dialog->priv->allow_creation;
+}
+
+
const char *
e_shell_folder_selection_dialog_get_selected_path (EShellFolderSelectionDialog *folder_selection_dialog)
{