aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorDevashish Sharma <dsharma@src.gnome.org>2006-06-12 19:31:38 +0800
committerDevashish Sharma <dsharma@src.gnome.org>2006-06-12 19:31:38 +0800
commit7add9d957695308274ab31d785e131001387b0b8 (patch)
tree62b97f18bb5def6632c1123b3f762fb9fa4777fb /addressbook
parent9236ecd8e816336d4ec7c4181c9cc31d881ebf05 (diff)
downloadgsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar.gz
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar.bz2
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar.lz
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar.xz
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar.zst
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.zip
Fix for Bug #342903 and 206320
svn path=/trunk/; revision=32112
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c30
2 files changed, 35 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index b4aef4a82f..be66dc78ae 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,12 @@
2006-06-12 Devashish Sharma <sdevashish@novell.com>
+ * gui/contact-editor/e-contact-editor.c : If company name
+ is set and full name and file as are not set, set company name
+ as full name and fle name.
+ Fixes Bug #206320, 342903
+
+2006-06-12 Devashish Sharma <sdevashish@novell.com>
+
* gui/contact-editor/e-contact-quick-add.c :Fix for Bug #341465
2006-06-09 Chris Heath <chris@heathens.co.nz>
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index a34b831f30..a7300be3fc 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -607,15 +607,23 @@ sensitize_ok (EContactEditor *ce)
gboolean allow_save;
GtkWidget *entry_fullname;
GtkWidget *entry_file_as;
+ GtkWidget *company_name;
entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" );
entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as");
+ company_name = glade_xml_get_widget (ce->gui, "entry-company");
const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname));
const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as));
+ const char *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name));
allow_save = ce->target_editable && ce->changed ? TRUE : FALSE;
- if (!strcmp (name_entry_string, "") || !strcmp (file_as_entry_string, ""))
- allow_save = FALSE;
+ if (!strcmp (name_entry_string, "") || !strcmp (file_as_entry_string, "")) {
+ if (strcmp (company_name_string , "")) {
+ allow_save = TRUE;
+ }
+ else
+ allow_save = FALSE;
+ }
widget = glade_xml_get_widget (ce->gui, "button-ok");
gtk_widget_set_sensitive (widget, allow_save);
}
@@ -2978,6 +2986,24 @@ save_contact (EContactEditor *ce, gboolean should_close)
if (e_error_run (GTK_WINDOW (ce->app), "addressbook:prompt-move", NULL) == GTK_RESPONSE_NO)
return;
}
+
+ GtkWidget *entry_fullname;
+ GtkWidget *entry_file_as;
+ GtkWidget *company_name;
+ entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" );
+ entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as");
+ company_name = glade_xml_get_widget (ce->gui, "entry-company");
+ const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname));
+ const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as));
+ const char *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name));
+
+ if (strcmp (company_name_string , "")) {
+ if (!strcmp (name_entry_string, ""))
+ gtk_entry_set_text (GTK_ENTRY (entry_fullname), company_name_string);
+ if (!strcmp (file_as_entry_string, ""))
+ gtk_entry_set_text (GTK_ENTRY (entry_file_as), company_name_string);
+ }
+
extract_all (ce);
if (!e_contact_editor_is_valid (EAB_EDITOR (ce))) {