aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/contact-editor
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/contact-editor')
-rw-r--r--addressbook/contact-editor/contact-editor.glade249
-rw-r--r--addressbook/contact-editor/e-contact-editor-strings.h2
-rw-r--r--addressbook/contact-editor/e-contact-editor.c118
3 files changed, 248 insertions, 121 deletions
diff --git a/addressbook/contact-editor/contact-editor.glade b/addressbook/contact-editor/contact-editor.glade
index cd17ffd288..33721520e6 100644
--- a/addressbook/contact-editor/contact-editor.glade
+++ b/addressbook/contact-editor/contact-editor.glade
@@ -429,57 +429,6 @@
</widget>
<widget>
- <class>GtkHBox</class>
- <name>hbox5</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
- <child>
- <left_attach>0</left_attach>
- <right_attach>7</right_attach>
- <top_attach>10</top_attach>
- <bottom_attach>11</bottom_attach>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <xexpand>True</xexpand>
- <yexpand>True</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>True</yfill>
- </child>
-
- <widget>
- <class>GtkText</class>
- <name>text-comments</name>
- <can_focus>True</can_focus>
- <editable>True</editable>
- <text></text>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkVScrollbar</class>
- <name>vscrollbar-comments</name>
- <policy>GTK_UPDATE_CONTINUOUS</policy>
- <value>0</value>
- <lower>0</lower>
- <upper>0</upper>
- <step>0</step>
- <page>0</page>
- <page_size>0</page_size>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
- </widget>
-
- <widget>
<class>GtkAlignment</class>
<name>alignment2</name>
<xalign>0</xalign>
@@ -566,38 +515,6 @@
<widget>
<class>GtkAlignment</class>
- <name>alignment4</name>
- <xalign>1</xalign>
- <yalign>0.5</yalign>
- <xscale>0</xscale>
- <yscale>1</yscale>
- <child>
- <left_attach>6</left_attach>
- <right_attach>7</right_attach>
- <top_attach>6</top_attach>
- <bottom_attach>7</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>
- <class>GtkButton</class>
- <name>button-address1</name>
-
- <widget>
- <class>Placeholder</class>
- </widget>
- </widget>
- </widget>
-
- <widget>
- <class>GtkAlignment</class>
<name>alignment5</name>
<xalign>1</xalign>
<yalign>0.5</yalign>
@@ -693,32 +610,6 @@
</widget>
<widget>
- <class>GtkLabel</class>
- <name>label-address1</name>
- <label>Business</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <left_attach>5</left_attach>
- <right_attach>6</right_attach>
- <top_attach>6</top_attach>
- <bottom_attach>7</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>GtkHSeparator</class>
<name>hseparator4</name>
<child>
@@ -910,7 +801,7 @@
<widget>
<class>GtkCombo</class>
- <name>combo-fileas</name>
+ <name>combo-file-as</name>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>True</case_sensitive>
@@ -935,7 +826,7 @@
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
- <name>combo-entry1</name>
+ <name>entry-file-as</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -964,12 +855,63 @@
</widget>
<widget>
- <class>GtkCheckButton</class>
- <name>checkbutton-htmlmail</name>
- <can_focus>True</can_focus>
- <label>Wants HTML mail</label>
- <active>False</active>
- <draw_indicator>True</draw_indicator>
+ <class>GtkHBox</class>
+ <name>hbox5</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>8</right_attach>
+ <top_attach>10</top_attach>
+ <bottom_attach>11</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkText</class>
+ <name>text-comments</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkVScrollbar</class>
+ <name>vscrollbar-comments</name>
+ <policy>GTK_UPDATE_CONTINUOUS</policy>
+ <value>0</value>
+ <lower>0</lower>
+ <upper>0</upper>
+ <step>0</step>
+ <page>0</page>
+ <page_size>0</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment10</name>
+ <xalign>0.5</xalign>
+ <yalign>0</yalign>
+ <xscale>1</xscale>
+ <yscale>1</yscale>
<child>
<left_attach>3</left_attach>
<right_attach>4</right_attach>
@@ -984,6 +926,73 @@
<xfill>True</xfill>
<yfill>True</yfill>
</child>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>checkbutton-htmlmail</name>
+ <can_focus>True</can_focus>
+ <label>Wants HTML mail</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment4</name>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>0</yscale>
+ <child>
+ <left_attach>6</left_attach>
+ <right_attach>7</right_attach>
+ <top_attach>6</top_attach>
+ <bottom_attach>7</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>
+ <class>GtkButton</class>
+ <name>button-address1</name>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-address1</name>
+ <label>Business</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>5</left_attach>
+ <right_attach>6</right_attach>
+ <top_attach>6</top_attach>
+ <bottom_attach>7</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>
@@ -1272,7 +1281,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry4</name>
+ <name>entry-spouse</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1464,7 +1473,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry13</name>
+ <name>entry-assistant</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1488,7 +1497,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry12</name>
+ <name>entry-manager</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
diff --git a/addressbook/contact-editor/e-contact-editor-strings.h b/addressbook/contact-editor/e-contact-editor-strings.h
index 7f0a8a83f1..42be016fbc 100644
--- a/addressbook/contact-editor/e-contact-editor-strings.h
+++ b/addressbook/contact-editor/e-contact-editor-strings.h
@@ -17,8 +17,8 @@ gchar *s = N_("File As:");
gchar *s = N_("Web page address:");
gchar *s = N_("This is the mailing address");
gchar *s = N_("A_ddress...");
-gchar *s = N_("Business");
gchar *s = N_("Wants HTML mail");
+gchar *s = N_("Business");
gchar *s = N_("General");
gchar *s = N_("Department:");
gchar *s = N_("Office:");
diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c
index 91339e9da3..5665e0d217 100644
--- a/addressbook/contact-editor/e-contact-editor.c
+++ b/addressbook/contact-editor/e-contact-editor.c
@@ -1,3 +1,4 @@
+
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* e-contact-editor.c
@@ -781,6 +782,7 @@ fill_in_info(EContactEditor *editor)
{
ECard *card = editor->card;
if (card) {
+ char *file_as;
char *fname;
ECardList *address_list;
ECardList *phone_list;
@@ -788,9 +790,14 @@ fill_in_info(EContactEditor *editor)
char *title;
char *org;
char *org_unit;
+ char *office;
char *url;
char *role;
+ char *manager;
+ char *assistant;
char *nickname;
+ char *spouse;
+ const ECardDate *anniversary;
char *fburl;
char *note;
const ECardPhone *phone;
@@ -803,6 +810,7 @@ fill_in_info(EContactEditor *editor)
ECardIterator *iterator;
gtk_object_get(GTK_OBJECT(card),
+ "file_as", &file_as,
"full_name", &fname,
"address_label", &address_list,
"phone", &phone_list,
@@ -810,9 +818,14 @@ fill_in_info(EContactEditor *editor)
"url", &url,
"org", &org,
"org_unit", &org_unit,
+ "office", &office,
"title", &title,
"role", &role,
+ "manager", &manager,
+ "assistant", &assistant,
"nickname", &nickname,
+ "spouse", &spouse,
+ "anniversary", &anniversary,
"fburl", &fburl,
"note", &note,
"birth_date", &bday,
@@ -824,6 +837,12 @@ fill_in_info(EContactEditor *editor)
if (fname)
gtk_editable_insert_text(editable, fname, strlen(fname), &position);
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-file-as"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (file_as)
+ gtk_editable_insert_text(editable, file_as, strlen(file_as), &position);
+
for (iterator = e_card_list_get_iterator(phone_list); e_card_iterator_is_valid(iterator); e_card_iterator_next(iterator)) {
int i;
phone = e_card_iterator_get(iterator);
@@ -879,18 +898,54 @@ fill_in_info(EContactEditor *editor)
gtk_editable_insert_text(editable, org_unit, strlen(org_unit), &position);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-office"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (office)
+ gtk_editable_insert_text(editable, office, strlen(office), &position);
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
gtk_editable_delete_text(editable, 0, -1);
if (title)
gtk_editable_insert_text(editable, title, strlen(title), &position);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-manager"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (manager)
+ gtk_editable_insert_text(editable, manager, strlen(manager), &position);
+
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-assistant"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (assistant)
+ gtk_editable_insert_text(editable, assistant, strlen(assistant), &position);
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-nickname"));
gtk_editable_delete_text(editable, 0, -1);
if (nickname)
gtk_editable_insert_text(editable, nickname, strlen(nickname), &position);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-spouse"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (spouse)
+ gtk_editable_insert_text(editable, spouse, strlen(spouse), &position);
+
+ if (anniversary) {
+ struct tm time_struct = {0,0,0,0,0,0,0,0,0};
+ time_t time_val;
+ GnomeDateEdit *dateedit;
+ time_struct.tm_mday = anniversary->day;
+ time_struct.tm_mon = anniversary->month - 1;
+ time_struct.tm_year = anniversary->year - 1900;
+ time_val = mktime(&time_struct);
+ dateedit = GNOME_DATE_EDIT(glade_xml_get_widget(editor->gui, "dateedit-anniversary"));
+ gnome_date_edit_set_time(dateedit, time_val);
+ }
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-fburl"));
gtk_editable_delete_text(editable, 0, -1);
if (fburl)
@@ -928,6 +983,7 @@ extract_info(EContactEditor *editor)
{
ECard *card = editor->card;
if (card) {
+ char *file_as;
char *fname;
ECardList *address_list;
ECardList *phone_list;
@@ -935,9 +991,14 @@ extract_info(EContactEditor *editor)
char *url;
char *org;
char *org_unit;
+ char *office;
char *title;
char *role;
+ char *manager;
+ char *assistant;
char *nickname;
+ char *spouse;
+ ECardDate *anniversary;
char *fburl;
char *note;
const ECardPhone *phone;
@@ -961,6 +1022,15 @@ extract_info(EContactEditor *editor)
NULL);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-file-as"));
+ file_as = gtk_editable_get_chars(editable, 0, -1);
+ if (file_as && *file_as)
+ gtk_object_set(GTK_OBJECT(card),
+ "file_as", file_as,
+ NULL);
+ g_free(file_as);
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-fullname"));
fname = gtk_editable_get_chars(editable, 0, -1);
if (fname && *fname)
@@ -1081,6 +1151,15 @@ extract_info(EContactEditor *editor)
NULL);
g_free(org_unit);
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-office"));
+ office = gtk_editable_get_chars(editable, 0, -1);
+ if (office && *office)
+ gtk_object_set(GTK_OBJECT(card),
+ "office", office,
+ NULL);
+ g_free(office);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
title = gtk_editable_get_chars(editable, 0, -1);
if (title && *title)
@@ -1097,6 +1176,24 @@ extract_info(EContactEditor *editor)
NULL);
g_free(role);
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-manager"));
+ manager = gtk_editable_get_chars(editable, 0, -1);
+ if (manager && *manager)
+ gtk_object_set(GTK_OBJECT(card),
+ "manager", manager,
+ NULL);
+ g_free(manager);
+
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-assistant"));
+ assistant = gtk_editable_get_chars(editable, 0, -1);
+ if (assistant && *assistant)
+ gtk_object_set(GTK_OBJECT(card),
+ "assistant", assistant,
+ NULL);
+ g_free(assistant);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-nickname"));
nickname = gtk_editable_get_chars(editable, 0, -1);
if (nickname && *nickname)
@@ -1105,6 +1202,27 @@ extract_info(EContactEditor *editor)
NULL);
g_free(nickname);
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-spouse"));
+ spouse = gtk_editable_get_chars(editable, 0, -1);
+ if (spouse && *spouse)
+ gtk_object_set(GTK_OBJECT(card),
+ "spouse", spouse,
+ NULL);
+ g_free(spouse);
+
+ dateedit = GNOME_DATE_EDIT(glade_xml_get_widget(editor->gui, "dateedit-anniversary"));
+ time_val = gnome_date_edit_get_date(dateedit);
+ gmtime_r(&time_val,
+ &time_struct);
+ anniversary = g_new(ECardDate, 1);
+ anniversary->day = time_struct.tm_mday;
+ anniversary->month = time_struct.tm_mon + 1;
+ anniversary->year = time_struct.tm_year + 1900;
+ gtk_object_set(GTK_OBJECT(card),
+ "anniversary", anniversary,
+ NULL);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-fburl"));
fburl = gtk_editable_get_chars(editable, 0, -1);
if (fburl && *fburl)