[evolution-kolab] EPlugin: added checkbox to metadata tab to (un)hide PIM folders



commit ea200c9ea73a6b5ef925035a32eac4b3d8731b70
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Aug 3 18:08:49 2012 +0200

    EPlugin: added checkbox to metadata tab to (un)hide PIM folders
    
    * in order to edit folder type annotations and access control
      lists of folders on the Kolab server, we need to be able to
      unhide the normally-hidden PIM folders
    * the setting will not be stored permanently for safety
      reasons, so upon restart of Evolution, the PIM folders
      will be hidden again in the EMail tree view
    * we will need CamelKolabIMAPXStore support for this to
      work

 src/eplugin/e-kolab-folder-metadata.c |   47 +++++++++++++++++++++++++++-----
 src/eplugin/e-kolab-folder-metadata.h |   15 ++++++++--
 2 files changed, 51 insertions(+), 11 deletions(-)
---
diff --git a/src/eplugin/e-kolab-folder-metadata.c b/src/eplugin/e-kolab-folder-metadata.c
index 0f70577..3591522 100644
--- a/src/eplugin/e-kolab-folder-metadata.c
+++ b/src/eplugin/e-kolab-folder-metadata.c
@@ -43,6 +43,7 @@
 /*----------------------------------------------------------------------------*/
 /* API functions (non-UI) */
 
+
 /*----------------------------------------------------------------------------*/
 /* API functions (UI) */
 
@@ -55,16 +56,29 @@ e_kolab_folder_metadata_ui_new (void)
 	GtkWidget *btn_loco = NULL;
 	GtkWidget *btn = NULL;
 
+	uidata->shell_view = NULL;
+	uidata->alert_bar = NULL;
+
 	uidata->widgets = g_new0 (KolabFolderMetaUIWidgets, 1);
-	uidata->widgets->container = gtk_frame_new (C_("Kolab Folder Metadata",
-	                                               "Folder Type (Annotation)"));
-	gtk_container_set_border_width (GTK_CONTAINER (uidata->widgets->container), 6);
+
+	grid = gtk_grid_new ();
+	gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);
+	gtk_container_set_border_width (GTK_CONTAINER (grid), 16);
+	uidata->widgets->container = grid;
+
+	/* Folder type radio button group */
+
+	widget = gtk_frame_new (C_("Kolab Folder Metadata",
+	                           "Folder Type (Annotation)"));
+	gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
+	gtk_container_add (GTK_CONTAINER (uidata->widgets->container), widget);
+	uidata->widgets->frame_type_select = widget;
 
 	grid = gtk_grid_new ();
 	gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);
 	gtk_grid_set_column_spacing (GTK_GRID (grid), 2);
 	gtk_container_set_border_width (GTK_CONTAINER (grid), 16);
-	gtk_container_add (GTK_CONTAINER (uidata->widgets->container), grid);
+	gtk_container_add (GTK_CONTAINER (uidata->widgets->frame_type_select), grid);
 
 	btn_loco = gtk_radio_button_new_with_label (NULL, C_("Kolab Folder Type",
 	                                                     "Mail"));
@@ -96,6 +110,23 @@ e_kolab_folder_metadata_ui_new (void)
 	uidata->widgets->radio_btn_type_contacts = btn;
 	gtk_container_add (GTK_CONTAINER (grid), btn);
 
+	/* "Show all folders" */
+
+	widget = gtk_frame_new (C_("Kolab Folder Metadata",
+	                           "Kolab Folder Options"));
+	gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
+	gtk_container_add (GTK_CONTAINER (uidata->widgets->container), widget);
+	uidata->widgets->frame_options = widget;
+
+	widget = gtk_check_button_new ();
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+	gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
+	gtk_container_add (GTK_CONTAINER (uidata->widgets->frame_options), widget);
+	uidata->widgets->chk_btn_show_all = widget;
+	widget = gtk_label_new (C_("Kolab Folder Options",
+	                           "Show all PIM folders in this Kolab account"));
+	gtk_container_add (GTK_CONTAINER (uidata->widgets->chk_btn_show_all), widget);
+
 	/* FIXME connect signals */
 	g_warning ("%s: FIXME connect signals", __func__);
 
@@ -115,10 +146,10 @@ e_kolab_folder_metadata_ui_free (KolabFolderMetaUIData *uidata)
 		g_free (uidata->widgets);
 
 	kolab_data_folder_metadata_free (uidata->metadata);
-	if (uidata->selected_folder != NULL)
-		g_free (uidata->selected_folder);
-	if (uidata->selected_source != NULL)
-		g_free (uidata->selected_source);
+	if (uidata->foldername != NULL)
+		g_free (uidata->foldername);
+	if (uidata->sourcename != NULL)
+		g_free (uidata->sourcename);
 
 	g_free (uidata);
 }
diff --git a/src/eplugin/e-kolab-folder-metadata.h b/src/eplugin/e-kolab-folder-metadata.h
index f94840a..ff44ed2 100644
--- a/src/eplugin/e-kolab-folder-metadata.h
+++ b/src/eplugin/e-kolab-folder-metadata.h
@@ -34,6 +34,9 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
+#include <shell/e-shell-view.h>
+#include <misc/e-alert-bar.h>
+
 #include <libekolab/kolab-data-folder-metadata.h>
 
 /*----------------------------------------------------------------------------*/
@@ -41,21 +44,27 @@
 typedef struct _KolabFolderMetaUIWidgets KolabFolderMetaUIWidgets;
 struct _KolabFolderMetaUIWidgets {
 	GtkWidget *container;
-	/* sub-widgets of container */
+	/* sub-widgets of container - folder type */
+	GtkWidget *frame_type_select;
 	GSList *radio_group;
 	GtkWidget *radio_btn_type_mail;
 	GtkWidget *radio_btn_type_calendar;
 	GtkWidget *radio_btn_type_memos;
 	GtkWidget *radio_btn_type_tasks;
 	GtkWidget *radio_btn_type_contacts;
+	/* sub-widgets of container - folder options */
+	GtkWidget *frame_options;
+	GtkWidget *chk_btn_show_all;
 };
 
 typedef struct _KolabFolderMetaUIData KolabFolderMetaUIData;
 struct _KolabFolderMetaUIData {
+	EShellView *shell_view;
+	EAlertBar *alert_bar;
 	KolabFolderMetaUIWidgets *widgets;
 	KolabDataFolderMetadata *metadata;
-	gchar *selected_folder;
-	gchar *selected_source;
+	gchar *foldername;
+	gchar *sourcename;
 };
 
 /*----------------------------------------------------------------------------*/



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