aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-06-06 01:10:32 +0800
committerJacob Leach <jleach@src.gnome.org>2001-06-06 01:10:32 +0800
commit8f366de2a4fb5c5bddab80667a821c1acee91c21 (patch)
tree70ca712fb4bfd275b1b94d9270cc3a7e82efa96c
parentbd19a9d79d73216721b8409b65be9bfc9928f12c (diff)
downloadgsoc2013-evolution-8f366de2a4fb5c5bddab80667a821c1acee91c21.tar.gz
gsoc2013-evolution-8f366de2a4fb5c5bddab80667a821c1acee91c21.tar.zst
gsoc2013-evolution-8f366de2a4fb5c5bddab80667a821c1acee91c21.zip
(Fixing bug #1299: Shell saves shortcuts when display name changes)
2001-06-04 Jason Leach <jleach@ximian.com> (Fixing bug #1299: Shell saves shortcuts when display name changes) * e-shortcuts.c (class_init): New signal: "update_shortcut". * e-shortcuts-view-model.c (e_shortcuts_view_model_construct): Connect thew new signal here. * e-shortcuts-view-model.c (shortcuts_update_shortcut_cb): New function, uses the new e_shortcut_model_update_item(). * e-shell-view.c (corba_interface_set_folder_bar_label): Fix a warning here. svn path=/trunk/; revision=10116
-rw-r--r--shell/ChangeLog16
-rw-r--r--shell/e-shell-view.c12
-rw-r--r--shell/e-shortcuts-view-model.c35
-rw-r--r--shell/e-shortcuts.c18
-rw-r--r--shell/e-shortcuts.h1
5 files changed, 70 insertions, 12 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 09102685a9..15652e0b15 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,19 @@
+2001-06-04 Jason Leach <jleach@ximian.com>
+
+ (Fixing bug #1299: Shell saves shortcuts when display name
+ changes)
+
+ * e-shortcuts.c (class_init): New signal: "update_shortcut".
+
+ * e-shortcuts-view-model.c (e_shortcuts_view_model_construct):
+ Connect thew new signal here.
+
+ * e-shortcuts-view-model.c (shortcuts_update_shortcut_cb): New
+ function, uses the new e_shortcut_model_update_item().
+
+ * e-shell-view.c (corba_interface_set_folder_bar_label): Fix a
+ warning here.
+
2001-06-03 Ettore Perazzoli <ettore@ximian.com>
* Makefile.am (evolution_LDADD): Move `$(DB3_LDADD)' before
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 7166a50454..7c2814de8b 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1083,8 +1083,8 @@ corba_interface_change_current_view_cb (EvolutionShellView *shell_view,
static void
corba_interface_set_title (EvolutionShellView *shell_view,
- const char *title,
- void *data)
+ const char *title,
+ void *data)
{
EShellView *view;
@@ -1096,9 +1096,9 @@ corba_interface_set_title (EvolutionShellView *shell_view,
}
static void
-corba_interface_set_folder_bar_label (EvolutionShellView *shell_view,
- const char *text,
- void *data)
+corba_interface_set_folder_bar_label (EvolutionShellView *evolution_shell_view,
+ const char *text,
+ void *data)
{
EShellView *shell_view;
EShellViewPrivate *priv;
@@ -1110,7 +1110,7 @@ corba_interface_set_folder_bar_label (EvolutionShellView *shell_view,
priv = shell_view->priv;
e_shell_folder_title_bar_set_folder_bar_label (E_SHELL_FOLDER_TITLE_BAR (priv->view_title_bar),
- text);
+ text);
}
static void
diff --git a/shell/e-shortcuts-view-model.c b/shell/e-shortcuts-view-model.c
index 72afd70497..36625e2bfe 100644
--- a/shell/e-shortcuts-view-model.c
+++ b/shell/e-shortcuts-view-model.c
@@ -208,6 +208,38 @@ shortcuts_remove_shortcut_cb (EShortcuts *shortcuts,
e_shortcut_model_remove_item (E_SHORTCUT_MODEL (shortcuts_view_model), group_num, item_num);
}
+static void
+shortcuts_update_shortcut_cb (EShortcuts *shortcuts,
+ int group_num,
+ int item_num,
+ void *data)
+{
+ EShortcutsViewModel *shortcuts_view_model;
+ EShortcutsViewModelPrivate *priv;
+ EStorageSet *storage_set;
+ EFolder *folder;
+ const char *uri;
+ const char *storage_set_path;
+ const char *folder_name;
+
+ shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
+ priv = shortcuts_view_model->priv;
+
+ uri = e_shortcuts_get_uri (priv->shortcuts, group_num, item_num);
+ g_assert (uri != NULL);
+
+ storage_set_path = get_storage_set_path_from_uri (uri);
+ if (storage_set_path == NULL)
+ return;
+
+ storage_set = e_shortcuts_get_storage_set (priv->shortcuts);
+ folder = e_storage_set_get_folder (storage_set, storage_set_path);
+ folder_name = e_folder_get_name (folder);
+
+ e_shortcut_model_update_item (E_SHORTCUT_MODEL (shortcuts_view_model),
+ group_num, item_num, uri, folder_name);
+}
+
/* GtkObject methods. */
@@ -277,6 +309,9 @@ e_shortcuts_view_model_construct (EShortcutsViewModel *model,
gtk_signal_connect_while_alive (GTK_OBJECT (priv->shortcuts),
"remove_shortcut", GTK_SIGNAL_FUNC (shortcuts_remove_shortcut_cb), model,
GTK_OBJECT (model));
+ gtk_signal_connect_while_alive (GTK_OBJECT (priv->shortcuts),
+ "update_shortcut", GTK_SIGNAL_FUNC (shortcuts_update_shortcut_cb), model,
+ GTK_OBJECT (model));
}
EShortcutsViewModel *
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c
index 5fae9cfb9d..3317dd4835 100644
--- a/shell/e-shortcuts.c
+++ b/shell/e-shortcuts.c
@@ -112,6 +112,7 @@ enum {
REMOVE_GROUP,
NEW_SHORTCUT,
REMOVE_SHORTCUT,
+ UPDATE_SHORTCUT,
LAST_SIGNAL
};
@@ -435,6 +436,16 @@ class_init (EShortcutsClass *klass)
GTK_TYPE_INT,
GTK_TYPE_INT);
+ signals[UPDATE_SHORTCUT]
+ = gtk_signal_new ("update_shortcut",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, update_shortcut),
+ gtk_marshal_NONE__INT_INT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT,
+ GTK_TYPE_INT);
+
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
@@ -741,13 +752,8 @@ e_shortcuts_update_shortcut (EShortcuts *shortcuts,
{
g_return_if_fail (shortcuts != NULL);
g_return_if_fail (E_IS_SHORTCUTS (shortcuts));
-
- /* FIXME: need support in e-shortcut-bar widget (and also
- e-icon-bar) to be able to "update" a shortcut without doing
- this lame remove then add */
- e_shortcuts_remove_shortcut (shortcuts, group_num, num);
- e_shortcuts_add_shortcut (shortcuts, group_num, num, uri);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[UPDATE_SHORTCUT], group_num, num);
}
diff --git a/shell/e-shortcuts.h b/shell/e-shortcuts.h
index bd7ed54080..2abbf6bb7f 100644
--- a/shell/e-shortcuts.h
+++ b/shell/e-shortcuts.h
@@ -60,6 +60,7 @@ struct _EShortcutsClass {
void (* remove_group) (EShortcuts *shortcuts, int group_num);
void (* new_shortcut) (EShortcuts *shortcuts, int group_num, int item_num);
void (* remove_shortcut) (EShortcuts *shortcuts, int group_num, int item_num);
+ void (* update_shortcut) (EShortcuts *shortcuts, int group_num, int item_num);
};
lass='insertions'>+5 * - fix build by not compiling gnu/kfreebsd branchesgahr2012-02-201-1/+10 * - Update to 11.12.25.15miwi2012-02-203-5/+10 * - Update devel/sdl12 to 1.2.15mva2012-02-181-0/+1 * - Bump PORTREVISION to chase the update of multimedia/libvpxashish2012-02-162-1/+2 * - Update to 2.6.6miwi2012-01-293-4/+7 * Update to 1.3.0ehaupt2012-01-083-7/+8 * Upgrade to version 0.6.olgeni2011-12-243-6/+7 * Upgrade to version 2.11.olgeni2011-12-243-6/+5 * - Update to 1.2.8.14sylvio2011-12-092-3/+5 * - Fix build with clanggahr2011-11-282-3/+15 * Remove trailing whitespaces.ehaupt2011-11-191-1/+1 * Unbreak the port by fixing the plist.rakuco2011-11-172-2/+7 * - Remove WITH_FBSD10_FIX, is no longer neededmiwi2011-11-091-1/+0 * - Update to 0.19.12dhn2011-11-022-3/+3 * - Fix build on FreeBSD 10miwi2011-10-291-0/+1 * - x11-wm/xfce4-wm update to 4.8.2miwi2011-10-283-4/+7 * Consistify spelling of "Xfce", and some other projects while there.rene2011-10-271-1/+1 * The vast majority of pkg-descr files had the following format when theydougb2011-10-241-3/+0 * Remove more tags from pkg-descr files fo the form:dougb2011-10-242-5/+0 * Re-assign to the Xfce team.rene2011-10-232-2/+2 * - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-2414-29/+21 * Fix build with clang.rene2011-09-131-0/+11 * Update to 0.9.9kmoore2011-09-033-4/+26 * - Update to 1.2.8.13sylvio2011-08-302-3/+3 * o Fix program version number: it displays 0.2.0.15 even though thelioux2011-08-281-0/+7 * - Mark BROKEN: incomplete plistpav2011-08-271-0/+2 * Chase libnotify, libproxy and webkit-gtk2 shlib changes, and fix build where ...kwm2011-08-241-2/+2 * - Update to 11.2.20.13sylvio2011-08-203-3/+4 * - Update Krusader to 2.4.0-beta1 "Migration"fluffy2011-08-163-170/+10 * Remove USE_GNOME=gnometarget from ports. It has been a empty keyword sincekwm2011-08-123-3/+3 * - Support USE_TKehaupt2011-08-113-14/+23 * Update to 0.0.10ehaupt2011-08-11