[evolution-kolab] EPlugin: Permissions "Folab Folder Properties" dialog fixups



commit f56ca9f9d53f815abe9e1df4d0c4046c2ce02fde
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Jun 4 11:24:09 2012 +0200

    EPlugin: Permissions "Folab Folder Properties" dialog fixups
    
    * added context to translatable strings
    * added "selected folder" widget to "edit"
      sub dialog
    * layouting fixes
    * commented out debugging code
    * added "selected folder" UI data
      (as passed on from parent)

 src/eplugin/e-kolab-folder-permissions.c |   59 +++++++++++++++++++++---------
 src/eplugin/e-kolab-folder-permissions.h |    1 +
 2 files changed, 43 insertions(+), 17 deletions(-)
---
diff --git a/src/eplugin/e-kolab-folder-permissions.c b/src/eplugin/e-kolab-folder-permissions.c
index 8113eaa..7dda95f 100644
--- a/src/eplugin/e-kolab-folder-permissions.c
+++ b/src/eplugin/e-kolab-folder-permissions.c
@@ -33,8 +33,11 @@
 #include <e-util/e-config.h>
 #include <e-util/e-plugin.h>
 
+#include "e-kolab-plugin-util.h"
 #include "e-kolab-folder-permissions.h"
 
+/*----------------------------------------------------------------------------*/
+
 enum {
 	KOLAB_PERM_TREE_VIEW_COL_NAME = 0,
 	KOLAB_PERM_TREE_VIEW_COL_LEVEL,
@@ -74,13 +77,13 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
 	GtkWidget *btn = NULL;
 	GtkWidget *grid = NULL;
 	GtkWidget *widget = NULL;
-	gchar *tmp_str = NULL;
 	gint row = 0;
 
 	g_assert (uidata != NULL);
 	g_assert (uidata->widgets != NULL);
 
-	dialog = gtk_dialog_new_with_buttons (_("Edit Kolab Folder Permissions..."),
+	dialog = gtk_dialog_new_with_buttons (C_("Kolab Folder Permissions",
+	                                         "Edit Kolab Folder Permissions..."),
 	                                      NULL, /* parent */
 	                                      GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_MODAL,
 	                                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@@ -90,21 +93,28 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
 	content = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 	gtk_container_set_border_width (GTK_CONTAINER (content), 6);
 
+	widget = e_kolab_plugin_util_ui_selected_folder_widget (uidata->selected_folder);
+	gtk_container_add (GTK_CONTAINER (content), widget);
+
+	widget = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+	gtk_widget_set_margin_bottom (widget, 4);
+	gtk_container_add (GTK_CONTAINER (content), widget);
+	
 	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-	tmp_str = g_strconcat (_("User ID"), ":", NULL);
-	label = gtk_label_new (tmp_str);
-	g_free (tmp_str);
+	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 ();
 	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);
-	btn = gtk_button_new_with_label (_("Retrieve..."));
+	btn = gtk_button_new_with_label (C_("Kolab Folder Permissions",
+	                                    "Retrieve..."));
 	uidata->widgets->edit_btn_retrieve = btn;
 	gtk_box_pack_start (GTK_BOX (hbox), btn, FALSE, FALSE, 0);
 	gtk_container_add (GTK_CONTAINER (content), hbox);
 
-	frame = gtk_frame_new (_("IMAP Folder Permissions"));
+	frame = gtk_frame_new (C_("Kolab Folder Permissions",
+	                          "IMAP Folder Permissions"));
 	gtk_container_add (GTK_CONTAINER (content), frame);
 
 	grid = gtk_grid_new ();
@@ -117,14 +127,18 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
 
 	row = 0;
 
-	widget = gtk_radio_button_new_with_label (NULL, C_("Permissions", "None"));
+	widget = gtk_radio_button_new_with_label (NULL,
+	                                          C_("Kolab Folder Permissions",
+	                                             "None"));
 	uidata->widgets->radio_btn_perm_none = widget;
 	uidata->widgets->radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget));
 	gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
 
 	row++;
 
-	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group, C_("Permissions", "Read"));
+	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
+	                                          C_("Kolab Folder Permissions",
+	                                             "Read"));
 	uidata->widgets->radio_btn_perm_read = widget;
 	gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
 	widget = gtk_label_new ("(lrs)");
@@ -133,7 +147,9 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
 
 	row++;
 
-	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group, C_("Permissions", "Append"));
+	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
+	                                          C_("Kolab Folder Permissions",
+	                                             "Append"));
 	uidata->widgets->radio_btn_perm_append = widget;
 	gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
 	widget = gtk_label_new ("(lrsip)");
@@ -142,7 +158,9 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
 
 	row++;
 
-	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group, C_("Permissions", "Write"));
+	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
+	                                          C_("Kolab Folder Permissions",
+	                                             "Write"));
 	uidata->widgets->radio_btn_perm_write = widget;
 	gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
 	widget = gtk_label_new ("(lrswipte)");
@@ -151,7 +169,9 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
 
 	row++;
 
-	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group, C_("Permissions", "All"));
+	widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
+	                                          C_("Kolab Folder Permissions",
+	                                             "All"));
 	uidata->widgets->radio_btn_perm_all = widget;
 	gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
 	widget = gtk_label_new ("(lrswipakxte)");
@@ -200,7 +220,8 @@ kolab_folder_permissions_ui_create_tree_view (KolabFolderPermUIData *uidata)
 	g_object_set (renderer, "editable", FALSE, NULL);
 	gtk_tree_view_insert_column_with_attributes (tree_view,
 	                                             -1,
-	                                             _("User ID"),
+	                                             C_("Kolab Folder Permissions",
+	                                                "User ID"),
 	                                             renderer,
 	                                             "text",
 	                                             KOLAB_PERM_TREE_VIEW_COL_NAME,
@@ -212,7 +233,8 @@ kolab_folder_permissions_ui_create_tree_view (KolabFolderPermUIData *uidata)
 	g_object_set (renderer, "editable", FALSE, NULL);
 	gtk_tree_view_insert_column_with_attributes (tree_view,
 	                                             -1,
-	                                             _("Permissions"),
+	                                             C_("Kolab Folder Permissions",
+	                                                "Permissions"),
 	                                             renderer,
 	                                             "text",
 	                                             KOLAB_PERM_TREE_VIEW_COL_LEVEL,
@@ -231,7 +253,7 @@ kolab_folder_permissions_ui_create_tree_view (KolabFolderPermUIData *uidata)
 	return GTK_WIDGET (tree_view);
 }
 
-/* FIXME testing/debugging only, remove */
+#if 0 /* FIXME testing/debugging only, remove */
 static void
 add_some_content_to_treeview (GtkTreeView *treeview)
 {
@@ -255,7 +277,7 @@ add_some_content_to_treeview (GtkTreeView *treeview)
 	                                   -1);
 
 }
-
+#endif
 /*----------------------------------------------------------------------------*/
 /* API functions (non-UI) */
 
@@ -312,7 +334,8 @@ e_kolab_folder_permissions_ui_new (void)
 	gint row = 0;
 
 	uidata->widgets = g_new0 (KolabFolderPermUIWidgets, 1);
-	uidata->widgets->container = gtk_frame_new (_("IMAP Folder Permissions"));
+	uidata->widgets->container = gtk_frame_new (C_("Kolab Folder Permissions",
+	                                               "IMAP Folder Permissions"));
 	gtk_container_set_border_width (GTK_CONTAINER (uidata->widgets->container), 6);
 	/* gtk_container_set_resize_mode (uidata->widgets->container, GTK_RESIZE_QUEUE); */
 
@@ -374,6 +397,8 @@ e_kolab_folder_permissions_ui_free (KolabFolderPermUIData *uidata)
 		g_free (uidata->widgets);
 
 	kolab_data_folder_permissions_free (uidata->permissions);
+	if (uidata->selected_folder != NULL)
+		g_free (uidata->selected_folder);
 
 	g_free (uidata);
 }
diff --git a/src/eplugin/e-kolab-folder-permissions.h b/src/eplugin/e-kolab-folder-permissions.h
index ff91d4c..dd0bdec 100644
--- a/src/eplugin/e-kolab-folder-permissions.h
+++ b/src/eplugin/e-kolab-folder-permissions.h
@@ -66,6 +66,7 @@ typedef struct _KolabFolderPermUIData KolabFolderPermUIData;
 struct _KolabFolderPermUIData {
 	KolabFolderPermUIWidgets *widgets;
 	KolabDataFolderPermissions *permissions;
+	gchar *selected_folder;
 };
 
 /*----------------------------------------------------------------------------*/



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