aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Leach <jasonleach@usa.net>2001-01-19 23:58:02 +0800
committerJacob Leach <jleach@src.gnome.org>2001-01-19 23:58:02 +0800
commit62a2dc7c2e5c5a11184ac23fc626aa22f499ab03 (patch)
tree678a10d973d6ccc6a6309893ebd8a433b2d6402e
parente0368460a3f69462db41f41ef3b7c66461daa301 (diff)
downloadgsoc2013-evolution-62a2dc7c2e5c5a11184ac23fc626aa22f499ab03.tar.gz
gsoc2013-evolution-62a2dc7c2e5c5a11184ac23fc626aa22f499ab03.tar.zst
gsoc2013-evolution-62a2dc7c2e5c5a11184ac23fc626aa22f499ab03.zip
(Adding a boolean "entry_changed" BonoboPropertyBag arg)
2001-01-19 Jason Leach <jasonleach@usa.net> (Adding a boolean "entry_changed" BonoboPropertyBag arg) * gui/component/select-names/e-select-names-bonobo.c (entry_set_property_fn): Use a gtk_object_set_data to set the property to TRUE here. (entry_changed): New function, calls bonobo_control_set_property if entry_changed hasn't been set to TRUE yet. (impl_SelectNames_get_entry_for_section): Connect "changed" on each entry_widget to the new entry_changed() func. 2001-01-19 Jason Leach <jasonleach@usa.net> * e-msg-composer-hdrs.c (create_addressbook_entry): Listen for property bag changes to "entry_changed" on here, which means on the To, Cc, and Bcc entries. (addressbook_entry_changed): New function that gets called when "entry_changed" property is changed (to TRUE). svn path=/trunk/; revision=7649
-rw-r--r--addressbook/ChangeLog14
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.c21
-rw-r--r--composer/ChangeLog8
-rw-r--r--composer/e-msg-composer-hdrs.c23
4 files changed, 64 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 673d4ac975..27c728694f 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,17 @@
+2001-01-19 Jason Leach <jasonleach@usa.net>
+
+ (Adding a boolean "entry_changed" BonoboPropertyBag arg)
+
+ * gui/component/select-names/e-select-names-bonobo.c
+ (entry_set_property_fn): Use a gtk_object_set_data to set the
+ property to TRUE here.
+
+ (entry_changed): New function, calls bonobo_control_set_property
+ if entry_changed hasn't been set to TRUE yet.
+
+ (impl_SelectNames_get_entry_for_section): Connect "changed" on
+ each entry_widget to the new entry_changed() func.
+
2001-01-19 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (ecard_from_remote_record): always free
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c
index 7014cddc22..87be63c3db 100644
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.c
+++ b/addressbook/gui/component/select-names/e-select-names-bonobo.c
@@ -46,7 +46,8 @@ struct _ESelectNamesBonoboPrivate {
};
enum _EntryPropertyID {
- ENTRY_PROPERTY_ID_TEXT
+ ENTRY_PROPERTY_ID_TEXT,
+ ENTRY_PROPERTY_ID_ENTRY_CHANGED
};
typedef enum _EntryPropertyID EntryPropertyID;
@@ -92,6 +93,9 @@ entry_set_property_fn (BonoboPropertyBag *bag,
text = BONOBO_ARG_GET_STRING (arg);
gtk_object_set (GTK_OBJECT (widget), "text", text, NULL);
break;
+ case ENTRY_PROPERTY_ID_ENTRY_CHANGED:
+ gtk_object_set_data (GTK_OBJECT (widget), "entry_property_id_changed", GUINT_TO_POINTER (1));
+ break;
default:
break;
}
@@ -142,6 +146,15 @@ impl_SelectNames_add_section (PortableServer_Servant servant,
e_select_names_manager_add_section (priv->manager, id, title);
}
+static void
+entry_changed (GtkWidget *widget, BonoboControl *control)
+{
+ gboolean changed = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (widget), "entry_property_id_changed"));
+
+ if (!changed)
+ bonobo_control_set_property (control, "entry_changed", TRUE, NULL);
+}
+
static Bonobo_Control
impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
const CORBA_char *section_id,
@@ -175,9 +188,15 @@ impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
bonobo_property_bag_add (property_bag, "text", ENTRY_PROPERTY_ID_TEXT,
BONOBO_ARG_STRING, NULL, NULL,
BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
+ bonobo_property_bag_add (property_bag, "entry_changed", ENTRY_PROPERTY_ID_ENTRY_CHANGED,
+ BONOBO_ARG_BOOLEAN, NULL, NULL,
+ BONOBO_PROPERTY_WRITEABLE);
bonobo_control_set_properties (control, property_bag);
+ gtk_signal_connect (GTK_OBJECT (entry_widget), "changed",
+ GTK_SIGNAL_FUNC (entry_changed), control);
+
return CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (control)), ev);
}
diff --git a/composer/ChangeLog b/composer/ChangeLog
index cff16bc2d7..b2492fd67c 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,11 @@
+2001-01-19 Jason Leach <jasonleach@usa.net>
+
+ * e-msg-composer-hdrs.c (create_addressbook_entry): Listen for
+ property bag changes to "entry_changed" on here, which means on
+ the To, Cc, and Bcc entries.
+ (addressbook_entry_changed): New function that gets called when
+ "entry_changed" property is changed (to TRUE).
+
2001-01-18 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer.c (build_message): Updated to reflect changes to
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index af22dcf611..834d63214a 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -191,6 +191,18 @@ create_optionmenu (EMsgComposerHdrs *hdrs,
return omenu;
}
+static void
+addressbook_entry_changed (BonoboListener *listener,
+ char *event_name,
+ CORBA_any *arg,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ EMsgComposerHdrs *hdrs = E_MSG_COMPOSER_HDRS (user_data);
+
+ hdrs->has_changed = TRUE;
+}
+
static GtkWidget *
create_addressbook_entry (EMsgComposerHdrs *hdrs,
const char *name)
@@ -200,6 +212,8 @@ create_addressbook_entry (EMsgComposerHdrs *hdrs,
Bonobo_Control corba_control;
GtkWidget *control_widget;
CORBA_Environment ev;
+ BonoboControlFrame *cf;
+ Bonobo_PropertyBag pb = CORBA_OBJECT_NIL;
priv = hdrs->priv;
corba_select_names = priv->corba_select_names;
@@ -223,6 +237,13 @@ create_addressbook_entry (EMsgComposerHdrs *hdrs,
control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
+ cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (control_widget));
+ pb = bonobo_control_frame_get_control_property_bag (cf, NULL);
+
+ bonobo_event_source_client_add_listener (pb, addressbook_entry_changed,
+ "Bonobo/Property:change:entry_changed",
+ NULL, hdrs);
+
return control_widget;
}
@@ -232,7 +253,7 @@ entry_changed (GtkWidget *entry, EMsgComposerHdrs *hdrs)
gchar *tmp;
gchar *subject;
- /* Mark the headers as changed */
+ /* Mark the composer as changed so it prompts to save on close */
hdrs->has_changed = TRUE;
tmp = e_msg_composer_hdrs_get_subject (hdrs);