Fix ID of newly added commands in the Set Custom Commands dialog

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5687 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Colomban Wendling 2011-04-03 17:52:49 +00:00
parent 779e00ec26
commit 0e0b3687bb
2 changed files with 7 additions and 4 deletions

View File

@ -18,6 +18,8 @@
Fix loading and updating menu accelerators for custom commands.
* src/prefs.c:
Don't allow editing keybinding column of group rows.
* src/tools.c:
Fix ID of newly added commands in the `Set Custom Commands` dialog.
2011-04-02 Colomban Wendling <colomban(at)geany(dot)org>

View File

@ -65,7 +65,7 @@ enum
/* custom commands code*/
struct cc_dialog
{
gint count;
guint count;
GtkWidget *view;
GtkTreeViewColumn *edit_column;
GtkListStore *store;
@ -133,13 +133,14 @@ static void cc_dialog_add_command(struct cc_dialog *cc, gint idx, gboolean start
{
GtkTreeIter iter;
const gchar *cmd;
guint id = cc->count;
cmd = (idx >= 0) ? ui_prefs.custom_commands[idx] : NULL;
gtk_list_store_append(cc->store, &iter);
gtk_list_store_set(cc->store, &iter, CC_COLUMN_ID, cc->count, CC_COLUMN_CMD, cmd, -1);
cc_dialog_update_row_status(cc->store, &iter, cmd);
cc->count++;
gtk_list_store_append(cc->store, &iter);
gtk_list_store_set(cc->store, &iter, CC_COLUMN_ID, id, CC_COLUMN_CMD, cmd, -1);
cc_dialog_update_row_status(cc->store, &iter, cmd);
if (start_editing)
{