aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-06-09 04:47:52 +0800
committerIain Holmes <iain@src.gnome.org>2001-06-09 04:47:52 +0800
commitd09d4962997e9056652815aab81f49311a6a59a8 (patch)
tree807d49e73be441e0332b67f889b38c0b518f74ef /shell
parentda6c1c4d2ef41c60130e4de31160ee8107227588 (diff)
downloadgsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar.gz
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar.bz2
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar.lz
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar.xz
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.tar.zst
gsoc2013-evolution-d09d4962997e9056652815aab81f49311a6a59a8.zip
Committing the new My Evolution.
svn path=/trunk/; revision=10163
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog28
-rw-r--r--shell/e-setup.c75
-rw-r--r--shell/e-shell-importer.c1
-rw-r--r--shell/e-shell-view.c92
-rw-r--r--shell/e-storage-set-view.c52
-rw-r--r--shell/evolution-storage.c1
6 files changed, 201 insertions, 48 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 327d172ee6..eea4620c6e 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,31 @@
+2001-06-08 Iain Holmes <iain@ximian.com>
+
+ * e-setup.c (check_dir_recur): Don't copy the old Executive-Summary dir.
+ (e_setup): If there is an Executive-Summary dir in ~/evolution/local
+ ask it the user wants to remove it.
+ (e_shell_rm_dir): Function to completely delete a directory.
+
+2001-06-07 Iain Holmes <iain@ximian.com>
+
+ * evolution-storage.c (impl_Storage_async_create_folder): Removed
+ debug spew.
+
+ * e-shell-importer.c (start_import): Removed spew.
+
+ * e-shell-view.c (update_window_icon): Take a gboolean to say if
+ the folder is my evolution. Do special cased things for My Evolution.
+ (update_folder_title_bar): Same.
+ (update_for_current_uri): Find out if the uri is the my evolution one
+ and act accordingly.
+ (get_control_for_uri): Handle the toplevel My Evolution.
+
+ * e-storage-set-view.c (etree_icon_at): Get an icon for the toplevel
+ My Evolution.
+ (etree_value_at): Default is to return "My Evolution"
+ (e_storage_set_view_construct): Set the toplevel to be called "My
+ Evolution" and show it.
+ (e_storage_set_view_set_show_folders): Same.
+
2001-06-08 Ettore Perazzoli <ettore@ximian.com>
* e-shell-folder-commands.c (e_shell_command_add_to_shortcut_bar):
diff --git a/shell/e-setup.c b/shell/e-setup.c
index 1d6e75b71e..a1698be510 100644
--- a/shell/e-setup.c
+++ b/shell/e-setup.c
@@ -69,6 +69,12 @@ check_dir_recur (const char *evolution_directory,
continue;
}
+ /* Hack to not copy the old Executive-Summary dir */
+ if (strcmp (current->d_name, "Executive-Summary") == 0) {
+ current = readdir (def);
+ continue;
+ }
+
fullname = g_concat_dir_and_file (evolution_directory,
current->d_name);
fulldefaultname = g_concat_dir_and_file (current_directory,
@@ -240,6 +246,48 @@ copy_default_stuff (const char *evolution_directory)
return retval;
}
+static void
+e_shell_rm_dir (const char *path)
+{
+ DIR *base;
+ struct stat statbuf;
+ struct dirent *contents;
+
+ stat (path, &statbuf);
+ if (!S_ISDIR (statbuf.st_mode)) {
+ /* Not a directory */
+ g_message ("Removing: %s", path);
+ unlink (path);
+ return;
+ } else {
+ g_message ("Opening: %s", path);
+ base = opendir (path);
+
+ if (base == NULL)
+ return;
+
+ contents = readdir (base);
+ while (contents != NULL) {
+ char *fullpath;
+
+ if (strcmp (contents->d_name, ".") == 0||
+ strcmp (contents->d_name, "..") ==0) {
+ contents = readdir (base);
+ continue;
+ }
+
+ fullpath = g_concat_dir_and_file (path, contents->d_name);
+ e_shell_rm_dir (fullpath);
+ g_free (fullpath);
+
+ contents = readdir (base);
+ }
+
+ closedir (base);
+ rmdir (path);
+ }
+}
+
gboolean
e_setup (const char *evolution_directory)
@@ -261,6 +309,33 @@ e_setup (const char *evolution_directory)
/* Make sure this is really our directory, not an Evolution
* build tree or something like that.
*/
+ file = g_strdup_printf ("%s/local/Executive-Summary", evolution_directory);
+ if (stat (file, &statinfo) == 0) {
+ if (S_ISDIR (statinfo.st_mode)) {
+ GtkWidget *dialog;
+
+ dialog = gnome_message_box_new (_("Evolution has detected an old\n"
+ "Executive-Summary directory.\n"
+ "This needs to be removed before\n"
+ "Evolution will run.\n"
+ "Do you want me to remove this directory?"),
+ GNOME_MESSAGE_BOX_INFO,
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+ switch (gnome_dialog_run_and_close (GNOME_DIALOG (dialog))) {
+ case 0:
+ e_shell_rm_dir (file);
+ break;
+
+ default:
+ return FALSE;
+ }
+ }
+ }
+
+ g_free (file);
+
file = g_strdup_printf ("%s/shortcuts.xml", evolution_directory);
if (stat (file, &statinfo) != 0) {
e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c
index b1cea8a153..2a16fc522c 100644
--- a/shell/e-shell-importer.c
+++ b/shell/e-shell-importer.c
@@ -394,7 +394,6 @@ start_import (const char *folderpath,
g_free (real_iid);
/* NULL for folderpath means use Inbox */
- g_message ("Folderpath: %s", folderpath);
if (*folderpath == '/') {
folderpath = strchr (folderpath + 1, '/');
}
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 2a146009bc..71584f6f3a 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1276,7 +1276,8 @@ get_storage_set_path_from_uri (const char *uri)
static void
update_window_icon (EShellView *shell_view,
- EFolder *folder)
+ EFolder *folder,
+ gboolean is_my_evolution)
{
EShellViewPrivate *priv;
const char *type;
@@ -1285,10 +1286,15 @@ update_window_icon (EShellView *shell_view,
priv = shell_view->priv;
- if (folder == NULL)
- type = NULL;
- else
+ if (folder == NULL) {
+ if (is_my_evolution) {
+ type = "My Evolution";
+ } else {
+ type = NULL;
+ }
+ } else {
type = e_folder_get_type_string (folder);
+ }
if (type == NULL) {
icon_path = NULL;
@@ -1313,7 +1319,8 @@ update_window_icon (EShellView *shell_view,
static void
update_folder_title_bar (EShellView *shell_view,
- EFolder *folder)
+ EFolder *folder,
+ gboolean is_my_evolution)
{
EShellViewPrivate *priv;
EFolderTypeRegistry *folder_type_registry;
@@ -1323,10 +1330,15 @@ update_folder_title_bar (EShellView *shell_view,
priv = shell_view->priv;
- if (folder == NULL)
- folder_type_name = NULL;
- else
+ if (folder == NULL) {
+ if (is_my_evolution) {
+ folder_type_name = "My Evolution";
+ } else {
+ folder_type_name = NULL;
+ }
+ } else {
folder_type_name = e_folder_get_type_string (folder);
+ }
if (folder_type_name == NULL) {
folder_name = NULL;
@@ -1336,7 +1348,11 @@ update_folder_title_bar (EShellView *shell_view,
folder_icon = e_folder_type_registry_get_icon_for_type (folder_type_registry,
folder_type_name,
TRUE);
- folder_name = e_folder_get_name (folder);
+ if (is_my_evolution) {
+ folder_name = "My Evolution";
+ } else {
+ folder_name = e_folder_get_name (folder);
+ }
}
if (folder_icon)
@@ -1357,21 +1373,29 @@ update_for_current_uri (EShellView *shell_view)
char *folder_name;
const char *path;
char *window_title;
+ gboolean is_my_evolution = FALSE;
priv = shell_view->priv;
path = get_storage_set_path_from_uri (priv->uri);
- if (path == NULL)
+ if (strcmp (priv->uri, "evolution:/My Evolution") == 0) {
+ /* Special case for My Evolution */
+ folder_name = g_strdup (_("My Evolution"));
+ is_my_evolution = TRUE;
folder = NULL;
- else
- folder = e_storage_set_get_folder (e_shell_get_storage_set (priv->shell),
- path);
-
- if (folder == NULL)
- folder_name = g_strdup (_("None"));
- else
- folder_name = e_utf8_to_gtk_string ((GtkWidget *) shell_view, e_folder_get_name (folder));
+ } else {
+ if (path == NULL)
+ folder = NULL;
+ else
+ folder = e_storage_set_get_folder (e_shell_get_storage_set (priv->shell),
+ path);
+
+ if (folder == NULL)
+ folder_name = g_strdup (_("None"));
+ else
+ folder_name = e_utf8_to_gtk_string ((GtkWidget *) shell_view, e_folder_get_name (folder));
+ }
if (SUB_VERSION[0] == '\0')
window_title = g_strdup_printf (_("%s - Evolution %s"), folder_name, VERSION);
@@ -1381,10 +1405,10 @@ update_for_current_uri (EShellView *shell_view)
gtk_window_set_title (GTK_WINDOW (shell_view), window_title);
g_free (window_title);
g_free (folder_name);
-
- update_folder_title_bar (shell_view, folder);
-
- update_window_icon (shell_view, folder);
+
+ update_folder_title_bar (shell_view, folder, is_my_evolution);
+
+ update_window_icon (shell_view, folder, is_my_evolution);
gtk_signal_handler_block_by_func (GTK_OBJECT (priv->storage_set_view),
GTK_SIGNAL_FUNC (folder_selected_cb),
@@ -1668,15 +1692,21 @@ get_control_for_uri (EShellView *shell_view,
if (*path == '\0')
return NULL;
- /* FIXME: This code needs to be made more robust. */
-
- slash = strchr (path + 1, G_DIR_SEPARATOR);
- if (slash == NULL || slash[1] == '\0')
- folder_type = get_type_for_storage (shell_view, path + 1, &physical_uri);
- else
- folder_type = get_type_for_folder (shell_view, path, &physical_uri);
- if (folder_type == NULL)
- return NULL;
+ /* Hack for My Evolution */
+ if (strcmp (path, "/My Evolution") == 0) {
+ folder_type = "My Evolution";
+ physical_uri = "";
+ } else {
+ /* FIXME: This code needs to be made more robust. */
+
+ slash = strchr (path + 1, G_DIR_SEPARATOR);
+ if (slash == NULL || slash[1] == '\0')
+ folder_type = get_type_for_storage (shell_view, path + 1, &physical_uri);
+ else
+ folder_type = get_type_for_folder (shell_view, path, &physical_uri);
+ if (folder_type == NULL)
+ return NULL;
+ }
folder_type_registry = e_shell_get_folder_type_registry (e_shell_view_get_shell (shell_view));
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 3129cdd976..63aa9cfbf1 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -1332,26 +1332,48 @@ etree_icon_at (ETreeModel *etree,
ETreePath tree_path,
void *model_data)
{
+ EFolderTypeRegistry *folder_type_registry;
EStorageSetView *storage_set_view;
EStorageSet *storage_set;
+ GdkPixbuf *icon_pixbuf;
EFolder *folder;
char *path;
+ int depth;
/* folders are from depth 2 on. depth 1 are storages and 0 is
- our (invisible) root node. */
- if (e_tree_model_node_depth (etree, tree_path) < 2)
- return NULL;
-
- storage_set_view = E_STORAGE_SET_VIEW (model_data);
- storage_set = storage_set_view->priv->storage_set;
+ our My Evolution root node. */
+ depth = e_tree_model_node_depth (etree, tree_path);
+
+ switch (depth) {
+ case 0: /* My Evolution */
+ storage_set_view = E_STORAGE_SET_VIEW (model_data);
+ storage_set = storage_set_view->priv->storage_set;
+
+ folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
+
+ icon_pixbuf = e_folder_type_registry_get_icon_for_type (folder_type_registry,
+ "My Evolution", TRUE);
- path = (char*)e_tree_memory_node_get_data (E_TREE_MEMORY(etree), tree_path);
+ return icon_pixbuf;
- folder = e_storage_set_get_folder (storage_set, path);
- if (folder == NULL)
+ case 1:
return NULL;
-
- return get_pixbuf_for_folder (storage_set_view, folder);
+
+ case 2:
+ storage_set_view = E_STORAGE_SET_VIEW (model_data);
+ storage_set = storage_set_view->priv->storage_set;
+
+ path = (char*)e_tree_memory_node_get_data (E_TREE_MEMORY(etree), tree_path);
+
+ folder = e_storage_set_get_folder (storage_set, path);
+ if (folder == NULL)
+ return NULL;
+
+ return get_pixbuf_for_folder (storage_set_view, folder);
+
+ default:
+ return NULL;
+ }
}
/* This function returns the number of columns in our ETreeModel. */
@@ -1414,7 +1436,7 @@ etree_value_at (ETreeModel *etree, ETreePath tree_path, int col, void *model_dat
if (storage != NULL && col == 0)
return (void *) e_storage_get_name (storage);
- return NULL;
+ return g_strdup ("My Evolution");
}
static void
@@ -1873,7 +1895,7 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view,
e_tree_memory_set_node_destroy_func (E_TREE_MEMORY (priv->etree_model), (GFunc) g_free, NULL);
e_tree_memory_set_expanded_default (E_TREE_MEMORY (priv->etree_model), TRUE);
- priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, g_strdup ("/Root Node"));
+ priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, g_strdup ("/My Evolution"));
extras = e_table_extras_new ();
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
@@ -1884,7 +1906,7 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view,
e_tree_construct_from_spec_file (E_TREE (storage_set_view), priv->etree_model, extras,
EVOLUTION_ETSPECDIR "/e-storage-set-view.etspec", NULL);
- e_tree_root_node_set_visible (E_TREE(storage_set_view), FALSE);
+ e_tree_root_node_set_visible (E_TREE(storage_set_view), TRUE);
gtk_object_unref (GTK_OBJECT (extras));
@@ -1995,7 +2017,7 @@ e_storage_set_view_set_show_folders (EStorageSetView *storage_set_view,
e_tree_memory_node_remove (E_TREE_MEMORY(priv->etree_model), priv->root_node);
/* now re-add the root node */
- priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, g_strdup ("/Root Node"));
+ priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, g_strdup ("/My Evolution"));
/* then reinsert the storages after setting the "show_folders"
flag. insert_storages will call insert_folders if
diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c
index bbe1a3be51..0686d7c0bf 100644
--- a/shell/evolution-storage.c
+++ b/shell/evolution-storage.c
@@ -300,7 +300,6 @@ impl_Storage_async_create_folder (PortableServer_Servant servant,
bonobo_object = bonobo_object_from_servant (servant);
storage = EVOLUTION_STORAGE (bonobo_object);
- g_message ("Path: %s", path);
gtk_signal_emit (GTK_OBJECT (storage), signals[CREATE_FOLDER],
listener, path, type, description, parent_physical_uri);
}