aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog29
-rw-r--r--shell/Evolution-Shell.idl3
-rw-r--r--shell/e-shell-folder-commands.c14
-rw-r--r--shell/e-shell-folder-selection-dialog.c34
-rw-r--r--shell/e-shell-folder-selection-dialog.h6
-rw-r--r--shell/e-shell-importer.c2
-rw-r--r--shell/e-shell-view-menu.c4
-rw-r--r--shell/e-shell.c3
-rw-r--r--shell/evolution-shell-client.c9
9 files changed, 64 insertions, 40 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 755c523d0e..4172e453ab 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,34 @@
2002-05-22 Ettore Perazzoli <ettore@ximian.com>
+ * e-shell.c (impl_Shell_selectUserFolder): No more @default_type
+ arg to e_shell_folder_selection_dialog_new().
+
+ * e-shell-view-menu.c (command_goto_folder): No more @default_type
+ arg to e_shell_folder_selection_dialog_new().
+ (command_new_shortcut): Likewise.
+
+ * e-shell-importer.c (import_druid_finish): No more @default_type
+ arg to e_shell_folder_selection_dialog_new().
+
+ * e-shell-folder-commands.c (e_shell_command_move_folder): No more
+ @default_type arg to e_shell_folder_selection_dialog_new().
+ (e_shell_command_copy_folder): Likewise.
+
+ * e-shell-folder-selection-dialog.c: Removed default_type member
+ in EShellFolderSelectionDialogPrivate.
+ (e_shell_folder_selection_dialog_new): Removed @default_type arg.
+ (e_shell_folder_selection_dialog_construct): Likewise.
+ (impl_clicked): Just pass the first of the allowed types to
+ e_shell_show_folder_creation_dialog() for the default type.
+
+ * evolution-shell-client.c (user_select_folder): No more
+ @default_type arg to the ::userSelectFolder CORBA method.
+
+ * Evolution-Shell.idl (selectUserFolder): Remove arg
+ @default_type.
+
+2002-05-22 Ettore Perazzoli <ettore@ximian.com>
+
* main.c (view_map_callback): New callback for when the first
created view in the shell gets mapped.
(new_view_created_callback): New callback for when the first view
diff --git a/shell/Evolution-Shell.idl b/shell/Evolution-Shell.idl
index 814133f7fc..101781cbfd 100644
--- a/shell/Evolution-Shell.idl
+++ b/shell/Evolution-Shell.idl
@@ -94,8 +94,7 @@ module Evolution {
in FolderSelectionListener listener,
in string title,
in string default_folder,
- in FolderTypeNameList possible_types,
- in string default_type)
+ in FolderTypeNameList possible_types)
raises (NotReady, Busy);
/**
diff --git a/shell/e-shell-folder-commands.c b/shell/e-shell-folder-commands.c
index a2b1055b5a..aee1d459e3 100644
--- a/shell/e-shell-folder-commands.c
+++ b/shell/e-shell-folder-commands.c
@@ -322,11 +322,8 @@ e_shell_command_copy_folder (EShell *shell,
get_folder_name (shell, folder_path));
uri = g_strconcat (E_SHELL_URI_PREFIX, folder_path, NULL);
- folder_selection_dialog = e_shell_folder_selection_dialog_new (shell,
- _("Copy folder"),
- caption,
- uri,
- NULL, NULL);
+ folder_selection_dialog = e_shell_folder_selection_dialog_new (shell, _("Copy folder"),
+ caption, uri, NULL);
g_free (caption);
g_free (uri);
@@ -369,11 +366,8 @@ e_shell_command_move_folder (EShell *shell,
get_folder_name (shell, folder_path));
uri = g_strconcat (E_SHELL_URI_PREFIX, folder_path, NULL);
- folder_selection_dialog = e_shell_folder_selection_dialog_new (shell,
- _("Move folder"),
- caption,
- uri,
- NULL, NULL);
+ folder_selection_dialog = e_shell_folder_selection_dialog_new (shell, _("Move folder"),
+ caption, uri, NULL);
g_free (caption);
g_free (uri);
diff --git a/shell/e-shell-folder-selection-dialog.c b/shell/e-shell-folder-selection-dialog.c
index 5419da4431..d653e31522 100644
--- a/shell/e-shell-folder-selection-dialog.c
+++ b/shell/e-shell-folder-selection-dialog.c
@@ -49,7 +49,6 @@ struct _EShellFolderSelectionDialogPrivate {
GList *allowed_types;
EStorageSet *storage_set;
GtkWidget *storage_set_view;
- char *default_type;
gboolean allow_creation;
};
@@ -160,7 +159,6 @@ 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);
@@ -201,6 +199,7 @@ impl_clicked (GnomeDialog *dialog,
EShellFolderSelectionDialogPrivate *priv;
EStorageSetView *storage_set_view;
const char *default_parent_folder;
+ const char *default_type;
folder_selection_dialog = E_SHELL_FOLDER_SELECTION_DIALOG (dialog);
priv = folder_selection_dialog->priv;
@@ -221,9 +220,17 @@ impl_clicked (GnomeDialog *dialog,
storage_set_view = E_STORAGE_SET_VIEW (priv->storage_set_view);
default_parent_folder = e_storage_set_view_get_current_folder (storage_set_view);
+ /* The default type in the folder creation dialog will be the
+ 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;
+
e_shell_show_folder_creation_dialog (priv->shell, GTK_WINDOW (dialog),
default_parent_folder,
- priv->default_type,
+ (const char *) priv->allowed_types->data,
folder_creation_dialog_result_cb,
dialog);
@@ -279,7 +286,6 @@ 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;
}
@@ -331,8 +337,6 @@ 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.
**/
@@ -342,8 +346,7 @@ 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 *default_type)
+ const char *allowed_types[])
{
EShellFolderSelectionDialogPrivate *priv;
GtkWidget *scroll_frame;
@@ -358,11 +361,6 @@ 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);
@@ -424,6 +422,11 @@ e_shell_folder_selection_dialog_construct (EShellFolderSelectionDialog *folder_s
for (i = 0; allowed_types[i] != NULL; i++)
priv->allowed_types = g_list_prepend (priv->allowed_types,
g_strdup (allowed_types[i]));
+
+ /* Preserve the order so we can use the first type listed as
+ the default for the folder creation dialog invoked by the
+ "New..." button. */
+ priv->allowed_types = g_list_reverse (priv->allowed_types);
}
if (default_uri != NULL)
@@ -465,8 +468,7 @@ e_shell_folder_selection_dialog_new (EShell *shell,
const char *title,
const char *caption,
const char *default_uri,
- const char *allowed_types[],
- const char *default_type)
+ const char *allowed_types[])
{
EShellFolderSelectionDialog *folder_selection_dialog;
@@ -475,7 +477,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, default_type);
+ title, caption, default_uri, allowed_types);
return GTK_WIDGET (folder_selection_dialog);
}
diff --git a/shell/e-shell-folder-selection-dialog.h b/shell/e-shell-folder-selection-dialog.h
index 32c34cb52b..30575d12cd 100644
--- a/shell/e-shell-folder-selection-dialog.h
+++ b/shell/e-shell-folder-selection-dialog.h
@@ -64,14 +64,12 @@ void e_shell_folder_selection_dialog_construct (EShellFolderSele
const char *title,
const char *caption,
const char *default_uri,
- const char *allowed_types[],
- const char *default_type);
+ const char *allowed_types[]);
GtkWidget *e_shell_folder_selection_dialog_new (EShell *shell,
const char *title,
const char *caption,
const char *default_uri,
- const char *allowed_types[],
- const char *default_type);
+ const char *allowed_types[]);
void e_shell_folder_selection_dialog_set_allow_creation (EShellFolderSelectionDialog *folder_selection_dialog,
gboolean allow_creation);
diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c
index 54012965ab..ca53f77abc 100644
--- a/shell/e-shell-importer.c
+++ b/shell/e-shell-importer.c
@@ -1027,7 +1027,7 @@ import_druid_finish (GnomeDruidPage *page,
_("Select folder"),
_("Select a destination folder for importing this data"),
e_shell_view_get_current_uri (data->view),
- NULL, NULL);
+ NULL);
gtk_signal_connect (GTK_OBJECT (folder), "folder_selected",
GTK_SIGNAL_FUNC (folder_selected), data);
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index 52261abc1f..38b7cd9586 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -471,7 +471,7 @@ command_goto_folder (BonoboUIComponent *uih,
_("Go to folder..."),
_("Select the folder that you want to open"),
current_uri,
- NULL, NULL);
+ NULL);
gtk_window_set_transient_for (GTK_WINDOW (folder_selection_dialog), GTK_WINDOW (shell_view));
@@ -592,7 +592,7 @@ command_new_shortcut (BonoboUIComponent *uih,
_("Create a new shortcut"),
_("Select the folder you want the shortcut to point to:"),
e_shell_view_get_current_uri (shell_view),
- NULL, NULL);
+ NULL);
e_shell_folder_selection_dialog_set_allow_creation (E_SHELL_FOLDER_SELECTION_DIALOG (folder_selection_dialog),
FALSE);
diff --git a/shell/e-shell.c b/shell/e-shell.c
index d16b449647..de4294bbec 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -567,8 +567,7 @@ impl_Shell_selectUserFolder (PortableServer_Servant servant,
title,
NULL,
default_folder,
- allowed_type_names,
- default_type);
+ allowed_type_names);
listener_duplicate = CORBA_Object_duplicate (listener, ev);
diff --git a/shell/evolution-shell-client.c b/shell/evolution-shell-client.c
index ff5386baa4..00b5c4548f 100644
--- a/shell/evolution-shell-client.c
+++ b/shell/evolution-shell-client.c
@@ -234,9 +234,12 @@ user_select_folder (EvolutionShellClient *shell_client,
parent_xid = (CORBA_long_long) GDK_WINDOW_XWINDOW (GTK_WIDGET (parent)->window);
- GNOME_Evolution_Shell_selectUserFolder (corba_shell, parent_xid, listener_interface,
- title, default_folder, &corba_type_name_list,
- "", &ev);
+ GNOME_Evolution_Shell_selectUserFolder (corba_shell, parent_xid,
+ listener_interface,
+ title,
+ default_folder,
+ &corba_type_name_list,
+ &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
CORBA_exception_free (&ev);