aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Pavel <jpavel@src.gnome.org>2000-11-07 07:10:42 +0800
committerJesse Pavel <jpavel@src.gnome.org>2000-11-07 07:10:42 +0800
commite3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec (patch)
tree27624c758032b88e835bf2b76a5166a81b1618ed
parent304ec439aef185a16c52ac1e22b9d6e723845ad2 (diff)
downloadgsoc2013-evolution-e3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec.tar
gsoc2013-evolution-e3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec.tar.gz
gsoc2013-evolution-e3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec.tar.bz2
gsoc2013-evolution-e3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec.tar.lz
gsoc2013-evolution-e3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec.tar.xz
gsoc2013-evolution-e3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec.tar.zst
gsoc2013-evolution-e3e5b0a37cf90b6c7b04f9bd1266ea515cbe25ec.zip
*gui/e-itip-control.c, gui/e-itip-control.glade: changed to GUI to
accomodate dynamically generated buttons, which will be tailored to the type of iTip message that is incoming. *gui/e-meeting-dialog.glade gui/e-meeting-edit.c: added a new button to publish events, in addition to requesting meetings. svn path=/trunk/; revision=6463
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/e-itip-control.c85
-rw-r--r--calendar/gui/e-itip-control.glade129
-rw-r--r--calendar/gui/e-meeting-dialog.glade22
-rw-r--r--calendar/gui/e-meeting-edit.c68
5 files changed, 256 insertions, 57 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 426ee0b488..a7616b3728 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,12 @@
+2000-11-06 Jesse Pavel <jpavel@helixcode.com>
+
+ *gui/e-itip-control.c, gui/e-itip-control.glade: changed to GUI to
+ accomodate dynamically generated buttons, which will be tailored to
+ the type of iTip message that is incoming.
+
+ *gui/e-meeting-dialog.glade gui/e-meeting-edit.c: added a new button
+ to publish events, in addition to requesting meetings.
+
2000-11-05 Federico Mena Quintero <federico@helixcode.com>
* gui/event-editor-dialog.glade: Removed the old recurrence page.
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 193667b9b7..b017678be3 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -22,26 +22,31 @@
#define DEFAULT_WIDTH 500
-#define DEFAULT_HEIGHT 400
+#define DEFAULT_HEIGHT 300
extern gchar *evolution_dir;
typedef struct _EItipControlPrivate EItipControlPrivate;
struct _EItipControlPrivate {
- GladeXML *xml;
+ GladeXML *xml, *xml2;
GtkWidget *main_frame;
GtkWidget *text_box;
GtkWidget *organizer_entry, *dtstart_label, *dtend_label;
- GtkWidget *summary_entry, *description_box;
+ GtkWidget *summary_entry, *description_box, *type_entry;
+ GtkWidget *address_entry;
GtkWidget *add_button;
GtkWidget *loading_window;
GtkWidget *loading_progress;
icalcomponent *main_comp, *comp;
CalComponent *cal_comp;
+ gchar *from_address;
};
+enum E_ITIP_BONOBO_ARGS {
+ FROM_ADDRESS_ARG_ID
+};
#if 0
static icalparameter *
@@ -64,6 +69,8 @@ itip_control_destroy_cb (GtkObject *object,
EItipControlPrivate *priv = data;
gtk_object_unref (GTK_OBJECT (priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml2));
+
if (priv->main_comp != NULL) {
icalcomponent_free (priv->main_comp);
}
@@ -71,6 +78,10 @@ itip_control_destroy_cb (GtkObject *object,
if (priv->cal_comp != NULL) {
gtk_object_unref (GTK_OBJECT (priv->cal_comp));
}
+
+ if (priv->from_address != NULL)
+ g_free (priv->from_address);
+
g_free (priv);
}
@@ -338,6 +349,19 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
gtk_label_set_text (GTK_LABEL (priv->dtstart_label), ctime (&tstart));
gtk_label_set_text (GTK_LABEL (priv->dtend_label), ctime (&tend));
+
+ prop = icalcomponent_get_first_property (priv->main_comp, ICAL_METHOD_PROPERTY);
+ switch (icalproperty_get_method (prop)) {
+ case ICAL_METHOD_PUBLISH:
+ gtk_entry_set_text (GTK_ENTRY (priv->type_entry), "Published information");
+ break;
+ case ICAL_METHOD_REQUEST:
+ gtk_entry_set_text (GTK_ENTRY (priv->type_entry), "Meeting Request");
+ break;
+ default:
+ gtk_entry_set_text (GTK_ENTRY (priv->type_entry), "Unknown");
+ }
+
}
pos = 0;
@@ -404,10 +428,41 @@ pstream_get_content_types (BonoboPersistStream *ps, void *closure,
return bonobo_persist_generate_content_types (2, "text/calendar", "text/x-calendar");
}
+static void
+get_prop ( BonoboPropertyBag *bag, BonoboArg *arg,
+ guint arg_id, gpointer user_data )
+{
+ EItipControlPrivate *priv = user_data;
+
+ BONOBO_ARG_SET_STRING (arg, priv->from_address);
+}
+
+static void
+set_prop ( BonoboPropertyBag *bag, const BonoboArg *arg,
+ guint arg_id, gpointer user_data )
+{
+ EItipControlPrivate *priv = user_data;
+
+ if (arg_id == FROM_ADDRESS_ARG_ID) {
+ if (priv->from_address)
+ g_free (priv->from_address);
+
+
+ priv->from_address = g_strdup (BONOBO_ARG_GET_STRING (arg));
+
+ /* Let's set the widget here, though I'm not sure if
+ it will work. */
+ gtk_entry_set_text (GTK_ENTRY (priv->address_entry), priv->from_address);
+
+ }
+}
+
+
static BonoboObject *
e_itip_control_factory (BonoboGenericFactory *Factory, void *closure)
{
BonoboControl *control;
+ BonoboPropertyBag *prop_bag;
BonoboPersistStream *stream;
EItipControlPrivate *priv;
@@ -423,9 +478,12 @@ e_itip_control_factory (BonoboGenericFactory *Factory, void *closure)
priv->dtend_label = glade_xml_get_widget (priv->xml, "dtend_label");
priv->summary_entry = glade_xml_get_widget (priv->xml, "summary_entry");
priv->description_box = glade_xml_get_widget (priv->xml, "description_box");
- priv->add_button = glade_xml_get_widget (priv->xml, "add_button");
- priv->loading_progress = glade_xml_get_widget (priv->xml, "loading_progress");
- priv->loading_window = glade_xml_get_widget (priv->xml, "loading_window");
+ /* priv->add_button = glade_xml_get_widget (priv->xml, "add_button"); */
+ priv->address_entry = glade_xml_get_widget (priv->xml, "address_entry");
+
+ priv->xml2 = glade_xml_new (EVOLUTION_GLADEDIR "/" "e-itip-control.glade", "loading_window");
+ priv->loading_progress = glade_xml_get_widget (priv->xml2, "loading_progress");
+ priv->loading_window = glade_xml_get_widget (priv->xml2, "loading_window");
gtk_text_set_editable (GTK_TEXT (priv->text_box), FALSE);
@@ -433,14 +491,25 @@ e_itip_control_factory (BonoboGenericFactory *Factory, void *closure)
GTK_SIGNAL_FUNC (itip_control_destroy_cb), priv);
gtk_signal_connect (GTK_OBJECT (priv->main_frame), "size_request",
GTK_SIGNAL_FUNC (itip_control_size_request_cb), priv);
- gtk_signal_connect (GTK_OBJECT (priv->add_button), "clicked",
- GTK_SIGNAL_FUNC (add_button_clicked_cb), priv);
+ /********
+ * gtk_signal_connect (GTK_OBJECT (priv->add_button), "clicked",
+ * GTK_SIGNAL_FUNC (add_button_clicked_cb), priv);
+ ********/
gtk_widget_show (priv->text_box);
gtk_widget_show (priv->main_frame);
control = bonobo_control_new (priv->main_frame);
+ /* create a property bag */
+ prop_bag = bonobo_property_bag_new ( get_prop, set_prop, priv );
+ bonobo_control_set_properties (control, prop_bag);
+
+ bonobo_property_bag_add (prop_bag, "from_address", FROM_ADDRESS_ARG_ID, BONOBO_ARG_STRING, NULL,
+ "from_address", 0 );
+
+ bonobo_control_set_automerge (control, TRUE);
+
stream = bonobo_persist_stream_new (pstream_load, pstream_save,
pstream_get_max_size,
pstream_get_content_types,
diff --git a/calendar/gui/e-itip-control.glade b/calendar/gui/e-itip-control.glade
index e17d20190e..2eeb7cc63e 100644
--- a/calendar/gui/e-itip-control.glade
+++ b/calendar/gui/e-itip-control.glade
@@ -28,6 +28,7 @@
<class>GtkFrame</class>
<name>main_frame</name>
<border_width>4</border_width>
+ <height>231</height>
<label>Test iTip control</label>
<label_xalign>0.11</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@@ -54,7 +55,7 @@
<widget>
<class>GtkTable</class>
<name>table1</name>
- <rows>4</rows>
+ <rows>6</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
@@ -328,11 +329,112 @@
</widget>
</widget>
</widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label11</name>
+ <label>Sender</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>4</top_attach>
+ <bottom_attach>5</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>address_entry</name>
+ <can_focus>True</can_focus>
+ <editable>False</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>4</top_attach>
+ <bottom_attach>5</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label12</name>
+ <label>Type</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>5</top_attach>
+ <bottom_attach>6</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>type_entry</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>5</top_attach>
+ <bottom_attach>6</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
</widget>
<widget>
<class>GtkHButtonBox</class>
- <name>hbuttonbox1</name>
+ <name>button_box</name>
+ <height>35</height>
<layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
@@ -344,27 +446,6 @@
<expand>True</expand>
<fill>True</fill>
</child>
-
- <widget>
- <class>GtkButton</class>
- <name>add_button</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <label>Add to Calendar</label>
- </widget>
- </widget>
-
- <widget>
- <class>GtkText</class>
- <name>text_box</name>
- <can_focus>True</can_focus>
- <editable>False</editable>
- <text></text>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
</widget>
</widget>
</widget>
@@ -430,7 +511,7 @@
<widget>
<class>GtkProgressBar</class>
- <name>progressbar1</name>
+ <name>loading_progress</name>
<value>0</value>
<lower>0</lower>
<upper>100</upper>
diff --git a/calendar/gui/e-meeting-dialog.glade b/calendar/gui/e-meeting-dialog.glade
index 96e6707013..5b9a057f46 100644
--- a/calendar/gui/e-meeting-dialog.glade
+++ b/calendar/gui/e-meeting-dialog.glade
@@ -50,9 +50,9 @@
<widget>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
- <name>send_button</name>
- <label>Send
-Updates</label>
+ <name>publish_button</name>
+ <label>Publish
+Event</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_MAIL_SND</stock_pixmap>
</widget>
@@ -66,6 +66,22 @@ Updates</label>
<widget>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
+ <name>request_button</name>
+ <label>Request
+Meeting</label>
+ <stock_pixmap>GNOME_STOCK_PIXMAP_REFRESH</stock_pixmap>
+ </widget>
+
+ <widget>
+ <class>GtkVSeparator</class>
+ <name>vseparator3</name>
+ <width>13</width>
+ <height>58</height>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <child_name>Toolbar:button</child_name>
<name>cancel_button</name>
<label>Cancel
Meeting</label>
diff --git a/calendar/gui/e-meeting-edit.c b/calendar/gui/e-meeting-edit.c
index 107dfc66a3..142e916997 100644
--- a/calendar/gui/e-meeting-edit.c
+++ b/calendar/gui/e-meeting-edit.c
@@ -44,7 +44,7 @@ struct _EMeetingEditorPrivate {
GtkWidget *organizer_entry;
GtkWidget *role_entry;
GtkWidget *rsvp_check;
- GtkWidget *send_button, *schedule_button;
+ GtkWidget *publish_button, *request_button, *schedule_button;
gint changed_signal_id;
@@ -500,21 +500,20 @@ schedule_button_clicked_cb (GtkWidget *widget, gpointer data)
static gchar *itip_methods[] = {
- "REQUEST"
+ "REQUEST",
+ "PUBLISH"
};
enum itip_method_enum {
- METHOD_REQUEST
+ METHOD_REQUEST,
+ METHOD_PUBLISH
};
-/********
- * This routine is called when the send button is clicked. Duh.
- * Actually, I'm just testing my commenting macros.
- ********/
+typedef enum itip_method_enum itip_method_enum;
+
static void
-send_button_clicked_cb (GtkWidget *widget, gpointer data)
+send_calendar_info (itip_method_enum method, EMeetingEditorPrivate *priv)
{
- EMeetingEditorPrivate *priv;
BonoboObjectClient *bonobo_server;
Evolution_Composer composer_server;
CORBA_Environment ev;
@@ -529,13 +528,7 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data)
CORBA_boolean show_inline;
CORBA_char tempstr[200];
-
- /********
- * CODE
- ********/
-
- priv = (EMeetingEditorPrivate *) ((EMeetingEditor *)data)->priv;
-
+
CORBA_exception_init (&ev);
/* First, I obtain an object reference that represents the Composer. */
@@ -581,7 +574,7 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data)
return;
}
- sprintf (tempstr, "text/calendar;METHOD=%s", itip_methods[METHOD_REQUEST]);
+ sprintf (tempstr, "text/calendar;METHOD=%s", itip_methods[method]);
content_type = CORBA_string_alloc (strlen (tempstr));
strcpy (content_type, tempstr);
filename = CORBA_string_alloc (0);
@@ -614,7 +607,7 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data)
icalcomponent_add_property (comp, prop);
prop = icalproperty_new (ICAL_METHOD_PROPERTY);
- value = icalvalue_new_text ("REQUEST");
+ value = icalvalue_new_text (itip_methods[method]);
icalproperty_set_value (prop, value);
icalcomponent_add_property (comp, prop);
@@ -691,7 +684,35 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data)
/* bonobo_object_unref (BONOBO_OBJECT (bonobo_server)); */
}
-
+/********
+ * This routine is called when the publish button is clicked. Duh.
+ * Actually, I'm just testing my commenting macros.
+ ********/
+static void
+publish_button_clicked_cb (GtkWidget *widget, gpointer data)
+{
+ EMeetingEditorPrivate *priv;
+
+
+ priv = (EMeetingEditorPrivate *) ((EMeetingEditor *)data)->priv;
+
+ send_calendar_info (METHOD_PUBLISH, priv);
+
+}
+
+static void
+request_button_clicked_cb (GtkWidget *widget, gpointer data)
+{
+ EMeetingEditorPrivate *priv;
+
+ priv = (EMeetingEditorPrivate *) ((EMeetingEditor *)data)->priv;
+
+ send_calendar_info (METHOD_REQUEST, priv);
+
+}
+
+
+
static void
add_button_clicked_cb (GtkWidget *widget, gpointer data)
{
@@ -900,7 +921,8 @@ e_meeting_edit (EMeetingEditor *editor)
priv->role_entry = glade_xml_get_widget (priv->xml, "role_entry");
priv->rsvp_check = glade_xml_get_widget (priv->xml, "rsvp_check");
priv->schedule_button = glade_xml_get_widget (priv->xml, "schedule_button");
- priv->send_button = glade_xml_get_widget (priv->xml, "send_button");
+ priv->publish_button = glade_xml_get_widget (priv->xml, "publish_button");
+ priv->request_button = glade_xml_get_widget (priv->xml, "request_button");
gtk_clist_set_column_justification (GTK_CLIST (priv->attendee_list), ROLE_COL, GTK_JUSTIFY_CENTER);
gtk_clist_set_column_justification (GTK_CLIST (priv->attendee_list), RSVP_COL, GTK_JUSTIFY_CENTER);
@@ -921,9 +943,11 @@ e_meeting_edit (EMeetingEditor *editor)
gtk_signal_connect (GTK_OBJECT (priv->schedule_button), "clicked",
GTK_SIGNAL_FUNC (schedule_button_clicked_cb), editor);
- gtk_signal_connect (GTK_OBJECT (priv->send_button), "clicked",
- GTK_SIGNAL_FUNC (send_button_clicked_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->publish_button), "clicked",
+ GTK_SIGNAL_FUNC (publish_button_clicked_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->request_button), "clicked",
+ GTK_SIGNAL_FUNC (request_button_clicked_cb), editor);
add_button = glade_xml_get_widget (priv->xml, "add_button");
delete_button = glade_xml_get_widget (priv->xml, "delete_button");