aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
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/gui/contact-editor
parent9236ecd8e816336d4ec7c4181c9cc31d881ebf05 (diff)
downloadgsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar.gz
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.tar.zst
gsoc2013-evolution-7add9d957695308274ab31d785e131001387b0b8.zip
Fix for Bug #342903 and 206320
svn path=/trunk/; revision=32112
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c30
1 files changed, 28 insertions, 2 deletions
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))) {