[Removing Evolution::LocalStorage interface, abstracting the unread counts
2001-08-03 Jason Leach <jleach@ximian.com> [Removing Evolution::LocalStorage interface, abstracting the unread counts from a folder's name, also abstract unread counts from a shortcut's name. Fixes #4489 and #5497] * e-shortcuts.c (shortcut_item_new): Take an unread_count argument now. (shortcut_item_update): Ditto. * e-shortcuts-view-model.c (get_name_with_unread): Get a string containing a shortcut name and it's unread, because these are abstracted now. (load_group_into_model): Use the above function to make shortcuts that have unread counts. * e-storage-set-view.c (update_folder_with_unread_hash): Keep a hash of folder names with unread counts, because the folder name and it's unread count are to be separated, only the ETree is supposed to present it as one string. * e-shell-view.c: Renamed EShellView::view_title_bar to folder_title_bar, to closer match the * e-shell-view-menu.c (new_shortcut_dialog_folder_selected_cb): Make a shortcut with the unread count. * e-shell-folder-commands.c (e_shell_command_add_to_shortcut_bar): Make a shortcut with the unread count. * e-local-storage.c: Updated for API changes. * e-folder.c (e_folder_get_unread_count): New function, does what it says. (e_folder_set_unread_count): Ditto. * e-corba-storage.c (impl_StorageListener_new_folder): Renamed to match the IDL function name. (impl_StorageListener_update_folder): Ditto. (impl_StorageListener_removed_folder): Ditto. * Evolution-Storage.idl (struct Folder): Replace the boolean highlighted with a long unread_count. (updateFolder): Brought in from the now dead Evolution::LocalStorage. * Evolution-Shell.idl (getLocalStorage): Return a Storage instead of a LocalStorage. * Evolution-LocalStorage.idl: Removed, no longer needed, only used function, updateFolder, has been moved into Evolution::Storage interface. * evolution-local-storage.[ch]: Ditto. * evolution-storage.c (impl_Storage_updateFolder): Implementation of the updateFolder taken from ::LocalStorage. (class_init): New "update_folder" signal, taken from evolution-local-storage.c too. (evolution_storage_update_folder): Take an @unread_count int instead of a @highlighted boolean. (evolution_storage_new_folder): Same for here. (evolution_storage_update_folder_by_uri): And here. * evolution-storage-listener.h: "update_folder" signal no longer sends a @highlighted boolean. 2001-08-03 Jason Leach <jleach@ximian.com> * e-shell-view-menu.c (update_offline_menu_item): Use Jakub's new "Work Online" icon and fix a typo. svn path=/trunk/; revision=11633
This commit is contained in:
@ -1,3 +1,75 @@
|
|||||||
|
2001-08-03 Jason Leach <jleach@ximian.com>
|
||||||
|
|
||||||
|
[Removing Evolution::LocalStorage interface, abstracting the
|
||||||
|
unread counts from a folder's name, also abstract unread counts
|
||||||
|
from a shortcut's name. Fixes #4489 and #5497]
|
||||||
|
|
||||||
|
* e-shortcuts.c (shortcut_item_new): Take an unread_count argument
|
||||||
|
now.
|
||||||
|
(shortcut_item_update): Ditto.
|
||||||
|
|
||||||
|
* e-shortcuts-view-model.c (get_name_with_unread): Get a string
|
||||||
|
containing a shortcut name and it's unread, because these are
|
||||||
|
abstracted now.
|
||||||
|
(load_group_into_model): Use the above function to make shortcuts
|
||||||
|
that have unread counts.
|
||||||
|
|
||||||
|
* e-storage-set-view.c (update_folder_with_unread_hash): Keep a
|
||||||
|
hash of folder names with unread counts, because the folder name
|
||||||
|
and it's unread count are to be separated, only the ETree is
|
||||||
|
supposed to present it as one string.
|
||||||
|
|
||||||
|
* e-shell-view.c: Renamed EShellView::view_title_bar to
|
||||||
|
folder_title_bar, to closer match the
|
||||||
|
|
||||||
|
* e-shell-view-menu.c (new_shortcut_dialog_folder_selected_cb):
|
||||||
|
Make a shortcut with the unread count.
|
||||||
|
|
||||||
|
* e-shell-folder-commands.c (e_shell_command_add_to_shortcut_bar):
|
||||||
|
Make a shortcut with the unread count.
|
||||||
|
|
||||||
|
* e-local-storage.c: Updated for API changes.
|
||||||
|
|
||||||
|
* e-folder.c (e_folder_get_unread_count): New function, does what
|
||||||
|
it says.
|
||||||
|
(e_folder_set_unread_count): Ditto.
|
||||||
|
|
||||||
|
* e-corba-storage.c (impl_StorageListener_new_folder): Renamed to
|
||||||
|
match the IDL function name.
|
||||||
|
(impl_StorageListener_update_folder): Ditto.
|
||||||
|
(impl_StorageListener_removed_folder): Ditto.
|
||||||
|
|
||||||
|
* Evolution-Storage.idl (struct Folder): Replace the boolean
|
||||||
|
highlighted with a long unread_count.
|
||||||
|
(updateFolder): Brought in from the now dead
|
||||||
|
Evolution::LocalStorage.
|
||||||
|
|
||||||
|
* Evolution-Shell.idl (getLocalStorage): Return a Storage instead
|
||||||
|
of a LocalStorage.
|
||||||
|
|
||||||
|
* Evolution-LocalStorage.idl: Removed, no longer needed, only used
|
||||||
|
function, updateFolder, has been moved into Evolution::Storage
|
||||||
|
interface.
|
||||||
|
|
||||||
|
* evolution-local-storage.[ch]: Ditto.
|
||||||
|
|
||||||
|
* evolution-storage.c (impl_Storage_updateFolder): Implementation
|
||||||
|
of the updateFolder taken from ::LocalStorage.
|
||||||
|
(class_init): New "update_folder" signal, taken from
|
||||||
|
evolution-local-storage.c too.
|
||||||
|
(evolution_storage_update_folder): Take an @unread_count int
|
||||||
|
instead of a @highlighted boolean.
|
||||||
|
(evolution_storage_new_folder): Same for here.
|
||||||
|
(evolution_storage_update_folder_by_uri): And here.
|
||||||
|
|
||||||
|
* evolution-storage-listener.h: "update_folder" signal no longer
|
||||||
|
sends a @highlighted boolean.
|
||||||
|
|
||||||
|
2001-08-03 Jason Leach <jleach@ximian.com>
|
||||||
|
|
||||||
|
* e-shell-view-menu.c (update_offline_menu_item): Use Jakub's new
|
||||||
|
"Work Online" icon and fix a typo.
|
||||||
|
|
||||||
2001-08-03 Ettore Perazzoli <ettore@ximian.com>
|
2001-08-03 Ettore Perazzoli <ettore@ximian.com>
|
||||||
|
|
||||||
[Fix #6232, the thirty-four-splash-screens-at-startup bug.]
|
[Fix #6232, the thirty-four-splash-screens-at-startup bug.]
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
||||||
/*
|
|
||||||
* Interface for the Evolution local storage.
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Ettore Perazzoli <ettore@ximian.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000, 2001 Ximian, Inc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <Bonobo.idl>
|
|
||||||
|
|
||||||
module GNOME {
|
|
||||||
module Evolution {
|
|
||||||
interface LocalStorage : Evolution::Storage {
|
|
||||||
/**
|
|
||||||
* update_folder:
|
|
||||||
* @path: Path of a folder within the storage.
|
|
||||||
* @display_name: Name to be displayed in the tree view for
|
|
||||||
* this folder
|
|
||||||
* @highlighted: Whether or not to highlight the name.
|
|
||||||
*
|
|
||||||
* Set the name to display for the folder at the specified
|
|
||||||
* @path.
|
|
||||||
*/
|
|
||||||
void updateFolder (in string path,
|
|
||||||
in string display_name,
|
|
||||||
in boolean highlighted);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
@ -87,7 +87,7 @@ module Evolution {
|
|||||||
*
|
*
|
||||||
* Return value: the `Evolution::LocalStorage' interface for
|
* Return value: the `Evolution::LocalStorage' interface for
|
||||||
* the local storage. */
|
* the local storage. */
|
||||||
LocalStorage getLocalStorage ();
|
Storage getLocalStorage ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createStorageSetView:
|
* createStorageSetView:
|
||||||
|
@ -17,7 +17,7 @@ module Evolution {
|
|||||||
string description;
|
string description;
|
||||||
string display_name;
|
string display_name;
|
||||||
string physical_uri;
|
string physical_uri;
|
||||||
boolean highlighted;
|
long unread_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface Storage;
|
interface Storage;
|
||||||
@ -62,6 +62,10 @@ module Evolution {
|
|||||||
in boolean remove_source,
|
in boolean remove_source,
|
||||||
in Bonobo::Listener listener);
|
in Bonobo::Listener listener);
|
||||||
|
|
||||||
|
void updateFolder (in string path,
|
||||||
|
in string display_name,
|
||||||
|
in long unread_count);
|
||||||
|
|
||||||
void addListener (in StorageListener listener)
|
void addListener (in StorageListener listener)
|
||||||
raises (AlreadyListening);
|
raises (AlreadyListening);
|
||||||
|
|
||||||
@ -83,7 +87,7 @@ module Evolution {
|
|||||||
|
|
||||||
void notifyFolderUpdated (in string path,
|
void notifyFolderUpdated (in string path,
|
||||||
in string display_name,
|
in string display_name,
|
||||||
in boolean highlighted)
|
in long unread_count)
|
||||||
raises (NotFound);
|
raises (NotFound);
|
||||||
|
|
||||||
void notifyFolderRemoved (in string path)
|
void notifyFolderRemoved (in string path)
|
||||||
|
@ -19,5 +19,4 @@
|
|||||||
#include <Evolution-ShellView.idl>
|
#include <Evolution-ShellView.idl>
|
||||||
#include <Evolution-Storage.idl>
|
#include <Evolution-Storage.idl>
|
||||||
#include <Evolution-StorageSetView.idl>
|
#include <Evolution-StorageSetView.idl>
|
||||||
#include <Evolution-LocalStorage.idl>
|
|
||||||
#include <Evolution-Shell.idl>
|
#include <Evolution-Shell.idl>
|
||||||
|
@ -20,7 +20,6 @@ INCLUDES = -O \
|
|||||||
IDLS = \
|
IDLS = \
|
||||||
Evolution-Activity.idl \
|
Evolution-Activity.idl \
|
||||||
Evolution-Icon.idl \
|
Evolution-Icon.idl \
|
||||||
Evolution-LocalStorage.idl \
|
|
||||||
Evolution-Offline.idl \
|
Evolution-Offline.idl \
|
||||||
Evolution-Session.idl \
|
Evolution-Session.idl \
|
||||||
Evolution-Shell.idl \
|
Evolution-Shell.idl \
|
||||||
@ -60,7 +59,6 @@ eshellinclude_HEADERS = \
|
|||||||
Evolution.h \
|
Evolution.h \
|
||||||
e-folder-tree.h \
|
e-folder-tree.h \
|
||||||
evolution-activity-client.h \
|
evolution-activity-client.h \
|
||||||
evolution-local-storage.h \
|
|
||||||
evolution-session.h \
|
evolution-session.h \
|
||||||
evolution-shell-client.h \
|
evolution-shell-client.h \
|
||||||
evolution-shell-component-client.h \
|
evolution-shell-component-client.h \
|
||||||
@ -76,7 +74,6 @@ libeshell_la_SOURCES = \
|
|||||||
$(IDL_GENERATED) \
|
$(IDL_GENERATED) \
|
||||||
e-folder-tree.c \
|
e-folder-tree.c \
|
||||||
evolution-activity-client.c \
|
evolution-activity-client.c \
|
||||||
evolution-local-storage.c \
|
|
||||||
evolution-session.c \
|
evolution-session.c \
|
||||||
evolution-shell-client.c \
|
evolution-shell-client.c \
|
||||||
evolution-shell-component-client.c \
|
evolution-shell-component-client.c \
|
||||||
|
@ -93,7 +93,7 @@ impl_StorageListener_destroy (PortableServer_Servant servant,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
impl_StorageListener_new_folder (PortableServer_Servant servant,
|
impl_StorageListener_notifyFolderCreated (PortableServer_Servant servant,
|
||||||
const CORBA_char *path,
|
const CORBA_char *path,
|
||||||
const GNOME_Evolution_Folder *folder,
|
const GNOME_Evolution_Folder *folder,
|
||||||
CORBA_Environment *ev)
|
CORBA_Environment *ev)
|
||||||
@ -110,7 +110,6 @@ impl_StorageListener_new_folder (PortableServer_Servant servant,
|
|||||||
folder->description);
|
folder->description);
|
||||||
|
|
||||||
e_folder_set_physical_uri (e_folder, folder->physical_uri);
|
e_folder_set_physical_uri (e_folder, folder->physical_uri);
|
||||||
e_folder_set_highlighted (e_folder, folder->highlighted);
|
|
||||||
|
|
||||||
if (! e_storage_new_folder (storage, path, e_folder)) {
|
if (! e_storage_new_folder (storage, path, e_folder)) {
|
||||||
g_print ("Cannot register folder -- %s %s\n", path, folder->display_name);
|
g_print ("Cannot register folder -- %s %s\n", path, folder->display_name);
|
||||||
@ -126,10 +125,10 @@ impl_StorageListener_new_folder (PortableServer_Servant servant,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
impl_StorageListener_update_folder (PortableServer_Servant servant,
|
impl_StorageListener_notifyFolderUpdated (PortableServer_Servant servant,
|
||||||
const CORBA_char *path,
|
const CORBA_char *path,
|
||||||
const CORBA_char *display_name,
|
const CORBA_char *display_name,
|
||||||
CORBA_boolean highlighted,
|
CORBA_long unread_count,
|
||||||
CORBA_Environment *ev)
|
CORBA_Environment *ev)
|
||||||
{
|
{
|
||||||
StorageListenerServant *storage_listener_servant;
|
StorageListenerServant *storage_listener_servant;
|
||||||
@ -149,11 +148,11 @@ impl_StorageListener_update_folder (PortableServer_Servant servant,
|
|||||||
}
|
}
|
||||||
|
|
||||||
e_folder_set_name (e_folder, display_name);
|
e_folder_set_name (e_folder, display_name);
|
||||||
e_folder_set_highlighted (e_folder, highlighted);
|
e_folder_set_unread_count (e_folder, unread_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
impl_StorageListener_removed_folder (PortableServer_Servant servant,
|
impl_StorageListener_notifyFolderRemoved (PortableServer_Servant servant,
|
||||||
const CORBA_char *path,
|
const CORBA_char *path,
|
||||||
CORBA_Environment *ev)
|
CORBA_Environment *ev)
|
||||||
{
|
{
|
||||||
@ -266,7 +265,6 @@ get_name (EStorage *storage)
|
|||||||
|
|
||||||
return priv->name;
|
return priv->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_display_name (EStorage *storage)
|
get_display_name (EStorage *storage)
|
||||||
{
|
{
|
||||||
@ -434,9 +432,9 @@ corba_class_init (void)
|
|||||||
base_epv->default_POA = NULL;
|
base_epv->default_POA = NULL;
|
||||||
|
|
||||||
epv = g_new0 (POA_GNOME_Evolution_StorageListener__epv, 1);
|
epv = g_new0 (POA_GNOME_Evolution_StorageListener__epv, 1);
|
||||||
epv->notifyFolderCreated = impl_StorageListener_new_folder;
|
epv->notifyFolderCreated = impl_StorageListener_notifyFolderCreated;
|
||||||
epv->notifyFolderUpdated = impl_StorageListener_update_folder;
|
epv->notifyFolderUpdated = impl_StorageListener_notifyFolderUpdated;
|
||||||
epv->notifyFolderRemoved = impl_StorageListener_removed_folder;
|
epv->notifyFolderRemoved = impl_StorageListener_notifyFolderRemoved;
|
||||||
|
|
||||||
vepv = &storage_listener_vepv;
|
vepv = &storage_listener_vepv;
|
||||||
vepv->_base_epv = base_epv;
|
vepv->_base_epv = base_epv;
|
||||||
|
@ -43,6 +43,7 @@ struct _EFolderPrivate {
|
|||||||
char *physical_uri;
|
char *physical_uri;
|
||||||
gboolean self_highlight;
|
gboolean self_highlight;
|
||||||
int child_highlight;
|
int child_highlight;
|
||||||
|
int unread_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define EF_CLASS(obj) \
|
#define EF_CLASS(obj) \
|
||||||
@ -149,6 +150,7 @@ init (EFolder *folder)
|
|||||||
priv->physical_uri = NULL;
|
priv->physical_uri = NULL;
|
||||||
priv->self_highlight = FALSE;
|
priv->self_highlight = FALSE;
|
||||||
priv->child_highlight = 0;
|
priv->child_highlight = 0;
|
||||||
|
priv->unread_count = 0;
|
||||||
|
|
||||||
folder->priv = priv;
|
folder->priv = priv;
|
||||||
}
|
}
|
||||||
@ -231,13 +233,22 @@ e_folder_get_physical_uri (EFolder *folder)
|
|||||||
return folder->priv->physical_uri;
|
return folder->priv->physical_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
e_folder_get_unread_count (EFolder *folder)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (folder != NULL, FALSE);
|
||||||
|
g_return_val_if_fail (E_IS_FOLDER (folder), FALSE);
|
||||||
|
|
||||||
|
return folder->priv->unread_count;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
e_folder_get_highlighted (EFolder *folder)
|
e_folder_get_highlighted (EFolder *folder)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (folder != NULL, FALSE);
|
g_return_val_if_fail (folder != NULL, FALSE);
|
||||||
g_return_val_if_fail (E_IS_FOLDER (folder), FALSE);
|
g_return_val_if_fail (E_IS_FOLDER (folder), FALSE);
|
||||||
|
|
||||||
return folder->priv->self_highlight || folder->priv->child_highlight;
|
return folder->priv->child_highlight || folder->priv->unread_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -298,13 +309,13 @@ e_folder_set_physical_uri (EFolder *folder,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
e_folder_set_highlighted (EFolder *folder,
|
e_folder_set_unread_count (EFolder *folder,
|
||||||
gboolean highlighted)
|
gint unread_count)
|
||||||
{
|
{
|
||||||
g_return_if_fail (folder != NULL);
|
g_return_if_fail (folder != NULL);
|
||||||
g_return_if_fail (E_IS_FOLDER (folder));
|
g_return_if_fail (E_IS_FOLDER (folder));
|
||||||
|
|
||||||
folder->priv->self_highlight = highlighted;
|
folder->priv->unread_count = unread_count;
|
||||||
|
|
||||||
gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]);
|
gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]);
|
||||||
}
|
}
|
||||||
@ -320,8 +331,6 @@ e_folder_set_child_highlight (EFolder *folder,
|
|||||||
folder->priv->child_highlight++;
|
folder->priv->child_highlight++;
|
||||||
else
|
else
|
||||||
folder->priv->child_highlight--;
|
folder->priv->child_highlight--;
|
||||||
|
|
||||||
gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,13 +75,14 @@ const char *e_folder_get_name (EFolder *folder);
|
|||||||
const char *e_folder_get_type_string (EFolder *folder);
|
const char *e_folder_get_type_string (EFolder *folder);
|
||||||
const char *e_folder_get_description (EFolder *folder);
|
const char *e_folder_get_description (EFolder *folder);
|
||||||
const char *e_folder_get_physical_uri (EFolder *folder);
|
const char *e_folder_get_physical_uri (EFolder *folder);
|
||||||
|
int e_folder_get_unread_count (EFolder *folder);
|
||||||
gboolean e_folder_get_highlighted (EFolder *folder);
|
gboolean e_folder_get_highlighted (EFolder *folder);
|
||||||
|
|
||||||
void e_folder_set_name (EFolder *folder, const char *name);
|
void e_folder_set_name (EFolder *folder, const char *name);
|
||||||
void e_folder_set_type_string (EFolder *folder, const char *type);
|
void e_folder_set_type_string (EFolder *folder, const char *type);
|
||||||
void e_folder_set_description (EFolder *folder, const char *description);
|
void e_folder_set_description (EFolder *folder, const char *description);
|
||||||
void e_folder_set_physical_uri (EFolder *folder, const char *physical_uri);
|
void e_folder_set_physical_uri (EFolder *folder, const char *physical_uri);
|
||||||
void e_folder_set_highlighted (EFolder *folder, gboolean highlighted);
|
void e_folder_set_unread_count (EFolder *folder, int unread_count);
|
||||||
void e_folder_set_child_highlight (EFolder *folder, gboolean highlighted);
|
void e_folder_set_child_highlight (EFolder *folder, gboolean highlighted);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -28,9 +28,6 @@
|
|||||||
* - If the LocalStorage is destroyed and an async operation on a shell component is
|
* - If the LocalStorage is destroyed and an async operation on a shell component is
|
||||||
* pending, we get a callback on a bogus object. We need support for cancelling
|
* pending, we get a callback on a bogus object. We need support for cancelling
|
||||||
* operations on the shell component.
|
* operations on the shell component.
|
||||||
*
|
|
||||||
* - The tree is kept both in the EStorage and the EvolutionStorage. Very
|
|
||||||
* bad design.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@ -53,7 +50,7 @@
|
|||||||
#include "e-util/e-path.h"
|
#include "e-util/e-path.h"
|
||||||
#include "e-local-folder.h"
|
#include "e-local-folder.h"
|
||||||
|
|
||||||
#include "evolution-local-storage.h"
|
#include "evolution-storage.h"
|
||||||
|
|
||||||
#include "e-local-storage.h"
|
#include "e-local-storage.h"
|
||||||
|
|
||||||
@ -64,7 +61,7 @@ static EStorageClass *parent_class = NULL;
|
|||||||
struct _ELocalStoragePrivate {
|
struct _ELocalStoragePrivate {
|
||||||
EFolderTypeRegistry *folder_type_registry;
|
EFolderTypeRegistry *folder_type_registry;
|
||||||
char *base_path;
|
char *base_path;
|
||||||
EvolutionLocalStorage *bonobo_interface;
|
EvolutionStorage *bonobo_interface;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -146,7 +143,7 @@ new_folder (ELocalStorage *local_storage,
|
|||||||
e_folder_get_type_string (folder),
|
e_folder_get_type_string (folder),
|
||||||
e_folder_get_physical_uri (folder),
|
e_folder_get_physical_uri (folder),
|
||||||
e_folder_get_description (folder),
|
e_folder_get_description (folder),
|
||||||
e_folder_get_highlighted (folder));
|
e_folder_get_unread_count (folder));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -842,7 +839,7 @@ impl_async_xfer_folder (EStorage *storage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Callbacks for the `Evolution::LocalStorage' interface we are exposing to the outside world. */
|
/* Callbacks for the `Evolution::Storage' interface we are exposing to the outside world. */
|
||||||
static int
|
static int
|
||||||
bonobo_interface_create_folder_cb (EvolutionStorage *storage,
|
bonobo_interface_create_folder_cb (EvolutionStorage *storage,
|
||||||
const char *path,
|
const char *path,
|
||||||
@ -872,10 +869,10 @@ bonobo_interface_remove_folder_cb (EvolutionStorage *storage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bonobo_interface_update_folder_cb (EvolutionLocalStorage *bonobo_local_storage,
|
bonobo_interface_update_folder_cb (EvolutionStorage *storage,
|
||||||
const char *path,
|
const char *path,
|
||||||
const char *display_name,
|
const char *display_name,
|
||||||
gboolean highlighted,
|
int unread_count,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
ELocalStorage *local_storage;
|
ELocalStorage *local_storage;
|
||||||
@ -888,7 +885,7 @@ bonobo_interface_update_folder_cb (EvolutionLocalStorage *bonobo_local_storage,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
e_folder_set_name (folder, display_name);
|
e_folder_set_name (folder, display_name);
|
||||||
e_folder_set_highlighted (folder, highlighted);
|
e_folder_set_unread_count (folder, unread_count);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -956,7 +953,8 @@ construct (ELocalStorage *local_storage,
|
|||||||
priv->base_path = g_strndup (base_path, base_path_len);
|
priv->base_path = g_strndup (base_path, base_path_len);
|
||||||
|
|
||||||
g_assert (priv->bonobo_interface == NULL);
|
g_assert (priv->bonobo_interface == NULL);
|
||||||
priv->bonobo_interface = evolution_local_storage_new (E_LOCAL_STORAGE_NAME);
|
priv->bonobo_interface = evolution_storage_new (E_LOCAL_STORAGE_NAME,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (priv->bonobo_interface), "create_folder",
|
gtk_signal_connect (GTK_OBJECT (priv->bonobo_interface), "create_folder",
|
||||||
GTK_SIGNAL_FUNC (bonobo_interface_create_folder_cb),
|
GTK_SIGNAL_FUNC (bonobo_interface_create_folder_cb),
|
||||||
@ -1001,11 +999,11 @@ e_local_storage_get_base_path (ELocalStorage *local_storage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const GNOME_Evolution_LocalStorage
|
const GNOME_Evolution_Storage
|
||||||
e_local_storage_get_corba_interface (ELocalStorage *local_storage)
|
e_local_storage_get_corba_interface (ELocalStorage *local_storage)
|
||||||
{
|
{
|
||||||
ELocalStoragePrivate *priv;
|
ELocalStoragePrivate *priv;
|
||||||
GNOME_Evolution_LocalStorage corba_interface;
|
GNOME_Evolution_Storage corba_interface;
|
||||||
|
|
||||||
g_return_val_if_fail (local_storage != NULL, NULL);
|
g_return_val_if_fail (local_storage != NULL, NULL);
|
||||||
g_return_val_if_fail (E_IS_LOCAL_STORAGE (local_storage), NULL);
|
g_return_val_if_fail (E_IS_LOCAL_STORAGE (local_storage), NULL);
|
||||||
|
@ -62,7 +62,7 @@ EStorage *e_local_storage_open (EFolderTypeR
|
|||||||
const char *base_path);
|
const char *base_path);
|
||||||
const char *e_local_storage_get_base_path (ELocalStorage *storage);
|
const char *e_local_storage_get_base_path (ELocalStorage *storage);
|
||||||
|
|
||||||
const GNOME_Evolution_LocalStorage e_local_storage_get_corba_interface (ELocalStorage *storage);
|
const GNOME_Evolution_Storage e_local_storage_get_corba_interface (ELocalStorage *storage);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include <gtk/gtklabel.h>
|
#include <gtk/gtklabel.h>
|
||||||
#include <gtk/gtksignal.h>
|
#include <gtk/gtksignal.h>
|
||||||
|
#include <gtk/gtkentry.h>
|
||||||
|
|
||||||
#include "e-shell-constants.h"
|
#include "e-shell-constants.h"
|
||||||
#include "e-shell-folder-creation-dialog.h"
|
#include "e-shell-folder-creation-dialog.h"
|
||||||
@ -58,6 +59,19 @@ get_folder_name (EShell *shell,
|
|||||||
return e_folder_get_name (folder);
|
return e_folder_get_name (folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
get_folder_unread (EShell *shell,
|
||||||
|
const char *path)
|
||||||
|
{
|
||||||
|
EStorageSet *storage_set;
|
||||||
|
EFolder *folder;
|
||||||
|
|
||||||
|
storage_set = e_shell_get_storage_set (shell);
|
||||||
|
folder = e_storage_set_get_folder (storage_set, path);
|
||||||
|
|
||||||
|
return e_folder_get_unread_count (folder);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* The data passed to the signals handled during the execution of the folder
|
/* The data passed to the signals handled during the execution of the folder
|
||||||
commands. */
|
commands. */
|
||||||
@ -348,7 +362,6 @@ delete_dialog (EShellView *shell_view, const char *utf8_folder)
|
|||||||
|
|
||||||
/* Popup a dialog asking if they are sure they want to delete
|
/* Popup a dialog asking if they are sure they want to delete
|
||||||
the folder */
|
the folder */
|
||||||
|
|
||||||
folder_name = e_utf8_to_gtk_string (GTK_WIDGET (shell_view),
|
folder_name = e_utf8_to_gtk_string (GTK_WIDGET (shell_view),
|
||||||
(char *)utf8_folder);
|
(char *)utf8_folder);
|
||||||
title = g_strdup_printf (_("Delete folder '%s'"), folder_name);
|
title = g_strdup_printf (_("Delete folder '%s'"), folder_name);
|
||||||
@ -360,6 +373,7 @@ delete_dialog (EShellView *shell_view, const char *utf8_folder)
|
|||||||
g_free (title);
|
g_free (title);
|
||||||
gnome_dialog_set_parent (dialog, GTK_WINDOW (shell_view));
|
gnome_dialog_set_parent (dialog, GTK_WINDOW (shell_view));
|
||||||
|
|
||||||
|
/* "Are you sure..." label */
|
||||||
question = g_strdup_printf (_("Are you sure you want to remove the '%s' folder?"),
|
question = g_strdup_printf (_("Are you sure you want to remove the '%s' folder?"),
|
||||||
folder_name);
|
folder_name);
|
||||||
question_label = gtk_label_new (question);
|
question_label = gtk_label_new (question);
|
||||||
@ -407,6 +421,16 @@ e_shell_command_delete_folder (EShell *shell,
|
|||||||
g_free (path);
|
g_free (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
rename_clicked (GtkWidget *dialog, gint button_num, void *data)
|
||||||
|
{
|
||||||
|
char **retval = data;
|
||||||
|
GtkWidget *entry;
|
||||||
|
|
||||||
|
entry = gtk_object_get_data (GTK_OBJECT (dialog), "entry");
|
||||||
|
*retval = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static char *
|
static char *
|
||||||
rename_dialog (char *folder_name)
|
rename_dialog (char *folder_name)
|
||||||
@ -414,35 +438,113 @@ rename_dialog (char *folder_name)
|
|||||||
GnomeDialog *dialog;
|
GnomeDialog *dialog;
|
||||||
int result;
|
int result;
|
||||||
char *title;
|
char *title;
|
||||||
GtkWidget *question_label;
|
GtkWidget *hbox;
|
||||||
|
char *label;
|
||||||
|
GtkWidget *prompt_label;
|
||||||
GtkWidget *entry;
|
GtkWidget *entry;
|
||||||
char *question;
|
char *question;
|
||||||
|
char *retval;
|
||||||
|
|
||||||
|
/* Popup a dialog asking what the user would like to rename
|
||||||
|
the folder to */
|
||||||
title = g_strdup_printf (_("Rename folder '%s'"),
|
title = g_strdup_printf (_("Rename folder '%s'"),
|
||||||
folder_name);
|
folder_name);
|
||||||
|
|
||||||
dialog = GNOME_DIALOG (gnome_dialog_new (title,
|
dialog = GNOME_DIALOG (gnome_dialog_new (title,
|
||||||
GNOME_STOCK_BUTTON_OK,
|
_("Rename"),
|
||||||
GNOME_STOCK_BUTTON_CANCEL,
|
GNOME_STOCK_BUTTON_CANCEL,
|
||||||
NULL));
|
NULL));
|
||||||
g_free (title);
|
g_free (title);
|
||||||
|
|
||||||
/* FIXME: Finish then make command_rename_folder use it */
|
hbox = gtk_hbox_new (FALSE, 2);
|
||||||
|
|
||||||
|
/* Make, pack the label */
|
||||||
|
label = g_strdup_printf (_("Folder name:"));
|
||||||
|
prompt_label = gtk_label_new (label);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), prompt_label, FALSE, TRUE, 2);
|
||||||
|
|
||||||
|
/* Make, setup, pack the entry */
|
||||||
|
entry = gtk_entry_new ();
|
||||||
|
gtk_entry_set_text (GTK_ENTRY (entry), folder_name);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, TRUE, 2);
|
||||||
|
|
||||||
|
gtk_widget_show (GTK_WIDGET (prompt_label));
|
||||||
|
gtk_widget_show (GTK_WIDGET (entry));
|
||||||
|
gtk_widget_show (GTK_WIDGET (hbox));
|
||||||
|
|
||||||
|
gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, FALSE, TRUE, 2);
|
||||||
|
|
||||||
|
gtk_object_set_data (GTK_OBJECT (dialog), "entry", entry);
|
||||||
|
|
||||||
|
gtk_signal_connect (GTK_OBJECT (dialog), "clicked",
|
||||||
|
rename_clicked, &retval);
|
||||||
|
|
||||||
|
gnome_dialog_set_default (dialog, 1);
|
||||||
|
|
||||||
|
result = gnome_dialog_run_and_close (dialog);
|
||||||
|
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
rename_cb (EStorageSet *storage_set,
|
||||||
|
EStorageResult result,
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
/* FIXME: Do something? */
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
e_shell_command_rename_folder (EShell *shell,
|
e_shell_command_rename_folder (EShell *shell,
|
||||||
EShellView *shell_view)
|
EShellView *shell_view)
|
||||||
{
|
{
|
||||||
|
EStorageSet *storage_set;
|
||||||
|
char *oldname;
|
||||||
|
char *newname;
|
||||||
|
|
||||||
|
char *path;
|
||||||
|
char *newpath;
|
||||||
|
|
||||||
g_return_if_fail (shell != NULL);
|
g_return_if_fail (shell != NULL);
|
||||||
g_return_if_fail (E_IS_SHELL (shell));
|
g_return_if_fail (E_IS_SHELL (shell));
|
||||||
g_return_if_fail (shell_view != NULL);
|
g_return_if_fail (shell_view != NULL);
|
||||||
g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
|
g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
|
||||||
|
|
||||||
g_warning ("To be implemented");
|
storage_set = e_shell_get_storage_set (shell);
|
||||||
|
path = g_strdup (e_shell_view_get_current_path (shell_view));
|
||||||
|
|
||||||
|
oldname = get_folder_name (shell, path);
|
||||||
|
newname = rename_dialog (oldname);
|
||||||
|
|
||||||
|
if (strcmp (oldname, newname)) {
|
||||||
|
/* FIXME: Doing strstr isn't robust enough, will fail
|
||||||
|
when path is /blah/blah, do looped strchr for '/' */
|
||||||
|
char *tmp = strstr (path, oldname);
|
||||||
|
char *tmp2;
|
||||||
|
|
||||||
|
tmp2 = g_strndup (path, strlen (path) - strlen (tmp));
|
||||||
|
|
||||||
|
newpath = g_strconcat (tmp2, newname, NULL);
|
||||||
|
|
||||||
|
printf ("newpath: %s\n", newpath);
|
||||||
|
|
||||||
|
g_free (tmp2);
|
||||||
|
g_free (tmp);
|
||||||
|
|
||||||
|
/* FIXME: newpath needs to be correct
|
||||||
|
e_storage_set_async_xfer_folder (storage_set,
|
||||||
|
oldpath,
|
||||||
|
newpath,
|
||||||
|
TRUE,
|
||||||
|
rename_cb,
|
||||||
|
NULL);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
g_free (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -453,6 +555,7 @@ e_shell_command_add_to_shortcut_bar (EShell *shell,
|
|||||||
EShortcuts *shortcuts;
|
EShortcuts *shortcuts;
|
||||||
int group_num;
|
int group_num;
|
||||||
const char *uri;
|
const char *uri;
|
||||||
|
int unread_count;
|
||||||
|
|
||||||
g_return_if_fail (shell != NULL);
|
g_return_if_fail (shell != NULL);
|
||||||
g_return_if_fail (E_IS_SHELL (shell));
|
g_return_if_fail (E_IS_SHELL (shell));
|
||||||
@ -463,5 +566,7 @@ e_shell_command_add_to_shortcut_bar (EShell *shell,
|
|||||||
group_num = e_shell_view_get_current_shortcuts_group_num (shell_view);
|
group_num = e_shell_view_get_current_shortcuts_group_num (shell_view);
|
||||||
uri = e_shell_view_get_current_uri (shell_view);
|
uri = e_shell_view_get_current_uri (shell_view);
|
||||||
|
|
||||||
e_shortcuts_add_shortcut (shortcuts, group_num, -1, uri, NULL, NULL);
|
unread_count = get_folder_unread (shell, e_shell_view_get_current_path (shell_view));
|
||||||
|
|
||||||
|
e_shortcuts_add_shortcut (shortcuts, group_num, -1, uri, NULL, unread_count, NULL);
|
||||||
}
|
}
|
||||||
|
@ -580,8 +580,8 @@ e_shell_folder_title_bar_set_clickable (EShellFolderTitleBar *folder_title_bar,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (clickable) {
|
if (clickable) {
|
||||||
gtk_widget_show (priv->button);
|
|
||||||
gtk_widget_hide (priv->label);
|
gtk_widget_hide (priv->label);
|
||||||
|
gtk_widget_show (priv->button);
|
||||||
} else {
|
} else {
|
||||||
gtk_widget_hide (priv->button);
|
gtk_widget_hide (priv->button);
|
||||||
gtk_widget_show (priv->label);
|
gtk_widget_show (priv->label);
|
||||||
|
@ -377,7 +377,7 @@ command_rename_folder (BonoboUIComponent *uih,
|
|||||||
EShellView *shell_view;
|
EShellView *shell_view;
|
||||||
|
|
||||||
shell_view = E_SHELL_VIEW (data);
|
shell_view = E_SHELL_VIEW (data);
|
||||||
e_shell_command_rename_folder (e_shell_view_get_shell (shell_view), shell_view);
|
/* e_shell_command_rename_folder (e_shell_view_get_shell (shell_view), shell_view); */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -562,7 +562,7 @@ new_shortcut_dialog_folder_selected_cb (EShellFolderSelectionDialog *folder_sele
|
|||||||
evolution_uri = g_strconcat (E_SHELL_URI_PREFIX, path, NULL);
|
evolution_uri = g_strconcat (E_SHELL_URI_PREFIX, path, NULL);
|
||||||
|
|
||||||
/* FIXME: I shouldn't have to set the type here. Maybe. */
|
/* FIXME: I shouldn't have to set the type here. Maybe. */
|
||||||
e_shortcuts_add_shortcut (shortcuts, group_num, -1, evolution_uri, NULL, e_folder_get_type_string (folder));
|
e_shortcuts_add_shortcut (shortcuts, group_num, -1, evolution_uri, NULL, e_folder_get_unread_count (folder), e_folder_get_type_string (folder));
|
||||||
|
|
||||||
g_free (evolution_uri);
|
g_free (evolution_uri);
|
||||||
|
|
||||||
@ -651,6 +651,19 @@ static EPixmap pixmaps [] = {
|
|||||||
E_PIXMAP ("/menu/File/Folder/Folder", "folder.xpm"),
|
E_PIXMAP ("/menu/File/Folder/Folder", "folder.xpm"),
|
||||||
E_PIXMAP ("/menu/File/FileImporter", "import.xpm"),
|
E_PIXMAP ("/menu/File/FileImporter", "import.xpm"),
|
||||||
E_PIXMAP ("/menu/File/ToggleOffline", "work_offline.xpm"),
|
E_PIXMAP ("/menu/File/ToggleOffline", "work_offline.xpm"),
|
||||||
|
|
||||||
|
E_PIXMAP_END
|
||||||
|
};
|
||||||
|
|
||||||
|
static EPixmap offline_pixmaps [] = {
|
||||||
|
E_PIXMAP ("/menu/File/ToggleOffline", "work_offline.xpm"),
|
||||||
|
|
||||||
|
E_PIXMAP_END
|
||||||
|
};
|
||||||
|
|
||||||
|
static EPixmap online_pixmaps [] = {
|
||||||
|
E_PIXMAP ("/menu/File/ToggleOffline", "work_online-16.png"),
|
||||||
|
|
||||||
E_PIXMAP_END
|
E_PIXMAP_END
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -691,8 +704,9 @@ update_offline_menu_item (EShellView *shell_view,
|
|||||||
"/menu/File/ToggleOffline",
|
"/menu/File/ToggleOffline",
|
||||||
"verb", "WorkOnline", NULL);
|
"verb", "WorkOnline", NULL);
|
||||||
bonobo_ui_component_set_prop (ui_component,
|
bonobo_ui_component_set_prop (ui_component,
|
||||||
"/commands/WorkOnline",
|
"/commands/ToggleOffline",
|
||||||
"sensitive", "1", NULL);
|
"sensitive", "1", NULL);
|
||||||
|
e_pixmaps_update (ui_component, online_pixmaps);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_SHELL_LINE_STATUS_ONLINE:
|
case E_SHELL_LINE_STATUS_ONLINE:
|
||||||
@ -705,6 +719,7 @@ update_offline_menu_item (EShellView *shell_view,
|
|||||||
bonobo_ui_component_set_prop (ui_component,
|
bonobo_ui_component_set_prop (ui_component,
|
||||||
"/commands/ToggleOffline",
|
"/commands/ToggleOffline",
|
||||||
"sensitive", "1", NULL);
|
"sensitive", "1", NULL);
|
||||||
|
e_pixmaps_update (ui_component, offline_pixmaps);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_SHELL_LINE_STATUS_GOING_OFFLINE:
|
case E_SHELL_LINE_STATUS_GOING_OFFLINE:
|
||||||
@ -717,6 +732,7 @@ update_offline_menu_item (EShellView *shell_view,
|
|||||||
bonobo_ui_component_set_prop (ui_component,
|
bonobo_ui_component_set_prop (ui_component,
|
||||||
"/commands/ToggleOffline",
|
"/commands/ToggleOffline",
|
||||||
"sensitive", "0", NULL);
|
"sensitive", "0", NULL);
|
||||||
|
e_pixmaps_update (ui_component, offline_pixmaps);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -97,7 +97,7 @@ struct _EShellViewPrivate {
|
|||||||
GtkWidget *appbar;
|
GtkWidget *appbar;
|
||||||
GtkWidget *hpaned;
|
GtkWidget *hpaned;
|
||||||
GtkWidget *view_vbox;
|
GtkWidget *view_vbox;
|
||||||
GtkWidget *view_title_bar;
|
GtkWidget *folder_title_bar;
|
||||||
GtkWidget *view_hpaned;
|
GtkWidget *view_hpaned;
|
||||||
GtkWidget *contents;
|
GtkWidget *contents;
|
||||||
GtkWidget *notebook;
|
GtkWidget *notebook;
|
||||||
@ -255,7 +255,7 @@ popdown_transient_folder_bar (EShellView *shell_view)
|
|||||||
|
|
||||||
disconnect_popup_signals (shell_view);
|
disconnect_popup_signals (shell_view);
|
||||||
|
|
||||||
e_shell_folder_title_bar_set_toggle_state (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar), FALSE);
|
e_shell_folder_title_bar_set_toggle_state (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -342,7 +342,7 @@ popup_storage_set_view_button_clicked (ETitleBar *title_bar,
|
|||||||
disconnect_popup_signals (shell_view);
|
disconnect_popup_signals (shell_view);
|
||||||
|
|
||||||
e_shell_view_set_folder_bar_mode (shell_view, E_SHELL_VIEW_SUBWINDOW_STICKY);
|
e_shell_view_set_folder_bar_mode (shell_view, E_SHELL_VIEW_SUBWINDOW_STICKY);
|
||||||
e_shell_folder_title_bar_set_toggle_state (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar), FALSE);
|
e_shell_folder_title_bar_set_toggle_state (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -631,15 +631,19 @@ setup_storage_set_subwindow (EShellView *shell_view)
|
|||||||
|
|
||||||
priv = shell_view->priv;
|
priv = shell_view->priv;
|
||||||
|
|
||||||
storage_set_view = e_storage_set_view_new (e_shell_get_storage_set (priv->shell), priv->ui_container);
|
storage_set_view = e_storage_set_view_new (e_shell_get_storage_set (priv->shell),
|
||||||
|
priv->ui_container);
|
||||||
gtk_signal_connect (GTK_OBJECT (storage_set_view), "folder_selected",
|
gtk_signal_connect (GTK_OBJECT (storage_set_view), "folder_selected",
|
||||||
GTK_SIGNAL_FUNC (folder_selected_cb), shell_view);
|
GTK_SIGNAL_FUNC (folder_selected_cb), shell_view);
|
||||||
gtk_signal_connect (GTK_OBJECT (storage_set_view), "storage_selected",
|
gtk_signal_connect (GTK_OBJECT (storage_set_view), "storage_selected",
|
||||||
GTK_SIGNAL_FUNC (storage_selected_cb), shell_view);
|
GTK_SIGNAL_FUNC (storage_selected_cb), shell_view);
|
||||||
|
|
||||||
scroll_frame = e_scroll_frame_new (NULL, NULL);
|
scroll_frame = e_scroll_frame_new (NULL, NULL);
|
||||||
e_scroll_frame_set_policy (E_SCROLL_FRAME (scroll_frame), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
e_scroll_frame_set_policy (E_SCROLL_FRAME (scroll_frame),
|
||||||
e_scroll_frame_set_shadow_type (E_SCROLL_FRAME (scroll_frame), GTK_SHADOW_IN);
|
GTK_POLICY_AUTOMATIC,
|
||||||
|
GTK_POLICY_AUTOMATIC);
|
||||||
|
e_scroll_frame_set_shadow_type (E_SCROLL_FRAME (scroll_frame),
|
||||||
|
GTK_SHADOW_IN);
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (scroll_frame), storage_set_view);
|
gtk_container_add (GTK_CONTAINER (scroll_frame), storage_set_view);
|
||||||
|
|
||||||
@ -827,16 +831,16 @@ setup_widgets (EShellView *shell_view)
|
|||||||
|
|
||||||
priv->view_vbox = gtk_vbox_new (FALSE, 0);
|
priv->view_vbox = gtk_vbox_new (FALSE, 0);
|
||||||
|
|
||||||
priv->view_title_bar = e_shell_folder_title_bar_new ();
|
priv->folder_title_bar = e_shell_folder_title_bar_new ();
|
||||||
gtk_signal_connect (GTK_OBJECT (priv->view_title_bar), "title_toggled",
|
gtk_signal_connect (GTK_OBJECT (priv->folder_title_bar), "title_toggled",
|
||||||
GTK_SIGNAL_FUNC (title_bar_toggled_cb), shell_view);
|
GTK_SIGNAL_FUNC (title_bar_toggled_cb), shell_view);
|
||||||
|
|
||||||
priv->view_hpaned = e_hpaned_new ();
|
priv->view_hpaned = e_hpaned_new ();
|
||||||
e_paned_pack1 (E_PANED (priv->view_hpaned), priv->storage_set_view_box, FALSE, FALSE);
|
e_paned_pack1 (E_PANED (priv->view_hpaned), priv->storage_set_view_box, FALSE, TRUE);
|
||||||
e_paned_pack2 (E_PANED (priv->view_hpaned), priv->notebook, TRUE, FALSE);
|
e_paned_pack2 (E_PANED (priv->view_hpaned), priv->notebook, TRUE, FALSE);
|
||||||
e_paned_set_position (E_PANED (priv->view_hpaned), DEFAULT_TREE_WIDTH);
|
e_paned_set_position (E_PANED (priv->view_hpaned), DEFAULT_TREE_WIDTH);
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (priv->view_vbox), priv->view_title_bar,
|
gtk_box_pack_start (GTK_BOX (priv->view_vbox), priv->folder_title_bar,
|
||||||
FALSE, FALSE, 0);
|
FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (priv->view_vbox), priv->view_hpaned,
|
gtk_box_pack_start (GTK_BOX (priv->view_vbox), priv->view_hpaned,
|
||||||
TRUE, TRUE, 0);
|
TRUE, TRUE, 0);
|
||||||
@ -871,7 +875,7 @@ setup_widgets (EShellView *shell_view)
|
|||||||
gtk_widget_show (priv->hpaned);
|
gtk_widget_show (priv->hpaned);
|
||||||
gtk_widget_show (priv->view_hpaned);
|
gtk_widget_show (priv->view_hpaned);
|
||||||
gtk_widget_show (priv->view_vbox);
|
gtk_widget_show (priv->view_vbox);
|
||||||
gtk_widget_show (priv->view_title_bar);
|
gtk_widget_show (priv->folder_title_bar);
|
||||||
gtk_widget_show (priv->status_bar);
|
gtk_widget_show (priv->status_bar);
|
||||||
|
|
||||||
/* By default, both the folder bar and shortcut bar are visible. */
|
/* By default, both the folder bar and shortcut bar are visible. */
|
||||||
@ -942,18 +946,6 @@ destroy (GtkObject *object)
|
|||||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
delete_event (GtkWidget *widget,
|
|
||||||
GdkEventAny *event)
|
|
||||||
{
|
|
||||||
EShell *shell;
|
|
||||||
|
|
||||||
shell = e_shell_view_get_shell (E_SHELL_VIEW (widget));
|
|
||||||
|
|
||||||
/* FIXME: Is this right, or should it be FALSE? */
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialization. */
|
/* Initialization. */
|
||||||
|
|
||||||
@ -1102,7 +1094,7 @@ corba_interface_set_folder_bar_label (EvolutionShellView *evolution_shell_view,
|
|||||||
shell_view = E_SHELL_VIEW (data);
|
shell_view = E_SHELL_VIEW (data);
|
||||||
priv = shell_view->priv;
|
priv = shell_view->priv;
|
||||||
|
|
||||||
e_shell_folder_title_bar_set_folder_bar_label (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar),
|
e_shell_folder_title_bar_set_folder_bar_label (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar),
|
||||||
text);
|
text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1131,14 +1123,6 @@ updated_folder_cb (EStorageSet *storage_set,
|
|||||||
shell_view = E_SHELL_VIEW (data);
|
shell_view = E_SHELL_VIEW (data);
|
||||||
priv = shell_view->priv;
|
priv = shell_view->priv;
|
||||||
|
|
||||||
#if 0
|
|
||||||
char *uri = g_strconcat (E_SHELL_URI_PREFIX, path, NULL);
|
|
||||||
|
|
||||||
/* Update the shortcut bar */
|
|
||||||
e_shortcuts_update_shortcut_by_uri (e_shell_get_shortcuts (priv->shell), uri);
|
|
||||||
g_free (uri);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
view_path = get_storage_set_path_from_uri (priv->uri);
|
view_path = get_storage_set_path_from_uri (priv->uri);
|
||||||
if (view_path && strcmp (path, view_path) != 0)
|
if (view_path && strcmp (path, view_path) != 0)
|
||||||
return;
|
return;
|
||||||
@ -1161,14 +1145,21 @@ shell_line_status_changed_cb (EShell *shell,
|
|||||||
update_offline_toggle_status (shell_view);
|
update_offline_toggle_status (shell_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
delete_event_cb (GtkWidget *widget,
|
||||||
|
GdkEventAny *ev,
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
EShellView *
|
EShellView *
|
||||||
e_shell_view_construct (EShellView *shell_view,
|
e_shell_view_construct (EShellView *shell_view,
|
||||||
EShell *shell)
|
EShell *shell)
|
||||||
{
|
{
|
||||||
EShellViewPrivate *priv;
|
EShellViewPrivate *priv;
|
||||||
EShellView *view;
|
EShellView *view;
|
||||||
GtkObject *window;
|
|
||||||
|
|
||||||
g_return_val_if_fail (shell != NULL, NULL);
|
g_return_val_if_fail (shell != NULL, NULL);
|
||||||
g_return_val_if_fail (shell_view != NULL, NULL);
|
g_return_val_if_fail (shell_view != NULL, NULL);
|
||||||
@ -1184,19 +1175,18 @@ e_shell_view_construct (EShellView *shell_view,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
window = GTK_OBJECT (view);
|
gtk_signal_connect (GTK_OBJECT (view), "delete_event",
|
||||||
|
GTK_SIGNAL_FUNC (delete_event_cb), NULL);
|
||||||
gtk_signal_connect (window, "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL);
|
|
||||||
|
|
||||||
priv->shell = shell;
|
priv->shell = shell;
|
||||||
|
|
||||||
gtk_signal_connect_while_alive (GTK_OBJECT (e_shell_get_storage_set (priv->shell)), "updated_folder",
|
gtk_signal_connect_while_alive (GTK_OBJECT (e_shell_get_storage_set (priv->shell)),
|
||||||
updated_folder_cb, shell_view, GTK_OBJECT (shell_view));
|
"updated_folder", updated_folder_cb, shell_view,
|
||||||
|
GTK_OBJECT (shell_view));
|
||||||
|
|
||||||
priv->ui_container = bonobo_ui_container_new ();
|
priv->ui_container = bonobo_ui_container_new ();
|
||||||
bonobo_ui_container_set_win (priv->ui_container, BONOBO_WINDOW (shell_view));
|
bonobo_ui_container_set_win (priv->ui_container, BONOBO_WINDOW (shell_view));
|
||||||
gtk_signal_connect (GTK_OBJECT (priv->ui_container),
|
gtk_signal_connect (GTK_OBJECT (priv->ui_container), "system_exception",
|
||||||
"system_exception", GTK_SIGNAL_FUNC (unmerge_on_error), NULL);
|
GTK_SIGNAL_FUNC (unmerge_on_error), NULL);
|
||||||
|
|
||||||
priv->ui_component = bonobo_ui_component_new ("evolution");
|
priv->ui_component = bonobo_ui_component_new ("evolution");
|
||||||
bonobo_ui_component_set_container (priv->ui_component,
|
bonobo_ui_component_set_container (priv->ui_component,
|
||||||
@ -1346,11 +1336,11 @@ update_folder_title_bar (EShellView *shell_view,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (folder_icon)
|
if (folder_icon)
|
||||||
e_shell_folder_title_bar_set_icon (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar), folder_icon);
|
e_shell_folder_title_bar_set_icon (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar), folder_icon);
|
||||||
if (folder_name) {
|
if (folder_name) {
|
||||||
gchar * utf;
|
gchar * utf;
|
||||||
utf = e_utf8_to_gtk_string (GTK_WIDGET (priv->view_title_bar), folder_name);
|
utf = e_utf8_to_gtk_string (GTK_WIDGET (priv->folder_title_bar), folder_name);
|
||||||
e_shell_folder_title_bar_set_title (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar), utf);
|
e_shell_folder_title_bar_set_title (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar), utf);
|
||||||
g_free (utf);
|
g_free (utf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1689,7 +1679,6 @@ get_control_for_uri (EShellView *shell_view,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* FIXME: This code needs to be made more robust. */
|
/* FIXME: This code needs to be made more robust. */
|
||||||
|
|
||||||
slash = strchr (path + 1, G_DIR_SEPARATOR);
|
slash = strchr (path + 1, G_DIR_SEPARATOR);
|
||||||
if (slash == NULL || slash[1] == '\0')
|
if (slash == NULL || slash[1] == '\0')
|
||||||
folder_type = get_type_for_storage (shell_view, path + 1, &physical_uri);
|
folder_type = get_type_for_storage (shell_view, path + 1, &physical_uri);
|
||||||
@ -1984,7 +1973,7 @@ e_shell_view_set_folder_bar_mode (EShellView *shell_view,
|
|||||||
e_title_bar_set_button_mode (E_TITLE_BAR (priv->storage_set_title_bar),
|
e_title_bar_set_button_mode (E_TITLE_BAR (priv->storage_set_title_bar),
|
||||||
E_TITLE_BAR_BUTTON_MODE_CLOSE);
|
E_TITLE_BAR_BUTTON_MODE_CLOSE);
|
||||||
|
|
||||||
e_shell_folder_title_bar_set_clickable (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar),
|
e_shell_folder_title_bar_set_clickable (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar),
|
||||||
FALSE);
|
FALSE);
|
||||||
} else {
|
} else {
|
||||||
if (GTK_WIDGET_VISIBLE (priv->storage_set_view_box)) {
|
if (GTK_WIDGET_VISIBLE (priv->storage_set_view_box)) {
|
||||||
@ -1997,7 +1986,7 @@ e_shell_view_set_folder_bar_mode (EShellView *shell_view,
|
|||||||
e_title_bar_set_button_mode (E_TITLE_BAR (priv->storage_set_title_bar),
|
e_title_bar_set_button_mode (E_TITLE_BAR (priv->storage_set_title_bar),
|
||||||
E_TITLE_BAR_BUTTON_MODE_PIN);
|
E_TITLE_BAR_BUTTON_MODE_PIN);
|
||||||
|
|
||||||
e_shell_folder_title_bar_set_clickable (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar),
|
e_shell_folder_title_bar_set_clickable (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar),
|
||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,12 +356,12 @@ impl_Shell_selectUserFolder (PortableServer_Servant servant,
|
|||||||
gtk_widget_show (folder_selection_dialog);
|
gtk_widget_show (folder_selection_dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GNOME_Evolution_LocalStorage
|
static GNOME_Evolution_Storage
|
||||||
impl_Shell_getLocalStorage (PortableServer_Servant servant,
|
impl_Shell_getLocalStorage (PortableServer_Servant servant,
|
||||||
CORBA_Environment *ev)
|
CORBA_Environment *ev)
|
||||||
{
|
{
|
||||||
BonoboObject *bonobo_object;
|
BonoboObject *bonobo_object;
|
||||||
GNOME_Evolution_LocalStorage local_storage_interface;
|
GNOME_Evolution_Storage local_storage_interface;
|
||||||
EShell *shell;
|
EShell *shell;
|
||||||
EShellPrivate *priv;
|
EShellPrivate *priv;
|
||||||
|
|
||||||
@ -509,6 +509,9 @@ setup_components (EShell *shell,
|
|||||||
if (ev._major != CORBA_NO_EXCEPTION)
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
g_error ("Eeek! Cannot perform OAF query for Evolution components.");
|
g_error ("Eeek! Cannot perform OAF query for Evolution components.");
|
||||||
|
|
||||||
|
if (info_list->_length == 0)
|
||||||
|
g_warning ("No Evolution components installed.");
|
||||||
|
|
||||||
for (i = 0; i < info_list->_length; i++) {
|
for (i = 0; i < info_list->_length; i++) {
|
||||||
const OAF_ServerInfo *info;
|
const OAF_ServerInfo *info;
|
||||||
GdkPixbuf *icon_pixbuf;
|
GdkPixbuf *icon_pixbuf;
|
||||||
@ -548,9 +551,6 @@ setup_components (EShell *shell,
|
|||||||
gtk_main_iteration ();
|
gtk_main_iteration ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info_list->_length == 0)
|
|
||||||
g_warning ("No Evolution components installed.");
|
|
||||||
|
|
||||||
CORBA_free (info_list);
|
CORBA_free (info_list);
|
||||||
|
|
||||||
CORBA_exception_free (&ev);
|
CORBA_exception_free (&ev);
|
||||||
@ -589,13 +589,13 @@ set_owner_on_components (EShell *shell)
|
|||||||
/* EShellView destruction callback. */
|
/* EShellView destruction callback. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
view_deleted_cb (GtkObject *object,
|
view_delete_event_cb (GtkWidget *widget,
|
||||||
GdkEvent *ev,
|
GdkEventAny *ev,
|
||||||
gpointer data)
|
void *data)
|
||||||
{
|
{
|
||||||
EShell *shell;
|
EShell *shell;
|
||||||
|
|
||||||
g_assert (E_IS_SHELL_VIEW (object));
|
g_assert (E_IS_SHELL_VIEW (widget));
|
||||||
|
|
||||||
shell = E_SHELL (data);
|
shell = E_SHELL (data);
|
||||||
e_shell_save_settings (shell);
|
e_shell_save_settings (shell);
|
||||||
@ -606,21 +606,21 @@ view_deleted_cb (GtkObject *object,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
view_destroy_cb (GtkObject *object,
|
view_destroy_cb (GtkObject *object,
|
||||||
gpointer data)
|
void *data)
|
||||||
{
|
{
|
||||||
EShell *shell;
|
EShell *shell;
|
||||||
int nviews;
|
int num_views;
|
||||||
|
|
||||||
g_assert (E_IS_SHELL_VIEW (object));
|
g_assert (E_IS_SHELL_VIEW (object));
|
||||||
|
|
||||||
shell = E_SHELL (data);
|
shell = E_SHELL (data);
|
||||||
|
|
||||||
nviews = g_list_length (shell->priv->views);
|
num_views = g_list_length (shell->priv->views);
|
||||||
|
|
||||||
/* If this is our last view, save settings now because in the
|
/* If this is our last view, save settings now because in the
|
||||||
callback for no_views_left shell->priv->views will be NULL
|
callback for no_views_left shell->priv->views will be NULL
|
||||||
and settings won't be saved because of that */
|
and settings won't be saved because of that */
|
||||||
if (nviews - 1 == 0)
|
if (num_views - 1 == 0)
|
||||||
e_shell_save_settings (shell);
|
e_shell_save_settings (shell);
|
||||||
|
|
||||||
shell->priv->views = g_list_remove (shell->priv->views, object);
|
shell->priv->views = g_list_remove (shell->priv->views, object);
|
||||||
@ -676,11 +676,11 @@ destroy (GtkObject *object)
|
|||||||
|
|
||||||
view = E_SHELL_VIEW (p->data);
|
view = E_SHELL_VIEW (p->data);
|
||||||
|
|
||||||
gtk_signal_disconnect_by_func (
|
|
||||||
GTK_OBJECT (view),
|
|
||||||
GTK_SIGNAL_FUNC (view_destroy_cb), shell);
|
|
||||||
gtk_signal_disconnect_by_func (GTK_OBJECT (view),
|
gtk_signal_disconnect_by_func (GTK_OBJECT (view),
|
||||||
GTK_SIGNAL_FUNC (view_deleted_cb),
|
GTK_SIGNAL_FUNC (view_delete_event_cb),
|
||||||
|
shell);
|
||||||
|
gtk_signal_disconnect_by_func (GTK_OBJECT (view),
|
||||||
|
GTK_SIGNAL_FUNC (view_destroy_cb),
|
||||||
shell);
|
shell);
|
||||||
|
|
||||||
gtk_object_destroy (GTK_OBJECT (view));
|
gtk_object_destroy (GTK_OBJECT (view));
|
||||||
@ -800,7 +800,6 @@ e_shell_construct (EShell *shell,
|
|||||||
CORBA_Object corba_object;
|
CORBA_Object corba_object;
|
||||||
CORBA_Environment ev;
|
CORBA_Environment ev;
|
||||||
gchar *shortcut_path;
|
gchar *shortcut_path;
|
||||||
|
|
||||||
g_return_val_if_fail (shell != NULL, E_SHELL_CONSTRUCT_RESULT_INVALIDARG);
|
g_return_val_if_fail (shell != NULL, E_SHELL_CONSTRUCT_RESULT_INVALIDARG);
|
||||||
g_return_val_if_fail (E_IS_SHELL (shell), E_SHELL_CONSTRUCT_RESULT_INVALIDARG);
|
g_return_val_if_fail (E_IS_SHELL (shell), E_SHELL_CONSTRUCT_RESULT_INVALIDARG);
|
||||||
g_return_val_if_fail (local_directory != NULL, E_SHELL_CONSTRUCT_RESULT_INVALIDARG);
|
g_return_val_if_fail (local_directory != NULL, E_SHELL_CONSTRUCT_RESULT_INVALIDARG);
|
||||||
@ -966,13 +965,16 @@ e_shell_create_view (EShell *shell,
|
|||||||
view = e_shell_view_new (shell);
|
view = e_shell_view_new (shell);
|
||||||
|
|
||||||
gtk_widget_show (GTK_WIDGET (view));
|
gtk_widget_show (GTK_WIDGET (view));
|
||||||
gtk_signal_connect (GTK_OBJECT (view), "delete-event",
|
gtk_signal_connect (GTK_OBJECT (view), "delete_event",
|
||||||
GTK_SIGNAL_FUNC (view_deleted_cb), shell);
|
GTK_SIGNAL_FUNC (view_delete_event_cb), shell);
|
||||||
gtk_signal_connect (GTK_OBJECT (view), "destroy",
|
gtk_signal_connect (GTK_OBJECT (view), "destroy",
|
||||||
GTK_SIGNAL_FUNC (view_destroy_cb), shell);
|
GTK_SIGNAL_FUNC (view_destroy_cb), shell);
|
||||||
|
|
||||||
if (uri != NULL)
|
if (uri != NULL)
|
||||||
if (!e_shell_view_display_uri (E_SHELL_VIEW (view), uri))
|
if (!e_shell_view_display_uri (E_SHELL_VIEW (view), uri))
|
||||||
|
/* FIXME: Consider popping a dialog box up
|
||||||
|
about how the provided URI does not
|
||||||
|
exist/could not be displayed */
|
||||||
e_shell_view_display_uri (E_SHELL_VIEW (view), DEFAULT_URI);
|
e_shell_view_display_uri (E_SHELL_VIEW (view), DEFAULT_URI);
|
||||||
|
|
||||||
shell->priv->views = g_list_prepend (shell->priv->views, view);
|
shell->priv->views = g_list_prepend (shell->priv->views, view);
|
||||||
|
@ -47,6 +47,15 @@ struct _EShortcutsViewModelPrivate {
|
|||||||
|
|
||||||
/* View initialization. */
|
/* View initialization. */
|
||||||
|
|
||||||
|
static char *
|
||||||
|
get_name_with_unread (const EShortcutItem *item)
|
||||||
|
{
|
||||||
|
if (item->unread_count > 0)
|
||||||
|
return g_strdup_printf ("%s (%d)", item->name, item->unread_count);
|
||||||
|
else
|
||||||
|
return g_strdup (item->name);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
load_group_into_model (EShortcutsViewModel *shortcuts_view_model,
|
load_group_into_model (EShortcutsViewModel *shortcuts_view_model,
|
||||||
int group_num)
|
int group_num)
|
||||||
@ -67,9 +76,12 @@ load_group_into_model (EShortcutsViewModel *shortcuts_view_model,
|
|||||||
|
|
||||||
for (p = shortcut_list; p != NULL; p = p->next) {
|
for (p = shortcut_list; p != NULL; p = p->next) {
|
||||||
const EShortcutItem *item;
|
const EShortcutItem *item;
|
||||||
|
char *name_with_unread;
|
||||||
|
|
||||||
item = (const EShortcutItem *) p->data;
|
item = (const EShortcutItem *) p->data;
|
||||||
e_shortcut_model_add_item (E_SHORTCUT_MODEL (shortcuts_view_model), group_num, -1, item->uri, item->name);
|
name_with_unread = get_name_with_unread (item);
|
||||||
|
e_shortcut_model_add_item (E_SHORTCUT_MODEL (shortcuts_view_model), group_num, -1, item->uri, name_with_unread);
|
||||||
|
g_free (name_with_unread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,6 +165,7 @@ shortcuts_new_shortcut_cb (EShortcuts *shortcuts,
|
|||||||
EShortcutsViewModel *shortcuts_view_model;
|
EShortcutsViewModel *shortcuts_view_model;
|
||||||
EShortcutsViewModelPrivate *priv;
|
EShortcutsViewModelPrivate *priv;
|
||||||
const EShortcutItem *shortcut_item;
|
const EShortcutItem *shortcut_item;
|
||||||
|
char *name_with_unread;
|
||||||
|
|
||||||
shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
|
shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
|
||||||
priv = shortcuts_view_model->priv;
|
priv = shortcuts_view_model->priv;
|
||||||
@ -160,10 +173,12 @@ shortcuts_new_shortcut_cb (EShortcuts *shortcuts,
|
|||||||
shortcut_item = e_shortcuts_get_shortcut (priv->shortcuts, group_num, item_num);
|
shortcut_item = e_shortcuts_get_shortcut (priv->shortcuts, group_num, item_num);
|
||||||
g_assert (shortcut_item != NULL);
|
g_assert (shortcut_item != NULL);
|
||||||
|
|
||||||
|
name_with_unread = get_name_with_unread (shortcut_item);
|
||||||
e_shortcut_model_add_item (E_SHORTCUT_MODEL (shortcuts_view_model),
|
e_shortcut_model_add_item (E_SHORTCUT_MODEL (shortcuts_view_model),
|
||||||
group_num, item_num,
|
group_num, item_num,
|
||||||
shortcut_item->uri,
|
shortcut_item->uri,
|
||||||
shortcut_item->name);
|
name_with_unread);
|
||||||
|
g_free (name_with_unread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -187,6 +202,7 @@ shortcuts_update_shortcut_cb (EShortcuts *shortcuts,
|
|||||||
EShortcutsViewModel *shortcuts_view_model;
|
EShortcutsViewModel *shortcuts_view_model;
|
||||||
EShortcutsViewModelPrivate *priv;
|
EShortcutsViewModelPrivate *priv;
|
||||||
const EShortcutItem *shortcut_item;
|
const EShortcutItem *shortcut_item;
|
||||||
|
char *name_with_unread;
|
||||||
|
|
||||||
shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
|
shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
|
||||||
priv = shortcuts_view_model->priv;
|
priv = shortcuts_view_model->priv;
|
||||||
@ -194,10 +210,12 @@ shortcuts_update_shortcut_cb (EShortcuts *shortcuts,
|
|||||||
shortcut_item = e_shortcuts_get_shortcut (priv->shortcuts, group_num, item_num);
|
shortcut_item = e_shortcuts_get_shortcut (priv->shortcuts, group_num, item_num);
|
||||||
g_assert (shortcut_item != NULL);
|
g_assert (shortcut_item != NULL);
|
||||||
|
|
||||||
|
name_with_unread = get_name_with_unread (shortcut_item);
|
||||||
e_shortcut_model_update_item (E_SHORTCUT_MODEL (shortcuts_view_model),
|
e_shortcut_model_update_item (E_SHORTCUT_MODEL (shortcuts_view_model),
|
||||||
group_num, item_num,
|
group_num, item_num,
|
||||||
shortcut_item->uri,
|
shortcut_item->uri,
|
||||||
shortcut_item->name);
|
name_with_unread);
|
||||||
|
g_free (name_with_unread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,7 +103,6 @@ icon_callback (EShortcutBar *shortcut_bar,
|
|||||||
|
|
||||||
storage_set = e_shortcuts_get_storage_set (shortcuts);
|
storage_set = e_shortcuts_get_storage_set (shortcuts);
|
||||||
folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
|
folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
|
||||||
|
|
||||||
folder = e_storage_set_get_folder (storage_set,
|
folder = e_storage_set_get_folder (storage_set,
|
||||||
get_storage_set_path_from_uri (uri));
|
get_storage_set_path_from_uri (uri));
|
||||||
|
|
||||||
@ -461,8 +460,9 @@ rename_shortcut_cb (GtkWidget *widget,
|
|||||||
if (new_name == NULL)
|
if (new_name == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
e_shortcuts_update_shortcut (shortcuts, menu_data->group_num, menu_data->item_num,
|
e_shortcuts_update_shortcut (shortcuts, menu_data->group_num, menu_data->item_num,
|
||||||
shortcut_item->uri, new_name, shortcut_item->type);
|
shortcut_item->uri, new_name, shortcut_item->unread_count, shortcut_item->type);
|
||||||
g_free (new_name);
|
g_free (new_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,6 +560,24 @@ item_selected (EShortcutBar *shortcut_bar,
|
|||||||
shortcuts, shortcut_item->uri, FALSE);
|
shortcuts, shortcut_item->uri, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static EFolder *
|
||||||
|
get_efolder_from_shortcut (EShortcuts *shortcuts,
|
||||||
|
char *item_url)
|
||||||
|
{
|
||||||
|
EFolderTypeRegistry *folder_type_registry;
|
||||||
|
EStorageSet *storage_set;
|
||||||
|
EFolder *folder;
|
||||||
|
char *path;
|
||||||
|
|
||||||
|
path = strchr (item_url, G_DIR_SEPARATOR);
|
||||||
|
storage_set = e_shortcuts_get_storage_set (shortcuts);
|
||||||
|
folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
|
||||||
|
|
||||||
|
folder = e_storage_set_get_folder (storage_set, path);
|
||||||
|
|
||||||
|
return folder;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
impl_shortcut_dropped (EShortcutBar *shortcut_bar,
|
impl_shortcut_dropped (EShortcutBar *shortcut_bar,
|
||||||
int group_num,
|
int group_num,
|
||||||
@ -569,11 +587,35 @@ impl_shortcut_dropped (EShortcutBar *shortcut_bar,
|
|||||||
{
|
{
|
||||||
EShortcutsView *shortcuts_view;
|
EShortcutsView *shortcuts_view;
|
||||||
EShortcutsViewPrivate *priv;
|
EShortcutsViewPrivate *priv;
|
||||||
|
EFolder *folder;
|
||||||
|
int unread_count;
|
||||||
|
const char *type;
|
||||||
|
char *tmp;
|
||||||
|
char *tp;
|
||||||
|
char *name_without_unread;
|
||||||
|
|
||||||
shortcuts_view = E_SHORTCUTS_VIEW (shortcut_bar);
|
shortcuts_view = E_SHORTCUTS_VIEW (shortcut_bar);
|
||||||
priv = shortcuts_view->priv;
|
priv = shortcuts_view->priv;
|
||||||
|
|
||||||
e_shortcuts_add_shortcut (priv->shortcuts, group_num, position, item_url, NULL, NULL);
|
folder = get_efolder_from_shortcut (priv->shortcuts, item_url);
|
||||||
|
|
||||||
|
unread_count = e_folder_get_unread_count (folder);
|
||||||
|
type = e_folder_get_type_string (folder);
|
||||||
|
|
||||||
|
/* Looks funny, but keeps it from adding the unread count
|
||||||
|
repeatedly when dragging folders around */
|
||||||
|
tmp = g_strdup_printf (" (%d)", unread_count);
|
||||||
|
if ((tp = strstr (item_name, tmp)) != NULL)
|
||||||
|
name_without_unread = g_strndup (item_name, strlen (item_name) - strlen (tp));
|
||||||
|
else
|
||||||
|
name_without_unread = g_strdup (item_name);
|
||||||
|
|
||||||
|
e_shortcuts_add_shortcut (priv->shortcuts,
|
||||||
|
group_num, position,
|
||||||
|
item_url, name_without_unread, unread_count, type);
|
||||||
|
|
||||||
|
g_free (tmp);
|
||||||
|
g_free (name_without_unread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -126,6 +126,7 @@ static void make_dirty (EShortcuts *shortcuts);
|
|||||||
static EShortcutItem *
|
static EShortcutItem *
|
||||||
shortcut_item_new (const char *uri,
|
shortcut_item_new (const char *uri,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
int unread_count,
|
||||||
const char *type)
|
const char *type)
|
||||||
{
|
{
|
||||||
EShortcutItem *new;
|
EShortcutItem *new;
|
||||||
@ -137,6 +138,7 @@ shortcut_item_new (const char *uri,
|
|||||||
new->uri = g_strdup (uri);
|
new->uri = g_strdup (uri);
|
||||||
new->name = g_strdup (name);
|
new->name = g_strdup (name);
|
||||||
new->type = g_strdup (type);
|
new->type = g_strdup (type);
|
||||||
|
new->unread_count = unread_count;
|
||||||
|
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
@ -145,6 +147,7 @@ static gboolean
|
|||||||
shortcut_item_update (EShortcutItem *shortcut_item,
|
shortcut_item_update (EShortcutItem *shortcut_item,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
int unread_count,
|
||||||
const char *type)
|
const char *type)
|
||||||
{
|
{
|
||||||
gboolean changed = FALSE;
|
gboolean changed = FALSE;
|
||||||
@ -166,6 +169,11 @@ shortcut_item_update (EShortcutItem *shortcut_item,
|
|||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shortcut_item->unread_count != unread_count) {
|
||||||
|
shortcut_item->unread_count = unread_count;
|
||||||
|
changed = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (shortcut_item->type == NULL || type == NULL ||
|
if (shortcut_item->type == NULL || type == NULL ||
|
||||||
strcmp (shortcut_item->type, type) != 0) {
|
strcmp (shortcut_item->type, type) != 0) {
|
||||||
g_free (shortcut_item->type);
|
g_free (shortcut_item->type);
|
||||||
@ -222,12 +230,24 @@ update_shortcut_and_emit_signal (EShortcuts *shortcuts,
|
|||||||
int num,
|
int num,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
int unread_count,
|
||||||
const char *type)
|
const char *type)
|
||||||
{
|
{
|
||||||
if (shortcut_item_update (shortcut_item, uri, name, type)) {
|
/* Only thing that changed was the unread count */
|
||||||
|
if (shortcut_item->unread_count != unread_count
|
||||||
|
&& !shortcut_item_update (shortcut_item, uri, name, unread_count, type)) {
|
||||||
|
gtk_signal_emit (GTK_OBJECT (shortcuts), signals[UPDATE_SHORTCUT], group_num, num);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Unread count is the same, but other stuff changed */
|
||||||
|
else if (shortcut_item_update (shortcut_item, uri, name, unread_count, type)) {
|
||||||
gtk_signal_emit (GTK_OBJECT (shortcuts), signals[UPDATE_SHORTCUT], group_num, num);
|
gtk_signal_emit (GTK_OBJECT (shortcuts), signals[UPDATE_SHORTCUT], group_num, num);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else
|
}
|
||||||
|
|
||||||
|
/* Nothing at all changed, return false only */
|
||||||
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +331,7 @@ load_shortcuts (EShortcuts *shortcuts,
|
|||||||
name = xmlGetProp (q, "name");
|
name = xmlGetProp (q, "name");
|
||||||
type = xmlGetProp (q, "type");
|
type = xmlGetProp (q, "type");
|
||||||
|
|
||||||
shortcut_item = shortcut_item_new (uri, name, type);
|
shortcut_item = shortcut_item_new (uri, name, 0, type);
|
||||||
|
|
||||||
shortcut_group->shortcuts = g_slist_prepend (shortcut_group->shortcuts,
|
shortcut_group->shortcuts = g_slist_prepend (shortcut_group->shortcuts,
|
||||||
shortcut_item);
|
shortcut_item);
|
||||||
@ -376,8 +396,10 @@ save_shortcuts (EShortcuts *shortcuts,
|
|||||||
|
|
||||||
if (shortcut->name != NULL)
|
if (shortcut->name != NULL)
|
||||||
xmlSetProp (shortcut_node, (xmlChar *) "name", shortcut->name);
|
xmlSetProp (shortcut_node, (xmlChar *) "name", shortcut->name);
|
||||||
|
|
||||||
if (shortcut->type != NULL)
|
if (shortcut->type != NULL)
|
||||||
xmlSetProp (shortcut_node, (xmlChar *) "type", shortcut->type);
|
xmlSetProp (shortcut_node, (xmlChar *) "type", shortcut->type);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,16 +488,18 @@ update_shortcuts_by_path (EShortcuts *shortcuts,
|
|||||||
|
|
||||||
shortcut_item = (EShortcutItem *) q->data;
|
shortcut_item = (EShortcutItem *) q->data;
|
||||||
|
|
||||||
if (strcmp (shortcut_item->uri, evolution_uri) == 0)
|
if (strcmp (shortcut_item->uri, evolution_uri) == 0) {
|
||||||
changed = update_shortcut_and_emit_signal (shortcuts,
|
changed = update_shortcut_and_emit_signal (shortcuts,
|
||||||
shortcut_item,
|
shortcut_item,
|
||||||
group_num,
|
group_num,
|
||||||
num,
|
num,
|
||||||
evolution_uri,
|
evolution_uri,
|
||||||
shortcut_item->name,
|
shortcut_item->name,
|
||||||
|
e_folder_get_unread_count (folder),
|
||||||
e_folder_get_type_string (folder));
|
e_folder_get_type_string (folder));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_free (evolution_uri);
|
g_free (evolution_uri);
|
||||||
|
|
||||||
@ -923,6 +947,7 @@ e_shortcuts_add_shortcut (EShortcuts *shortcuts,
|
|||||||
int num,
|
int num,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
int unread_count,
|
||||||
const char *type)
|
const char *type)
|
||||||
{
|
{
|
||||||
EShortcutsPrivate *priv;
|
EShortcutsPrivate *priv;
|
||||||
@ -943,7 +968,7 @@ e_shortcuts_add_shortcut (EShortcuts *shortcuts,
|
|||||||
if (num == -1)
|
if (num == -1)
|
||||||
num = g_slist_length (group->shortcuts);
|
num = g_slist_length (group->shortcuts);
|
||||||
|
|
||||||
item = shortcut_item_new (uri, name, type);
|
item = shortcut_item_new (uri, name, unread_count, type);
|
||||||
|
|
||||||
group->shortcuts = g_slist_insert (group->shortcuts, item, num);
|
group->shortcuts = g_slist_insert (group->shortcuts, item, num);
|
||||||
|
|
||||||
@ -958,6 +983,7 @@ e_shortcuts_update_shortcut (EShortcuts *shortcuts,
|
|||||||
int num,
|
int num,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
int unread_count,
|
||||||
const char *type)
|
const char *type)
|
||||||
{
|
{
|
||||||
EShortcutItem *shortcut_item;
|
EShortcutItem *shortcut_item;
|
||||||
@ -967,7 +993,7 @@ e_shortcuts_update_shortcut (EShortcuts *shortcuts,
|
|||||||
|
|
||||||
shortcut_item = get_item (shortcuts, group_num, num);
|
shortcut_item = get_item (shortcuts, group_num, num);
|
||||||
|
|
||||||
update_shortcut_and_emit_signal (shortcuts, shortcut_item, group_num, num, uri, name, type);
|
update_shortcut_and_emit_signal (shortcuts, shortcut_item, group_num, num, uri, name, unread_count, type);
|
||||||
|
|
||||||
make_dirty (shortcuts);
|
make_dirty (shortcuts);
|
||||||
}
|
}
|
||||||
@ -981,10 +1007,12 @@ e_shortcuts_add_default_group (EShortcuts *shortcuts)
|
|||||||
|
|
||||||
e_shortcuts_add_group (shortcuts, -1, _("Shortcuts"));
|
e_shortcuts_add_group (shortcuts, -1, _("Shortcuts"));
|
||||||
|
|
||||||
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Inbox", _("Inbox"), "mail");
|
/* FIXME: Inbox shortcut should point to something else for
|
||||||
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Calendar", _("Calendar"), "calendar");
|
people who won't care about using /Local Folders/Inbox */
|
||||||
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Tasks", _("Tasks"), "tasks");
|
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Inbox", _("Inbox"), 0, "mail");
|
||||||
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Contacts", _("Contacts"), "contacts");
|
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Calendar", _("Calendar"), 0, "calendar");
|
||||||
|
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Tasks", _("Tasks"), 0, "tasks");
|
||||||
|
e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Contacts", _("Contacts"), 0, "contacts");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -49,6 +49,7 @@ struct _EShortcutItem {
|
|||||||
char *uri;
|
char *uri;
|
||||||
char *name;
|
char *name;
|
||||||
char *type;
|
char *type;
|
||||||
|
int unread_count;
|
||||||
};
|
};
|
||||||
typedef struct _EShortcutItem EShortcutItem;
|
typedef struct _EShortcutItem EShortcutItem;
|
||||||
|
|
||||||
@ -112,12 +113,14 @@ void e_shortcuts_add_shortcut (EShortcuts *shortcuts,
|
|||||||
int num,
|
int num,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
int unread_count,
|
||||||
const char *type);
|
const char *type);
|
||||||
void e_shortcuts_update_shortcut (EShortcuts *shortcuts,
|
void e_shortcuts_update_shortcut (EShortcuts *shortcuts,
|
||||||
int group_num,
|
int group_num,
|
||||||
int num,
|
int num,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
int unread_count,
|
||||||
const char *type);
|
const char *type);
|
||||||
|
|
||||||
void e_shortcuts_remove_group (EShortcuts *shortcuts,
|
void e_shortcuts_remove_group (EShortcuts *shortcuts,
|
||||||
|
@ -416,7 +416,7 @@ e_splash_set_icon_highlight (ESplash *splash,
|
|||||||
|
|
||||||
priv = splash->priv;
|
priv = splash->priv;
|
||||||
|
|
||||||
icon = (Icon *) g_list_nth (priv->icons, num)->data;
|
icon = (Icon *) g_list_nth_data (priv->icons, num);
|
||||||
|
|
||||||
gtk_object_set (GTK_OBJECT (icon->canvas_item),
|
gtk_object_set (GTK_OBJECT (icon->canvas_item),
|
||||||
"pixbuf", highlight ? icon->light_pixbuf : icon->dark_pixbuf,
|
"pixbuf", highlight ? icon->light_pixbuf : icon->dark_pixbuf,
|
||||||
|
@ -1423,6 +1423,21 @@ etree_get_node_by_id (ETreeModel *etm, gchar *save_id, void *model_data)
|
|||||||
return g_hash_table_lookup (storage_set_view->priv->path_to_etree_node, save_id);
|
return g_hash_table_lookup (storage_set_view->priv->path_to_etree_node, save_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GHashTable *folders_with_unread = NULL;
|
||||||
|
|
||||||
|
static void
|
||||||
|
update_folder_with_unread_hash (char *folder_name, int unread_count)
|
||||||
|
{
|
||||||
|
if (!folders_with_unread)
|
||||||
|
folders_with_unread = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
|
|
||||||
|
g_hash_table_insert (folders_with_unread,
|
||||||
|
g_strdup (folder_name),
|
||||||
|
g_strdup_printf ("%s (%d)",
|
||||||
|
folder_name,
|
||||||
|
unread_count));
|
||||||
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
etree_value_at (ETreeModel *etree, ETreePath tree_path, int col, void *model_data)
|
etree_value_at (ETreeModel *etree, ETreePath tree_path, int col, void *model_data)
|
||||||
{
|
{
|
||||||
@ -1439,8 +1454,18 @@ etree_value_at (ETreeModel *etree, ETreePath tree_path, int col, void *model_dat
|
|||||||
|
|
||||||
folder = e_storage_set_get_folder (storage_set, path);
|
folder = e_storage_set_get_folder (storage_set, path);
|
||||||
if (folder != NULL) {
|
if (folder != NULL) {
|
||||||
|
char *folder_name = e_folder_get_name (folder);
|
||||||
|
int unread_count = e_folder_get_unread_count (folder);
|
||||||
|
|
||||||
|
update_folder_with_unread_hash (folder_name, unread_count);
|
||||||
|
|
||||||
if (col == 0)
|
if (col == 0)
|
||||||
return (void *) e_folder_get_name (folder);
|
if (unread_count > 0)
|
||||||
|
return (void *) g_hash_table_lookup (folders_with_unread,
|
||||||
|
folder_name);
|
||||||
|
else
|
||||||
|
return (void *) folder_name;
|
||||||
|
|
||||||
else
|
else
|
||||||
return (void *) e_folder_get_highlighted (folder);
|
return (void *) e_folder_get_highlighted (folder);
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,8 @@ struct _EStorageSetViewClass {
|
|||||||
|
|
||||||
|
|
||||||
GtkType e_storage_set_view_get_type (void);
|
GtkType e_storage_set_view_get_type (void);
|
||||||
|
GtkWidget *e_storage_set_view_new_partial_view (EStorageSet *storage_set,
|
||||||
|
GList *visible_types);
|
||||||
GtkWidget *e_storage_set_view_new (EStorageSet *storage_set,
|
GtkWidget *e_storage_set_view_new (EStorageSet *storage_set,
|
||||||
BonoboUIContainer *container);
|
BonoboUIContainer *container);
|
||||||
void e_storage_set_view_construct (EStorageSetView *storage_set_view,
|
void e_storage_set_view_construct (EStorageSetView *storage_set_view,
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
* Author: Ettore Perazzoli
|
* Author: Ettore Perazzoli
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* FIXME: The EFolderTree is kept both in the EStorage and the
|
||||||
|
* EvolutionStorage. Bad design.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,220 +0,0 @@
|
|||||||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
||||||
/* evolution-local-storage.c
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000 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 <glib.h>
|
|
||||||
#include <gtk/gtksignal.h>
|
|
||||||
#include <libgnome/gnome-defs.h>
|
|
||||||
#include <libgnome/gnome-util.h>
|
|
||||||
|
|
||||||
#include <gal/util/e-util.h>
|
|
||||||
|
|
||||||
#include "evolution-local-storage.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define PARENT_TYPE evolution_storage_get_type ()
|
|
||||||
static EvolutionStorageClass *parent_class = NULL;
|
|
||||||
|
|
||||||
struct _EvolutionLocalStoragePrivate {
|
|
||||||
int dummy;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
|
||||||
UPDATE_FOLDER,
|
|
||||||
|
|
||||||
LAST_SIGNAL
|
|
||||||
};
|
|
||||||
|
|
||||||
static guint signals[LAST_SIGNAL] = { 0 };
|
|
||||||
|
|
||||||
|
|
||||||
/* CORBA interface implementation. */
|
|
||||||
|
|
||||||
static POA_GNOME_Evolution_LocalStorage__vepv LocalStorage_vepv;
|
|
||||||
|
|
||||||
static void
|
|
||||||
impl_GNOME_Evolution_LocalStorage_updateFolder (PortableServer_Servant servant,
|
|
||||||
const CORBA_char *path,
|
|
||||||
const CORBA_char *display_name,
|
|
||||||
CORBA_boolean highlighted,
|
|
||||||
CORBA_Environment *ev)
|
|
||||||
{
|
|
||||||
BonoboObject *bonobo_object;
|
|
||||||
EvolutionLocalStorage *local_storage;
|
|
||||||
|
|
||||||
bonobo_object = bonobo_object_from_servant (servant);
|
|
||||||
local_storage = EVOLUTION_LOCAL_STORAGE (bonobo_object);
|
|
||||||
|
|
||||||
gtk_signal_emit (GTK_OBJECT (local_storage), signals[UPDATE_FOLDER], path, display_name, highlighted);
|
|
||||||
}
|
|
||||||
|
|
||||||
static POA_GNOME_Evolution_LocalStorage *
|
|
||||||
create_servant (void)
|
|
||||||
{
|
|
||||||
POA_GNOME_Evolution_LocalStorage *servant;
|
|
||||||
CORBA_Environment ev;
|
|
||||||
|
|
||||||
servant = (POA_GNOME_Evolution_LocalStorage *) g_new0 (BonoboObjectServant, 1);
|
|
||||||
servant->vepv = &LocalStorage_vepv;
|
|
||||||
|
|
||||||
CORBA_exception_init (&ev);
|
|
||||||
|
|
||||||
POA_GNOME_Evolution_LocalStorage__init ((PortableServer_Servant) servant, &ev);
|
|
||||||
if (ev._major != CORBA_NO_EXCEPTION) {
|
|
||||||
g_free (servant);
|
|
||||||
CORBA_exception_free (&ev);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CORBA_exception_free (&ev);
|
|
||||||
|
|
||||||
return servant;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* GtkObject methods. */
|
|
||||||
|
|
||||||
static void
|
|
||||||
impl_destroy (GtkObject *object)
|
|
||||||
{
|
|
||||||
EvolutionLocalStorage *local_storage;
|
|
||||||
EvolutionLocalStoragePrivate *priv;
|
|
||||||
|
|
||||||
local_storage = EVOLUTION_LOCAL_STORAGE (object);
|
|
||||||
priv = local_storage->priv;
|
|
||||||
|
|
||||||
g_free (priv);
|
|
||||||
|
|
||||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
corba_class_init (void)
|
|
||||||
{
|
|
||||||
POA_GNOME_Evolution_LocalStorage__vepv *vepv;
|
|
||||||
PortableServer_ServantBase__epv *base_epv;
|
|
||||||
|
|
||||||
base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
|
|
||||||
base_epv->_private = NULL;
|
|
||||||
base_epv->finalize = NULL;
|
|
||||||
base_epv->default_POA = NULL;
|
|
||||||
|
|
||||||
vepv = &LocalStorage_vepv;
|
|
||||||
vepv->_base_epv = base_epv;
|
|
||||||
vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
|
|
||||||
vepv->GNOME_Evolution_Storage_epv = evolution_storage_get_epv ();
|
|
||||||
vepv->GNOME_Evolution_LocalStorage_epv = evolution_local_storage_get_epv ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
class_init (EvolutionLocalStorageClass *klass)
|
|
||||||
{
|
|
||||||
GtkObjectClass *object_class;
|
|
||||||
|
|
||||||
object_class = GTK_OBJECT_CLASS (klass);
|
|
||||||
object_class->destroy = impl_destroy;
|
|
||||||
|
|
||||||
parent_class = gtk_type_class (PARENT_TYPE);
|
|
||||||
|
|
||||||
signals[UPDATE_FOLDER] = gtk_signal_new ("update_folder",
|
|
||||||
GTK_RUN_FIRST,
|
|
||||||
object_class->type,
|
|
||||||
GTK_SIGNAL_OFFSET (EvolutionLocalStorageClass,
|
|
||||||
update_folder),
|
|
||||||
e_marshal_NONE__POINTER_POINTER_INT,
|
|
||||||
GTK_TYPE_NONE, 3,
|
|
||||||
GTK_TYPE_STRING,
|
|
||||||
GTK_TYPE_STRING,
|
|
||||||
GTK_TYPE_BOOL);
|
|
||||||
|
|
||||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
|
||||||
|
|
||||||
corba_class_init ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
init (EvolutionLocalStorage *local_storage)
|
|
||||||
{
|
|
||||||
EvolutionLocalStoragePrivate *priv;
|
|
||||||
|
|
||||||
priv = g_new (EvolutionLocalStoragePrivate, 1);
|
|
||||||
|
|
||||||
local_storage->priv = priv;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
POA_GNOME_Evolution_LocalStorage__epv *
|
|
||||||
evolution_local_storage_get_epv (void)
|
|
||||||
{
|
|
||||||
POA_GNOME_Evolution_LocalStorage__epv *epv;
|
|
||||||
|
|
||||||
epv = g_new0 (POA_GNOME_Evolution_LocalStorage__epv, 1);
|
|
||||||
epv->updateFolder = impl_GNOME_Evolution_LocalStorage_updateFolder;
|
|
||||||
|
|
||||||
return epv;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
evolution_local_storage_construct (EvolutionLocalStorage *local_storage,
|
|
||||||
GNOME_Evolution_LocalStorage corba_object,
|
|
||||||
const char *name)
|
|
||||||
{
|
|
||||||
g_return_if_fail (local_storage != NULL);
|
|
||||||
g_return_if_fail (EVOLUTION_IS_LOCAL_STORAGE (local_storage));
|
|
||||||
g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
|
|
||||||
g_return_if_fail (name != NULL);
|
|
||||||
g_return_if_fail (name[0] != '\0');
|
|
||||||
|
|
||||||
evolution_storage_construct (EVOLUTION_STORAGE (local_storage), corba_object, name, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
EvolutionLocalStorage *
|
|
||||||
evolution_local_storage_new (const char *name)
|
|
||||||
{
|
|
||||||
EvolutionLocalStorage *new;
|
|
||||||
POA_GNOME_Evolution_LocalStorage *servant;
|
|
||||||
GNOME_Evolution_LocalStorage corba_object;
|
|
||||||
|
|
||||||
g_return_val_if_fail (name != NULL, NULL);
|
|
||||||
g_return_val_if_fail (name[0] != '\0', NULL);
|
|
||||||
|
|
||||||
servant = create_servant ();
|
|
||||||
if (servant == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
new = gtk_type_new (evolution_local_storage_get_type ());
|
|
||||||
|
|
||||||
corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new), servant);
|
|
||||||
evolution_local_storage_construct (new, corba_object, name);
|
|
||||||
|
|
||||||
return new;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
E_MAKE_TYPE (evolution_local_storage, "EvolutionLocalStorage", EvolutionLocalStorage,
|
|
||||||
class_init, init, PARENT_TYPE)
|
|
@ -1,75 +0,0 @@
|
|||||||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
||||||
/* evolution-local-storage.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000 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 __EVOLUTION_LOCAL_STORAGE_H__
|
|
||||||
#define __EVOLUTION_LOCAL_STORAGE_H__
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
|
|
||||||
#include "evolution-storage.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#pragma }
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#define EVOLUTION_TYPE_LOCAL_STORAGE (evolution_local_storage_get_type ())
|
|
||||||
#define EVOLUTION_LOCAL_STORAGE(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_LOCAL_STORAGE, EvolutionLocalStorage))
|
|
||||||
#define EVOLUTION_LOCAL_STORAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_LOCAL_STORAGE, EvolutionLocalStorageClass))
|
|
||||||
#define EVOLUTION_IS_LOCAL_STORAGE(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_LOCAL_STORAGE))
|
|
||||||
#define EVOLUTION_IS_LOCAL_STORAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_LOCAL_STORAGE))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _EvolutionLocalStorage EvolutionLocalStorage;
|
|
||||||
typedef struct _EvolutionLocalStoragePrivate EvolutionLocalStoragePrivate;
|
|
||||||
typedef struct _EvolutionLocalStorageClass EvolutionLocalStorageClass;
|
|
||||||
|
|
||||||
struct _EvolutionLocalStorage {
|
|
||||||
EvolutionStorage parent;
|
|
||||||
|
|
||||||
EvolutionLocalStoragePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _EvolutionLocalStorageClass {
|
|
||||||
EvolutionStorageClass parent_class;
|
|
||||||
|
|
||||||
void (* update_folder) (EvolutionLocalStorage *local_storage,
|
|
||||||
const char *path,
|
|
||||||
const char *display_name,
|
|
||||||
gboolean highlighted);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
POA_GNOME_Evolution_LocalStorage__epv *evolution_local_storage_get_epv (void);
|
|
||||||
|
|
||||||
GtkType evolution_local_storage_get_type (void);
|
|
||||||
void evolution_local_storage_construct (EvolutionLocalStorage *local_storage,
|
|
||||||
GNOME_Evolution_LocalStorage corba_object,
|
|
||||||
const char *name);
|
|
||||||
EvolutionLocalStorage *evolution_local_storage_new (const char *name);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* __EVOLUTION_LOCAL_STORAGE_H__ */
|
|
@ -394,11 +394,11 @@ evolution_shell_client_get_activity_interface (EvolutionShellClient *shell_clien
|
|||||||
* Return value: a pointer to the CORBA object implementing the local storage
|
* Return value: a pointer to the CORBA object implementing the local storage
|
||||||
* in the shell associated with @shell_client.
|
* in the shell associated with @shell_client.
|
||||||
**/
|
**/
|
||||||
GNOME_Evolution_LocalStorage
|
GNOME_Evolution_Storage
|
||||||
evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client)
|
evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client)
|
||||||
{
|
{
|
||||||
GNOME_Evolution_Shell corba_shell;
|
GNOME_Evolution_Shell corba_shell;
|
||||||
GNOME_Evolution_LocalStorage corba_local_storage;
|
GNOME_Evolution_Storage corba_local_storage;
|
||||||
CORBA_Environment ev;
|
CORBA_Environment ev;
|
||||||
|
|
||||||
g_return_val_if_fail (shell_client != NULL, CORBA_OBJECT_NIL);
|
g_return_val_if_fail (shell_client != NULL, CORBA_OBJECT_NIL);
|
||||||
|
@ -69,7 +69,7 @@ void evolution_shell_client_user_select_folder (EvolutionShe
|
|||||||
|
|
||||||
GNOME_Evolution_Activity evolution_shell_client_get_activity_interface (EvolutionShellClient *shell_client);
|
GNOME_Evolution_Activity evolution_shell_client_get_activity_interface (EvolutionShellClient *shell_client);
|
||||||
|
|
||||||
GNOME_Evolution_LocalStorage evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client);
|
GNOME_Evolution_Storage evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ static void
|
|||||||
impl_GNOME_Evolution_StorageListener_notifyFolderUpdated (PortableServer_Servant servant,
|
impl_GNOME_Evolution_StorageListener_notifyFolderUpdated (PortableServer_Servant servant,
|
||||||
const CORBA_char *path,
|
const CORBA_char *path,
|
||||||
const CORBA_char *display_name,
|
const CORBA_char *display_name,
|
||||||
CORBA_boolean highlighted,
|
CORBA_long unread_count,
|
||||||
CORBA_Environment *ev)
|
CORBA_Environment *ev)
|
||||||
{
|
{
|
||||||
EvolutionStorageListener *listener;
|
EvolutionStorageListener *listener;
|
||||||
@ -106,7 +106,7 @@ impl_GNOME_Evolution_StorageListener_notifyFolderUpdated (PortableServer_Servant
|
|||||||
priv = listener->priv;
|
priv = listener->priv;
|
||||||
|
|
||||||
gtk_signal_emit (GTK_OBJECT (listener), signals[UPDATE_FOLDER], path,
|
gtk_signal_emit (GTK_OBJECT (listener), signals[UPDATE_FOLDER], path,
|
||||||
display_name, highlighted);
|
display_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -262,11 +262,10 @@ class_init (EvolutionStorageListenerClass *klass)
|
|||||||
GTK_RUN_FIRST,
|
GTK_RUN_FIRST,
|
||||||
object_class->type,
|
object_class->type,
|
||||||
GTK_SIGNAL_OFFSET (EvolutionStorageListenerClass, update_folder),
|
GTK_SIGNAL_OFFSET (EvolutionStorageListenerClass, update_folder),
|
||||||
e_marshal_NONE__POINTER_POINTER_INT,
|
gtk_marshal_NONE__POINTER_POINTER,
|
||||||
GTK_TYPE_NONE, 3,
|
GTK_TYPE_NONE, 2,
|
||||||
GTK_TYPE_STRING,
|
GTK_TYPE_STRING,
|
||||||
GTK_TYPE_STRING,
|
GTK_TYPE_STRING);
|
||||||
GTK_TYPE_BOOL);
|
|
||||||
|
|
||||||
signals[REMOVED_FOLDER] = gtk_signal_new ("removed_folder",
|
signals[REMOVED_FOLDER] = gtk_signal_new ("removed_folder",
|
||||||
GTK_RUN_FIRST,
|
GTK_RUN_FIRST,
|
||||||
|
@ -45,6 +45,9 @@ struct _EvolutionStoragePrivate {
|
|||||||
/* Name of the storage. */
|
/* Name of the storage. */
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
|
/* What we will display as the name of the storage. */
|
||||||
|
char *display_name;
|
||||||
|
|
||||||
/* URI for the toplevel node of the storage. */
|
/* URI for the toplevel node of the storage. */
|
||||||
char *toplevel_node_uri;
|
char *toplevel_node_uri;
|
||||||
|
|
||||||
@ -65,6 +68,7 @@ struct _EvolutionStoragePrivate {
|
|||||||
enum {
|
enum {
|
||||||
CREATE_FOLDER,
|
CREATE_FOLDER,
|
||||||
REMOVE_FOLDER,
|
REMOVE_FOLDER,
|
||||||
|
UPDATE_FOLDER,
|
||||||
|
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
@ -359,6 +363,53 @@ impl_Storage_async_xfer_folder (PortableServer_Servant servant,
|
|||||||
g_print ("FIXME: impl_Storage_async_xfer_folder -- implement me!\n");
|
g_print ("FIXME: impl_Storage_async_xfer_folder -- implement me!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
impl_Storage_updateFolder (PortableServer_Servant servant,
|
||||||
|
const CORBA_char *path,
|
||||||
|
const CORBA_char *display_name,
|
||||||
|
CORBA_long unread_count,
|
||||||
|
CORBA_Environment *ev)
|
||||||
|
{
|
||||||
|
BonoboObject *bonobo_object;
|
||||||
|
EvolutionStoragePrivate *priv;
|
||||||
|
EvolutionStorage *storage;
|
||||||
|
GList *p;
|
||||||
|
CORBA_Environment ev;
|
||||||
|
|
||||||
|
bonobo_object = bonobo_object_from_servant (servant);
|
||||||
|
storage = EVOLUTION_STORAGE (bonobo_object);
|
||||||
|
|
||||||
|
gtk_signal_emit (GTK_OBJECT (storage), signals[UPDATE_FOLDER],
|
||||||
|
path, display_name, unread_count);
|
||||||
|
|
||||||
|
priv = storage->priv;
|
||||||
|
|
||||||
|
if (priv->corba_storage_listeners == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CORBA_exception_init (&ev);
|
||||||
|
|
||||||
|
for (p = priv->corba_storage_listeners; p != NULL; p = p->next) {
|
||||||
|
GNOME_Evolution_StorageListener listener;
|
||||||
|
|
||||||
|
listener = p->data;
|
||||||
|
GNOME_Evolution_StorageListener_notifyFolderUpdated (listener,
|
||||||
|
path,
|
||||||
|
display_name,
|
||||||
|
unread_count,
|
||||||
|
&ev);
|
||||||
|
|
||||||
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* FIXME: Handle errors */
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
CORBA_exception_free (&ev);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
impl_Storage_add_listener (PortableServer_Servant servant,
|
impl_Storage_add_listener (PortableServer_Servant servant,
|
||||||
const GNOME_Evolution_StorageListener listener,
|
const GNOME_Evolution_StorageListener listener,
|
||||||
@ -493,6 +544,17 @@ class_init (EvolutionStorageClass *klass)
|
|||||||
GTK_TYPE_STRING,
|
GTK_TYPE_STRING,
|
||||||
GTK_TYPE_STRING);
|
GTK_TYPE_STRING);
|
||||||
|
|
||||||
|
signals[UPDATE_FOLDER] = gtk_signal_new ("update_folder",
|
||||||
|
GTK_RUN_FIRST,
|
||||||
|
object_class->type,
|
||||||
|
GTK_SIGNAL_OFFSET (EvolutionStorageClass,
|
||||||
|
update_folder),
|
||||||
|
e_marshal_NONE__POINTER_POINTER_INT,
|
||||||
|
GTK_TYPE_NONE, 3,
|
||||||
|
GTK_TYPE_STRING,
|
||||||
|
GTK_TYPE_STRING,
|
||||||
|
GTK_TYPE_INT);
|
||||||
|
|
||||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
||||||
|
|
||||||
corba_class_init ();
|
corba_class_init ();
|
||||||
@ -525,6 +587,7 @@ evolution_storage_get_epv (void)
|
|||||||
epv->asyncCreateFolder = impl_Storage_async_create_folder;
|
epv->asyncCreateFolder = impl_Storage_async_create_folder;
|
||||||
epv->asyncRemoveFolder = impl_Storage_async_remove_folder;
|
epv->asyncRemoveFolder = impl_Storage_async_remove_folder;
|
||||||
epv->asyncXferFolder = impl_Storage_async_xfer_folder;
|
epv->asyncXferFolder = impl_Storage_async_xfer_folder;
|
||||||
|
epv->updateFolder = impl_Storage_updateFolder;
|
||||||
epv->addListener = impl_Storage_add_listener;
|
epv->addListener = impl_Storage_add_listener;
|
||||||
epv->removeListener = impl_Storage_remove_listener;
|
epv->removeListener = impl_Storage_remove_listener;
|
||||||
|
|
||||||
@ -583,6 +646,13 @@ evolution_storage_new (const char *name,
|
|||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evolution_storage_rename (EvolutionStorage *evolution_storage,
|
||||||
|
const char *new_name)
|
||||||
|
{
|
||||||
|
/* FIXME: Implement me */
|
||||||
|
}
|
||||||
|
|
||||||
EvolutionStorageResult
|
EvolutionStorageResult
|
||||||
evolution_storage_register (EvolutionStorage *evolution_storage,
|
evolution_storage_register (EvolutionStorage *evolution_storage,
|
||||||
GNOME_Evolution_StorageRegistry corba_storage_registry)
|
GNOME_Evolution_StorageRegistry corba_storage_registry)
|
||||||
@ -728,7 +798,7 @@ evolution_storage_new_folder (EvolutionStorage *evolution_storage,
|
|||||||
const char *type,
|
const char *type,
|
||||||
const char *physical_uri,
|
const char *physical_uri,
|
||||||
const char *description,
|
const char *description,
|
||||||
gboolean highlighted)
|
int unread_count)
|
||||||
{
|
{
|
||||||
EvolutionStorageResult result;
|
EvolutionStorageResult result;
|
||||||
EvolutionStoragePrivate *priv;
|
EvolutionStoragePrivate *priv;
|
||||||
@ -757,7 +827,7 @@ evolution_storage_new_folder (EvolutionStorage *evolution_storage,
|
|||||||
corba_folder->description = CORBA_string_dup (description);
|
corba_folder->description = CORBA_string_dup (description);
|
||||||
corba_folder->type = CORBA_string_dup (type);
|
corba_folder->type = CORBA_string_dup (type);
|
||||||
corba_folder->physical_uri = CORBA_string_dup (physical_uri);
|
corba_folder->physical_uri = CORBA_string_dup (physical_uri);
|
||||||
corba_folder->highlighted = highlighted;
|
corba_folder->unread_count = 0;
|
||||||
|
|
||||||
if (! e_folder_tree_add (priv->folder_tree, path, corba_folder)) {
|
if (! e_folder_tree_add (priv->folder_tree, path, corba_folder)) {
|
||||||
CORBA_free (corba_folder);
|
CORBA_free (corba_folder);
|
||||||
@ -793,8 +863,9 @@ evolution_storage_new_folder (EvolutionStorage *evolution_storage,
|
|||||||
|
|
||||||
EvolutionStorageResult
|
EvolutionStorageResult
|
||||||
evolution_storage_update_folder (EvolutionStorage *evolution_storage,
|
evolution_storage_update_folder (EvolutionStorage *evolution_storage,
|
||||||
const char *path, const char *display_name,
|
const char *path,
|
||||||
gboolean highlighted)
|
const char *display_name,
|
||||||
|
int unread_count)
|
||||||
{
|
{
|
||||||
EvolutionStorageResult result;
|
EvolutionStorageResult result;
|
||||||
EvolutionStoragePrivate *priv;
|
EvolutionStoragePrivate *priv;
|
||||||
@ -811,6 +882,9 @@ evolution_storage_update_folder (EvolutionStorage *evolution_storage,
|
|||||||
|
|
||||||
priv = evolution_storage->priv;
|
priv = evolution_storage->priv;
|
||||||
|
|
||||||
|
gtk_signal_emit (GTK_OBJECT (evolution_storage), signals[UPDATE_FOLDER],
|
||||||
|
path, display_name, unread_count);
|
||||||
|
|
||||||
if (priv->corba_storage_listeners == NULL)
|
if (priv->corba_storage_listeners == NULL)
|
||||||
return EVOLUTION_STORAGE_ERROR_NOTREGISTERED;
|
return EVOLUTION_STORAGE_ERROR_NOTREGISTERED;
|
||||||
|
|
||||||
@ -822,7 +896,7 @@ evolution_storage_update_folder (EvolutionStorage *evolution_storage,
|
|||||||
GNOME_Evolution_StorageListener listener;
|
GNOME_Evolution_StorageListener listener;
|
||||||
|
|
||||||
listener = p->data;
|
listener = p->data;
|
||||||
GNOME_Evolution_StorageListener_notifyFolderUpdated (listener, path, display_name, highlighted, &ev);
|
GNOME_Evolution_StorageListener_notifyFolderUpdated (listener, path, display_name, unread_count, &ev);
|
||||||
|
|
||||||
if (ev._major != CORBA_NO_EXCEPTION)
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
continue;
|
continue;
|
||||||
@ -844,7 +918,7 @@ evolution_storage_update_folder (EvolutionStorage *evolution_storage,
|
|||||||
if (corba_folder != NULL) {
|
if (corba_folder != NULL) {
|
||||||
CORBA_free (corba_folder->display_name);
|
CORBA_free (corba_folder->display_name);
|
||||||
corba_folder->display_name = CORBA_string_dup (display_name);
|
corba_folder->display_name = CORBA_string_dup (display_name);
|
||||||
corba_folder->highlighted = highlighted;
|
corba_folder->unread_count = unread_count;
|
||||||
} else
|
} else
|
||||||
result = EVOLUTION_STORAGE_ERROR_NOTFOUND;
|
result = EVOLUTION_STORAGE_ERROR_NOTFOUND;
|
||||||
}
|
}
|
||||||
@ -856,7 +930,7 @@ EvolutionStorageResult
|
|||||||
evolution_storage_update_folder_by_uri (EvolutionStorage *evolution_storage,
|
evolution_storage_update_folder_by_uri (EvolutionStorage *evolution_storage,
|
||||||
const char *physical_uri,
|
const char *physical_uri,
|
||||||
const char *display_name,
|
const char *display_name,
|
||||||
gboolean highlighted)
|
int unread_count)
|
||||||
{
|
{
|
||||||
EvolutionStoragePrivate *priv;
|
EvolutionStoragePrivate *priv;
|
||||||
char *path;
|
char *path;
|
||||||
@ -870,7 +944,7 @@ evolution_storage_update_folder_by_uri (EvolutionStorage *evolution_storage,
|
|||||||
priv = evolution_storage->priv;
|
priv = evolution_storage->priv;
|
||||||
|
|
||||||
path = g_hash_table_lookup (priv->uri_to_path, physical_uri);
|
path = g_hash_table_lookup (priv->uri_to_path, physical_uri);
|
||||||
return evolution_storage_update_folder (evolution_storage, path, display_name, highlighted);
|
return evolution_storage_update_folder (evolution_storage, path, display_name, unread_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
EvolutionStorageResult
|
EvolutionStorageResult
|
||||||
|
@ -91,6 +91,11 @@ struct _EvolutionStorageClass {
|
|||||||
int (*remove_folder) (EvolutionStorage *storage,
|
int (*remove_folder) (EvolutionStorage *storage,
|
||||||
const char *path,
|
const char *path,
|
||||||
const char *physical_uri);
|
const char *physical_uri);
|
||||||
|
|
||||||
|
void (*update_folder) (EvolutionStorage *storage,
|
||||||
|
const char *path,
|
||||||
|
const char *display_name,
|
||||||
|
int unread_count);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -106,6 +111,9 @@ EvolutionStorage *evolution_storage_new (const char *name,
|
|||||||
const char *toplevel_node_uri,
|
const char *toplevel_node_uri,
|
||||||
const char *toplevel_node_type);
|
const char *toplevel_node_type);
|
||||||
|
|
||||||
|
void evolution_storage_rename (EvolutionStorage *storage,
|
||||||
|
const char *new_name);
|
||||||
|
|
||||||
EvolutionStorageResult evolution_storage_register (EvolutionStorage *storage,
|
EvolutionStorageResult evolution_storage_register (EvolutionStorage *storage,
|
||||||
GNOME_Evolution_StorageRegistry corba_registry);
|
GNOME_Evolution_StorageRegistry corba_registry);
|
||||||
EvolutionStorageResult evolution_storage_register_on_shell (EvolutionStorage *evolution_storage,
|
EvolutionStorageResult evolution_storage_register_on_shell (EvolutionStorage *evolution_storage,
|
||||||
@ -118,15 +126,15 @@ EvolutionStorageResult evolution_storage_new_folder (EvolutionStorage
|
|||||||
const char *type,
|
const char *type,
|
||||||
const char *physical_uri,
|
const char *physical_uri,
|
||||||
const char *description,
|
const char *description,
|
||||||
gboolean highlighted);
|
int unread_count);
|
||||||
EvolutionStorageResult evolution_storage_update_folder (EvolutionStorage *evolution_storage,
|
EvolutionStorageResult evolution_storage_update_folder (EvolutionStorage *evolution_storage,
|
||||||
const char *path,
|
const char *path,
|
||||||
const char *display_name,
|
const char *display_name,
|
||||||
gboolean highlighted);
|
int unread_count);
|
||||||
EvolutionStorageResult evolution_storage_update_folder_by_uri (EvolutionStorage *evolution_storage,
|
EvolutionStorageResult evolution_storage_update_folder_by_uri (EvolutionStorage *evolution_storage,
|
||||||
const char *physical_uri,
|
const char *physical_uri,
|
||||||
const char *display_name,
|
const char *display_name,
|
||||||
gboolean highlighted);
|
int unread_count);
|
||||||
EvolutionStorageResult evolution_storage_removed_folder (EvolutionStorage *evolution_storage,
|
EvolutionStorageResult evolution_storage_removed_folder (EvolutionStorage *evolution_storage,
|
||||||
const char *path);
|
const char *path);
|
||||||
gboolean evolution_storage_folder_exists (EvolutionStorage *evolution_storage,
|
gboolean evolution_storage_folder_exists (EvolutionStorage *evolution_storage,
|
||||||
|
Reference in New Issue
Block a user