aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-07-31 03:24:22 +0800
committerJacob Leach <jleach@src.gnome.org>2001-07-31 03:24:22 +0800
commitc7fa1e7eb5c25c1e4235fd717130cbf41e06240c (patch)
tree654d31db933eea3417831d7b8db41c3bcee9a008 /shell
parent116e504828b7383a447579142e06ca0f161864df (diff)
downloadgsoc2013-evolution-c7fa1e7eb5c25c1e4235fd717130cbf41e06240c.tar
gsoc2013-evolution-c7fa1e7eb5c25c1e4235fd717130cbf41e06240c.tar.gz
gsoc2013-evolution-c7fa1e7eb5c25c1e4235fd717130cbf41e06240c.tar.bz2
gsoc2013-evolution-c7fa1e7eb5c25c1e4235fd717130cbf41e06240c.tar.lz
gsoc2013-evolution-c7fa1e7eb5c25c1e4235fd717130cbf41e06240c.tar.xz
gsoc2013-evolution-c7fa1e7eb5c25c1e4235fd717130cbf41e06240c.tar.zst
gsoc2013-evolution-c7fa1e7eb5c25c1e4235fd717130cbf41e06240c.zip
Remember the current group so after renaming a group it doesn't flip to
2001-07-30 Jason Leach <jleach@ximian.com> * e-shortcuts-view.c (rename_group_cb): Remember the current group so after renaming a group it doesn't flip to the next group. Bug #3857. * e-shortcuts.c (e_shortcuts_rename_group): Comparing two separately allocated strings, use strcmp() instead of !=. svn path=/trunk/; revision=11483
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog9
-rw-r--r--shell/e-shortcuts-view-model.c4
-rw-r--r--shell/e-shortcuts-view.c8
-rw-r--r--shell/e-shortcuts.c5
4 files changed, 23 insertions, 3 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 228929239c..ee1807db41 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,14 @@
2001-07-30 Jason Leach <jleach@ximian.com>
+ * e-shortcuts-view.c (rename_group_cb): Remember the current group
+ so after renaming a group it doesn't flip to the next group. Bug
+ #3857.
+
+ * e-shortcuts.c (e_shortcuts_rename_group): Comparing two
+ separately allocated strings, use strcmp() instead of !=.
+
+2001-07-30 Jason Leach <jleach@ximian.com>
+
* e-shell-folder-creation-dialog.c (async_create_cb): If we can't
create a folder because it already exists, select that folder that
exists. Bug #1716.
diff --git a/shell/e-shortcuts-view-model.c b/shell/e-shortcuts-view-model.c
index 57d2762fb9..8936d24242 100644
--- a/shell/e-shortcuts-view-model.c
+++ b/shell/e-shortcuts-view-model.c
@@ -135,6 +135,10 @@ shortcuts_rename_group_cb (EShortcuts *shortcuts,
shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
+ /* FIXME: Ideally there should be an
+ e_shortcut_model_rename_group(), removing then re-add
+ actually causes a flip to the next group, which we work
+ around in e-shortcuts-view.c */
e_shortcut_model_remove_group (E_SHORTCUT_MODEL (shortcuts_view_model), group_num);
e_shortcut_model_add_group (E_SHORTCUT_MODEL (shortcuts_view_model), group_num, new_title);
load_group_into_model (shortcuts_view_model, group_num);
diff --git a/shell/e-shortcuts-view.c b/shell/e-shortcuts-view.c
index dc45bcd949..6cae3293ab 100644
--- a/shell/e-shortcuts-view.c
+++ b/shell/e-shortcuts-view.c
@@ -285,11 +285,14 @@ rename_group_cb (GtkWidget *widget,
{
RightClickMenuData *menu_data;
EShortcuts *shortcuts;
+ EShortcutsView *shortcuts_view;
const char *old_name;
const char *new_name;
+ int group;
menu_data = (RightClickMenuData *) data;
- shortcuts = menu_data->shortcuts_view->priv->shortcuts;
+ shortcuts_view = menu_data->shortcuts_view;
+ shortcuts = shortcuts_view->priv->shortcuts;
old_name = e_shortcuts_get_group_title (shortcuts, menu_data->group_num);
@@ -301,7 +304,10 @@ rename_group_cb (GtkWidget *widget,
if (new_name == NULL)
return;
+ /* Remember the group and flip back to it */
+ group = e_group_bar_get_current_group_num (E_GROUP_BAR (E_SHORTCUT_BAR (shortcuts_view)));
e_shortcuts_rename_group (shortcuts, menu_data->group_num, new_name);
+ e_group_bar_set_current_group_num (E_GROUP_BAR (E_SHORTCUT_BAR (shortcuts_view)), group, FALSE);
}
static GnomeUIInfo icon_size_radio_group_uiinfo[] = {
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c
index 7c8505ab79..1aaf8edd52 100644
--- a/shell/e-shortcuts.c
+++ b/shell/e-shortcuts.c
@@ -1030,10 +1030,11 @@ e_shortcuts_rename_group (EShortcuts *shortcuts,
g_return_if_fail (p != NULL);
group = (ShortcutGroup *) p->data;
- if (group->title != new_title) {
+ if (strcmp (group->title, new_title)) {
g_free (group->title);
group->title = g_strdup (new_title);
- }
+ } else
+ return;
gtk_signal_emit (GTK_OBJECT (shortcuts), signals[RENAME_GROUP], group_num, new_title);