aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Leach <jasonleach@usa.net>2001-01-26 03:35:54 +0800
committerJacob Leach <jleach@src.gnome.org>2001-01-26 03:35:54 +0800
commit024435f8ccbc749533474c882627680145649a4c (patch)
treec766fcebd81c22db378c3e10798485c1d571b45d
parent593f0036f8dfa204eb0d70c6ad5b5243ee2b49a7 (diff)
downloadgsoc2013-evolution-024435f8ccbc749533474c882627680145649a4c.tar.gz
gsoc2013-evolution-024435f8ccbc749533474c882627680145649a4c.tar.zst
gsoc2013-evolution-024435f8ccbc749533474c882627680145649a4c.zip
(Moving the flag for has_changed from the Hdrs to the Composer itself.
2001-01-25 Jason Leach <jasonleach@usa.net> (Moving the flag for has_changed from the Hdrs to the Composer itself. Providing public methods to set/unset a composer as changed. Adding attachments now flags the composer as changed) * e-msg-composer.c (e_msg_composer_unset_changed): New function. (e_msg_composer_set_changed): New function. * e-msg-composer.c (hdrs_changed_cb): Callback to the new signal, uses the new composer_set_changed. (attachment_bar_changed_cb): Add a call to the new _set_changed. * e-msg-composer-hdrs.c (class_init): New signal "hdrs_changed" to tell the parent composer that any of the headers have changed. (addressbook_entry_changed): emit the new signal here. (entry_changed): And here. svn path=/trunk/; revision=7818
-rw-r--r--composer/ChangeLog19
-rw-r--r--composer/e-msg-composer-hdrs.c19
-rw-r--r--composer/e-msg-composer-hdrs.h2
-rw-r--r--composer/e-msg-composer.c55
-rw-r--r--composer/e-msg-composer.h5
5 files changed, 92 insertions, 8 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 10365cc362..34fffcad58 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,22 @@
+2001-01-25 Jason Leach <jasonleach@usa.net>
+
+ (Moving the flag for has_changed from the Hdrs to the Composer
+ itself. Providing public methods to set/unset a composer as
+ changed. Adding attachments now flags the composer as changed)
+
+ * e-msg-composer.c (e_msg_composer_unset_changed): New function.
+ (e_msg_composer_set_changed): New function.
+
+ * e-msg-composer.c (hdrs_changed_cb): Callback to the new signal,
+ uses the new composer_set_changed.
+ (attachment_bar_changed_cb): Add a call to the new
+ composer_set_changed.
+
+ * e-msg-composer-hdrs.c (class_init): New signal "hdrs_changed" to
+ tell the parent composer that any of the headers have changed.
+ (addressbook_entry_changed): emit the new signal here.
+ (entry_changed): And here.
+
2001-01-24 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer.c (menu_security_pgp_encrypt_cb): New callback.
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 4228bd5f4c..1ac061ed82 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -68,6 +68,7 @@ static GtkTableClass *parent_class = NULL;
enum {
SHOW_ADDRESS_DIALOG,
SUBJECT_CHANGED,
+ HDRS_CHANGED,
LAST_SIGNAL
};
@@ -209,7 +210,7 @@ addressbook_entry_changed (BonoboListener *listener,
{
EMsgComposerHdrs *hdrs = E_MSG_COMPOSER_HDRS (user_data);
- hdrs->has_changed = TRUE;
+ gtk_signal_emit (GTK_OBJECT (hdrs), signals[HDRS_CHANGED]);
}
static GtkWidget *
@@ -262,14 +263,13 @@ entry_changed (GtkWidget *entry, EMsgComposerHdrs *hdrs)
gchar *tmp;
gchar *subject;
- /* Mark the composer as changed so it prompts to save on close */
- hdrs->has_changed = TRUE;
-
tmp = e_msg_composer_hdrs_get_subject (hdrs);
subject = e_utf8_to_gtk_string (GTK_WIDGET (entry), tmp);
gtk_signal_emit (GTK_OBJECT (hdrs), signals[SUBJECT_CHANGED], subject);
g_free (tmp);
+
+ gtk_signal_emit (GTK_OBJECT (hdrs), signals[HDRS_CHANGED]);
}
static GtkWidget *
@@ -448,6 +448,15 @@ class_init (EMsgComposerHdrsClass *class)
GTK_TYPE_NONE,
1, GTK_TYPE_STRING);
+ signals[HDRS_CHANGED] =
+ gtk_signal_new ("hdrs_changed",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EMsgComposerHdrsClass,
+ hdrs_changed),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
@@ -475,8 +484,6 @@ init (EMsgComposerHdrs *hdrs)
hdrs->priv = priv;
hdrs->account = NULL;
-
- hdrs->has_changed = FALSE;
}
diff --git a/composer/e-msg-composer-hdrs.h b/composer/e-msg-composer-hdrs.h
index dc48356c06..9b1c5c4c84 100644
--- a/composer/e-msg-composer-hdrs.h
+++ b/composer/e-msg-composer-hdrs.h
@@ -60,6 +60,8 @@ struct _EMsgComposerHdrsClass {
void (* show_address_dialog) (EMsgComposerHdrs *hdrs);
void (* subject_changed) (EMsgComposerHdrs *hdrs, gchar *subject);
+
+ void (* hdrs_changed) (EMsgComposerHdrs *hdrs);
};
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 85ba03651b..ef4b8414f2 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -807,7 +807,7 @@ exit_dialog_cb (int reply, EMsgComposer *composer)
default:
}
}
-
+
static void
do_exit (EMsgComposer *composer)
{
@@ -815,7 +815,7 @@ do_exit (EMsgComposer *composer)
GtkWidget *label;
gint button;
- if (E_MSG_COMPOSER_HDRS (composer->hdrs)->has_changed) {
+ if (composer->has_changed) {
dialog = gnome_dialog_new (_("Evolution"),
GNOME_STOCK_BUTTON_YES, /* Save */
GNOME_STOCK_BUTTON_NO, /* Don't save */
@@ -1271,6 +1271,9 @@ attachment_bar_changed_cb (EMsgComposerAttachmentBar *bar,
e_msg_composer_show_attachments (composer, TRUE);
else
e_msg_composer_show_attachments (composer, FALSE);
+
+ /* Mark the composer as changed so it prompts about unsaved changes on close */
+ e_msg_composer_set_changed (composer);
}
static void
@@ -1290,6 +1293,18 @@ subject_changed_cb (EMsgComposerHdrs *hdrs,
g_free (subject);
}
+static void
+hdrs_changed_cb (EMsgComposerHdrs *hdrs,
+ void *data)
+{
+ EMsgComposer *composer;
+
+ composer = E_MSG_COMPOSER (data);
+
+ /* Mark the composer as changed so it prompts about unsaved changes on close */
+ e_msg_composer_set_changed (composer);
+}
+
/* GtkObject methods. */
@@ -1459,6 +1474,8 @@ init (EMsgComposer *composer)
composer->send_html = FALSE;
composer->pgp_sign = FALSE;
composer->pgp_encrypt = FALSE;
+
+ composer->has_changed = FALSE;
}
@@ -1523,6 +1540,8 @@ e_msg_composer_construct (EMsgComposer *composer)
gtk_box_pack_start (GTK_BOX (vbox), composer->hdrs, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (composer->hdrs), "subject_changed",
GTK_SIGNAL_FUNC (subject_changed_cb), composer);
+ gtk_signal_connect (GTK_OBJECT (composer->hdrs), "hdrs_changed",
+ GTK_SIGNAL_FUNC (hdrs_changed_cb), composer);
gtk_widget_show (composer->hdrs);
/* Editor component. */
@@ -2338,3 +2357,35 @@ e_msg_composer_guess_mime_type (const gchar *file_name)
} else
return NULL;
}
+
+/**
+ * e_msg_composer_set_changed:
+ * @composer: An EMsgComposer object.
+ *
+ * Mark the composer as changed, so before the composer gets destroyed
+ * the user will be prompted about unsaved changes.
+ **/
+void
+e_msg_composer_set_changed (EMsgComposer *composer)
+{
+ g_return_if_fail (composer != NULL);
+ g_return_if_fail (E_IS_MSG_COMPOSER (composer));
+
+ composer->has_changed = TRUE;
+}
+
+/**
+ * e_msg_composer_unset_changed:
+ * @composer: An EMsgComposer object.
+ *
+ * Mark the composer as unchanged, so no prompt about unsaved changes
+ * will appear before destroying the composer.
+ **/
+void
+e_msg_composer_unset_changed (EMsgComposer *composer)
+{
+ g_return_if_fail (composer != NULL);
+ g_return_if_fail (E_IS_MSG_COMPOSER (composer));
+
+ composer->has_changed = FALSE;
+}
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 428bd9f110..ef60ebd1e4 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -77,6 +77,8 @@ struct _EMsgComposer {
gboolean send_html : 1;
gboolean pgp_sign : 1;
gboolean pgp_encrypt : 1;
+
+ gboolean has_changed : 1;
};
struct _EMsgComposerClass {
@@ -128,6 +130,9 @@ gboolean e_msg_composer_get_pgp_encrypt (EMsgComposer *compose
void e_msg_composer_clear_inlined_table (EMsgComposer *composer);
gchar * e_msg_composer_guess_mime_type (const gchar *file_name);
+void e_msg_composer_set_changed (EMsgComposer *composer);
+void e_msg_composer_unset_changed (EMsgComposer *composer);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
052dceddcc501691fe2958f5653d05639e31435'>Bump PORTREVISION to have portmaster be re-installed with the fix commitedse2016-07-161-1/+1 * A read lock on the sqlite file used by pkg can lock out writers forse2016-07-161-0/+67 * - Update to version 3.3.0pawel2016-07-152-5/+6 * Fix ports-mgmt/portfind string management/searching issuesngie2016-07-142-0/+81 * ports-mgmt/dialog4ports: 0.1.5 -> 0.1.6pi2016-07-132-4/+5 * - Drop maintainership and deprecate: does not work with pkg(8)amdmi32016-07-111-1/+4 * Update to 2.17.3.marcus2016-07-082-5/+5 * Update to 1.8.7bapt2016-07-052-4/+4 * Update to 1.8.99.9:bapt2016-07-052-4/+4 * Move the release MANIFESTS to misc/freebsd-release-manifests.bdrewery2016-06-3050-342/+14 * Release 1.8.6bapt2016-06-253-18/+4 * Update to 1.8.99.8bapt2016-06-252-4/+4 * Fix debugging that crept inbdrewery2016-06-242-1/+20 * Fix debugging that crept inbdrewery2016-06-242-1/+20 * - Update to 3.0-1677-g146fc3fbdrewery2016-06-242-5/+5 * - Update to 3.1.14bdrewery2016-06-242-4/+4 * Update to 1.8.99.7bapt2016-06-232-4/+4 * - Update to 3.1.13bdrewery2016-06-233-9/+15 * ports-mgmt/synth: Upgrade version 1.40 => 1.41marino2016-06-212-4/+4 * Fix pkg upgrade -fbapt2016-06-132-0/+14 * ports-mgmt/synth: Upgrade version 1.34 => 1.40marino2016-06-123-16/+4 * - Update to checkin 3.0-1669-g5d15cfebdrewery2016-06-122-5/+5 * Change MAINTAINER from ports@toco-domains.de to tz@FreeBSD.orgtz2016-06-102-2/+2 * Update to 1.8.99.6bapt2016-06-102-4/+4 * Release 1.8.5bapt2016-06-103-24/+4 * Add a patch to fix grabbing mirror lists over httpsbapt2016-06-082-0/+20 * Update to 1.8.4bapt2016-06-052-4/+4 * Update to 1.8.99.5bapt2016-06-052-4/+4 * Ignore on the package buildersantoine2016-06-041-1/+7 * - Update to checkin 3.0-1668-g5880c23bdrewery2016-06-042-6/+6 * - Update to 3.0-1663-gf6c1badbdrewery2016-06-012-5/+5 * - Update to 3.0-1662-gc11d922bdrewery2016-06-012-5/+5 * Update WWW:skreuzer2016-05-311-2/+1 * update to 1.8.99.4bapt2016-05-312-4/+4 * Update to 1.8.99.3bapt2016-05-282-4/+4 * Update to version 1.07skreuzer2016-05-264-16/+5 * Remove expired misc/kdehier4 and update all of its consumers to not reference...rene2016-05-261-1/+1 * Update to 1.8.99.2bapt2016-05-262-4/+4 * Convert tab after WWW: in pkg-descrs to single space as per PHBamdmi32016-05-241-1/+1 * Update to 1.8.99.1bapt2016-05-242-4/+4 * Update to 1.8.3bapt2016-05-242-4/+4 * Do not check deinstall script results at all except if DEVELOPER_MODE is setbapt2016-05-232-4/+4 * Update to 1.8.1bapt2016-05-232-4/+4 * - Fix WWW linkmich2016-05-231-1/+1 * Release pkg 1.8.0bapt2016-05-224-7/+8 * - Update to 3.0-1659-gfdf5930bdrewery2016-05-212-5/+5 * - Update to 3.0-1658-g99b3286bdrewery2016-05-203-7/+7 * - Fix trailing whitespace in pkg-descrs, categories [p-x]*amdmi32016-05-19