aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2004-06-23 06:40:38 +0800
committerHans Petter <hansp@src.gnome.org>2004-06-23 06:40:38 +0800
commit5267503f4cfd2a682ba6590ab0cc5c7c9dc4feef (patch)
tree5e4ec563c2d11a1211725ab5a0f95ec0b4aff40b /addressbook
parent2e266d5ae53296ce9b647c2318b42b2d9111a7b1 (diff)
downloadgsoc2013-evolution-5267503f4cfd2a682ba6590ab0cc5c7c9dc4feef.tar.gz
gsoc2013-evolution-5267503f4cfd2a682ba6590ab0cc5c7c9dc4feef.tar.zst
gsoc2013-evolution-5267503f4cfd2a682ba6590ab0cc5c7c9dc4feef.zip
Name the labels.
2004-06-22 Hans Petter Jansson <hpj@ximian.com> * gui/contact-editor/contact-editor.glade: Name the labels. * gui/contact-editor/e-contact-editor.c (sensitize_email_record) (sensitize_phone_record) (sensitize_im_record) (sensitize_address_textview) (sensitize_address_field) (simple_field_map) (sensitize_simple_field): Make entries uneditable and labels insensitive, if field is disabled or read-only. svn path=/trunk/; revision=26464
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog13
-rw-r--r--addressbook/gui/contact-editor/contact-editor.glade36
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c89
3 files changed, 87 insertions, 51 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index f0d03e8bb1..8f90f8b83e 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,18 @@
2004-06-22 Hans Petter Jansson <hpj@ximian.com>
+ * gui/contact-editor/contact-editor.glade: Name the labels.
+
+ * gui/contact-editor/e-contact-editor.c (sensitize_email_record)
+ (sensitize_phone_record)
+ (sensitize_im_record)
+ (sensitize_address_textview)
+ (sensitize_address_field)
+ (simple_field_map)
+ (sensitize_simple_field): Make entries uneditable and labels
+ insensitive, if field is disabled or read-only.
+
+2004-06-22 Hans Petter Jansson <hpj@ximian.com>
+
Fixes #59622.
* gui/widgets/e-minicard-view.c (e_minicard_view_init): Clear drag_list
diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade
index d843026036..1acbbac9ed 100644
--- a/addressbook/gui/contact-editor/contact-editor.glade
+++ b/addressbook/gui/contact-editor/contact-editor.glade
@@ -2554,7 +2554,7 @@
<property name="column_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label425">
+ <widget class="GtkLabel" id="label-home-city">
<property name="visible">True</property>
<property name="label" translatable="yes">City:</property>
<property name="use_underline">False</property>
@@ -2599,7 +2599,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label427">
+ <widget class="GtkLabel" id="label-home-zip">
<property name="visible">True</property>
<property name="label" translatable="yes">Zip/Postal Code:</property>
<property name="use_underline">False</property>
@@ -2644,7 +2644,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label426">
+ <widget class="GtkLabel" id="label-home-state">
<property name="visible">True</property>
<property name="label" translatable="yes">State/Province:</property>
<property name="use_underline">False</property>
@@ -2689,7 +2689,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label428">
+ <widget class="GtkLabel" id="label-home-country">
<property name="visible">True</property>
<property name="label" translatable="yes">Country:</property>
<property name="use_underline">False</property>
@@ -2734,7 +2734,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label445">
+ <widget class="GtkLabel" id="label-home-address">
<property name="visible">True</property>
<property name="label" translatable="yes">Address:</property>
<property name="use_underline">False</property>
@@ -2815,7 +2815,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label447">
+ <widget class="GtkLabel" id="label-home-pobox">
<property name="visible">True</property>
<property name="label" translatable="yes">PO Box:</property>
<property name="use_underline">False</property>
@@ -2884,7 +2884,7 @@
<property name="column_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label432">
+ <widget class="GtkLabel" id="label-work-city">
<property name="visible">True</property>
<property name="label" translatable="yes">City:</property>
<property name="use_underline">False</property>
@@ -2929,7 +2929,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label433">
+ <widget class="GtkLabel" id="label-work-state">
<property name="visible">True</property>
<property name="label" translatable="yes">State/Province:</property>
<property name="use_underline">False</property>
@@ -2974,7 +2974,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label434">
+ <widget class="GtkLabel" id="label-work-zip">
<property name="visible">True</property>
<property name="label" translatable="yes">Zip/Postal Code:</property>
<property name="use_underline">False</property>
@@ -3019,7 +3019,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label435">
+ <widget class="GtkLabel" id="label-work-country">
<property name="visible">True</property>
<property name="label" translatable="yes">Country:</property>
<property name="use_underline">False</property>
@@ -3064,7 +3064,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label430">
+ <widget class="GtkLabel" id="label-work-address">
<property name="visible">True</property>
<property name="label" translatable="yes">Address:</property>
<property name="use_underline">False</property>
@@ -3145,7 +3145,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label448">
+ <widget class="GtkLabel" id="label-work-pobox">
<property name="visible">True</property>
<property name="label" translatable="yes">PO Box:</property>
<property name="use_underline">False</property>
@@ -3214,7 +3214,7 @@
<property name="column_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label440">
+ <widget class="GtkLabel" id="label-other-city">
<property name="visible">True</property>
<property name="label" translatable="yes">City:</property>
<property name="use_underline">False</property>
@@ -3259,7 +3259,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label446">
+ <widget class="GtkLabel" id="label-other-address">
<property name="visible">True</property>
<property name="label" translatable="yes">Address:</property>
<property name="use_underline">False</property>
@@ -3304,7 +3304,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label441">
+ <widget class="GtkLabel" id="label-other-state">
<property name="visible">True</property>
<property name="label" translatable="yes">State/Province:</property>
<property name="use_underline">False</property>
@@ -3328,7 +3328,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label442">
+ <widget class="GtkLabel" id="label-other-zip">
<property name="visible">True</property>
<property name="label" translatable="yes">Zip/Postal Code:</property>
<property name="use_underline">False</property>
@@ -3373,7 +3373,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label443">
+ <widget class="GtkLabel" id="label-other-country">
<property name="visible">True</property>
<property name="label" translatable="yes">Country:</property>
<property name="use_underline">False</property>
@@ -3475,7 +3475,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label449">
+ <widget class="GtkLabel" id="label-other-pobox">
<property name="visible">True</property>
<property name="label" translatable="yes">PO Box:</property>
<property name="use_underline">False</property>
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 6728780e24..92a32ec958 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -962,7 +962,7 @@ sensitize_email_record (EContactEditor *editor, gint record, gboolean enabled)
g_free (widget_name);
gtk_widget_set_sensitive (location_option_menu, enabled);
- gtk_widget_set_sensitive (email_entry, enabled);
+ gtk_editable_set_editable (GTK_EDITABLE (email_entry), enabled);
}
static void
@@ -1265,7 +1265,7 @@ sensitize_phone_record (EContactEditor *editor, gint record, gboolean enabled)
g_free (widget_name);
gtk_widget_set_sensitive (phone_type_option_menu, enabled);
- gtk_widget_set_sensitive (phone_entry, enabled);
+ gtk_editable_set_editable (GTK_EDITABLE (phone_entry), enabled);
sensitize_phone_types (editor, phone_type_option_menu);
}
@@ -1556,7 +1556,7 @@ sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled)
#ifdef ENABLE_IM_LOCATION
gtk_widget_set_sensitive (location_option_menu, enabled);
#endif
- gtk_widget_set_sensitive (name_entry, enabled);
+ gtk_editable_set_editable (GTK_EDITABLE (name_entry), enabled);
}
static void
@@ -1776,28 +1776,40 @@ extract_address (EContactEditor *editor)
static void
sensitize_address_textview (EContactEditor *editor, gint record, gboolean enabled)
{
- gchar *textview_name;
+ gchar *widget_name;
GtkWidget *textview;
+ GtkWidget *label;
- textview_name = g_strdup_printf ("textview-%s-address", address_name [record]);
- textview = glade_xml_get_widget (editor->gui, textview_name);
- g_free (textview_name);
+ widget_name = g_strdup_printf ("textview-%s-address", address_name [record]);
+ textview = glade_xml_get_widget (editor->gui, widget_name);
+ g_free (widget_name);
- gtk_widget_set_sensitive (textview, enabled);
+ widget_name = g_strdup_printf ("label-%s-address", address_name [record]);
+ label = glade_xml_get_widget (editor->gui, widget_name);
+ g_free (widget_name);
+
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (textview), enabled);
+ gtk_widget_set_sensitive (label, enabled);
}
static void
sensitize_address_field (EContactEditor *editor, gint record, const gchar *widget_field_name,
gboolean enabled)
{
- gchar *entry_name;
+ gchar *widget_name;
GtkWidget *entry;
+ GtkWidget *label;
- entry_name = g_strdup_printf ("entry-%s-%s", address_name [record], widget_field_name);
- entry = glade_xml_get_widget (editor->gui, entry_name);
- g_free (entry_name);
+ widget_name = g_strdup_printf ("entry-%s-%s", address_name [record], widget_field_name);
+ entry = glade_xml_get_widget (editor->gui, widget_name);
+ g_free (widget_name);
+
+ widget_name = g_strdup_printf ("label-%s-%s", address_name [record], widget_field_name);
+ label = glade_xml_get_widget (editor->gui, widget_name);
+ g_free (widget_name);
- gtk_widget_set_sensitive (entry, enabled);
+ gtk_editable_set_editable (GTK_EDITABLE (entry), enabled);
+ gtk_widget_set_sensitive (label, enabled);
}
static void
@@ -1844,61 +1856,61 @@ FieldMapping;
static FieldMapping simple_field_map [] = {
{ "entry-homepage", E_CONTACT_HOMEPAGE_URL, TRUE, TRUE },
- { "accellabel-homepage", E_CONTACT_HOMEPAGE_URL, FALSE, FALSE },
+ { "accellabel-homepage", E_CONTACT_HOMEPAGE_URL, FALSE, TRUE },
{ "entry-jobtitle", E_CONTACT_TITLE, TRUE, TRUE },
- { "label-jobtitle", E_CONTACT_TITLE, FALSE, FALSE },
+ { "label-jobtitle", E_CONTACT_TITLE, FALSE, TRUE },
{ "entry-company", E_CONTACT_ORG, TRUE, TRUE },
- { "label-company", E_CONTACT_ORG, FALSE, FALSE },
+ { "label-company", E_CONTACT_ORG, FALSE, TRUE },
{ "entry-department", E_CONTACT_ORG_UNIT, TRUE, TRUE },
- { "label-department", E_CONTACT_ORG_UNIT, FALSE, FALSE },
+ { "label-department", E_CONTACT_ORG_UNIT, FALSE, TRUE },
{ "entry-profession", E_CONTACT_ROLE, TRUE, TRUE },
- { "label-profession", E_CONTACT_ROLE, FALSE, FALSE },
+ { "label-profession", E_CONTACT_ROLE, FALSE, TRUE },
{ "entry-manager", E_CONTACT_MANAGER, TRUE, TRUE },
- { "label-manager", E_CONTACT_MANAGER, FALSE, FALSE },
+ { "label-manager", E_CONTACT_MANAGER, FALSE, TRUE },
{ "entry-assistant", E_CONTACT_ASSISTANT, TRUE, TRUE },
- { "label-assistant", E_CONTACT_ASSISTANT, FALSE, FALSE },
+ { "label-assistant", E_CONTACT_ASSISTANT, FALSE, TRUE },
{ "entry-nickname", E_CONTACT_NICKNAME, TRUE, TRUE },
- { "label-nickname", E_CONTACT_NICKNAME, FALSE, FALSE },
+ { "label-nickname", E_CONTACT_NICKNAME, FALSE, TRUE },
{ "dateedit-birthday", E_CONTACT_BIRTH_DATE, TRUE, TRUE },
- { "label-birthday", E_CONTACT_BIRTH_DATE, FALSE, FALSE },
+ { "label-birthday", E_CONTACT_BIRTH_DATE, FALSE, TRUE },
{ "dateedit-anniversary", E_CONTACT_ANNIVERSARY, TRUE, TRUE },
- { "label-anniversary", E_CONTACT_ANNIVERSARY, FALSE, FALSE },
+ { "label-anniversary", E_CONTACT_ANNIVERSARY, FALSE, TRUE },
{ "entry-spouse", E_CONTACT_SPOUSE, TRUE, TRUE },
- { "label-spouse", E_CONTACT_SPOUSE, FALSE, FALSE },
+ { "label-spouse", E_CONTACT_SPOUSE, FALSE, TRUE },
{ "entry-office", E_CONTACT_OFFICE, TRUE, TRUE },
- { "label-office", E_CONTACT_OFFICE, FALSE, FALSE },
+ { "label-office", E_CONTACT_OFFICE, FALSE, TRUE },
{ "text-comments", E_CONTACT_NOTE, TRUE, TRUE },
- { "label-comments", E_CONTACT_NOTE, FALSE, FALSE },
+ { "label-comments", E_CONTACT_NOTE, FALSE, TRUE },
{ "entry-fullname", E_CONTACT_FULL_NAME, TRUE, TRUE },
- { "button-fullname", E_CONTACT_FULL_NAME, FALSE, FALSE },
+ { "button-fullname", E_CONTACT_FULL_NAME, FALSE, TRUE },
{ "entry-categories", E_CONTACT_CATEGORIES, TRUE, TRUE },
{ "button-categories", E_CONTACT_CATEGORIES, FALSE, TRUE },
{ "entry-weblog", E_CONTACT_BLOG_URL, TRUE, TRUE },
- { "label-weblog", E_CONTACT_BLOG_URL, FALSE, FALSE },
+ { "label-weblog", E_CONTACT_BLOG_URL, FALSE, TRUE },
{ "entry-caluri", E_CONTACT_CALENDAR_URI, TRUE, TRUE },
- { "label-caluri", E_CONTACT_CALENDAR_URI, FALSE, FALSE },
+ { "label-caluri", E_CONTACT_CALENDAR_URI, FALSE, TRUE },
{ "entry-fburl", E_CONTACT_FREEBUSY_URL, TRUE, TRUE },
- { "label-fburl", E_CONTACT_FREEBUSY_URL, FALSE, FALSE },
+ { "label-fburl", E_CONTACT_FREEBUSY_URL, FALSE, TRUE },
{ "entry-videourl", E_CONTACT_VIDEO_URL, TRUE, TRUE },
- { "label-videourl", E_CONTACT_VIDEO_URL, FALSE, FALSE },
+ { "label-videourl", E_CONTACT_VIDEO_URL, FALSE, TRUE },
{ "checkbutton-htmlmail", E_CONTACT_WANTS_HTML, TRUE, TRUE },
@@ -1907,7 +1919,7 @@ static FieldMapping simple_field_map [] = {
{ "combo-file-as", E_CONTACT_FILE_AS, FALSE, TRUE },
{ "entry-file-as", E_CONTACT_FILE_AS, TRUE, TRUE },
- { "accellabel-fileas", E_CONTACT_FILE_AS, FALSE, FALSE },
+ { "accellabel-fileas", E_CONTACT_FILE_AS, FALSE, TRUE },
};
static void
@@ -2073,7 +2085,18 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id)
static void
sensitize_simple_field (GtkWidget *widget, gboolean enabled)
{
- gtk_widget_set_sensitive (widget, enabled);
+ if (GTK_IS_ENTRY (widget))
+ gtk_editable_set_editable (GTK_EDITABLE (widget), enabled);
+ else if (GTK_IS_TEXT_VIEW (widget))
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (widget), enabled);
+ else if (E_IS_URL_ENTRY (widget)) {
+ GtkWidget *entry = e_url_entry_get_entry (E_URL_ENTRY (widget));
+ gtk_editable_set_editable (GTK_EDITABLE (entry), enabled);
+ }
+ else if (E_IS_DATE_EDIT (widget))
+ e_date_edit_set_editable (E_DATE_EDIT (widget), enabled);
+ else
+ gtk_widget_set_sensitive (widget, enabled);
}
static void