aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-hdrs.c
diff options
context:
space:
mode:
authorJason Leach <jasonleach@usa.net>2001-01-18 11:15:16 +0800
committerJacob Leach <jleach@src.gnome.org>2001-01-18 11:15:16 +0800
commit809a9d80148789de20f4d00ec49dce7ead5a3399 (patch)
tree38c36623b45e568243d3675795278a5cca88063c /composer/e-msg-composer-hdrs.c
parentd184f178b8ede3b173789195ba22a243da08fc42 (diff)
downloadgsoc2013-evolution-809a9d80148789de20f4d00ec49dce7ead5a3399.tar.gz
gsoc2013-evolution-809a9d80148789de20f4d00ec49dce7ead5a3399.tar.zst
gsoc2013-evolution-809a9d80148789de20f4d00ec49dce7ead5a3399.zip
(Bug #1192: Set the Composer window title to something useful)
2001-01-17 Jason Leach <jasonleach@usa.net> (Bug #1192: Set the Composer window title to something useful) * e-msg-composer.c (e_msg_composer_construct): Connect up the new signal here. (subject_changed_cb): Set the composer window title to the subject as it's changed, or if it goes blank make it the default "Compose a message". * e-msg-composer-hdrs.c (class_init): Create a new signal "subject_changed". (entry_changed): Emit the signal here when the subject entry is changed. svn path=/trunk/; revision=7610
Diffstat (limited to 'composer/e-msg-composer-hdrs.c')
-rw-r--r--composer/e-msg-composer-hdrs.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 862938f665..66aa80a88b 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -67,6 +67,7 @@ static GtkTableClass *parent_class = NULL;
enum {
SHOW_ADDRESS_DIALOG,
+ SUBJECT_CHANGED,
LAST_SIGNAL
};
@@ -228,8 +229,17 @@ create_addressbook_entry (EMsgComposerHdrs *hdrs,
static void
entry_changed (GtkWidget *entry, EMsgComposerHdrs *hdrs)
{
- /* Set the has_changed var to TRUE */
+ gchar *tmp;
+ gchar *subject;
+
+ /* Mark the headers as changed */
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);
}
static GtkWidget *
@@ -248,7 +258,7 @@ add_header (EMsgComposerHdrs *hdrs,
if (type == HEADER_ADDRBOOK) {
label = gtk_button_new_with_label (name);
- GTK_OBJECT_UNSET_FLAGS(label, GTK_CAN_FOCUS);
+ GTK_OBJECT_UNSET_FLAGS (label, GTK_CAN_FOCUS);
gtk_signal_connect (GTK_OBJECT (label), "clicked",
GTK_SIGNAL_FUNC (address_button_clicked_cb),
hdrs);
@@ -274,13 +284,14 @@ add_header (EMsgComposerHdrs *hdrs,
case HEADER_OPTIONMENU:
entry = create_optionmenu (hdrs, name);
break;
+ case HEADER_ENTRYBOX:
default:
entry = e_entry_new ();
- gtk_object_set(GTK_OBJECT(entry),
- "editable", TRUE,
- "use_ellipsis", TRUE,
- "allow_newlines", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT(entry),
+ "editable", TRUE,
+ "use_ellipsis", TRUE,
+ "allow_newlines", FALSE,
+ NULL);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
GTK_SIGNAL_FUNC (entry_changed), hdrs);
}
@@ -397,6 +408,16 @@ class_init (EMsgComposerHdrsClass *class)
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
+ signals[SUBJECT_CHANGED] =
+ gtk_signal_new ("subject_changed",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EMsgComposerHdrsClass,
+ subject_changed),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE,
+ 1, GTK_TYPE_STRING);
+
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}