aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/shared-folder/Makefile.am23
-rw-r--r--plugins/shared-folder/org-gnome-shared-folder.eplug.in48
-rw-r--r--plugins/shared-folder/properties.glade848
-rw-r--r--plugins/shared-folder/share-folder-common.c134
-rw-r--r--plugins/shared-folder/share-folder.c719
-rw-r--r--plugins/shared-folder/share-folder.h128
6 files changed, 1900 insertions, 0 deletions
diff --git a/plugins/shared-folder/Makefile.am b/plugins/shared-folder/Makefile.am
new file mode 100644
index 0000000000..58db34f810
--- /dev/null
+++ b/plugins/shared-folder/Makefile.am
@@ -0,0 +1,23 @@
+INCLUDES = \
+ -I$(top_srcdir)\
+ -I$(top_srcdir)/camel \
+ $(EVOLUTION_MAIL_CFLAGS)\
+ $(CAMEL_GROUPWISE_CFLAGS)\
+ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\"
+
+@EVO_PLUGIN_RULE@
+
+plugin_DATA = org-gnome-shared-folder.eplug
+plugin_LTLIBRARIES = liborg-gnome-shared-folder.la
+
+liborg_gnome_shared_folder_la_SOURCES = share-folder-common.c share-folder.c share-folder.h
+liborg_gnome_shared_folder_la_LIBADD= $(prefix)/lib/libegroupwise-1.2.la
+
+
+liborg_gnome_shared_folder_la_LDFLAGS = -module -avoid-version
+
+ glade_DATA =properties.glade
+
+
+
+EXTRA_DIST =$(glade_DATA)
diff --git a/plugins/shared-folder/org-gnome-shared-folder.eplug.in b/plugins/shared-folder/org-gnome-shared-folder.eplug.in
new file mode 100644
index 0000000000..2f0d9519ea
--- /dev/null
+++ b/plugins/shared-folder/org-gnome-shared-folder.eplug.in
@@ -0,0 +1,48 @@
+<e-plugin-list>
+ <e-plugin id="org.gnome.evolution.mail_shared_folder" type="shlib" name="Shared folder" description="shared folder properties "
+ location="@PLUGINDIR@/liborg-gnome-shared-folder.so">
+
+ <hook class="org.gnome.evolution.mail.config:1.0">
+ <group
+ id="org.gnome.evolution.mail.folderConfig"
+ target="folder"
+ check="shared_folder_validate"
+ commit="shared_folder_commit"
+ abort="shared_folder_abort">
+ <item type="page" path="10.shared" label="_Shared" factory="org_gnome_shared_folder_factory"/>
+ </group>
+ </hook>
+ </e-plugin>
+
+ <e-plugin id="org.gnome.mail.folder.share_option"
+ type="shlib" domain="evolution" name="SHARE Folders"
+ location="@PLUGINDIR@/liborg-gnome-shared-folder.so">
+ <description>Allows sharing folders in the folder tree context menu</description>
+ <author name="Jeffrey Stedfast" email="fejj@novell.com"/>
+ <hook class="org.gnome.evolution.mail.popup:1.0">
+ <menu id="org.gnome.evolution.mail.foldertree.popup" target="folder">
+ <item type="item" path="20.emc.03" label="_Share"
+ activate="org_gnome_shared_option"
+ enable="delete" visible="delete"/>
+ </menu>
+ </hook>
+ </e-plugin>
+
+ <e-plugin id="org.gnome.mail.folder.create_option"
+ type="shlib" domain="evolution" name="CREATE Folders"
+ location="@PLUGINDIR@/liborg-gnome-shared-folder.so">
+ <description>Allows sharing folders in the folder tree context menu</description>
+ <author name="Jeffrey Stedfast" email="fejj@novell.com"/>
+ <hook class="org.gnome.evolution.mail.popup:1.0">
+ <menu id="org.gnome.evolution.mail.foldertree.popup" target="folder">
+ <item type="item" path="20.emc.00" label="_Create New"
+ activate="org_gnome_create_option"
+ enable="delete" visible="delete"/>
+ </menu>
+ </hook>
+ </e-plugin>
+
+
+
+
+</e-plugin-list>
diff --git a/plugins/shared-folder/properties.glade b/plugins/shared-folder/properties.glade
new file mode 100644
index 0000000000..10a1c543f4
--- /dev/null
+++ b/plugins/shared-folder/properties.glade
@@ -0,0 +1,848 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+<requires lib="gnome"/>
+
+<widget class="GtkWindow" id="main_page">
+ <property name="title" translatable="yes">Folder Properties</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+
+ <child>
+ <widget class="GtkNotebook" id="sharing_props">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_tabs">True</property>
+ <property name="show_border">True</property>
+ <property name="tab_pos">GTK_POS_TOP</property>
+ <property name="scrollable">False</property>
+ <property name="enable_popup">False</property>
+
+ <child>
+ <widget class="GtkVBox" id="vboxSharing">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkVBox" id="vboxSharingOptions">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox186">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="label539">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox190">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkRadioButton" id="radNotShared">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Not Shared</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkRadioButton" id="radShared">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Shared With ...</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radNotShared</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkTable" id="table26">
+ <property name="visible">True</property>
+ <property name="n_rows">6</property>
+ <property name="n_columns">3</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="Name">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Name:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="entry2">
+ <property name="width_request">257</property>
+ <property name="height_request">32</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">850</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_padding">8</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="Address">
+ <property name="height_request">38</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Address Book</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="Remove">
+ <property name="height_request">38</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox226">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-remove</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label557">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Remove</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="ShareList">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">
+Share List</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="Add">
+ <property name="height_request">38</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox225">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-add</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label556">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Add</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_padding">12</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="height_request">137</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_padding">6</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.52</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox221">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Ad_d</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">30</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Edi_t</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">30</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Delet_e</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">30</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label550">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Additional Access</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_padding">58</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox227">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label558">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.52</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">32</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="Notification">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Sen_d Custom Notification</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="lblSharing">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Sharing</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+<widget class="GtkWindow" id="window1">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Shared Folder Notification</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_CENTER</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox191">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="label551">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">The participants will receive the following notification.
+</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.66</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">1</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox223">
+ <property name="height_request">309</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox193">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkLabel" id="label553">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Subject</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="entry3">
+ <property name="width_request">158</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="padding">6</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label554">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Message</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTextView" id="textview1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="overwrite">False</property>
+ <property name="accepts_tab">True</property>
+ <property name="justification">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap_mode">GTK_WRAP_NONE</property>
+ <property name="cursor_visible">True</property>
+ <property name="pixels_above_lines">0</property>
+ <property name="pixels_below_lines">0</property>
+ <property name="pixels_inside_wrap">0</property>
+ <property name="left_margin">0</property>
+ <property name="right_margin">0</property>
+ <property name="indent">0</property>
+ <property name="text" translatable="yes"></property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox224">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label555">
+ <property name="width_request">248</property>
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.52</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkButton" id="nCancel">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="on_nCancel_clicked" last_modification_time="Tue, 23 Nov 2004 10:56:42 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="nOK">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="on_nOK_clicked" last_modification_time="Tue, 23 Nov 2004 10:57:50 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">42</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
diff --git a/plugins/shared-folder/share-folder-common.c b/plugins/shared-folder/share-folder-common.c
new file mode 100644
index 0000000000..6bee9cef20
--- /dev/null
+++ b/plugins/shared-folder/share-folder-common.c
@@ -0,0 +1,134 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Authors: Vivek Jain <jvivek@novell.com>
+ *
+ * Copyright 2004 Novell, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-widget.h>
+#include <bonobo/bonobo-exception.h>
+#include <bonobo/bonobo-ui-component.h>
+#include <addressbook/util/e-destination.h>
+
+#include <string.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <libgnome/gnome-i18n.h>
+#include <gconf/gconf-client.h>
+#include <e-util/e-config.h>
+#include <mail/em-config.h>
+#include <mail/em-popup.h>
+#include <mail/em-folder-properties.h>
+#include <mail/em-folder-tree.h>
+#include <mail/em-folder-selector.h>
+#include <camel/providers/groupwise/camel-groupwise-store.h>
+#include <camel/providers/groupwise/camel-groupwise-folder.h>
+#include <e-gw-container.h>
+#include <e-gw-connection.h>
+#include <glade/glade.h>
+#include "share-folder.h"
+#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
+
+typedef CORBA_Object GNOME_Evolution_Addressbook_SelectNames;
+ShareFolder *common = NULL;
+
+
+
+void
+shared_folder_check (EPlugin *ep, EConfigTarget *target)
+{
+ printf ("check **********\n");
+}
+
+
+
+void
+shared_folder_commit (EPlugin *ep, EConfigTarget *target)
+{
+
+ gchar *mesg = "Folder shared to you";
+ gchar *sub = "Shared folder notification";
+ ShareFolder *sf;
+ gchar *check = NULL;
+ if(common)
+ share_folder (common);
+ g_object_run_dispose(common);
+
+ printf ("commit **********\n");
+}
+
+
+void
+shared_folder_abort (EPlugin *ep, EConfigTarget *target)
+{
+ printf ("aborttttttt**********\n");
+}
+
+
+
+
+
+
+
+
+GtkWidget *
+org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
+{
+
+ gchar *folderuri = NULL;
+ gchar *account = NULL;
+ gchar *id = NULL;
+ gchar *sub = NULL;
+ EGwConnection *cnc;
+ ShareFolder *sharing_tab;
+ EMConfigTargetPrefs *target1 = (EMConfigTargetPrefs *) hook_data->config->target;
+ EMConfigTargetFolder *target2= (EMConfigTargetFolder *)hook_data->config->target;
+ folderuri=g_strdup(target2->uri);
+ account = g_strrstr(folderuri, "groupwise");
+ if(account)
+ {
+ sub = g_strrstr(folderuri, "#");
+ if(sub == NULL)
+ sub = g_strrstr(folderuri, "/");
+ sub++;
+ g_print("\n\nTHE URI OF THE FOLDER%s\n\n %s\n\n",target2->uri,sub);
+ CamelFolder *folder = target2->folder ;
+ CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder) ;
+ CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store) ;
+ CamelGroupwiseStorePrivate *priv = gw_store->priv ;
+
+ id = g_strdup (container_id_lookup(priv,sub));
+ cnc = cnc_lookup (priv);
+ g_free (sub);
+ g_free (folderuri);
+
+ sharing_tab = share_folder_new (cnc, id);
+ gtk_notebook_append_page((GtkNotebook *) hook_data->parent, sharing_tab->vbox, gtk_label_new_with_mnemonic N_("Sharing"));
+ common = sharing_tab;
+
+
+ return sharing_tab;
+ } else
+ return NULL;
+
+
+}
+
diff --git a/plugins/shared-folder/share-folder.c b/plugins/shared-folder/share-folder.c
new file mode 100644
index 0000000000..771658447b
--- /dev/null
+++ b/plugins/shared-folder/share-folder.c
@@ -0,0 +1,719 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <glade/glade.h>
+#include "share-folder.h"
+#include <glib/gmain.h>
+#include <gtk/gtktreemodel.h>
+#include <gtk/gtkliststore.h>
+#include <gtk/gtktreeselection.h>
+#include <gtk/gtktreeview.h>
+#include <gtk/gtkdialog.h>
+#include <gtk/gtkbutton.h>
+#include <gtk/gtk.h>
+#include <gtk/gtktogglebutton.h>
+#include <gtk/gtkcellrenderertoggle.h>
+#include <gtk/gtkcellrenderertext.h>
+
+#include <libgnome/gnome-init.h>
+#include <e-gw-container.h>
+#include <e-gw-connection.h>
+
+#define ROOTNODE "vboxSharing"
+
+
+
+#define d(x)
+
+static void share_folder_class_init (ShareFolderClass *class);
+static void share_folder_init (ShareFolder *sf);
+static void share_folder_destroy (GtkObject *obj);
+static void share_folder_finalise (GObject *obj);
+
+static void free_node(EShUsers *user);
+static void free_all(ShareFolder *sf);
+
+
+static GtkVBoxClass *parent_class = NULL;
+
+
+GType
+share_folder_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type) {
+ static const GTypeInfo info = {
+ sizeof (ShareFolderClass),
+ NULL, NULL,
+ (GClassInitFunc) share_folder_class_init,
+ NULL, NULL,
+ sizeof (ShareFolder),
+ 0,
+ (GInstanceInitFunc) share_folder_init,
+ };
+
+ type = g_type_register_static (gtk_vbox_get_type (), "ShareFolder", &info, 0);
+ }
+
+ return type;
+}
+
+static void
+share_folder_class_init (ShareFolderClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_ref (gtk_vbox_get_type ());
+
+ object_class->destroy = share_folder_destroy;
+ gobject_class->finalize = share_folder_finalise;
+}
+
+static void
+share_folder_finalise (GObject *obj)
+{
+ ShareFolder *sf = (ShareFolder *) obj;
+ g_object_unref (sf->xml);
+ free_all(sf);
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
+}
+
+static void
+share_folder_destroy (GtkObject *obj)
+{
+
+ ShareFolder *sf = (ShareFolder *) obj;
+ free_all(sf);
+ GTK_OBJECT_CLASS (parent_class)->destroy (obj);
+}
+
+static void
+share_folder_init (ShareFolder *sf)
+{
+ sf->gcontainer = NULL;
+ sf->users = 0;
+ sf->duplicate = -1;
+ sf->flag_for_ok = 0;
+ sf->shared = FALSE;
+ sf->container_list = NULL;
+ sf->new_list = NULL;
+ sf->update_list = NULL;
+ sf->remove_list = NULL;
+ sf->sub = "Shared Folder notification";
+ sf->message = NULL;
+
+}
+
+
+static void
+free_node(EShUsers *user)
+{
+ if(user){
+ g_free(user->email);
+ user->email = NULL;
+ }
+ return ;
+
+}
+
+
+static int
+find_node(GList *list, gchar *email)
+{
+
+ EShUsers *user = NULL;
+ GList *tmp;
+ gint i ;
+ gint duplicate = -1;
+ if(list){
+ tmp = g_list_first(list);
+ for(i=0; tmp ; i++)
+ {
+ user= g_list_nth_data(tmp, 0);
+ if(!strcmp(user->email, email)){
+ duplicate = i;
+ break;
+ }
+ tmp= g_list_next(tmp);
+ }
+
+ }
+ return duplicate;
+}
+
+static void
+free_all(ShareFolder *sf)
+{
+ if(sf->new_list){
+ g_list_foreach (sf->new_list, free_node, NULL);
+ g_list_free (sf->new_list);
+ }
+ if(sf->update_list){
+ g_list_foreach (sf->update_list, free_node, NULL);
+ g_list_free (sf->update_list);
+ }
+
+ sf->new_list = NULL;
+
+
+ e_gw_container_get_user_list (sf->gcontainer, &(sf->new_list));
+ if (sf->new_list) {
+ g_list_foreach (sf->new_list, free_node, NULL);
+ g_list_free (sf->new_list);
+ }
+ if (sf->remove_list) {
+ g_list_foreach (sf->remove_list, free_node, NULL);
+ g_list_free (sf->remove_list);
+ }
+
+ sf->new_list = NULL;
+ sf->update_list = NULL;
+ sf->remove_list = NULL;
+ e_gw_connection_free_container_list (sf->container_list);
+
+}
+
+
+static void
+update_list_update (ShareFolder *sf)
+{
+ gboolean add = FALSE;
+ gboolean edit = FALSE;
+ gboolean delete = FALSE;
+ GList *tmp = NULL;
+ EShUsers *user = NULL;
+ int rights = 0;
+ add = gtk_toggle_button_get_active(sf->add);
+ edit = gtk_toggle_button_get_active(sf->edit);
+ delete = gtk_toggle_button_get_active(sf->del);
+ if(add){
+ rights = rights|0x1;
+ }
+ if(edit){
+ rights = rights|0x2;
+ }
+ if(delete){
+ rights = rights|0x4;
+ }
+ if(sf->update_list){
+ tmp = g_list_last(sf->update_list);
+ user = g_list_nth_data(tmp, 0);
+ if(user){
+ if(user->rights != rights){
+ user->rights= rights;
+
+ }
+ else{
+ sf->update_list = g_list_remove(sf->update_list, user);
+ free_node(user);
+ if(g_list_length(sf->update_list) == 0)
+ sf->update_list = NULL;
+ }
+ }
+ }
+
+}
+
+
+static void
+display_container (EGwContainer *container , ShareFolder *sf)
+{
+ gint i;
+ gchar **tail;
+ gchar *id_shared;
+ gchar *id_unshared;
+ gboolean byme = FALSE;
+ gboolean tome = FALSE;
+
+ id_shared = e_gw_container_get_id(container);
+ if( g_str_has_suffix (id_shared, "35")){
+ tail = g_strsplit(id_shared, "@", 2);
+ id_unshared = g_strconcat(tail[0], "@", "13", NULL);
+ g_strfreev(tail);
+ }
+
+ if((!strcmp(id_unshared, sf->container_id)) ||(!strcmp(id_shared, sf->container_id)) ){
+ sf->gcontainer = container;
+ byme = e_gw_container_get_is_shared_by_me(container);
+ tome = e_gw_container_get_is_shared_to_me(container);
+ if(byme | tome) {
+
+ sf->users = e_gw_container_get_length (sf->gcontainer);
+
+ if(sf->users != 0){
+ sf->is_shared = TRUE;
+ gtk_toggle_button_set_active((GtkToggleButton *) sf->shared, TRUE);
+ shared_clicked(sf->shared , sf);
+ if(tome){
+ gtk_widget_set_sensitive (sf->table, FALSE);
+ gtk_widget_set_sensitive (sf->shared, FALSE);
+ gtk_widget_set_sensitive (sf->not_shared, FALSE);
+
+ }
+
+ gchar *email= NULL;
+ gchar *msg;
+ for(i = 0; i < sf->users; i++){
+
+ email = g_strdup (e_gw_container_get_email(container, i));
+ msg = g_strdup_printf ("%s", email);
+ gtk_list_store_append (GTK_LIST_STORE (sf->model), &(sf->iter));
+ gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 0, msg, -1);
+ g_free (msg);
+ g_free (email);
+ msg = NULL;
+ email = NULL;
+ g_print("\n");
+ }
+ /* i also need to display status*/
+ } else {
+
+ gtk_toggle_button_set_active ((GtkToggleButton *) sf->not_shared, TRUE);
+ not_shared_clicked (sf->not_shared , sf);
+ }
+ }
+
+
+ }
+
+}
+
+
+static void
+get_container_list (ShareFolder *sf)
+{
+ sf->container_list = NULL;
+ if (E_IS_GW_CONNECTION (sf->cnc)) {
+ /* get list of containers */
+ if (e_gw_connection_get_container_list (sf->cnc, "folders", &(sf->container_list)) == E_GW_CONNECTION_STATUS_OK) {
+ GList *container = NULL;
+
+ for (container = sf->container_list; container != NULL; container = container->next)
+ display_container (E_GW_CONTAINER (container->data), sf);
+
+ }
+ g_warning("Could not get the Container List");
+
+ }
+
+}
+
+
+
+static void
+user_selected(GtkTreeSelection *selection, ShareFolder *sf)
+{
+ EShUsers *user = NULL;
+ gint index = -1;
+ int rights = 0;
+ gchar *email = NULL;
+ int length=0;
+
+
+ /* This function should be called in the beginning of any probable subsequent event*/
+ update_list_update (sf);
+
+ gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
+ if (gtk_tree_selection_get_selected (selection, &(sf->model), &(sf->iter))){
+ gtk_widget_set_sensitive (sf->frame, TRUE);
+ gtk_widget_set_sensitive (sf->remove, TRUE);
+
+ gtk_toggle_button_set_active (sf->add, FALSE);
+ gtk_toggle_button_set_active (sf->del, FALSE);
+ gtk_toggle_button_set_active (sf->edit, FALSE);
+ gtk_tree_model_get (sf->model, &(sf->iter), 0, &email, -1);
+ index = (gint)g_ascii_strtod(gtk_tree_model_get_string_from_iter(sf->model, &(sf->iter)), NULL);
+
+ gtk_label_set_text (sf->user_rights, email);
+
+ sf->duplicate = find_node(sf->update_list, email);
+ if( sf->duplicate == -1){
+ if (sf->shared && index < sf->users){
+ rights = e_gw_container_get_rights (sf->gcontainer, email);
+ } else {
+ user = g_list_nth_data (sf->new_list, index - sf->users);
+ rights = user->rights;
+ }
+ } else {
+ user = g_list_nth_data (sf->update_list, sf->duplicate);
+ rights = user->rights;
+ sf->duplicate = -1;
+ }
+ if(rights & 0x1)
+ gtk_toggle_button_set_active (sf->add, TRUE);
+ if(rights & 0x2)
+ gtk_toggle_button_set_active (sf->edit, TRUE);
+ if(rights & 0x4)
+ gtk_toggle_button_set_active (sf->del, TRUE);
+
+
+ user = g_new0(EShUsers, 1);
+ user->email = g_strdup (email);
+ user->rights = rights;
+
+ if(sf->duplicate != -1) {
+ EShUsers *usr = NULL;
+ usr = g_list_nth_data (sf->update_list, sf->duplicate);
+ if(usr){
+ sf->update_list = g_list_remove (sf->update_list, usr);
+ free_node (usr);
+ }
+ sf->duplicate = -1;
+ }
+
+
+
+ sf->update_list = g_list_append (sf->update_list, user);
+ length = g_list_length (sf->update_list);
+ }
+ else {
+ gtk_widget_set_sensitive (sf->frame, FALSE);
+ gtk_widget_set_sensitive (sf->remove, FALSE);
+
+ }
+
+}
+
+
+
+
+
+
+
+static void
+shared_clicked (GtkRadioButton *button, ShareFolder *sf)
+{
+
+ gtk_widget_set_sensitive (sf->table ,TRUE);
+ sf->flag_for_ok = 0;
+
+}
+
+static void
+not_shared_clicked (GtkRadioButton *button, ShareFolder *sf)
+{
+ if (!sf->is_shared) {
+ sf->flag_for_ok = 0;
+ }else{
+ sf->flag_for_ok = 2;
+ }
+
+ gtk_widget_set_sensitive (sf->table, FALSE);
+
+}
+
+
+void
+add_clicked(GtkButton *button, ShareFolder *sf)
+{
+ static gchar *email = NULL;
+ EShUsers *user = NULL;
+ GList *list = NULL;
+ gint rights = 0;
+ gint length;
+ gchar *msg = NULL;
+ gboolean add,edit, delete;
+
+ email = gtk_entry_get_text (sf->name);
+ if (strcmp (email, "" )) {
+ update_list_update (sf);
+ user = g_new0 (EShUsers, 1);
+ user->email = g_strdup(email);
+ }else{
+ return;
+ }
+ /*check whether already exists*/
+ e_gw_container_get_user_list (sf->gcontainer, &list);
+
+ if(list && user->email){
+
+ sf->duplicate = find_node (list, user->email);
+ if (sf->duplicate != -1) {
+ sf->duplicate = -1;
+ return ;
+ }
+ }
+ if(sf->new_list && user->email){
+
+ sf->duplicate = find_node (sf->new_list, user->email);
+ if (sf->duplicate != -1) {
+ sf->duplicate = -1;
+ return ;
+ }
+ }
+
+ add = gtk_toggle_button_get_active (sf->add);
+ edit = gtk_toggle_button_get_active (sf->edit);
+ delete = gtk_toggle_button_get_active (sf->del);
+ if(add) {
+ rights = rights|0x1;
+ }
+ if(edit) {
+ rights = rights|0x2;
+ }
+ if(delete) {
+ rights = rights|0x4;
+ }
+
+
+ e_gw_container_set_rights (user, rights);
+ msg = g_strdup (user->email);
+ gtk_list_store_append (GTK_LIST_STORE (sf->model), &(sf->iter));
+ gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 0, msg, -1);
+
+ g_free(msg);
+ sf->new_list = g_list_append (sf->new_list, user);
+ length = g_list_length (sf->new_list);
+ g_print("\nlist length: %d\n\n\n",length);
+
+ sf->flag_for_ok = 0;
+ gtk_entry_set_text (sf->name, "");
+
+}
+
+
+static void
+remove_clicked(GtkButton *button, ShareFolder *sf)
+{
+
+ GList *list = NULL;
+ EShUsers *usr = NULL;
+ gchar *email;
+ gchar *removed_addr;
+
+ /*check whether this is required*/
+ gtk_tree_model_get (sf->model, &(sf->iter), 0, &email, -1);
+
+ list = g_list_last (sf->update_list);
+ usr = g_list_nth_data (list, 0);
+ sf->duplicate = find_node (sf->new_list, usr->email);
+ sf->update_list = g_list_remove (sf->update_list, usr);
+ if (sf->duplicate != -1) {
+ free_node (usr);
+ usr = g_list_nth_data (sf->new_list, sf->duplicate);
+ sf->new_list = g_list_remove (sf->new_list, usr);
+ free_node(usr);
+ sf->duplicate = -1;
+ } else {
+ sf->remove_list = g_list_append (sf->remove_list, usr);
+ }
+
+
+ g_free (email);
+ gtk_list_store_remove (GTK_LIST_STORE (sf->model), &(sf->iter));
+ sf->flag_for_ok = 1;
+}
+
+void
+share_folder (ShareFolder *sf)
+{
+
+ update_list_update (sf);
+
+ if (E_IS_GW_CONNECTION (sf->cnc)) {
+
+ if(sf->gcontainer){
+
+ if(sf->flag_for_ok == 2){ /* you have to remove all the users*/
+ GList *list = NULL;
+
+
+ if(sf->new_list){
+ g_list_foreach (sf->new_list, free_node, NULL);
+ g_list_free (sf->new_list);
+ }
+ if(sf->update_list){
+ g_list_foreach (sf->update_list, free_node, NULL);
+ g_list_free (sf->update_list);
+ }
+
+ sf->new_list = NULL;
+ if(sf->remove_list){
+ g_list_foreach (sf->remove_list, free_node, NULL);
+ g_list_free (sf->remove_list);
+ }
+ sf->remove_list = NULL;
+
+ e_gw_container_get_user_list (sf->gcontainer, &list);
+ sf->remove_list = g_list_copy (list);
+
+
+ } else {
+
+
+ if (sf->new_list) {
+ if (e_gw_connection_share_folder (sf->cnc, sf->gcontainer, sf->new_list, sf->sub, sf->mesg, 0) == E_GW_CONNECTION_STATUS_OK);
+ }
+
+ if (sf->update_list) {
+ if (e_gw_connection_share_folder (sf->cnc, sf->gcontainer, sf->update_list, sf->sub, sf->mesg, 2) == E_GW_CONNECTION_STATUS_OK);
+ }
+ }
+
+
+ if (sf->remove_list) {
+ if (e_gw_connection_share_folder (sf->cnc, sf->gcontainer, sf->remove_list, sf->sub, sf->mesg, 1) == E_GW_CONNECTION_STATUS_OK);
+ }
+ }
+ else
+ g_warning("Container is Null");
+
+ }
+
+}
+
+
+
+static void
+not_ok_clicked(GtkButton *button, ShareFolder *sf)
+{
+
+ gchar *subj = NULL;
+ gchar *msg = NULL;
+ GtkTextIter *start,*end;
+ GtkTextBuffer *buffer;
+
+ buffer=g_new0(GtkTextBuffer,1);
+ start = g_new0 (GtkTextIter, 1);
+ end = g_new0 (GtkTextIter, 1);
+ subj = g_strdup (gtk_entry_get_text (sf->subject));
+ if(subj)
+ sf->sub = subj;
+
+
+ buffer = gtk_text_view_get_buffer (sf->message);
+ gtk_text_buffer_get_start_iter (buffer, start);
+ gtk_text_buffer_get_end_iter (buffer, end);
+
+ msg = g_strdup(gtk_text_buffer_get_text (buffer, start, end, FALSE));
+ if(msg)
+ sf->mesg = msg;
+
+ gtk_widget_destroy(sf->window);
+
+
+}
+
+static void
+not_cancel_clicked(GtkButton *button, GtkWidget *window)
+{
+ gtk_widget_destroy(window);
+}
+
+
+static void
+notification_clicked(GtkButton *button, ShareFolder *sf)
+{
+
+ static GladeXML *xmln;
+ GtkWidget *not_ok;
+ GtkWidget *not_cancel;
+ int length = 0;
+
+ xmln = glade_xml_new (EVOLUTION_GLADEDIR "/properties.glade" ,"window1", NULL);
+ sf->window = GTK_WINDOW (glade_xml_get_widget (xmln, "window1"));
+ sf->subject = GTK_ENTRY (glade_xml_get_widget (xmln, "entry3"));
+ gtk_entry_set_text(sf->subject , sf->sub);
+
+ sf->message = GTK_TEXT_VIEW (glade_xml_get_widget (xmln, "textview1"));
+ not_ok = GTK_BUTTON (glade_xml_get_widget (xmln, "nOK"));
+ g_signal_connect ((gpointer) not_ok, "clicked", G_CALLBACK (not_ok_clicked), sf);
+ not_cancel = GTK_BUTTON (glade_xml_get_widget (xmln, "nCancel"));
+ g_signal_connect ((gpointer) not_cancel, "clicked", G_CALLBACK (not_cancel_clicked), sf->window);
+}
+
+static void
+share_folder_construct (ShareFolder *sf)
+{
+
+ GladeXML *xml;
+ xml = glade_xml_new (EVOLUTION_GLADEDIR "/properties.glade", ROOTNODE, NULL);
+ sf->xml =xml;
+
+ if(!sf->xml) {
+ g_warning("could not get xml");
+ }
+ /*checck abt this Parent?*/
+ sf->vbox = GTK_VBOX(glade_xml_get_widget(sf->xml, "vboxSharing"));
+
+
+ sf->table = GTK_TABLE (glade_xml_get_widget (sf->xml, "table26"));
+ if(!sf->table)
+ gtk_widget_set_sensitive (sf->table, FALSE);
+
+ sf->shared = GTK_RADIO_BUTTON (glade_xml_get_widget (sf->xml, "radShared"));
+ g_signal_connect ((gpointer) sf->shared, "clicked", G_CALLBACK (shared_clicked), sf);
+
+ sf->not_shared = GTK_RADIO_BUTTON (glade_xml_get_widget (sf->xml, "radNotShared"));
+ g_signal_connect ((gpointer) sf->not_shared, "clicked", G_CALLBACK (not_shared_clicked), sf);
+
+
+ sf->add_book = GTK_BUTTON (glade_xml_get_widget (sf->xml, "Address"));
+ gtk_widget_set_sensitive (sf->add_book, FALSE);
+
+ sf->add_button = GTK_BUTTON (glade_xml_get_widget(sf->xml, "Add"));
+ g_signal_connect((GtkWidget *) sf->add_button, "clicked", G_CALLBACK (add_clicked), sf);
+
+ sf->remove = GTK_BUTTON(glade_xml_get_widget(sf->xml, "Remove"));
+ g_signal_connect ((GtkWidget *) sf->remove, "clicked", G_CALLBACK (remove_clicked), sf);
+ gtk_widget_set_sensitive(sf->remove, FALSE);
+
+ sf->notification = GTK_BUTTON (glade_xml_get_widget (sf->xml, "Notification"));
+ g_signal_connect((GtkWidget *) sf->notification, "clicked", G_CALLBACK (notification_clicked), sf);
+
+
+ sf->name = GTK_ENTRY (glade_xml_get_widget (sf->xml, "entry2"));
+ /*TODO:connect name and label*/
+ gtk_widget_show(sf->name);
+
+ sf->frame = GTK_FRAME (glade_xml_get_widget(sf->xml, "frame1"));
+ gtk_widget_set_sensitive(sf->frame, FALSE);
+
+
+ sf->add = GTK_TOGGLE_BUTTON (glade_xml_get_widget (sf->xml, "checkbutton1"));
+
+ sf->del = GTK_TOGGLE_BUTTON (glade_xml_get_widget (sf->xml, "checkbutton2"));
+
+ sf->edit = GTK_TOGGLE_BUTTON (glade_xml_get_widget (sf->xml, "checkbutton3"));
+
+ sf->user_rights = GTK_LABEL (glade_xml_get_widget (sf->xml,"label550"));
+
+ sf->scrolledwindow = GTK_SCROLLED_WINDOW (glade_xml_get_widget (sf->xml,"scrolledwindow1"));
+
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sf->scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ sf->model = gtk_list_store_new (1, G_TYPE_STRING);
+ sf->user_list = gtk_tree_view_new ();
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sf->scrolledwindow), sf->user_list);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (sf->user_list), GTK_TREE_MODEL (sf->model));
+ gtk_widget_show (sf->user_list);
+
+
+ sf->cell = gtk_cell_renderer_text_new ();
+ sf->column = gtk_tree_view_column_new_with_attributes ("Users", sf->cell, "text", 0, NULL);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (sf->user_list),
+ GTK_TREE_VIEW_COLUMN (sf->column));
+
+ g_signal_connect(gtk_tree_view_get_selection(sf->user_list), "changed", G_CALLBACK (user_selected), sf);
+
+
+}
+
+
+
+ShareFolder *
+share_folder_new (gchar *ccnc, gchar *id)
+{
+ ShareFolder *new;
+ new = (ShareFolder *) g_object_new (share_folder_get_type (), NULL);
+ share_folder_construct (new);
+ new->cnc = ccnc;
+ new->container_id = id;
+ get_container_list(new);
+ return (GtkWidget *) new;
+
+}
+
+
diff --git a/plugins/shared-folder/share-folder.h b/plugins/shared-folder/share-folder.h
new file mode 100644
index 0000000000..dd21401335
--- /dev/null
+++ b/plugins/shared-folder/share-folder.h
@@ -0,0 +1,128 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Authors: Vivek Jain <jvivek@novell.com>
+ *
+ * Copyright 2002-2003 Ximian, Inc. (www.ximian.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+
+#ifndef __SHARE_FOLDER_H__
+#define __SHARE_FOLDER_H__
+
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
+
+#include <glib.h>
+#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
+#include <e-gw-connection.h>
+
+#define _SHARE_FOLDER_TYPE (share_folder_get_type ())
+#define SHARE_FOLDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SHARE_FOLDER, ShareFolder))
+#define SHARE_FOLDER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SHARE_FOLDER_TYPE, ShareFolder))
+#define IS_SHARE_FOLDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SHARE_FOLDER_TYPE))
+#define IS_SHARE_FOLDER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SHARE_FOLDER_TYPE))
+
+typedef struct _ShareFolder ShareFolder;
+typedef struct _ShareFolderClass ShareFolderClass;
+
+struct _GtkToggleButton;
+struct _GtkWidget;
+struct _GladeXML;
+struct _GtkButton;
+struct _GtkTreeView;
+struct _GtkLabel;
+struct _GtkEntry;
+struct _GtkWindow;
+struct _GtkRadioButton;
+struct _GtkListStore;
+struct _GtkCellRenderer;
+struct _GtkTreeViewColumn;
+struct _GtkFrame;
+struct _GtkVBox;
+
+struct _ShareFolder {
+ GtkVBox parent_object;
+
+ struct _GladeXML *xml;
+
+ /* General tab */
+
+ /* Default Behavior */
+ struct _GtkToggleButton *add;
+ struct _GtkToggleButton *edit;
+ struct _GtkToggleButton *del;
+
+ struct _GtkTreeView *user_list;
+ struct _GtkTextView *message;
+ struct _GtkButton *add_button;
+ struct _GtkButton *remove;
+ struct _GtkButton *add_book;
+ struct _GtkButton *notification;
+ struct _GtkLabel *user_rights;
+ struct _GtkEntry *name;
+ struct _GtkEntry *subject;
+ struct _GtkRadioButton *shared;
+ struct _GtkRadioButton *not_shared;
+ struct _GtkWidget *scrolledwindow;
+ struct _GtkWidget *table;
+ struct _GtkListStore *model;
+ struct _GtkCellRenderer *cell;
+ struct _GtkTreeViewColumn *column;
+ struct _GtkFrame *frame;
+ struct _GtkVBox *vbox;
+ struct _GtkWidget *window;
+
+ GList *new_list;
+ GList *update_list;
+ GList *remove_list;
+ EGwContainer *gcontainer;
+ gint users;
+ gboolean byme;
+ gboolean tome;
+ gint duplicate;
+ gint flag_for_ok;
+ gchar *email;
+ gboolean is_shared;
+ EGwConnection *cnc;
+ gchar *container_id;
+ gchar *sub;
+ gchar *mesg;
+ GList *container_list;
+ GtkTreeIter iter;
+};
+
+struct _ShareFolderClass {
+ GtkVBoxClass parent_class;
+
+
+};
+
+GType share_folderget_type (void);
+
+struct _ShareFolder * share_folder_new (gchar *ccnc, gchar *id);
+
+void share_folder(struct _ShareFolder *sf);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __EM_COMPOSER_PREFS_H__ */