diff options
Diffstat (limited to 'mail-client/sylpheed/files/sylpheed-3.7.0-signature-box.patch')
| -rw-r--r-- | mail-client/sylpheed/files/sylpheed-3.7.0-signature-box.patch | 267 |
1 files changed, 0 insertions, 267 deletions
diff --git a/mail-client/sylpheed/files/sylpheed-3.7.0-signature-box.patch b/mail-client/sylpheed/files/sylpheed-3.7.0-signature-box.patch deleted file mode 100644 index af8cdaa..0000000 --- a/mail-client/sylpheed/files/sylpheed-3.7.0-signature-box.patch +++ /dev/null | |||
| @@ -1,267 +0,0 @@ | |||
| 1 | diff -x .git -rupN sylpheed-3.7.0/libsylph/prefs_common.c sylpheed-3.7.0.new/libsylph/prefs_common.c | ||
| 2 | --- sylpheed-3.7.0/libsylph/prefs_common.c 2017-11-24 05:17:23.000000000 +0100 | ||
| 3 | +++ sylpheed-3.7.0.new/libsylph/prefs_common.c 2018-01-31 10:52:57.094885505 +0100 | ||
| 4 | @@ -406,6 +406,8 @@ static PrefParam param[] = { | ||
| 5 | P_BOOL}, | ||
| 6 | {"gpg_signature_popup", "FALSE", &prefs_common.gpg_signature_popup, | ||
| 7 | P_BOOL}, | ||
| 8 | + {"gpg_signature_popup_mode", "1", &prefs_common.gpg_signature_popup_mode, | ||
| 9 | + P_INT}, | ||
| 10 | {"store_passphrase", "FALSE", &prefs_common.store_passphrase, P_BOOL}, | ||
| 11 | {"store_passphrase_timeout", "0", | ||
| 12 | &prefs_common.store_passphrase_timeout, P_INT}, | ||
| 13 | diff -x .git -rupN sylpheed-3.7.0/libsylph/prefs_common.h sylpheed-3.7.0.new/libsylph/prefs_common.h | ||
| 14 | --- sylpheed-3.7.0/libsylph/prefs_common.h 2017-11-24 05:16:18.000000000 +0100 | ||
| 15 | +++ sylpheed-3.7.0.new/libsylph/prefs_common.h 2018-01-31 10:52:57.052886536 +0100 | ||
| 16 | @@ -243,6 +243,7 @@ struct _PrefsCommon | ||
| 17 | /* Privacy */ | ||
| 18 | gboolean auto_check_signatures; | ||
| 19 | gboolean gpg_signature_popup; | ||
| 20 | + gint gpg_signature_popup_mode; | ||
| 21 | gboolean store_passphrase; | ||
| 22 | gint store_passphrase_timeout; | ||
| 23 | gboolean passphrase_grab; | ||
| 24 | diff -x .git -rupN sylpheed-3.7.0/src/prefs_common_dialog.c sylpheed-3.7.0.new/src/prefs_common_dialog.c | ||
| 25 | --- sylpheed-3.7.0/src/prefs_common_dialog.c 2014-11-05 08:28:13.000000000 +0100 | ||
| 26 | +++ sylpheed-3.7.0.new/src/prefs_common_dialog.c 2018-01-31 10:52:57.184883295 +0100 | ||
| 27 | @@ -205,6 +205,7 @@ static struct JunkMail { | ||
| 28 | static struct Privacy { | ||
| 29 | GtkWidget *checkbtn_auto_check_signatures; | ||
| 30 | GtkWidget *checkbtn_gpg_signature_popup; | ||
| 31 | + GtkWidget *radiobtn_gpg_signature_all; | ||
| 32 | GtkWidget *checkbtn_store_passphrase; | ||
| 33 | GtkWidget *spinbtn_store_passphrase; | ||
| 34 | GtkObject *spinbtn_store_passphrase_adj; | ||
| 35 | @@ -314,6 +315,13 @@ static void prefs_common_attach_toolbtn_ | ||
| 36 | static void prefs_common_online_mode_set_data_from_radiobtn(PrefParam *pparam); | ||
| 37 | static void prefs_common_online_mode_set_radiobtn (PrefParam *pparam); | ||
| 38 | |||
| 39 | +#if USE_GPGME | ||
| 40 | +static void prefs_common_gpg_signature_popup_mode_set_data_from_radiobtn( | ||
| 41 | + PrefParam *pparam); | ||
| 42 | +static void prefs_common_gpg_signature_popup_mode_set_radiobtn( | ||
| 43 | + PrefParam *pparam); | ||
| 44 | +#endif | ||
| 45 | + | ||
| 46 | static PrefsUIData ui_data[] = { | ||
| 47 | /* Receive */ | ||
| 48 | {"autochk_newmail", &receive.checkbtn_autochk, | ||
| 49 | @@ -540,6 +548,9 @@ static PrefsUIData ui_data[] = { | ||
| 50 | prefs_set_data_from_toggle, prefs_set_toggle}, | ||
| 51 | {"gpg_signature_popup", &privacy.checkbtn_gpg_signature_popup, | ||
| 52 | prefs_set_data_from_toggle, prefs_set_toggle}, | ||
| 53 | + {"gpg_signature_popup_mode", &privacy.radiobtn_gpg_signature_all, | ||
| 54 | + prefs_common_gpg_signature_popup_mode_set_data_from_radiobtn, | ||
| 55 | + prefs_common_gpg_signature_popup_mode_set_radiobtn}, | ||
| 56 | {"store_passphrase", &privacy.checkbtn_store_passphrase, | ||
| 57 | prefs_set_data_from_toggle, prefs_set_toggle}, | ||
| 58 | {"store_passphrase_timeout", &privacy.spinbtn_store_passphrase, | ||
| 59 | @@ -2478,10 +2489,14 @@ static void prefs_privacy_create(void) | ||
| 60 | GtkWidget *vbox2; | ||
| 61 | GtkWidget *vbox3; | ||
| 62 | GtkWidget *hbox1; | ||
| 63 | + GtkWidget *vbox_sign_popup_mode; | ||
| 64 | + GtkWidget *hbox_sign_popup_mode; | ||
| 65 | GtkWidget *hbox_spc; | ||
| 66 | GtkWidget *label; | ||
| 67 | GtkWidget *checkbtn_auto_check_signatures; | ||
| 68 | GtkWidget *checkbtn_gpg_signature_popup; | ||
| 69 | + GtkWidget *radiobtn_gpg_signature_all; | ||
| 70 | + GtkWidget *radiobtn_gpg_signature_bad; | ||
| 71 | GtkWidget *checkbtn_store_passphrase; | ||
| 72 | GtkObject *spinbtn_store_passphrase_adj; | ||
| 73 | GtkWidget *spinbtn_store_passphrase; | ||
| 74 | @@ -2505,6 +2520,56 @@ static void prefs_privacy_create(void) | ||
| 75 | PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup, | ||
| 76 | _("Show signature check result in a popup window")); | ||
| 77 | |||
| 78 | + vbox_sign_popup_mode = gtk_vbox_new (FALSE, VSPACING_NARROW); | ||
| 79 | + gtk_widget_show (vbox_sign_popup_mode); | ||
| 80 | + gtk_box_pack_start (GTK_BOX (vbox2), vbox_sign_popup_mode, FALSE, FALSE, 0); | ||
| 81 | + | ||
| 82 | + hbox_sign_popup_mode = gtk_hbox_new (FALSE, 8); | ||
| 83 | + gtk_widget_show (hbox_sign_popup_mode); | ||
| 84 | + gtk_box_pack_start (GTK_BOX (vbox_sign_popup_mode), | ||
| 85 | + hbox_sign_popup_mode, | ||
| 86 | + FALSE, | ||
| 87 | + FALSE, | ||
| 88 | + 0); | ||
| 89 | + | ||
| 90 | + hbox_spc = gtk_hbox_new (FALSE, 0); | ||
| 91 | + gtk_widget_show (hbox_spc); | ||
| 92 | + gtk_box_pack_start (GTK_BOX (hbox_sign_popup_mode), | ||
| 93 | + hbox_spc, | ||
| 94 | + FALSE, | ||
| 95 | + FALSE, | ||
| 96 | + 0); | ||
| 97 | + gtk_widget_set_size_request (hbox_spc, 12, -1); | ||
| 98 | + | ||
| 99 | + radiobtn_gpg_signature_all = gtk_radio_button_new_with_label( | ||
| 100 | + NULL, | ||
| 101 | + _("All signatures")); | ||
| 102 | + gtk_widget_show(radiobtn_gpg_signature_all); | ||
| 103 | + gtk_box_pack_start(GTK_BOX (hbox_sign_popup_mode), | ||
| 104 | + radiobtn_gpg_signature_all, | ||
| 105 | + FALSE, | ||
| 106 | + FALSE, | ||
| 107 | + 0); | ||
| 108 | + g_object_set_data(G_OBJECT (radiobtn_gpg_signature_all), | ||
| 109 | + MENU_VAL_ID, | ||
| 110 | + GINT_TO_POINTER (1)); | ||
| 111 | + | ||
| 112 | + radiobtn_gpg_signature_bad = gtk_radio_button_new_with_label_from_widget( | ||
| 113 | + GTK_RADIO_BUTTON (radiobtn_gpg_signature_all), | ||
| 114 | + _("Bad signatures only")); | ||
| 115 | + gtk_widget_show(radiobtn_gpg_signature_bad); | ||
| 116 | + gtk_box_pack_start(GTK_BOX (hbox_sign_popup_mode), | ||
| 117 | + radiobtn_gpg_signature_bad, | ||
| 118 | + FALSE, | ||
| 119 | + FALSE, | ||
| 120 | + 0); | ||
| 121 | + g_object_set_data(G_OBJECT (radiobtn_gpg_signature_bad), | ||
| 122 | + MENU_VAL_ID, | ||
| 123 | + GINT_TO_POINTER (0)); | ||
| 124 | + | ||
| 125 | + SET_TOGGLE_SENSITIVITY (checkbtn_gpg_signature_popup, | ||
| 126 | + hbox_sign_popup_mode); | ||
| 127 | + | ||
| 128 | PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase, | ||
| 129 | _("Store passphrase in memory temporarily")); | ||
| 130 | |||
| 131 | @@ -2572,7 +2637,8 @@ static void prefs_privacy_create(void) | ||
| 132 | = checkbtn_auto_check_signatures; | ||
| 133 | privacy.checkbtn_gpg_signature_popup | ||
| 134 | = checkbtn_gpg_signature_popup; | ||
| 135 | - privacy.checkbtn_store_passphrase = checkbtn_store_passphrase; | ||
| 136 | + privacy.radiobtn_gpg_signature_all = radiobtn_gpg_signature_all; | ||
| 137 | + privacy.checkbtn_store_passphrase = checkbtn_store_passphrase; | ||
| 138 | privacy.spinbtn_store_passphrase = spinbtn_store_passphrase; | ||
| 139 | privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj; | ||
| 140 | #ifndef G_OS_WIN32 | ||
| 141 | @@ -4719,6 +4785,60 @@ static void prefs_common_online_mode_set | ||
| 142 | } | ||
| 143 | } | ||
| 144 | |||
| 145 | +#if USE_GPGME | ||
| 146 | +static void prefs_common_gpg_signature_popup_mode_set_data_from_radiobtn( | ||
| 147 | + PrefParam *pparam) | ||
| 148 | +{ | ||
| 149 | + PrefsUIData *ui_data; | ||
| 150 | + GtkRadioButton *radiobtn; | ||
| 151 | + GSList *group; | ||
| 152 | + | ||
| 153 | + ui_data = (PrefsUIData *)pparam->ui_data; | ||
| 154 | + g_return_if_fail(ui_data != NULL); | ||
| 155 | + g_return_if_fail(*ui_data->widget != NULL); | ||
| 156 | + | ||
| 157 | + radiobtn = GTK_RADIO_BUTTON(*ui_data->widget); | ||
| 158 | + group = gtk_radio_button_get_group(radiobtn); | ||
| 159 | + while (group != NULL) { | ||
| 160 | + GtkToggleButton *btn = GTK_TOGGLE_BUTTON(group->data); | ||
| 161 | + | ||
| 162 | + if (gtk_toggle_button_get_active(btn)) { | ||
| 163 | + prefs_common.gpg_signature_popup_mode = | ||
| 164 | + GPOINTER_TO_INT(g_object_get_data(G_OBJECT(btn), MENU_VAL_ID)); | ||
| 165 | + break; | ||
| 166 | + } | ||
| 167 | + group = group->next; | ||
| 168 | + } | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +static void prefs_common_gpg_signature_popup_mode_set_radiobtn( | ||
| 172 | + PrefParam *pparam) | ||
| 173 | +{ | ||
| 174 | + PrefsUIData *ui_data; | ||
| 175 | + GtkRadioButton *radiobtn; | ||
| 176 | + GSList *group; | ||
| 177 | + | ||
| 178 | + ui_data = (PrefsUIData *)pparam->ui_data; | ||
| 179 | + g_return_if_fail(ui_data != NULL); | ||
| 180 | + g_return_if_fail(*ui_data->widget != NULL); | ||
| 181 | + | ||
| 182 | + radiobtn = GTK_RADIO_BUTTON(*ui_data->widget); | ||
| 183 | + group = gtk_radio_button_get_group(radiobtn); | ||
| 184 | + while (group != NULL) { | ||
| 185 | + GtkToggleButton *btn = GTK_TOGGLE_BUTTON(group->data); | ||
| 186 | + gint data; | ||
| 187 | + | ||
| 188 | + data = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(btn), | ||
| 189 | + MENU_VAL_ID)); | ||
| 190 | + if (data == prefs_common.gpg_signature_popup_mode) { | ||
| 191 | + gtk_toggle_button_set_active(btn, TRUE); | ||
| 192 | + break; | ||
| 193 | + } | ||
| 194 | + group = group->next; | ||
| 195 | + } | ||
| 196 | +} | ||
| 197 | +#endif | ||
| 198 | + | ||
| 199 | static void prefs_common_dispitem_clicked(void) | ||
| 200 | { | ||
| 201 | prefs_summary_column_open(FOLDER_ITEM_IS_SENT_FOLDER | ||
| 202 | diff -x .git -rupN sylpheed-3.7.0/src/rfc2015.c sylpheed-3.7.0.new/src/rfc2015.c | ||
| 203 | --- sylpheed-3.7.0/src/rfc2015.c 2014-03-26 06:55:35.000000000 +0100 | ||
| 204 | +++ sylpheed-3.7.0.new/src/rfc2015.c 2018-01-31 11:10:44.946662147 +0100 | ||
| 205 | @@ -210,8 +210,12 @@ static void check_signature(MimeInfo *mi | ||
| 206 | gchar *tmp_file; | ||
| 207 | gint n_exclude_chars = 0; | ||
| 208 | |||
| 209 | - if (prefs_common.gpg_signature_popup) | ||
| 210 | + if (prefs_common.gpg_signature_popup && | ||
| 211 | + prefs_common.gpg_signature_popup_mode == 1) | ||
| 212 | + { | ||
| 213 | + /* FIXME: Perhaps some macro instead of 1 */ | ||
| 214 | statuswindow = gpgmegtk_sig_status_create(); | ||
| 215 | + } | ||
| 216 | |||
| 217 | err = gpgme_new(&ctx); | ||
| 218 | if (err) { | ||
| 219 | @@ -309,8 +313,21 @@ leave: | ||
| 220 | result = _("Error verifying the signature"); | ||
| 221 | } | ||
| 222 | debug_print("verification status: %s\n", result); | ||
| 223 | - if (prefs_common.gpg_signature_popup) | ||
| 224 | + if (prefs_common.gpg_signature_popup && | ||
| 225 | + prefs_common.gpg_signature_popup_mode == 1) | ||
| 226 | + { | ||
| 227 | + /* FIXME: Perhaps some macro instead of 1 */ | ||
| 228 | + gpgmegtk_sig_status_update(statuswindow, ctx); | ||
| 229 | + } else if (prefs_common.gpg_signature_popup && | ||
| 230 | + verifyresult->signatures->status != GPG_ERR_NO_DATA && | ||
| 231 | + verifyresult->signatures->status != GPG_ERR_NO_ERROR) | ||
| 232 | + { | ||
| 233 | + /* prefs_common.gpg_signature_popup_mode == 0 is useless as long as | ||
| 234 | + * there are only two modes (0 and 1) | ||
| 235 | + */ | ||
| 236 | + statuswindow = gpgmegtk_sig_status_create(); | ||
| 237 | gpgmegtk_sig_status_update(statuswindow, ctx); | ||
| 238 | + } | ||
| 239 | |||
| 240 | g_free (partinfo->sigstatus); | ||
| 241 | partinfo->sigstatus = g_strdup (result); | ||
| 242 | @@ -319,8 +336,11 @@ leave: | ||
| 243 | gpgme_data_release(text); | ||
| 244 | if (ctx) | ||
| 245 | gpgme_release(ctx); | ||
| 246 | - if (prefs_common.gpg_signature_popup) | ||
| 247 | + if (prefs_common.gpg_signature_popup) { | ||
| 248 | + /* gpgmegtk_sig_status_destroy handles NULL params so no complicated | ||
| 249 | + check is needed */ | ||
| 250 | gpgmegtk_sig_status_destroy(statuswindow); | ||
| 251 | + } | ||
| 252 | } | ||
| 253 | |||
| 254 | /* | ||
| 255 | @@ -427,7 +447,11 @@ static gpgme_data_t pgp_decrypt(MsgInfo | ||
| 256 | debug_print("verification status: %s\n", result); | ||
| 257 | debug_print("full status: %s\n", | ||
| 258 | msginfo->encinfo->sigstatus_full); | ||
| 259 | - if (prefs_common.gpg_signature_popup) { | ||
| 260 | + if (prefs_common.gpg_signature_popup && | ||
| 261 | + ((prefs_common.gpg_signature_popup_mode == 1) || | ||
| 262 | + (verifyresult->signatures->status != GPG_ERR_NO_DATA && | ||
| 263 | + verifyresult->signatures->status != GPG_ERR_NO_ERROR))) | ||
| 264 | + { | ||
| 265 | GpgmegtkSigStatus statuswindow; | ||
| 266 | statuswindow = gpgmegtk_sig_status_create(); | ||
| 267 | gpgmegtk_sig_status_update(statuswindow, ctx); | ||
