[prev in list] [next in list] [prev in thread] [next in thread]
List: sylpheed
Subject: [sylpheed:25788] [PATCH] Yet more mail subject in compose title bar
From: Thomas White <taw27 () cam ! ac ! uk>
Date: 2005-09-25 23:21:07
Message-ID: 20050926002107.98f917c0.taw27 () cam ! ac ! uk
[Download RAW message or body]
This is a new version of the patch I submitted last night, but fixed
such that it actually works.
Previously, I'd only been thinking about the scenario where a blank
email is created and a subject entered from scratch. This time, the
patch sets the title bar correctly in situations where the subject line
isn't empty when the compose window is created - such as when replying
or forwarding.
Thanks,
Tom
--
Thomas White
Downing College
Cambridge
GPG: 1024D / D8834197
9749 7C8A 037D F867 9F38 F7C0 2314 8F97 D883 4197
["sylpheed-composetitle_2-2.1.2.patch" (application/octet-stream)]
diff -urN sylpheed-2.1.2-clean/libsylph/prefs_account.c sylpheed-2.1.2+composetitle/libsylph/prefs_account.c
--- sylpheed-2.1.2-clean/libsylph/prefs_account.c 2005-09-15 17:02:35.000000000 +0100
+++ sylpheed-2.1.2+composetitle/libsylph/prefs_account.c 2005-09-25 00:22:50.000000000 +0100
@@ -85,6 +85,7 @@
{"auto_bcc", NULL, &tmp_ac_prefs.auto_bcc, P_STRING},
{"set_autoreplyto", "FALSE", &tmp_ac_prefs.set_autoreplyto, P_BOOL},
{"auto_replyto", NULL, &tmp_ac_prefs.auto_replyto, P_STRING},
+ {"subject_title", "FALSE", &tmp_ac_prefs.subject_title, P_BOOL},
/* Privacy */
{"default_sign", "FALSE", &tmp_ac_prefs.default_sign, P_BOOL},
diff -urN sylpheed-2.1.2-clean/libsylph/prefs_account.h sylpheed-2.1.2+composetitle/libsylph/prefs_account.h
--- sylpheed-2.1.2-clean/libsylph/prefs_account.h 2005-09-15 17:02:35.000000000 +0100
+++ sylpheed-2.1.2+composetitle/libsylph/prefs_account.h 2005-09-25 00:21:42.000000000 +0100
@@ -120,6 +120,7 @@
gchar *auto_bcc;
gboolean set_autoreplyto;
gchar *auto_replyto;
+ gboolean subject_title;
/* Privacy */
gboolean default_sign;
diff -urN sylpheed-2.1.2-clean/src/compose.c sylpheed-2.1.2+composetitle/src/compose.c
--- sylpheed-2.1.2-clean/src/compose.c 2005-09-15 17:02:38.000000000 +0100
+++ sylpheed-2.1.2+composetitle/src/compose.c 2005-09-26 00:13:00.814288428 +0100
@@ -706,6 +706,8 @@
compose_connect_changed_callbacks(compose);
+ compose_set_title(compose);
+
if (prefs_common.auto_exteditor)
compose_exec_ext_editor(compose);
}
@@ -785,6 +787,8 @@
compose_connect_changed_callbacks(compose);
+ compose_set_title(compose);
+
#if USE_GPGME
if (account->encrypt_reply &&
MSG_IS_ENCRYPTED(compose->replyinfo->flags)) {
@@ -905,6 +909,8 @@
compose_connect_changed_callbacks(compose);
+ compose_set_title(compose);
+
if (account->protocol != A_NNTP)
gtk_widget_grab_focus(compose->to_entry);
else
@@ -974,6 +980,8 @@
undo_unblock(compose->undostruct);
compose_connect_changed_callbacks(compose);
+
+ compose_set_title(compose);
}
void compose_reedit(MsgInfo *msginfo)
@@ -1041,6 +1049,8 @@
compose_connect_changed_callbacks(compose);
+ compose_set_title(compose);
+
if (prefs_common.auto_exteditor)
compose_exec_ext_editor(compose);
}
@@ -2357,13 +2367,19 @@
{
gchar *str;
gchar *edited;
-
+ const gchar *subject;
+
+ subject = gtk_entry_get_text(GTK_ENTRY(compose->subject_entry));
edited = compose->modified ? _(" [Edited]") : "";
- if (compose->account && compose->account->address)
- str = g_strdup_printf(_("%s - Compose message%s"),
- compose->account->address, edited);
- else
- str = g_strdup_printf(_("Compose message%s"), edited);
+ if ( compose->account && compose->account->subject_title && strlen(subject) ) {
+ str = g_strdup_printf(_("%s - Compose message%s"), subject, edited);
+ } else {
+ if (compose->account && compose->account->address)
+ str = g_strdup_printf(_("%s - Compose message%s"),
+ compose->account->address, edited);
+ else
+ str = g_strdup_printf(_("Compose message%s"), edited);
+ }
gtk_window_set_title(GTK_WINDOW(compose->window), str);
g_free(str);
}
@@ -6029,8 +6045,8 @@
{
if (compose->modified == FALSE) {
compose->modified = TRUE;
- compose_set_title(compose);
}
+ compose_set_title(compose);
}
static void compose_wrap_cb(gpointer data, guint action, GtkWidget *widget)
diff -urN sylpheed-2.1.2-clean/src/prefs_account_dialog.c sylpheed-2.1.2+composetitle/src/prefs_account_dialog.c
--- sylpheed-2.1.2-clean/src/prefs_account_dialog.c 2005-09-15 17:02:38.000000000 +0100
+++ sylpheed-2.1.2+composetitle/src/prefs_account_dialog.c 2005-09-25 00:30:45.000000000 +0100
@@ -126,6 +126,8 @@
GtkWidget *autobcc_entry;
GtkWidget *autoreplyto_chkbtn;
GtkWidget *autoreplyto_entry;
+
+ GtkWidget *subjecttitle_chkbtn;
} compose;
#if USE_GPGME
@@ -301,6 +303,8 @@
prefs_set_data_from_toggle, prefs_set_toggle},
{"auto_replyto", &compose.autoreplyto_entry,
prefs_set_data_from_entry, prefs_set_entry},
+ {"subject_title", &compose.subjecttitle_chkbtn,
+ prefs_set_data_from_toggle, prefs_set_toggle},
#if USE_GPGME
/* Privacy */
@@ -1179,6 +1183,7 @@
GtkWidget *autobcc_entry;
GtkWidget *autoreplyto_chkbtn;
GtkWidget *autoreplyto_entry;
+ GtkWidget *subjecttitle_chkbtn;
vbox1 = gtk_vbox_new (FALSE, VSPACING);
gtk_widget_show (vbox1);
@@ -1263,16 +1268,18 @@
SET_TOGGLE_SENSITIVITY (autoreplyto_chkbtn, autoreplyto_entry);
+ PACK_CHECK_BUTTON (vbox1, subjecttitle_chkbtn, _("Display subject in title bar"));
compose.sigfile_radiobtn = sigfile_radiobtn;
compose.sigpath_entry = sigpath_entry;
- compose.autocc_chkbtn = autocc_chkbtn;
- compose.autocc_entry = autocc_entry;
- compose.autobcc_chkbtn = autobcc_chkbtn;
- compose.autobcc_entry = autobcc_entry;
- compose.autoreplyto_chkbtn = autoreplyto_chkbtn;
- compose.autoreplyto_entry = autoreplyto_entry;
+ compose.autocc_chkbtn = autocc_chkbtn;
+ compose.autocc_entry = autocc_entry;
+ compose.autobcc_chkbtn = autobcc_chkbtn;
+ compose.autobcc_entry = autobcc_entry;
+ compose.autoreplyto_chkbtn = autoreplyto_chkbtn;
+ compose.autoreplyto_entry = autoreplyto_entry;
+ compose.subjecttitle_chkbtn = subjecttitle_chkbtn;
}
#if USE_GPGME
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic