aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog35
-rw-r--r--shell/Evolution-ShellView.idl1
-rw-r--r--shell/e-shell-folder-commands.c2
-rw-r--r--shell/e-shell-folder-title-bar.c49
-rw-r--r--shell/e-shell-folder-title-bar.h2
-rw-r--r--shell/e-shell-view.c39
-rw-r--r--shell/e-shell-view.h3
-rw-r--r--shell/evolution-shell-view.c23
-rw-r--r--shell/evolution-shell-view.h1
-rw-r--r--shell/evolution-storage-listener.c10
-rw-r--r--shell/evolution-storage.c2
11 files changed, 154 insertions, 13 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 3306a23b40..ff411da114 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,40 @@
2001-05-30 Jason Leach <jleach@ximian.com>
+ * e-shell-view.c (e_shell_view_set_current_shortcuts_group_num):
+ New function (probably should just be static).
+ (e_shell_view_load_settings): Load the current shortcut group here
+ using the above new function.
+ (e_shell_view_save_settings): Save current shortcut group in here.
+
+2001-05-30 Jason Leach <jleach@ximian.com>
+
+ * e-shell-folder-title-bar.c: New 'folder_bar_label' member for
+ EShellFolderTitleBar, it's for information that's shown to the
+ left of the icon like the dates in the calendar (or, potentially
+ total and unread numbers for mailer).
+ (e_shell_folder_title_bar_set_folder_bar_label): New function,
+ lets others set the title bar extra label.
+
+ * Evolution-ShellView.idl: New method 'setFolderBarLabel' for our
+ exposed ShellView interface.
+
+ * evolution-shell-view.h: New signal "set_folder_bar_label" for
+ EvolutionShellView.
+
+ * evolution-shell-view.c (impl_ShellView_set_message): Emit the
+ new signal here.
+
+ * e-shell-view.c (setup_corba_interface): Connect the signal here.
+
+ * e-shell-view.c (corba_interface_set_folder_bar_label): New
+ function, callback for the above signals, does the actual extra
+ label setting for the folder title bar.
+
+ * e-shell-folder-commands.c (e_shell_command_add_to_shortcut_bar):
+ Fix a warning here.
+
+2001-05-30 Jason Leach <jleach@ximian.com>
+
* e-shell.c (e_shell_construct): Removed an unecessary sleep(2)
call, so evolution will start up 2 seconds faster now.
diff --git a/shell/Evolution-ShellView.idl b/shell/Evolution-ShellView.idl
index 0da2540528..685604e601 100644
--- a/shell/Evolution-ShellView.idl
+++ b/shell/Evolution-ShellView.idl
@@ -18,6 +18,7 @@ module Evolution {
void unsetMessage ();
void changeCurrentView (in string uri);
void setTitle (in string title);
+ void setFolderBarLabel (in string text);
};
};
};
diff --git a/shell/e-shell-folder-commands.c b/shell/e-shell-folder-commands.c
index f0a39f0e4e..6843c89da4 100644
--- a/shell/e-shell-folder-commands.c
+++ b/shell/e-shell-folder-commands.c
@@ -316,7 +316,7 @@ e_shell_command_add_to_shortcut_bar (EShell *shell,
{
EShortcuts *shortcuts;
int group_num;
- char *uri;
+ const char *uri;
g_return_if_fail (shell != NULL);
g_return_if_fail (E_IS_SHELL (shell));
diff --git a/shell/e-shell-folder-title-bar.c b/shell/e-shell-folder-title-bar.c
index 2ad59f507f..514d5141ac 100644
--- a/shell/e-shell-folder-title-bar.c
+++ b/shell/e-shell-folder-title-bar.c
@@ -50,15 +50,19 @@ struct _EShellFolderTitleBarPrivate {
GdkPixbuf *icon;
GtkWidget *icon_widget;
- /* The hbox containing the button, the label and the icon on the right. */
+ /* The hbox containing the button, the label, the extra label, and the icon on the right. */
GtkWidget *hbox;
- /* We have a label and a button. When the button is enabled, the label is hidden;
- when the button is disable, only the label is visible. */
+ /* We have a label and a button. When the button is enabled,
+ the label is hidden; when the button is disable, only the
+ label is visible. */
/* The label. */
GtkWidget *label;
+ /* Holds extra information that is to be shown to the left of the icon */
+ GtkWidget *folder_bar_label;
+
/* The button. */
GtkWidget *button;
GtkWidget *button_label;
@@ -269,8 +273,8 @@ realize (GtkWidget *widget)
gtk_widget_show (priv->icon_widget);
gtk_misc_set_alignment (GTK_MISC (priv->icon_widget), 1.0, .5);
- gtk_misc_set_padding (GTK_MISC (priv->icon_widget), 5, 0);
- gtk_box_pack_start (GTK_BOX (priv->hbox), priv->icon_widget, TRUE, TRUE, 2);
+ gtk_misc_set_padding (GTK_MISC (priv->icon_widget), 0, 0);
+ gtk_box_pack_start (GTK_BOX (priv->hbox), priv->icon_widget, FALSE, FALSE, 2);
}
static void
@@ -345,6 +349,7 @@ init (EShellFolderTitleBar *shell_folder_title_bar)
priv->icon_widget = NULL;
priv->hbox = NULL;
priv->label = NULL;
+ priv->folder_bar_label = NULL;
priv->button_label = NULL;
priv->button = NULL;
priv->button_arrow = NULL;
@@ -375,9 +380,12 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
widget = GTK_WIDGET (folder_title_bar);
priv->label = gtk_label_new ("");
- gtk_misc_set_padding (GTK_MISC (priv->label), 5, 0);
gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
+ priv->folder_bar_label = gtk_label_new ("");
+ gtk_misc_set_alignment (GTK_MISC (priv->folder_bar_label), 1.0, 0.5);
+ gtk_widget_show (priv->folder_bar_label);
+
priv->button_label = gtk_label_new ("");
gtk_misc_set_padding (GTK_MISC (priv->button_label), 5, 0);
gtk_misc_set_alignment (GTK_MISC (priv->button_label), 0.0, 0.5);
@@ -399,6 +407,7 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
gtk_container_set_border_width (GTK_CONTAINER (priv->hbox), 2);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->label, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->button, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (priv->hbox), priv->folder_bar_label, TRUE, TRUE, 0);
gtk_widget_show (priv->hbox);
@@ -468,6 +477,34 @@ e_shell_folder_title_bar_set_title (EShellFolderTitleBar *folder_title_bar,
}
/**
+ * e_shell_folder_title_bar_set_folder_bar_label:
+ * @folder_title_bar:
+ * @text: Some text to show in the label.
+ *
+ * Sets the right-justified text label (to the left of the icon) for
+ * the title bar.
+ **/
+void
+e_shell_folder_title_bar_set_folder_bar_label (EShellFolderTitleBar *folder_title_bar,
+ const char *text)
+{
+ EShellFolderTitleBarPrivate *priv;
+
+ g_return_if_fail (folder_title_bar != NULL);
+ g_return_if_fail (E_IS_SHELL_FOLDER_TITLE_BAR (folder_title_bar));
+
+ priv = folder_title_bar->priv;
+
+ if (text == NULL)
+ gtk_label_set_text (GTK_LABEL (priv->folder_bar_label), "");
+ else
+ gtk_label_set_text (GTK_LABEL (priv->folder_bar_label), text);
+
+ /* FIXME: Might want to set the styles somewhere in here too,
+ black text on grey background isn't the best combination */
+}
+
+/**
* e_shell_folder_title_bar_set_icon:
* @folder_title_bar:
* @icon:
diff --git a/shell/e-shell-folder-title-bar.h b/shell/e-shell-folder-title-bar.h
index f6eef54bbf..092a465f14 100644
--- a/shell/e-shell-folder-title-bar.h
+++ b/shell/e-shell-folder-title-bar.h
@@ -63,6 +63,8 @@ GtkWidget *e_shell_folder_title_bar_new (void);
void e_shell_folder_title_bar_set_title (EShellFolderTitleBar *folder_title_bar,
const char *title);
+void e_shell_folder_title_bar_set_folder_bar_label (EShellFolderTitleBar *folder_title_bar,
+ const char *folder_bar_label);
void e_shell_folder_title_bar_set_icon (EShellFolderTitleBar *folder_title_bar,
const GdkPixbuf *icon);
void e_shell_folder_title_bar_set_toggle_state (EShellFolderTitleBar *folder_title_bar,
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 6bd47ebcf7..7166a50454 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -677,6 +677,20 @@ setup_progress_bar (EShellView *shell_view)
bonobo_object_unref (BONOBO_OBJECT (control));
}
+void
+e_shell_view_set_current_shortcuts_group_num (EShellView *shell_view, int group_num)
+{
+ /* This function could become static */
+ EShellViewPrivate *priv;
+ EShortcutsView *shortcuts_view;
+
+ priv = shell_view->priv;
+
+ shortcuts_view = E_SHORTCUTS_VIEW (priv->shortcut_bar);
+
+ e_group_bar_set_current_group_num (E_GROUP_BAR (E_SHORTCUT_BAR (shortcuts_view)), group_num, FALSE);
+}
+
int
e_shell_view_get_current_shortcuts_group_num (EShellView *shell_view)
{
@@ -1082,6 +1096,24 @@ corba_interface_set_title (EvolutionShellView *shell_view,
}
static void
+corba_interface_set_folder_bar_label (EvolutionShellView *shell_view,
+ const char *text,
+ void *data)
+{
+ EShellView *shell_view;
+ EShellViewPrivate *priv;
+
+ g_return_if_fail (data != NULL);
+ g_return_if_fail (E_IS_SHELL_VIEW (data));
+
+ shell_view = E_SHELL_VIEW (data);
+ priv = shell_view->priv;
+
+ e_shell_folder_title_bar_set_folder_bar_label (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar),
+ text);
+}
+
+static void
unmerge_on_error (BonoboObject *object,
CORBA_Object cobject,
CORBA_Environment *ev)
@@ -1474,6 +1506,9 @@ setup_corba_interface (EShellView *shell_view,
gtk_signal_connect_while_alive (GTK_OBJECT (corba_interface), "set_title",
GTK_SIGNAL_FUNC (corba_interface_set_title),
shell_view, GTK_OBJECT (shell_view));
+ gtk_signal_connect_while_alive (GTK_OBJECT (corba_interface), "set_folder_bar_label",
+ GTK_SIGNAL_FUNC (corba_interface_set_folder_bar_label),
+ shell_view, GTK_OBJECT (shell_view));
bonobo_object_add_interface (BONOBO_OBJECT (control_frame),
BONOBO_OBJECT (corba_interface));
@@ -2069,6 +2104,7 @@ e_shell_view_save_settings (EShellView *shell_view,
gnome_config_push_prefix (prefix);
+ gnome_config_set_int ("CurrentShortcutsGroupNum", e_shell_view_get_current_shortcuts_group_num (shell_view));
gnome_config_set_int ("FolderBarMode", e_shell_view_get_folder_bar_mode (shell_view));
gnome_config_set_int ("ShortcutBarMode", e_shell_view_get_shortcut_bar_mode (shell_view));
gnome_config_set_int ("HPanedPosition", e_paned_get_position (E_PANED (priv->hpaned)));
@@ -2119,6 +2155,9 @@ e_shell_view_load_settings (EShellView *shell_view,
gnome_config_push_prefix (prefix);
+ val = gnome_config_get_int ("CurrentShortcutsGroupNum");
+ e_shell_view_set_current_shortcuts_group_num (shell_view, val);
+
val = gnome_config_get_int ("FolderBarMode");
e_shell_view_set_folder_bar_mode (shell_view, val);
diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h
index 804379b1c0..605691b46d 100644
--- a/shell/e-shell-view.h
+++ b/shell/e-shell-view.h
@@ -84,13 +84,16 @@ void e_shell_view_set_folder_bar_mode (EShellView
EShellViewSubwindowMode mode);
EShellViewSubwindowMode e_shell_view_get_folder_bar_mode (EShellView *shell_view);
+
EShell *e_shell_view_get_shell (EShellView *shell_view);
BonoboUIComponent *e_shell_view_get_bonobo_ui_component (EShellView *shell_view);
BonoboUIContainer *e_shell_view_get_bonobo_ui_container (EShellView *shell_view);
GtkWidget *e_shell_view_get_appbar (EShellView *shell_view);
const char *e_shell_view_get_current_uri (EShellView *shell_view);
const char *e_shell_view_get_current_path (EShellView *shell_view);
+
int e_shell_view_get_current_shortcuts_group_num (EShellView *shell_view);
+void e_shell_view_set_current_shortcuts_group_num (EShellView *shell_view, int group_num);
gboolean e_shell_view_save_settings (EShellView *shell_view,
const char *prefix);
diff --git a/shell/evolution-shell-view.c b/shell/evolution-shell-view.c
index 82e471c35f..e5a377afe0 100644
--- a/shell/evolution-shell-view.c
+++ b/shell/evolution-shell-view.c
@@ -44,6 +44,7 @@ enum {
UNSET_MESSAGE,
CHANGE_VIEW,
SET_TITLE,
+ SET_FOLDER_BAR_LABEL,
LAST_SIGNAL
};
static int signals[LAST_SIGNAL] = { 0 };
@@ -121,6 +122,18 @@ impl_ShellView_set_title (PortableServer_Servant servant,
title);
}
+static void
+impl_ShellView_set_folder_bar_label (PortableServer_Servant servant,
+ const CORBA_char *text,
+ CORBA_Environment *ev)
+{
+ BonoboObject *bonobo_object;
+
+ bonobo_object = bonobo_object_from_servant (servant);
+ gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[SET_FOLDER_BAR_LABEL],
+ text);
+}
+
/* GtkObject methods. */
static void
@@ -155,6 +168,7 @@ corba_class_init (void)
epv->unsetMessage = impl_ShellView_unset_message;
epv->changeCurrentView = impl_ShellView_change_current_view;
epv->setTitle = impl_ShellView_set_title;
+ epv->setFolderBarLabel = impl_ShellView_set_folder_bar_label;
vepv = &ShellView_vepv;
vepv->_base_epv = base_epv;
@@ -206,6 +220,15 @@ class_init (EvolutionShellViewClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_STRING);
+ signals[SET_FOLDER_BAR_LABEL]
+ = gtk_signal_new ("set_folder_bar_label",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EvolutionShellViewClass, set_folder_bar_label),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
+
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
parent_class = gtk_type_class (bonobo_object_get_type ());
diff --git a/shell/evolution-shell-view.h b/shell/evolution-shell-view.h
index f7e58a316b..0f2fc64267 100644
--- a/shell/evolution-shell-view.h
+++ b/shell/evolution-shell-view.h
@@ -59,6 +59,7 @@ struct _EvolutionShellViewClass {
void (* unset_message) (EvolutionShellView *shell_view);
void (* change_current_view) (EvolutionShellView *shell_view, const char *uri);
void (* set_title) (EvolutionShellView *shell_view, const char *message);
+ void (* set_folder_bar_label) (EvolutionShellView *shell_view, const char *text);
};
diff --git a/shell/evolution-storage-listener.c b/shell/evolution-storage-listener.c
index 0d8ca46609..0da33fda2a 100644
--- a/shell/evolution-storage-listener.c
+++ b/shell/evolution-storage-listener.c
@@ -42,11 +42,11 @@ struct _EvolutionStorageListenerPrivate {
enum {
- DESTROYED,
- NEW_FOLDER,
- UPDATE_FOLDER,
- REMOVED_FOLDER,
- LAST_SIGNAL
+ DESTROYED,
+ NEW_FOLDER,
+ UPDATE_FOLDER,
+ REMOVED_FOLDER,
+ LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c
index e965c71a2a..482e25c834 100644
--- a/shell/evolution-storage.c
+++ b/shell/evolution-storage.c
@@ -515,7 +515,7 @@ init (EvolutionStorage *storage)
priv->toplevel_node_uri = NULL;
priv->toplevel_node_type = NULL;
priv->folder_tree = e_folder_tree_new (folder_destroy_notify, storage);
- priv->uri_to_path = g_hash_table_new (g_str_hash, g_str_equal);
+ priv->uri_to_path = g_hash_table_new (g_str_hash, g_str_equal);
priv->corba_storage_listeners = NULL;
storage->priv = priv;