sharing_account_set_param (a, id, new);
changed = TRUE;
}
-
+ /* Make the account name shown under service name */
+ if (changed && id == "name") {
+ sharing_account_set_username(a, new);
+ }
g_free (old);
return changed;
}
static gboolean
gui_read(GHashTable* h, SharingAccount* a)
{
- gboolean changed = FALSE;
-
- if (gui_read_item (h, "command_line", a)) changed = TRUE;
-
- return changed;
+ gboolean command_updated = FALSE;
+ gboolean name_updated = FALSE;
+ command_updated = gui_read_item (h, "command_line", a);
+ name_updated = gui_read_item (h, "name", a);
+ /* Must separate the evaluation of two gui_read_item, or 1 of 2 params
+ * won't be saved */
+ return command_updated || name_updated;
}
gtk_box_pack_end(GTK_BOX(vbox), table, TRUE, TRUE, 0);
- gui_add_item(table, 0,
+ gui_add_item(table, 1,
"command_line", "CLI command",
- "Command line command to execute",
+ "Command to execute",
+ FALSE, account, h);
+ gui_add_item(table, 0,
+ "name", "Name",
+ "Account name",
FALSE, account, h);
gtk_widget_show_all (GTK_WIDGET (dlg));
gtk_widget_destroy (dlg);
g_hash_table_unref (h);
+ g_hash_table_unref (h);
if (result == GTK_RESPONSE_YES && (changed || setup))
return SHARING_EDIT_ACCOUNT_SUCCESS;