aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog9
-rw-r--r--shell/Makefile.am2
-rw-r--r--shell/e-shell-folder-commands.c125
-rw-r--r--shell/e-shell-folder-commands.h42
-rw-r--r--shell/e-shell-view-menu.c15
5 files changed, 181 insertions, 12 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index ba58043972..684ff51747 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,12 @@
+2001-05-19 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-shell-view-menu.c (command_create_folder): Call
+ `e_shell_command_create_new_folder()' implemented in
+ `e-shell-folder-commands.c'.
+
+ * e-shell-folder-commands.c: New.
+ * e-shell-folder-commands.h: New.
+
2001-05-17 Ettore Perazzoli <ettore@ximian.com>
* e-storage-set-view.c
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 8ba7d53b4b..0f2e1731c2 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -96,6 +96,8 @@ evolution_SOURCES = \
e-setup.c \
e-setup.h \
e-shell-constants.h \
+ e-shell-folder-commands.c \
+ e-shell-folder-commands.h \
e-shell-folder-creation-dialog.c \
e-shell-folder-creation-dialog.h \
e-shell-folder-selection-dialog.c \
diff --git a/shell/e-shell-folder-commands.c b/shell/e-shell-folder-commands.c
new file mode 100644
index 0000000000..4d0342f7de
--- /dev/null
+++ b/shell/e-shell-folder-commands.c
@@ -0,0 +1,125 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-shell-folder-commands.h
+ *
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Ettore Perazzoli
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "e-shell-folder-commands.h"
+
+#include "e-shell-constants.h"
+#include "e-shell-folder-creation-dialog.h"
+
+
+void
+e_shell_command_create_new_folder (EShell *shell,
+ EShellView *shell_view)
+{
+ const char *current_uri;
+ const char *default_folder;
+
+ g_return_if_fail (shell != NULL);
+ g_return_if_fail (E_IS_SHELL (shell));
+ g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view));
+
+ current_uri = e_shell_view_get_current_uri (shell_view);
+
+ if (strncmp (current_uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0)
+ default_folder = current_uri + E_SHELL_URI_PREFIX_LEN;
+ else
+ default_folder = NULL;
+
+ e_shell_show_folder_creation_dialog (shell, GTK_WINDOW (shell_view), default_folder,
+ NULL /* result_callback */,
+ NULL /* result_callback_data */);
+}
+
+
+void
+e_shell_command_open_folder_in_other_window (EShell *shell,
+ EShellView *shell_view)
+{
+ g_return_if_fail (shell != NULL);
+ g_return_if_fail (E_IS_SHELL (shell));
+ g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view));
+
+ g_warning ("To be implemented");
+}
+
+
+void
+e_shell_command_copy_folder (EShell *shell,
+ EShellView *shell_view)
+{
+ g_return_if_fail (shell != NULL);
+ g_return_if_fail (E_IS_SHELL (shell));
+ g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view));
+
+ g_warning ("To be implemented");
+}
+
+
+void
+e_shell_command_move_folder (EShell *shell,
+ EShellView *shell_view)
+{
+ g_return_if_fail (shell != NULL);
+ g_return_if_fail (E_IS_SHELL (shell));
+ g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view));
+}
+
+
+void
+e_shell_command_rename_folder (EShell *shell,
+ EShellView *shell_view)
+{
+ g_return_if_fail (shell != NULL);
+ g_return_if_fail (E_IS_SHELL (shell));
+ g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view));
+
+ g_warning ("To be implemented");
+}
+
+
+void
+e_shell_command_add_to_shortcut_bar (EShell *shell,
+ EShellView *shell_view)
+{
+ g_return_if_fail (shell != NULL);
+ g_return_if_fail (E_IS_SHELL (shell));
+ g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view));
+
+ g_warning ("To be implemented");
+}
+
+
+void
+e_shell_command_folder_properties (EShell *shell,
+ EShellView *shell_view)
+{
+ g_return_if_fail (shell != NULL);
+ g_return_if_fail (E_IS_SHELL (shell));
+ g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view));
+
+ g_warning ("To be implemented");
+}
diff --git a/shell/e-shell-folder-commands.h b/shell/e-shell-folder-commands.h
new file mode 100644
index 0000000000..379b401f9a
--- /dev/null
+++ b/shell/e-shell-folder-commands.h
@@ -0,0 +1,42 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-shell-folder-commands.h
+ *
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Ettore Perazzoli
+ */
+
+#ifndef E_SHELL_FOLDER_COMMANDS_H
+#define E_SHELL_FOLDER_COMMANDS_H
+
+#include "e-shell.h"
+#include "e-shell-view.h"
+
+void e_shell_command_create_new_folder (EShell *shell, EShellView *shell_view);
+
+void e_shell_command_open_folder_in_other_window (EShell *shell, EShellView *shell_view);
+
+void e_shell_command_copy_folder (EShell *shell, EShellView *shell_view);
+void e_shell_command_move_folder (EShell *shell, EShellView *shell_view);
+void e_shell_command_rename_folder (EShell *shell, EShellView *shell_view);
+
+void e_shell_command_add_to_shortcut_bar (EShell *shell, EShellView *shell_view);
+
+void e_shell_command_folder_properties (EShell *shell, EShellView *shell_view);
+
+#endif
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index 4ca1c37b75..3e8d2b9bd7 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -47,6 +47,8 @@
#include "e-shell-view-menu.h"
#include "e-shell-importer.h"
+#include "e-shell-folder-commands.h"
+
#include "e-util/e-gui-utils.h"
@@ -410,22 +412,11 @@ command_create_folder (BonoboUIComponent *uih,
{
EShellView *shell_view;
EShell *shell;
- const char *current_uri;
- const char *default_folder;
shell_view = E_SHELL_VIEW (data);
shell = e_shell_view_get_shell (shell_view);
- current_uri = e_shell_view_get_current_uri (shell_view);
-
- if (strncmp (current_uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0)
- default_folder = current_uri + E_SHELL_URI_PREFIX_LEN;
- else
- default_folder = NULL;
-
- e_shell_show_folder_creation_dialog (shell, GTK_WINDOW (shell_view), default_folder,
- NULL /* result_callback */,
- NULL /* result_callback_data */);
+ e_shell_command_create_new_folder (shell, shell_view);
}
static void