[evolution-kolab] EPlugin: new default selection for the ACL "edit" sub-dialog



commit bed56dc845c8f13a45aebda7d06de79418705b46
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Oct 9 15:17:52 2012 +0200

    EPlugin: new default selection for the ACL "edit" sub-dialog
    
    * added a "Keep the current permission settings" radio button
      to the group, so that we can activate the sub-dialog "OK"
      button once there is a change to the selection in the
      ACL settings radio button group (needed since this button
      group is the only initially sensitive widget in that dialog
      other than the "Cancel" button)

 src/eplugin/e-kolab-folder-permissions.c |   36 +++++++++++++++++++++++------
 src/eplugin/e-kolab-folder-permissions.h |    1 +
 2 files changed, 29 insertions(+), 8 deletions(-)
---
diff --git a/src/eplugin/e-kolab-folder-permissions.c b/src/eplugin/e-kolab-folder-permissions.c
index 955fe3d..7cf35bd 100644
--- a/src/eplugin/e-kolab-folder-permissions.c
+++ b/src/eplugin/e-kolab-folder-permissions.c
@@ -264,14 +264,34 @@ kolab_folder_permissions_ui_add_edit_dialog (KolabFolderPermUIData *uidata)
 
 	row = 0;
 
-	btn_loco = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
-	                                            C_("Kolab Folder Permissions",
-	                                               "Read"));
-	uidata->widgets->radio_btn_perm_read = btn_loco;
-	gtk_grid_attach (GTK_GRID (grid), btn_loco, 0, row, 1, 1);
-	widget = gtk_label_new ("(lrs)");
-	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-	gtk_grid_attach (GTK_GRID (grid), widget, 1, row, 1, 1);
+	if (uidata->editing) {
+		btn_loco = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
+		                                            C_("Kolab Folder Permissions",
+		                                               "Keep the current permission settings"));
+		uidata->widgets->radio_btn_perm_nochange = btn_loco;
+		gtk_grid_attach (GTK_GRID (grid), btn_loco, 0, row, 2, 1);
+
+		row++;
+
+		btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+		                                                   C_("Kolab Folder Permissions",
+		                                                      "Read"));
+		uidata->widgets->radio_btn_perm_read = btn;
+		gtk_grid_attach (GTK_GRID (grid), btn, 0, row, 1, 1);
+		widget = gtk_label_new ("(lrsip)");
+		gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+		gtk_grid_attach (GTK_GRID (grid), widget, 1, row, 1, 1);
+	} else {
+		uidata->widgets->radio_btn_perm_nochange = NULL;
+		btn_loco = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
+		                                                   C_("Kolab Folder Permissions",
+		                                                      "Read"));
+		uidata->widgets->radio_btn_perm_read = btn_loco;
+		gtk_grid_attach (GTK_GRID (grid), btn_loco, 0, row, 1, 1);
+		widget = gtk_label_new ("(lrsip)");
+		gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+		gtk_grid_attach (GTK_GRID (grid), widget, 1, row, 1, 1);
+	}
 
 	row++;
 
diff --git a/src/eplugin/e-kolab-folder-permissions.h b/src/eplugin/e-kolab-folder-permissions.h
index 36941f1..96ce784 100644
--- a/src/eplugin/e-kolab-folder-permissions.h
+++ b/src/eplugin/e-kolab-folder-permissions.h
@@ -62,6 +62,7 @@ struct _KolabFolderPermUIWidgets {
 	GtkWidget *access_rights;
 	GtkWidget *access_rights_lbl;
 	GSList *radio_group;
+	GtkWidget *radio_btn_perm_nochange;
 	GtkWidget *radio_btn_perm_read;
 	GtkWidget *radio_btn_perm_append;
 	GtkWidget *radio_btn_perm_write;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]