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
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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[] = {
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user