aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog25
-rw-r--r--addressbook/backend/ebook/e-card-simple.c1
-rw-r--r--addressbook/backend/ebook/e-card-simple.h1
-rw-r--r--addressbook/backend/ebook/e-card.c24
-rw-r--r--addressbook/backend/ebook/e-card.h1
-rw-r--r--addressbook/gui/contact-editor/contact-editor.glade163
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c30
7 files changed, 232 insertions, 13 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 6f3f550b25..5f0f82be0c 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,4 +1,29 @@
2001-09-18 JP Rosevear <jpr@ximian.com>
+
+ * backend/ebook/e-card-simple.c (field_data): add caluri field data
+
+ * backend/ebook/e-card.c (e_card_get_vobject): add the caluri
+ property when appropriate
+ (parse_caluri): handle read caluri
+ (e_card_class_init): add caluri arg
+ (e_card_destroy): free the caluri
+ (e_card_get_arg): return caluri arg
+ (e_card_set_arg): set caluri from arg
+ (e_card_init): init caluri to null
+
+ * backend/ebook/e-card-simple.h: new simple field
+
+ * backend/ebook/e-card.h: new member
+
+ * gui/contact-editor/e-contact-editor.c (field_changed): util
+ callback to change the command state
+ (set_entry_changed_signal_field): hook up a change signal to above
+ (set_entry_changed_signals): use above function
+
+ * gui/contact-editor/e-contact-editor.glade: Add collaboration
+ page and fields
+
+2001-09-18 JP Rosevear <jpr@ximian.com>
* backend/pas/pas-backend-file.c
(pas_backend_file_build_cards_list): create a sexp and check if
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index 6f13356428..4cd558e5e2 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -94,6 +94,7 @@ static ECardSimpleFieldData field_data[] =
{ E_CARD_SIMPLE_FIELD_NICKNAME, "nickname", N_("Nickname"), N_("Nick"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
{ E_CARD_SIMPLE_FIELD_SPOUSE, "spouse", N_("Spouse"), N_("Spouse"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
{ E_CARD_SIMPLE_FIELD_NOTE, "note", N_("Note"), N_("Note"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
+ { E_CARD_SIMPLE_FIELD_CALURI, "caluri", N_("Calendar URI"), N_("CALUri"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
{ E_CARD_SIMPLE_FIELD_FBURL, "fburl", N_("Free-busy URL"), N_("FBUrl"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
{ E_CARD_SIMPLE_FIELD_ANNIVERSARY, "anniversary", N_("Anniversary"), N_("Anniv"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE },
{ E_CARD_SIMPLE_FIELD_BIRTH_DATE, "birth_date", N_("Birth Date"), "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE },
diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h
index 675695a7ea..1af3ecb606 100644
--- a/addressbook/backend/ebook/e-card-simple.h
+++ b/addressbook/backend/ebook/e-card-simple.h
@@ -115,6 +115,7 @@ enum _ECardSimpleField {
E_CARD_SIMPLE_FIELD_NICKNAME,
E_CARD_SIMPLE_FIELD_SPOUSE,
E_CARD_SIMPLE_FIELD_NOTE,
+ E_CARD_SIMPLE_FIELD_CALURI,
E_CARD_SIMPLE_FIELD_FBURL,
E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING = E_CARD_SIMPLE_FIELD_FBURL,
E_CARD_SIMPLE_FIELD_ANNIVERSARY,
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 59077ec035..835cc8195a 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -65,6 +65,7 @@ enum {
ARG_SPOUSE,
ARG_ANNIVERSARY,
ARG_MAILER,
+ ARG_CALURI,
ARG_FBURL,
ARG_NOTE,
ARG_RELATED_CONTACTS,
@@ -115,6 +116,7 @@ static void parse_nickname(ECard *card, VObject *object, char *default_charset);
static void parse_spouse(ECard *card, VObject *object, char *default_charset);
static void parse_anniversary(ECard *card, VObject *object, char *default_charset);
static void parse_mailer(ECard *card, VObject *object, char *default_charset);
+static void parse_caluri(ECard *card, VObject *object, char *default_charset);
static void parse_fburl(ECard *card, VObject *object, char *default_charset);
static void parse_note(ECard *card, VObject *object, char *default_charset);
static void parse_related_contacts(ECard *card, VObject *object, char *default_charset);
@@ -158,6 +160,7 @@ struct {
{ "X-EVOLUTION-SPOUSE", parse_spouse },
{ "X-EVOLUTION-ANNIVERSARY", parse_anniversary },
{ VCMailerProp, parse_mailer },
+ { "CALURI", parse_caluri },
{ "FBURL", parse_fburl },
{ VCNoteProp, parse_note },
{ XEV_RELATED_CONTACTS, parse_related_contacts },
@@ -550,6 +553,9 @@ e_card_get_vobject (ECard *card, gboolean assumeUTF8)
ADD_PROP_VALUE(vobj, VCMailerProp, card->mailer);
}
+ if (card->caluri)
+ addPropValue(vobj, "CALURI", card->caluri);
+
if (card->fburl)
ADD_PROP_VALUE(vobj, "FBURL", card->fburl);
@@ -978,6 +984,13 @@ parse_mailer(ECard *card, VObject *vobj, char *default_charset)
}
static void
+parse_caluri(ECard *card, VObject *vobj, char *default_charset)
+{
+ g_free(card->caluri);
+ assign_string(vobj, default_charset, &(card->caluri));
+}
+
+static void
parse_fburl(ECard *card, VObject *vobj, char *default_charset)
{
g_free(card->fburl);
@@ -1284,6 +1297,8 @@ e_card_class_init (ECardClass *klass)
GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_ANNIVERSARY);
gtk_object_add_arg_type ("ECard::mailer",
GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_MAILER);
+ gtk_object_add_arg_type ("ECard::caluri",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_CALURI);
gtk_object_add_arg_type ("ECard::fburl",
GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FBURL);
gtk_object_add_arg_type ("ECard::note",
@@ -1888,6 +1903,7 @@ e_card_destroy (GtkObject *object)
g_free(card->nickname);
g_free(card->spouse);
g_free(card->anniversary);
+ g_free(card->caluri);
g_free(card->fburl);
g_free(card->note);
g_free(card->related_contacts);
@@ -2028,6 +2044,10 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
g_free(card->mailer);
card->mailer = g_strdup(GTK_VALUE_STRING(*arg));
break;
+ case ARG_CALURI:
+ g_free(card->caluri);
+ card->caluri = g_strdup(GTK_VALUE_STRING(*arg));
+ break;
case ARG_FBURL:
g_free(card->fburl);
card->fburl = g_strdup(GTK_VALUE_STRING(*arg));
@@ -2190,6 +2210,9 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
case ARG_MAILER:
GTK_VALUE_STRING(*arg) = card->mailer;
break;
+ case ARG_CALURI:
+ GTK_VALUE_STRING(*arg) = card->caluri;
+ break;
case ARG_FBURL:
GTK_VALUE_STRING(*arg) = card->fburl;
break;
@@ -2264,6 +2287,7 @@ e_card_init (ECard *card)
card->spouse = NULL;
card->anniversary = NULL;
card->mailer = NULL;
+ card->caluri = NULL;
card->fburl = NULL;
card->note = NULL;
card->related_contacts = NULL;
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index c9ac994a0d..f1e35ce0a8 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -67,6 +67,7 @@ struct _ECard {
char *mailer; /* Mailer */
+ char *caluri; /* Calendar URI */
char *fburl; /* Free Busy URL */
gint timezone; /* number of minutes from UTC as an int */
diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade
index 88d74a2a77..575282b2d1 100644
--- a/addressbook/gui/contact-editor/contact-editor.glade
+++ b/addressbook/gui/contact-editor/contact-editor.glade
@@ -149,7 +149,6 @@
<border_width>2</border_width>
<can_focus>True</can_focus>
<label>_Add</label>
- <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
@@ -163,7 +162,6 @@
<border_width>2</border_width>
<can_focus>True</can_focus>
<label>_Delete</label>
- <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
@@ -494,7 +492,6 @@
<name>button-fullname</name>
<can_focus>True</can_focus>
<label>_Full Name...</label>
- <relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>1</left_attach>
<right_attach>3</right_attach>
@@ -536,7 +533,6 @@
<widget>
<class>GtkButton</class>
<name>button-email1</name>
- <relief>GTK_RELIEF_NORMAL</relief>
<widget>
<class>Placeholder</class>
@@ -569,7 +565,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone4</name>
- <relief>GTK_RELIEF_NORMAL</relief>
<widget>
<class>Placeholder</class>
@@ -602,7 +597,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone2</name>
- <relief>GTK_RELIEF_NORMAL</relief>
<widget>
<class>Placeholder</class>
@@ -635,7 +629,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone1</name>
- <relief>GTK_RELIEF_NORMAL</relief>
<widget>
<class>Placeholder</class>
@@ -687,7 +680,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone3</name>
- <relief>GTK_RELIEF_NORMAL</relief>
<widget>
<class>Placeholder</class>
@@ -948,7 +940,6 @@
<widget>
<class>GtkButton</class>
<name>button-address</name>
- <relief>GTK_RELIEF_NORMAL</relief>
<widget>
<class>Placeholder</class>
@@ -1245,7 +1236,6 @@
<name>button-contacts</name>
<can_focus>True</can_focus>
<label>_Contacts...</label>
- <relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
@@ -1309,7 +1299,6 @@
<name>button-categories</name>
<can_focus>True</can_focus>
<label>Ca_tegories...</label>
- <relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
@@ -1552,7 +1541,6 @@
<name>button-fulladdr</name>
<can_focus>True</can_focus>
<label>_Address...</label>
- <relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>5</left_attach>
<right_attach>7</right_attach>
@@ -2323,6 +2311,157 @@
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table-contact-editor-collaboration</name>
+ <border_width>7</border_width>
+ <rows>2</rows>
+ <columns>3</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label22</name>
+ <label>_Calendar Information:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-department</focus_target>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</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>GtkLabel</class>
+ <name>label23</name>
+ <label>_Free/Busy Information:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-office</focus_target>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</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>entry-caluri</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>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</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>GtkEntry</class>
+ <name>entry-fburl</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>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</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>Custom</class>
+ <name>custom11</name>
+ <creation_function>e_create_image_widget</creation_function>
+ <string1>globe.png</string1>
+ <string2></string2>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Thu, 18 May 2000 12:20:13 GMT</last_modification_time>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>2</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>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label21</name>
+ <label>Collaboration</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
</widget>
</widget>
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 86386f4cdd..d34d1589b3 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -513,6 +513,15 @@ company_entry_changed (GtkWidget *widget, EContactEditor *editor)
}
static void
+field_changed (GtkWidget *widget, EContactEditor *editor)
+{
+ if (!editor->changed) {
+ editor->changed = TRUE;
+ command_state_changed (editor);
+ }
+}
+
+static void
set_entry_changed_signal_phone(EContactEditor *editor, char *id)
{
GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
@@ -536,6 +545,15 @@ widget_changed (GtkWidget *widget, EContactEditor *editor)
}
static void
+set_entry_changed_signal_field(EContactEditor *editor, char *id)
+{
+ GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
+ if (widget && GTK_IS_ENTRY(widget))
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ field_changed, editor);
+}
+
+static void
set_entry_changed_signals(EContactEditor *editor)
{
GtkWidget *widget;
@@ -769,6 +787,9 @@ ensure_select_names_contact (EContactEditor *editor)
"contacts",
"Related Contacts");
}
+
+ set_entry_changed_signal_field(editor, "entry-caluri");
+ set_entry_changed_signal_field(editor, "entry-fburl");
}
static void
@@ -1955,6 +1976,8 @@ add_field_callback(GtkWidget *widget, EContactEditor *editor)
"text-address",
"checkbutton-mailingaddress",
"checkbutton-htmlmail",
+ "entry-caluri",
+ "entry-fburl",
NULL
};
name = glade_get_widget_name(widget);
@@ -1986,6 +2009,8 @@ static struct {
{ "entry-spouse", "spouse" },
{ "text-comments", "note" },
{ "entry-categories", "categories" },
+ { "entry-caluri", "caluri" },
+ { "entry-fburl", "fburl" },
};
static void
@@ -2092,7 +2117,10 @@ static struct {
{ "entry-fullname", E_CARD_SIMPLE_FIELD_FULL_NAME, TRUE },
{ "button-categories", E_CARD_SIMPLE_FIELD_CATEGORIES, TRUE },
- { "entry-categories", E_CARD_SIMPLE_FIELD_CATEGORIES, TRUE }
+ { "entry-categories", E_CARD_SIMPLE_FIELD_CATEGORIES, TRUE },
+
+ { "entry-caluri", E_CARD_SIMPLE_FIELD_CALURI, TRUE },
+ { "entry-fburl", E_CARD_SIMPLE_FIELD_FBURL, TRUE }
};
static int num_widget_field_mappings = sizeof(widget_field_mappings) / sizeof (widget_field_mappings[0]);