From ced3f5dcf315c6ca93df4df992ab43e4bc946274 Mon Sep 17 00:00:00 2001 From: Andreas Grapentin Date: Wed, 29 Nov 2017 19:00:15 +0100 Subject: nonprism/claws-mail: updated to 3.15.1 --- nonprism/claws-mail/PKGBUILD | 66 +- .../claws-mail/claws-mail-3.15.1-libical3.patch | 83 + nonprism/claws-mail/dillo-plugin.diff | 2706 ++++++++++++++------ nonprism/claws-mail/enchant-2.patch | 11 + 4 files changed, 2044 insertions(+), 822 deletions(-) create mode 100644 nonprism/claws-mail/claws-mail-3.15.1-libical3.patch create mode 100644 nonprism/claws-mail/enchant-2.patch (limited to 'nonprism/claws-mail') diff --git a/nonprism/claws-mail/PKGBUILD b/nonprism/claws-mail/PKGBUILD index f4932ddfe..5ac31f985 100644 --- a/nonprism/claws-mail/PKGBUILD +++ b/nonprism/claws-mail/PKGBUILD @@ -1,21 +1,24 @@ -# $Id: PKGBUILD 288058 2017-02-05 09:28:56Z andyrtr $ +# Maintainer: Andreas Grapentin # Maintainer (Arch): Andreas Radke -# Maintainer: Márcio Silva +# Contributor: Márcio Silva pkgname=claws-mail -pkgver=3.14.1 + +pkgver=3.15.1 pkgrel=3.nonprism1 +arch=(i686 x86_64 armv7h) + pkgdesc="A GTK+ based e-mail client, without libgdata support" -arch=('i686' 'x86_64' 'armv7h') -license=('GPL3') url="http://www.claws-mail.org" -depends=('gtk2' 'gnutls' 'startup-notification' 'enchant' 'gpgme' 'libetpan' 'compface' - 'libsm' 'dbus-glib' 'hicolor-icon-theme' 'desktop-file-utils') -makedepends=('spamassassin' 'bogofilter' 'valgrind' +license=(GPL3) + +depends=(gtk2 gnutls startup-notification enchant gpgme libetpan compface + libsm dbus-glib hicolor-icon-theme desktop-file-utils) +makedepends=(spamassassin bogofilter valgrind # dependencies for plugins - 'libnotify' 'libcanberra' 'poppler-glib' 'pygtk' 'dillo' + libnotify libcanberra poppler-glib pygtk libytnef libical dillo # deps to build the docs - 'docbook-utils') + docbook-utils) #'libchamplain' needed for geolocation plugin, disabled for now - most time it's not compatible with current gnome releases optdepends=('python2: needed for some tools and python plugin' 'perl: needed for some tools and perl plugin' @@ -30,31 +33,39 @@ optdepends=('python2: needed for some tools and python plugin' 'libytnef: for tnef_parse plugin' 'poppler-glib: for pdf viewer plugin' 'ghostscript: for pdf viewer plugin' + 'libical: for vcalendar plugin' 'dillo: for html viewer plugin') -replaces=('sylpheed-claws' 'claws-mail-extra-plugins' 'claws-mail-libre' 'claws-mail-libre-nonprism' 'claws-mail-nonprism') -conflicts=('claws-mail-extra-plugins' 'claws-mail-libre' 'claws-mail-libre-nonprism' 'claws-mail-nonprism') -provides=('claws') +replaces=(sylpheed-claws claws-mail-extra-plugins claws-mail-libre claws-mail-libre-nonprism claws-mail-nonprism) +conflicts=(claws-mail-extra-plugins claws-mail-libre claws-mail-libre-nonprism claws-mail-nonprism) +provides=(claws) + source=(http://www.claws-mail.org/download.php?file=releases/claws-mail-$pkgver.tar.xz{,.asc} - dillo-plugin.diff) -sha256sums=('b79a1dc04f0b3d1f693e84d7fa7282f140fb5280179281445a8b954ce423c335' + dillo-plugin.diff + enchant-2.patch + claws-mail-3.15.1-libical3.patch) +sha256sums=('8d093c2f32db863c1141d56e35424c04ee48fe5d6adf4c7f349f647fa3149542' 'SKIP' - 'e58fde187b53ce12d4cb711a11ad2c6f5c3d152253e07999710decfd414b14ce') + '4913d101aa32a69afda7ffb17eb23dce8580bfb619e28cc271f4ea10ce39cc5d' + 'fafd9713b265b55a84b01e5071d930965b98d34cde57be4aaa46c5eb6c2635ce' + '160cb7a3ac057c5a8f65427adc152f53abd372eeaf1b371e9a99bfcb741a793f') validpgpkeys=('8B3B297A03468356692F8D592CD716D654D6BBD4') # Paul prepare() { - cd ${pkgname}-${pkgver} + cd $pkgname-$pkgver # upstream reintroduction of dillo plugin - after fancy plugin dropped patch -Np1 -i ../dillo-plugin.diff + patch -Np1 -i ../enchant-2.patch + patch -Np1 -i ../claws-mail-3.15.1-libical3.patch autoreconf -vfi + sed -i 's@^#!.*python.*@#!/usr/bin/python2@' tools/*.py + sed -i 's:python -c:python2 -c:g' configure } build() { - cd ${pkgname}-${pkgver} + cd $pkgname-$pkgver # fixes for python2 export PYTHON="/usr/bin/python2" - sed -i 's@^#!.*python.*@#!/usr/bin/python2@' tools/*.py - sed -i 's:python -c:python2 -c:g' configure ./configure --prefix=/usr --disable-static \ --enable-enchant \ @@ -65,19 +76,18 @@ build() { --enable-spamassassin-plugin \ --enable-bogofilter-plugin \ --disable-gdata-plugin #--help + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make } package() { - cd ${pkgname}-${pkgver} - make DESTDIR=${pkgdir} install + cd $pkgname-$pkgver + make DESTDIR="$pkgdir" install - # build and install extra tools + # install extra tools cd tools - make - # all executables and .conf files ; only top directory - find -maxdepth 1 -type f -and -perm /111 -or -name '*.conf' | while read i ; do - install -D -m755 ${i} \ - ${pkgdir}/usr/lib/claws-mail/tools/${i} + install -m755 -d $pkgdir/usr/lib/claws-mail/tools + for files in *.pl *.py *.sh kdeservicemenu multiwebsearch.conf tb2claws-mail update-po uudec uuooffice README; do + cp -arv $files $pkgdir/usr/lib/claws-mail/tools/$i done } diff --git a/nonprism/claws-mail/claws-mail-3.15.1-libical3.patch b/nonprism/claws-mail/claws-mail-3.15.1-libical3.patch new file mode 100644 index 000000000..85cb8e92d --- /dev/null +++ b/nonprism/claws-mail/claws-mail-3.15.1-libical3.patch @@ -0,0 +1,83 @@ +diff -Nur claws-mail-3.15.1-orig/src/plugins/vcalendar/vcalendar.c claws-mail-3.15.1/src/plugins/vcalendar/vcalendar.c +--- claws-mail-3.15.1-orig/src/plugins/vcalendar/vcalendar.c 2017-08-28 19:48:24.000000000 +0200 ++++ claws-mail-3.15.1/src/plugins/vcalendar/vcalendar.c 2017-11-16 17:51:01.139709415 +0100 +@@ -157,8 +157,8 @@ + gchar *orgname = NULL; + gchar *summary = g_strdup(msginfo->subject ? msginfo->subject:_("no subject")); + gchar *description = file_read_stream_to_str(fp); +- gchar *dtstart = g_strdup(icaltime_as_ical_string(icaltime_from_timet(t, FALSE))); +- gchar *dtend = g_strdup(icaltime_as_ical_string(icaltime_from_timet(t2, FALSE))); ++ gchar *dtstart = g_strdup(icaltime_as_ical_string(icaltime_from_timet_with_zone(t, FALSE,NULL))); ++ gchar *dtend = g_strdup(icaltime_as_ical_string(icaltime_from_timet_with_zone(t2, FALSE,NULL))); + gchar *recur = NULL; + gchar *tzid = g_strdup("UTC"); + gchar *url = NULL; +diff -Nur claws-mail-3.15.1-orig/src/plugins/vcalendar/vcal_manager.c claws-mail-3.15.1/src/plugins/vcalendar/vcal_manager.c +--- claws-mail-3.15.1-orig/src/plugins/vcalendar/vcal_manager.c 2017-08-28 19:48:24.000000000 +0200 ++++ claws-mail-3.15.1/src/plugins/vcalendar/vcal_manager.c 2017-11-16 17:43:34.911106211 +0100 +@@ -395,7 +395,7 @@ + icalcomponent_add_property(ievent, + icalproperty_new_uid(event->uid)); + icalcomponent_add_property(ievent, +- icalproperty_vanew_dtstamp(icaltime_from_timet(time(NULL), TRUE), (void*)0)); ++ icalproperty_vanew_dtstamp(icaltime_from_timet_with_zone(time(NULL), TRUE, NULL), (void*)0)); + icalcomponent_add_property(ievent, + icalproperty_vanew_dtstart((icaltime_from_string(event->dtstart)), (void*)0)); + icalcomponent_add_property(ievent, +@@ -423,9 +423,9 @@ + icalcomponent_add_property(ievent, + icalproperty_new_status(ICAL_STATUS_CONFIRMED)); + icalcomponent_add_property(ievent, +- icalproperty_vanew_created(icaltime_from_timet(time(NULL), TRUE), (void*)0)); ++ icalproperty_vanew_created(icaltime_from_timet_with_zone(time(NULL), TRUE, NULL), (void*)0)); + icalcomponent_add_property(ievent, +- icalproperty_vanew_lastmodified(icaltime_from_timet(time(NULL), TRUE), (void*)0)); ++ icalproperty_vanew_lastmodified(icaltime_from_timet_with_zone(time(NULL), TRUE, NULL), (void*)0)); + icalcomponent_add_property(ievent, + orgprop); + +diff -Nur claws-mail-3.15.1-orig/src/plugins/vcalendar/vcal_meeting_gtk.c claws-mail-3.15.1/src/plugins/vcalendar/vcal_meeting_gtk.c +--- claws-mail-3.15.1-orig/src/plugins/vcalendar/vcal_meeting_gtk.c 2017-08-28 19:48:24.000000000 +0200 ++++ claws-mail-3.15.1/src/plugins/vcalendar/vcal_meeting_gtk.c 2017-11-16 17:54:45.798495950 +0100 +@@ -477,7 +477,7 @@ + debug_print("DST change offset to apply to time %d\n", dst_offset); + t += dst_offset; + debug_print("%s\n", ctime(&t)); +- return g_strdup(icaltime_as_ical_string(icaltime_from_timet(t, FALSE))); ++ return g_strdup(icaltime_as_ical_string(icaltime_from_timet_with_zone(t, FALSE,NULL))); + } + + static gchar *get_location(VCalMeeting *meet) +@@ -893,8 +893,8 @@ + found = FALSE; + while (!found && offset >= -3600*6) { + gboolean ok = TRUE; +- struct icaltimetype new_start = icaltime_from_timet(icaltime_as_timet(start)+offset, FALSE); +- struct icaltimetype new_end = icaltime_from_timet(icaltime_as_timet(end)+offset, FALSE); ++ struct icaltimetype new_start = icaltime_from_timet_with_zone(icaltime_as_timet(start)+offset, FALSE, NULL); ++ struct icaltimetype new_end = icaltime_from_timet_with_zone(icaltime_as_timet(end)+offset, FALSE, NULL); + for (cur = attendees; cur; cur = cur->next) { + VCalAttendee *attendee = (VCalAttendee *)cur->data; + debug_print("trying %s - %s (offset %d)\n", +@@ -919,8 +919,8 @@ + offset = 1800; + while (!found && offset <= 3600*6) { + gboolean ok = TRUE; +- struct icaltimetype new_start = icaltime_from_timet(icaltime_as_timet(start)+offset, FALSE); +- struct icaltimetype new_end = icaltime_from_timet(icaltime_as_timet(end)+offset, FALSE); ++ struct icaltimetype new_start = icaltime_from_timet_with_zone(icaltime_as_timet(start)+offset, FALSE, NULL); ++ struct icaltimetype new_end = icaltime_from_timet_with_zone(icaltime_as_timet(end)+offset, FALSE, NULL); + for (cur = attendees; cur; cur = cur->next) { + VCalAttendee *attendee = (VCalAttendee *)cur->data; + debug_print("trying %s - %s (offset %d)\n", +@@ -2172,8 +2172,8 @@ + + icalcomponent_add_component(calendar, timezone); + +- itt_start = icaltime_from_timet(whole_start, FALSE); +- itt_end = icaltime_from_timet(whole_end, FALSE); ++ itt_start = icaltime_from_timet_with_zone(whole_start, FALSE, NULL); ++ itt_end = icaltime_from_timet_with_zone(whole_end, FALSE, NULL); + itt_start.second = itt_start.minute = itt_start.hour = 0; + itt_end.second = 59; itt_end.minute = 59; itt_end.hour = 23; + diff --git a/nonprism/claws-mail/dillo-plugin.diff b/nonprism/claws-mail/dillo-plugin.diff index 86cafae4d..1762e3d70 100644 --- a/nonprism/claws-mail/dillo-plugin.diff +++ b/nonprism/claws-mail/dillo-plugin.diff @@ -1,10 +1,1016 @@ -From 1e068dbfc2837809030dcbf0173d2841a411d95a Mon Sep 17 00:00:00 2001 -From: wwp + + + +dillo-plugin.diff\trunk - svntogit/packages.git - Git clone of the 'packages' repository + + + + + + + + + + + +
+ +
+ +
+
+
+ + + +
+summaryrefslogtreecommitdiffstats
+ + + +
+
+
blob: 15090454a56af9e084991bc843fab07172ef812d (plain) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+
From 1e068dbfc2837809030dcbf0173d2841a411d95a Mon Sep 17 00:00:00 2001
+From: wwp <wwp@free.fr>
 Date: Thu, 2 Feb 2017 18:06:27 +0100
 Subject: [PATCH] Re-introducing the Dillo plugin. Tested against Dillo
  3.0.4.1/3.0.5.
 
----
+---
  configure.ac                     |   15 ++
  src/plugins/Makefile.am          |    1 +
  src/plugins/dillo/Makefile.am    |   33 ++++
@@ -21,835 +1027,947 @@ Subject: [PATCH] Re-introducing the Dillo plugin. Tested against Dillo
 
 diff --git a/configure.ac b/configure.ac
 index b0683cf..e8e4ae4 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -988,6 +988,10 @@ AC_ARG_ENABLE(clamd-plugin,
+--- a/configure.ac
++++ b/configure.ac
+@@ -988,6 +988,10 @@ AC_ARG_ENABLE(clamd-plugin,
  		[  --disable-clamd-plugin          Do not build clamd plugin],
  		[enable_clamd_plugin=$enableval], [enable_clamd_plugin=auto])
  
-+AC_ARG_ENABLE(dillo-plugin,
-+		[  --disable-dillo-plugin          Do not build dillo plugin],
-+		[enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
-+
++AC_ARG_ENABLE(dillo-plugin,
++		[  --disable-dillo-plugin          Do not build dillo plugin],
++		[enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
++
  AC_ARG_ENABLE(fancy-plugin,
  		[  --disable-fancy-plugin          Do not build fancy plugin],
  		[enable_fancy_plugin=$enableval], [enable_fancy_plugin=auto])
-@@ -1416,6 +1420,15 @@ else
+@@ -1416,6 +1420,15 @@ else
  	AC_MSG_RESULT(no)
  fi
  
-+AC_MSG_CHECKING([whether to build Dillo plugin])
-+if test x"$enable_dillo_plugin" != xno; then
-+	PLUGINS="$PLUGINS dillo"
-+	AC_MSG_RESULT(yes)
-+else
-+	DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
-+	AC_MSG_RESULT(no)
-+fi
-+
++AC_MSG_CHECKING([whether to build Dillo plugin])
++if test x"$enable_dillo_plugin" != xno; then
++	PLUGINS="$PLUGINS dillo"
++	AC_MSG_RESULT(yes)
++else
++	DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
++	AC_MSG_RESULT(no)
++fi
++
  AC_MSG_CHECKING([whether to build fancy plugin])
- if test x"$enable_fancy_plugin" != xno; then
- 	dependencies_missing=""
-@@ -1872,6 +1885,7 @@ AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN,		test x"$enable_bogofilter_plugin" != xn
- AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN,		test x"$enable_bsfilter_plugin" != xno)
- AM_CONDITIONAL(BUILD_CLAMD_PLUGIN,		test x"$enable_clamd_plugin" != xno)
- AM_CONDITIONAL(BUILD_DEMO_PLUGIN,		test x"$enable_demo_plugin" != xno)
-+AM_CONDITIONAL(BUILD_DILLO_PLUGIN,		test x"$enable_dillo_plugin" != xno)
- AM_CONDITIONAL(BUILD_FANCY_PLUGIN,		test x"$enable_fancy_plugin" != xno)
- AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN,		test x"$enable_fetchinfo_plugin" != xno)
- AM_CONDITIONAL(BUILD_GDATA_PLUGIN,		test x"$enable_gdata_plugin" != xno)
-@@ -1920,6 +1934,7 @@ src/plugins/bsfilter/Makefile
+ if test x"$enable_fancy_plugin" != xno; then
+ 	dependencies_missing=""
+@@ -1970,7 +1970,7 @@
+ AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN,		test x"$enable_bsfilter_plugin" != xno)
+ AM_CONDITIONAL(BUILD_CLAMD_PLUGIN,		test x"$enable_clamd_plugin" != xno)
+ AM_CONDITIONAL(BUILD_DEMO_PLUGIN,		test x"$enable_demo_plugin" != xno)
+-dnl AM_CONDITIONAL(BUILD_DILLO_PLUGIN,		test x"$enable_dillo_plugin" != xno)
++AM_CONDITIONAL(BUILD_DILLO_PLUGIN,		test x"$enable_dillo_plugin" != xno)
+ AM_CONDITIONAL(BUILD_FANCY_PLUGIN,		test x"$enable_fancy_plugin" != xno)
+ AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN,		test x"$enable_fetchinfo_plugin" != xno)
+ AM_CONDITIONAL(BUILD_GDATA_PLUGIN,		test x"$enable_gdata_plugin" != xno)
+@@ -1920,6 +1934,7 @@ src/plugins/bsfilter/Makefile
  src/plugins/clamd/Makefile
  src/plugins/clamd/libclamd/Makefile
  src/plugins/demo/Makefile
-+src/plugins/dillo/Makefile
++src/plugins/dillo/Makefile
  src/plugins/fancy/Makefile
  src/plugins/fetchinfo/Makefile
  src/plugins/gdata/Makefile
 diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
 index 6acc1fb..28abfdb 100644
---- a/src/plugins/Makefile.am
-+++ b/src/plugins/Makefile.am
-@@ -13,6 +13,7 @@ SUBDIRS = \
+--- a/src/plugins/Makefile.am
++++ b/src/plugins/Makefile.am
+@@ -13,6 +13,7 @@ SUBDIRS = \
  	bsfilter \
  	clamd \
  	demo \
-+	dillo \
++	dillo \
  	fancy \
  	fetchinfo \
  	gdata \
 diff --git a/src/plugins/dillo/Makefile.am b/src/plugins/dillo/Makefile.am
 new file mode 100644
 index 0000000..2dd9349
---- /dev/null
-+++ b/src/plugins/dillo/Makefile.am
-@@ -0,0 +1,33 @@
-+# Copyright 1999-2014 the Claws Mail team.
-+# This file is part of Claws Mail package, and distributed under the
-+# terms of the General Public License version 3 (or later).
-+# See COPYING file for license details.
-+
-+plugindir = $(pkglibdir)/plugins
-+
-+plugin_LTLIBRARIES = dillo.la
-+
-+dillo_la_SOURCES = \
-+     dillo_viewer.c \
-+     dillo_prefs.c \
-+	 dillo_prefs.h
-+
-+dillo_la_LDFLAGS = \
-+	-avoid-version -module
-+
-+if CYGWIN
-+cygwin_export_lib = -L$(top_builddir)/src -lclaws-mail
-+else
-+cygwin_export_lib =
-+endif
-+
-+dillo_la_LIBADD = $(cygwin_export_lib) \
-+	$(GTK_LIBS) 
-+
-+dillo_la_CPPFLAGS = \
-+	-I$(top_srcdir)/src \
-+	-I$(top_builddir)/src/common \
-+	-I$(top_srcdir)/src/common \
-+	-I$(top_srcdir)/src/gtk \
-+	$(GLIB_CFLAGS) \
-+	$(GTK_CFLAGS)
+--- /dev/null
++++ b/src/plugins/dillo/Makefile.am
+@@ -0,0 +1,33 @@
++# Copyright 1999-2014 the Claws Mail team.
++# This file is part of Claws Mail package, and distributed under the
++# terms of the General Public License version 3 (or later).
++# See COPYING file for license details.
++
++plugindir = $(pkglibdir)/plugins
++
++plugin_LTLIBRARIES = dillo.la
++
++dillo_la_SOURCES = \
++     dillo_viewer.c \
++     dillo_prefs.c \
++	 dillo_prefs.h
++
++dillo_la_LDFLAGS = \
++	-avoid-version -module
++
++if CYGWIN
++cygwin_export_lib = -L$(top_builddir)/src -lclaws-mail
++else
++cygwin_export_lib =
++endif
++
++dillo_la_LIBADD = $(cygwin_export_lib) \
++	$(GTK_LIBS) 
++
++dillo_la_CPPFLAGS = \
++	-I$(top_srcdir)/src \
++	-I$(top_builddir)/src/common \
++	-I$(top_srcdir)/src/common \
++	-I$(top_srcdir)/src/gtk \
++	$(GLIB_CFLAGS) \
++	$(GTK_CFLAGS)
 diff --git a/src/plugins/dillo/README b/src/plugins/dillo/README
 new file mode 100644
 index 0000000..a61f4e0
---- /dev/null
-+++ b/src/plugins/dillo/README
-@@ -0,0 +1,48 @@
-+Dillo Viewer: HTML mail viewing in Claws Mail
-+-------------------------------------------------
-+
-+This plugin uses the Dillo (http://www.dillo.org) browser to
-+view text/html MIME parts inside Claws Mail.
-+
-+When the plugin is loaded, if the MIME part to be viewed is of
-+text/html type, then the MIME part is saved in a temporary file and
-+Dillo is started with special options to embed it inside
-+Claws Mail' message view and to "safely" view the part.  Dillo is
-+also run in the fullwindow mode, where the toolbar, menubar and the
-+statusbar are hidden so the message is viewed in a larger area.  The
-+fullwindow mode is toggled on and off by double clicking on an empty
-+part of the page or by clicking on the icon in the lower right corner.
-+
-+The "safe" viewing of text/html message parts is achieved by using the
-+-l (or --local) option of Dillo.  This option prevents Dillo from
-+retrieving remote web resources, like images.  Thus, no connection
-+to the Internet is done.  If the user wants to view the message
-+without this restriction, s/he just reloads the page by clicking on
-+the "Reload" button in Dillo's toolbar.
-+
-+WARNING: This plugin is provided as is.  The author does not guarantee
-+safe viewing of text/html messages although he tried hard to achieve
-+this goal.
-+
-+What Dillo version should be used?
-+----------------------------------
-+
-+Dillo 0.7.0 was the first version that included the features needed by
-+Claws, but it had a small bug where remote resources could be
-+accessed even with the --local option (when a BASE element is present
-+in the message).
-+
-+Since 2002-03-16, the CVS tree of Dillo fixed that bug.
-+
-+Dillo 0.7.2 and newer (up to 3.0.5) do not have that bug, and are the
-+recommended versions to be used.
-+
-+Acknowledgment:
-+---------------
-+
-+The author of this plugin thanks the author of Dillo, Jorge Arellano
-+Cid, who accepted to integrate and improve the different patches
-+needed for this functionality.
-+
-+-- 
-+Melvin Hadasht
+--- /dev/null
++++ b/src/plugins/dillo/README
+@@ -0,0 +1,48 @@
++Dillo Viewer: HTML mail viewing in Claws Mail
++-------------------------------------------------
++
++This plugin uses the Dillo (http://www.dillo.org) browser to
++view text/html MIME parts inside Claws Mail.
++
++When the plugin is loaded, if the MIME part to be viewed is of
++text/html type, then the MIME part is saved in a temporary file and
++Dillo is started with special options to embed it inside
++Claws Mail' message view and to "safely" view the part.  Dillo is
++also run in the fullwindow mode, where the toolbar, menubar and the
++statusbar are hidden so the message is viewed in a larger area.  The
++fullwindow mode is toggled on and off by double clicking on an empty
++part of the page or by clicking on the icon in the lower right corner.
++
++The "safe" viewing of text/html message parts is achieved by using the
++-l (or --local) option of Dillo.  This option prevents Dillo from
++retrieving remote web resources, like images.  Thus, no connection
++to the Internet is done.  If the user wants to view the message
++without this restriction, s/he just reloads the page by clicking on
++the "Reload" button in Dillo's toolbar.
++
++WARNING: This plugin is provided as is.  The author does not guarantee
++safe viewing of text/html messages although he tried hard to achieve
++this goal.
++
++What Dillo version should be used?
++----------------------------------
++
++Dillo 0.7.0 was the first version that included the features needed by
++Claws, but it had a small bug where remote resources could be
++accessed even with the --local option (when a BASE element is present
++in the message).
++
++Since 2002-03-16, the CVS tree of Dillo fixed that bug.
++
++Dillo 0.7.2 and newer (up to 3.0.5) do not have that bug, and are the
++recommended versions to be used.
++
++Acknowledgment:
++---------------
++
++The author of this plugin thanks the author of Dillo, Jorge Arellano
++Cid, who accepted to integrate and improve the different patches
++needed for this functionality.
++
++-- 
++Melvin Hadasht
 diff --git a/src/plugins/dillo/dillo_prefs.c b/src/plugins/dillo/dillo_prefs.c
 new file mode 100644
 index 0000000..8d9529b
---- /dev/null
-+++ b/src/plugins/dillo/dillo_prefs.c
-@@ -0,0 +1,305 @@
-+/*
-+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-+ * Copyright (C) 1999-2012 the Claws Mail Team
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program. If not, see .
-+ * 
-+ */
-+
-+/*
-+ * The structure of this file has been borrowed from the structure of
-+ * the image_viewer plugin file. I also used it as an example of how to
-+ * build the preferences for the dillo plugin.
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#  include "config.h"
-+#include "claws-features.h"
-+#endif
-+
-+#include "defs.h"
-+
-+#include 
-+#include 
-+#include 
-+
-+#include "gtkutils.h"
-+#include "utils.h"
-+#include "prefs.h"
-+#include "prefs_gtk.h"
-+#include "prefswindow.h"
-+#include "combobox.h"
-+#include "addressbook.h"
-+
-+#include "dillo_prefs.h"
-+
-+#define PREFS_BLOCK_NAME "Dillo"
-+
-+DilloBrowserPrefs dillo_prefs;
-+
-+typedef struct _DilloBrowserPage DilloBrowserPage;
-+
-+struct _DilloBrowserPage {
-+        PrefsPage page;
-+        GtkWidget *local;
-+	GtkWidget *whitelist_ab;
-+	GtkWidget *whitelist_ab_folder_combo;
-+	GtkWidget *whitelist_ab_select_btn;
-+        GtkWidget *full;
-+};
-+
-+static PrefParam param[] = {
-+        {"local_browse", "TRUE", &dillo_prefs.local, P_BOOL, NULL, NULL, NULL},
-+        {"full_window", "TRUE", &dillo_prefs.full, P_BOOL, NULL, NULL, NULL},
-+	{"whitelist_ab", "FALSE", &dillo_prefs.whitelist_ab, P_BOOL,
-+	 NULL, NULL, NULL},
-+	{"whitelist_ab_folder", N_("Any"), &dillo_prefs.whitelist_ab_folder, P_STRING,
-+	 NULL, NULL, NULL},
-+
-+        {0,0,0,0,0,0,0}
-+};
-+
-+static DilloBrowserPage prefs_page;
-+
-+static void create_dillo_prefs_page	(PrefsPage *page,
-+					 GtkWindow *window,
-+					 gpointer   data);
-+static void destroy_dillo_prefs_page	(PrefsPage *page);
-+static void save_dillo_prefs		(PrefsPage *page);
-+
-+#ifndef USE_NEW_ADDRBOOK
-+static void dillo_whitelist_ab_select_cb(GtkWidget *widget, gpointer data)
-+{
-+	DilloBrowserPage *page = (DilloBrowserPage *) data;
-+	const gchar *folderpath = NULL;
-+	gchar *new_path = NULL;
-+
-+	folderpath = gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((page->whitelist_ab_folder_combo)))));
-+	new_path = addressbook_folder_selection(folderpath);
-+	if (new_path) {
-+		gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((page->whitelist_ab_folder_combo)))), new_path);
-+		g_free(new_path);
-+	} 
-+}
-+#endif
-+
-+static void local_checkbox_toggled(GtkToggleButton *button,
-+					  gpointer user_data)
-+{
-+	gboolean active = gtk_toggle_button_get_active(button);
-+        DilloBrowserPage *prefs_page = (DilloBrowserPage *) user_data;
-+
-+	gtk_widget_set_sensitive(prefs_page->whitelist_ab, active);
-+	gtk_widget_set_sensitive(prefs_page->whitelist_ab_folder_combo, active && 
-+			gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->whitelist_ab)));
-+#ifndef USE_NEW_ADDRBOOK
-+	gtk_widget_set_sensitive(prefs_page->whitelist_ab_select_btn, active && 
-+			gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->whitelist_ab)));
-+#endif
-+}
-+
-+static void whitelist_checkbox_toggled(GtkToggleButton *button,
-+					  gpointer user_data)
-+{
-+	gboolean active = gtk_toggle_button_get_active(button);
-+        DilloBrowserPage *prefs_page = (DilloBrowserPage *) user_data;
-+
-+	active &= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->local));
-+
-+	gtk_widget_set_sensitive(prefs_page->whitelist_ab_folder_combo, active);
-+	gtk_widget_set_sensitive(prefs_page->whitelist_ab_select_btn, active);
-+}
-+
-+void dillo_prefs_init(void)
-+{
-+	static gchar *path[3];
-+	gchar *rcpath;
-+
-+	path[0] = _("Plugins");
-+	path[1] = _("Dillo Browser");
-+	path[2] = NULL;
-+
-+        prefs_set_default(param);
-+	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
-+        prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
-+	g_free(rcpath);
-+        
-+        prefs_page.page.path = path;
-+        prefs_page.page.create_widget = create_dillo_prefs_page;
-+        prefs_page.page.destroy_widget = destroy_dillo_prefs_page;
-+        prefs_page.page.save_page = save_dillo_prefs;
-+		prefs_page.page.weight = 35.0;
-+        prefs_gtk_register_page((PrefsPage *) &prefs_page);
-+}
-+
-+void dillo_prefs_done(void)
-+{
-+        prefs_gtk_unregister_page((PrefsPage *) &prefs_page);
-+}
-+
-+static void create_dillo_prefs_page(PrefsPage *page,
-+				    GtkWindow *window,
-+                                    gpointer data)
-+{
-+        DilloBrowserPage *prefs_page = (DilloBrowserPage *) page;
-+
-+        GtkWidget *vbox;
-+        GtkWidget *local_checkbox;
-+        GtkWidget *full_checkbox;
-+        GtkWidget *label;
-+	GtkWidget *whitelist_ab_checkbtn;
-+	GtkWidget *whitelist_ab_folder_combo;
-+	GtkWidget *whitelist_ab_select_btn;
-+	GtkWidget *hbox_whitelist, *spacer;
-+
-+        vbox = gtk_vbox_new(FALSE, 3);
-+        gtk_container_set_border_width(GTK_CONTAINER(vbox), VBOX_BORDER);
-+        gtk_widget_show(vbox);
-+        
-+        local_checkbox = gtk_check_button_new_with_label
-+				(_("Load remote links in mails"));
-+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(local_checkbox),
-+                                     !dillo_prefs.local);
-+        gtk_box_pack_start(GTK_BOX(vbox), local_checkbox, FALSE, FALSE, 0);
-+        gtk_widget_show(local_checkbox);
-+	CLAWS_SET_TIP(local_checkbox,
-+			     _("Equivalent to Dillo's '--local' option"));
-+        
-+	label = gtk_label_new(_("You can still load remote links "
-+			      "by reloading the page"));
-+        gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-+	gtkut_widget_set_small_font_size (label);
-+        gtk_widget_show(label);
-+
-+	
-+	hbox_whitelist = gtk_hbox_new(FALSE, 8);
-+	gtk_widget_show(hbox_whitelist);
-+	gtk_box_pack_start (GTK_BOX (vbox), hbox_whitelist, FALSE, FALSE, 0);
-+	
-+	spacer = gtk_hbox_new(FALSE, 0);
-+	gtk_widget_set_size_request(spacer, 12, -1);
-+	gtk_widget_show(spacer);
-+	gtk_box_pack_start(GTK_BOX(hbox_whitelist), spacer, FALSE, FALSE, 0);
-+
-+	whitelist_ab_checkbtn = gtk_check_button_new_with_label(_("Only for senders found in address book/folder"));
-+	gtk_widget_show(whitelist_ab_checkbtn);
-+	gtk_box_pack_start(GTK_BOX(hbox_whitelist), whitelist_ab_checkbtn, FALSE, FALSE, 0);
-+
-+	whitelist_ab_folder_combo = combobox_text_new(TRUE, _("Any"), NULL);
-+	gtk_widget_set_size_request(whitelist_ab_folder_combo, 100, -1);
-+	gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_folder_combo, TRUE, TRUE, 0);
-+
-+	whitelist_ab_select_btn = gtk_button_new_with_label(_("Select ..."));
-+	gtk_widget_show (whitelist_ab_select_btn);
-+	gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_select_btn, FALSE, FALSE, 0);
-+
-+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(whitelist_ab_checkbtn), dillo_prefs.whitelist_ab);
-+	if (dillo_prefs.whitelist_ab_folder != NULL) {
-+		/* translate "Any" (stored UNtranslated) */
-+		if (strcasecmp(dillo_prefs.whitelist_ab_folder, "Any") == 0)
-+			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
-+					_("Any"));
-+		else
-+		/* backward compatibility (when translated "Any" was stored) */
-+		if (g_utf8_collate(dillo_prefs.whitelist_ab_folder, _("Any")) == 0)
-+			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
-+					dillo_prefs.whitelist_ab_folder);
-+		else
-+			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
-+					dillo_prefs.whitelist_ab_folder);
-+	}
-+
-+        full_checkbox = gtk_check_button_new_with_label
-+				(_("Full window mode (hide controls)"));
-+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(full_checkbox),
-+                                      dillo_prefs.full);
-+        gtk_box_pack_start(GTK_BOX(vbox), full_checkbox, FALSE, FALSE, 0);
-+        gtk_widget_show(full_checkbox);
-+	CLAWS_SET_TIP(full_checkbox,
-+			     _("Equivalent to Dillo's '--fullwindow' option"));
-+
-+	g_signal_connect(G_OBJECT(local_checkbox), "toggled",
-+			 G_CALLBACK(local_checkbox_toggled),
-+			 prefs_page);
-+
-+	g_signal_connect(G_OBJECT(whitelist_ab_checkbtn), "toggled",
-+			 G_CALLBACK(whitelist_checkbox_toggled),
-+			 prefs_page);
-+
-+#ifndef USE_NEW_ADDRBOOK
-+	g_signal_connect(G_OBJECT (whitelist_ab_select_btn), "clicked",
-+			 G_CALLBACK(dillo_whitelist_ab_select_cb), prefs_page);
-+#else
-+	gtk_widget_set_sensitive(GTK_WIDGET(whitelist_ab_select_btn), FALSE);
-+#endif
-+	gtk_widget_set_sensitive(whitelist_ab_checkbtn, !dillo_prefs.local);
-+	gtk_widget_set_sensitive(whitelist_ab_folder_combo, !dillo_prefs.local && dillo_prefs.whitelist_ab);
-+	gtk_widget_set_sensitive(whitelist_ab_select_btn, !dillo_prefs.local && dillo_prefs.whitelist_ab);
-+
-+        
-+        prefs_page->local = local_checkbox;
-+        prefs_page->full = full_checkbox;
-+	prefs_page->whitelist_ab = whitelist_ab_checkbtn;
-+	prefs_page->whitelist_ab_folder_combo = whitelist_ab_folder_combo;
-+	prefs_page->whitelist_ab_select_btn = whitelist_ab_select_btn;
-+        prefs_page->page.widget = vbox;
-+}
-+
-+static void destroy_dillo_prefs_page(PrefsPage *page)
-+{
-+	/* Do nothing! */
-+}
-+
-+static void save_dillo_prefs(PrefsPage *page)
-+{
-+        DilloBrowserPage *prefs_page = (DilloBrowserPage *) page;
-+        PrefFile *pref_file;
-+        gchar *rc_file_path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
-+                                          COMMON_RC, NULL);
-+        
-+        dillo_prefs.local = !gtk_toggle_button_get_active
-+				(GTK_TOGGLE_BUTTON(prefs_page->local));
-+        dillo_prefs.full = gtk_toggle_button_get_active
-+				(GTK_TOGGLE_BUTTON(prefs_page->full));
-+
-+	dillo_prefs.whitelist_ab = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->whitelist_ab));
-+	g_free(dillo_prefs.whitelist_ab_folder);
-+	dillo_prefs.whitelist_ab_folder = gtk_editable_get_chars(
-+				GTK_EDITABLE(gtk_bin_get_child(GTK_BIN((prefs_page->whitelist_ab_folder_combo)))), 0, -1);
-+	/* store UNtranslated "Any" */
-+	if (g_utf8_collate(dillo_prefs.whitelist_ab_folder, _("Any")) == 0) {
-+		g_free(dillo_prefs.whitelist_ab_folder);
-+		dillo_prefs.whitelist_ab_folder = g_strdup("Any");
-+	}
-+    
-+        pref_file = prefs_write_open(rc_file_path);
-+        g_free(rc_file_path);
-+        
-+        if (!(pref_file) ||
-+	    (prefs_set_block_label(pref_file, PREFS_BLOCK_NAME) < 0))
-+          return;
-+        
-+        if (prefs_write_param(param, pref_file->fp) < 0) {
-+          g_warning("failed to write Dillo Plugin configuration\n");
-+          prefs_file_close_revert(pref_file);
-+          return;
-+        }
-+
-+        if (fprintf(pref_file->fp, "\n") < 0) {
-+		FILE_OP_ERROR(rc_file_path, "fprintf");
-+		prefs_file_close_revert(pref_file);
-+	} else
-+	        prefs_file_close(pref_file);
-+}
+--- /dev/null
++++ b/src/plugins/dillo/dillo_prefs.c
+@@ -0,0 +1,305 @@
++/*
++ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
++ * Copyright (C) 1999-2012 the Claws Mail Team
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ * 
++ */
++
++/*
++ * The structure of this file has been borrowed from the structure of
++ * the image_viewer plugin file. I also used it as an example of how to
++ * build the preferences for the dillo plugin.
++ */
++
++#ifdef HAVE_CONFIG_H
++#  include "config.h"
++#include "claws-features.h"
++#endif
++
++#include "defs.h"
++
++#include <glib.h>
++#include <glib/gi18n.h>
++#include <gtk/gtk.h>
++
++#include "gtkutils.h"
++#include "utils.h"
++#include "prefs.h"
++#include "prefs_gtk.h"
++#include "prefswindow.h"
++#include "combobox.h"
++#include "addressbook.h"
++
++#include "dillo_prefs.h"
++
++#define PREFS_BLOCK_NAME "Dillo"
++
++DilloBrowserPrefs dillo_prefs;
++
++typedef struct _DilloBrowserPage DilloBrowserPage;
++
++struct _DilloBrowserPage {
++        PrefsPage page;
++        GtkWidget *local;
++	GtkWidget *whitelist_ab;
++	GtkWidget *whitelist_ab_folder_combo;
++	GtkWidget *whitelist_ab_select_btn;
++        GtkWidget *full;
++};
++
++static PrefParam param[] = {
++        {"local_browse", "TRUE", &dillo_prefs.local, P_BOOL, NULL, NULL, NULL},
++        {"full_window", "TRUE", &dillo_prefs.full, P_BOOL, NULL, NULL, NULL},
++	{"whitelist_ab", "FALSE", &dillo_prefs.whitelist_ab, P_BOOL,
++	 NULL, NULL, NULL},
++	{"whitelist_ab_folder", N_("Any"), &dillo_prefs.whitelist_ab_folder, P_STRING,
++	 NULL, NULL, NULL},
++
++        {0,0,0,0,0,0,0}
++};
++
++static DilloBrowserPage prefs_page;
++
++static void create_dillo_prefs_page	(PrefsPage *page,
++					 GtkWindow *window,
++					 gpointer   data);
++static void destroy_dillo_prefs_page	(PrefsPage *page);
++static void save_dillo_prefs		(PrefsPage *page);
++
++#ifndef USE_NEW_ADDRBOOK
++static void dillo_whitelist_ab_select_cb(GtkWidget *widget, gpointer data)
++{
++	DilloBrowserPage *page = (DilloBrowserPage *) data;
++	const gchar *folderpath = NULL;
++	gchar *new_path = NULL;
++
++	folderpath = gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((page->whitelist_ab_folder_combo)))));
++	new_path = addressbook_folder_selection(folderpath);
++	if (new_path) {
++		gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((page->whitelist_ab_folder_combo)))), new_path);
++		g_free(new_path);
++	} 
++}
++#endif
++
++static void local_checkbox_toggled(GtkToggleButton *button,
++					  gpointer user_data)
++{
++	gboolean active = gtk_toggle_button_get_active(button);
++        DilloBrowserPage *prefs_page = (DilloBrowserPage *) user_data;
++
++	gtk_widget_set_sensitive(prefs_page->whitelist_ab, active);
++	gtk_widget_set_sensitive(prefs_page->whitelist_ab_folder_combo, active && 
++			gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->whitelist_ab)));
++#ifndef USE_NEW_ADDRBOOK
++	gtk_widget_set_sensitive(prefs_page->whitelist_ab_select_btn, active && 
++			gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->whitelist_ab)));
++#endif
++}
++
++static void whitelist_checkbox_toggled(GtkToggleButton *button,
++					  gpointer user_data)
++{
++	gboolean active = gtk_toggle_button_get_active(button);
++        DilloBrowserPage *prefs_page = (DilloBrowserPage *) user_data;
++
++	active &= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->local));
++
++	gtk_widget_set_sensitive(prefs_page->whitelist_ab_folder_combo, active);
++	gtk_widget_set_sensitive(prefs_page->whitelist_ab_select_btn, active);
++}
++
++void dillo_prefs_init(void)
++{
++	static gchar *path[3];
++	gchar *rcpath;
++
++	path[0] = _("Plugins");
++	path[1] = _("Dillo Browser");
++	path[2] = NULL;
++
++        prefs_set_default(param);
++	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
++        prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
++	g_free(rcpath);
++        
++        prefs_page.page.path = path;
++        prefs_page.page.create_widget = create_dillo_prefs_page;
++        prefs_page.page.destroy_widget = destroy_dillo_prefs_page;
++        prefs_page.page.save_page = save_dillo_prefs;
++		prefs_page.page.weight = 35.0;
++        prefs_gtk_register_page((PrefsPage *) &prefs_page);
++}
++
++void dillo_prefs_done(void)
++{
++        prefs_gtk_unregister_page((PrefsPage *) &prefs_page);
++}
++
++static void create_dillo_prefs_page(PrefsPage *page,
++				    GtkWindow *window,
++                                    gpointer data)
++{
++        DilloBrowserPage *prefs_page = (DilloBrowserPage *) page;
++
++        GtkWidget *vbox;
++        GtkWidget *local_checkbox;
++        GtkWidget *full_checkbox;
++        GtkWidget *label;
++	GtkWidget *whitelist_ab_checkbtn;
++	GtkWidget *whitelist_ab_folder_combo;
++	GtkWidget *whitelist_ab_select_btn;
++	GtkWidget *hbox_whitelist, *spacer;
++
++        vbox = gtk_vbox_new(FALSE, 3);
++        gtk_container_set_border_width(GTK_CONTAINER(vbox), VBOX_BORDER);
++        gtk_widget_show(vbox);
++        
++        local_checkbox = gtk_check_button_new_with_label
++				(_("Load remote links in mails"));
++        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(local_checkbox),
++                                     !dillo_prefs.local);
++        gtk_box_pack_start(GTK_BOX(vbox), local_checkbox, FALSE, FALSE, 0);
++        gtk_widget_show(local_checkbox);
++	CLAWS_SET_TIP(local_checkbox,
++			     _("Equivalent to Dillo's '--local' option"));
++        
++	label = gtk_label_new(_("You can still load remote links "
++			      "by reloading the page"));
++        gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
++	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
++	gtkut_widget_set_small_font_size (label);
++        gtk_widget_show(label);
++
++	
++	hbox_whitelist = gtk_hbox_new(FALSE, 8);
++	gtk_widget_show(hbox_whitelist);
++	gtk_box_pack_start (GTK_BOX (vbox), hbox_whitelist, FALSE, FALSE, 0);
++	
++	spacer = gtk_hbox_new(FALSE, 0);
++	gtk_widget_set_size_request(spacer, 12, -1);
++	gtk_widget_show(spacer);
++	gtk_box_pack_start(GTK_BOX(hbox_whitelist), spacer, FALSE, FALSE, 0);
++
++	whitelist_ab_checkbtn = gtk_check_button_new_with_label(_("Only for senders found in address book/folder"));
++	gtk_widget_show(whitelist_ab_checkbtn);
++	gtk_box_pack_start(GTK_BOX(hbox_whitelist), whitelist_ab_checkbtn, FALSE, FALSE, 0);
++
++	whitelist_ab_folder_combo = combobox_text_new(TRUE, _("Any"), NULL);
++	gtk_widget_set_size_request(whitelist_ab_folder_combo, 100, -1);
++	gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_folder_combo, TRUE, TRUE, 0);
++
++	whitelist_ab_select_btn = gtk_button_new_with_label(_("Select ..."));
++	gtk_widget_show (whitelist_ab_select_btn);
++	gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_select_btn, FALSE, FALSE, 0);
++
++	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(whitelist_ab_checkbtn), dillo_prefs.whitelist_ab);
++	if (dillo_prefs.whitelist_ab_folder != NULL) {
++		/* translate "Any" (stored UNtranslated) */
++		if (strcasecmp(dillo_prefs.whitelist_ab_folder, "Any") == 0)
++			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
++					_("Any"));
++		else
++		/* backward compatibility (when translated "Any" was stored) */
++		if (g_utf8_collate(dillo_prefs.whitelist_ab_folder, _("Any")) == 0)
++			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
++					dillo_prefs.whitelist_ab_folder);
++		else
++			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
++					dillo_prefs.whitelist_ab_folder);
++	}
++
++        full_checkbox = gtk_check_button_new_with_label
++				(_("Full window mode (hide controls)"));
++        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(full_checkbox),
++                                      dillo_prefs.full);
++        gtk_box_pack_start(GTK_BOX(vbox), full_checkbox, FALSE, FALSE, 0);
++        gtk_widget_show(full_checkbox);
++	CLAWS_SET_TIP(full_checkbox,
++			     _("Equivalent to Dillo's '--fullwindow' option"));
++
++	g_signal_connect(G_OBJECT(local_checkbox), "toggled",
++			 G_CALLBACK(local_checkbox_toggled),
++			 prefs_page);
++
++	g_signal_connect(G_OBJECT(whitelist_ab_checkbtn), "toggled",
++			 G_CALLBACK(whitelist_checkbox_toggled),
++			 prefs_page);
++
++#ifndef USE_NEW_ADDRBOOK
++	g_signal_connect(G_OBJECT (whitelist_ab_select_btn), "clicked",
++			 G_CALLBACK(dillo_whitelist_ab_select_cb), prefs_page);
++#else
++	gtk_widget_set_sensitive(GTK_WIDGET(whitelist_ab_select_btn), FALSE);
++#endif
++	gtk_widget_set_sensitive(whitelist_ab_checkbtn, !dillo_prefs.local);
++	gtk_widget_set_sensitive(whitelist_ab_folder_combo, !dillo_prefs.local && dillo_prefs.whitelist_ab);
++	gtk_widget_set_sensitive(whitelist_ab_select_btn, !dillo_prefs.local && dillo_prefs.whitelist_ab);
++
++        
++        prefs_page->local = local_checkbox;
++        prefs_page->full = full_checkbox;
++	prefs_page->whitelist_ab = whitelist_ab_checkbtn;
++	prefs_page->whitelist_ab_folder_combo = whitelist_ab_folder_combo;
++	prefs_page->whitelist_ab_select_btn = whitelist_ab_select_btn;
++        prefs_page->page.widget = vbox;
++}
++
++static void destroy_dillo_prefs_page(PrefsPage *page)
++{
++	/* Do nothing! */
++}
++
++static void save_dillo_prefs(PrefsPage *page)
++{
++        DilloBrowserPage *prefs_page = (DilloBrowserPage *) page;
++        PrefFile *pref_file;
++        gchar *rc_file_path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
++                                          COMMON_RC, NULL);
++        
++        dillo_prefs.local = !gtk_toggle_button_get_active
++				(GTK_TOGGLE_BUTTON(prefs_page->local));
++        dillo_prefs.full = gtk_toggle_button_get_active
++				(GTK_TOGGLE_BUTTON(prefs_page->full));
++
++	dillo_prefs.whitelist_ab = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_page->whitelist_ab));
++	g_free(dillo_prefs.whitelist_ab_folder);
++	dillo_prefs.whitelist_ab_folder = gtk_editable_get_chars(
++				GTK_EDITABLE(gtk_bin_get_child(GTK_BIN((prefs_page->whitelist_ab_folder_combo)))), 0, -1);
++	/* store UNtranslated "Any" */
++	if (g_utf8_collate(dillo_prefs.whitelist_ab_folder, _("Any")) == 0) {
++		g_free(dillo_prefs.whitelist_ab_folder);
++		dillo_prefs.whitelist_ab_folder = g_strdup("Any");
++	}
++    
++        pref_file = prefs_write_open(rc_file_path);
++        g_free(rc_file_path);
++        
++        if (!(pref_file) ||
++	    (prefs_set_block_label(pref_file, PREFS_BLOCK_NAME) < 0))
++          return;
++        
++        if (prefs_write_param(param, pref_file->fp) < 0) {
++          g_warning("failed to write Dillo Plugin configuration\n");
++          prefs_file_close_revert(pref_file);
++          return;
++        }
++
++        if (fprintf(pref_file->fp, "\n") < 0) {
++		FILE_OP_ERROR(rc_file_path, "fprintf");
++		prefs_file_close_revert(pref_file);
++	} else
++	        prefs_file_close(pref_file);
++}
 diff --git a/src/plugins/dillo/dillo_prefs.h b/src/plugins/dillo/dillo_prefs.h
 new file mode 100644
 index 0000000..d4b5b4d
---- /dev/null
-+++ b/src/plugins/dillo/dillo_prefs.h
-@@ -0,0 +1,46 @@
-+/*
-+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-+ * Copyright (C) 1999-2012 the Claws Mail Team
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program. If not, see .
-+ * 
-+ */
-+
-+/*
-+ * The structure of this file has been borrowed from the structure of
-+ * the image_viewer plugin file. I also used it as an example of how to
-+ * build the preferences for the dillo plugin.
-+ */
-+
-+#ifndef DILLOPREFS_H
-+#define DILLOPREFS_H
-+
-+#include 
-+
-+typedef struct _DilloBrowserPrefs	DilloBrowserPrefs;
-+
-+struct _DilloBrowserPrefs
-+{
-+	gboolean local;   /**< local browsing */
-+	gboolean whitelist_ab;
-+	gchar *whitelist_ab_folder;
-+	gboolean full;    /**< use full window */
-+};
-+
-+extern DilloBrowserPrefs dillo_prefs;
-+
-+void dillo_prefs_init(void);
-+void dillo_prefs_done(void);
-+
-+#endif
+--- /dev/null
++++ b/src/plugins/dillo/dillo_prefs.h
+@@ -0,0 +1,46 @@
++/*
++ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
++ * Copyright (C) 1999-2012 the Claws Mail Team
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ * 
++ */
++
++/*
++ * The structure of this file has been borrowed from the structure of
++ * the image_viewer plugin file. I also used it as an example of how to
++ * build the preferences for the dillo plugin.
++ */
++
++#ifndef DILLOPREFS_H
++#define DILLOPREFS_H
++
++#include <glib.h>
++
++typedef struct _DilloBrowserPrefs	DilloBrowserPrefs;
++
++struct _DilloBrowserPrefs
++{
++	gboolean local;   /**< local browsing */
++	gboolean whitelist_ab;
++	gchar *whitelist_ab_folder;
++	gboolean full;    /**< use full window */
++};
++
++extern DilloBrowserPrefs dillo_prefs;
++
++void dillo_prefs_init(void);
++void dillo_prefs_done(void);
++
++#endif
 diff --git a/src/plugins/dillo/dillo_viewer.c b/src/plugins/dillo/dillo_viewer.c
 new file mode 100644
 index 0000000..1c63fa3
---- /dev/null
-+++ b/src/plugins/dillo/dillo_viewer.c
-@@ -0,0 +1,310 @@
-+/*
-+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-+ * Copyright (C) 1999-2012 the Claws Mail Team
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program. If not, see .
-+ * 
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#  include "config.h"
-+#include "claws-features.h"
-+#endif
-+
-+#include 
-+
-+#include 
-+#include 
-+#include 
-+#if GTK_CHECK_VERSION(3, 0, 0)
-+#include 
-+#endif
-+#include 
-+
-+#include "common/claws.h"
-+#include "common/version.h"
-+#include "plugin.h"
-+#include "utils.h"
-+#include "mimeview.h"
-+#include "addr_compl.h"
-+
-+#include "dillo_prefs.h"
-+
-+#define PLUGIN_NAME (_("Dillo HTML Viewer"))
-+
-+typedef struct _DilloViewer DilloViewer;
-+
-+struct _DilloViewer
-+{
-+	MimeViewer	 mimeviewer;
-+	GtkWidget	*widget;	
-+	GtkWidget	*socket;
-+	gchar		*filename;
-+};
-+
-+static MimeViewerFactory dillo_viewer_factory;
-+
-+static GtkWidget *dillo_get_widget(MimeViewer *_viewer)
-+{
-+	DilloViewer *viewer = (DilloViewer *) _viewer;
-+
-+	debug_print("dillo_get_widget\n");
-+
-+	return GTK_WIDGET(viewer->widget);
-+}
-+
-+#if !GTK_CHECK_VERSION(3, 0, 0)
-+static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
-+#else
-+static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
-+#endif
-+{
-+	DilloViewer *viewer = (DilloViewer *) data;
-+	debug_print("Destroyed dillo socket %p\n", viewer->socket);
-+	viewer->socket = NULL;
-+	return FALSE;
-+}
-+
-+static gboolean found_in_addressbook(const gchar *address)
-+{
-+	gchar *addr = NULL;
-+	gboolean found = FALSE;
-+	gint num_addr = 0;
-+	
-+	if (!address)
-+		return FALSE;
-+	
-+	addr = g_strdup(address);
-+	extract_address(addr);
-+	num_addr = complete_address(addr);
-+	if (num_addr > 1) {
-+		/* skip first item (this is the search string itself) */
-+		int i = 1;
-+		for (; i < num_addr && !found; i++) {
-+			gchar *caddr = get_complete_address(i);
-+			extract_address(caddr);
-+			if (strcasecmp(caddr, addr) == 0)
-+				found = TRUE;
-+			g_free(caddr);
-+		}
-+	}
-+	g_free(addr);
-+	return found;
-+}
-+
-+static gboolean load_images(DilloViewer *viewer)
-+{
-+	MessageView *messageview = ((MimeViewer *)viewer)->mimeview 
-+					? ((MimeViewer *)viewer)->mimeview->messageview 
-+					: NULL;
-+	MsgInfo *msginfo = NULL;
-+	gchar *ab_folderpath = NULL;
-+
-+	if (messageview == NULL)
-+		return FALSE;
-+	
-+	msginfo = messageview->msginfo;
-+	
-+	if (msginfo == NULL)
-+		return FALSE;
-+
-+	/* don't load remote images, period. */
-+	if (dillo_prefs.local)
-+		return FALSE;
-+	
-+	/* don't do whitelisting -> load images */
-+	if (!dillo_prefs.whitelist_ab)
-+		return TRUE;
-+
-+	if (*dillo_prefs.whitelist_ab_folder != '\0' &&
-+	    strcasecmp(dillo_prefs.whitelist_ab_folder, _("Any")) != 0)
-+		ab_folderpath = dillo_prefs.whitelist_ab_folder;
-+
-+	start_address_completion(ab_folderpath);
-+
-+	/* do whitelisting -> check sender */
-+	if (found_in_addressbook(msginfo->from)) {
-+		end_address_completion();
-+		return TRUE;
-+	}
-+	
-+	end_address_completion();
-+	return FALSE;
-+}
-+
-+static void dillo_show_mimepart(MimeViewer *_viewer,
-+				const gchar *infile,
-+				MimeInfo *partinfo)
-+{
-+	DilloViewer *viewer = (DilloViewer *) _viewer;
-+
-+	debug_print("dillo_show_mimepart\n");
-+
-+	if (viewer->filename != NULL) {
-+		claws_unlink(viewer->filename);
-+		g_free(viewer->filename);
-+	}
-+
-+	viewer->filename = procmime_get_tmp_file_name(partinfo);
-+	
-+	if (!(procmime_get_part(viewer->filename, partinfo) < 0)) {
-+		gchar *cmd;
-+
-+		if (viewer->socket)
-+			gtk_widget_destroy(viewer->socket);
-+		viewer->socket = gtk_socket_new();
-+		debug_print("Adding dillo socket %p", viewer->socket);
-+		gtk_container_add(GTK_CONTAINER(viewer->widget),
-+				  viewer->socket);
-+		gtk_widget_realize(viewer->socket);
-+		gtk_widget_show(viewer->socket);
-+		g_signal_connect(G_OBJECT(viewer->socket), "destroy", 
-+				 G_CALLBACK(socket_destroy_cb), viewer);
-+
-+		cmd = g_strdup_printf("dillo %s%s-x %d \"%s\"",
-+				      (!load_images(viewer) ? "-l " : ""),
-+				      (dillo_prefs.full ? "-f " : ""),
-+				      (gint) GDK_WINDOW_XWINDOW(viewer->socket->window),
-+				      viewer->filename);
-+
-+		execute_command_line(cmd, TRUE, NULL);
-+		g_free(cmd);
-+	}
-+}
-+
-+static void dillo_clear_viewer(MimeViewer *_viewer)
-+{
-+	DilloViewer *viewer = (DilloViewer *) _viewer;
-+
-+	debug_print("dillo_clear_viewer\n");
-+	debug_print("Removing dillo socket %p\n", viewer->socket);
-+
-+	if (viewer->socket) {
-+		gtk_widget_destroy(viewer->socket);
-+	}
-+}
-+
-+static void dillo_destroy_viewer(MimeViewer *_viewer)
-+{
-+	DilloViewer *viewer = (DilloViewer *) _viewer;
-+
-+	debug_print("dillo_destroy_viewer\n");
-+
-+	if (viewer->socket) {
-+		gtk_widget_destroy(viewer->socket);
-+	}
-+
-+	g_object_unref(GTK_WIDGET(viewer->widget));
-+	claws_unlink(viewer->filename);
-+	g_free(viewer->filename);
-+    	g_free(viewer);
-+}
-+
-+static MimeViewer *dillo_viewer_create(void)
-+{
-+	DilloViewer *viewer;
-+
-+	debug_print("dillo_viewer_create\n");
-+	
-+	viewer = g_new0(DilloViewer, 1);
-+	viewer->mimeviewer.factory = &dillo_viewer_factory;
-+	viewer->mimeviewer.get_widget = dillo_get_widget;
-+	viewer->mimeviewer.show_mimepart = dillo_show_mimepart;
-+	viewer->mimeviewer.clear_viewer = dillo_clear_viewer;
-+	viewer->mimeviewer.destroy_viewer = dillo_destroy_viewer;	
-+	viewer->mimeviewer.get_selection = NULL;
-+	viewer->widget = gtk_event_box_new();
-+
-+	gtk_widget_show(viewer->widget);
-+	g_object_ref(viewer->widget);
-+
-+	viewer->filename = NULL;
-+
-+	return (MimeViewer *) viewer;
-+}
-+
-+static gchar *content_types[] = 
-+	{"text/html", NULL};
-+
-+static MimeViewerFactory dillo_viewer_factory =
-+{
-+	content_types,	
-+	0,
-+
-+	dillo_viewer_create,
-+};
-+
-+gint plugin_init(gchar **error)
-+{
-+	gchar *dillo_path = NULL;
-+	if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
-+				VERSION_NUMERIC, PLUGIN_NAME, error))
-+  		return -1;
-+
-+	if ((dillo_path = g_find_program_in_path("dillo")) == NULL) {
-+		*error = g_strdup(_("Can't find the dillo executable in PATH. Is it installed?"));
-+		return -1;
-+	}
-+	g_free(dillo_path);
-+
-+        dillo_prefs_init();
-+
-+	mimeview_register_viewer_factory(&dillo_viewer_factory);
-+
-+	return 0;	
-+}
-+
-+gboolean plugin_done(void)
-+{
-+	mimeview_unregister_viewer_factory(&dillo_viewer_factory);
-+
-+        dillo_prefs_done();
-+	return TRUE;
-+}
-+
-+const gchar *plugin_name(void)
-+{
-+	return PLUGIN_NAME;
-+}
-+
-+const gchar *plugin_desc(void)
-+{
-+	return _("This plugin renders HTML mail using the Dillo "
-+		"web browser.\n"
-+	        "\n"
-+	        "Options can be found in /Configuration/Preferences/Plugins/Dillo Browser");
-+}
-+
-+const gchar *plugin_type(void)
-+{
-+	return "GTK2";
-+}
-+
-+const gchar *plugin_licence(void)
-+{
-+	return "GPL3+";
-+}
-+
-+const gchar *plugin_version(void)
-+{
-+	return VERSION;
-+}
-+
-+struct PluginFeature *plugin_provides(void)
-+{
-+	static struct PluginFeature features[] = 
-+		{ {PLUGIN_MIMEVIEWER, "text/html"},
-+		  {PLUGIN_NOTHING, NULL}};
-+	return features;
-+}
--- 
+--- /dev/null
++++ b/src/plugins/dillo/dillo_viewer.c
+@@ -0,0 +1,310 @@
++/*
++ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
++ * Copyright (C) 1999-2012 the Claws Mail Team
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ * 
++ */
++
++#ifdef HAVE_CONFIG_H
++#  include "config.h"
++#include "claws-features.h"
++#endif
++
++#include <unistd.h>
++
++#include <glib.h>
++#include <glib/gi18n.h>
++#include <gtk/gtk.h>
++#if GTK_CHECK_VERSION(3, 0, 0)
++#include <gtk/gtkx.h>
++#endif
++#include <gdk/gdkx.h>
++
++#include "common/claws.h"
++#include "common/version.h"
++#include "plugin.h"
++#include "utils.h"
++#include "mimeview.h"
++#include "addr_compl.h"
++
++#include "dillo_prefs.h"
++
++#define PLUGIN_NAME (_("Dillo HTML Viewer"))
++
++typedef struct _DilloViewer DilloViewer;
++
++struct _DilloViewer
++{
++	MimeViewer	 mimeviewer;
++	GtkWidget	*widget;	
++	GtkWidget	*socket;
++	gchar		*filename;
++};
++
++static MimeViewerFactory dillo_viewer_factory;
++
++static GtkWidget *dillo_get_widget(MimeViewer *_viewer)
++{
++	DilloViewer *viewer = (DilloViewer *) _viewer;
++
++	debug_print("dillo_get_widget\n");
++
++	return GTK_WIDGET(viewer->widget);
++}
++
++#if !GTK_CHECK_VERSION(3, 0, 0)
++static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
++#else
++static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
++#endif
++{
++	DilloViewer *viewer = (DilloViewer *) data;
++	debug_print("Destroyed dillo socket %p\n", viewer->socket);
++	viewer->socket = NULL;
++	return FALSE;
++}
++
++static gboolean found_in_addressbook(const gchar *address)
++{
++	gchar *addr = NULL;
++	gboolean found = FALSE;
++	gint num_addr = 0;
++	
++	if (!address)
++		return FALSE;
++	
++	addr = g_strdup(address);
++	extract_address(addr);
++	num_addr = complete_address(addr);
++	if (num_addr > 1) {
++		/* skip first item (this is the search string itself) */
++		int i = 1;
++		for (; i < num_addr && !found; i++) {
++			gchar *caddr = get_complete_address(i);
++			extract_address(caddr);
++			if (strcasecmp(caddr, addr) == 0)
++				found = TRUE;
++			g_free(caddr);
++		}
++	}
++	g_free(addr);
++	return found;
++}
++
++static gboolean load_images(DilloViewer *viewer)
++{
++	MessageView *messageview = ((MimeViewer *)viewer)->mimeview 
++					? ((MimeViewer *)viewer)->mimeview->messageview 
++					: NULL;
++	MsgInfo *msginfo = NULL;
++	gchar *ab_folderpath = NULL;
++
++	if (messageview == NULL)
++		return FALSE;
++	
++	msginfo = messageview->msginfo;
++	
++	if (msginfo == NULL)
++		return FALSE;
++
++	/* don't load remote images, period. */
++	if (dillo_prefs.local)
++		return FALSE;
++	
++	/* don't do whitelisting -> load images */
++	if (!dillo_prefs.whitelist_ab)
++		return TRUE;
++
++	if (*dillo_prefs.whitelist_ab_folder != '\0' &&
++	    strcasecmp(dillo_prefs.whitelist_ab_folder, _("Any")) != 0)
++		ab_folderpath = dillo_prefs.whitelist_ab_folder;
++
++	start_address_completion(ab_folderpath);
++
++	/* do whitelisting -> check sender */
++	if (found_in_addressbook(msginfo->from)) {
++		end_address_completion();
++		return TRUE;
++	}
++	
++	end_address_completion();
++	return FALSE;
++}
++
++static void dillo_show_mimepart(MimeViewer *_viewer,
++				const gchar *infile,
++				MimeInfo *partinfo)
++{
++	DilloViewer *viewer = (DilloViewer *) _viewer;
++
++	debug_print("dillo_show_mimepart\n");
++
++	if (viewer->filename != NULL) {
++		claws_unlink(viewer->filename);
++		g_free(viewer->filename);
++	}
++
++	viewer->filename = procmime_get_tmp_file_name(partinfo);
++	
++	if (!(procmime_get_part(viewer->filename, partinfo) < 0)) {
++		gchar *cmd;
++
++		if (viewer->socket)
++			gtk_widget_destroy(viewer->socket);
++		viewer->socket = gtk_socket_new();
++		debug_print("Adding dillo socket %p", viewer->socket);
++		gtk_container_add(GTK_CONTAINER(viewer->widget),
++				  viewer->socket);
++		gtk_widget_realize(viewer->socket);
++		gtk_widget_show(viewer->socket);
++		g_signal_connect(G_OBJECT(viewer->socket), "destroy", 
++				 G_CALLBACK(socket_destroy_cb), viewer);
++
++		cmd = g_strdup_printf("dillo %s%s-x %d \"%s\"",
++				      (!load_images(viewer) ? "-l " : ""),
++				      (dillo_prefs.full ? "-f " : ""),
++				      (gint) GDK_WINDOW_XWINDOW(viewer->socket->window),
++				      viewer->filename);
++
++		execute_command_line(cmd, TRUE, NULL);
++		g_free(cmd);
++	}
++}
++
++static void dillo_clear_viewer(MimeViewer *_viewer)
++{
++	DilloViewer *viewer = (DilloViewer *) _viewer;
++
++	debug_print("dillo_clear_viewer\n");
++	debug_print("Removing dillo socket %p\n", viewer->socket);
++
++	if (viewer->socket) {
++		gtk_widget_destroy(viewer->socket);
++	}
++}
++
++static void dillo_destroy_viewer(MimeViewer *_viewer)
++{
++	DilloViewer *viewer = (DilloViewer *) _viewer;
++
++	debug_print("dillo_destroy_viewer\n");
++
++	if (viewer->socket) {
++		gtk_widget_destroy(viewer->socket);
++	}
++
++	g_object_unref(GTK_WIDGET(viewer->widget));
++	claws_unlink(viewer->filename);
++	g_free(viewer->filename);
++    	g_free(viewer);
++}
++
++static MimeViewer *dillo_viewer_create(void)
++{
++	DilloViewer *viewer;
++
++	debug_print("dillo_viewer_create\n");
++	
++	viewer = g_new0(DilloViewer, 1);
++	viewer->mimeviewer.factory = &dillo_viewer_factory;
++	viewer->mimeviewer.get_widget = dillo_get_widget;
++	viewer->mimeviewer.show_mimepart = dillo_show_mimepart;
++	viewer->mimeviewer.clear_viewer = dillo_clear_viewer;
++	viewer->mimeviewer.destroy_viewer = dillo_destroy_viewer;	
++	viewer->mimeviewer.get_selection = NULL;
++	viewer->widget = gtk_event_box_new();
++
++	gtk_widget_show(viewer->widget);
++	g_object_ref(viewer->widget);
++
++	viewer->filename = NULL;
++
++	return (MimeViewer *) viewer;
++}
++
++static gchar *content_types[] = 
++	{"text/html", NULL};
++
++static MimeViewerFactory dillo_viewer_factory =
++{
++	content_types,	
++	0,
++
++	dillo_viewer_create,
++};
++
++gint plugin_init(gchar **error)
++{
++	gchar *dillo_path = NULL;
++	if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
++				VERSION_NUMERIC, PLUGIN_NAME, error))
++  		return -1;
++
++	if ((dillo_path = g_find_program_in_path("dillo")) == NULL) {
++		*error = g_strdup(_("Can't find the dillo executable in PATH. Is it installed?"));
++		return -1;
++	}
++	g_free(dillo_path);
++
++        dillo_prefs_init();
++
++	mimeview_register_viewer_factory(&dillo_viewer_factory);
++
++	return 0;	
++}
++
++gboolean plugin_done(void)
++{
++	mimeview_unregister_viewer_factory(&dillo_viewer_factory);
++
++        dillo_prefs_done();
++	return TRUE;
++}
++
++const gchar *plugin_name(void)
++{
++	return PLUGIN_NAME;
++}
++
++const gchar *plugin_desc(void)
++{
++	return _("This plugin renders HTML mail using the Dillo "
++		"web browser.\n"
++	        "\n"
++	        "Options can be found in /Configuration/Preferences/Plugins/Dillo Browser");
++}
++
++const gchar *plugin_type(void)
++{
++	return "GTK2";
++}
++
++const gchar *plugin_licence(void)
++{
++	return "GPL3+";
++}
++
++const gchar *plugin_version(void)
++{
++	return VERSION;
++}
++
++struct PluginFeature *plugin_provides(void)
++{
++	static struct PluginFeature features[] = 
++		{ {PLUGIN_MIMEVIEWER, "text/html"},
++		  {PLUGIN_NOTHING, NULL}};
++	return features;
++}
+-- 
 1.7.10.4
 
+From 1950c0973e8175da4b7fde7eca66184086e903ac Mon Sep 17 00:00:00 2001
+From: Michael Rasmussen <mir@datanom.net>
+Date: Sun, 5 Feb 2017 01:13:03 +0100
+Subject: [PATCH] Fix build when using alternate addressbook
+
+---
+ src/plugins/dillo/dillo_prefs.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/plugins/dillo/dillo_viewer.c b/src/plugins/dillo/dillo_viewer.c
+index 1c63fa3..6c820f0 100644
+--- a/src/plugins/dillo/dillo_viewer.c
++++ b/src/plugins/dillo/dillo_viewer.c
+@@ -76,33 +76,6 @@ static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
+ 	return FALSE;
+ }
+ 
+-static gboolean found_in_addressbook(const gchar *address)
+-{
+-	gchar *addr = NULL;
+-	gboolean found = FALSE;
+-	gint num_addr = 0;
+-	
+-	if (!address)
+-		return FALSE;
+-	
+-	addr = g_strdup(address);
+-	extract_address(addr);
+-	num_addr = complete_address(addr);
+-	if (num_addr > 1) {
+-		/* skip first item (this is the search string itself) */
+-		int i = 1;
+-		for (; i < num_addr && !found; i++) {
+-			gchar *caddr = get_complete_address(i);
+-			extract_address(caddr);
+-			if (strcasecmp(caddr, addr) == 0)
+-				found = TRUE;
+-			g_free(caddr);
+-		}
+-	}
+-	g_free(addr);
+-	return found;
+-}
+-
+ static gboolean load_images(DilloViewer *viewer)
+ {
+ 	MessageView *messageview = ((MimeViewer *)viewer)->mimeview 
+From 2bf719fcbf4e1e2cbfb0b574db48c468375e4dbf Mon Sep 17 00:00:00 2001
+From: Andrej Kacian <ticho@claws-mail.org>
+Date: Sat, 4 Feb 2017 18:31:45 +0100
+Subject: [PATCH] Make --disable-dillo-plugin actually do something.
+
+---
+ src/plugins/dillo/Makefile.am |    2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/plugins/dillo/Makefile.am b/src/plugins/dillo/Makefile.am
+index 2dd9349..9f8f42a 100644
+--- a/src/plugins/dillo/Makefile.am
++++ b/src/plugins/dillo/Makefile.am
+@@ -5,7 +5,9 @@
+ 
+ plugindir = $(pkglibdir)/plugins
+ 
++if BUILD_DILLO_PLUGIN
+ plugin_LTLIBRARIES = dillo.la
++endif
+ 
+ dillo_la_SOURCES = \
+      dillo_viewer.c \
+-- 
+1.7.10.4
+
+diff --git a/src/plugins/dillo/dillo_prefs.c b/src/plugins/dillo/dillo_prefs.c
+index 8d9529b..08718cd 100644
+--- a/src/plugins/dillo/dillo_prefs.c
++++ b/src/plugins/dillo/dillo_prefs.c
+@@ -78,7 +78,7 @@ static void create_dillo_prefs_page	(PrefsPage *page,
+ static void destroy_dillo_prefs_page	(PrefsPage *page);
+ static void save_dillo_prefs		(PrefsPage *page);
+ 
+-#ifndef USE_NEW_ADDRBOOK
++#ifndef USE_ALT_ADDRBOOK
+ static void dillo_whitelist_ab_select_cb(GtkWidget *widget, gpointer data)
+ {
+ 	DilloBrowserPage *page = (DilloBrowserPage *) data;
+@@ -238,7 +238,7 @@ static void create_dillo_prefs_page(PrefsPage *page,
+ 			 G_CALLBACK(whitelist_checkbox_toggled),
+ 			 prefs_page);
+ 
+-#ifndef USE_NEW_ADDRBOOK
++#ifndef USE_ALT_ADDRBOOK
+ 	g_signal_connect(G_OBJECT (whitelist_ab_select_btn), "clicked",
+ 			 G_CALLBACK(dillo_whitelist_ab_select_cb), prefs_page);
+ #else
+-- 
+1.7.10.4
+
+
+
+
+

Copyright © 2002-2017 Judd Vinet and Aaron Griffin. The Arch Linux name and logo +are recognized trademarks. Some rights reserved. The registered trademark +Linux® is used pursuant to a sublicense from LMI, the exclusive licensee +of Linus Torvalds, owner of the mark on a world-wide basis.

+
+
+ + diff --git a/nonprism/claws-mail/enchant-2.patch b/nonprism/claws-mail/enchant-2.patch new file mode 100644 index 000000000..1a2ee926f --- /dev/null +++ b/nonprism/claws-mail/enchant-2.patch @@ -0,0 +1,11 @@ +--- claws-mail-3.15.1/src/gtk/gtkaspell.c.orig 2017-08-28 17:48:24.000000000 +0000 ++++ claws-mail-3.15.1/src/gtk/gtkaspell.c 2017-11-22 15:05:59.371073969 +0000 +@@ -1348,7 +1348,7 @@ + { + GtkAspell *gtkaspell = (GtkAspell *) data; + +- enchant_dict_add_to_pwl(gtkaspell->gtkaspeller->speller, gtkaspell->theword, strlen(gtkaspell->theword)); ++ enchant_dict_add(gtkaspell->gtkaspeller->speller, gtkaspell->theword, strlen(gtkaspell->theword)); + + gtkaspell->ctx.check_word(gtkaspell->ctx.data); + gtkaspell_dict_changed(gtkaspell); -- cgit v1.2.3