Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 143894 | Differences between
and this patch

Collapse All | Expand All

(-)mahogany-0.67/acinclude.m4 (-259 / +15 lines)
Lines 1-4 Link Here
1
dnl $Id: acinclude.m4,v 1.9 2004/10/10 23:55:35 vadz Exp $
1
dnl $Id: acinclude.m4,v 1.11 2006/08/25 15:38:28 vadz Exp $
2
dnl local macro definitions for M's configure.in
2
dnl local macro definitions for M's configure.in
3
3
4
dnl package,message,variable,default,helpmessage
4
dnl package,message,variable,default,helpmessage
Lines 170-432 Link Here
170
  ]
170
  ]
171
)
171
)
172
172
173
173
dnl M_GCC_OPTION(OPTION, ACTION-IF-SUPPORTED, ACTION-IF-NOT-SUPPORTED)
174
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
175
## Copyright (C) 1996-1998 Free Software Foundation, Inc.
176
## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
177
##
178
## This program is free software; you can redistribute it and/or modify
179
## it under the terms of the GNU General Public License as published by
180
## the Free Software Foundation; either version 2 of the License, or
181
## (at your option) any later version.
182
##
183
## This program is distributed in the hope that it will be useful, but
184
## WITHOUT ANY WARRANTY; without even the implied warranty of
185
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
186
## General Public License for more details.
187
##
188
## You should have received a copy of the GNU General Public License
189
## along with this program; if not, write to the Free Software
190
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
191
##
192
## As a special exception to the GNU General Public License, if you
193
## distribute this file as part of a program that contains a
194
## configuration script generated by Autoconf, you may include it under
195
## the same distribution terms that you use for the rest of that program.
196
197
# serial 24 AM_PROG_LIBTOOL
198
AC_DEFUN([AM_PROG_LIBTOOL],
199
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
200
AC_REQUIRE([AM_ENABLE_STATIC])dnl
201
AC_REQUIRE([AC_CANONICAL_HOST])dnl
202
AC_REQUIRE([AC_PROG_RANLIB])dnl
203
AC_REQUIRE([AC_PROG_CC])dnl
204
AC_REQUIRE([AM_PROG_LD])dnl
205
AC_REQUIRE([AM_PROG_NM])dnl
206
AC_REQUIRE([AC_PROG_LN_S])dnl
207
dnl
174
dnl
208
# Always use our own libtool.
175
dnl Check if gcc supports the given option (fails if compiler is not gcc)
209
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
176
AC_DEFUN([M_GCC_OPTION], [
210
AC_SUBST(LIBTOOL)dnl
177
   AC_REQUIRE([AC_PROG_CC])
211
178
   if test "x$GCC" = "xyes"; then
212
# Check for any special flags to pass to ltconfig.
179
      echo 'void f(){}' >conftest.c
213
libtool_flags=
180
      case "`$CC $1 -c conftest.c 2>&1`" in
214
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
181
         '') ifelse([$2], , :, [$2]) ;;
215
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
182
         *)  ifelse([$3], , :, [$3]) ;;
216
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
183
      esac
217
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
184
      rm -f conftest.*
218
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
185
   else
219
186
      ifelse([$3], , :, [$3])
220
# Some flags need to be propagated to the compiler or linker for good
187
   fi
221
# libtool support.
222
case "$host" in
223
*-*-irix6*)
224
  # Find out which ABI we are using.
225
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
226
  if AC_TRY_EVAL(ac_compile); then
227
    case "`/usr/bin/file conftest.o`" in
228
    *32-bit*)
229
      LD="${LD-ld} -32"
230
      ;;
231
    *N32*)
232
      LD="${LD-ld} -n32"
233
      ;;
234
    *64-bit*)
235
      LD="${LD-ld} -64"
236
      ;;
237
    esac
238
  fi
239
  rm -rf conftest*
240
  ;;
241
242
*-*-sco3.2v5*)
243
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
244
  CFLAGS="$CFLAGS -belf"
245
  ;;
246
esac
247
248
# Actually configure libtool.  ac_aux_dir is where install-sh is found.
249
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
250
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
251
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
252
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
253
|| AC_MSG_ERROR([libtool configure failed])
254
])
255
256
# AM_ENABLE_SHARED - implement the --enable-shared flag
257
# Usage: AM_ENABLE_SHARED[(DEFAULT)]
258
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
259
#   `yes'.
260
AC_DEFUN([AM_ENABLE_SHARED],
261
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
262
AC_ARG_ENABLE(shared,
263
changequote(<<, >>)dnl
264
<<  --enable-shared         build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
265
changequote([, ])dnl
266
[  --enable-shared=PKGS    only build shared libraries if the current package
267
                          appears as an element in the PKGS list],
268
[p=${PACKAGE-default}
269
case "$enableval" in
270
yes) enable_shared=yes ;;
271
no) enable_shared=no ;;
272
*)
273
  enable_shared=no
274
  # Look at the argument we got.  We use all the common list separators.
275
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
276
  for pkg in $enableval; do
277
    if test "X$pkg" = "X$p"; then
278
      enable_shared=yes
279
    fi
280
  done
281
  IFS="$ac_save_ifs"
282
  ;;
283
esac],
284
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
285
])
286
287
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
288
AC_DEFUN([AM_DISABLE_SHARED],
289
[AM_ENABLE_SHARED(no)])
290
291
# AM_DISABLE_STATIC - set the default static flag to --disable-static
292
AC_DEFUN([AM_DISABLE_STATIC],
293
[AM_ENABLE_STATIC(no)])
294
295
# AM_ENABLE_STATIC - implement the --enable-static flag
296
# Usage: AM_ENABLE_STATIC[(DEFAULT)]
297
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
298
#   `yes'.
299
AC_DEFUN([AM_ENABLE_STATIC],
300
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
301
AC_ARG_ENABLE(static,
302
changequote(<<, >>)dnl
303
<<  --enable-static         build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
304
changequote([, ])dnl
305
[  --enable-static=PKGS    only build shared libraries if the current package
306
                          appears as an element in the PKGS list],
307
[p=${PACKAGE-default}
308
case "$enableval" in
309
yes) enable_static=yes ;;
310
no) enable_static=no ;;
311
*)
312
  enable_static=no
313
  # Look at the argument we got.  We use all the common list separators.
314
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
315
  for pkg in $enableval; do
316
    if test "X$pkg" = "X$p"; then
317
      enable_static=yes
318
    fi
319
  done
320
  IFS="$ac_save_ifs"
321
  ;;
322
esac],
323
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
324
])
325
326
327
# AM_PROG_LD - find the path to the GNU or non-GNU linker
328
AC_DEFUN([AM_PROG_LD],
329
[AC_ARG_WITH(gnu-ld,
330
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
331
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
332
AC_REQUIRE([AC_PROG_CC])
333
ac_prog=ld
334
if test "$ac_cv_prog_gcc" = yes; then
335
  # Check if gcc -print-prog-name=ld gives a path.
336
  AC_MSG_CHECKING([for ld used by GCC])
337
  ac_prog=`($CC -print-prog-name=ld) 2>&5`
338
  case "$ac_prog" in
339
  # Accept absolute paths.
340
  /* | [A-Za-z]:\\*)
341
    test -z "$LD" && LD="$ac_prog"
342
    ;;
343
  "")
344
    # If it fails, then pretend we aren't using GCC.
345
    ac_prog=ld
346
    ;;
347
  *)
348
    # If it is relative, then search for the first ld in PATH.
349
    with_gnu_ld=unknown
350
    ;;
351
  esac
352
elif test "$with_gnu_ld" = yes; then
353
  AC_MSG_CHECKING([for GNU ld])
354
else
355
  AC_MSG_CHECKING([for non-GNU ld])
356
fi
357
AC_CACHE_VAL(ac_cv_path_LD,
358
[if test -z "$LD"; then
359
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
360
  for ac_dir in $PATH; do
361
    test -z "$ac_dir" && ac_dir=.
362
    if test -f "$ac_dir/$ac_prog"; then
363
      ac_cv_path_LD="$ac_dir/$ac_prog"
364
      # Check to see if the program is GNU ld.  I'd rather use --version,
365
      # but apparently some GNU ld's only accept -v.
366
      # Break only if it was the GNU/non-GNU ld that we prefer.
367
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
368
	test "$with_gnu_ld" != no && break
369
      else
370
        test "$with_gnu_ld" != yes && break
371
      fi
372
    fi
373
  done
374
  IFS="$ac_save_ifs"
375
else
376
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
377
fi])
378
LD="$ac_cv_path_LD"
379
if test -n "$LD"; then
380
  AC_MSG_RESULT($LD)
381
else
382
  AC_MSG_RESULT(no)
383
fi
384
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
385
AC_SUBST(LD)
386
AM_PROG_LD_GNU
387
])
388
389
AC_DEFUN([AM_PROG_LD_GNU],
390
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
391
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
392
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
393
  ac_cv_prog_gnu_ld=yes
394
else
395
  ac_cv_prog_gnu_ld=no
396
fi])
397
])
398
399
# AM_PROG_NM - find the path to a BSD-compatible name lister
400
AC_DEFUN([AM_PROG_NM],
401
[AC_MSG_CHECKING([for BSD-compatible nm])
402
AC_CACHE_VAL(ac_cv_path_NM,
403
[case "$NM" in
404
/* | [A-Za-z]:\\*)
405
  ac_cv_path_NM="$NM" # Let the user override the test with a path.
406
  ;;
407
*)
408
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
409
  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
410
    test -z "$ac_dir" && ac_dir=.
411
    if test -f $ac_dir/nm; then
412
      # Check to see if the nm accepts a BSD-compat flag.
413
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
414
      #   nm: unknown option "B" ignored
415
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
416
        ac_cv_path_NM="$ac_dir/nm -B"
417
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
418
        ac_cv_path_NM="$ac_dir/nm -p"
419
      else
420
        ac_cv_path_NM="$ac_dir/nm"
421
      fi
422
      break
423
    fi
424
  done
425
  IFS="$ac_save_ifs"
426
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
427
  ;;
428
esac])
429
NM="$ac_cv_path_NM"
430
AC_MSG_RESULT([$NM])
431
AC_SUBST(NM)
432
])
188
])
(-)mahogany-0.67/configure (-15 / +37 lines)
Lines 16-22 Link Here
16
ac_help="$ac_help
16
ac_help="$ac_help
17
  --disable-optimize      disable optimization (automatic if debugging)"
17
  --disable-optimize      disable optimization (automatic if debugging)"
18
ac_help="$ac_help
18
ac_help="$ac_help
19
  --with-wxdebug          use debug wxWindows libraries"
19
  --with-wxdebug          use debug wxWidgets libraries"
20
ac_help="$ac_help
20
ac_help="$ac_help
21
  --with-dmalloc          use dmalloc (http://dmalloc.com/) for debugging"
21
  --with-dmalloc          use dmalloc (http://dmalloc.com/) for debugging"
22
ac_help="$ac_help
22
ac_help="$ac_help
Lines 568-574 Link Here
568
fi
568
fi
569
569
570
570
571
# From configure.in Id: configure.in,v 1.316 2006/05/03 20:16:04 vadz Exp 
571
# From configure.in Id: configure.in,v 1.318 2006/08/25 15:39:12 vadz Exp 
572
572
573
rm -f conftestdata
573
rm -f conftestdata
574
if ln -s X conftestdata 2>/dev/null
574
if ln -s X conftestdata 2>/dev/null
Lines 2143-2156 Link Here
2143
			if test -f /etc/redhat-release -a ! grep "7\.0" /etc/redhat-release
2143
			if test -f /etc/redhat-release -a ! grep "7\.0" /etc/redhat-release
2144
			then workarroundmsg="
2144
			then workarroundmsg="
2145
	It seems you are using Red Hat Linux 7.0. A workaround for your
2145
	It seems you are using Red Hat Linux 7.0. A workaround for your
2146
	problem is to use egcs to compile wxWindows and Mahogany:
2146
	problem is to use egcs to compile wxWidgets and Mahogany:
2147
		- at your bash prompt type:
2147
		- at your bash prompt type:
2148
			export CC=egcs
2148
			export CC=egcs
2149
			export CXX=egcs++
2149
			export CXX=egcs++
2150
		- reconfigure and rebuild wxWindows and Mahogany
2150
		- reconfigure and rebuild wxWidgets and Mahogany
2151
		(don't forget to remove the config.cache files
2151
		(don't forget to remove the config.cache files
2152
		located in the source code directories of
2152
		located in the source code directories of
2153
		wxWindows and Mahogany before reconfiguring them."
2153
		wxWidgets and Mahogany before reconfiguring them."
2154
			else workarroundmsg=""
2154
			else workarroundmsg=""
2155
			fi
2155
			fi
2156
			{ echo "configure: error: Sorry, it seems that you have a buggy gcc version which is
2156
			{ echo "configure: error: Sorry, it seems that you have a buggy gcc version which is
Lines 4481-4493 Link Here
4481
4481
4482
if test "$wxOK" != 1; then
4482
if test "$wxOK" != 1; then
4483
   { echo "configure: error: 
4483
   { echo "configure: error: 
4484
	   Mahogany requires wxWindows to be installed on your system
4484
	   Mahogany requires wxWidgets to be installed on your system
4485
	   but wx-config script couldn't be found.
4485
	   but wx-config script couldn't be found.
4486
4486
4487
	   Please check that wx-config is in PATH, the directory
4487
	   Please check that wx-config is in PATH, the directory
4488
	   where wxWindows libraries are installed (returned by
4488
	   where wxWidgets libraries are installed (returned by
4489
	   'wx-config --libs' command) is in LD_LIBRARY_PATH or
4489
	   'wx-config --libs' command) is in LD_LIBRARY_PATH or
4490
	   equivalent variable and wxWindows version is 2.5.2 or above.
4490
	   equivalent variable and wxWidgets version is 2.5.2 or above.
4491
   " 1>&2; exit 1; }
4491
   " 1>&2; exit 1; }
4492
fi
4492
fi
4493
4493
Lines 4559-4566 Link Here
4559
fi
4559
fi
4560
4560
4561
case "$USE_THREADS" in 1)
4561
case "$USE_THREADS" in 1)
4562
	echo $ac_n "checking if wxWindows was compiled with threads""... $ac_c" 1>&6
4562
	echo $ac_n "checking if wxWidgets was compiled with threads""... $ac_c" 1>&6
4563
echo "configure:4564: checking if wxWindows was compiled with threads" >&5
4563
echo "configure:4564: checking if wxWidgets was compiled with threads" >&5
4564
if eval "test \"`echo '$''{'m_cv_wx_threads'+set}'`\" = set"; then
4564
if eval "test \"`echo '$''{'m_cv_wx_threads'+set}'`\" = set"; then
4565
  echo $ac_n "(cached) $ac_c" 1>&6
4565
  echo $ac_n "(cached) $ac_c" 1>&6
4566
else
4566
else
Lines 5324-5331 Link Here
5324
5324
5325
IMAP_CFLAGS="$CFLAGS"
5325
IMAP_CFLAGS="$CFLAGS"
5326
IMAP_CPPFLAGS="$IMAP_CPPFLAGS $CPPFLAGS"
5326
IMAP_CPPFLAGS="$IMAP_CPPFLAGS $CPPFLAGS"
5327
if test "$GCC" = "yes"; then
5327
echo $ac_n "checking whether $CC accepts -Wno-pointer-sign""... $ac_c" 1>&6
5328
            IMAP_CPPFLAGS="$IMAP_CPPFLAGS -Wno-pointer-sign"
5328
echo "configure:5329: checking whether $CC accepts -Wno-pointer-sign" >&5
5329
if eval "test \"`echo '$''{'m_cv_cc_no_warn_ptr_sign'+set}'`\" = set"; then
5330
  echo $ac_n "(cached) $ac_c" 1>&6
5331
else
5332
  
5333
   
5334
   if test "x$GCC" = "xyes"; then
5335
      echo 'void f(){}' >conftest.c
5336
      case "`$CC -Wno-pointer-sign -c conftest.c 2>&1`" in
5337
         '') m_cv_cc_no_warn_ptr_sign="yes" ;;
5338
         *)  m_cv_cc_no_warn_ptr_sign="no" ;;
5339
      esac
5340
      rm -f conftest.*
5341
   else
5342
      m_cv_cc_no_warn_ptr_sign="no"
5343
   fi
5344
5345
5346
fi
5347
5348
echo "$ac_t""$m_cv_cc_no_warn_ptr_sign" 1>&6
5349
if test $m_cv_cc_no_warn_ptr_sign = "yes"; then
5350
    IMAP_CPPFLAGS="$IMAP_CPPFLAGS -Wno-pointer-sign"
5329
fi
5351
fi
5330
5352
5331
5353
Lines 5380-5386 Link Here
5380
if test "x$DEPFLAGS" != "x"; then
5402
if test "x$DEPFLAGS" != "x"; then
5381
            if test "x$GXX" != "xyes"; then
5403
            if test "x$GXX" != "xyes"; then
5382
	echo $ac_n "checking whether ${CXX} accepts ${DEPFLAGS}""... $ac_c" 1>&6
5404
	echo $ac_n "checking whether ${CXX} accepts ${DEPFLAGS}""... $ac_c" 1>&6
5383
echo "configure:5384: checking whether ${CXX} accepts ${DEPFLAGS}" >&5
5405
echo "configure:5406: checking whether ${CXX} accepts ${DEPFLAGS}" >&5
5384
if eval "test \"`echo '$''{'m_cv_cxx_depflags'+set}'`\" = set"; then
5406
if eval "test \"`echo '$''{'m_cv_cxx_depflags'+set}'`\" = set"; then
5385
  echo $ac_n "(cached) $ac_c" 1>&6
5407
  echo $ac_n "(cached) $ac_c" 1>&6
5386
else
5408
else
Lines 5403-5409 Link Here
5403
    if test "x$DEPFLAGS" != "x"; then
5425
    if test "x$DEPFLAGS" != "x"; then
5404
	if test "x$GCC" != "xyes"; then
5426
	if test "x$GCC" != "xyes"; then
5405
	    echo $ac_n "checking whether ${CC} accepts ${DEPFLAGS}""... $ac_c" 1>&6
5427
	    echo $ac_n "checking whether ${CC} accepts ${DEPFLAGS}""... $ac_c" 1>&6
5406
echo "configure:5407: checking whether ${CC} accepts ${DEPFLAGS}" >&5
5428
echo "configure:5429: checking whether ${CC} accepts ${DEPFLAGS}" >&5
5407
if eval "test \"`echo '$''{'m_cv_c_depflags'+set}'`\" = set"; then
5429
if eval "test \"`echo '$''{'m_cv_c_depflags'+set}'`\" = set"; then
5408
  echo $ac_n "(cached) $ac_c" 1>&6
5430
  echo $ac_n "(cached) $ac_c" 1>&6
5409
else
5431
else
Lines 5958-5964 Link Here
5958
echo
5980
echo
5959
echo "Configured Mahogany ${M_VERSION_MAJOR}.${M_VERSION_MINOR}.${M_VERSION_RELEASE} for ${host}."
5981
echo "Configured Mahogany ${M_VERSION_MAJOR}.${M_VERSION_MINOR}.${M_VERSION_RELEASE} for ${host}."
5960
echo ""
5982
echo ""
5961
echo "	wxWindows port used:			${WX_NAME} ${WX_VERSION}"
5983
echo "	wxWidgets port used:			${WX_NAME} ${WX_VERSION}"
5962
echo "	Debug mode:				${debug_option}"
5984
echo "	Debug mode:				${debug_option}"
5963
echo "	SSL support:				${ssl_option}"
5985
echo "	SSL support:				${ssl_option}"
5964
echo "	Modules support:			${m_cv_USE_MODULES}"
5986
echo "	Modules support:			${m_cv_USE_MODULES}"
(-)mahogany-0.67/configure.in (-4 / +10 lines)
Lines 1-7 Link Here
1
dnl Process this file with autoconf to produce a configure script.
1
dnl Process this file with autoconf to produce a configure script.
2
2
3
AC_INIT(configure.in)
3
AC_INIT(configure.in)
4
AC_REVISION([$Id: configure.in,v 1.317 2006/07/31 00:32:44 nerijus Exp $])
4
AC_REVISION([$Id: configure.in,v 1.319 2006/08/31 23:58:25 vadz Exp $])
5
5
6
rm -f conftestdata
6
rm -f conftestdata
7
if ln -s X conftestdata 2>/dev/null
7
if ln -s X conftestdata 2>/dev/null
Lines 1293-1301 Link Here
1293
dnl imap
1293
dnl imap
1294
IMAP_CFLAGS="$CFLAGS"
1294
IMAP_CFLAGS="$CFLAGS"
1295
IMAP_CPPFLAGS="$IMAP_CPPFLAGS $CPPFLAGS"
1295
IMAP_CPPFLAGS="$IMAP_CPPFLAGS $CPPFLAGS"
1296
if test "$GCC" = "yes"; then
1296
dnl there are too many warnings in c-client sources which its author
1297
    dnl there are too many warnings in c-client sources which its author
1297
dnl refuses to fix, suppress them when using gcc4
1298
    dnl refuses to fix, suppress them when using gcc
1298
AC_CACHE_CHECK([whether $CC accepts -Wno-pointer-sign],
1299
    m_cv_cc_no_warn_ptr_sign,
1300
    [M_GCC_OPTION(-Wno-pointer-sign,
1301
	m_cv_cc_no_warn_ptr_sign="yes",
1302
	m_cv_cc_no_warn_ptr_sign="no")]
1303
)
1304
if test $m_cv_cc_no_warn_ptr_sign = "yes"; then
1299
    IMAP_CPPFLAGS="$IMAP_CPPFLAGS -Wno-pointer-sign"
1305
    IMAP_CPPFLAGS="$IMAP_CPPFLAGS -Wno-pointer-sign"
1300
fi
1306
fi
1301
AC_SUBST(IMAP_CPPFLAGS)
1307
AC_SUBST(IMAP_CPPFLAGS)
(-)mahogany-0.67/doc/release.txt (-2 / +1 lines)
Lines 98-104 Link Here
98
98
99
mahogany-announce@lists.sourceforge.net
99
mahogany-announce@lists.sourceforge.net
100
mahogany-users@lists.sourceforge.net
100
mahogany-users@lists.sourceforge.net
101
mahogany-developers@lists.sourceforge.net
102
101
103
c-client@u.washington.edu
102
c-client@u.washington.edu
104
wxwin-announce@lists.wxwindows.org
103
wxwin-announce@lists.wxwindows.org
Lines 118-124 Link Here
118
117
119
Update the FM record
118
Update the FM record
120
119
121
d) GNOME app map: http://www.gnome.org/softwaremap/projects/mahogany/
120
d) GNOME app map: http://www.gnomefiles.org/app.php/Mahogany
122
121
123
e) GNU Free Software Directory: http://www.gnu.org/directory/mahogany.html
122
e) GNU Free Software Directory: http://www.gnu.org/directory/mahogany.html
124
123
(-)mahogany-0.67/include/gui/wxBrowseButton.h (-6 / +1 lines)
Lines 6-12 Link Here
6
// Author:      Vadim Zeitlin
6
// Author:      Vadim Zeitlin
7
// Modified by:
7
// Modified by:
8
// Created:     24.12.98
8
// Created:     24.12.98
9
// CVS-ID:      $Id: wxBrowseButton.h,v 1.26 2006/01/16 20:32:01 nerijus Exp $
9
// CVS-ID:      $Id: wxBrowseButton.h,v 1.27 2006/08/31 23:18:29 vadz Exp $
10
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
11
// Licence:     M license
11
// Licence:     M license
12
///////////////////////////////////////////////////////////////////////////////
12
///////////////////////////////////////////////////////////////////////////////
Lines 293-303 Link Here
293
   // show the font selection dialog
293
   // show the font selection dialog
294
   virtual void DoBrowse();
294
   virtual void DoBrowse();
295
295
296
   // convert between wxNativeFontInfo description and the string we show to
297
   // the user in the text control
298
   static String FontDescToUser(const String& desc);
299
   static String FontDescFromUser(const String& desc);
300
301
private:
296
private:
302
   DECLARE_NO_COPY_CLASS(wxFontBrowseButton)
297
   DECLARE_NO_COPY_CLASS(wxFontBrowseButton)
303
};
298
};
(-)mahogany-0.67/include/guidef.h (-13 / +31 lines)
Lines 1-14 Link Here
1
/*-*- c++ -*-********************************************************
1
///////////////////////////////////////////////////////////////////////////////
2
 * guidef.h define the GUI implementation                           *
2
// Project:     M - cross platform e-mail GUI client
3
 *                                                                  *
3
// File name:   guidef.h
4
 * (C) 1997 by Karsten Ballüder (Ballueder@usa.net)                 *
4
// Purpose:     miscellaneous GUI helpers
5
 *                                                                  *
5
// Author:      Karsten Ballüder, Vadim Zeitlin
6
 * $Id: guidef.h,v 1.25 2004/08/13 20:57:56 vadz Exp $
6
// Created:     1998
7
 *
7
// CVS-ID:      $Id: guidef.h,v 1.26 2006/08/19 13:11:59 vadz Exp $
8
 *******************************************************************/
8
// Copyright:   (c) 1998-2006 Mahogany team
9
// Licence:     M license
10
///////////////////////////////////////////////////////////////////////////////
9
11
10
#ifndef GUIDEF_H
12
#ifndef M_GUIDEF_H_
11
#define GUIDEF_H
13
#define M_GUIDEF_H_
12
14
13
#ifndef USE_PCH
15
#ifndef USE_PCH
14
#  include <wx/frame.h>
16
#  include <wx/frame.h>
Lines 63-70 Link Here
63
  find a replacement encoding - if this succeeds, the text is translated into
65
  find a replacement encoding - if this succeeds, the text is translated into
64
  this encoding and the encoding parameter is modified in place.
66
  this encoding and the encoding parameter is modified in place.
65
67
66
  Note that this function is implemented in wxMApp.cpp.
67
68
  @param encoding the encoding to check, may be modified
68
  @param encoding the encoding to check, may be modified
69
  @param text the text we want to show in this encoding, may be translated
69
  @param text the text we want to show in this encoding, may be translated
70
  @return true if this or equivalent encoding is available, false otherwise
70
  @return true if this or equivalent encoding is available, false otherwise
Lines 73-78 Link Here
73
                                        wxString *text = NULL,
73
                                        wxString *text = NULL,
74
                                        bool mayAskUser = false);
74
                                        bool mayAskUser = false);
75
75
76
/**
77
   Create a font from the given native font description or font family and
78
   size.
79
80
   Notice that if neither of the parameters is specified (description is empty
81
   and the other ones are -1), an invalid font is returned and the caller
82
   should check for it and avoid using it in this case to avoid overriding the
83
   default system font if the user didn't set any specific font to use.
84
85
   @param fontDesc opaque string returned by wxFont::GetNativeFontInfoDesc()
86
   @param fontSize font size, -1 if not specified
87
   @param fontFamily font family, wxFONTFAMILY_DEFAULT if not specified
88
   @return font which may be invalid, to be checked by the caller
89
 */
90
extern wxFont
91
CreateFontFromDesc(const String& fontDesc, int fontSize, int fontFamily);
92
93
76
// Prevent MEvent dispatch inside wxYield
94
// Prevent MEvent dispatch inside wxYield
77
extern int g_busyCursorYield;
95
extern int g_busyCursorYield;
78
96
Lines 86-89 Link Here
86
   ~MBusyCursor() { MEndBusyCursor(); }
104
   ~MBusyCursor() { MEndBusyCursor(); }
87
};
105
};
88
106
89
#endif // GUIDEF_H
107
#endif // M_GUIDEF_H_
(-)mahogany-0.67/include/Mdefaults.h (-9 / +1 lines)
Lines 5-11 Link Here
5
// Author:      Karsten Ballüder
5
// Author:      Karsten Ballüder
6
// Modified by: Vadim Zeitlin at 22.08.01 to use MOption class
6
// Modified by: Vadim Zeitlin at 22.08.01 to use MOption class
7
// Created:     1997
7
// Created:     1997
8
// CVS-ID:      $Id: Mdefaults.h,v 1.259 2005/05/15 21:16:50 vadz Exp $
8
// CVS-ID:      $Id: Mdefaults.h,v 1.260 2006/08/19 13:11:59 vadz Exp $
9
// Copyright:   (c) 1997-2001 Mahogany team
9
// Copyright:   (c) 1997-2001 Mahogany team
10
// Licence:     M licence
10
// Licence:     M licence
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 15-28 Link Here
15
15
16
class Profile;
16
class Profile;
17
17
18
// under Windows 12pt font looks too huge, letters are like in a book for
19
// children
20
#ifdef OS_WIN
21
#  define DEFAULT_FONT_SIZE 10l
22
#else
23
#  define DEFAULT_FONT_SIZE 12l
24
#endif
25
26
/** @name Levels of  interaction, do something or not?
18
/** @name Levels of  interaction, do something or not?
27
19
28
    NB: these values can't be changed as they are written to (and read from)
20
    NB: these values can't be changed as they are written to (and read from)
(-)mahogany-0.67/include/Moptions.h (-7 / +7 lines)
Lines 7-13 Link Here
7
// Author:      Vadim Zeitlin
7
// Author:      Vadim Zeitlin
8
// Modified by:
8
// Modified by:
9
// Created:     23.08.01
9
// Created:     23.08.01
10
// CVS-ID:      $Id: Moptions.h,v 1.105 2006/06/23 23:27:30 vadz Exp $
10
// CVS-ID:      $Id: Moptions.h,v 1.106 2006/08/19 13:11:59 vadz Exp $
11
// Copyright:   (c) 2001 Vadim Zeitlin
11
// Copyright:   (c) 2001 Vadim Zeitlin
12
// Licence:     M licence
12
// Licence:     M licence
13
///////////////////////////////////////////////////////////////////////////////
13
///////////////////////////////////////////////////////////////////////////////
Lines 1906-1914 Link Here
1906
/// message view title
1906
/// message view title
1907
#define   MP_MVIEW_TITLE_FMT_DEFVAL   _("from $from about \"$subject\"")
1907
#define   MP_MVIEW_TITLE_FMT_DEFVAL   _("from $from about \"$subject\"")
1908
/// which font to use
1908
/// which font to use
1909
#define   MP_MVIEW_FONT_DEFVAL         6L
1909
#define   MP_MVIEW_FONT_DEFVAL         0L
1910
/// which font size
1910
/// which font size
1911
#define   MP_MVIEW_FONT_SIZE_DEFVAL         DEFAULT_FONT_SIZE
1911
#define   MP_MVIEW_FONT_SIZE_DEFVAL         -1
1912
/// the full font desc (replaces the 2 settings above)
1912
/// the full font desc (replaces the 2 settings above)
1913
#define   MP_MVIEW_FONT_DESC_DEFVAL   wxEmptyString
1913
#define   MP_MVIEW_FONT_DESC_DEFVAL   wxEmptyString
1914
/// which foreground colour for the font
1914
/// which foreground colour for the font
Lines 1944-1952 Link Here
1944
/**@name  Font settings for message view */
1944
/**@name  Font settings for message view */
1945
//@{
1945
//@{
1946
/// which font to use
1946
/// which font to use
1947
#define   MP_FVIEW_FONT_DEFVAL         4L
1947
#define   MP_FVIEW_FONT_DEFVAL         0L
1948
/// which font size
1948
/// which font size
1949
#define   MP_FVIEW_FONT_SIZE_DEFVAL         DEFAULT_FONT_SIZE
1949
#define   MP_FVIEW_FONT_SIZE_DEFVAL         -1
1950
/// the full font desc (replaces the 2 settings above)
1950
/// the full font desc (replaces the 2 settings above)
1951
#define   MP_FVIEW_FONT_DESC_DEFVAL   wxEmptyString
1951
#define   MP_FVIEW_FONT_DESC_DEFVAL   wxEmptyString
1952
/// don't show full e-mail, only sender's name
1952
/// don't show full e-mail, only sender's name
Lines 2007-2015 Link Here
2007
/**@name Font settings for compose view */
2007
/**@name Font settings for compose view */
2008
//@{
2008
//@{
2009
/// which font to use
2009
/// which font to use
2010
#define   MP_CVIEW_FONT_DEFVAL         6L
2010
#define   MP_CVIEW_FONT_DEFVAL         0L
2011
/// which font size
2011
/// which font size
2012
#define   MP_CVIEW_FONT_SIZE_DEFVAL    DEFAULT_FONT_SIZE
2012
#define   MP_CVIEW_FONT_SIZE_DEFVAL    -1
2013
/// the full font desc (replaces the 2 settings above)
2013
/// the full font desc (replaces the 2 settings above)
2014
#define   MP_CVIEW_FONT_DESC_DEFVAL   wxEmptyString
2014
#define   MP_CVIEW_FONT_DESC_DEFVAL   wxEmptyString
2015
/// which foreground colour for the font
2015
/// which foreground colour for the font
(-)mahogany-0.67/include/sysutil.h (-30 / +53 lines)
Lines 1-18 Link Here
1
/*-*- c++ -*-********************************************************
1
///////////////////////////////////////////////////////////////////////////////
2
 * sysutil.h : utility functions for various OS functionality       *
2
// Project:     M - cross platform e-mail GUI client
3
 *                                                                  *
3
// File name:   include/sysutil.h
4
 * (C) 1999 by Karsten Ballüder (Ballueder@usa.net)                 *
4
// Purpose:     utility functions for various OS-level functionality
5
 *                                                                  *
5
// Author:      Karsten Ballüder, Vadim Zeitlin
6
 * $Id: sysutil.h,v 1.10 2003/09/18 16:30:43 robertvazan Exp $
6
// Created:     1999
7
 *
7
// CVS-ID:      $Id: sysutil.h,v 1.11 2006/08/31 23:45:05 vadz Exp $
8
 *******************************************************************/
8
// Copyright:   (c) 1999 Karsten Ballüder
9
//              (c) 2000-2006 Vadim Zeitlin <vadim@wxwindows.org>
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
9
12
10
13
#ifndef M_SYSUTIL_H
11
#ifndef SYSUTIL_H
14
#define M_SYSUTIL_H
12
#define SYSUTIL_H
13
14
#ifndef  USE_PCH
15
#endif // USE_PCH
16
15
17
#include <wx/filename.h>
16
#include <wx/filename.h>
18
17
Lines 38-64 Link Here
38
class MTempFileName
37
class MTempFileName
39
{
38
{
40
public:
39
public:
41
   // def ctor: creates the temp file and doesn't delete it unless told to do
40
   /**
42
   // so (i.e. Ok() is called)
41
      Ctor creates a temporary file name and possibly associates it with the
43
   MTempFileName() : m_name (wxFileName::CreateTempFileName(_T("Mahogany")))
42
      specified file.
44
      { m_ok = false; }
43
45
44
      If the temp file name is used for writing some data to it, the file
46
   // ctor which takes a temp file name: still won't be deleted unless Ok() is
45
      parameter must be specified as otherwise the operation wouldn't be atomic
47
   // called
46
      and race conditions could occur. Do close the file before this object
48
   MTempFileName(const String& name) : m_name(name) { m_ok = false; }
47
      goes out of scope in this case though as otherwise we could fail to
48
      delete the temp file under Windows.
49
50
      @param file if non-NULL, the file to open (for writing) with the
51
                  temporary file name
52
    */
53
   MTempFileName(wxFile *file = NULL)
54
      : m_name(wxFileName::CreateTempFileName(_T("Mahogany"), file))
55
   {
56
      m_keepFile = false;
57
   }
58
59
   /**
60
      Ctor from an existing temporary file name.
49
61
50
   /// returns FALSE if temp file name couldn't be generated
62
      The specified file will be deleted when this object is destroyed unless
51
   bool IsOk() const { return !!m_name; }
63
      Ok() is called.
52
64
53
   /// get the name of the temp file
65
      @param name of the existing temporary file
66
    */
67
   MTempFileName(const String& name) : m_name(name)
68
   {
69
      m_keepFile = false;
70
   }
71
72
   /// Returns false if temp file name couldn't be generated
73
   bool IsOk() const { return !m_name.empty(); }
74
75
   /// Get the name of the temp file
54
   const String& GetName() const { return m_name; }
76
   const String& GetName() const { return m_name; }
55
77
56
   /// tells us not to delete the temp file
78
   /// Tells us not to delete the temp file
57
   void Ok() { m_ok = true; }
79
   void Ok() { m_keepFile = true; }
58
80
59
   ~MTempFileName()
81
   ~MTempFileName()
60
   {
82
   {
61
      if ( !m_ok && !m_name.empty() )
83
      if ( !m_keepFile && !m_name.empty() )
62
      {
84
      {
63
         if ( wxRemove(m_name) != 0 )
85
         if ( wxRemove(m_name) != 0 )
64
         {
86
         {
Lines 69-77 Link Here
69
91
70
private:
92
private:
71
   String m_name;
93
   String m_name;
72
   bool   m_ok;
94
   bool   m_keepFile;
73
};
95
};
74
96
75
//@}
97
//@}
76
#endif
98
99
#endif // M_SYSUTIL_H
77
100
(-)mahogany-0.67/src/adb/AdbFrame.cpp (-2 / +2 lines)
Lines 5-11 Link Here
5
// Author:      Vadim Zeitlin
5
// Author:      Vadim Zeitlin
6
// Modified by:
6
// Modified by:
7
// Created:     09.08.98
7
// Created:     09.08.98
8
// CVS-ID:      $Id: AdbFrame.cpp,v 1.121 2006/01/16 20:32:26 nerijus Exp $
8
// CVS-ID:      $Id: AdbFrame.cpp,v 1.122 2006/08/25 16:06:53 vadz Exp $
9
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10
// Licence:     M license
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 3166-3172 Link Here
3166
3166
3167
wxAdbTree::wxAdbTree(wxAdbEditFrame *frame, wxWindow *parent, long id)
3167
wxAdbTree::wxAdbTree(wxAdbEditFrame *frame, wxWindow *parent, long id)
3168
         : wxTreeCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
3168
         : wxTreeCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
3169
                      wxTR_HAS_BUTTONS | wxSUNKEN_BORDER)
3169
                      wxTR_DEFAULT_STYLE | wxSUNKEN_BORDER)
3170
{
3170
{
3171
  m_frame = frame;
3171
  m_frame = frame;
3172
  m_menu = NULL;
3172
  m_menu = NULL;
(-)mahogany-0.67/src/classes/MessageView.cpp (-27 / +8 lines)
Lines 8-14 Link Here
8
// Author:      Vadim Zeitlin (based on gui/MessageView.cpp by Karsten)
8
// Author:      Vadim Zeitlin (based on gui/MessageView.cpp by Karsten)
9
// Modified by:
9
// Modified by:
10
// Created:     24.07.01
10
// Created:     24.07.01
11
// CVS-ID:      $Id: MessageView.cpp,v 1.173 2006/07/24 14:13:41 vadz Exp $
11
// CVS-ID:      $Id: MessageView.cpp,v 1.175 2006/08/23 15:41:53 vadz Exp $
12
// Copyright:   (c) 2001 Mahogany Team
12
// Copyright:   (c) 2001 Mahogany Team
13
// Licence:     Mahogany license
13
// Licence:     Mahogany license
14
///////////////////////////////////////////////////////////////////////////////
14
///////////////////////////////////////////////////////////////////////////////
Lines 505-539 Link Here
505
505
506
wxFont MessageView::AllProfileValues::GetFont(wxFontEncoding encoding) const
506
wxFont MessageView::AllProfileValues::GetFont(wxFontEncoding encoding) const
507
{
507
{
508
   wxFont font;
508
   wxFont font(CreateFontFromDesc(fontDesc, fontSize, fontFamily));
509
509
510
   if ( !fontDesc.empty() )
510
   // assume that wxFONTENCODING_DEFAULT (US-ASCII) text can be shown in any
511
   // encoding
512
   if ( encoding != wxFONTENCODING_DEFAULT )
511
   {
513
   {
512
      wxNativeFontInfo fontInfo;
514
      if ( !font.Ok() )
513
      if ( fontInfo.FromString(fontDesc) )
515
         font = *wxNORMAL_FONT;
514
      {
515
         font.SetNativeFontInfo(fontInfo);
516
516
517
         // assume that iso8859-1 text can be shown in any encoding - it's
517
      font.SetEncoding(encoding);
518
         // true for all normal fonts
519
         if ( font.Ok() &&
520
               (encoding != wxFONTENCODING_DEFAULT) &&
521
                  (encoding != wxFONTENCODING_ISO8859_1) )
522
         {
523
            font.SetEncoding(encoding);
524
         }
525
      }
526
   }
527
528
   if ( !font.Ok() )
529
   {
530
      font = wxFont(fontSize,
531
                    fontFamily,
532
                    wxFONTSTYLE_NORMAL,
533
                    wxFONTWEIGHT_NORMAL,
534
                    FALSE,   // not underlined
535
                    wxEmptyString,  // no specific face name
536
                    encoding);
537
   }
518
   }
538
519
539
   return font;
520
   return font;
(-)mahogany-0.67/src/classes/MModule.cpp (-2 / +2 lines)
Lines 3-9 Link Here
3
 *                                                                  *
3
 *                                                                  *
4
 * (C) 1999 by Karsten Ballüder (karsten@phy.hw.ac.uk)              *
4
 * (C) 1999 by Karsten Ballüder (karsten@phy.hw.ac.uk)              *
5
 *                                                                  *
5
 *                                                                  *
6
 * $Id: MModule.cpp,v 1.97 2006/02/12 22:36:40 vadz Exp $
6
 * $Id: MModule.cpp,v 1.98 2006/08/25 15:59:30 vadz Exp $
7
 *******************************************************************/
7
 *******************************************************************/
8
8
9
/*
9
/*
Lines 158-165 Link Here
158
   wxDynamicLibrary *dll = module->GetDLL();
158
   wxDynamicLibrary *dll = module->GetDLL();
159
159
160
   // call cleanup function, if any
160
   // call cleanup function, if any
161
   if ( dll->HasSymbol(MMODULE_CLEANUP_FUNCTION) )
161
   {
162
   {
162
      wxLogNull noLog;
163
      MModule_CleanUpFuncType funcCleanup =
163
      MModule_CleanUpFuncType funcCleanup =
164
         (MModule_CleanUpFuncType)dll->GetSymbol(MMODULE_CLEANUP_FUNCTION);
164
         (MModule_CleanUpFuncType)dll->GetSymbol(MMODULE_CLEANUP_FUNCTION);
165
      if ( funcCleanup )
165
      if ( funcCleanup )
(-)mahogany-0.67/src/gui/ClickURL.cpp (-5 / +9 lines)
Lines 6-12 Link Here
6
// Author:      Vadim Zeitlin
6
// Author:      Vadim Zeitlin
7
// Modified by:
7
// Modified by:
8
// Created:     05.12.02 (extracted from MessageView.cpp and wxMessageView.cpp)
8
// Created:     05.12.02 (extracted from MessageView.cpp and wxMessageView.cpp)
9
// CVS-ID:      $Id: ClickURL.cpp,v 1.24 2006/06/26 23:24:41 vadz Exp $
9
// CVS-ID:      $Id: ClickURL.cpp,v 1.26 2006/08/31 17:59:27 nerijus Exp $
10
// Copyright:   (c) 2001-2002 Mahogany Team
10
// Copyright:   (c) 2001-2002 Mahogany Team
11
// Licence:     Mahogany license
11
// Licence:     Mahogany license
12
///////////////////////////////////////////////////////////////////////////////
12
///////////////////////////////////////////////////////////////////////////////
Lines 48-53 Link Here
48
#include "Collect.h"
48
#include "Collect.h"
49
49
50
#include <wx/clipbrd.h>
50
#include <wx/clipbrd.h>
51
#include <wx/mimetype.h>
51
52
52
#ifdef OS_UNIX
53
#ifdef OS_UNIX
53
   #include <sys/stat.h>
54
   #include <sys/stat.h>
Lines 260-268 Link Here
260
            }
261
            }
261
            else
262
            else
262
            {
263
            {
264
#ifdef DEBUG_nerijus
263
               wxTheClipboard->UsePrimarySelection();
265
               wxTheClipboard->UsePrimarySelection();
264
               wxTheClipboard->SetData(new
266
               wxTheClipboard->SetData(new wxTextDataObject(m_clickableURL->GetUrl()));
265
                     wxTextDataObject(m_clickableURL->GetUrl()));
267
#endif
268
               wxURLDataObject *dobj = new wxURLDataObject;
269
               dobj->SetURL(m_clickableURL->GetUrl());
270
               wxTheClipboard->SetData(dobj);
266
            }
271
            }
267
         }
272
         }
268
         break;
273
         break;
Lines 500-507 Link Here
500
      // either not netscape or ns isn't running or we have non-UNIX
505
      // either not netscape or ns isn't running or we have non-UNIX
501
      if(! bOk)
506
      if(! bOk)
502
      {
507
      {
503
         command = browser;
508
         String command = wxFileType::ExpandCommand(browser, m_url);
504
         command << _T(' ') << m_url;
505
509
506
         wxString errmsg;
510
         wxString errmsg;
507
         errmsg.Printf(_("Couldn't launch browser: '%s' failed"),
511
         errmsg.Printf(_("Couldn't launch browser: '%s' failed"),
(-)mahogany-0.67/src/gui/wxBrowseButton.cpp (-32 / +3 lines)
Lines 6-12 Link Here
6
// Author:      Vadim Zeitlin
6
// Author:      Vadim Zeitlin
7
// Modified by:
7
// Modified by:
8
// Created:     24.12.98
8
// Created:     24.12.98
9
// CVS-ID:      $Id: wxBrowseButton.cpp,v 1.43 2006/04/09 20:36:54 vadz Exp $
9
// CVS-ID:      $Id: wxBrowseButton.cpp,v 1.44 2006/08/31 23:18:28 vadz Exp $
10
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
12
12
Lines 384-418 Link Here
384
{
384
{
385
}
385
}
386
386
387
// FIXME: these methods rely on internals of wxNativeFontInfo because they
388
//        know that it prepends the format version number (currently 0) to
389
//        the real font desc string - they shouldn't but we should add methods
390
//        to wxNativeFontInfo to do this conversion instead!
391
392
String wxFontBrowseButton::FontDescToUser(const String& desc)
393
{
394
   String user = desc;
395
   if ( user.length() > 2 && user[0u] == '0' && user[1u] == ';' )
396
   {
397
      user.erase(0, 2);
398
   }
399
400
   return user;
401
}
402
403
String wxFontBrowseButton::FontDescFromUser(const String& user)
404
{
405
   String desc;
406
   if ( !user.empty() )
407
   {
408
      desc = _T("0;");
409
   }
410
411
   desc += user;
412
413
   return desc;
414
}
415
416
void wxFontBrowseButton::DoBrowse()
387
void wxFontBrowseButton::DoBrowse()
417
{
388
{
418
   wxFont font;
389
   wxFont font;
Lines 420-426 Link Here
420
   wxString desc = GetText();
391
   wxString desc = GetText();
421
   if ( !desc.empty() )
392
   if ( !desc.empty() )
422
   {
393
   {
423
      if ( fontInfo.FromString(FontDescFromUser(desc)) )
394
      if ( fontInfo.FromString(desc) )
424
      {
395
      {
425
         font.SetNativeFontInfo(fontInfo);
396
         font.SetNativeFontInfo(fontInfo);
426
      }
397
      }
Lines 434-440 Link Here
434
   {
405
   {
435
      font = dialog.GetFontData().GetChosenFont();
406
      font = dialog.GetFontData().GetChosenFont();
436
407
437
      SetText(FontDescToUser(font.GetNativeFontInfoDesc()));
408
      SetText(font.GetNativeFontInfoDesc());
438
   }
409
   }
439
}
410
}
440
411
(-)mahogany-0.67/src/gui/wxComposeView.cpp (-30 / +38 lines)
Lines 5-11 Link Here
5
// Author:      Karsten Ballüder, Vadim Zeitlin
5
// Author:      Karsten Ballüder, Vadim Zeitlin
6
// Modified by:
6
// Modified by:
7
// Created:     1998
7
// Created:     1998
8
// CVS-ID:      $Id: wxComposeView.cpp,v 1.413 2006/06/28 15:55:15 vadz Exp $
8
// CVS-ID:      $Id: wxComposeView.cpp,v 1.418 2006/08/25 13:25:48 vadz Exp $
9
// Copyright:   (c) 1998-2001 Mahogany team
9
// Copyright:   (c) 1998-2001 Mahogany team
10
// Licence:     M license
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 924-948 Link Here
924
924
925
wxFont ComposerOptions::GetFont() const
925
wxFont ComposerOptions::GetFont() const
926
{
926
{
927
   wxFont font;
927
   return CreateFontFromDesc(m_font, m_fontSize, m_fontFamily);
928
   if ( !m_font.empty() )
929
   {
930
      wxNativeFontInfo fontInfo;
931
      if ( fontInfo.FromString(m_font) )
932
      {
933
         font.SetNativeFontInfo(fontInfo);
934
      }
935
   }
936
937
   if ( !font.Ok() )
938
   {
939
      font = wxFont(m_fontSize,
940
                    m_fontFamily,
941
                    wxFONTSTYLE_NORMAL,
942
                    wxFONTWEIGHT_NORMAL);
943
   }
944
945
   return font;
946
}
928
}
947
929
948
// ----------------------------------------------------------------------------
930
// ----------------------------------------------------------------------------
Lines 2288-2294 Link Here
2288
   {
2270
   {
2289
      text->SetForegroundColour(m_options.m_fg);
2271
      text->SetForegroundColour(m_options.m_fg);
2290
      text->SetBackgroundColour(m_options.m_bg);
2272
      text->SetBackgroundColour(m_options.m_bg);
2291
      text->SetFont(m_options.GetFont());
2273
      wxFont font(m_options.GetFont());
2274
      if ( font.Ok() )
2275
         text->SetFont(font);
2292
2276
2293
      wxSizer *sizer = text->GetContainingSizer();
2277
      wxSizer *sizer = text->GetContainingSizer();
2294
      if ( sizer )
2278
      if ( sizer )
Lines 3764-3771 Link Here
3764
         // we have a handy function in wxFileType which will replace
3748
         // we have a handy function in wxFileType which will replace
3765
         // '%s' with the file name or add the file name at the end if
3749
         // '%s' with the file name or add the file name at the end if
3766
         // there is no '%s'
3750
         // there is no '%s'
3767
         wxFileType::MessageParameters params(tmpFileName.GetName(), wxEmptyString);
3751
         String
3768
         String command = wxFileType::ExpandCommand(extEdit, params);
3752
            command = wxFileType::ExpandCommand(extEdit, tmpFileName.GetName());
3769
3753
3770
         // do start the external process
3754
         // do start the external process
3771
         m_procExtEdit = new wxProcess(this, HelperProcess_Editor);
3755
         m_procExtEdit = new wxProcess(this, HelperProcess_Editor);
Lines 4074-4085 Link Here
4074
      }
4058
      }
4075
      else // non empty file
4059
      else // non empty file
4076
      {
4060
      {
4077
         wxChar *p = text.GetWriteBuf(lenFile + 1);
4061
         wxStringBuffer buf(text, lenFile + 1);
4078
         p[lenFile] = '\0';
4062
         buf[lenFile] = '\0';
4079
4080
         ok = file.Read(p, lenFile) != wxInvalidOffset;
4081
4063
4082
         text.UngetWriteBuf();
4064
         ok = file.Read(buf, lenFile) != wxInvalidOffset;
4083
      }
4065
      }
4084
   }
4066
   }
4085
4067
Lines 4095-4105 Link Here
4095
   return true;
4077
   return true;
4096
}
4078
}
4097
4079
4098
/// inserts a text
4099
void
4080
void
4100
wxComposeView::InsertText(const String &text)
4081
wxComposeView::InsertText(const String &text)
4101
{
4082
{
4102
   m_editor->InsertText(text, MessageEditor::Insert_Append);
4083
   // the text here may come from a file and so can be in an encoding different
4084
   // from the one we currently use, but we -- unfortunately -- have no way of
4085
   // knowing about it, except in the special case when we use UTF-8 and then
4086
   // we must check if text is a valid UTF-8 string as otherwise inserting it
4087
   // is going to fail
4088
   String textCopy;
4089
   if ( wxLocale::GetSystemEncoding() == wxFONTENCODING_UTF8 )
4090
   {
4091
      if ( wxConvUTF8.MB2WC(NULL, text, 0) == (size_t)-1 )
4092
      {
4093
         // not a valid UTF-8 string, must suppose it's in some other encoding
4094
         // and as we have no idea about what it is, choose latin1 as the most
4095
         // common (among Mahogany users, anyhow)
4096
         if ( m_encoding == wxFONTENCODING_SYSTEM )
4097
         {
4098
            // change the encoding to latin1 if none explicitly specified
4099
            SetEncoding(wxFONTENCODING_ISO8859_1);
4100
         }
4101
         else // we already have an existing encoding
4102
         {
4103
            // transform the text from latin1 to the current encoding
4104
            textCopy = wxCSConv(m_encoding).cWC2MB(wxConvISO8859_1.cMB2WC(text));
4105
         }
4106
      }
4107
   }
4108
4109
   m_editor->InsertText(textCopy.empty() ? text : textCopy,
4110
                        MessageEditor::Insert_Append);
4103
}
4111
}
4104
4112
4105
void
4113
void
(-)mahogany-0.67/src/gui/wxFolderTree.cpp (-2 / +2 lines)
Lines 5-11 Link Here
5
// Author:      Vadim Zeitlin
5
// Author:      Vadim Zeitlin
6
// Modified by:
6
// Modified by:
7
// Created:     03.10.98
7
// Created:     03.10.98
8
// CVS-ID:      $Id: wxFolderTree.cpp,v 1.243 2006/06/28 12:46:34 vadz Exp $
8
// CVS-ID:      $Id: wxFolderTree.cpp,v 1.244 2006/08/19 14:22:53 vadz Exp $
9
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10
// Licence:     M license
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 1754-1760 Link Here
1754
                                   wxWindow *parent, wxWindowID id,
1754
                                   wxWindow *parent, wxWindowID id,
1755
                                   const wxPoint& pos, const wxSize& size)
1755
                                   const wxPoint& pos, const wxSize& size)
1756
                : wxPTreeCtrl(_T("FolderTree"), parent, id, pos, size,
1756
                : wxPTreeCtrl(_T("FolderTree"), parent, id, pos, size,
1757
                              wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS)
1757
                              wxTR_DEFAULT_STYLE | wxTR_EDIT_LABELS)
1758
{
1758
{
1759
   // init member vars
1759
   // init member vars
1760
   m_current = NULL;
1760
   m_current = NULL;
(-)mahogany-0.67/src/gui/wxFolderView.cpp (-31 / +13 lines)
Lines 5-11 Link Here
5
// Author:      Karsten Ballüder (Ballueder@gmx.net)
5
// Author:      Karsten Ballüder (Ballueder@gmx.net)
6
// Modified by: VZ at 13.07.01: use virtual list control, update on demand
6
// Modified by: VZ at 13.07.01: use virtual list control, update on demand
7
// Created:     1997
7
// Created:     1997
8
// CVS-ID:      $Id: wxFolderView.cpp,v 1.679 2006/06/30 11:08:18 nerijus Exp $
8
// CVS-ID:      $Id: wxFolderView.cpp,v 1.683 2006/08/19 13:12:00 vadz Exp $
9
// Copyright:   (c) 1997-2001 Mahogany team
9
// Copyright:   (c) 1997-2001 Mahogany team
10
// Licence:     M license
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 1608-1631 Link Here
1608
   SetTextColour( fg );
1608
   SetTextColour( fg );
1609
   SetBackgroundColour( bg );
1609
   SetBackgroundColour( bg );
1610
1610
1611
   wxFont font;
1611
   wxFont font(CreateFontFromDesc(fontDesc, fontSize, fontFamily));
1612
   if ( !fontDesc.empty() )
1612
   if ( font.Ok() )
1613
   {
1613
   {
1614
      wxNativeFontInfo fontInfo;
1614
      SetFont(font);
1615
      if ( fontInfo.FromString(fontDesc) )
1616
      {
1617
         font.SetNativeFontInfo(fontInfo);
1618
      }
1619
   }
1620
1621
   if ( !font.Ok() )
1622
   {
1623
      font = wxFont(fontSize, fontFamily,
1624
                    wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
1625
   }
1615
   }
1626
1616
1627
   SetFont(font);
1628
1629
   if ( memcmp(m_columns, columns, sizeof(m_columns)) != 0 )
1617
   if ( memcmp(m_columns, columns, sizeof(m_columns)) != 0 )
1630
   {
1618
   {
1631
      // the control must be recreated if the order of columns changed
1619
      // the control must be recreated if the order of columns changed
Lines 4626-4651 Link Here
4626
         }
4614
         }
4627
         break;
4615
         break;
4628
4616
4629
      case WXK_UP:
4630
      case WXK_DOWN:
4631
      case WXK_HOME:
4632
      case WXK_END:
4633
      case WXK_RETURN:
4634
#if !defined DEBUG_nerijus
4635
      case WXK_SPACE:
4636
#endif
4637
         // let the control process these keys as they're used for navigation
4638
         event.Skip();
4639
         return false;
4640
4641
      default:
4617
      default:
4642
         // pressing any alphanumeric character in the list control starts
4618
         // pressing any alphanumeric character in the list control starts
4643
         // incremental search in it which is worse than useless in our case
4619
         // incremental search in it which is worse than useless in our case
4644
         // because it's never going to find anything (the first column is
4620
         // because it's never going to find anything (the first column is
4645
         // always flags in this case and won't match...) and we just lost the
4621
         // always flags in this case and won't match...) and we just lose the
4646
         // current selection, so prevent this from happening by *not* calling
4622
         // current selection, so prevent this from happening by *not* calling
4647
         // event.Skip() here
4623
         // event.Skip() in this case
4648
         ;
4624
         if ( key >= 0x7f || !isalnum(key) )
4625
         {
4626
            // let the control process other keys (some are used for navigation
4627
            // in it)
4628
            event.Skip();
4629
            return false;
4630
         }
4649
   }
4631
   }
4650
4632
4651
   if ( cmd )
4633
   if ( cmd )
(-)mahogany-0.67/src/gui/wxIconManager.cpp (-6 / +13 lines)
Lines 3-9 Link Here
3
 *                                                                  *
3
 *                                                                  *
4
 * (C) 1997-1999 by Karsten Ballüder (ballueder@gmx.net)            *
4
 * (C) 1997-1999 by Karsten Ballüder (ballueder@gmx.net)            *
5
 *                                                                  *
5
 *                                                                  *
6
 * $Id: wxIconManager.cpp,v 1.110 2006/01/16 20:32:27 nerijus Exp $
6
 * $Id: wxIconManager.cpp,v 1.112 2006/08/25 16:23:13 vadz Exp $
7
 *******************************************************************/
7
 *******************************************************************/
8
8
9
// ============================================================================
9
// ============================================================================
Lines 556-568 Link Here
556
      return icon;
556
      return icon;
557
557
558
   // next step: try to load the icon files .png,.xpm,.gif:
558
   // next step: try to load the icon files .png,.xpm,.gif:
559
   bool found = false;
560
   if(m_GlobalDir.Length())
559
   if(m_GlobalDir.Length())
561
   {
560
   {
562
      PathFinder pf(READ_APPCONFIG(MP_ICONPATH));
561
      PathFinder pf(READ_APPCONFIG(MP_ICONPATH));
563
562
564
#ifdef M_TOP_SOURCEDIR
563
#ifdef M_TOP_SOURCEDIR
564
      // look in the source directory to make it possible to use the program
565
      // without installing it
565
      pf.AddPaths(String(M_TOP_SOURCEDIR) + _T("/src/icons"));
566
      pf.AddPaths(String(M_TOP_SOURCEDIR) + _T("/src/icons"));
567
      pf.AddPaths(String(M_TOP_SOURCEDIR) + _T("/res"));
566
#endif // M_TOP_SOURCEDIR
568
#endif // M_TOP_SOURCEDIR
567
569
568
      pf.AddPaths(m_GlobalDir, false);
570
      pf.AddPaths(m_GlobalDir, false);
Lines 580-590 Link Here
580
      String name;
582
      String name;
581
      for ( int ext = 0; wxIconManagerFileExtensions[ext]; ext++ )
583
      for ( int ext = 0; wxIconManagerFileExtensions[ext]; ext++ )
582
      {
584
      {
583
         // Use iconNameOrig to preserve captialisation:
585
         // use iconNameOrig here to preserve the original case
584
         name = iconNameOrig + wxIconManagerFileExtensions[ext];
586
         name = pf.FindFile(iconNameOrig + wxIconManagerFileExtensions[ext]);
585
         name = pf.FindFile(name, &found);
586
587
587
         if( found )
588
         // but if it's not found, also fall back to the usual lower case
589
         if ( name.empty() )
590
         {
591
            name = pf.FindFile(iconName + wxIconManagerFileExtensions[ext]);
592
         }
593
594
         if ( !name.empty() )
588
         {
595
         {
589
            ms_IconPath = name.BeforeLast('/');
596
            ms_IconPath = name.BeforeLast('/');
590
597
(-)mahogany-0.67/src/gui/wxMApp.cpp (-70 / +24 lines)
Lines 6-12 Link Here
6
// Author:      Karsten Ballüder, Vadim Zeitlin
6
// Author:      Karsten Ballüder, Vadim Zeitlin
7
// Modified by:
7
// Modified by:
8
// Created:     1997
8
// Created:     1997
9
// CVS-ID:      $Id: wxMApp.cpp,v 1.305 2006/04/19 00:55:04 vadz Exp $
9
// CVS-ID:      $Id: wxMApp.cpp,v 1.309 2006/09/02 12:41:30 vadz Exp $
10
// Copyright:   (c) 1997-2002 M-Team
10
// Copyright:   (c) 1997-2002 M-Team
11
// Licence:     M license
11
// Licence:     M license
12
///////////////////////////////////////////////////////////////////////////////
12
///////////////////////////////////////////////////////////////////////////////
Lines 913-920 Link Here
913
bool
913
bool
914
wxMApp::OnInit()
914
wxMApp::OnInit()
915
{
915
{
916
   // we want our OnAbnormalTermination() be called if we crash
916
   // we want our OnAbnormalTermination() be called if we crash but don't use
917
#if wxUSE_ON_FATAL_EXCEPTION
917
   // it in debug builds as it interferes with the debugger
918
#if wxUSE_ON_FATAL_EXCEPTION && !defined(__WXDEBUG__)
918
   wxHandleFatalExceptions();
919
   wxHandleFatalExceptions();
919
#endif
920
#endif
920
921
Lines 1101-1106 Link Here
1101
   }
1102
   }
1102
#endif // USE_I18N
1103
#endif // USE_I18N
1103
1104
1105
   // wxLocale::GetSystemEncoding() is broken in wx <= 2.6.3, it returns
1106
   // ISO-8859-1 for UTF-8 locale
1107
#if defined(__WXGTK20__) && wxCHECK_VERSION(2, 6, 4)
1108
   // we need UTF-8 support to be able to work with messages in different
1109
   // encodings
1110
   if ( wxLocale::GetSystemEncoding() != wxFONTENCODING_UTF8 )
1111
   {
1112
      // TODO: set encoding to UTF-8 (but keeping the current language)
1113
      //       ourselves
1114
      wxLogWarning(_("Your current locale doesn't use UTF-8 encoding!\n"
1115
                     "\n"
1116
                     "This means that Mahogany will not be able to work "
1117
                     "with texts in encodings other than the default one\n"
1118
                     "which may result in messages not being displayed or "
1119
                     "even sent correctly.\n"
1120
                     "\n"
1121
                     "Please change the system locale to UTF-8."));
1122
   }
1123
#endif // GTK+ 2.0
1124
1104
   wxInitAllImageHandlers();
1125
   wxInitAllImageHandlers();
1105
   wxFileSystem::AddHandler(new wxMemoryFSHandler);
1126
   wxFileSystem::AddHandler(new wxMemoryFSHandler);
1106
//   wxFileSystem::AddHandler(new wxZipFSHandler); // for zipped docs
1127
//   wxFileSystem::AddHandler(new wxZipFSHandler); // for zipped docs
Lines 2503-2575 Link Here
2503
   return true;
2524
   return true;
2504
}
2525
}
2505
2526
2506
// ----------------------------------------------------------------------------
2507
// global functions implemented here
2508
// ----------------------------------------------------------------------------
2509
2510
extern bool EnsureAvailableTextEncoding(wxFontEncoding *enc,
2511
                                        wxString *text,
2512
                                        bool mayAskUser)
2513
{
2514
   CHECK( enc, false, _T("CheckEncodingAvailability: NULL encoding") );
2515
2516
   if ( !wxFontMapper::Get()->IsEncodingAvailable(*enc) )
2517
   {
2518
      // try to find another encoding
2519
      wxFontEncoding encAlt;
2520
      if ( wxFontMapper::Get()->
2521
            GetAltForEncoding(*enc, &encAlt, wxEmptyString, mayAskUser) )
2522
      {
2523
         // translate the text (if any) to the equivalent encoding
2524
         if ( text && !text->empty() )
2525
         {
2526
#if wxUSE_WCHAR_T
2527
            // try converting via Unicode
2528
            wxCSConv a2w(*enc);
2529
            wxWCharBuffer wbuf(a2w.cMB2WC(text->c_str()));
2530
            if ( *wbuf )
2531
            {
2532
               // special case of UTF-8 which is used all the time under wxGTK
2533
               if ( encAlt == wxFONTENCODING_UTF8 )
2534
               {
2535
                  *text = wxConvUTF8.cWC2MB(wbuf);
2536
               }
2537
               else // all the other encodings, use generic converter
2538
               {
2539
                  wxCSConv w2a(encAlt);
2540
                  *text = w2a.cWC2MB(wbuf);
2541
               }
2542
2543
               if ( !text->empty() )
2544
                  return true;
2545
               //else: fall back to wxEncodingConverter
2546
            }
2547
            //else: conversion to Unicode failed
2548
#endif // wxUSE_WCHAR_T
2549
2550
            wxEncodingConverter conv;
2551
            if ( !conv.Init(*enc, encAlt) )
2552
            {
2553
               // failed to convert the text
2554
               return false;
2555
            }
2556
2557
            *text = conv.Convert(*text);
2558
         }
2559
         //else: just return the encoding
2560
2561
         *enc = encAlt;
2562
      }
2563
      else // no equivalent encoding
2564
      {
2565
         return false;
2566
      }
2567
   }
2568
2569
   // we have either the requested encoding or an equivalent one
2570
   return true;
2571
}
2572
2573
// ============================================================================
2527
// ============================================================================
2574
// IPC and multiple program instances handling
2528
// IPC and multiple program instances handling
2575
// ============================================================================
2529
// ============================================================================
(-)mahogany-0.67/src/gui/wxMDialogs.cpp (-4 / +6 lines)
Lines 3-9 Link Here
3
 *                                                                  *
3
 *                                                                  *
4
 * (C) 1998-2000 by Karsten Ballüder (karsten@phy.hw.ac.uk)         *
4
 * (C) 1998-2000 by Karsten Ballüder (karsten@phy.hw.ac.uk)         *
5
 *                                                                  *
5
 *                                                                  *
6
 * $Id: wxMDialogs.cpp,v 1.433 2006/08/06 20:02:01 vadz Exp $
6
 * $Id: wxMDialogs.cpp,v 1.435 2006/08/25 16:22:46 vadz Exp $
7
 *******************************************************************/
7
 *******************************************************************/
8
8
9
#ifdef __GNUG__
9
#ifdef __GNUG__
Lines 2163-2170 Link Here
2163
                                             MH_DIALOG_LICENSE);
2163
                                             MH_DIALOG_LICENSE);
2164
   wxHtmlWindow *license = new wxHtmlWindow(this);
2164
   wxHtmlWindow *license = new wxHtmlWindow(this);
2165
2165
2166
   wxBitmap bmp(mApplication->GetIconManager()-> GetBitmap(_T("Msplash")));
2166
   wxBitmap bmp(mApplication->GetIconManager()->GetBitmap(_T("Msplash")));
2167
   const int w = bmp.Ok() ? bmp.GetWidth() : 400;
2167
   int w = bmp.Ok() ? bmp.GetWidth() : 0;
2168
   if ( w < 400 )
2169
      w = 400;
2168
2170
2169
   wxMemoryFSHandler::AddFile(_T("splash.png"), bmp, wxBITMAP_TYPE_PNG);
2171
   wxMemoryFSHandler::AddFile(_T("splash.png"), bmp, wxBITMAP_TYPE_PNG);
2170
2172
Lines 2740-2746 Link Here
2740
   m_frame->CentreOnParent();
2742
   m_frame->CentreOnParent();
2741
   m_frame->Show();
2743
   m_frame->Show();
2742
2744
2743
   wxYield();
2745
   m_frame->Update();
2744
}
2746
}
2745
2747
2746
void MProgressInfo::SetLabel(const wxString& label)
2748
void MProgressInfo::SetLabel(const wxString& label)
(-)mahogany-0.67/src/gui/wxMGuiUtils.cpp (+129 lines)
Line 0 Link Here
1
///////////////////////////////////////////////////////////////////////////////
2
// Project:     M - cross platform e-mail GUI client
3
// File name:   gui/wxMGuiUtils.cpp
4
// Purpose:     miscellaneous GUI helpers
5
// Author:      Vadim Zeitlin
6
// Created:     2006-08-19
7
// CVS-ID:      $Id: wxMGuiUtils.cpp,v 1.1 2006/08/19 13:12:00 vadz Exp $
8
// Copyright:   (c) 2006 Vadim Zeitlin
9
// Licence:     M license
10
///////////////////////////////////////////////////////////////////////////////
11
12
// ============================================================================
13
// declarations
14
// ============================================================================
15
16
// ----------------------------------------------------------------------------
17
// headers
18
// ----------------------------------------------------------------------------
19
20
#include "Mpch.h"
21
22
#ifndef  USE_PCH
23
#  include "Mcommon.h"
24
#  include "guidef.h"
25
26
#  include <wx/fontmap.h>
27
#endif // USE_PCH
28
29
#include <wx/encconv.h>
30
31
// ============================================================================
32
// implementation
33
// ============================================================================
34
35
bool
36
EnsureAvailableTextEncoding(wxFontEncoding *enc, wxString *text, bool mayAskUser)
37
{
38
   CHECK( enc, false, _T("CheckEncodingAvailability: NULL encoding") );
39
40
   if ( !wxFontMapper::Get()->IsEncodingAvailable(*enc) )
41
   {
42
      // try to find another encoding
43
      wxFontEncoding encAlt;
44
      if ( wxFontMapper::Get()->
45
            GetAltForEncoding(*enc, &encAlt, wxEmptyString, mayAskUser) )
46
      {
47
         // translate the text (if any) to the equivalent encoding
48
         if ( text && !text->empty() )
49
         {
50
#if wxUSE_WCHAR_T
51
            // try converting via Unicode
52
            wxCSConv a2w(*enc);
53
            wxWCharBuffer wbuf(a2w.cMB2WC(text->c_str()));
54
            if ( *wbuf )
55
            {
56
               // special case of UTF-8 which is used all the time under wxGTK
57
               if ( encAlt == wxFONTENCODING_UTF8 )
58
               {
59
                  *text = wxConvUTF8.cWC2MB(wbuf);
60
               }
61
               else // all the other encodings, use generic converter
62
               {
63
                  wxCSConv w2a(encAlt);
64
                  *text = w2a.cWC2MB(wbuf);
65
               }
66
67
               if ( !text->empty() )
68
                  return true;
69
               //else: fall back to wxEncodingConverter
70
            }
71
            //else: conversion to Unicode failed
72
#endif // wxUSE_WCHAR_T
73
74
            wxEncodingConverter conv;
75
            if ( !conv.Init(*enc, encAlt) )
76
            {
77
               // failed to convert the text
78
               return false;
79
            }
80
81
            *text = conv.Convert(*text);
82
         }
83
         //else: just return the encoding
84
85
         *enc = encAlt;
86
      }
87
      else // no equivalent encoding
88
      {
89
         return false;
90
      }
91
   }
92
93
   // we have either the requested encoding or an equivalent one
94
   return true;
95
}
96
97
wxFont
98
CreateFontFromDesc(const String& fontDesc, int fontSize, int fontFamily)
99
{
100
   wxFont font;
101
102
   // use the native font description if we have it
103
   if ( !fontDesc.empty() )
104
   {
105
      wxNativeFontInfo fontInfo;
106
      if ( fontInfo.FromString(fontDesc) )
107
      {
108
         font.SetNativeFontInfo(fontInfo);
109
      }
110
   }
111
112
   // if we don't, or if creating font from it failed, create the font with the
113
   // given size and family if we have [either of] them
114
   if ( !font.Ok() && (fontSize != -1 || fontFamily != -1) )
115
   {
116
      font = wxFont
117
             (
118
               fontSize == -1 ? wxNORMAL_FONT->GetPointSize()
119
                              : fontSize,
120
               fontFamily == wxFONTFAMILY_DEFAULT ? wxNORMAL_FONT->GetFamily()
121
                                                  : fontFamily,
122
               wxFONTSTYLE_NORMAL,
123
               wxFONTWEIGHT_NORMAL
124
             );
125
   }
126
127
   return font;
128
}
129
(-)mahogany-0.67/src/gui/wxMSplash.cpp (-4 / +6 lines)
Lines 4-10 Link Here
4
// Purpose:     splash screen/about dialog implementation
4
// Purpose:     splash screen/about dialog implementation
5
// Author:      Vadim Zeitlin
5
// Author:      Vadim Zeitlin
6
// Created:     2006-06-04 (extracted from wxMDialogs.cpp)
6
// Created:     2006-06-04 (extracted from wxMDialogs.cpp)
7
// CVS-ID:      $Id: wxMSplash.cpp,v 1.2 2006/06/04 19:24:54 nerijus Exp $
7
// CVS-ID:      $Id: wxMSplash.cpp,v 1.6 2006/08/31 23:09:06 nerijus Exp $
8
// Copyright:   (c) 1998-2006 Vadim Zeitlin <vadim@wxwindows.org>
8
// Copyright:   (c) 1998-2006 Vadim Zeitlin <vadim@wxwindows.org>
9
// Licence:     M license
9
// Licence:     M license
10
///////////////////////////////////////////////////////////////////////////////
10
///////////////////////////////////////////////////////////////////////////////
Lines 174-180 Link Here
174
   wxStaticBitmap *top = new wxStaticBitmap(this, wxID_ANY, bmp,
174
   wxStaticBitmap *top = new wxStaticBitmap(this, wxID_ANY, bmp,
175
                                            wxPoint(0, 0), sizeBmp);
175
                                            wxPoint(0, 0), sizeBmp);
176
   wxHtmlWindow *bottom = new wxHtmlWindow(this, wxID_ANY,
176
   wxHtmlWindow *bottom = new wxHtmlWindow(this, wxID_ANY,
177
                                           wxPoint(0, sizeBmp.y + 1), sizeBmp);
177
                                           wxPoint(0, sizeBmp.y + 1), sizeBmp,
178
                                           wxHW_DEFAULT_STYLE | wxHW_NO_SELECTION);
178
179
179
   ConnectMouseAndKeyEvents(top);
180
   ConnectMouseAndKeyEvents(top);
180
   ConnectMouseAndKeyEvents(bottom);
181
   ConnectMouseAndKeyEvents(bottom);
Lines 219-224 Link Here
219
   wxString pageHtmlText;
220
   wxString pageHtmlText;
220
221
221
   pageHtmlText << _T("<body text=#000000 bgcolor=#ffffff>"
222
   pageHtmlText << _T("<body text=#000000 bgcolor=#ffffff>"
223
                   "<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;charset=UTF-8\">"
222
                   "<font face=\"Times New Roman,times\">"
224
                   "<font face=\"Times New Roman,times\">"
223
225
224
                   "<h4>") << _("Mahogany information") << _T("</h4>")
226
                   "<h4>") << _("Mahogany information") << _T("</h4>")
Lines 261-268 Link Here
261
                << "<p>"
263
                << "<p>"
262
                   _T("<h4>") << _("List of contributors:") << _T("</h4>")
264
                   _T("<h4>") << _("List of contributors:") << _T("</h4>")
263
                   "<p>"
265
                   "<p>"
264
                   "Karsten Ball&uuml;der, Vadim Zeitlin, Greg Noel,<br> "
266
                   "Karsten Ball" "\xC3\xBC" "der, Vadim Zeitlin, Greg Noel,<br>"
265
                   "Nerijus Bali&#363;nas, Xavier Nodet, Vaclav Slavik,<br>"
267
                   "Nerijus Bali" "\xC5\xAB" "nas, Xavier Nodet, Vaclav Slavik,<br>"
266
                   "Daniel Seifert, Michele Ravani, Michael A Chase,<br>"
268
                   "Daniel Seifert, Michele Ravani, Michael A Chase,<br>"
267
                   "Robert Vazan " << _("and many others") << "<br>"
269
                   "Robert Vazan " << _("and many others") << "<br>"
268
                   "<br>"
270
                   "<br>"
(-)mahogany-0.67/src/gui/wxOptionsDlg.cpp (-6 / +1 lines)
Lines 5-11 Link Here
5
// Author:      Vadim Zeitlin
5
// Author:      Vadim Zeitlin
6
// Modified by:
6
// Modified by:
7
// Created:     20.08.98
7
// Created:     20.08.98
8
// CVS-ID:      $Id: wxOptionsDlg.cpp,v 1.430 2006/07/31 00:38:47 vadz Exp $
8
// CVS-ID:      $Id: wxOptionsDlg.cpp,v 1.431 2006/08/31 23:18:28 vadz Exp $
9
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9
// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10
// Licence:     M license
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 2818-2826 Link Here
2818
               strValue = strutil_decrypt(strValue);
2818
               strValue = strutil_decrypt(strValue);
2819
2819
2820
         case Field_Font:
2820
         case Field_Font:
2821
            strValue = wxFontBrowseButton::FontDescToUser(strValue);
2822
            // fall through
2823
2824
         case Field_Dir:
2821
         case Field_Dir:
2825
         case Field_File:
2822
         case Field_File:
2826
         case Field_Folder:
2823
         case Field_Folder:
Lines 2987-2994 Link Here
2987
            // post processing is needed for some fields
2984
            // post processing is needed for some fields
2988
            if ( fieldType == Field_Passwd )
2985
            if ( fieldType == Field_Passwd )
2989
               strValue = strutil_encrypt(strValue);
2986
               strValue = strutil_encrypt(strValue);
2990
            else if ( fieldType == Field_Font )
2991
               strValue = wxFontBrowseButton::FontDescFromUser(strValue);
2992
            else if ( fieldType == Field_Number ) {
2987
            else if ( fieldType == Field_Number ) {
2993
               wxASSERT( m_aDefaults[n].IsNumeric() );
2988
               wxASSERT( m_aDefaults[n].IsNumeric() );
2994
2989
(-)mahogany-0.67/src/gui/wxTemplateDialog.cpp (-5 / +17 lines)
Lines 6-12 Link Here
6
// Author:      Vadim Zeitlin
6
// Author:      Vadim Zeitlin
7
// Modified by: VZ at 09.05.00 to allow editing all templates
7
// Modified by: VZ at 09.05.00 to allow editing all templates
8
// Created:     16.07.99
8
// Created:     16.07.99
9
// CVS-ID:      $Id: wxTemplateDialog.cpp,v 1.42 2006/01/16 20:32:28 nerijus Exp $
9
// CVS-ID:      $Id: wxTemplateDialog.cpp,v 1.43 2006/08/19 14:49:52 vadz Exp $
10
// Copyright:   (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10
// Copyright:   (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
11
// Licence:     M license
11
// Licence:     M license
12
///////////////////////////////////////////////////////////////////////////////
12
///////////////////////////////////////////////////////////////////////////////
Lines 527-536 Link Here
527
      listbox->Append(wxGetTranslation(gs_templateNames[n]));
527
      listbox->Append(wxGetTranslation(gs_templateNames[n]));
528
   }
528
   }
529
529
530
   int wLbox = listbox->GetBestSize().x;
531
   if ( wLbox > 3*wBtn )
532
      wLbox = 3*wBtn;
533
530
   c = new wxLayoutConstraints;
534
   c = new wxLayoutConstraints;
531
   c->top.Below(msg, LAYOUT_Y_MARGIN);
535
   c->top.Below(msg, LAYOUT_Y_MARGIN);
532
   c->left.SameAs(box, wxLeft, 2*LAYOUT_X_MARGIN);
536
   c->left.SameAs(box, wxLeft, 2*LAYOUT_X_MARGIN);
533
   c->width.AsIs();
537
   c->width.Absolute(wLbox);
534
   c->height.Absolute(5*hBtn);
538
   c->height.Absolute(5*hBtn);
535
   listbox->SetConstraints(c);
539
   listbox->SetConstraints(c);
536
540
Lines 612-618 Link Here
612
{
616
{
613
   m_kind = kind;
617
   m_kind = kind;
614
618
615
   SetDefaultSize(6*wBtn, 10*hBtn);
619
   SetDefaultSize(10*wBtn, 10*hBtn);
616
}
620
}
617
621
618
bool wxTemplatesDialogBase::TransferDataToWindow()
622
bool wxTemplatesDialogBase::TransferDataToWindow()
Lines 755-765 Link Here
755
   // now lay them out
759
   // now lay them out
756
   // ----------------
760
   // ----------------
757
761
762
   int wLbox = m_listbox->GetBestSize().x;
763
   if ( wLbox > 3*wBtn )
764
      wLbox = 3*wBtn;
765
758
   wxLayoutConstraints *c;
766
   wxLayoutConstraints *c;
759
   c = new wxLayoutConstraints;
767
   c = new wxLayoutConstraints;
760
   c->left.SameAs(box, wxLeft, 2*LAYOUT_X_MARGIN);
768
   c->left.SameAs(box, wxLeft, 2*LAYOUT_X_MARGIN);
761
   c->top.SameAs(box, wxTop, 4*LAYOUT_Y_MARGIN);
769
   c->top.SameAs(box, wxTop, 4*LAYOUT_Y_MARGIN);
762
   c->width.AsIs();
770
   c->width.Absolute(wLbox);
763
   c->bottom.SameAs(box, wxBottom, 2*LAYOUT_Y_MARGIN);
771
   c->bottom.SameAs(box, wxBottom, 2*LAYOUT_Y_MARGIN);
764
   m_listbox->SetConstraints(c);
772
   m_listbox->SetConstraints(c);
765
773
Lines 887-896 Link Here
887
   // constraints
895
   // constraints
888
   FillListBox();
896
   FillListBox();
889
897
898
   int wLbox = m_listbox->GetBestSize().x;
899
   if ( wLbox > 3*wBtn )
900
      wLbox = 3*wBtn;
901
890
   c = new wxLayoutConstraints;
902
   c = new wxLayoutConstraints;
891
   c->top.Below(combo, 2*LAYOUT_Y_MARGIN);
903
   c->top.Below(combo, 2*LAYOUT_Y_MARGIN);
892
   c->left.SameAs(msg, wxLeft, 2*LAYOUT_X_MARGIN);
904
   c->left.SameAs(msg, wxLeft, 2*LAYOUT_X_MARGIN);
893
   c->width.AsIs();
905
   c->width.Absolute(wLbox);
894
   c->bottom.SameAs(box, wxBottom, 2*LAYOUT_Y_MARGIN);
906
   c->bottom.SameAs(box, wxBottom, 2*LAYOUT_Y_MARGIN);
895
   m_listbox->SetConstraints(c);
907
   m_listbox->SetConstraints(c);
896
908
(-)mahogany-0.67/src/gui/wxTextDialog.cpp (-33 / +38 lines)
Lines 5-11 Link Here
5
// Author:      Vadim Zeitlin
5
// Author:      Vadim Zeitlin
6
// Modified by:
6
// Modified by:
7
// Created:     14.02.03 (extracted from src/gui/wxMDialogs.cpp)
7
// Created:     14.02.03 (extracted from src/gui/wxMDialogs.cpp)
8
// CVS-ID:      $Id: wxTextDialog.cpp,v 1.10 2006/01/16 20:32:28 nerijus Exp $
8
// CVS-ID:      $Id: wxTextDialog.cpp,v 1.14 2006/08/24 17:58:37 vadz Exp $
9
// Copyright:   (c) 2001-2003 Vadim Zeitlin
9
// Copyright:   (c) 2001-2003 Vadim Zeitlin
10
// Licence:     M licence
10
// Licence:     M licence
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 143-180 Link Here
143
143
144
   m_configPath = configPath;
144
   m_configPath = configPath;
145
145
146
   // we may have or not the location in config where the dialogs position/size
147
   // are stored
148
   int x, y, w, h;
149
   if ( m_configPath )
150
   {
151
      wxMFrame::RestorePosition(configPath, &x, &y, &w, &h);
152
   }
153
   else
154
   {
155
      x =
156
      y = -1;
157
      w = 500;
158
      h = 300;
159
   }
160
161
   SetSize(x, y, w, h);
162
163
   // create controls
146
   // create controls
164
   // ---------------
147
   // ---------------
165
148
166
   m_text = new wxTextCtrl(this, -1, wxEmptyString,
149
   m_text = new wxTextCtrl(this, -1, wxEmptyString,
167
                           wxPoint(0, 0),
150
                           wxDefaultPosition,
168
                           wxSize(w, h),
151
                           wxDefaultSize,
169
                           wxTE_MULTILINE |
152
                           wxTE_MULTILINE |
170
                           wxTE_READONLY |
153
                           wxTE_READONLY |
171
                           wxTE_NOHIDESEL |
154
                           wxTE_NOHIDESEL |
172
                           wxTE_RICH2);
155
                           wxTE_RICH2);
173
   m_text->SetValue(text);
174
156
175
   // use fixed-width font
157
   // use fixed-width font and latin1 encoding in which all text is valid:
176
   m_text->SetFont(wxFont(12, wxFONTFAMILY_TELETYPE,
158
   // without encoding information (which wouldn't make sense anyhow as we can
177
                          wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
159
   // have multiple parts using different encodings) we must do this to at
160
   // least show something to the user while using the default UTF-8 encoding
161
   // of GTK+ 2 could result in nothing being shown at all
162
   m_text->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_TELETYPE,
163
                          wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL,
164
                          false /* not underlined */, wxEmptyString,
165
                          wxFONTENCODING_ISO8859_1));
166
167
   // now that the encoding is set, we can show the text
168
   m_text->SetValue(text);
178
169
179
   // in TAB order we want "Save" to get focus before "Close", so create
170
   // in TAB order we want "Save" to get focus before "Close", so create
180
   // them in order
171
   // them in order
Lines 196-215 Link Here
196
   sizerTop->Add(m_text, 1, wxEXPAND);
187
   sizerTop->Add(m_text, 1, wxEXPAND);
197
   sizerTop->Add(sizerBtns, 0, wxCENTRE | wxTOP | wxBOTTOM, LAYOUT_Y_MARGIN);
188
   sizerTop->Add(sizerBtns, 0, wxCENTRE | wxTOP | wxBOTTOM, LAYOUT_Y_MARGIN);
198
189
199
   // set the sizer &c
200
   // ----------------
201
202
   SetSizer(sizerTop);
190
   SetSizer(sizerTop);
203
   SetAutoLayout(TRUE);
204
191
205
   // FIXME: bug in wxMSW? without Layout() the buttons are not positioned
192
   // final initialization
206
   //        correctly initially
193
   // --------------------
207
#ifdef __WXMSW__
208
   Layout();
209
#endif
210
194
211
   m_text->SetFocus();
195
   m_text->SetFocus();
212
196
197
   // under wxGTK SetFocus() scrolls the control to the bottom for some reason
198
   // while we always want to show the top of the message
199
   m_text->SetInsertionPoint(0);
200
201
   // we may have or not the location in config where the dialogs position/size
202
   // are stored
203
   int x, y, w, h;
204
   if ( m_configPath )
205
   {
206
      wxMFrame::RestorePosition(configPath, &x, &y, &w, &h);
207
   }
208
   else
209
   {
210
      x =
211
      y = -1;
212
      w = 500;
213
      h = 300;
214
   }
215
216
   SetSize(x, y, w, h);
217
213
   Show(TRUE);
218
   Show(TRUE);
214
}
219
}
215
220
(-)mahogany-0.67/src/icons/adb_palmos.xpm (-21 / +16 lines)
Lines 178-202 Link Here
178
"/. c #a4a8a8",
178
"/. c #a4a8a8",
179
"(. c #a8b6ad",
179
"(. c #a8b6ad",
180
/* pixels */
180
/* pixels */
181
"                      ",
181
"g g e.e.S.S._ J Y I ^ A.X.X.% % ",
182
"                      ",
182
"j j D D H H A r M 2 e -.=.=.@ @ ",
183
"g e.S._ J Y I ^ A.X.% ",
183
"5 5 $.$.V V L i.6.j.g.D.*.*., , ",
184
"j D H A r M 2 e -.=.@ ",
184
"z z H.H.R.R.T.G.b.V.!.Q.p.p.4 4 ",
185
"5 $.V L i.6.j.g.D.*., ",
185
"b b n.n.1.1.z.M.9.f.Z.B.l.l.7 7 ",
186
"z H.R.T.G.b.V.!.Q.p.4 ",
186
"t t F.F.x.x.G U ] { r.g.y.y.9 9 ",
187
"b n.1.z.M.9.f.Z.B.l.7 ",
187
"< < L.L.t.t.5.4.2.>.v.C.%.%.q q ",
188
"t F.x.G U ] { r.g.y.9 ",
188
"a a P.P.( ( :.} ) m.a.d.3.3.w w ",
189
"< L.t.5.4.2.>.v.C.%.q ",
189
"p p u.u.[ [ S B P / F ,.+.+.8 8 ",
190
"a P.( :.} ) m.a.d.3.w ",
190
"k k ! ! ~ ~ s.<.o.;. .8.O.O.3 3 ",
191
"p u.[ S B P / F ,.+.8 ",
191
"d d N.N.....W./.^.~.(.' Q Q > > ",
192
"k ! ~ s.<.o.;. .8.O.3 ",
192
"y y #.#.R R U.I.E.K.Y.` T T = = ",
193
"d N...W./.^.~.(.' Q > ",
193
"1 1 | | &.&.@.c.k.q.7.h.W W # # ",
194
"y #.R U.I.E.K.Y.` T = ",
194
"h h v v $ $ o X + . *   n n O O ",
195
"1 | &.@.c.k.q.7.h.W # ",
195
"i i u u 0.0.K Z N l w.E J.J.: : ",
196
"h v $ o X + . *   n O ",
196
"c c & & - - 0 x s f 6 ; m m C C ",
197
"i u 0.K Z N l w.E J.: ",
198
"c & - 0 x s f 6 ; m C ",
199
"                      ",
200
"                      ",
201
"                      ",
202
};
197
};
(-)mahogany-0.67/src/mail/SendMessageCC.cpp (-17 / +27 lines)
Lines 5-11 Link Here
5
// Author:      Karsten Ballüder
5
// Author:      Karsten Ballüder
6
// Modified by:
6
// Modified by:
7
// Created:     1998
7
// Created:     1998
8
// CVS-ID:      $Id: SendMessageCC.cpp,v 1.233 2006/06/23 23:27:31 vadz Exp $
8
// CVS-ID:      $Id: SendMessageCC.cpp,v 1.234 2006/08/31 23:45:33 vadz Exp $
9
// Copyright:   (C) 1999-2001 by M-Team
9
// Copyright:   (C) 1999-2001 by M-Team
10
// Licence:     M license
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 43-48 Link Here
43
#include "Message.h"
43
#include "Message.h"
44
#include "MFolder.h"
44
#include "MFolder.h"
45
45
46
#ifdef OS_UNIX
47
#  include "sysutil.h"
48
#endif // OS_UNIX
49
46
// has to be included before SendMessage.h, as it includes windows.h which
50
// has to be included before SendMessage.h, as it includes windows.h which
47
// defines SendMessage under Windows
51
// defines SendMessage under Windows
48
#include <wx/fontmap.h>          // for GetEncodingName()
52
#include <wx/fontmap.h>          // for GetEncodingName()
Lines 1920-1927 Link Here
1920
1924
1921
            // write to temp file:
1925
            // write to temp file:
1922
            wxFile out;
1926
            wxFile out;
1923
            const String filename = wxFileName::CreateTempFileName(
1927
            MTempFileName tmpFN(&out);
1924
               _T("Mtemp"), &out);
1928
            const String& filename = tmpFN.GetName();
1925
1929
1926
            bool success = false;
1930
            bool success = false;
1927
            if ( !filename.empty() )
1931
            if ( !filename.empty() )
Lines 1930-1947 Link Here
1930
               out.Close();
1934
               out.Close();
1931
               if ( written == lfOnly.Length() )
1935
               if ( written == lfOnly.Length() )
1932
               {
1936
               {
1933
                  String command;
1937
                  int rc = system(m_SendmailCmd + " < " + filename);
1934
                  command.Printf(_T("%s < '%s'; exec /bin/rm -f '%s'"),
1938
                  if ( WEXITSTATUS(rc) != 0 )
1935
                                 m_SendmailCmd.c_str(),
1939
                  {
1936
                                 filename.c_str(), filename.c_str());
1940
                     ERRORMESSAGE((_("Failed to execute local MTA \"%s\""),
1937
                  // HORRIBLE HACK: this should be `const char *' but wxExecute's
1941
                                   m_SendmailCmd.c_str()));
1938
                  // prototype doesn't allow it...
1942
                  }
1939
                  wxChar *argv[4];
1943
                  else
1940
                  argv[0] = (wxChar *)"/bin/sh";
1944
                  {
1941
                  argv[1] = (wxChar *)"-c";
1945
                     success = true;
1942
                  argv[2] = (wxChar *)command.c_str();
1946
                  }
1943
                  argv[3] = 0;  // NULL
1947
               }
1944
                  success = wxExecute(argv) != 0;
1948
               else
1949
               {
1950
                  ERRORMESSAGE((_("Failed to write to temporary file \"%s\""),
1951
                                filename.c_str()));
1945
               }
1952
               }
1946
            }
1953
            }
1947
            else
1954
            else
Lines 1961-1968 Link Here
1961
            }
1968
            }
1962
            else
1969
            else
1963
            {
1970
            {
1964
               ERRORMESSAGE((_("Failed to send message via '%s'"),
1971
               ERRORMESSAGE((_("Failed to send message via local MTA, maybe "
1965
                             m_SendmailCmd.c_str()));
1972
                               "it's not configured correctly?\n"
1973
                               "\n"
1974
                               "Please try using an SMTP server if you are not "
1975
                               " sure.")));
1966
            }
1976
            }
1967
1977
1968
            return success;
1978
            return success;
(-)mahogany-0.67/src/modules/HtmlViewer.cpp (-12 / +15 lines)
Lines 6-12 Link Here
6
// Author:      Vadim Zeitlin
6
// Author:      Vadim Zeitlin
7
// Modified by:
7
// Modified by:
8
// Created:     26.07.01
8
// Created:     26.07.01
9
// CVS-ID:      $Id: HtmlViewer.cpp,v 1.77 2006/06/27 00:35:07 vadz Exp $
9
// CVS-ID:      $Id: HtmlViewer.cpp,v 1.78 2006/08/19 13:12:00 vadz Exp $
10
// Copyright:   (c) 2001 Vadim Zeitlin
10
// Copyright:   (c) 2001 Vadim Zeitlin
11
// Licence:     M license
11
// Licence:     M license
12
///////////////////////////////////////////////////////////////////////////////
12
///////////////////////////////////////////////////////////////////////////////
Lines 140-147 Link Here
140
   // add "attr=#colour" attribute to m_htmlText if col is valid
140
   // add "attr=#colour" attribute to m_htmlText if col is valid
141
   void AddColourAttr(const wxChar *attr, const wxColour& col);
141
   void AddColourAttr(const wxChar *attr, const wxColour& col);
142
142
143
   // calculate font size
143
   // calculate HTML font size for the given font
144
   int CalculateFontSize(int diff);
144
   int CalculateFontSize(const wxFont& font);
145
145
146
   // get the name of the virtual file for the n-th image we use
146
   // get the name of the virtual file for the n-th image we use
147
   wxString GetVirtualFileName(size_t n) const;
147
   wxString GetVirtualFileName(size_t n) const;
Lines 844-855 Link Here
844
   }
844
   }
845
}
845
}
846
846
847
int HtmlViewer::CalculateFontSize(int diff)
847
int HtmlViewer::CalculateFontSize(const wxFont& font)
848
{
848
{
849
   if ( !font.Ok() )
850
   {
851
      // use default size
852
      return 0;
853
   }
854
849
   // map the point size into the HTML font size so that if the standard font
855
   // map the point size into the HTML font size so that if the standard font
850
   // size is 12pt, 6pt is very small and 24pt is very big
856
   // size is 12pt, 6pt is very small and 24pt is very big
851
   //
857
   //
852
   // this is not very rigorous, of course...
858
   // this is not very rigorous, of course...
859
   int diff = font.GetPointSize() - wxNORMAL_FONT->GetPointSize();
853
   if ( diff > 0 )
860
   if ( diff > 0 )
854
      diff /= 4;
861
      diff /= 4;
855
   else
862
   else
Lines 901-909 Link Here
901
   // close <body> tag
908
   // close <body> tag
902
   m_htmlText += _T(">");
909
   m_htmlText += _T(">");
903
910
904
   wxFont font = profileValues.GetFont();
911
   wxFont font(profileValues.GetFont());
905
912
   int diff = CalculateFontSize(font);
906
   int diff = CalculateFontSize(font.GetPointSize() - DEFAULT_FONT_SIZE);
907
   if ( diff )
913
   if ( diff )
908
   {
914
   {
909
      m_htmlText << _T("<font size=") << wxString::Format(_T("%+d"), diff) << _T(">");
915
      m_htmlText << _T("<font size=") << wxString::Format(_T("%+d"), diff) << _T(">");
Lines 913-919 Link Here
913
   // map the font family into HTML font face name
919
   // map the font family into HTML font face name
914
   //
920
   //
915
   // TODO: use <font face="...">
921
   // TODO: use <font face="...">
916
   if ( font.IsFixedWidth() )
922
   if ( font.Ok() && font.IsFixedWidth() )
917
   {
923
   {
918
      m_htmlText << _T("<tt>");
924
      m_htmlText << _T("<tt>");
919
      m_htmlEnd.Prepend(_T("</tt>"));
925
      m_htmlEnd.Prepend(_T("</tt>"));
Lines 925-934 Link Here
925
931
926
void HtmlViewer::ShowRawHeaders(const String& header)
932
void HtmlViewer::ShowRawHeaders(const String& header)
927
{
933
{
928
   const ProfileValues& profileValues = GetOptions();
934
   int diff = CalculateFontSize(GetOptions().GetFont());
929
   wxFont font = profileValues.GetFont();
930
931
   int diff = CalculateFontSize(font.GetPointSize() - DEFAULT_FONT_SIZE);
932
   m_htmlText << _T("<pre>") << _T("<font size=") << wxString::Format(_T("%+d"), diff) << _T(">")
935
   m_htmlText << _T("<pre>") << _T("<font size=") << wxString::Format(_T("%+d"), diff) << _T(">")
933
              << MakeHtmlSafe(header) << _T("</font>") << _T("</pre>");
936
              << MakeHtmlSafe(header) << _T("</font>") << _T("</pre>");
934
}
937
}
(-)mahogany-0.67/src/modules/spam/HeadersFilter.cpp (-2 / +2 lines)
Lines 5-11 Link Here
5
// Author:      Vadim Zeitlin
5
// Author:      Vadim Zeitlin
6
// Modified by:
6
// Modified by:
7
// Created:     2004-07-10 (mostly extracted from Filters.cpp)
7
// Created:     2004-07-10 (mostly extracted from Filters.cpp)
8
// CVS-ID:      $Id: HeadersFilter.cpp,v 1.15 2006/06/25 14:36:07 vadz Exp $
8
// CVS-ID:      $Id: HeadersFilter.cpp,v 1.16 2006/08/25 10:47:57 vadz Exp $
9
// Copyright:   (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9
// Copyright:   (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
10
// Licence:     M licence
10
// Licence:     M licence
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 70-79 Link Here
70
   Spam_Test_HTML,
70
   Spam_Test_HTML,
71
   Spam_Test_BadMIME,
71
   Spam_Test_BadMIME,
72
   Spam_Test_ExeAttachment,
72
   Spam_Test_ExeAttachment,
73
   Spam_Test_WhiteList,
74
#ifdef USE_RBL
73
#ifdef USE_RBL
75
   Spam_Test_RBL,
74
   Spam_Test_RBL,
76
#endif // USE_RBL
75
#endif // USE_RBL
76
   Spam_Test_WhiteList,
77
77
78
   Spam_Test_Max
78
   Spam_Test_Max
79
};
79
};
(-)mahogany-0.67/src/modules/TextViewer.cpp (-2 / +4 lines)
Lines 5-11 Link Here
5
// Author:      Vadim Zeitlin
5
// Author:      Vadim Zeitlin
6
// Modified by:
6
// Modified by:
7
// Created:     26.07.01
7
// Created:     26.07.01
8
// CVS-ID:      $Id: TextViewer.cpp,v 1.67 2006/01/16 20:32:28 nerijus Exp $
8
// CVS-ID:      $Id: TextViewer.cpp,v 1.68 2006/08/19 13:12:00 vadz Exp $
9
// Copyright:   (c) 2001 Vadim Zeitlin
9
// Copyright:   (c) 2001 Vadim Zeitlin
10
// Licence:     M license
10
// Licence:     M license
11
///////////////////////////////////////////////////////////////////////////////
11
///////////////////////////////////////////////////////////////////////////////
Lines 549-555 Link Here
549
549
550
   const ProfileValues& profileValues = GetOptions();
550
   const ProfileValues& profileValues = GetOptions();
551
551
552
   m_window->SetFont(profileValues.GetFont());
552
   wxFont font(profileValues.GetFont());
553
   if ( font.Ok() )
554
      m_window->SetFont(font);
553
   m_window->SetForegroundColour(profileValues.FgCol);
555
   m_window->SetForegroundColour(profileValues.FgCol);
554
   m_window->SetBackgroundColour(profileValues.BgCol);
556
   m_window->SetBackgroundColour(profileValues.BgCol);
555
}
557
}

Return to bug 143894