[evolution-kolab/ek-wip-acl] EPlugin: update the ACL edit sub-dialog before displaying
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-acl] EPlugin: update the ACL edit sub-dialog before displaying
- Date: Tue, 9 Oct 2012 10:34:41 +0000 (UTC)
commit dba161c017194c2722080536a828f6c00c0f3017
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue Oct 9 11:22:01 2012 +0200
EPlugin: update the ACL edit sub-dialog before displaying
* update the "edit" variant of the ACL add/edit
dialog with data previously read from the
server
src/eplugin/e-kolab-folder-permissions.c | 40 +++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/src/eplugin/e-kolab-folder-permissions.c b/src/eplugin/e-kolab-folder-permissions.c
index a7be0b8..17e39ac 100644
--- a/src/eplugin/e-kolab-folder-permissions.c
+++ b/src/eplugin/e-kolab-folder-permissions.c
@@ -83,6 +83,15 @@ kolab_folder_permissions_ui_update_add_dialog (KolabFolderPermUIData *uidata)
static void
kolab_folder_permissions_ui_update_edit_dialog (KolabFolderPermUIData *uidata)
{
+ GtkComboBoxText *entrybox = NULL;
+ GtkTreeView *treeview = NULL;
+ GtkTreeSelection *treesel = NULL;
+ GtkTreeModel *treemodel = NULL;
+ GtkTreeIter treeiter;
+ gchar *access_id = NULL;
+ gchar *rights = NULL;
+ gboolean have_sel = FALSE;
+
g_return_if_fail (uidata != NULL);
g_return_if_fail (uidata->widgets != NULL);
@@ -93,6 +102,35 @@ kolab_folder_permissions_ui_update_edit_dialog (KolabFolderPermUIData *uidata)
gtk_widget_set_sensitive (uidata->widgets->edit_entry_box,
FALSE);
+ /* get the access_id and rights string from the tree selection */
+
+ treeview = GTK_TREE_VIEW (uidata->widgets->treeview);
+ treesel = gtk_tree_view_get_selection (treeview);
+ g_return_if_fail (treesel != NULL);
+
+ have_sel = gtk_tree_selection_get_selected (treesel,
+ &treemodel,
+ &treeiter);
+ g_return_if_fail (have_sel);
+ g_return_if_fail (GTK_IS_TREE_MODEL (treemodel));
+
+ gtk_tree_model_get (treemodel, &treeiter,
+ 0, &access_id,
+ 1, &rights,
+ -1);
+ g_return_if_fail (access_id != NULL);
+ /* rights may be NULL */
+
+ /* update dialog */
+ entrybox = GTK_COMBO_BOX_TEXT (uidata->widgets->edit_entry_box);
+ gtk_combo_box_text_insert_text (entrybox, 0, access_id);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (entrybox), 0);
+ gtk_label_set_text (GTK_LABEL (uidata->widgets->access_rights_lbl),
+ rights);
+
+ g_free (access_id);
+ if (rights != NULL)
+ g_free (rights);
}
static void
@@ -155,7 +193,7 @@ kolab_folder_permissions_ui_add_edit_dialog (KolabFolderPermUIData *uidata)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
label = gtk_label_new (C_("Kolab Folder Permissions", "User ID:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- entry = gtk_combo_box_new_with_entry ();
+ entry = gtk_combo_box_text_new_with_entry ();
gtk_combo_box_set_popup_fixed_width (GTK_COMBO_BOX (entry), FALSE);
uidata->widgets->edit_entry_box = entry;
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]