aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r--shell/e-shell-view.c92
1 files changed, 61 insertions, 31 deletions
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));