commit 515dd02ab9b52043e250629a98425bb50e608acd
parent c8b47d43cfcbcc581e184aa6b5696d949f816e6d
Author: Jean-Yves Lefort <jylefort@brutele.be>
Date: Thu, 9 Sep 2004 09:44:55 +1000
mail-notification-0.6.2
* Added STARTTLS support to the IMAP backend
* Added STLS support to the POP3 backend
* Now prompts the user before connecting to untrusted SSL/TLS
servers
* Added a "Start Mail Notification on GNOME login" option
* Added a "Blink on errors" option
* Commands are now executed in the user's shell
* The Gmail log is now dumped when --enable-info is in use
* Added a --unset-obsolete-configuration command line argument
* An obsolete mailbox list is now handled without being
rewritten (a step towards full forward compatibility of
GConf keys)
* "SSL" is now called "SSL/TLS", as we provide SSLv2, SSLv3
and TLSv1 support
* Fixed a typo in the MD5 code which prevented builds on some
platforms (reported by Andy Shaw)
* Automatic mailboxes were also polled: fixed
* Added German translations (Hendrik Brandt)
* Added Portuguese translations (Duarte Henriques)
* A few minor issues have been fixed
* Some cleanups have been performed
* Now requires GNOME version 2.6 or superior
Diffstat:
125 files changed, 9670 insertions(+), 5009 deletions(-)
diff --git a/AUTHORS b/AUTHORS
@@ -5,6 +5,9 @@
Developed by Jean-Yves Lefort <jylefort@brutele.be>.
Contributors:
+ * Hendrik Brandt <eru@gmx.li> (german translations)
+ * Duarte Henriques <duarte_henriques@myrealbox.com>
+ (portuguese translations)
* Dan Korostelev <dan@ats.energo.ru> (russian translations)
External art sources:
diff --git a/INSTALL b/INSTALL
@@ -10,7 +10,7 @@ Index
0. About this document
- $Id: INSTALL,v 1.8 2004/08/18 22:45:35 jylefort Exp $
+ $Id: INSTALL,v 1.10 2004/09/08 23:35:47 jylefort Exp $
Copyright (c) 2003, 2004 Jean-Yves Lefort.
@@ -24,7 +24,7 @@ Index
* GTK+ (version 2.4.0 or superior)
http://www.gtk.org/
- * GNOME (version 2.0 or superior)
+ * GNOME (version 2.6.0 or superior)
http://www.gnome.org/
Optional libraries:
@@ -34,7 +34,7 @@ Index
libsoup (version 1.99.28)
ftp://ftp.gnome.org/pub/GNOME/sources/libsoup/1.99/
- * for SSL support:
+ * for SSL/TLS support:
OpenSSL (version 0.9.5b or superior)
http://www.openssl.org/
@@ -54,9 +54,19 @@ Index
<get root privileges, if needed>
$ make install
- IMPORTANT: you must install Mail Notification in the same
- prefix as GNOME (commonly /usr or /opt/gnome).
+ IMPORTANT:
+ * You must install Mail Notification in the same
+ prefix as GNOME (commonly /usr or /opt/gnome). To
+ know where GNOME is installed on your system, type:
+
+ $ pkg-config --variable prefix libgnome-2.0
+
+ * Due to a bug in bonobo-activation
+ (http://bugzilla.gnome.org/show_bug.cgi?id=151082),
+ your session must be restarted after installing Mail
+ Notification.
+
The ./configure script behaviour can be changed using
command-line options: type "./configure --help" for an
exhaustive list.
diff --git a/Makefile.in b/Makefile.in
@@ -41,8 +41,8 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
diff --git a/NEWS b/NEWS
@@ -1,3 +1,28 @@
+0.6.2 09 September 2004
+
+ * Added STARTTLS support to the IMAP backend
+ * Added STLS support to the POP3 backend
+ * Now prompts the user before connecting to untrusted SSL/TLS
+ servers
+ * Added a "Start Mail Notification on GNOME login" option
+ * Added a "Blink on errors" option
+ * Commands are now executed in the user's shell
+ * The Gmail log is now dumped when --enable-info is in use
+ * Added a --unset-obsolete-configuration command line argument
+ * An obsolete mailbox list is now handled without being
+ rewritten (a step towards full forward compatibility of
+ GConf keys)
+ * "SSL" is now called "SSL/TLS", as we provide SSLv2, SSLv3
+ and TLSv1 support
+ * Fixed a typo in the MD5 code which prevented builds on some
+ platforms (reported by Andy Shaw)
+ * Automatic mailboxes were also polled: fixed
+ * Added german translations (Henrik Brandt)
+ * Added portuguese translations (Duarte Henriques)
+ * A few minor issues have been fixed
+ * Some cleanups have been performed
+ * Now requires GNOME version 2.6 or superior
+
0.6.1 19 August 2004
* File descriptor leaks in the Sylpheed and Maildir backends
diff --git a/README b/README
@@ -6,12 +6,11 @@ Index
0. About this document
1. About Mail Notification
- 2. Release notes
- 3. Installation instructions
+ 2. Installation instructions
0. About this document
- $Id: README,v 1.18 2004/08/18 01:00:25 jylefort Exp $
+ $Id: README,v 1.21 2004/09/08 23:35:47 jylefort Exp $
Copyright (c) 2003, 2004 Jean-Yves Lefort.
@@ -35,23 +34,12 @@ Index
support
* SASL authentication support
* APOP authentication support
- * SSL support
+ * SSL/TLS support
* automatic detection of mailbox format
- * automatic notification
+ * immediate notification (the status icon is updated
+ within seconds after a mailbox changes)
* HIG 2.0 compliance
-2. Release notes
-
- In this release or in previous ones, some configuration keys
- have been obsoleted. For the sake of cleanliness, you should
- remove them, by typing:
-
- $ gconftool-2 --recursive-unset \
- /apps/mail-notification/local \
- /apps/mail-notification/remote \
- /apps/mail-notification/commands/clicked \
- /apps/mail-notification/ui/preferences-dialog
-
-3. Installation instructions
+2. Installation instructions
See the INSTALL file.
diff --git a/TODO b/TODO
@@ -1,3 +1,2 @@
-* add STARTTLS support to the IMAP backend
-* implement RFC 2965 cookie support
-* implement a MNURI object
+* Check the SSL certificate's hostname against the hostname we used
+ (RFC 3501, section 11.1)
diff --git a/aclocal.m4 b/aclocal.m4
@@ -772,6 +772,64 @@ chmod u+w intltool-update
])
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN(PKG_CHECK_MODULES, [
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ AC_MSG_CHECKING(for $2)
+
+ if $PKG_CONFIG --exists "$2" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING($1_CFLAGS)
+ $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+ AC_MSG_RESULT($$1_CFLAGS)
+
+ AC_MSG_CHECKING($1_LIBS)
+ $1_LIBS=`$PKG_CONFIG --libs "$2"`
+ AC_MSG_RESULT($$1_LIBS)
+ else
+ $1_CFLAGS=""
+ $1_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ fi
+
+ AC_SUBST($1_CFLAGS)
+ AC_SUBST($1_LIBS)
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+ fi
+])
+
+
+
# -*- Autoconf -*-
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
# Generated from amversion.in; do not edit by hand.
@@ -1732,6 +1790,5 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
m4_include([m4/openssl.m4])
-m4_include([m4/pkg.m4])
m4_include([m4/sasl2.m4])
m4_include([acinclude.m4])
diff --git a/art/Makefile.in b/art/Makefile.in
@@ -39,8 +39,8 @@ DIST_COMMON = $(dist_app_pixmaps_DATA) $(dist_gnome_pixmaps_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/config.h.in b/config.h.in
@@ -177,7 +177,7 @@
/* Define to 1 if SASL support is enabled */
#undef WITH_SASL
-/* Define to 1 if SSL support is enabled */
+/* Define to 1 if SSL/TLS support is enabled */
#undef WITH_SSL
/* Define to 1 if Sylpheed support is enabled */
diff --git a/configure b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for mail-notification 0.6.1.
+# Generated by GNU Autoconf 2.59 for mail-notification 0.6.2.
#
# Report bugs to <jylefort@brutele.be>.
#
@@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='mail-notification'
PACKAGE_TARNAME='mail-notification'
-PACKAGE_VERSION='0.6.1'
-PACKAGE_STRING='mail-notification 0.6.1'
+PACKAGE_VERSION='0.6.2'
+PACKAGE_STRING='mail-notification 0.6.2'
PACKAGE_BUGREPORT='jylefort@brutele.be'
ac_unique_file="src/mn-main.c"
@@ -780,7 +780,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mail-notification 0.6.1 to adapt to many kinds of systems.
+\`configure' configures mail-notification 0.6.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -842,7 +842,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mail-notification 0.6.1:";;
+ short | recursive ) echo "Configuration of mail-notification 0.6.2:";;
esac
cat <<\_ACEOF
@@ -854,7 +854,7 @@ Optional Features:
--disable-maildir disable Maildir support
--disable-pop3 disable POP3 support
--disable-imap disable IMAP support
- --disable-ssl disable SSL support
+ --disable-ssl disable SSL/TLS support
--disable-sasl disable SASL authentication support
--disable-sylpheed disable Sylpheed support
--disable-gmail disable Gmail support
@@ -986,7 +986,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-mail-notification configure 0.6.1
+mail-notification configure 0.6.2
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1000,7 +1000,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mail-notification $as_me 0.6.1, which was
+It was created by mail-notification $as_me 0.6.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1828,7 +1828,7 @@ fi
# Define the identity of the package.
PACKAGE='mail-notification'
- VERSION='0.6.1'
+ VERSION='0.6.2'
cat >>confdefs.h <<_ACEOF
@@ -1991,7 +1991,7 @@ _ACEOF
-ALL_LINGUAS="fr ru"
+ALL_LINGUAS="de fr pt ru"
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
@@ -7201,12 +7201,11 @@ echo "$as_me: error: unable to find the GTK+ library" >&2;}
rm -f conf.gtktest
-found=no
-GNOME_CFLAGS=""
-GNOME_LIBS=""
-if test -z "$PKG_CONFIG"; then
- # Extract the first word of "pkg-config", so it can be a program name with args.
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
@@ -7246,45 +7245,59 @@ else
echo "${ECHO_T}no" >&6
fi
-fi
+ fi
-if test "x$PKG_CONFIG" = "xno" ; then
- { echo "$as_me:$LINENO: WARNING: the pkg-config script could not be found: make sure it is in your path, or set the PKG_CONFIG environment variable to the full path to pkg-config" >&5
-echo "$as_me: WARNING: the pkg-config script could not be found: make sure it is in your path, or set the PKG_CONFIG environment variable to the full path to pkg-config" >&2;}
-else
- PKG_CONFIG_MIN_VERSION=0.9.0
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo "$as_me:$LINENO: checking for gthread-2.0 gconf-2.0 >= 2.4.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 >= 2.6.0 bonobo-activation-2.0" >&5
+echo $ECHO_N "checking for gthread-2.0 gconf-2.0 >= 2.4.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 >= 2.6.0 bonobo-activation-2.0... $ECHO_C" >&6
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
- echo "$as_me:$LINENO: checking for gthread-2.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 bonobo-activation-2.0" >&5
-echo $ECHO_N "checking for gthread-2.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 bonobo-activation-2.0... $ECHO_C" >&6
+ if $PKG_CONFIG --exists "gthread-2.0 gconf-2.0 >= 2.4.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 >= 2.6.0 bonobo-activation-2.0" ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ succeeded=yes
+
+ echo "$as_me:$LINENO: checking GNOME_CFLAGS" >&5
+echo $ECHO_N "checking GNOME_CFLAGS... $ECHO_C" >&6
+ GNOME_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0 gconf-2.0 >= 2.4.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 >= 2.6.0 bonobo-activation-2.0"`
+ echo "$as_me:$LINENO: result: $GNOME_CFLAGS" >&5
+echo "${ECHO_T}$GNOME_CFLAGS" >&6
+
+ echo "$as_me:$LINENO: checking GNOME_LIBS" >&5
+echo $ECHO_N "checking GNOME_LIBS... $ECHO_C" >&6
+ GNOME_LIBS=`$PKG_CONFIG --libs "gthread-2.0 gconf-2.0 >= 2.4.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 >= 2.6.0 bonobo-activation-2.0"`
+ echo "$as_me:$LINENO: result: $GNOME_LIBS" >&5
+echo "${ECHO_T}$GNOME_LIBS" >&6
+ else
+ GNOME_CFLAGS=""
+ GNOME_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ GNOME_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gthread-2.0 gconf-2.0 >= 2.4.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 >= 2.6.0 bonobo-activation-2.0"`
- if $PKG_CONFIG --exists "gthread-2.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 bonobo-activation-2.0"; then
- found=yes
+ fi
- GNOME_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 bonobo-activation-2.0"`
- GNOME_LIBS=`$PKG_CONFIG --libs "gthread-2.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 bonobo-activation-2.0"`
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- fi
- else
- { echo "$as_me:$LINENO: WARNING: your version of pkg-config is too old, you need version $PKG_CONFIG_MIN_VERSION or newer" >&5
-echo "$as_me: WARNING: your version of pkg-config is too old, you need version $PKG_CONFIG_MIN_VERSION or newer" >&2;}
- fi
-fi
-if test $found = no; then
- { { echo "$as_me:$LINENO: error: unable to find the GNOME libraries" >&5
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ :
+ else
+ { { echo "$as_me:$LINENO: error: unable to find the GNOME libraries" >&5
echo "$as_me: error: unable to find the GNOME libraries" >&2;}
{ (exit 1); exit 1; }; }
-else
- :
-fi
-
-
+ fi
@@ -7568,12 +7581,11 @@ fi
have_soup=no
if test $enable_gmail = yes; then
- found=no
-SOUP_CFLAGS=""
-SOUP_LIBS=""
-if test -z "$PKG_CONFIG"; then
- # Extract the first word of "pkg-config", so it can be a program name with args.
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
@@ -7613,44 +7625,58 @@ else
echo "${ECHO_T}no" >&6
fi
-fi
-
-if test "x$PKG_CONFIG" = "xno" ; then
- { echo "$as_me:$LINENO: WARNING: the pkg-config script could not be found: make sure it is in your path, or set the PKG_CONFIG environment variable to the full path to pkg-config" >&5
-echo "$as_me: WARNING: the pkg-config script could not be found: make sure it is in your path, or set the PKG_CONFIG environment variable to the full path to pkg-config" >&2;}
-else
- PKG_CONFIG_MIN_VERSION=0.9.0
+ fi
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
- echo "$as_me:$LINENO: checking for soup-2.0" >&5
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo "$as_me:$LINENO: checking for soup-2.0" >&5
echo $ECHO_N "checking for soup-2.0... $ECHO_C" >&6
- if $PKG_CONFIG --exists "soup-2.0"; then
- found=yes
+ if $PKG_CONFIG --exists "soup-2.0" ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ succeeded=yes
+
+ echo "$as_me:$LINENO: checking SOUP_CFLAGS" >&5
+echo $ECHO_N "checking SOUP_CFLAGS... $ECHO_C" >&6
+ SOUP_CFLAGS=`$PKG_CONFIG --cflags "soup-2.0"`
+ echo "$as_me:$LINENO: result: $SOUP_CFLAGS" >&5
+echo "${ECHO_T}$SOUP_CFLAGS" >&6
+
+ echo "$as_me:$LINENO: checking SOUP_LIBS" >&5
+echo $ECHO_N "checking SOUP_LIBS... $ECHO_C" >&6
+ SOUP_LIBS=`$PKG_CONFIG --libs "soup-2.0"`
+ echo "$as_me:$LINENO: result: $SOUP_LIBS" >&5
+echo "${ECHO_T}$SOUP_LIBS" >&6
+ else
+ SOUP_CFLAGS=""
+ SOUP_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ SOUP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "soup-2.0"`
- SOUP_CFLAGS=`$PKG_CONFIG --cflags "soup-2.0"`
- SOUP_LIBS=`$PKG_CONFIG --libs "soup-2.0"`
+ fi
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- fi
- else
- { echo "$as_me:$LINENO: WARNING: your version of pkg-config is too old, you need version $PKG_CONFIG_MIN_VERSION or newer" >&5
-echo "$as_me: WARNING: your version of pkg-config is too old, you need version $PKG_CONFIG_MIN_VERSION or newer" >&2;}
- fi
-fi
-if test $found = no; then
- { echo "$as_me:$LINENO: WARNING: unable to find the soup library: forcing --disable-gmail" >&5
-echo "$as_me: WARNING: unable to find the soup library: forcing --disable-gmail" >&2;}; enable_gmail=no; disable_gmail_reason="(libsoup not found)"
-else
- have_soup=yes
-fi
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+ if test $succeeded = yes; then
+ have_soup=yes
+ else
+ { echo "$as_me:$LINENO: WARNING: unable to find the soup library: forcing --disable-gmail" >&5
+echo "$as_me: WARNING: unable to find the soup library: forcing --disable-gmail" >&2;}; enable_gmail=no; disable_gmail_reason="(libsoup not found)"
+ fi
fi
@@ -8391,7 +8417,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by mail-notification $as_me 0.6.1, which was
+This file was extended by mail-notification $as_me 0.6.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8454,7 +8480,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-mail-notification config.status 0.6.1
+mail-notification config.status 0.6.2
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(mail-notification, 0.6.1, jylefort@brutele.be)
+AC_INIT(mail-notification, 0.6.2, jylefort@brutele.be)
AC_CONFIG_SRCDIR(src/mn-main.c)
AC_PREREQ(2.59)
@@ -41,7 +41,7 @@ AC_HELP_STRING([--disable-imap], [disable IMAP support]),
esac], [enable_imap=yes])
AC_ARG_ENABLE(ssl,
-AC_HELP_STRING([--disable-ssl], [disable SSL support]),
+AC_HELP_STRING([--disable-ssl], [disable SSL/TLS support]),
[case "$enableval" in
yes|no) enable_ssl=$enableval ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-ssl]) ;;
@@ -97,7 +97,7 @@ GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the gettext package name])
AC_SUBST(GETTEXT_PACKAGE)
-ALL_LINGUAS="fr ru"
+ALL_LINGUAS="de fr pt ru"
AM_GLIB_GNU_GETTEXT
AC_PROG_INTLTOOL
@@ -138,7 +138,7 @@ AC_CHECK_FUNCS(atoi close connect exit freeaddrinfo gai_strerror getaddrinfo get
AM_PATH_GTK_2_0(2.4.0,, [AC_MSG_ERROR([unable to find the GTK+ library])])
-AM_PATH_PKG(GNOME, [gthread-2.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 bonobo-activation-2.0],, [AC_MSG_ERROR([unable to find the GNOME libraries])])
+PKG_CHECK_MODULES(GNOME, [gthread-2.0 gconf-2.0 >= 2.4.0 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0 >= 2.6.0 bonobo-activation-2.0],, [AC_MSG_ERROR([unable to find the GNOME libraries])])
AC_SUBST(GNOME_CFLAGS)
AC_SUBST(GNOME_LIBS)
@@ -172,7 +172,7 @@ fi
have_soup=no
if test $enable_gmail = yes; then
- AM_PATH_PKG(SOUP, soup-2.0, have_soup=yes, [AC_MSG_WARN([unable to find the soup library: forcing --disable-gmail]); enable_gmail=no; disable_gmail_reason="(libsoup not found)"])
+ PKG_CHECK_MODULES(SOUP, soup-2.0, have_soup=yes, [AC_MSG_WARN([unable to find the soup library: forcing --disable-gmail]); enable_gmail=no; disable_gmail_reason="(libsoup not found)"])
fi
ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
@@ -219,7 +219,7 @@ if test $enable_imap = yes; then
AC_DEFINE(WITH_IMAP, 1, [Define to 1 if IMAP support is enabled])
fi
if test $enable_ssl = yes; then
- AC_DEFINE(WITH_SSL, 1, [Define to 1 if SSL support is enabled])
+ AC_DEFINE(WITH_SSL, 1, [Define to 1 if SSL/TLS support is enabled])
fi
if test $enable_sasl = yes; then
AC_DEFINE(WITH_SASL, 1, [Define to 1 if SASL support is enabled])
diff --git a/data/Makefile.in b/data/Makefile.in
@@ -38,8 +38,8 @@ subdir = data
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/data/mail-notification.schemas.in b/data/mail-notification.schemas.in
@@ -108,5 +108,38 @@
<long>Whether Mail Notification has already been run or not.</long>
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/mail-notification/blink-on-errors</key>
+ <applyto>/apps/mail-notification/blink-on-errors</applyto>
+ <owner>mail-notification</owner>
+ <type>bool</type>
+ <default>1</default>
+ <locale name="C">
+ <short>Blink on errors</short>
+ <long>Whether the status icon should blink on errors or not.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/apps/mail-notification/trusted-x509-certificates</key>
+ <applyto>/apps/mail-notification/trusted-x509-certificates</applyto>
+ <owner>mail-notification</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <locale name="C">
+ <short>Fingerprints of trusted X509 certificates</short>
+ <long>The list of trusted X509 certificates, represented by their MD5 fingerprint.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/apps/mail-notification/trusted-servers</key>
+ <applyto>/apps/mail-notification/trusted-servers</applyto>
+ <owner>mail-notification</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <locale name="C">
+ <short>Trusted servers list</short>
+ <long>The list of trusted SSL/TLS servers (hostname:port) lacking a X509 certificate.</long>
+ </locale>
+ </schema>
</schemalist>
</gconfschemafile>
diff --git a/help/C/Makefile.in b/help/C/Makefile.in
@@ -100,8 +100,8 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
subdir = help/C
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/help/C/mail-notification-C.omf b/help/C/mail-notification-C.omf
@@ -12,9 +12,9 @@
Mail Notification Manual
</title>
<date>
- 2004-08-19
+ 2004-09-09
</date>
- <version identifier="2.3" date="2004-08-19" description="Fourth release"/>
+ <version identifier="2.4" date="2004-09-09" description="Fifth release"/>
<subject category="GNOME|Internet"/>
<description>
Mail Notification Manual
diff --git a/help/C/mail-notification.xml b/help/C/mail-notification.xml
@@ -2,9 +2,9 @@
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY app "<application>Mail Notification</application>">
- <!ENTITY appversion "0.6.1">
- <!ENTITY manrevision "2.3">
- <!ENTITY date "Thursday, August 19, 2004">
+ <!ENTITY appversion "0.6.2">
+ <!ENTITY manrevision "2.4">
+ <!ENTITY date "Thursday, September 9, 2004">
<!ENTITY project "The Mail Notification Project">
@@ -20,12 +20,13 @@
<!ENTITY imap "<link linkend="imap">IMAP</link>">
<!ENTITY sasl "<link linkend="sasl">SASL</link>">
<!ENTITY ssl "<link linkend="pop3">SSL</link>">
+ <!ENTITY tls "<link linkend="pop3">TLS</link>">
<!ENTITY sylpheed "<link linkend="sylpheed">Sylpheed</link>">
<!ENTITY gmail "<link linkend="gmail">Gmail</link>">
<!ENTITY gnomevfs "<link linkend="gnomevfs">GnomeVFS</link>">
]>
-<!-- $Id: mail-notification.xml,v 1.37 2004/08/18 22:37:58 jylefort Exp $ -->
+<!-- $Id: mail-notification.xml,v 1.49 2004/09/08 23:26:57 jylefort Exp $ -->
<!-- Mail Notification Manual -->
<!-- Copyright (c) 2004 Jean-Yves Lefort -->
@@ -133,6 +134,17 @@
</revdescription>
</revision>
<revision>
+ <revnumber>Mail Notification Manual V2.3</revnumber>
+ <date>Thursday, August 19, 2004</date>
+ <revdescription>
+ <para role="author">
+ Jean-Yves Lefort
+ <email>jylefort@brutele.be</email>
+ </para>
+ <para role="publisher">&project;</para>
+ </revdescription>
+ </revision>
+ <revision>
<revnumber>Mail Notification Manual V2.2</revnumber>
<date>Monday, August 16, 2004</date>
<revdescription>
@@ -203,9 +215,9 @@
<listitem><para>&mbox;, &mh;, &maildir;, &sylpheed;, &pop3;, &imap; and &gmail; support</para></listitem>
<listitem><para>&sasl; authentication support</para></listitem>
<listitem><para>APOP authentication support</para></listitem>
- <listitem><para>&ssl; support</para></listitem>
+ <listitem><para>&ssl;/&tls; support</para></listitem>
<listitem><para>automatic detection of mailbox format</para></listitem>
- <listitem><para><link linkend="automatic-notification">automatic notification</link></para></listitem>
+ <listitem><para><link linkend="immediate-notification">immediate notification</link> (the status icon is updated within seconds after a mailbox changes)</para></listitem>
<listitem><para><ulink url="http://developer.gnome.org/projects/gup/hig" type="http">HIG</ulink> 2.0 compliance</para></listitem>
</itemizedlist>
</sect1>
@@ -291,6 +303,11 @@
</varlistentry>
<varlistentry>
+ <term>--unset-obsolete-configuration</term>
+ <listitem><para>Unset obsolete GConf configuration and exit</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>--help</term>
<listitem><para>Show help and exit</para></listitem>
</varlistentry>
@@ -324,7 +341,8 @@
</screenshot>
</figure>
<para>
- If an error is detected, the icon blinks.
+ If an error is detected, the icon blinks (unless the
+ <link linkend="blink-on-errors">Blink on errors</link> setting is disabled).
</para>
<para>
Leaving your mouse over the icon will reveal more details
@@ -339,27 +357,64 @@
<menuchoice>
<guimenu>Applications</guimenu>
<guisubmenu>Desktop Preferences</guisubmenu>
- <guimenuitem>Mail Notification</guimenuitem>
- </menuchoice>. The
- <guilabel>Properties</guilabel> dialog contains the following
- settings:
+ <guimenuitem>Mail Notification</guimenuitem>
+ </menuchoice> (or on some systems
+ <menuchoice>
+ <guimenu>Applications</guimenu>
+ <guisubmenu>Preferences</guisubmenu>
+ <guisubmenu>More Preferences</guisubmenu>
+ <guimenuitem>Mail Notification</guimenuitem>
+ </menuchoice>).
+ </para>
+ <para>
+ The <guilabel>Properties</guilabel> dialog contains the
+ following settings:
</para>
<variablelist>
- <varlistentry id="delay-between-mail-checks">
- <term><guilabel>Delay between mail checks</guilabel></term>
+ <varlistentry>
+ <term><guilabel>General</guilabel></term>
<listitem>
- <para>
- This is the amount of time to wait between mail checks.
- <note>
- <para>
- This delay only applies to mailboxes which do not
- support <link linkend="automatic-notification">automatic notification</link> of changes.
- </para>
- </note>
- </para>
+ <variablelist>
+ <varlistentry id="delay-between-mail-checks">
+ <term><guilabel>Delay between mail checks</guilabel></term>
+ <listitem>
+ <para>
+ This is the amount of time to wait between mail
+ checks.
+ <note>
+ <para>
+ This delay only applies to mailboxes which do
+ not support <link linkend="immediate-notification">immediate notification</link> of changes.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Start Mail Notification on GNOME login</guilabel></term>
+ <listitem>
+ <para>
+ If this option is enabled, &app; will be started
+ along with your GNOME session.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="blink-on-errors">
+ <term><guilabel>Blink on errors</guilabel></term>
+ <listitem>
+ <para>
+ If this option is enabled, &app; will show the
+ status icon and make it blink on errors. Disabling
+ this option is useful if some of your mailboxes are
+ not permanently accessible.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</listitem>
</varlistentry>
+
<varlistentry>
<term><guilabel>Mailboxes</guilabel></term>
<listitem>
@@ -373,26 +428,36 @@
</para>
</listitem>
</varlistentry>
+
<varlistentry>
- <term><guilabel>When new mail arrives:</guilabel></term>
- <listitem>
- <para>
- This is the command to execute when new mail arrives.
- <note>
- <para>
- This command will not be executed if you already have
- new mail.
- </para>
- </note>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><guilabel>When double-clicked:</guilabel></term>
+ <term><guilabel>Commands</guilabel></term>
<listitem>
- <para>
- This is the command to execute when the icon is double-clicked.
- </para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>When new mail arrives:</guilabel></term>
+ <listitem>
+ <para>
+ This is the command to execute when new mail
+ arrives.
+ <note>
+ <para>
+ This command will not be executed if you already
+ have new mail.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>When double-clicked:</guilabel></term>
+ <listitem>
+ <para>
+ This is the command to execute when the icon is
+ double-clicked.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</listitem>
</varlistentry>
</variablelist>
@@ -483,10 +548,13 @@
<title>Security</title>
<para>
To avoid sending your password over the network in
- clear text, you must eitheir use a SSL connection
- or select a secure authentication mechanism. See
- below for more details.
+ clear text, you must eitheir use a SSL/TLS
+ connection or select a secure authentication
+ mechanism. See below for more details.
</para>
+ <!-- simplified on purpose: actually, a weak SSL/TLS -->
+ <!-- algorithm could be used, but this is beyond the -->
+ <!-- scope of this document -->
</warning>
</listitem>
</varlistentry>
@@ -497,11 +565,28 @@
This is the type of connection to use and the port
number to connect to.
</para>
+ <para>
+ <guilabel>In-band SSL/TLS</guilabel> refers to a
+ &ssl;/&tls; connection negotiated inside of the
+ protocol (using the <literal>STLS</literal> &pop3;
+ command or the <literal>STARTTLS</literal> &imap;
+ command).
+ </para>
+ <para>
+ <guilabel>SSL/TLS on separate port</guilabel> refers to
+ the most widespread method for establishing a
+ &ssl;/&tls; connection: using a separate port.
+ </para>
<note>
<para>
The security considerations listed below do not
- apply if you select <guilabel>SSL</guilabel>.
+ apply if you select <guilabel>SSL/TLS</guilabel>
+ (eitheir <guilabel>in-band</guilabel> or
+ <guilabel>on separate port</guilabel>).
</para>
+ <!-- simplified on purpose: actually, a weak SSL/TLS -->
+ <!-- algorithm could be used, but this is beyond the -->
+ <!-- scope of this document -->
</note>
</listitem>
</varlistentry>
@@ -523,7 +608,7 @@
If <guilabel>autodetect</guilabel> is selected and
secure authentication fails, your credentials may
be sent over the network in clear text (unless you
- use a &ssl; connection).
+ use a &ssl;/&tls; connection).
</para>
<para>
If this is a concern, select the appropriate
@@ -602,16 +687,16 @@
<sect1 id="technical-information">
<title>Technical Information</title>
- <sect2 id="automatic-notification">
- <title>Automatic Notification</title>
+ <sect2 id="immediate-notification">
+ <title>Immediate Notification</title>
<para>
- Automatic notification is the ability to detect changes to a
+ Immediate notification is the ability to detect changes to a
mailbox without needing to poll it periodically. It allows the
status icon to be updated within seconds after a mailbox
- receives new mail.
+ changes.
</para>
<para>
- For automatic notification to be supported, &gnomevfs; must be compiled
+ For immediate notification to be supported, &gnomevfs; must be compiled
with <ulink url="http://oss.sgi.com/projects/fam" type="http">FAM</ulink> support,
and FAM must be configured properly.
</para>
@@ -622,7 +707,7 @@
</para>
<note>
<para>
- Automatic notification is only supported for local mailboxes.
+ Immediate notification is only supported for local mailboxes.
Mailboxes which do not support it will be checked periodically
according to the <link linkend="delay-between-mail-checks">Delay between mail checks</link>
setting.
@@ -635,8 +720,9 @@
<para>
The &app; &pop3; implementation strictly conforms to
<ulink url="http://www.ietf.org/rfc/rfc1939.txt" type="http">RFC 1939</ulink>,
- <ulink url="http://www.ietf.org/rfc/rfc2449.txt" type="http">RFC 2449</ulink> and
- <ulink url="http://www.ietf.org/rfc/rfc1734.txt" type="http">RFC 1734</ulink>.
+ <ulink url="http://www.ietf.org/rfc/rfc2449.txt" type="http">RFC 2449</ulink>,
+ <ulink url="http://www.ietf.org/rfc/rfc1734.txt" type="http">RFC 1734</ulink> and
+ <ulink url="http://www.ietf.org/rfc/rfc2595.txt" type="http">RFC 2595</ulink>.
</para>
<para>
The AUTH, APOP and USER/PASS authentication mechanisms are
@@ -723,6 +809,8 @@ endif</programlisting>
<itemizedlist>
<!-- We don't use <firstname> and <surname> because we can't -->
<!-- unambiguously split some names. -->
+ <listitem><para>Hendrik Brandt</para></listitem>
+ <listitem><para>Duarte Henriques</para></listitem>
<listitem><para>Dan Korostelev</para></listitem>
<listitem><para>Phil Nelson</para></listitem>
</itemizedlist>
@@ -879,6 +967,26 @@ endif</programlisting>
</glossentry>
</glossdiv>
+ <glossdiv><title>T</title>
+ <glossentry>
+ <glossterm>TLS</glossterm>
+ <glosssee otherterm="tls"/>
+ </glossentry>
+
+ <glossentry id="tls">
+ <glossterm>Transport Layer Security</glossterm>
+ <acronym>TLS</acronym>
+ <glossdef>
+ <para>
+ A protocol securing a connection through the use of
+ cryptographic techniques, as defined by
+ <ulink url="http://www.ietf.org/rfc/rfc2246.txt" type="http">RFC 2246</ulink>.
+ TLS is the successor of &ssl;.
+ </para>
+ </glossdef>
+ </glossentry>
+ </glossdiv>
+
<glossdiv><title>U</title>
<glossentry id="uri">
<glossterm>Uniform Resource Identifier</glossterm>
diff --git a/help/Makefile.in b/help/Makefile.in
@@ -37,8 +37,8 @@ subdir = help
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/m4/Makefile.am b/m4/Makefile.am
@@ -1 +1 @@
-EXTRA_DIST = pkg.m4
+EXTRA_DIST = openssl.m4 sasl2.m4
diff --git a/m4/Makefile.in b/m4/Makefile.in
@@ -37,8 +37,8 @@ subdir = m4
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -201,7 +201,7 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-EXTRA_DIST = pkg.m4
+EXTRA_DIST = openssl.m4 sasl2.m4
all: all-am
.SUFFIXES:
diff --git a/m4/pkg.m4 b/m4/pkg.m4
@@ -1,52 +0,0 @@
-# $Id: pkg.m4,v 1.5 2004/05/26 18:02:11 jylefort Exp $
-#
-# This file is part of Mail Notification.
-#
-# Copyright (c) 2002, 2003, 2004 Jean-Yves Lefort.
-#
-# As a special exception to the Mail Notification licensing terms,
-# Jean-Yves Lefort gives unlimited permission to copy, distribute and
-# modify this file.
-
-dnl AM_PATH_PKG(VARIABLE_PREFIX, MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-dnl
-AC_DEFUN([AM_PATH_PKG],
-[found=no
-$1_CFLAGS=""
-$1_LIBS=""
-
-if test -z "$PKG_CONFIG"; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-fi
-
-if test "x$PKG_CONFIG" = "xno" ; then
- AC_MSG_WARN([the pkg-config script could not be found: make sure it is in your path, or set the PKG_CONFIG environment variable to the full path to pkg-config])
-else
- PKG_CONFIG_MIN_VERSION=0.9.0
-
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
- AC_MSG_CHECKING([for $2])
-
- if $PKG_CONFIG --exists "$2"; then
- found=yes
-
- $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
- $1_LIBS=`$PKG_CONFIG --libs "$2"`
-
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_WARN([your version of pkg-config is too old, you need version $PKG_CONFIG_MIN_VERSION or newer])
- fi
-fi
-
-if test $found = no; then
- ifelse([$4],, :, [$4])
-else
- ifelse([$3],, :, [$3])
-fi
-
-AC_SUBST($1_CFLAGS)
-AC_SUBST($1_LIBS)])
diff --git a/po/POTFILES.in b/po/POTFILES.in
@@ -16,8 +16,6 @@ src/mn-client-session.c
src/mn-client-session.h
src/mn-conf.c
src/mn-conf.h
-src/mn-dialog.c
-src/mn-dialog.h
src/mn-gmail-mailbox-properties.gob
src/mn-gmail-mailbox.gob
src/mn-imap-mailbox-properties.gob
@@ -56,13 +54,11 @@ src/mn-stock.h
src/mn-sylpheed-mailbox.gob
src/mn-system-mailbox-properties.gob
src/mn-unsupported-mailbox.gob
-src/mn-uri.c
-src/mn-uri.h
+src/mn-uri.gob
src/mn-util.c
src/mn-util.h
src/mn-vfs.c
src/mn-vfs.h
-ui/dialog.glade
ui/mailbox-properties.glade
ui/properties.glade
ui/welcome.glade
diff --git a/po/de.gmo b/po/de.gmo
Binary files differ.
diff --git a/po/de.po b/po/de.po
@@ -0,0 +1,1263 @@
+# German translations for mail-notification.
+# Copyright (c) 2003, 2004 Jean-Yves Lefort.
+#
+# This file is distributed under the same license as the
+# mail-notification package.
+#
+# Hendrik Brandt <eru@gmx.li>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mail-notification 0.6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-09-09 01:43+0200\n"
+"PO-Revision-Date: 2004-09-08 23:26+0200\n"
+"Last-Translator: Hendrik Brandt <eru@gmx.li>\n"
+"Language-Team: German <gnome-de@gnome.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#: data/GNOME_MailNotification_Automation.server.in.in.h:1
+msgid "Mail Notification automation"
+msgstr "Automatische E-Mail-Eingangsüberwachnung"
+
+#: data/GNOME_MailNotification_Automation.server.in.in.h:2
+#, fuzzy
+msgid "Mail Notification automation factory"
+msgstr "Automatische E-Mail-Eingangsüberwachnung"
+
+#: data/mail-notification-properties.desktop.in.h:1
+msgid "Configure Mail Notification"
+msgstr "Die E-Mail-Eingangsüberwachung einstellen"
+
+#: data/mail-notification-properties.desktop.in.h:2
+#: data/mail-notification.desktop.in.h:2
+#: data/mail-notification.soundlist.in.h:1 src/mn-about-dialog.gob:38
+#: src/mn-mail-icon.gob:160 src/mn-main.c:221
+msgid "Mail Notification"
+msgstr "E-Mail-Eingangsüberwachung"
+
+#: data/mail-notification.desktop.in.h:1
+msgid "Get notified when new mail arrives"
+msgstr "Informiert Sie wenn eine neue Nachricht eintrifft"
+
+#: data/mail-notification.schemas.in.h:1
+msgid "Blink on errors"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:2
+msgid "Delay between mail checks (minutes part)."
+msgstr "Abstand zwischen Eingangsüberprüfung (Minutenteil)."
+
+#: data/mail-notification.schemas.in.h:3
+msgid "Delay between mail checks (seconds part)."
+msgstr "Abstand zwischen Eingangsüberprüfung (Sekundenteil)."
+
+#: data/mail-notification.schemas.in.h:4
+msgid "Double-clicked command"
+msgstr "Auszuführender Befehl bei Doppelklick"
+
+#: data/mail-notification.schemas.in.h:5
+msgid "Fingerprints of trusted X509 certificates"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:6
+msgid "Has already been run"
+msgstr "Wurde schon einmal gestartet"
+
+#: data/mail-notification.schemas.in.h:7
+msgid "Height of properties dialog"
+msgstr "Höhe des Einstellungen-Dialogs"
+
+#: data/mail-notification.schemas.in.h:8
+msgid "Mailboxes list"
+msgstr "Liste der Postfächer"
+
+#: data/mail-notification.schemas.in.h:9
+msgid "Minutes between mail checks"
+msgstr "Minuten zwischen den Aktualisierungen"
+
+#: data/mail-notification.schemas.in.h:10
+msgid "New mail command"
+msgstr "Befehl bei neuer Nachricht"
+
+#: data/mail-notification.schemas.in.h:11
+msgid "Run a command when new mail arrives"
+msgstr "Einen Befehl ausführen, wenn eine neue Nachricht eintrifft"
+
+#: data/mail-notification.schemas.in.h:12
+msgid "Run a command when the icon is double-clicked"
+msgstr ""
+"Einen Befehl ausführen, wenn das Nachrichtensymbol doppelt angeklickt wird"
+
+#: data/mail-notification.schemas.in.h:13
+msgid "Seconds between mail checks"
+msgstr "Sekunden zwischen den Aktualisierungen"
+
+#: data/mail-notification.schemas.in.h:14
+msgid "The command to run when new mail arrives."
+msgstr "Der Befehl der ausgeführt wird, wenn eine neue Nachricht eintrifft."
+
+#: data/mail-notification.schemas.in.h:15
+msgid "The command to run when the icon is double-clicked."
+msgstr ""
+"Der Befehl der ausgeführt wird, wenn das Nachrichtensymbol doppelt "
+"angeklickt wird."
+
+#: data/mail-notification.schemas.in.h:16
+msgid "The height of the properties dialog in pixels."
+msgstr "Die Höhe des Einstellungsdialogs in Pixel."
+
+#: data/mail-notification.schemas.in.h:17
+msgid "The list of mailboxes to monitor."
+msgstr "Die Liste der zu überwachenden Postfächer."
+
+#: data/mail-notification.schemas.in.h:18
+msgid ""
+"The list of trusted SSL/TLS servers (hostname:port) lacking a X509 "
+"certificate."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:19
+msgid ""
+"The list of trusted X509 certificates, represented by their MD5 fingerprint."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:20
+msgid "The width of the properties dialog in pixels."
+msgstr "Die Breite des Einstellungen-Dialogs in Pixel."
+
+#: data/mail-notification.schemas.in.h:21
+msgid "Trusted servers list"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:22
+msgid "Whether Mail Notification has already been run or not."
+msgstr ""
+"Legt fest, ob die E-Mail-Eingangsüberwachnung schon einmal gestartet wurde."
+
+#: data/mail-notification.schemas.in.h:23
+#, fuzzy
+msgid "Whether the status icon should blink on errors or not."
+msgstr "Legt fest, ob das Bild blinkt oder nicht"
+
+#: data/mail-notification.schemas.in.h:24
+msgid "Whether to run a command when new mail arrives or not."
+msgstr ""
+"Legt fest, ob ein Befehl ausgeführt wird, wenn eine neue Nachricht eintrifft."
+
+#: data/mail-notification.schemas.in.h:25
+msgid "Whether to run a command when the icon is double-clicked or not."
+msgstr ""
+"Legt fest, ob ein Befehl ausgeführt wird, wenn das Nachrichtensymbol doppelt "
+"angeklickt wird."
+
+#: data/mail-notification.schemas.in.h:26
+msgid "Width of properties dialog"
+msgstr "Breite des Einstellungen-Dialogs"
+
+#: data/mail-notification.soundlist.in.h:2
+msgid "New Mail"
+msgstr "Neue Nachricht"
+
+#: src/eggtrayicon.c:109
+msgid "Orientation"
+msgstr "Ausrichtung"
+
+#: src/eggtrayicon.c:110
+msgid "The orientation of the tray."
+msgstr "Die Ausrichtung des Benachrichtigungsfeldes"
+
+#: src/mn-about-dialog.gob:41
+msgid "A Mail Notification Icon"
+msgstr ""
+"Ein Benachrichtigungssymbol das erscheint, wenn neue Nachrichten in Ihren "
+"Postfächern liegen."
+
+#: src/mn-about-dialog.gob:44
+msgid "Jean-Yves Lefort <jylefort@brutele.be>"
+msgstr "Hendrik Brandt <eru@gmx.li>"
+
+#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:35
+msgid "<span style=\"italic\">autodetect</span>"
+msgstr "<span style=\"italic\">automatisch erkennen</span>"
+
+#: src/mn-autodetect-mailbox-properties.gob:66
+msgid "_Location:"
+msgstr "_Ort:"
+
+#: src/mn-autodetect-mailbox-properties.gob:72
+msgid "_Browse..."
+msgstr "_Durchsuchen..."
+
+#: src/mn-autodetect-mailbox-properties.gob:79
+msgid "The URI of the mailbox"
+msgstr "Die Adresse des Postfachs"
+
+#: src/mn-autodetect-mailbox-properties.gob:116
+msgid "Select a File or Folder"
+msgstr "Wählen Sie eine Datei oder ein Verzeichnis"
+
+#: src/mn-blinking-image.gob:30
+msgid "Whether the image is blinking or not"
+msgstr "Legt fest, ob das Bild blinkt oder nicht"
+
+#: src/mn-client-session.c:196 src/mn-client-session.c:203
+#, c-format
+msgid "unable to read from server: %s"
+msgstr "Es konnte nicht vom Server gelesen werden: %s"
+
+#: src/mn-client-session.c:201
+msgid "unable to read from server: EOF"
+msgstr "Es konnte nicht vom Server gelesen werden: EOF"
+
+#: src/mn-client-session.c:213
+#, c-format
+msgid "unable to decode data using SASL: %s"
+msgstr "Die Daten konnten nicht per SASL dekodiert werden: %s"
+
+#: src/mn-client-session.c:284
+#, c-format
+msgid "resolving %s"
+msgstr "%s wird kontaktiert"
+
+#: src/mn-client-session.c:294
+#, c-format
+msgid "unable to resolve %s: %s"
+msgstr "%s konnte nicht kontaktiert werden: %s"
+
+#: src/mn-client-session.c:331
+#, c-format
+msgid "%s: unsupported address family"
+msgstr "%s: Adressfamilie wird nicht unterstützt"
+
+#: src/mn-client-session.c:338
+#, c-format
+msgid "%s: unable to create socket: %s"
+msgstr "%s: Socket konnte nciht erstellt werden: %s"
+
+#: src/mn-client-session.c:342
+#, c-format
+msgid "connecting to %s (%s) port %i"
+msgstr "Verbindung mit %s (%s) über Port %i wird hergestellt"
+
+#: src/mn-client-session.c:345
+#, c-format
+msgid "unable to connect: %s"
+msgstr "Es konnte nicht verbunden werden: %s"
+
+#: src/mn-client-session.c:350
+msgid "connected successfully"
+msgstr "Verbindung hergestellt"
+
+#. if reached, we couldn't find a working address
+#: src/mn-client-session.c:356
+#, c-format
+msgid "unable to connect to %s"
+msgstr "Es konnte keine Verbindung mit %s hergestellt werden"
+
+#: src/mn-client-session.c:372
+#, c-format
+msgid "unable to initialize the OpenSSL library: %s"
+msgstr "Die OpenSSL-Bibliothek konnte nicht initializiert werden: %s"
+
+#: src/mn-client-session.c:380
+#, fuzzy, c-format
+msgid "unable to create a SSL/TLS object: %s"
+msgstr "Es konnte kein SSL-Objekt erzeugt werden: %s"
+
+#: src/mn-client-session.c:386
+#, fuzzy, c-format
+msgid "unable to set the SSL/TLS file descriptor: %s"
+msgstr "Es konnte kein SSL-Dateideskriptor gesetzt werden: %s"
+
+#: src/mn-client-session.c:392
+#, fuzzy, c-format
+msgid "unable to perform the SSL/TLS handshake: %s"
+msgstr "Es konnte kein SSL-Dateideskriptor gesetzt werden: %s"
+
+#: src/mn-client-session.c:398
+msgid "untrusted server"
+msgstr ""
+
+#: src/mn-client-session.c:402
+#, c-format
+msgid "a SSL/TLS layer is now active (%s, %s %i-bit)"
+msgstr ""
+
+#: src/mn-client-session.c:449
+#, c-format
+msgid "%s, fingerprint: %s"
+msgstr ""
+
+#: src/mn-client-session.c:478
+msgid "missing certificate"
+msgstr ""
+
+#: src/mn-client-session.c:504
+#, c-format
+msgid ""
+"Mail Notification was unable to trust \"%s\" (%s). It is possible that "
+"someone is intercepting your communication to obtain your confidential "
+"information.\n"
+"\n"
+"You should only connect to the server if you are certain you are connected "
+"to \"%s\". If you choose to connect to the server, this message will not be "
+"shown again."
+msgstr ""
+
+#: src/mn-client-session.c:521
+msgid "Connect to untrusted server?"
+msgstr ""
+
+#: src/mn-client-session.c:526
+msgid "Co_nnect"
+msgstr ""
+
+#: src/mn-client-session.c:584
+#, c-format
+msgid "response \"%s\" is not valid in current context"
+msgstr "Die Antwort »%s« ist in diesem Kontext nicht zugelassen"
+
+#: src/mn-client-session.c:610
+#, c-format
+msgid "unable to parse response \"%s\""
+msgstr "Die Antwort »%s« konnte nicht analysiert werden"
+
+#: src/mn-client-session.c:657
+#, c-format
+msgid "unable to encode data using SASL: %s"
+msgstr "Die Daten konnten nicht per SASL kodiert werden: %s"
+
+#: src/mn-client-session.c:688 src/mn-client-session.c:695
+#, c-format
+msgid "unable to write to server: %s"
+msgstr "Es konnte nicht auf den Server geschrieben werden: %s"
+
+#: src/mn-client-session.c:693
+msgid "unable to write to server: EOF"
+msgstr "Es konnte nicht auf den Server geschrieben werden: EOF"
+
+#: src/mn-client-session.c:725
+#, c-format
+msgid "unable to encode Base64: %s"
+msgstr "Es konnte nicht mit Base64 kodiert werden: %s"
+
+#: src/mn-client-session.c:828
+#, c-format
+msgid "unable to initialize the SASL library: %s"
+msgstr "Die SASL-Bibliothek konnte nicht initializiert werden: %s"
+
+#: src/mn-client-session.c:837
+#, c-format
+msgid "unable to retrieve local address of socket: %s"
+msgstr "Die lokale Adresse des Socket konnte nicht herausgefunden werden: %s"
+
+#: src/mn-client-session.c:843
+#, c-format
+msgid "unable to retrieve remote address of socket: %s"
+msgstr ""
+"Die entfernte Adresse des Socket konnte nicht herausgefunden werden: %s"
+
+#: src/mn-client-session.c:877
+#, c-format
+msgid "warning: unable to set SASL security properties: %s"
+msgstr ""
+"Warnung: Die SASL-Sicherheitseigenschaften konnten nicht gesetzt werden: %s"
+
+#: src/mn-client-session.c:916
+msgid ""
+"unable to start SASL authentication: SASL asked for something we did not know"
+msgstr ""
+"Die SASL-Authentifizierung konnte nicht gestartet werden: es wurde eine "
+"unbekannte Anfrage von SASL gestellt"
+
+#: src/mn-client-session.c:920
+#, c-format
+msgid "unable to start SASL authentication: %s"
+msgstr "Die SASL-Authentifizierung konnte nicht gestartet werden: %s"
+
+#: src/mn-client-session.c:924
+#, c-format
+msgid "unable to create a SASL connection: %s"
+msgstr "Es konnte keine Verbindung mit SASL erzeugt werden: %s"
+
+#: src/mn-client-session.c:974
+msgid "SASL asked for something we did not know, aborting SASL authentication"
+msgstr ""
+"Es wurde eine unbekannte Anfrage von SASL gestellt, SASL-Authentifizierung "
+"wird abgebrochen"
+
+#: src/mn-client-session.c:978
+#, c-format
+msgid "%s, aborting SASL authentication"
+msgstr "%s, SASL-Authentifizierung wird abgebrochen"
+
+#. compliance error
+#: src/mn-client-session.c:983
+#, c-format
+msgid "unable to decode Base64 input from server: %s"
+msgstr "Die Server-seitige Base64-Eingabe konnte nicht dekodiert werden: %s"
+
+#: src/mn-client-session.c:986
+msgid ""
+"the server sent a SASL challenge, but there was a pending initial SASL "
+"client response"
+msgstr ""
+
+#: src/mn-client-session.c:1000
+msgid ""
+"the server did not send a SASL challenge, but there was no pending initial "
+"SASL client response"
+msgstr ""
+
+#: src/mn-client-session.c:1023
+#, c-format
+msgid "a SASL security layer of strength factor %i is now active"
+msgstr "Die SASL-Sicherheitsebene der Stärke %i ist jetzt aktiv"
+
+#. a security layer is active but we can't retrieve maxoutbuf -> fatal
+#: src/mn-client-session.c:1028
+#, c-format
+msgid "unable to get SASL_MAXOUTBUF property: %s"
+msgstr "Der Wert SASL_MAXOUTBUF wurde nicht gefunden: %s"
+
+#: src/mn-client-session.c:1034
+#, c-format
+msgid "warning: unable to get SASL_SSF property: %s"
+msgstr "Warnung: Der Wert SASL_SSF wurde nicht gefunden: %s"
+
+#: src/mn-conf.c:109
+#, c-format
+msgid "recursively unsetting %s"
+msgstr ""
+
+#: src/mn-conf.c:113
+msgid "syncing the GConf database"
+msgstr ""
+
+#: src/mn-conf.c:116
+#, fuzzy
+msgid "completed"
+msgstr "Vollständig"
+
+#: src/mn-gmail-mailbox-properties.gob:77
+msgid "Your Gmail username"
+msgstr "Ihr Gmail-Benutzername"
+
+#: src/mn-gmail-mailbox-properties.gob:78
+msgid "Your Gmail password"
+msgstr "Ihr Gmail-Passwort"
+
+#: src/mn-gmail-mailbox.gob:220
+#, fuzzy
+msgid "logging in"
+msgstr "Anmelden bei"
+
+#: src/mn-gmail-mailbox.gob:239 src/mn-gmail-mailbox.gob:279
+#: src/mn-gmail-mailbox.gob:313 src/mn-gmail-mailbox.gob:418
+#, c-format
+msgid "unable to transfer data: %s"
+msgstr "Daten konnten nicht übertragen werden: %s"
+
+#: src/mn-gmail-mailbox.gob:265 src/mn-gmail-mailbox.gob:299
+#: src/mn-gmail-mailbox.gob:334
+msgid "login failed"
+msgstr "Anmeldung fehlgeschlagen"
+
+#: src/mn-gmail-mailbox.gob:328
+msgid "successfully logged in"
+msgstr "Anmeldung war erfolgreich"
+
+#: src/mn-gmail-mailbox.gob:406
+msgid "searching for unread mail"
+msgstr "Es wird nach ungelesenen Nachrichten gesucht"
+
+#: src/mn-gmail-mailbox.gob:427
+msgid "unable to parse Gmail data"
+msgstr "Die Gmail-Daten konnte nicht analysiert werden"
+
+#: src/mn-imap-mailbox-properties.gob:92
+msgid "Mailbox:"
+msgstr "Postfach:"
+
+#: src/mn-imap-mailbox-properties.gob:96
+msgid "in_box"
+msgstr "In_box"
+
+#: src/mn-imap-mailbox-properties.gob:107
+msgid "oth_er:"
+msgstr "_Anderer:"
+
+#: src/mn-imap-mailbox-properties.gob:122
+msgid "The hostname or IP address of the IMAP server"
+msgstr "Der Name oder die IP-Adresse des IMAP-Servers"
+
+#: src/mn-imap-mailbox-properties.gob:123
+msgid "Your username on the IMAP server"
+msgstr "Ihr Benutzername auf dem IMAP-Server"
+
+#: src/mn-imap-mailbox-properties.gob:124
+msgid "Your password on the IMAP server"
+msgstr "Ihr Passwort auf dem IMAP-Server"
+
+#: src/mn-imap-mailbox-properties.gob:125
+#: src/mn-imap-mailbox-properties.gob:126
+msgid "The port number of the IMAP server"
+msgstr "Die Port-Nummer auf dem IMAP-Server"
+
+#: src/mn-imap-mailbox-properties.gob:127
+msgid "The mailbox name"
+msgstr "Der Postfachname"
+
+#: src/mn-imap-mailbox.gob:112 src/mn-pop3-mailbox.gob:125
+#, fuzzy
+msgid "SSL/TLS support has not been compiled in"
+msgstr ""
+"Die Unterstützung für SSL wurde beim Erstellen des Programms nicht eingebaut"
+
+#: src/mn-imap-mailbox.gob:179
+msgid "server did not send capabilities"
+msgstr "Der Server hat seine Fähigkeiten nicht bekannt gegeben"
+
+#: src/mn-imap-mailbox.gob:292
+msgid "server advertised LOGINDISABLED, not using LOGIN authentication"
+msgstr ""
+"Der Server gibt LOGINDISABLED zurück, LOGIN-Authentifizierung wird nicht "
+"verwendet"
+
+#: src/mn-imap-mailbox.gob:293
+msgid "unable to login"
+msgstr "Anmeldung fehlgeschlagen"
+
+#. compliance error
+#: src/mn-imap-mailbox.gob:361
+msgid "server did not send status"
+msgstr "Der Server hat seinen Status nicht bekannt gegeben"
+
+#: src/mn-imap-mailbox.gob:583 src/mn-pop3-mailbox.gob:744
+msgid "unknown server error"
+msgstr "Unbekannter Server-Fehler"
+
+#: src/mn-imap-mailbox.gob:656 src/mn-pop3-mailbox.gob:210
+#, fuzzy
+msgid "server does not support in-band SSL/TLS"
+msgstr "Der Server unterstütz eine Authentifizierung per APOP nicht."
+
+#: src/mn-imap-mailbox.gob:675 src/mn-pop3-mailbox.gob:674
+msgid ""
+"a SASL authentication mechanism was selected but SASL support has not been "
+"compiled in"
+msgstr ""
+"Sie haben eine Authentifizierung mit SASL ausgewählt, jedoch wurde die "
+"Unterstützung für SASL beim Erstellen des Programms nicht eingebaut"
+
+#: src/mn-imap-mailbox.gob:683 src/mn-pop3-mailbox.gob:686
+#, c-format
+msgid "unknown authentication mechanism \"%s\""
+msgstr "Unbekannte Authentifizierungsmethode »%s«"
+
+#: src/mn-imap-mailbox.gob:701
+msgid "falling back to IMAP LOGIN authentication"
+msgstr "Es wird auf die Authentifizierung per IMAP LOGIN zurückgegriffen"
+
+#: src/mn-imap-mailbox.gob:705 src/mn-pop3-mailbox.gob:720
+msgid "authentication failed"
+msgstr "Authentifizierung fehlgeschlagen"
+
+#: src/mn-mail-icon.gob:81
+msgid "_Update"
+msgstr "_Aktualisieren"
+
+#: src/mn-mail-icon.gob:87
+msgid "R_emove From Notification Area"
+msgstr "Aus dem Benachrichtigungsfeld entfernen"
+
+#: src/mn-mail-icon.gob:172
+#, c-format
+msgid "_Run %s"
+msgstr "%s a_usführen"
+
+#: src/mn-mail-icon.gob:173
+msgid "_Run Default Action"
+msgstr "_Standard Aktion ausführen"
+
+#: src/mn-mailbox-properties-dialog.c:109
+msgid "Add a Mailbox"
+msgstr "Ein Postfach hinzufügen"
+
+#: src/mn-mailbox-properties-dialog.c:331
+#, c-format
+msgid "%s Properties"
+msgstr "%s Eigenschaften"
+
+#: src/mn-mailbox-properties-util.c:77
+msgid "_Username:"
+msgstr "Ben_utzername:"
+
+#: src/mn-mailbox-properties-util.c:87
+msgid "_Password:"
+msgstr "_Passwort:"
+
+#: src/mn-mailbox-properties-util.c:154
+msgid "Connection type:"
+msgstr "Verbindungsart:"
+
+#: src/mn-mailbox-properties-util.c:161
+msgid "Port:"
+msgstr "Port:"
+
+#: src/mn-mailbox-properties-util.c:189
+msgid "_Authentication mechanism:"
+msgstr "_Authentifizierungsmethode:"
+
+#: src/mn-mailbox-properties.c:63
+msgid "Label"
+msgstr "Bezeichnung"
+
+#: src/mn-mailbox-properties.c:64
+msgid "The marked up text to show in the type combo box"
+msgstr ""
+
+#: src/mn-mailbox-properties.c:69
+msgid "Size group"
+msgstr ""
+
+#: src/mn-mailbox-properties.c:70
+msgid "A GtkSizeGroup for aligning control labels"
+msgstr ""
+
+#: src/mn-mailbox-properties.c:75
+msgid "Complete"
+msgstr "Vollständig"
+
+#: src/mn-mailbox-properties.c:76
+msgid "Whether the properties are completely filled or not"
+msgstr "Legt fest, ob die Einstellungen vollständig ausgefüllt sind"
+
+#: src/mn-mailbox-view.gob:254
+msgid "Mailbox"
+msgstr "Postfach"
+
+#: src/mn-mailbox-view.gob:268
+msgid "Format"
+msgstr "Protokoll"
+
+#: src/mn-mailbox-view.gob:543
+msgid "Unable to add mailbox"
+msgstr "Postfach konnte nicht hinzugefügt werden"
+
+#: src/mn-mailbox-view.gob:543
+msgid "The mailbox is already in the list."
+msgstr "Dieses Postfach exisitiert bereits in Ihrer Liste."
+
+#: src/mn-mailbox.gob:122
+msgid "The mailbox URI"
+msgstr "Die Postfachadresse"
+
+#: src/mn-mailbox.gob:133
+msgid "The mailbox human-readable name"
+msgstr "Der lesbare Postfachname"
+
+#: src/mn-mailbox.gob:137
+msgid "Whether the mailbox has to be manually checked or not"
+msgstr "Legt fest, ob das Postfach manuell überprüft werden soll"
+
+#: src/mn-mailbox.gob:142
+msgid "Whether the mailbox has new mail or not"
+msgstr "Legt fest, ob das Postfach neue Nachrichten enthält"
+
+#: src/mn-mailbox.gob:147
+msgid "The mailbox error, if any"
+msgstr "Der Postfachfehler, falls vorhanden"
+
+#: src/mn-mailbox.gob:251
+msgid "does not exist"
+msgstr "existiert nicht"
+
+#: src/mn-mailbox.gob:287
+msgid "unknown format"
+msgstr "unbekanntes Format"
+
+#: src/mn-mailbox.gob:355
+#, c-format
+msgid "unable to monitor %s: %s"
+msgstr "%s konnte nicht überwacht werden: %s"
+
+#: src/mn-mailbox.gob:369
+#, fuzzy, c-format
+msgid ""
+"As a fallback, they will be checked every %i second (this delay is "
+"configurable from the Properties Dialog)."
+msgid_plural ""
+"As a fallback, they will be checked every %i seconds (this delay is "
+"configurable from the Properties Dialog)."
+msgstr[0] ""
+"Als Rücksicherung werden die Postfächer alle %i Sekunden überprüft (Dieser "
+"Wert kann über den Einstellungen-Dialog angepasst werden).Als Rücksicherung "
+"werden die Postfächer alle %i Sekunden überprüft (Dieser Wert kann über den "
+"Einstellungen-Dialog angepasst werden)."
+msgstr[1] ""
+"Als Rücksicherung werden die Postfächer alle %i Sekunden überprüft (Dieser "
+"Wert kann über den Einstellungen-Dialog angepasst werden).Als Rücksicherung "
+"werden die Postfächer alle %i Sekunden überprüft (Dieser Wert kann über den "
+"Einstellungen-Dialog angepasst werden)."
+
+#: src/mn-mailbox.gob:380
+#, fuzzy, c-format
+msgid ""
+"As a fallback, they will be checked every %i minute (this delay is "
+"configurable from the Properties Dialog)."
+msgid_plural ""
+"As a fallback, they will be checked every %i minutes (this delay is "
+"configurable from the Properties Dialog)."
+msgstr[0] ""
+"Als Rücksicherung werden die Postfächer alle %i Minuten überprüft (Dieser "
+"Wert kann über den Einstellungen-Dialog angepasst werden).Als Rücksicherung "
+"werden die Postfächer alle %i Minuten überprüft (Dieser Wert kann über den "
+"Einstellungen-Dialog angepasst werden)."
+msgstr[1] ""
+"Als Rücksicherung werden die Postfächer alle %i Minuten überprüft (Dieser "
+"Wert kann über den Einstellungen-Dialog angepasst werden).Als Rücksicherung "
+"werden die Postfächer alle %i Minuten überprüft (Dieser Wert kann über den "
+"Einstellungen-Dialog angepasst werden)."
+
+#: src/mn-mailbox.gob:391
+#, fuzzy, c-format
+msgid ""
+"As a fallback, they will be checked approximately every %i minute (this "
+"delay is configurable from the Properties Dialog)."
+msgid_plural ""
+"As a fallback, they will be checked approximately every %i minutes (this "
+"delay is configurable from the Properties Dialog)."
+msgstr[0] ""
+"Als Rücksicherung werden die Postfächer alle %i Minuten überprüft (Dieser "
+"Wert kann über den Einstellungen-Dialog angepasst werden).Als Rücksicherung "
+"werden die Postfächer alle %i Minuten überprüft (Dieser Wert kann über den "
+"Einstellungen-Dialog angepasst werden)."
+msgstr[1] ""
+"Als Rücksicherung werden die Postfächer alle %i Minuten überprüft (Dieser "
+"Wert kann über den Einstellungen-Dialog angepasst werden).Als Rücksicherung "
+"werden die Postfächer alle %i Minuten überprüft (Dieser Wert kann über den "
+"Einstellungen-Dialog angepasst werden)."
+
+#: src/mn-mailbox.gob:405
+msgid "A monitoring error has occurred"
+msgstr "Bei der Überwachung ist ein Fehler aufgetreten"
+
+#: src/mn-mailbox.gob:406
+#, fuzzy, c-format
+msgid ""
+"Mail Notification was unable to enable immediate notification for one or "
+"more mailboxes. %s"
+msgstr ""
+"Die E-Mail-Eingangsüberwachung konnte die automatische Benachrichtigung für "
+"ein oder mehrere Postfächer nicht aktivieren: %s"
+
+#: src/mn-mailboxes.gob:143
+#, c-format
+msgid "%s is unsupported: %s"
+msgstr "%s wird nicht unterstützt: %s"
+
+#: src/mn-mailboxes.gob:170
+#, c-format
+msgid "%s has new mail"
+msgstr "%s hat neue Nachrichten"
+
+#: src/mn-mailboxes.gob:170
+#, c-format
+msgid "%s has no new mail"
+msgstr "%s hat keine neuen Nachrichten"
+
+#: src/mn-mailboxes.gob:186
+#, c-format
+msgid "%s reported an error: %s"
+msgstr "%s hat einen Fehler erzeugt: %s"
+
+#: src/mn-maildir-mailbox.gob:109
+#, c-format
+msgid "unable to open folder \"new\": %s"
+msgstr "Der Ordner »new« konnte nicht geöffnet werden: %s"
+
+#: src/mn-maildir-mailbox.gob:137
+#, c-format
+msgid "unable to close folder \"new\": %s"
+msgstr "Der Ordner »new« konnte nicht geschlossen werden: %s"
+
+#: src/mn-maildir-mailbox.gob:140
+#, c-format
+msgid "error while reading folder \"new\": %s"
+msgstr "Fehler beim Lesen des Ordners »new«: %s"
+
+#: src/mn-main.c:85
+#, c-format
+msgid "Compiled-in mailbox backends: %s\n"
+msgstr "Eingebaute Postfacharten: %s\n"
+
+#: src/mn-main.c:103
+#, c-format
+msgid "Compiled-in features: %s\n"
+msgstr "Eingebaute Programmfähigkeiten: %s\n"
+
+#: src/mn-main.c:133
+msgid "Enable informational output"
+msgstr "Ausgabe von Informationen aktivieren"
+
+#: src/mn-main.c:142
+msgid "List compiled-in features and exit"
+msgstr "Eingebaute Programmfähigkeiten anzeigen und beenden"
+
+#: src/mn-main.c:151
+msgid "Display the properties dialog"
+msgstr "Den Dialog zum Einstellen der E-Mail-Eingangsüberwachung anzeigen"
+
+#: src/mn-main.c:160
+msgid "Display the about dialog"
+msgstr "Den Info-Dialog anzeigen"
+
+#: src/mn-main.c:169
+msgid "Update the mail status"
+msgstr "Nach neuen Nachrichten sehen"
+
+#: src/mn-main.c:178
+msgid "Report the mail status"
+msgstr "Den aktuellen Nachrichten anzeigen"
+
+#: src/mn-main.c:187
+msgid "Unset obsolete GConf configuration and exit"
+msgstr ""
+
+#.
+#. * We can't use mn_error_dialog() because gtk_init() has not been
+#. * called yet.
+#.
+#: src/mn-main.c:213
+msgid "multi-threading is not available"
+msgstr "Multi-Threading steht nicht zur Verfügung"
+
+#: src/mn-main.c:258
+msgid ""
+"Bonobo could not locate the automation object. Please check your Mail "
+"Notification installation."
+msgstr ""
+"Bonobo konnte das Automatisierungsobjekt nicht finden. Bitte überprüfen Sie "
+"Ihre Installation der E-Mail-Eingangsüberwachung."
+
+#: src/mn-main.c:263
+msgid "Unable to initialize the GnomeVFS library."
+msgstr "Die GnomeVFS-Bibliothek konnte nicht initializiert werden."
+
+#: src/mn-main.c:285
+msgid "updating the mail status"
+msgstr "Nachrichtenstatus wird aktualisiert"
+
+#: src/mn-main.c:301
+msgid "Mail Notification is already running"
+msgstr "Die E-Mail-Eingangsüberwachung ist bereits aktiv"
+
+#: src/mn-main.c:308
+msgid ""
+"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
+"Please check your Mail Notification installation."
+msgstr ""
+"Bonobo konnte die Datei GNOME_MailNotification_Automation.server nicht "
+"finden. Bitte überprüfen Sie Ihre Installation der E-Mail-"
+"Eingangsüberwachung."
+
+#: src/mn-main.c:312
+msgid ""
+"Bonobo was unable to register the automation server. Please check your Mail "
+"Notification installation."
+msgstr ""
+"Bonobo konnte den Automatisierungs-Server nicht registrieren.Bitte "
+"überprüfen Sie Ihre Installation der E-Mail-Eingangsüberwachung."
+
+#: src/mn-mbox-mailbox.gob:171
+#, c-format
+msgid "error while reading mailbox: %s"
+msgstr "Postfach konnte nicht neu geladen werden: %s"
+
+#: src/mn-mbox-mailbox.gob:179
+#, c-format
+msgid "unable to open mailbox: %s"
+msgstr "Postfach konnte nicht geöffnet werden: %s"
+
+#: src/mn-mh-mailbox.gob:122
+#, c-format
+msgid "error while reading .mh_sequences: %s"
+msgstr "Fehler beim lesen der .mh_sequences: %s"
+
+#: src/mn-mh-mailbox.gob:130
+#, c-format
+msgid "unable to open .mh_sequences: %s"
+msgstr ".mh_sequences konnten nicht geöffnet werden: %s"
+
+#: src/mn-pending-mailbox.gob:33
+msgid "detecting"
+msgstr "ermitteln"
+
+#: src/mn-pi-mailbox-properties.gob:74
+msgid "_Hostname:"
+msgstr "_Server:"
+
+#: src/mn-pi-mailbox-properties.gob:92
+msgid "_Details"
+msgstr "_Details"
+
+#: src/mn-pi-mailbox-properties.gob:104
+msgid "sta_ndard"
+msgstr "Sta_ndard"
+
+#: src/mn-pi-mailbox-properties.gob:114
+msgid "_in-band SSL/TLS"
+msgstr ""
+
+#: src/mn-pi-mailbox-properties.gob:124
+msgid "SSL/TLS on sepa_rate port"
+msgstr ""
+
+#: src/mn-pop3-mailbox-properties.gob:84
+msgid "The hostname or IP address of the POP3 server"
+msgstr "Der Name oder die IP-Adresse des POP3-Servers"
+
+#: src/mn-pop3-mailbox-properties.gob:85
+msgid "Your username on the POP3 server"
+msgstr "Ihr Benutzername für diesen POP3-Server"
+
+#: src/mn-pop3-mailbox-properties.gob:86
+msgid "Your password on the POP3 server"
+msgstr "Ihr Passwort für diesen POP3-Server"
+
+#: src/mn-pop3-mailbox-properties.gob:87 src/mn-pop3-mailbox-properties.gob:88
+msgid "The port number of the POP3 server"
+msgstr "Die Port-Nummer des POP3-Servers"
+
+#: src/mn-pop3-mailbox.gob:256
+msgid "invalid arguments for the LOGIN-DELAY capability"
+msgstr "Ungültige Argumente für die Anmeldeverzögerung"
+
+#: src/mn-pop3-mailbox.gob:523
+#, c-format
+msgid "honouring LOGIN-DELAY, sleeping for %i second"
+msgid_plural "honouring LOGIN-DELAY, sleeping for %i seconds"
+msgstr[0] ""
+"Anmeldeverzögerung wird berücksichtigt, es wird für eine Sekunde gewartet"
+msgstr[1] ""
+"Anmeldeverzögerung wird berücksichtigt, es wird für %i Sekunden gewartet"
+
+#: src/mn-pop3-mailbox.gob:682
+msgid "server does not support APOP authentication"
+msgstr "Der Server unterstütz eine Authentifizierung per APOP nicht."
+
+#: src/mn-pop3-mailbox.gob:710
+msgid "falling back to APOP authentication"
+msgstr "Es wird auf Authentifizierung mit APOP zurück gegriffen."
+
+#: src/mn-pop3-mailbox.gob:715
+msgid "falling back to USER/PASS authentication"
+msgstr ""
+"Es wird auf Authentifizierung per Nutzername und Passwort zurück gegriffen."
+
+#: src/mn-properties.c:151
+msgid "No mailbox selected."
+msgstr "Kein Postfach ausgewählt."
+
+#: src/mn-properties.c:156
+#, c-format
+msgid "%i mailbox selected."
+msgid_plural "%i mailboxes selected."
+msgstr[0] "Ein Posfach ausgewählt."
+msgstr[1] "%i Postfächer ausgewählt."
+
+#: src/mn-shell.gob:204
+msgid "A command error has occurred"
+msgstr "Es ist ein Fehler beim Ausführen des Befehls aufgetreten"
+
+#: src/mn-shell.gob:205
+#, c-format
+msgid "Unable to execute double-clicked command: %s."
+msgstr ""
+"Der Befehl für einen Symboldoppelklick konnte nicht ausgeführt werden: %s."
+
+#: src/mn-shell.gob:292
+msgid "The following mailbox has new mail:\n"
+msgid_plural "The following mailboxes have new mail:\n"
+msgstr[0] "Dieses Postfach hat neue Nachrichten:\n"
+msgstr[1] "Diese Postfächer haben neue Nachrichten:\n"
+
+#: src/mn-shell.gob:296
+msgid "You have no new mail."
+msgstr "Sie haben keine neuen Nachrichten."
+
+#: src/mn-shell.gob:299
+msgid "The following mailbox reported an error:\n"
+msgid_plural "The following mailboxes reported an error:\n"
+msgstr[0] "Das folgende Postfach hat einen Fehler ausgegeben:\n"
+msgstr[1] "Die folgenden Postfächer haben einen Fehler ausgegeben:\n"
+
+#: src/mn-shell.gob:304
+msgid "The following mailbox is unsupported:\n"
+msgid_plural "The following mailboxes are unsupported:\n"
+msgstr[0] "Das folgende Postfach wird nicht unterstützt:\n"
+msgstr[1] "Die folgenden Postfächer werden nicht unterstützt:\n"
+
+#: src/mn-shell.gob:320
+msgid "You have new mail."
+msgstr "Sie haben neue Nachrichten."
+
+#: src/mn-shell.gob:330
+msgid "A command error has occurred in Mail Notification"
+msgstr ""
+"Es ist ein Fehler beim Ausführen eines Befehls in der E-Mail-"
+"Eingangsüberwachung aufgetreten."
+
+#: src/mn-shell.gob:331
+#, c-format
+msgid "Unable to execute new mail command: %s."
+msgstr "Der Befehl für neue E-Mails konnte nicht ausgeführt werden: %s."
+
+#: src/mn-ssl.c:79
+#, fuzzy
+msgid "unknown SSL/TLS error"
+msgstr "Unbekannter Server-Fehler"
+
+#: src/mn-stock.c:28
+msgid "Select _All"
+msgstr "_Alles auswählen"
+
+#: src/mn-sylpheed-mailbox.gob:93
+#, c-format
+msgid "unable to open folder: %s"
+msgstr "Ordner konnte nicht geöffnet werden: %s"
+
+#: src/mn-sylpheed-mailbox.gob:127
+#, c-format
+msgid "unable to close folder: %s"
+msgstr "Ordner konnte nicht geschlossen werden: %s"
+
+#: src/mn-sylpheed-mailbox.gob:130
+#, c-format
+msgid "error while reading folder: %s"
+msgstr "Fehler beim Lesen von Ordner: %s"
+
+#: src/mn-system-mailbox-properties.gob:32 src/mn-uri.gob:391
+msgid "System Mailbox"
+msgstr "Systempostfach"
+
+#: src/mn-system-mailbox-properties.gob:55
+#, c-format
+msgid "Your system mailbox (<span weight=\"bold\">%s</span>) will be used."
+msgstr ""
+"Es wird Ihr Systempostfach (<span weight=\"bold\">%s</span>) verwendet."
+
+#: src/mn-system-mailbox-properties.gob:62
+msgid ""
+"The location of your system mailbox could not be detected. Please set the "
+"MAIL environment variable."
+msgstr ""
+"Der Ort Ihres Systempostfachs wurde nicht erkannt. Bitte setzen Sie die "
+"Umgebungsvariable »MAIL«."
+
+#: src/mn-unsupported-mailbox.gob:31
+msgid "The reason why the mailbox is unsupported"
+msgstr "Der Grund weshalb dieses Postfach nicht unerstützt wird"
+
+#: src/mn-unsupported-mailbox.gob:38
+msgid "unsupported"
+msgstr "nicht unterstützt"
+
+#: src/mn-util.c:199
+#, c-format
+msgid "error loading image: %s"
+msgstr "Bild konnte nicht geladen werden: %s"
+
+#: src/mn-util.c:237
+#, c-format
+msgid "widget %s not found in interface %s"
+msgstr "Widget %s konnte nicht in Interface %s gefunden werden"
+
+#: src/mn-util.c:355
+msgid "received an invalid URI list"
+msgstr "Es wurde eine ungültige Adressliste erhalten"
+
+#: src/mn-util.c:391
+msgid "received an invalid Mozilla URL"
+msgstr "Es wurde eine ungültige Mozilla-Adresse erhalten"
+
+#: src/mn-util.c:484
+msgid "Unable to display help"
+msgstr "Die Hilfe kann nicht angezeigt werden"
+
+#: src/mn-util.c:498
+#, c-format
+msgid "Unable to create a thread: %s."
+msgstr "Es konnte kein Thread erzeugt werden: %s."
+
+#: src/mn-util.c:701
+msgid "A fatal error has occurred in Mail Notification"
+msgstr ""
+"Ein schwerwiegender Fehler ist beim Ausführen der E-Mail-Eingangsüberwachung "
+"aufgetreten"
+
+#: ui/mailbox-properties.glade.h:1
+msgid "_Mailbox type:"
+msgstr "_Art des Postfachs:"
+
+#: ui/properties.glade.h:1
+msgid " "
+msgstr " "
+
+#: ui/properties.glade.h:2
+msgid "*"
+msgstr "*"
+
+#: ui/properties.glade.h:3
+msgid "<span weight=\"bold\">Commands</span>"
+msgstr "<span weight=\"bold\">Befehle</span>"
+
+#: ui/properties.glade.h:4
+msgid "<span weight=\"bold\">General</span>"
+msgstr "<span weight=\"bold\">Allgemein</span>"
+
+#: ui/properties.glade.h:5
+msgid "<span weight=\"bold\">Mailboxes</span>"
+msgstr "<span weight=\"bold\">Postfächer</span>"
+
+#: ui/properties.glade.h:6
+msgid "Mail Notification Properties"
+msgstr "Einstellung der E-Mail-Eingangsüberwachung"
+
+#: ui/properties.glade.h:7
+msgid "The amount of time to wait between mail checks"
+msgstr "Die Zeit die zwischen zwei Überprüfungen auf neue Nachrichten vergeht"
+
+#: ui/properties.glade.h:8
+msgid "The command to run when new mail arrives"
+msgstr ""
+"Geben Sie hier den Befehl ein, der ausgeführt wird sobald eine neue "
+"Nachricht eintrifft."
+
+#: ui/properties.glade.h:9
+msgid "The command to run when the icon is double-clicked"
+msgstr ""
+"Geben Sie hier den Befehl ein, der ausgeführt wird sobald das "
+"Benachrichtigungssymbol doppelt angeklickt wird."
+
+#: ui/properties.glade.h:10
+msgid "When _new mail arrives:"
+msgstr "Wenn neue Nachricht _eintrifft:"
+
+#: ui/properties.glade.h:11
+msgid "When double-click_ed:"
+msgstr "Wenn _doppelt angeklickt:"
+
+#: ui/properties.glade.h:12
+#, fuzzy
+msgid "Whether the status icon should blink on errors or not"
+msgstr "Legt fest, ob das Bild blinkt oder nicht"
+
+#: ui/properties.glade.h:13
+msgid "Whether to run a command when new mail arrives or not"
+msgstr ""
+"Wenn diese Option ausgewählt ist, können Sie einen Befehl angeben der "
+"ausgeführt wird, sobald eine neue Nachricht eintrifft."
+
+#: ui/properties.glade.h:14
+msgid "Whether to run a command when the icon is double-clicked or not"
+msgstr ""
+"Wenn diese Option ausgewählt ist, können Sie einen Befehl angeben der "
+"ausgeführt wird, sobald das Benachrichtigungssymbol doppelt angeklickt wird."
+
+#: ui/properties.glade.h:15
+#, fuzzy
+msgid ""
+"Whether to start Mail Notification when you log into your GNOME session or "
+"not"
+msgstr ""
+"Legt fest, ob die E-Mail-Eingangsüberwachnung schon einmal gestartet wurde."
+
+#: ui/properties.glade.h:16
+msgid "_Blink on errors"
+msgstr ""
+
+#: ui/properties.glade.h:17
+msgid "_Delay between mail checks:"
+msgstr "_Nach neuen Nachrichten sehen alle:"
+
+#: ui/properties.glade.h:18
+#, fuzzy
+msgid "_Start Mail Notification on GNOME login"
+msgstr ""
+"Ein Benachrichtigungssymbol das erscheint, wenn neue Nachrichten in Ihren "
+"Postfächern liegen."
+
+#: ui/properties.glade.h:19
+msgid "minutes"
+msgstr "Minuten"
+
+#: ui/properties.glade.h:20
+msgid "seconds"
+msgstr "Sekunden"
+
+#: ui/welcome.glade.h:1
+#, fuzzy
+msgid ""
+"<span weight=\"bold\" size=\"larger\">First startup</span>\n"
+"\n"
+"Mail Notification has been loaded successfully.\n"
+"\n"
+"Since this is the first time you run Mail Notification, you might want to "
+"configure it.\n"
+"\n"
+"Note: this message will not be shown anymore. To configure Mail Notification "
+"again, choose <span weight=\"bold\">Applications</span> → <span weight=\"bold"
+"\">Desktop Preferences</span> → <span weight=\"bold\">Mail Notification</"
+"span> (or on some systems <span weight=\"bold\">Applications → Preferences → "
+"More Preferences → Mail Notification</span>)."
+msgstr ""
+"<span weight=\"bold\" size=\"larger\">Erster Start</span>\n"
+"\n"
+"Die E-Mail-Eingangsüberwachung wurde erfolgreich geladen.\n"
+"\n"
+"Da dies das erste Mal ist, dass Sie die E-Mail-Eingangsüberwachnung starten, "
+"möchten Sie vielleicht einige Einstellungen vornehmen.\n"
+"\n"
+"Hinweis: Diese Meldung wird nicht erneut angezeigt. Um die E-Mail-"
+"Eingangsüberwachnung zu einem später Zeitpunkt einzustellen, starten Sie "
+"bitte <span weight=\"bold\">Anwendungen</span> → <span weight=\"bold"
+"\">Desktop-Einstellungen</span> → <span weight=\"bold\">E-Mail-"
+"Eingangsüberwachnung</span>."
+
+#: ui/welcome.glade.h:8
+msgid "_Configure Mail Notification"
+msgstr "Die E-Mail-Eingangsüberwachung anpassen"
+
+#: ui/welcome.glade.h:9
+msgid "_Skip configuration"
+msgstr "Konfiguration über_springen"
+
+#~ msgid "unable to parse Gmail URI"
+#~ msgstr "Die Gmail-Adresse konnte nicht analysiert werden"
+
+#~ msgid "unable to parse IMAP URI"
+#~ msgstr "Die IMAP-Adresse konnte nicht analysiert werden"
+
+#~ msgid ""
+#~ "As a fallback, they will be checked approximately every %i minute (this "
+#~ "delay is configurable from the Properties Dialog).As a fallback, they "
+#~ "will be checked approximately every %i minutes (this delay is "
+#~ "configurable from the Properties Dialog)."
+#~ msgstr ""
+#~ "Als Rücksicherung werden die Postfächer durchschnittlich alle %i Minuten "
+#~ "überprüft (Dieser Wert kann über den Einstellungen-Dialog angepasst "
+#~ "werden).Als Rücksicherung werden die Postfächer durchschnittlich alle %i "
+#~ "Minuten überprüft (Dieser Wert kann über den Einstellungen-Dialog "
+#~ "angepasst werden)."
+
+#~ msgid "_SSL"
+#~ msgstr "_SSL"
+
+#~ msgid "unable to parse POP3 URI"
+#~ msgstr "POP3-Adresse konnte nicht analysiert werden"
diff --git a/po/fr.gmo b/po/fr.gmo
Binary files differ.
diff --git a/po/fr.po b/po/fr.po
@@ -8,10 +8,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: mail-notification 0.6.1\n"
+"Project-Id-Version: mail-notification 0.6.2\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-08-19 00:12+0200\n"
-"PO-Revision-Date: 2004-08-19 00:04+0200\n"
+"POT-Creation-Date: 2004-09-09 01:43+0200\n"
+"PO-Revision-Date: 2004-09-09 01:37+0200\n"
"Last-Translator: Jean-Yves Lefort <jylefort@brutele.be>\n"
"Language-Team: Jean-Yves Lefort <jylefort@brutele.be>\n"
"MIME-Version: 1.0\n"
@@ -34,7 +34,7 @@ msgstr "Configurer la Notification de Courrier"
#: data/mail-notification-properties.desktop.in.h:2
#: data/mail-notification.desktop.in.h:2
#: data/mail-notification.soundlist.in.h:1 src/mn-about-dialog.gob:38
-#: src/mn-mail-icon.gob:160 src/mn-main.c:212
+#: src/mn-mail-icon.gob:160 src/mn-main.c:221
msgid "Mail Notification"
msgstr "Notification de Courrier"
@@ -43,84 +43,115 @@ msgid "Get notified when new mail arrives"
msgstr "Etre notifié lorsque du nouveau courrier arrive"
#: data/mail-notification.schemas.in.h:1
+msgid "Blink on errors"
+msgstr "Clignoter lors d'erreurs"
+
+#: data/mail-notification.schemas.in.h:2
msgid "Delay between mail checks (minutes part)."
msgstr "Délai entre les vérifications de courrier (partie minutes)."
-#: data/mail-notification.schemas.in.h:2
+#: data/mail-notification.schemas.in.h:3
msgid "Delay between mail checks (seconds part)."
msgstr "Délai entre les vérifications de courrier (partie secondes)."
-#: data/mail-notification.schemas.in.h:3
+#: data/mail-notification.schemas.in.h:4
msgid "Double-clicked command"
msgstr "Commande associée au double-click"
-#: data/mail-notification.schemas.in.h:4
+#: data/mail-notification.schemas.in.h:5
+msgid "Fingerprints of trusted X509 certificates"
+msgstr "Empreintes digitales des certificats X509 de confiance"
+
+#: data/mail-notification.schemas.in.h:6
msgid "Has already been run"
msgstr "A déjà été exécuté"
-#: data/mail-notification.schemas.in.h:5
+#: data/mail-notification.schemas.in.h:7
msgid "Height of properties dialog"
msgstr "Hauteur de la boîte de dialogue contenant les propriétés"
-#: data/mail-notification.schemas.in.h:6
+#: data/mail-notification.schemas.in.h:8
msgid "Mailboxes list"
msgstr "Liste des boîtes aux lettres"
-#: data/mail-notification.schemas.in.h:7
+#: data/mail-notification.schemas.in.h:9
msgid "Minutes between mail checks"
msgstr "Minutes entre les vérifications de courrier"
-#: data/mail-notification.schemas.in.h:8
+#: data/mail-notification.schemas.in.h:10
msgid "New mail command"
msgstr "Commande de nouveau message"
-#: data/mail-notification.schemas.in.h:9
+#: data/mail-notification.schemas.in.h:11
msgid "Run a command when new mail arrives"
msgstr "Exécuter une commande lorsque du nouveau courrier arrive"
-#: data/mail-notification.schemas.in.h:10
+#: data/mail-notification.schemas.in.h:12
msgid "Run a command when the icon is double-clicked"
msgstr "Exécuter une commande lorsque l'îcone est double-cliquée"
-#: data/mail-notification.schemas.in.h:11
+#: data/mail-notification.schemas.in.h:13
msgid "Seconds between mail checks"
msgstr "Secondes entre les vérifications de courrier"
-#: data/mail-notification.schemas.in.h:12
+#: data/mail-notification.schemas.in.h:14
msgid "The command to run when new mail arrives."
msgstr "La commande à exécuter lorsque du nouveau courrier arrive."
-#: data/mail-notification.schemas.in.h:13
+#: data/mail-notification.schemas.in.h:15
msgid "The command to run when the icon is double-clicked."
msgstr "La commande à exécuter lorsque l'îcone est double-cliquée."
-#: data/mail-notification.schemas.in.h:14
+#: data/mail-notification.schemas.in.h:16
msgid "The height of the properties dialog in pixels."
msgstr "La hauteur de la boîte de dialogue contenant les propriétés en pixels."
-#: data/mail-notification.schemas.in.h:15
+#: data/mail-notification.schemas.in.h:17
msgid "The list of mailboxes to monitor."
msgstr "La liste des boîtes aux lettres à surveiller."
-#: data/mail-notification.schemas.in.h:16
+#: data/mail-notification.schemas.in.h:18
+msgid ""
+"The list of trusted SSL/TLS servers (hostname:port) lacking a X509 "
+"certificate."
+msgstr ""
+"La liste des serveurs SSL/TLS (hôte:port) de confiance auxquels il manque un "
+"certificat X509."
+
+#: data/mail-notification.schemas.in.h:19
+msgid ""
+"The list of trusted X509 certificates, represented by their MD5 fingerprint."
+msgstr ""
+"La liste des certificats X509 de confiance, représentés par leur empreinte "
+"digitale."
+
+#: data/mail-notification.schemas.in.h:20
msgid "The width of the properties dialog in pixels."
msgstr "La largeur de la boîte de dialogue contenant les propriétés en pixels."
-#: data/mail-notification.schemas.in.h:17
+#: data/mail-notification.schemas.in.h:21
+msgid "Trusted servers list"
+msgstr "Liste des serveurs de confiance"
+
+#: data/mail-notification.schemas.in.h:22
msgid "Whether Mail Notification has already been run or not."
msgstr "Si la Notification de Courrier a déjà été exécutée ou pas."
-#: data/mail-notification.schemas.in.h:18
+#: data/mail-notification.schemas.in.h:23
+msgid "Whether the status icon should blink on errors or not."
+msgstr "Si l'icône de status doit clignoter lors d'erreurs ou pas."
+
+#: data/mail-notification.schemas.in.h:24
msgid "Whether to run a command when new mail arrives or not."
msgstr ""
"Si une commande doit être exécutée lorsque du nouveau courrier arrive ou pas."
-#: data/mail-notification.schemas.in.h:19
+#: data/mail-notification.schemas.in.h:25
msgid "Whether to run a command when the icon is double-clicked or not."
msgstr ""
"Si une commande doit être exécutée lorsque l'îcone est double-cliquée ou pas."
-#: data/mail-notification.schemas.in.h:20
+#: data/mail-notification.schemas.in.h:26
msgid "Width of properties dialog"
msgstr "Largeur de la boîte de dialogue contenant les propriétés"
@@ -144,23 +175,23 @@ msgstr "Une Icône de Notification de Courrier"
msgid "Jean-Yves Lefort <jylefort@brutele.be>"
msgstr "Jean-Yves Lefort <jylefort@brutele.be>"
-#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:36
+#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:35
msgid "<span style=\"italic\">autodetect</span>"
msgstr "<span style=\"italic\">autodétecter</span>"
-#: src/mn-autodetect-mailbox-properties.gob:67
+#: src/mn-autodetect-mailbox-properties.gob:66
msgid "_Location:"
msgstr "_Emplacement:"
-#: src/mn-autodetect-mailbox-properties.gob:73
+#: src/mn-autodetect-mailbox-properties.gob:72
msgid "_Browse..."
msgstr "_Parcourir..."
-#: src/mn-autodetect-mailbox-properties.gob:80
+#: src/mn-autodetect-mailbox-properties.gob:79
msgid "The URI of the mailbox"
msgstr "L'URI de la boîte aux lettres"
-#: src/mn-autodetect-mailbox-properties.gob:117
+#: src/mn-autodetect-mailbox-properties.gob:116
msgid "Select a File or Folder"
msgstr "Sélectionnez un Fichier ou Dossier"
@@ -168,160 +199,210 @@ msgstr "Sélectionnez un Fichier ou Dossier"
msgid "Whether the image is blinking or not"
msgstr "Si l'image clignote ou pas"
-#: src/mn-client-session.c:195 src/mn-client-session.c:202
+#: src/mn-client-session.c:196 src/mn-client-session.c:203
#, c-format
msgid "unable to read from server: %s"
msgstr "impossible de lire depuis le serveur: %s"
-#: src/mn-client-session.c:200
+#: src/mn-client-session.c:201
msgid "unable to read from server: EOF"
msgstr "impossible de lire depuis le serveur: EOF"
-#: src/mn-client-session.c:212
+#: src/mn-client-session.c:213
#, c-format
msgid "unable to decode data using SASL: %s"
msgstr "impossible de décoder les données en utilisant SASL: %s"
-#: src/mn-client-session.c:286
+#: src/mn-client-session.c:284
#, c-format
msgid "resolving %s"
msgstr "résolution de %s en cours"
-#: src/mn-client-session.c:296
+#: src/mn-client-session.c:294
#, c-format
msgid "unable to resolve %s: %s"
msgstr "impossible de résoudre %s: %s"
-#: src/mn-client-session.c:333
+#: src/mn-client-session.c:331
#, c-format
msgid "%s: unsupported address family"
msgstr "%s: famille d'adresse non prise en charge"
-#: src/mn-client-session.c:340
+#: src/mn-client-session.c:338
#, c-format
msgid "%s: unable to create socket: %s"
msgstr "%s: impossible de créer un soquet: %s"
-#: src/mn-client-session.c:344
+#: src/mn-client-session.c:342
#, c-format
msgid "connecting to %s (%s) port %i"
msgstr "connection à %s (%s) port %i en cours"
-#: src/mn-client-session.c:347
+#: src/mn-client-session.c:345
#, c-format
msgid "unable to connect: %s"
msgstr "impossible de se connecter: %s"
-#: src/mn-client-session.c:352
+#: src/mn-client-session.c:350
msgid "connected successfully"
msgstr "connecté avec succès"
#. if reached, we couldn't find a working address
-#: src/mn-client-session.c:358
+#: src/mn-client-session.c:356
#, c-format
msgid "unable to connect to %s"
msgstr "impossible de se connecter à %s"
-#: src/mn-client-session.c:374
+#: src/mn-client-session.c:372
#, c-format
msgid "unable to initialize the OpenSSL library: %s"
msgstr "impossible d'initialiser la bibliothèque OpenSSL: %s"
-#: src/mn-client-session.c:382
+#: src/mn-client-session.c:380
+#, c-format
+msgid "unable to create a SSL/TLS object: %s"
+msgstr "impossible de créer un objet SSL/TLS: %s"
+
+#: src/mn-client-session.c:386
+#, c-format
+msgid "unable to set the SSL/TLS file descriptor: %s"
+msgstr "impossible de spécifier le descripteur de fichier SSL/TLS: %s"
+
+#: src/mn-client-session.c:392
#, c-format
-msgid "unable to create a SSL object: %s"
-msgstr "impossible de créer un objet SSL: %s"
+msgid "unable to perform the SSL/TLS handshake: %s"
+msgstr "impossible d'accomplir la négotiation SSL/TLS: %s"
+
+#: src/mn-client-session.c:398
+msgid "untrusted server"
+msgstr "serveur non fiable"
-#: src/mn-client-session.c:388
+#: src/mn-client-session.c:402
#, c-format
-msgid "unable to set the SSL file descriptor: %s"
-msgstr "impossible de spécifier le descripteur de fichier SSL: %s"
+msgid "a SSL/TLS layer is now active (%s, %s %i-bit)"
+msgstr "une couche SSL/TLS est maintenant active (%s, %s %i-bit)"
+
+#: src/mn-client-session.c:449
+#, c-format
+msgid "%s, fingerprint: %s"
+msgstr "%s, empreinte digitale: %s"
+
+#: src/mn-client-session.c:478
+msgid "missing certificate"
+msgstr "certificat manquant"
+
+#: src/mn-client-session.c:504
+#, c-format
+msgid ""
+"Mail Notification was unable to trust \"%s\" (%s). It is possible that "
+"someone is intercepting your communication to obtain your confidential "
+"information.\n"
+"\n"
+"You should only connect to the server if you are certain you are connected "
+"to \"%s\". If you choose to connect to the server, this message will not be "
+"shown again."
+msgstr ""
+"La Notification de Courrier n'a pas été en mesure de faire confiance à \"%s"
+"\" (%s). Il est possible que quelqu'un soit en train d'intercepter votre "
+"communication afin d'obtenir vos informations confidentielles.\n"
+"\n"
+"Vous devriez vous connecter au serveur uniquement si vous êtes certain que "
+"vous êtes connecté à \"%s\". Si vous choisissez de vous connecter au "
+"serveur, ce message ne sera plus affiché."
+
+#: src/mn-client-session.c:521
+msgid "Connect to untrusted server?"
+msgstr "Se connecter au serveur non fiable?"
+
+#: src/mn-client-session.c:526
+msgid "Co_nnect"
+msgstr "Se co_nnecter"
-#: src/mn-client-session.c:443
+#: src/mn-client-session.c:584
#, c-format
msgid "response \"%s\" is not valid in current context"
msgstr "la réponse \"%s\" n'est pas valable dans le contexte actuel"
-#: src/mn-client-session.c:469
+#: src/mn-client-session.c:610
#, c-format
msgid "unable to parse response \"%s\""
msgstr "impossible d'interpréter la réponse \"%s\""
-#: src/mn-client-session.c:516
+#: src/mn-client-session.c:657
#, c-format
msgid "unable to encode data using SASL: %s"
msgstr "impossible d'encoder les données en utilisant SASL: %s"
-#: src/mn-client-session.c:545 src/mn-client-session.c:552
+#: src/mn-client-session.c:688 src/mn-client-session.c:695
#, c-format
msgid "unable to write to server: %s"
msgstr "impossible d'écrire vers le serveur: %s"
-#: src/mn-client-session.c:550
+#: src/mn-client-session.c:693
msgid "unable to write to server: EOF"
msgstr "impossible d'écrire vers le serveur: EOF"
-#: src/mn-client-session.c:582
+#: src/mn-client-session.c:725
#, c-format
msgid "unable to encode Base64: %s"
msgstr "impossible d'encoder en Base64: %s"
-#: src/mn-client-session.c:685
+#: src/mn-client-session.c:828
#, c-format
msgid "unable to initialize the SASL library: %s"
msgstr "impossible d'initialiser la bibliothèque SASL: %s"
-#: src/mn-client-session.c:694
+#: src/mn-client-session.c:837
#, c-format
msgid "unable to retrieve local address of socket: %s"
msgstr "impossible d'obtenir l'adresse locale du soquet: %s"
-#: src/mn-client-session.c:700
+#: src/mn-client-session.c:843
#, c-format
msgid "unable to retrieve remote address of socket: %s"
msgstr "impossible d'obtenir l'adresse distante du soquet: %s"
-#: src/mn-client-session.c:734
+#: src/mn-client-session.c:877
#, c-format
msgid "warning: unable to set SASL security properties: %s"
msgstr ""
"avertissement: impossible de spécifier les propriétés de sécurité SASL: %s"
-#: src/mn-client-session.c:773
+#: src/mn-client-session.c:916
msgid ""
"unable to start SASL authentication: SASL asked for something we did not know"
msgstr ""
"impossible de démarrer l'authentification SASL: SASL a demandé quelque chose "
"que nous ne connaissions pas"
-#: src/mn-client-session.c:777
+#: src/mn-client-session.c:920
#, c-format
msgid "unable to start SASL authentication: %s"
msgstr "impossible de démarrer l'authentification SASL: %s"
-#: src/mn-client-session.c:781
+#: src/mn-client-session.c:924
#, c-format
msgid "unable to create a SASL connection: %s"
msgstr "impossible de créer une connection SASL: %s"
-#: src/mn-client-session.c:831
+#: src/mn-client-session.c:974
msgid "SASL asked for something we did not know, aborting SASL authentication"
msgstr ""
"SASL a demandé quelque chose que nous ne connaissions pas, annulation de "
"l'authentification SASL"
-#: src/mn-client-session.c:835
+#: src/mn-client-session.c:978
#, c-format
msgid "%s, aborting SASL authentication"
msgstr "%s, annulation de l'authentification SASL"
#. compliance error
-#: src/mn-client-session.c:840
+#: src/mn-client-session.c:983
#, c-format
msgid "unable to decode Base64 input from server: %s"
msgstr "impossible de décoder l'entrée Base64 du serveur: %s"
-#: src/mn-client-session.c:843
+#: src/mn-client-session.c:986
msgid ""
"the server sent a SASL challenge, but there was a pending initial SASL "
"client response"
@@ -329,7 +410,7 @@ msgstr ""
"le serveur a envoyé un défi SASL, mais il y avait une réponse client SASL "
"initiale en attente"
-#: src/mn-client-session.c:857
+#: src/mn-client-session.c:1000
msgid ""
"the server did not send a SASL challenge, but there was no pending initial "
"SASL client response"
@@ -337,63 +418,68 @@ msgstr ""
"le serveur n'a pas envoyé de défi SASL, mais il n'y avait pas de réponse "
"client SASL initiale en attente"
-#: src/mn-client-session.c:880
+#: src/mn-client-session.c:1023
#, c-format
msgid "a SASL security layer of strength factor %i is now active"
msgstr ""
"une couche de sécurité SASL de facteur de force %i est maintenant active"
#. a security layer is active but we can't retrieve maxoutbuf -> fatal
-#: src/mn-client-session.c:885
+#: src/mn-client-session.c:1028
#, c-format
msgid "unable to get SASL_MAXOUTBUF property: %s"
msgstr "impossible d'obtenir la propriété SASL_MAXOUTBUF: %s"
-#: src/mn-client-session.c:891
+#: src/mn-client-session.c:1034
#, c-format
msgid "warning: unable to get SASL_SSF property: %s"
msgstr "avertissement: impossible d'obtenir la propriété SASL_SSF: %s"
-#: src/mn-dialog.c:108
-msgid "A fatal error has occurred in Mail Notification"
-msgstr "Une erreur fatale s'est produite dans la Notification de Courrier"
+#: src/mn-conf.c:109
+#, c-format
+msgid "recursively unsetting %s"
+msgstr "en train de supprimer récursivement %s"
-#: src/mn-gmail-mailbox-properties.gob:78
+#: src/mn-conf.c:113
+msgid "syncing the GConf database"
+msgstr "en train de synchroniser la base de données GConf"
+
+#: src/mn-conf.c:116
+msgid "completed"
+msgstr "terminé"
+
+#: src/mn-gmail-mailbox-properties.gob:77
msgid "Your Gmail username"
msgstr "Votre nom d'utilisateur Gmail"
-#: src/mn-gmail-mailbox-properties.gob:79
+#: src/mn-gmail-mailbox-properties.gob:78
msgid "Your Gmail password"
msgstr "Votre mot de passe Gmail"
-#: src/mn-gmail-mailbox.gob:65
-msgid "unable to parse Gmail URI"
-msgstr "impossible d'interpréter l'URI Gmail"
-
-#: src/mn-gmail-mailbox.gob:182
+#: src/mn-gmail-mailbox.gob:220
msgid "logging in"
msgstr "ouverture de session en cours"
-#: src/mn-gmail-mailbox.gob:201 src/mn-gmail-mailbox.gob:240
-#: src/mn-gmail-mailbox.gob:273 src/mn-gmail-mailbox.gob:377
+#: src/mn-gmail-mailbox.gob:239 src/mn-gmail-mailbox.gob:279
+#: src/mn-gmail-mailbox.gob:313 src/mn-gmail-mailbox.gob:418
#, c-format
msgid "unable to transfer data: %s"
msgstr "impossible de transférer des données: %s"
-#: src/mn-gmail-mailbox.gob:226 src/mn-gmail-mailbox.gob:259
-#: src/mn-gmail-mailbox.gob:293
+#: src/mn-gmail-mailbox.gob:265 src/mn-gmail-mailbox.gob:299
+#: src/mn-gmail-mailbox.gob:334
msgid "login failed"
msgstr "l'ouverture de session a échoué"
-#: src/mn-gmail-mailbox.gob:287
+#: src/mn-gmail-mailbox.gob:328
msgid "successfully logged in"
msgstr "ouverture de session effectuée avec succès"
-#: src/mn-gmail-mailbox.gob:365
+#: src/mn-gmail-mailbox.gob:406
msgid "searching for unread mail"
msgstr "recherche du courrier non lu"
-#: src/mn-gmail-mailbox.gob:384
+#: src/mn-gmail-mailbox.gob:427
msgid "unable to parse Gmail data"
msgstr "impossible d'interpréter les données Gmail"
@@ -409,76 +495,76 @@ msgstr "_boîte de réception"
msgid "oth_er:"
msgstr "autr_e:"
-#: src/mn-imap-mailbox-properties.gob:121
+#: src/mn-imap-mailbox-properties.gob:122
msgid "The hostname or IP address of the IMAP server"
msgstr "Le nom d'hôte ou adresse IP du serveur IMAP"
-#: src/mn-imap-mailbox-properties.gob:122
+#: src/mn-imap-mailbox-properties.gob:123
msgid "Your username on the IMAP server"
msgstr "Votre nom d'utilisateur sur le serveur IMAP"
-#: src/mn-imap-mailbox-properties.gob:123
+#: src/mn-imap-mailbox-properties.gob:124
msgid "Your password on the IMAP server"
msgstr "Votre mot de passe sur le serveur IMAP"
-#: src/mn-imap-mailbox-properties.gob:124
#: src/mn-imap-mailbox-properties.gob:125
+#: src/mn-imap-mailbox-properties.gob:126
msgid "The port number of the IMAP server"
msgstr "Le numéro de port du serveur IMAP"
-#: src/mn-imap-mailbox-properties.gob:126
+#: src/mn-imap-mailbox-properties.gob:127
msgid "The mailbox name"
msgstr "Le nom de la boîte aux lettres"
-#: src/mn-imap-mailbox.gob:124 src/mn-pop3-mailbox.gob:133
-msgid "SSL support has not been compiled in"
-msgstr "le support SSL n'a pas été inclus lors de la compilation"
-
-#: src/mn-imap-mailbox.gob:128
-msgid "unable to parse IMAP URI"
-msgstr "impossible d'interpréter l'URI IMAP"
+#: src/mn-imap-mailbox.gob:112 src/mn-pop3-mailbox.gob:125
+msgid "SSL/TLS support has not been compiled in"
+msgstr "le support SSL/TLS n'a pas été inclus lors de la compilation"
-#: src/mn-imap-mailbox.gob:195
+#: src/mn-imap-mailbox.gob:179
msgid "server did not send capabilities"
msgstr "le serveur n'a pas envoyé ses possibilités"
-#: src/mn-imap-mailbox.gob:267
+#: src/mn-imap-mailbox.gob:292
msgid "server advertised LOGINDISABLED, not using LOGIN authentication"
msgstr ""
"le serveur a annoncé LOGINDISABLED, pas d'utilisation de l'authentification "
"LOGIN"
-#: src/mn-imap-mailbox.gob:268
+#: src/mn-imap-mailbox.gob:293
msgid "unable to login"
msgstr "impossible d'ouvrir la session"
#. compliance error
-#: src/mn-imap-mailbox.gob:336
+#: src/mn-imap-mailbox.gob:361
msgid "server did not send status"
msgstr "le serveur n'a pas envoyé de status"
-#: src/mn-imap-mailbox.gob:554 src/mn-pop3-mailbox.gob:715
+#: src/mn-imap-mailbox.gob:583 src/mn-pop3-mailbox.gob:744
msgid "unknown server error"
msgstr "erreur serveur inconnue"
-#: src/mn-imap-mailbox.gob:625 src/mn-pop3-mailbox.gob:645
+#: src/mn-imap-mailbox.gob:656 src/mn-pop3-mailbox.gob:210
+msgid "server does not support in-band SSL/TLS"
+msgstr "le serveur ne supporte pas le mode SSL/TLS interne"
+
+#: src/mn-imap-mailbox.gob:675 src/mn-pop3-mailbox.gob:674
msgid ""
"a SASL authentication mechanism was selected but SASL support has not been "
"compiled in"
msgstr ""
-"un méchanisme d'authentification SASL a été sélectionné mais le support SASL "
+"un mécanisme d'authentification SASL a été sélectionné mais le support SASL "
"n'a pas été inclus lors de la compilation"
-#: src/mn-imap-mailbox.gob:633 src/mn-pop3-mailbox.gob:657
+#: src/mn-imap-mailbox.gob:683 src/mn-pop3-mailbox.gob:686
#, c-format
msgid "unknown authentication mechanism \"%s\""
-msgstr "méchanisme d'authentification inconnu \"%s\""
+msgstr "mécanisme d'authentification inconnu \"%s\""
-#: src/mn-imap-mailbox.gob:651
+#: src/mn-imap-mailbox.gob:701
msgid "falling back to IMAP LOGIN authentication"
msgstr "rétrogradation vers l'authentification IMAP LOGIN"
-#: src/mn-imap-mailbox.gob:655 src/mn-pop3-mailbox.gob:691
+#: src/mn-imap-mailbox.gob:705 src/mn-pop3-mailbox.gob:720
msgid "authentication failed"
msgstr "l'authentification a échoué"
@@ -508,25 +594,25 @@ msgstr "Ajouter une Boîte aux Lettres"
msgid "%s Properties"
msgstr "Propriétés de %s"
-#: src/mn-mailbox-properties-util.c:75
+#: src/mn-mailbox-properties-util.c:77
msgid "_Username:"
msgstr "_Nom d'utilisateur:"
-#: src/mn-mailbox-properties-util.c:79
+#: src/mn-mailbox-properties-util.c:87
msgid "_Password:"
msgstr "_Mot de passe:"
-#: src/mn-mailbox-properties-util.c:146
+#: src/mn-mailbox-properties-util.c:154
msgid "Connection type:"
msgstr "Type de connection:"
-#: src/mn-mailbox-properties-util.c:153
+#: src/mn-mailbox-properties-util.c:161
msgid "Port:"
msgstr "Port:"
-#: src/mn-mailbox-properties-util.c:180
+#: src/mn-mailbox-properties-util.c:189
msgid "_Authentication mechanism:"
-msgstr "Méchanisme d'_authentification:"
+msgstr "Mécanisme d'_authentification:"
#: src/mn-mailbox-properties.c:63
msgid "Label"
@@ -552,56 +638,56 @@ msgstr "Complet"
msgid "Whether the properties are completely filled or not"
msgstr "Si les propriétés sont complètement remplies ou pas"
-#: src/mn-mailbox-view.gob:91
-msgid "Unable to add mailbox"
-msgstr "Impossible d'ajouter la boîte aux lettres"
-
-#: src/mn-mailbox-view.gob:91
-msgid "The mailbox is already in the list."
-msgstr "La boîte aux lettres est déjà dans la liste."
-
-#: src/mn-mailbox-view.gob:283
+#: src/mn-mailbox-view.gob:254
msgid "Mailbox"
msgstr "Boîte aux lettres"
-#: src/mn-mailbox-view.gob:297
+#: src/mn-mailbox-view.gob:268
msgid "Format"
msgstr "Format"
-#: src/mn-mailbox.gob:88
+#: src/mn-mailbox-view.gob:543
+msgid "Unable to add mailbox"
+msgstr "Impossible d'ajouter la boîte aux lettres"
+
+#: src/mn-mailbox-view.gob:543
+msgid "The mailbox is already in the list."
+msgstr "La boîte aux lettres est déjà dans la liste."
+
+#: src/mn-mailbox.gob:122
msgid "The mailbox URI"
msgstr "L'URI de la boîte aux lettres"
-#: src/mn-mailbox.gob:98
+#: src/mn-mailbox.gob:133
msgid "The mailbox human-readable name"
msgstr "Le nom, lisible par un humain, de la boîte aux lettres"
-#: src/mn-mailbox.gob:102
+#: src/mn-mailbox.gob:137
msgid "Whether the mailbox has to be manually checked or not"
msgstr "Si la boîte aux lettres doit être vérifiée manuellement ou pas"
-#: src/mn-mailbox.gob:107
+#: src/mn-mailbox.gob:142
msgid "Whether the mailbox has new mail or not"
msgstr "Si la boîte aux lettres a du nouveau courrier ou pas"
-#: src/mn-mailbox.gob:112
+#: src/mn-mailbox.gob:147
msgid "The mailbox error, if any"
msgstr "L'erreur de la boîte aux lettres si il y en a une"
-#: src/mn-mailbox.gob:218
+#: src/mn-mailbox.gob:251
msgid "does not exist"
msgstr "n'existe pas"
-#: src/mn-mailbox.gob:255
+#: src/mn-mailbox.gob:287
msgid "unknown format"
msgstr "format inconnu"
-#: src/mn-mailbox.gob:316
+#: src/mn-mailbox.gob:355
#, c-format
msgid "unable to monitor %s: %s"
msgstr "impossible de surveiller %s: %s"
-#: src/mn-mailbox.gob:330
+#: src/mn-mailbox.gob:369
#, c-format
msgid ""
"As a fallback, they will be checked every %i second (this delay is "
@@ -616,7 +702,7 @@ msgstr[1] ""
"Comme solution de secours, elles seront vérifiées toutes les %i secondes (ce "
"délai est configurable depuis les Propriétés)."
-#: src/mn-mailbox.gob:341
+#: src/mn-mailbox.gob:380
#, c-format
msgid ""
"As a fallback, they will be checked every %i minute (this delay is "
@@ -631,7 +717,7 @@ msgstr[1] ""
"Comme solution de secours, elles seront vérifiées toutes les %i minutes (ce "
"délai est configurable depuis les Propriétés)."
-#: src/mn-mailbox.gob:352
+#: src/mn-mailbox.gob:391
#, c-format
msgid ""
"As a fallback, they will be checked approximately every %i minute (this "
@@ -646,60 +732,60 @@ msgstr[1] ""
"Comme solution de secours, elles seront vérifiées approximativement toutes "
"les %i minutes (ce délai est configurable depuis les Propriétés)."
-#: src/mn-mailbox.gob:366
+#: src/mn-mailbox.gob:405
msgid "A monitoring error has occurred"
msgstr "Une erreur de surveillance s'est produite"
-#: src/mn-mailbox.gob:367
+#: src/mn-mailbox.gob:406
#, c-format
msgid ""
-"Mail Notification was unable to enable automatic notification for one or "
+"Mail Notification was unable to enable immediate notification for one or "
"more mailboxes. %s"
msgstr ""
-"Notification de Courrier n'a pas été en mesure d'activer la notification "
-"automatique pour une ou plusieures boîtes aux lettres. %s"
+"La Notification de Courrier n'a pas été en mesure d'activer la notification "
+"immédiate pour une ou plusieures boîtes aux lettres. %s"
-#: src/mn-mailboxes.gob:130
+#: src/mn-mailboxes.gob:143
#, c-format
msgid "%s is unsupported: %s"
msgstr "%s n'est pas pris en charge: %s"
-#: src/mn-mailboxes.gob:157
+#: src/mn-mailboxes.gob:170
#, c-format
msgid "%s has new mail"
msgstr "%s a du nouveau courrier"
-#: src/mn-mailboxes.gob:157
+#: src/mn-mailboxes.gob:170
#, c-format
msgid "%s has no new mail"
msgstr "%s n'a pas de nouveau courrier"
-#: src/mn-mailboxes.gob:173
+#: src/mn-mailboxes.gob:186
#, c-format
msgid "%s reported an error: %s"
msgstr "%s a indiqué une erreur: %s"
-#: src/mn-maildir-mailbox.gob:98
+#: src/mn-maildir-mailbox.gob:109
#, c-format
msgid "unable to open folder \"new\": %s"
msgstr "impossible d'ouvrir le dossier \"new\": %s"
-#: src/mn-maildir-mailbox.gob:126
+#: src/mn-maildir-mailbox.gob:137
#, c-format
msgid "unable to close folder \"new\": %s"
msgstr "impossible de fermer le dossier \"new\": %s"
-#: src/mn-maildir-mailbox.gob:129
+#: src/mn-maildir-mailbox.gob:140
#, c-format
msgid "error while reading folder \"new\": %s"
msgstr "erreur lors de la lecture du dossier \"new\": %s"
-#: src/mn-main.c:86
+#: src/mn-main.c:85
#, c-format
msgid "Compiled-in mailbox backends: %s\n"
msgstr "Prises en charge de boîtes aux lettres disponibles: %s\n"
-#: src/mn-main.c:104
+#: src/mn-main.c:103
#, c-format
msgid "Compiled-in features: %s\n"
msgstr "Fonctionnalités disponibles: %s\n"
@@ -728,15 +814,19 @@ msgstr "Mettre à jour le status du courrier"
msgid "Report the mail status"
msgstr "Rapporter le status du courrier"
+#: src/mn-main.c:187
+msgid "Unset obsolete GConf configuration and exit"
+msgstr "Supprimer la configuration GConf obsolète et quitter"
+
#.
#. * We can't use mn_error_dialog() because gtk_init() has not been
#. * called yet.
#.
-#: src/mn-main.c:204
+#: src/mn-main.c:213
msgid "multi-threading is not available"
msgstr "le multi-threading n'est pas disponible"
-#: src/mn-main.c:243
+#: src/mn-main.c:258
msgid ""
"Bonobo could not locate the automation object. Please check your Mail "
"Notification installation."
@@ -744,19 +834,19 @@ msgstr ""
"Bonobo n'a pas pu localiser l'objet automation. Veuillez vérifier votre "
"installation de la Notification de Courrier."
-#: src/mn-main.c:248
+#: src/mn-main.c:263
msgid "Unable to initialize the GnomeVFS library."
msgstr "Impossible d'initialiser la bibliothèque GnomeVFS."
-#: src/mn-main.c:270
+#: src/mn-main.c:285
msgid "updating the mail status"
msgstr "mise à jour du status du courrier"
-#: src/mn-main.c:286
+#: src/mn-main.c:301
msgid "Mail Notification is already running"
msgstr "La Notification de Courrier est déjà en cours d'exécution"
-#: src/mn-main.c:293
+#: src/mn-main.c:308
msgid ""
"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
"Please check your Mail Notification installation."
@@ -764,7 +854,7 @@ msgstr ""
"Bonobo n'a pas pu localiser le fichier GNOME_MailNotification_Automation."
"server. Veuillez vérifier votre installation de la Notification de Courrier."
-#: src/mn-main.c:297
+#: src/mn-main.c:312
msgid ""
"Bonobo was unable to register the automation server. Please check your Mail "
"Notification installation."
@@ -772,22 +862,22 @@ msgstr ""
"Bonobo n'a pas été en mesure d'inscrire le serveur d'automation. Veuillez "
"vérifier votre installation de la Notification de Courrier."
-#: src/mn-mbox-mailbox.gob:165
+#: src/mn-mbox-mailbox.gob:171
#, c-format
msgid "error while reading mailbox: %s"
msgstr "erreur lors de la lecture de la boîte aux lettres: %s"
-#: src/mn-mbox-mailbox.gob:173
+#: src/mn-mbox-mailbox.gob:179
#, c-format
msgid "unable to open mailbox: %s"
msgstr "impossible d'ouvrir la boîte aux lettres: %s"
-#: src/mn-mh-mailbox.gob:111
+#: src/mn-mh-mailbox.gob:122
#, c-format
msgid "error while reading .mh_sequences: %s"
msgstr "erreur lors de la lecture de .mh_sequences: %s"
-#: src/mn-mh-mailbox.gob:119
+#: src/mn-mh-mailbox.gob:130
#, c-format
msgid "unable to open .mh_sequences: %s"
msgstr "impossible d'ouvrir .mh_sequences: %s"
@@ -796,21 +886,25 @@ msgstr "impossible d'ouvrir .mh_sequences: %s"
msgid "detecting"
msgstr "en cours de détection"
-#: src/mn-pi-mailbox-properties.gob:75
+#: src/mn-pi-mailbox-properties.gob:74
msgid "_Hostname:"
msgstr "Nom d'_hôte:"
-#: src/mn-pi-mailbox-properties.gob:93
+#: src/mn-pi-mailbox-properties.gob:92
msgid "_Details"
msgstr "_Détails"
-#: src/mn-pi-mailbox-properties.gob:105
+#: src/mn-pi-mailbox-properties.gob:104
msgid "sta_ndard"
msgstr "sta_ndard"
-#: src/mn-pi-mailbox-properties.gob:115
-msgid "_SSL"
-msgstr "_SSL"
+#: src/mn-pi-mailbox-properties.gob:114
+msgid "_in-band SSL/TLS"
+msgstr "SSL/TLS _interne"
+
+#: src/mn-pi-mailbox-properties.gob:124
+msgid "SSL/TLS on sepa_rate port"
+msgstr "SSL/TLS sur port sépa_ré"
#: src/mn-pop3-mailbox-properties.gob:84
msgid "The hostname or IP address of the POP3 server"
@@ -828,122 +922,122 @@ msgstr "Votre mot de passe sur le serveur POP3"
msgid "The port number of the POP3 server"
msgstr "Le numéro de port du serveur POP3"
-#: src/mn-pop3-mailbox.gob:137
-msgid "unable to parse POP3 URI"
-msgstr "impossible d'interpréter l'URI POP3"
-
-#: src/mn-pop3-mailbox.gob:267
+#: src/mn-pop3-mailbox.gob:256
msgid "invalid arguments for the LOGIN-DELAY capability"
msgstr "arguments invalides pour la possibilité LOGIN-DELAY"
-#: src/mn-pop3-mailbox.gob:495
+#: src/mn-pop3-mailbox.gob:523
#, c-format
msgid "honouring LOGIN-DELAY, sleeping for %i second"
msgid_plural "honouring LOGIN-DELAY, sleeping for %i seconds"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-pop3-mailbox.gob:653
+#: src/mn-pop3-mailbox.gob:682
msgid "server does not support APOP authentication"
msgstr "le serveur ne supporte pas l'authentification APOP"
-#: src/mn-pop3-mailbox.gob:681
+#: src/mn-pop3-mailbox.gob:710
msgid "falling back to APOP authentication"
msgstr "rétrogradation vers l'authentification APOP"
-#: src/mn-pop3-mailbox.gob:686
+#: src/mn-pop3-mailbox.gob:715
msgid "falling back to USER/PASS authentication"
msgstr "rétrogradation vers l'authentification USER/PASS"
-#: src/mn-properties.c:132
+#: src/mn-properties.c:151
msgid "No mailbox selected."
msgstr "Pas de boîte aux lettres sélectionnée."
-#: src/mn-properties.c:137
+#: src/mn-properties.c:156
#, c-format
msgid "%i mailbox selected."
msgid_plural "%i mailboxes selected."
msgstr[0] "%i boîte aux lettres sélectionnée"
msgstr[1] "%i boîtes aux lettres sélectionnées"
-#: src/mn-shell.gob:191
+#: src/mn-shell.gob:204
msgid "A command error has occurred"
msgstr "Une erreur de commande s'est produite"
-#: src/mn-shell.gob:192
+#: src/mn-shell.gob:205
#, c-format
msgid "Unable to execute double-clicked command: %s."
msgstr ""
"Impossible d'exécuter la commande associée au double-click sur l'icône: %s."
-#: src/mn-shell.gob:297
+#: src/mn-shell.gob:292
msgid "The following mailbox has new mail:\n"
msgid_plural "The following mailboxes have new mail:\n"
msgstr[0] "La boîte aux lettres suivante a du nouveau courrier:\n"
msgstr[1] "Les boîtes aux lettres suivantes ont du nouveau courrier:\n"
-#: src/mn-shell.gob:301
+#: src/mn-shell.gob:296
msgid "You have no new mail."
msgstr "Vous n'avez pas de nouveau courrier."
-#: src/mn-shell.gob:304
+#: src/mn-shell.gob:299
msgid "The following mailbox reported an error:\n"
msgid_plural "The following mailboxes reported an error:\n"
msgstr[0] "La boîte aux lettres suivante a indiqué une erreur:\n"
msgstr[1] "Les boîtes aux lettres suivantes ont indiqué une erreur:\n"
-#: src/mn-shell.gob:309
+#: src/mn-shell.gob:304
msgid "The following mailbox is unsupported:\n"
msgid_plural "The following mailboxes are unsupported:\n"
msgstr[0] "La boîte aux lettres suivante n'est pas prise en charge:\n"
msgstr[1] "Les boîtes aux lettres suivantes ne sont pas prises en charge:\n"
-#: src/mn-shell.gob:325
+#: src/mn-shell.gob:320
msgid "You have new mail."
msgstr "Vous avez du nouveau courrier."
-#: src/mn-shell.gob:338
+#: src/mn-shell.gob:330
msgid "A command error has occurred in Mail Notification"
msgstr "Une erreur de commande s'est produite dans la Notification de Courrier"
-#: src/mn-shell.gob:339
+#: src/mn-shell.gob:331
#, c-format
msgid "Unable to execute new mail command: %s."
msgstr ""
"Impossible d'exécuter la commande associée à l'arrivée de nouveau courrier: %"
"s"
+#: src/mn-ssl.c:79
+msgid "unknown SSL/TLS error"
+msgstr "erreur SSL/TLS inconnue"
+
#: src/mn-stock.c:28
msgid "Select _All"
msgstr "Sélectionner _Tout"
-#: src/mn-sylpheed-mailbox.gob:84
+#: src/mn-sylpheed-mailbox.gob:93
#, c-format
msgid "unable to open folder: %s"
msgstr "impossible d'ouvrir le dossier: %s"
-#: src/mn-sylpheed-mailbox.gob:118
+#: src/mn-sylpheed-mailbox.gob:127
#, c-format
msgid "unable to close folder: %s"
msgstr "impossible de fermer le dossier: %s"
-#: src/mn-sylpheed-mailbox.gob:121
+#: src/mn-sylpheed-mailbox.gob:130
#, c-format
msgid "error while reading folder: %s"
msgstr "erreur lors de la lecture du dossier: %s"
-#: src/mn-system-mailbox-properties.gob:33 src/mn-uri.c:672
+#: src/mn-system-mailbox-properties.gob:32 src/mn-uri.gob:391
msgid "System Mailbox"
msgstr "Boîte aux Lettres Système"
-#: src/mn-system-mailbox-properties.gob:56
+#: src/mn-system-mailbox-properties.gob:55
#, c-format
msgid "Your system mailbox (<span weight=\"bold\">%s</span>) will be used."
msgstr ""
"Votre boîte aux lettres système (<span weight=\"bold\">%s</span>) sera "
"utilisée."
-#: src/mn-system-mailbox-properties.gob:63
+#: src/mn-system-mailbox-properties.gob:62
msgid ""
"The location of your system mailbox could not be detected. Please set the "
"MAIL environment variable."
@@ -959,33 +1053,37 @@ msgstr "La raison pour laquelle la boîte aux lettres n'est pas prise en charge"
msgid "unsupported"
msgstr "non pris en charge"
-#: src/mn-util.c:116
+#: src/mn-util.c:199
#, c-format
msgid "error loading image: %s"
msgstr "erreur de chargement d'image: %s"
-#: src/mn-util.c:154
+#: src/mn-util.c:237
#, c-format
msgid "widget %s not found in interface %s"
msgstr "élément %s non trouvé dans interface %s"
-#: src/mn-util.c:261
+#: src/mn-util.c:355
msgid "received an invalid URI list"
msgstr "une liste d'URI invalide a été reçue"
-#: src/mn-util.c:297
+#: src/mn-util.c:391
msgid "received an invalid Mozilla URL"
msgstr "une URL Mozilla invalide a été reçue"
-#: src/mn-util.c:389
+#: src/mn-util.c:484
msgid "Unable to display help"
msgstr "Impossible d'afficher l'aide"
-#: src/mn-util.c:403
+#: src/mn-util.c:498
#, c-format
msgid "Unable to create a thread: %s."
msgstr "Impossible de créer un thread: %s."
+#: src/mn-util.c:701
+msgid "A fatal error has occurred in Mail Notification"
+msgstr "Une erreur fatale s'est produite dans la Notification de Courrier"
+
#: ui/mailbox-properties.glade.h:1
msgid "_Mailbox type:"
msgstr "_Type de boîte aux lettres:"
@@ -1035,24 +1133,45 @@ msgid "When double-click_ed:"
msgstr "Lorsque l'îcone est double-cliqué_e:"
#: ui/properties.glade.h:12
+msgid "Whether the status icon should blink on errors or not"
+msgstr "Si l'icône de status doit clignoter lors d'erreurs ou pas"
+
+#: ui/properties.glade.h:13
msgid "Whether to run a command when new mail arrives or not"
msgstr ""
"Si une commande doit être exécutée lorsque du nouveau courrier arrive ou pas"
-#: ui/properties.glade.h:13
+#: ui/properties.glade.h:14
msgid "Whether to run a command when the icon is double-clicked or not"
msgstr ""
"Si une commande doit être exécutée lorsque l'îcone est double-cliquée ou pas"
-#: ui/properties.glade.h:14
+#: ui/properties.glade.h:15
+msgid ""
+"Whether to start Mail Notification when you log into your GNOME session or "
+"not"
+msgstr ""
+"Si la Notification de Courrier doit être démarrée lorsque vous ouvrez votre "
+"session GNOME ou pas"
+
+#: ui/properties.glade.h:16
+msgid "_Blink on errors"
+msgstr "_Clignoter lors d'erreurs"
+
+#: ui/properties.glade.h:17
msgid "_Delay between mail checks:"
msgstr "_Délai entre les vérifications de courrier:"
-#: ui/properties.glade.h:15
+#: ui/properties.glade.h:18
+msgid "_Start Mail Notification on GNOME login"
+msgstr ""
+"_Démarrer la Notification de Courrier lors de l'ouverture de session GNOME"
+
+#: ui/properties.glade.h:19
msgid "minutes"
msgstr "minutes"
-#: ui/properties.glade.h:16
+#: ui/properties.glade.h:20
msgid "seconds"
msgstr "secondes"
@@ -1068,7 +1187,8 @@ msgid ""
"Note: this message will not be shown anymore. To configure Mail Notification "
"again, choose <span weight=\"bold\">Applications</span> → <span weight=\"bold"
"\">Desktop Preferences</span> → <span weight=\"bold\">Mail Notification</"
-"span>."
+"span> (or on some systems <span weight=\"bold\">Applications → Preferences → "
+"More Preferences → Mail Notification</span>)."
msgstr ""
"<span weight=\"bold\" size=\"larger\">Premier démarrage</span>\n"
"\n"
@@ -1080,7 +1200,10 @@ msgstr ""
"Note: ce message ne sera plus affiché à nouveau. Pour configurer la "
"Notification de Courrier ultérieurement, choisissez <span weight=\"bold"
"\">Applications</span> → <span weight=\"bold\">Préférences du bureau</span> "
-"→ <span weight=\"bold\">Notification de Courrier</span>."
+"→ <span weight=\"bold\">Notification de Courrier</span> (ou pour certains "
+"systèmes <span weight=\"bold\">Applications</span> → <span weight=\"bold"
+"\">Préférences</span> → <span weight=\"bold\">Plus de préférences</span> → "
+"<span weight=\"bold\">Notification de Courrier</span>)."
#: ui/welcome.glade.h:8
msgid "_Configure Mail Notification"
diff --git a/po/mail-notification.pot b/po/mail-notification.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-08-19 00:12+0200\n"
+"POT-Creation-Date: 2004-09-09 01:43+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -32,7 +32,7 @@ msgstr ""
#: data/mail-notification-properties.desktop.in.h:2
#: data/mail-notification.desktop.in.h:2
#: data/mail-notification.soundlist.in.h:1 src/mn-about-dialog.gob:38
-#: src/mn-mail-icon.gob:160 src/mn-main.c:212
+#: src/mn-mail-icon.gob:160 src/mn-main.c:221
msgid "Mail Notification"
msgstr ""
@@ -41,82 +41,109 @@ msgid "Get notified when new mail arrives"
msgstr ""
#: data/mail-notification.schemas.in.h:1
-msgid "Delay between mail checks (minutes part)."
+msgid "Blink on errors"
msgstr ""
#: data/mail-notification.schemas.in.h:2
-msgid "Delay between mail checks (seconds part)."
+msgid "Delay between mail checks (minutes part)."
msgstr ""
#: data/mail-notification.schemas.in.h:3
-msgid "Double-clicked command"
+msgid "Delay between mail checks (seconds part)."
msgstr ""
#: data/mail-notification.schemas.in.h:4
-msgid "Has already been run"
+msgid "Double-clicked command"
msgstr ""
#: data/mail-notification.schemas.in.h:5
-msgid "Height of properties dialog"
+msgid "Fingerprints of trusted X509 certificates"
msgstr ""
#: data/mail-notification.schemas.in.h:6
-msgid "Mailboxes list"
+msgid "Has already been run"
msgstr ""
#: data/mail-notification.schemas.in.h:7
-msgid "Minutes between mail checks"
+msgid "Height of properties dialog"
msgstr ""
#: data/mail-notification.schemas.in.h:8
-msgid "New mail command"
+msgid "Mailboxes list"
msgstr ""
#: data/mail-notification.schemas.in.h:9
-msgid "Run a command when new mail arrives"
+msgid "Minutes between mail checks"
msgstr ""
#: data/mail-notification.schemas.in.h:10
-msgid "Run a command when the icon is double-clicked"
+msgid "New mail command"
msgstr ""
#: data/mail-notification.schemas.in.h:11
-msgid "Seconds between mail checks"
+msgid "Run a command when new mail arrives"
msgstr ""
#: data/mail-notification.schemas.in.h:12
-msgid "The command to run when new mail arrives."
+msgid "Run a command when the icon is double-clicked"
msgstr ""
#: data/mail-notification.schemas.in.h:13
-msgid "The command to run when the icon is double-clicked."
+msgid "Seconds between mail checks"
msgstr ""
#: data/mail-notification.schemas.in.h:14
-msgid "The height of the properties dialog in pixels."
+msgid "The command to run when new mail arrives."
msgstr ""
#: data/mail-notification.schemas.in.h:15
-msgid "The list of mailboxes to monitor."
+msgid "The command to run when the icon is double-clicked."
msgstr ""
#: data/mail-notification.schemas.in.h:16
-msgid "The width of the properties dialog in pixels."
+msgid "The height of the properties dialog in pixels."
msgstr ""
#: data/mail-notification.schemas.in.h:17
-msgid "Whether Mail Notification has already been run or not."
+msgid "The list of mailboxes to monitor."
msgstr ""
#: data/mail-notification.schemas.in.h:18
-msgid "Whether to run a command when new mail arrives or not."
+msgid ""
+"The list of trusted SSL/TLS servers (hostname:port) lacking a X509 "
+"certificate."
msgstr ""
#: data/mail-notification.schemas.in.h:19
-msgid "Whether to run a command when the icon is double-clicked or not."
+msgid ""
+"The list of trusted X509 certificates, represented by their MD5 fingerprint."
msgstr ""
#: data/mail-notification.schemas.in.h:20
+msgid "The width of the properties dialog in pixels."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:21
+msgid "Trusted servers list"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:22
+msgid "Whether Mail Notification has already been run or not."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:23
+msgid "Whether the status icon should blink on errors or not."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:24
+msgid "Whether to run a command when new mail arrives or not."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:25
+msgid "Whether to run a command when the icon is double-clicked or not."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:26
msgid "Width of properties dialog"
msgstr ""
@@ -140,23 +167,23 @@ msgstr ""
msgid "Jean-Yves Lefort <jylefort@brutele.be>"
msgstr ""
-#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:36
+#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:35
msgid "<span style=\"italic\">autodetect</span>"
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:67
+#: src/mn-autodetect-mailbox-properties.gob:66
msgid "_Location:"
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:73
+#: src/mn-autodetect-mailbox-properties.gob:72
msgid "_Browse..."
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:80
+#: src/mn-autodetect-mailbox-properties.gob:79
msgid "The URI of the mailbox"
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:117
+#: src/mn-autodetect-mailbox-properties.gob:116
msgid "Select a File or Folder"
msgstr ""
@@ -164,222 +191,270 @@ msgstr ""
msgid "Whether the image is blinking or not"
msgstr ""
-#: src/mn-client-session.c:195 src/mn-client-session.c:202
+#: src/mn-client-session.c:196 src/mn-client-session.c:203
#, c-format
msgid "unable to read from server: %s"
msgstr ""
-#: src/mn-client-session.c:200
+#: src/mn-client-session.c:201
msgid "unable to read from server: EOF"
msgstr ""
-#: src/mn-client-session.c:212
+#: src/mn-client-session.c:213
#, c-format
msgid "unable to decode data using SASL: %s"
msgstr ""
-#: src/mn-client-session.c:286
+#: src/mn-client-session.c:284
#, c-format
msgid "resolving %s"
msgstr ""
-#: src/mn-client-session.c:296
+#: src/mn-client-session.c:294
#, c-format
msgid "unable to resolve %s: %s"
msgstr ""
-#: src/mn-client-session.c:333
+#: src/mn-client-session.c:331
#, c-format
msgid "%s: unsupported address family"
msgstr ""
-#: src/mn-client-session.c:340
+#: src/mn-client-session.c:338
#, c-format
msgid "%s: unable to create socket: %s"
msgstr ""
-#: src/mn-client-session.c:344
+#: src/mn-client-session.c:342
#, c-format
msgid "connecting to %s (%s) port %i"
msgstr ""
-#: src/mn-client-session.c:347
+#: src/mn-client-session.c:345
#, c-format
msgid "unable to connect: %s"
msgstr ""
-#: src/mn-client-session.c:352
+#: src/mn-client-session.c:350
msgid "connected successfully"
msgstr ""
#. if reached, we couldn't find a working address
-#: src/mn-client-session.c:358
+#: src/mn-client-session.c:356
#, c-format
msgid "unable to connect to %s"
msgstr ""
-#: src/mn-client-session.c:374
+#: src/mn-client-session.c:372
#, c-format
msgid "unable to initialize the OpenSSL library: %s"
msgstr ""
-#: src/mn-client-session.c:382
+#: src/mn-client-session.c:380
#, c-format
-msgid "unable to create a SSL object: %s"
+msgid "unable to create a SSL/TLS object: %s"
+msgstr ""
+
+#: src/mn-client-session.c:386
+#, c-format
+msgid "unable to set the SSL/TLS file descriptor: %s"
+msgstr ""
+
+#: src/mn-client-session.c:392
+#, c-format
+msgid "unable to perform the SSL/TLS handshake: %s"
+msgstr ""
+
+#: src/mn-client-session.c:398
+msgid "untrusted server"
+msgstr ""
+
+#: src/mn-client-session.c:402
+#, c-format
+msgid "a SSL/TLS layer is now active (%s, %s %i-bit)"
+msgstr ""
+
+#: src/mn-client-session.c:449
+#, c-format
+msgid "%s, fingerprint: %s"
+msgstr ""
+
+#: src/mn-client-session.c:478
+msgid "missing certificate"
msgstr ""
-#: src/mn-client-session.c:388
+#: src/mn-client-session.c:504
#, c-format
-msgid "unable to set the SSL file descriptor: %s"
+msgid ""
+"Mail Notification was unable to trust \"%s\" (%s). It is possible that "
+"someone is intercepting your communication to obtain your confidential "
+"information.\n"
+"\n"
+"You should only connect to the server if you are certain you are connected "
+"to \"%s\". If you choose to connect to the server, this message will not be "
+"shown again."
msgstr ""
-#: src/mn-client-session.c:443
+#: src/mn-client-session.c:521
+msgid "Connect to untrusted server?"
+msgstr ""
+
+#: src/mn-client-session.c:526
+msgid "Co_nnect"
+msgstr ""
+
+#: src/mn-client-session.c:584
#, c-format
msgid "response \"%s\" is not valid in current context"
msgstr ""
-#: src/mn-client-session.c:469
+#: src/mn-client-session.c:610
#, c-format
msgid "unable to parse response \"%s\""
msgstr ""
-#: src/mn-client-session.c:516
+#: src/mn-client-session.c:657
#, c-format
msgid "unable to encode data using SASL: %s"
msgstr ""
-#: src/mn-client-session.c:545 src/mn-client-session.c:552
+#: src/mn-client-session.c:688 src/mn-client-session.c:695
#, c-format
msgid "unable to write to server: %s"
msgstr ""
-#: src/mn-client-session.c:550
+#: src/mn-client-session.c:693
msgid "unable to write to server: EOF"
msgstr ""
-#: src/mn-client-session.c:582
+#: src/mn-client-session.c:725
#, c-format
msgid "unable to encode Base64: %s"
msgstr ""
-#: src/mn-client-session.c:685
+#: src/mn-client-session.c:828
#, c-format
msgid "unable to initialize the SASL library: %s"
msgstr ""
-#: src/mn-client-session.c:694
+#: src/mn-client-session.c:837
#, c-format
msgid "unable to retrieve local address of socket: %s"
msgstr ""
-#: src/mn-client-session.c:700
+#: src/mn-client-session.c:843
#, c-format
msgid "unable to retrieve remote address of socket: %s"
msgstr ""
-#: src/mn-client-session.c:734
+#: src/mn-client-session.c:877
#, c-format
msgid "warning: unable to set SASL security properties: %s"
msgstr ""
-#: src/mn-client-session.c:773
+#: src/mn-client-session.c:916
msgid ""
"unable to start SASL authentication: SASL asked for something we did not know"
msgstr ""
-#: src/mn-client-session.c:777
+#: src/mn-client-session.c:920
#, c-format
msgid "unable to start SASL authentication: %s"
msgstr ""
-#: src/mn-client-session.c:781
+#: src/mn-client-session.c:924
#, c-format
msgid "unable to create a SASL connection: %s"
msgstr ""
-#: src/mn-client-session.c:831
+#: src/mn-client-session.c:974
msgid "SASL asked for something we did not know, aborting SASL authentication"
msgstr ""
-#: src/mn-client-session.c:835
+#: src/mn-client-session.c:978
#, c-format
msgid "%s, aborting SASL authentication"
msgstr ""
#. compliance error
-#: src/mn-client-session.c:840
+#: src/mn-client-session.c:983
#, c-format
msgid "unable to decode Base64 input from server: %s"
msgstr ""
-#: src/mn-client-session.c:843
+#: src/mn-client-session.c:986
msgid ""
"the server sent a SASL challenge, but there was a pending initial SASL "
"client response"
msgstr ""
-#: src/mn-client-session.c:857
+#: src/mn-client-session.c:1000
msgid ""
"the server did not send a SASL challenge, but there was no pending initial "
"SASL client response"
msgstr ""
-#: src/mn-client-session.c:880
+#: src/mn-client-session.c:1023
#, c-format
msgid "a SASL security layer of strength factor %i is now active"
msgstr ""
#. a security layer is active but we can't retrieve maxoutbuf -> fatal
-#: src/mn-client-session.c:885
+#: src/mn-client-session.c:1028
#, c-format
msgid "unable to get SASL_MAXOUTBUF property: %s"
msgstr ""
-#: src/mn-client-session.c:891
+#: src/mn-client-session.c:1034
#, c-format
msgid "warning: unable to get SASL_SSF property: %s"
msgstr ""
-#: src/mn-dialog.c:108
-msgid "A fatal error has occurred in Mail Notification"
+#: src/mn-conf.c:109
+#, c-format
+msgid "recursively unsetting %s"
msgstr ""
-#: src/mn-gmail-mailbox-properties.gob:78
-msgid "Your Gmail username"
+#: src/mn-conf.c:113
+msgid "syncing the GConf database"
msgstr ""
-#: src/mn-gmail-mailbox-properties.gob:79
-msgid "Your Gmail password"
+#: src/mn-conf.c:116
+msgid "completed"
msgstr ""
-#: src/mn-gmail-mailbox.gob:65
-msgid "unable to parse Gmail URI"
+#: src/mn-gmail-mailbox-properties.gob:77
+msgid "Your Gmail username"
+msgstr ""
+
+#: src/mn-gmail-mailbox-properties.gob:78
+msgid "Your Gmail password"
msgstr ""
-#: src/mn-gmail-mailbox.gob:182
+#: src/mn-gmail-mailbox.gob:220
msgid "logging in"
msgstr ""
-#: src/mn-gmail-mailbox.gob:201 src/mn-gmail-mailbox.gob:240
-#: src/mn-gmail-mailbox.gob:273 src/mn-gmail-mailbox.gob:377
+#: src/mn-gmail-mailbox.gob:239 src/mn-gmail-mailbox.gob:279
+#: src/mn-gmail-mailbox.gob:313 src/mn-gmail-mailbox.gob:418
#, c-format
msgid "unable to transfer data: %s"
msgstr ""
-#: src/mn-gmail-mailbox.gob:226 src/mn-gmail-mailbox.gob:259
-#: src/mn-gmail-mailbox.gob:293
+#: src/mn-gmail-mailbox.gob:265 src/mn-gmail-mailbox.gob:299
+#: src/mn-gmail-mailbox.gob:334
msgid "login failed"
msgstr ""
-#: src/mn-gmail-mailbox.gob:287
+#: src/mn-gmail-mailbox.gob:328
msgid "successfully logged in"
msgstr ""
-#: src/mn-gmail-mailbox.gob:365
+#: src/mn-gmail-mailbox.gob:406
msgid "searching for unread mail"
msgstr ""
-#: src/mn-gmail-mailbox.gob:384
+#: src/mn-gmail-mailbox.gob:427
msgid "unable to parse Gmail data"
msgstr ""
@@ -395,72 +470,72 @@ msgstr ""
msgid "oth_er:"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:121
+#: src/mn-imap-mailbox-properties.gob:122
msgid "The hostname or IP address of the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:122
+#: src/mn-imap-mailbox-properties.gob:123
msgid "Your username on the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:123
+#: src/mn-imap-mailbox-properties.gob:124
msgid "Your password on the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:124
#: src/mn-imap-mailbox-properties.gob:125
+#: src/mn-imap-mailbox-properties.gob:126
msgid "The port number of the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:126
+#: src/mn-imap-mailbox-properties.gob:127
msgid "The mailbox name"
msgstr ""
-#: src/mn-imap-mailbox.gob:124 src/mn-pop3-mailbox.gob:133
-msgid "SSL support has not been compiled in"
+#: src/mn-imap-mailbox.gob:112 src/mn-pop3-mailbox.gob:125
+msgid "SSL/TLS support has not been compiled in"
msgstr ""
-#: src/mn-imap-mailbox.gob:128
-msgid "unable to parse IMAP URI"
-msgstr ""
-
-#: src/mn-imap-mailbox.gob:195
+#: src/mn-imap-mailbox.gob:179
msgid "server did not send capabilities"
msgstr ""
-#: src/mn-imap-mailbox.gob:267
+#: src/mn-imap-mailbox.gob:292
msgid "server advertised LOGINDISABLED, not using LOGIN authentication"
msgstr ""
-#: src/mn-imap-mailbox.gob:268
+#: src/mn-imap-mailbox.gob:293
msgid "unable to login"
msgstr ""
#. compliance error
-#: src/mn-imap-mailbox.gob:336
+#: src/mn-imap-mailbox.gob:361
msgid "server did not send status"
msgstr ""
-#: src/mn-imap-mailbox.gob:554 src/mn-pop3-mailbox.gob:715
+#: src/mn-imap-mailbox.gob:583 src/mn-pop3-mailbox.gob:744
msgid "unknown server error"
msgstr ""
-#: src/mn-imap-mailbox.gob:625 src/mn-pop3-mailbox.gob:645
+#: src/mn-imap-mailbox.gob:656 src/mn-pop3-mailbox.gob:210
+msgid "server does not support in-band SSL/TLS"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:675 src/mn-pop3-mailbox.gob:674
msgid ""
"a SASL authentication mechanism was selected but SASL support has not been "
"compiled in"
msgstr ""
-#: src/mn-imap-mailbox.gob:633 src/mn-pop3-mailbox.gob:657
+#: src/mn-imap-mailbox.gob:683 src/mn-pop3-mailbox.gob:686
#, c-format
msgid "unknown authentication mechanism \"%s\""
msgstr ""
-#: src/mn-imap-mailbox.gob:651
+#: src/mn-imap-mailbox.gob:701
msgid "falling back to IMAP LOGIN authentication"
msgstr ""
-#: src/mn-imap-mailbox.gob:655 src/mn-pop3-mailbox.gob:691
+#: src/mn-imap-mailbox.gob:705 src/mn-pop3-mailbox.gob:720
msgid "authentication failed"
msgstr ""
@@ -490,23 +565,23 @@ msgstr ""
msgid "%s Properties"
msgstr ""
-#: src/mn-mailbox-properties-util.c:75
+#: src/mn-mailbox-properties-util.c:77
msgid "_Username:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:79
+#: src/mn-mailbox-properties-util.c:87
msgid "_Password:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:146
+#: src/mn-mailbox-properties-util.c:154
msgid "Connection type:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:153
+#: src/mn-mailbox-properties-util.c:161
msgid "Port:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:180
+#: src/mn-mailbox-properties-util.c:189
msgid "_Authentication mechanism:"
msgstr ""
@@ -534,56 +609,56 @@ msgstr ""
msgid "Whether the properties are completely filled or not"
msgstr ""
-#: src/mn-mailbox-view.gob:91
-msgid "Unable to add mailbox"
+#: src/mn-mailbox-view.gob:254
+msgid "Mailbox"
msgstr ""
-#: src/mn-mailbox-view.gob:91
-msgid "The mailbox is already in the list."
+#: src/mn-mailbox-view.gob:268
+msgid "Format"
msgstr ""
-#: src/mn-mailbox-view.gob:283
-msgid "Mailbox"
+#: src/mn-mailbox-view.gob:543
+msgid "Unable to add mailbox"
msgstr ""
-#: src/mn-mailbox-view.gob:297
-msgid "Format"
+#: src/mn-mailbox-view.gob:543
+msgid "The mailbox is already in the list."
msgstr ""
-#: src/mn-mailbox.gob:88
+#: src/mn-mailbox.gob:122
msgid "The mailbox URI"
msgstr ""
-#: src/mn-mailbox.gob:98
+#: src/mn-mailbox.gob:133
msgid "The mailbox human-readable name"
msgstr ""
-#: src/mn-mailbox.gob:102
+#: src/mn-mailbox.gob:137
msgid "Whether the mailbox has to be manually checked or not"
msgstr ""
-#: src/mn-mailbox.gob:107
+#: src/mn-mailbox.gob:142
msgid "Whether the mailbox has new mail or not"
msgstr ""
-#: src/mn-mailbox.gob:112
+#: src/mn-mailbox.gob:147
msgid "The mailbox error, if any"
msgstr ""
-#: src/mn-mailbox.gob:218
+#: src/mn-mailbox.gob:251
msgid "does not exist"
msgstr ""
-#: src/mn-mailbox.gob:255
+#: src/mn-mailbox.gob:287
msgid "unknown format"
msgstr ""
-#: src/mn-mailbox.gob:316
+#: src/mn-mailbox.gob:355
#, c-format
msgid "unable to monitor %s: %s"
msgstr ""
-#: src/mn-mailbox.gob:330
+#: src/mn-mailbox.gob:369
#, c-format
msgid ""
"As a fallback, they will be checked every %i second (this delay is "
@@ -594,7 +669,7 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.gob:341
+#: src/mn-mailbox.gob:380
#, c-format
msgid ""
"As a fallback, they will be checked every %i minute (this delay is "
@@ -605,7 +680,7 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.gob:352
+#: src/mn-mailbox.gob:391
#, c-format
msgid ""
"As a fallback, they will be checked approximately every %i minute (this "
@@ -616,58 +691,58 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.gob:366
+#: src/mn-mailbox.gob:405
msgid "A monitoring error has occurred"
msgstr ""
-#: src/mn-mailbox.gob:367
+#: src/mn-mailbox.gob:406
#, c-format
msgid ""
-"Mail Notification was unable to enable automatic notification for one or "
+"Mail Notification was unable to enable immediate notification for one or "
"more mailboxes. %s"
msgstr ""
-#: src/mn-mailboxes.gob:130
+#: src/mn-mailboxes.gob:143
#, c-format
msgid "%s is unsupported: %s"
msgstr ""
-#: src/mn-mailboxes.gob:157
+#: src/mn-mailboxes.gob:170
#, c-format
msgid "%s has new mail"
msgstr ""
-#: src/mn-mailboxes.gob:157
+#: src/mn-mailboxes.gob:170
#, c-format
msgid "%s has no new mail"
msgstr ""
-#: src/mn-mailboxes.gob:173
+#: src/mn-mailboxes.gob:186
#, c-format
msgid "%s reported an error: %s"
msgstr ""
-#: src/mn-maildir-mailbox.gob:98
+#: src/mn-maildir-mailbox.gob:109
#, c-format
msgid "unable to open folder \"new\": %s"
msgstr ""
-#: src/mn-maildir-mailbox.gob:126
+#: src/mn-maildir-mailbox.gob:137
#, c-format
msgid "unable to close folder \"new\": %s"
msgstr ""
-#: src/mn-maildir-mailbox.gob:129
+#: src/mn-maildir-mailbox.gob:140
#, c-format
msgid "error while reading folder \"new\": %s"
msgstr ""
-#: src/mn-main.c:86
+#: src/mn-main.c:85
#, c-format
msgid "Compiled-in mailbox backends: %s\n"
msgstr ""
-#: src/mn-main.c:104
+#: src/mn-main.c:103
#, c-format
msgid "Compiled-in features: %s\n"
msgstr ""
@@ -696,60 +771,64 @@ msgstr ""
msgid "Report the mail status"
msgstr ""
+#: src/mn-main.c:187
+msgid "Unset obsolete GConf configuration and exit"
+msgstr ""
+
#.
#. * We can't use mn_error_dialog() because gtk_init() has not been
#. * called yet.
#.
-#: src/mn-main.c:204
+#: src/mn-main.c:213
msgid "multi-threading is not available"
msgstr ""
-#: src/mn-main.c:243
+#: src/mn-main.c:258
msgid ""
"Bonobo could not locate the automation object. Please check your Mail "
"Notification installation."
msgstr ""
-#: src/mn-main.c:248
+#: src/mn-main.c:263
msgid "Unable to initialize the GnomeVFS library."
msgstr ""
-#: src/mn-main.c:270
+#: src/mn-main.c:285
msgid "updating the mail status"
msgstr ""
-#: src/mn-main.c:286
+#: src/mn-main.c:301
msgid "Mail Notification is already running"
msgstr ""
-#: src/mn-main.c:293
+#: src/mn-main.c:308
msgid ""
"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
"Please check your Mail Notification installation."
msgstr ""
-#: src/mn-main.c:297
+#: src/mn-main.c:312
msgid ""
"Bonobo was unable to register the automation server. Please check your Mail "
"Notification installation."
msgstr ""
-#: src/mn-mbox-mailbox.gob:165
+#: src/mn-mbox-mailbox.gob:171
#, c-format
msgid "error while reading mailbox: %s"
msgstr ""
-#: src/mn-mbox-mailbox.gob:173
+#: src/mn-mbox-mailbox.gob:179
#, c-format
msgid "unable to open mailbox: %s"
msgstr ""
-#: src/mn-mh-mailbox.gob:111
+#: src/mn-mh-mailbox.gob:122
#, c-format
msgid "error while reading .mh_sequences: %s"
msgstr ""
-#: src/mn-mh-mailbox.gob:119
+#: src/mn-mh-mailbox.gob:130
#, c-format
msgid "unable to open .mh_sequences: %s"
msgstr ""
@@ -758,20 +837,24 @@ msgstr ""
msgid "detecting"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:75
+#: src/mn-pi-mailbox-properties.gob:74
msgid "_Hostname:"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:93
+#: src/mn-pi-mailbox-properties.gob:92
msgid "_Details"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:105
+#: src/mn-pi-mailbox-properties.gob:104
msgid "sta_ndard"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:115
-msgid "_SSL"
+#: src/mn-pi-mailbox-properties.gob:114
+msgid "_in-band SSL/TLS"
+msgstr ""
+
+#: src/mn-pi-mailbox-properties.gob:124
+msgid "SSL/TLS on sepa_rate port"
msgstr ""
#: src/mn-pop3-mailbox-properties.gob:84
@@ -790,117 +873,117 @@ msgstr ""
msgid "The port number of the POP3 server"
msgstr ""
-#: src/mn-pop3-mailbox.gob:137
-msgid "unable to parse POP3 URI"
-msgstr ""
-
-#: src/mn-pop3-mailbox.gob:267
+#: src/mn-pop3-mailbox.gob:256
msgid "invalid arguments for the LOGIN-DELAY capability"
msgstr ""
-#: src/mn-pop3-mailbox.gob:495
+#: src/mn-pop3-mailbox.gob:523
#, c-format
msgid "honouring LOGIN-DELAY, sleeping for %i second"
msgid_plural "honouring LOGIN-DELAY, sleeping for %i seconds"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-pop3-mailbox.gob:653
+#: src/mn-pop3-mailbox.gob:682
msgid "server does not support APOP authentication"
msgstr ""
-#: src/mn-pop3-mailbox.gob:681
+#: src/mn-pop3-mailbox.gob:710
msgid "falling back to APOP authentication"
msgstr ""
-#: src/mn-pop3-mailbox.gob:686
+#: src/mn-pop3-mailbox.gob:715
msgid "falling back to USER/PASS authentication"
msgstr ""
-#: src/mn-properties.c:132
+#: src/mn-properties.c:151
msgid "No mailbox selected."
msgstr ""
-#: src/mn-properties.c:137
+#: src/mn-properties.c:156
#, c-format
msgid "%i mailbox selected."
msgid_plural "%i mailboxes selected."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:191
+#: src/mn-shell.gob:204
msgid "A command error has occurred"
msgstr ""
-#: src/mn-shell.gob:192
+#: src/mn-shell.gob:205
#, c-format
msgid "Unable to execute double-clicked command: %s."
msgstr ""
-#: src/mn-shell.gob:297
+#: src/mn-shell.gob:292
msgid "The following mailbox has new mail:\n"
msgid_plural "The following mailboxes have new mail:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:301
+#: src/mn-shell.gob:296
msgid "You have no new mail."
msgstr ""
-#: src/mn-shell.gob:304
+#: src/mn-shell.gob:299
msgid "The following mailbox reported an error:\n"
msgid_plural "The following mailboxes reported an error:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:309
+#: src/mn-shell.gob:304
msgid "The following mailbox is unsupported:\n"
msgid_plural "The following mailboxes are unsupported:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:325
+#: src/mn-shell.gob:320
msgid "You have new mail."
msgstr ""
-#: src/mn-shell.gob:338
+#: src/mn-shell.gob:330
msgid "A command error has occurred in Mail Notification"
msgstr ""
-#: src/mn-shell.gob:339
+#: src/mn-shell.gob:331
#, c-format
msgid "Unable to execute new mail command: %s."
msgstr ""
+#: src/mn-ssl.c:79
+msgid "unknown SSL/TLS error"
+msgstr ""
+
#: src/mn-stock.c:28
msgid "Select _All"
msgstr ""
-#: src/mn-sylpheed-mailbox.gob:84
+#: src/mn-sylpheed-mailbox.gob:93
#, c-format
msgid "unable to open folder: %s"
msgstr ""
-#: src/mn-sylpheed-mailbox.gob:118
+#: src/mn-sylpheed-mailbox.gob:127
#, c-format
msgid "unable to close folder: %s"
msgstr ""
-#: src/mn-sylpheed-mailbox.gob:121
+#: src/mn-sylpheed-mailbox.gob:130
#, c-format
msgid "error while reading folder: %s"
msgstr ""
-#: src/mn-system-mailbox-properties.gob:33 src/mn-uri.c:672
+#: src/mn-system-mailbox-properties.gob:32 src/mn-uri.gob:391
msgid "System Mailbox"
msgstr ""
-#: src/mn-system-mailbox-properties.gob:56
+#: src/mn-system-mailbox-properties.gob:55
#, c-format
msgid "Your system mailbox (<span weight=\"bold\">%s</span>) will be used."
msgstr ""
-#: src/mn-system-mailbox-properties.gob:63
+#: src/mn-system-mailbox-properties.gob:62
msgid ""
"The location of your system mailbox could not be detected. Please set the "
"MAIL environment variable."
@@ -914,33 +997,37 @@ msgstr ""
msgid "unsupported"
msgstr ""
-#: src/mn-util.c:116
+#: src/mn-util.c:199
#, c-format
msgid "error loading image: %s"
msgstr ""
-#: src/mn-util.c:154
+#: src/mn-util.c:237
#, c-format
msgid "widget %s not found in interface %s"
msgstr ""
-#: src/mn-util.c:261
+#: src/mn-util.c:355
msgid "received an invalid URI list"
msgstr ""
-#: src/mn-util.c:297
+#: src/mn-util.c:391
msgid "received an invalid Mozilla URL"
msgstr ""
-#: src/mn-util.c:389
+#: src/mn-util.c:484
msgid "Unable to display help"
msgstr ""
-#: src/mn-util.c:403
+#: src/mn-util.c:498
#, c-format
msgid "Unable to create a thread: %s."
msgstr ""
+#: src/mn-util.c:701
+msgid "A fatal error has occurred in Mail Notification"
+msgstr ""
+
#: ui/mailbox-properties.glade.h:1
msgid "_Mailbox type:"
msgstr ""
@@ -990,22 +1077,40 @@ msgid "When double-click_ed:"
msgstr ""
#: ui/properties.glade.h:12
-msgid "Whether to run a command when new mail arrives or not"
+msgid "Whether the status icon should blink on errors or not"
msgstr ""
#: ui/properties.glade.h:13
-msgid "Whether to run a command when the icon is double-clicked or not"
+msgid "Whether to run a command when new mail arrives or not"
msgstr ""
#: ui/properties.glade.h:14
-msgid "_Delay between mail checks:"
+msgid "Whether to run a command when the icon is double-clicked or not"
msgstr ""
#: ui/properties.glade.h:15
-msgid "minutes"
+msgid ""
+"Whether to start Mail Notification when you log into your GNOME session or "
+"not"
msgstr ""
#: ui/properties.glade.h:16
+msgid "_Blink on errors"
+msgstr ""
+
+#: ui/properties.glade.h:17
+msgid "_Delay between mail checks:"
+msgstr ""
+
+#: ui/properties.glade.h:18
+msgid "_Start Mail Notification on GNOME login"
+msgstr ""
+
+#: ui/properties.glade.h:19
+msgid "minutes"
+msgstr ""
+
+#: ui/properties.glade.h:20
msgid "seconds"
msgstr ""
@@ -1021,7 +1126,8 @@ msgid ""
"Note: this message will not be shown anymore. To configure Mail Notification "
"again, choose <span weight=\"bold\">Applications</span> → <span weight=\"bold"
"\">Desktop Preferences</span> → <span weight=\"bold\">Mail Notification</"
-"span>."
+"span> (or on some systems <span weight=\"bold\">Applications → Preferences → "
+"More Preferences → Mail Notification</span>)."
msgstr ""
#: ui/welcome.glade.h:8
diff --git a/po/pt.gmo b/po/pt.gmo
Binary files differ.
diff --git a/po/pt.po b/po/pt.po
@@ -0,0 +1,1204 @@
+# Portuguese translations for mail-notification.
+# Copyright (c) 2003, 2004 Jean-Yves Lefort.
+#
+# This file is distributed under the same license as the
+# mail-notification package.
+#
+# Duarte Henriques <duarte_henriques@myrealbox.com>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mail-notification 0.6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-09-09 01:43+0200\n"
+"PO-Revision-Date: 2004-09-07 00:04+0200\n"
+"Last-Translator: Duarte Henriques <duarte_henriques@myrealbox.com>\n"
+"Language-Team: Duarte Henriques <duarte_henriques@myrealbox.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n>1;\n"
+
+#: data/GNOME_MailNotification_Automation.server.in.in.h:1
+msgid "Mail Notification automation"
+msgstr "Automação da Notificação de Correio"
+
+#: data/GNOME_MailNotification_Automation.server.in.in.h:2
+msgid "Mail Notification automation factory"
+msgstr "Fábrica de automação de Notificação de Correio"
+
+#: data/mail-notification-properties.desktop.in.h:1
+msgid "Configure Mail Notification"
+msgstr "Configurar Notificação de Correio"
+
+#: data/mail-notification-properties.desktop.in.h:2
+#: data/mail-notification.desktop.in.h:2
+#: data/mail-notification.soundlist.in.h:1 src/mn-about-dialog.gob:38
+#: src/mn-mail-icon.gob:160 src/mn-main.c:221
+msgid "Mail Notification"
+msgstr "Notificação de Correio"
+
+#: data/mail-notification.desktop.in.h:1
+msgid "Get notified when new mail arrives"
+msgstr "Notificar quando chega novo correio"
+
+#: data/mail-notification.schemas.in.h:1
+msgid "Blink on errors"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:2
+msgid "Delay between mail checks (minutes part)."
+msgstr "Intervalo entre verificações de correio (minutos)."
+
+#: data/mail-notification.schemas.in.h:3
+msgid "Delay between mail checks (seconds part)."
+msgstr "Intervalo entre verificações de correio (segundos)."
+
+#: data/mail-notification.schemas.in.h:4
+msgid "Double-clicked command"
+msgstr "Comando de duplo-clique"
+
+#: data/mail-notification.schemas.in.h:5
+msgid "Fingerprints of trusted X509 certificates"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:6
+msgid "Has already been run"
+msgstr "Já foi executado"
+
+#: data/mail-notification.schemas.in.h:7
+msgid "Height of properties dialog"
+msgstr "Altura do diálogo de propriedades"
+
+#: data/mail-notification.schemas.in.h:8
+msgid "Mailboxes list"
+msgstr "Lista de caixas de correio"
+
+#: data/mail-notification.schemas.in.h:9
+msgid "Minutes between mail checks"
+msgstr "Minutos entre verificações de correio"
+
+#: data/mail-notification.schemas.in.h:10
+msgid "New mail command"
+msgstr "Novo comando de correio"
+
+#: data/mail-notification.schemas.in.h:11
+msgid "Run a command when new mail arrives"
+msgstr "Executar um comando quando chega novo correio"
+
+#: data/mail-notification.schemas.in.h:12
+msgid "Run a command when the icon is double-clicked"
+msgstr "Executar um comando quando fizer duplo-clique no ícone"
+
+#: data/mail-notification.schemas.in.h:13
+msgid "Seconds between mail checks"
+msgstr "Segundos entre verificações de correio"
+
+#: data/mail-notification.schemas.in.h:14
+msgid "The command to run when new mail arrives."
+msgstr "O comando a executar quando chega novo correio."
+
+#: data/mail-notification.schemas.in.h:15
+msgid "The command to run when the icon is double-clicked."
+msgstr "O comando a executar quando fizer duplo-clique no ícone."
+
+#: data/mail-notification.schemas.in.h:16
+msgid "The height of the properties dialog in pixels."
+msgstr "A altura em pixeis do diálogo de propriedades."
+
+#: data/mail-notification.schemas.in.h:17
+msgid "The list of mailboxes to monitor."
+msgstr "A lista de caixas de correio a monitorizar."
+
+#: data/mail-notification.schemas.in.h:18
+msgid ""
+"The list of trusted SSL/TLS servers (hostname:port) lacking a X509 "
+"certificate."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:19
+msgid ""
+"The list of trusted X509 certificates, represented by their MD5 fingerprint."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:20
+msgid "The width of the properties dialog in pixels."
+msgstr "A largura em pixeis do diálogo de propriedades."
+
+#: data/mail-notification.schemas.in.h:21
+msgid "Trusted servers list"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:22
+msgid "Whether Mail Notification has already been run or not."
+msgstr "Se a Notificação de Correio já foi executada ou não."
+
+#: data/mail-notification.schemas.in.h:23
+#, fuzzy
+msgid "Whether the status icon should blink on errors or not."
+msgstr "Se a imagem pisca ou não"
+
+#: data/mail-notification.schemas.in.h:24
+msgid "Whether to run a command when new mail arrives or not."
+msgstr "Se um comando deverá ser executado quando chega novo correio."
+
+#: data/mail-notification.schemas.in.h:25
+msgid "Whether to run a command when the icon is double-clicked or not."
+msgstr "Se um comando deverá ser executado quando fizer duplo-clique no ícone."
+
+#: data/mail-notification.schemas.in.h:26
+msgid "Width of properties dialog"
+msgstr "Largura do diálogo de propriedades"
+
+#: data/mail-notification.soundlist.in.h:2
+msgid "New Mail"
+msgstr "Novo Correio"
+
+#: src/eggtrayicon.c:109
+msgid "Orientation"
+msgstr "Orientação"
+
+#: src/eggtrayicon.c:110
+msgid "The orientation of the tray."
+msgstr "A orientação do tabuleiro."
+
+#: src/mn-about-dialog.gob:41
+msgid "A Mail Notification Icon"
+msgstr "Um Ícone de Notificação de Correio"
+
+#: src/mn-about-dialog.gob:44
+msgid "Jean-Yves Lefort <jylefort@brutele.be>"
+msgstr "Duarte Henriques <duarte_henriques@myrealbox.com>"
+
+#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:35
+msgid "<span style=\"italic\">autodetect</span>"
+msgstr "<span style=\"italic\">autodetectar</span>"
+
+#: src/mn-autodetect-mailbox-properties.gob:66
+msgid "_Location:"
+msgstr "_Localização:"
+
+#: src/mn-autodetect-mailbox-properties.gob:72
+msgid "_Browse..."
+msgstr "_Procurar..."
+
+#: src/mn-autodetect-mailbox-properties.gob:79
+msgid "The URI of the mailbox"
+msgstr "O URI da caixa de correio"
+
+#: src/mn-autodetect-mailbox-properties.gob:116
+msgid "Select a File or Folder"
+msgstr "Escolha um Ficheiro ou Pasta"
+
+#: src/mn-blinking-image.gob:30
+msgid "Whether the image is blinking or not"
+msgstr "Se a imagem pisca ou não"
+
+#: src/mn-client-session.c:196 src/mn-client-session.c:203
+#, c-format
+msgid "unable to read from server: %s"
+msgstr "incapaz de ler do servidor: %s"
+
+#: src/mn-client-session.c:201
+msgid "unable to read from server: EOF"
+msgstr "incapaz de ler do servidor: EOF"
+
+#: src/mn-client-session.c:213
+#, c-format
+msgid "unable to decode data using SASL: %s"
+msgstr "incapaz de descodificar dados usando SASL: %s"
+
+#: src/mn-client-session.c:284
+#, c-format
+msgid "resolving %s"
+msgstr "resolvendo %s"
+
+#: src/mn-client-session.c:294
+#, c-format
+msgid "unable to resolve %s: %s"
+msgstr "incapaz de resolver %s: %s"
+
+#: src/mn-client-session.c:331
+#, c-format
+msgid "%s: unsupported address family"
+msgstr "%s: família de endereços não suportada"
+
+#: src/mn-client-session.c:338
+#, c-format
+msgid "%s: unable to create socket: %s"
+msgstr "%s: incapaz de criar socket: %s"
+
+#: src/mn-client-session.c:342
+#, c-format
+msgid "connecting to %s (%s) port %i"
+msgstr "ligando a %s (%s), porto %i"
+
+#: src/mn-client-session.c:345
+#, c-format
+msgid "unable to connect: %s"
+msgstr "incapaz de ligar: %s"
+
+#: src/mn-client-session.c:350
+msgid "connected successfully"
+msgstr "ligado com sucesso"
+
+#. if reached, we couldn't find a working address
+#: src/mn-client-session.c:356
+#, c-format
+msgid "unable to connect to %s"
+msgstr "incapaz de ligar a %s"
+
+#: src/mn-client-session.c:372
+#, c-format
+msgid "unable to initialize the OpenSSL library: %s"
+msgstr "incapaz de inicializar a biblioteca OpenSSL: %s"
+
+#: src/mn-client-session.c:380
+#, fuzzy, c-format
+msgid "unable to create a SSL/TLS object: %s"
+msgstr "incapaz de criar um objecto SSL: %s"
+
+#: src/mn-client-session.c:386
+#, fuzzy, c-format
+msgid "unable to set the SSL/TLS file descriptor: %s"
+msgstr "incapaz de definir o descritor de ficheiro SSL: %s"
+
+#: src/mn-client-session.c:392
+#, fuzzy, c-format
+msgid "unable to perform the SSL/TLS handshake: %s"
+msgstr "incapaz de definir o descritor de ficheiro SSL: %s"
+
+#: src/mn-client-session.c:398
+msgid "untrusted server"
+msgstr ""
+
+#: src/mn-client-session.c:402
+#, c-format
+msgid "a SSL/TLS layer is now active (%s, %s %i-bit)"
+msgstr ""
+
+#: src/mn-client-session.c:449
+#, c-format
+msgid "%s, fingerprint: %s"
+msgstr ""
+
+#: src/mn-client-session.c:478
+msgid "missing certificate"
+msgstr ""
+
+#: src/mn-client-session.c:504
+#, c-format
+msgid ""
+"Mail Notification was unable to trust \"%s\" (%s). It is possible that "
+"someone is intercepting your communication to obtain your confidential "
+"information.\n"
+"\n"
+"You should only connect to the server if you are certain you are connected "
+"to \"%s\". If you choose to connect to the server, this message will not be "
+"shown again."
+msgstr ""
+
+#: src/mn-client-session.c:521
+msgid "Connect to untrusted server?"
+msgstr ""
+
+#: src/mn-client-session.c:526
+msgid "Co_nnect"
+msgstr ""
+
+#: src/mn-client-session.c:584
+#, c-format
+msgid "response \"%s\" is not valid in current context"
+msgstr "a resposta \"%s\" não é válida no contexto actual"
+
+#: src/mn-client-session.c:610
+#, c-format
+msgid "unable to parse response \"%s\""
+msgstr "incapaz de processar resposta \"%s\""
+
+#: src/mn-client-session.c:657
+#, c-format
+msgid "unable to encode data using SASL: %s"
+msgstr "incapaz de encodificar dados usando SASL: %s"
+
+#: src/mn-client-session.c:688 src/mn-client-session.c:695
+#, c-format
+msgid "unable to write to server: %s"
+msgstr "incapaz de escrever para o servidor: %s"
+
+#: src/mn-client-session.c:693
+msgid "unable to write to server: EOF"
+msgstr "incapaz de escrever para o servidor: EOF"
+
+#: src/mn-client-session.c:725
+#, c-format
+msgid "unable to encode Base64: %s"
+msgstr "incapaz de encodificar em Base64: %s"
+
+#: src/mn-client-session.c:828
+#, c-format
+msgid "unable to initialize the SASL library: %s"
+msgstr "incapaz de inicializar a biblioteca SASL: %s"
+
+#: src/mn-client-session.c:837
+#, c-format
+msgid "unable to retrieve local address of socket: %s"
+msgstr "incapaz de obter o endereço local do socket: %s"
+
+#: src/mn-client-session.c:843
+#, c-format
+msgid "unable to retrieve remote address of socket: %s"
+msgstr "incapaz de obter endereço remoto do socket: %s"
+
+#: src/mn-client-session.c:877
+#, c-format
+msgid "warning: unable to set SASL security properties: %s"
+msgstr "aviso: incapaz de definir as propriedades de segurança SASL: %s"
+
+#: src/mn-client-session.c:916
+msgid ""
+"unable to start SASL authentication: SASL asked for something we did not know"
+msgstr ""
+"incapaz de iniciar a autenticação SASL: SASL perguntou algo que não sabíamos"
+
+#: src/mn-client-session.c:920
+#, c-format
+msgid "unable to start SASL authentication: %s"
+msgstr "incapaz de iniciar autenticação SASL: %s"
+
+#: src/mn-client-session.c:924
+#, c-format
+msgid "unable to create a SASL connection: %s"
+msgstr "incapaz de criar uma ligação SASL: %s"
+
+#: src/mn-client-session.c:974
+msgid "SASL asked for something we did not know, aborting SASL authentication"
+msgstr "SASL perguntou algo que não sabíamos, abortando a autenticação SASL"
+
+#: src/mn-client-session.c:978
+#, c-format
+msgid "%s, aborting SASL authentication"
+msgstr "%s, abortando a autenticação SASL"
+
+#. compliance error
+#: src/mn-client-session.c:983
+#, c-format
+msgid "unable to decode Base64 input from server: %s"
+msgstr "incapaz de descodificar o input em Base64 do servidor: %s"
+
+#: src/mn-client-session.c:986
+msgid ""
+"the server sent a SASL challenge, but there was a pending initial SASL "
+"client response"
+msgstr ""
+"o servidor enviou um desafio SASL, mas havia uma resposta SASL inicial "
+"pendente do cliente"
+
+#: src/mn-client-session.c:1000
+msgid ""
+"the server did not send a SASL challenge, but there was no pending initial "
+"SASL client response"
+msgstr ""
+"o servidor não enviou um desafio SASL, mas não havia uma resposta SASL "
+"inicial pendente do cliente"
+
+#: src/mn-client-session.c:1023
+#, c-format
+msgid "a SASL security layer of strength factor %i is now active"
+msgstr "está agora activa uma camada de segurança SASL com factor de força %i"
+
+#. a security layer is active but we can't retrieve maxoutbuf -> fatal
+#: src/mn-client-session.c:1028
+#, c-format
+msgid "unable to get SASL_MAXOUTBUF property: %s"
+msgstr "incapaz de obter a propriedade SASL_MAXOUTBUF: %s"
+
+#: src/mn-client-session.c:1034
+#, c-format
+msgid "warning: unable to get SASL_SSF property: %s"
+msgstr "aviso: incapaz de obter a propriedade SASL_SSF: %s"
+
+#: src/mn-conf.c:109
+#, c-format
+msgid "recursively unsetting %s"
+msgstr ""
+
+#: src/mn-conf.c:113
+msgid "syncing the GConf database"
+msgstr ""
+
+#: src/mn-conf.c:116
+#, fuzzy
+msgid "completed"
+msgstr "Completo"
+
+#: src/mn-gmail-mailbox-properties.gob:77
+msgid "Your Gmail username"
+msgstr "O seu nome de utilizador Gmail"
+
+#: src/mn-gmail-mailbox-properties.gob:78
+msgid "Your Gmail password"
+msgstr "A sua senha Gmail"
+
+#: src/mn-gmail-mailbox.gob:220
+msgid "logging in"
+msgstr "ligando-se"
+
+#: src/mn-gmail-mailbox.gob:239 src/mn-gmail-mailbox.gob:279
+#: src/mn-gmail-mailbox.gob:313 src/mn-gmail-mailbox.gob:418
+#, c-format
+msgid "unable to transfer data: %s"
+msgstr "incapaz de transferir dados: %s"
+
+#: src/mn-gmail-mailbox.gob:265 src/mn-gmail-mailbox.gob:299
+#: src/mn-gmail-mailbox.gob:334
+msgid "login failed"
+msgstr "login falhou"
+
+#: src/mn-gmail-mailbox.gob:328
+msgid "successfully logged in"
+msgstr "ligado com sucesso"
+
+#: src/mn-gmail-mailbox.gob:406
+msgid "searching for unread mail"
+msgstr "a procurar correio não lido"
+
+#: src/mn-gmail-mailbox.gob:427
+msgid "unable to parse Gmail data"
+msgstr "incapaz de processar dados Gmail"
+
+#: src/mn-imap-mailbox-properties.gob:92
+msgid "Mailbox:"
+msgstr "Caixa de Correio:"
+
+#: src/mn-imap-mailbox-properties.gob:96
+msgid "in_box"
+msgstr "caixa de _entrada"
+
+#: src/mn-imap-mailbox-properties.gob:107
+msgid "oth_er:"
+msgstr "_outros"
+
+#: src/mn-imap-mailbox-properties.gob:122
+msgid "The hostname or IP address of the IMAP server"
+msgstr "O hostname ou endereço IP do servidor IMAP"
+
+#: src/mn-imap-mailbox-properties.gob:123
+msgid "Your username on the IMAP server"
+msgstr "O seu nome de utilizador no servidor IMAP"
+
+#: src/mn-imap-mailbox-properties.gob:124
+msgid "Your password on the IMAP server"
+msgstr "A sua senha no servidor IMAP"
+
+#: src/mn-imap-mailbox-properties.gob:125
+#: src/mn-imap-mailbox-properties.gob:126
+msgid "The port number of the IMAP server"
+msgstr "O número do porto do servidor IMAP"
+
+#: src/mn-imap-mailbox-properties.gob:127
+msgid "The mailbox name"
+msgstr "O nome da caixa de correio"
+
+#: src/mn-imap-mailbox.gob:112 src/mn-pop3-mailbox.gob:125
+#, fuzzy
+msgid "SSL/TLS support has not been compiled in"
+msgstr "suporte SSL não foi compilado"
+
+#: src/mn-imap-mailbox.gob:179
+msgid "server did not send capabilities"
+msgstr "servidor não enviou habilidades"
+
+#: src/mn-imap-mailbox.gob:292
+msgid "server advertised LOGINDISABLED, not using LOGIN authentication"
+msgstr "servidor anunciou LOGINDISABLED, não usando a autenticação LOGIN"
+
+#: src/mn-imap-mailbox.gob:293
+msgid "unable to login"
+msgstr "incapaz de ligar"
+
+#. compliance error
+#: src/mn-imap-mailbox.gob:361
+msgid "server did not send status"
+msgstr "servidor não enviou estado"
+
+#: src/mn-imap-mailbox.gob:583 src/mn-pop3-mailbox.gob:744
+msgid "unknown server error"
+msgstr "erro de servidor desconhecido"
+
+#: src/mn-imap-mailbox.gob:656 src/mn-pop3-mailbox.gob:210
+#, fuzzy
+msgid "server does not support in-band SSL/TLS"
+msgstr "servidor não suporta autenticação APOP"
+
+#: src/mn-imap-mailbox.gob:675 src/mn-pop3-mailbox.gob:674
+msgid ""
+"a SASL authentication mechanism was selected but SASL support has not been "
+"compiled in"
+msgstr ""
+"foi escolhido um mecanismo de autenticação SASL, mas o suporte SASL não foi "
+"compilado"
+
+#: src/mn-imap-mailbox.gob:683 src/mn-pop3-mailbox.gob:686
+#, c-format
+msgid "unknown authentication mechanism \"%s\""
+msgstr "mecanismo de autenticação desconhecido \"%s\""
+
+#: src/mn-imap-mailbox.gob:701
+msgid "falling back to IMAP LOGIN authentication"
+msgstr "recorrendo à autenticação IMAP LOGIN"
+
+#: src/mn-imap-mailbox.gob:705 src/mn-pop3-mailbox.gob:720
+msgid "authentication failed"
+msgstr "autenticação falhou"
+
+#: src/mn-mail-icon.gob:81
+msgid "_Update"
+msgstr "_Actualizar"
+
+#: src/mn-mail-icon.gob:87
+msgid "R_emove From Notification Area"
+msgstr "_Remover da área de notificação"
+
+#: src/mn-mail-icon.gob:172
+#, c-format
+msgid "_Run %s"
+msgstr "_Executar %s"
+
+#: src/mn-mail-icon.gob:173
+msgid "_Run Default Action"
+msgstr "_Executar acção por omissão"
+
+#: src/mn-mailbox-properties-dialog.c:109
+msgid "Add a Mailbox"
+msgstr "Acrescentar uma Caixa de Correio"
+
+#: src/mn-mailbox-properties-dialog.c:331
+#, c-format
+msgid "%s Properties"
+msgstr "Propriedades de %s"
+
+#: src/mn-mailbox-properties-util.c:77
+msgid "_Username:"
+msgstr "Nome de _Utilizador:"
+
+#: src/mn-mailbox-properties-util.c:87
+msgid "_Password:"
+msgstr "_Senha:"
+
+#: src/mn-mailbox-properties-util.c:154
+msgid "Connection type:"
+msgstr "Tipo de ligação:"
+
+#: src/mn-mailbox-properties-util.c:161
+msgid "Port:"
+msgstr "Porto:"
+
+#: src/mn-mailbox-properties-util.c:189
+msgid "_Authentication mechanism:"
+msgstr "Mecanismo de _Autenticação:"
+
+#: src/mn-mailbox-properties.c:63
+msgid "Label"
+msgstr "Rótulo"
+
+#: src/mn-mailbox-properties.c:64
+msgid "The marked up text to show in the type combo box"
+msgstr "O texto que aparece na combo box de tipo"
+
+#: src/mn-mailbox-properties.c:69
+msgid "Size group"
+msgstr "Grupo de tamanho"
+
+#: src/mn-mailbox-properties.c:70
+msgid "A GtkSizeGroup for aligning control labels"
+msgstr "Um GtkSizeGroup para alinhar rótulos de controlo"
+
+#: src/mn-mailbox-properties.c:75
+msgid "Complete"
+msgstr "Completo"
+
+#: src/mn-mailbox-properties.c:76
+msgid "Whether the properties are completely filled or not"
+msgstr "Se as propriedades estão completamente preenchidas"
+
+#: src/mn-mailbox-view.gob:254
+msgid "Mailbox"
+msgstr "Caixa de Correio"
+
+#: src/mn-mailbox-view.gob:268
+msgid "Format"
+msgstr "Formato"
+
+#: src/mn-mailbox-view.gob:543
+msgid "Unable to add mailbox"
+msgstr "Incapaz de adicionar caixa de correio"
+
+#: src/mn-mailbox-view.gob:543
+msgid "The mailbox is already in the list."
+msgstr "A caixa de correio já está na lista."
+
+#: src/mn-mailbox.gob:122
+msgid "The mailbox URI"
+msgstr "O URI da caixa de correio"
+
+#: src/mn-mailbox.gob:133
+msgid "The mailbox human-readable name"
+msgstr "O nome legível da caixa de correio"
+
+#: src/mn-mailbox.gob:137
+msgid "Whether the mailbox has to be manually checked or not"
+msgstr "Se a caixa de correio tem de ser manualmente verificada"
+
+#: src/mn-mailbox.gob:142
+msgid "Whether the mailbox has new mail or not"
+msgstr "Se a caixa de correio tem novo correio"
+
+#: src/mn-mailbox.gob:147
+msgid "The mailbox error, if any"
+msgstr "O erro da caixa de correio, se houver"
+
+#: src/mn-mailbox.gob:251
+msgid "does not exist"
+msgstr "não existe"
+
+#: src/mn-mailbox.gob:287
+msgid "unknown format"
+msgstr "formato desconhecido"
+
+#: src/mn-mailbox.gob:355
+#, c-format
+msgid "unable to monitor %s: %s"
+msgstr "incapaz de monitorizar %s: %s"
+
+#: src/mn-mailbox.gob:369
+#, c-format
+msgid ""
+"As a fallback, they will be checked every %i second (this delay is "
+"configurable from the Properties Dialog)."
+msgid_plural ""
+"As a fallback, they will be checked every %i seconds (this delay is "
+"configurable from the Properties Dialog)."
+msgstr[0] ""
+"Como medida de recurso, serão verificadas a cada %i segundo (este atraso é "
+"configurável no Diálogo de Propriedades)."
+msgstr[1] ""
+"Como medida de recurso, serão verificadas a cada %i segundos (este atraso é "
+"configurável no Diálogo de Propriedades)."
+
+#: src/mn-mailbox.gob:380
+#, c-format
+msgid ""
+"As a fallback, they will be checked every %i minute (this delay is "
+"configurable from the Properties Dialog)."
+msgid_plural ""
+"As a fallback, they will be checked every %i minutes (this delay is "
+"configurable from the Properties Dialog)."
+msgstr[0] ""
+"Como medida de recurso, serão verificadas a cada %i minuto (este atraso é "
+"configurável no Diálogo de Propriedades)."
+msgstr[1] ""
+"Como medida de recurso, serão verificadas a cada %i minutos (este atraso é "
+"configurável no Diálogo de Propriedades)."
+
+#: src/mn-mailbox.gob:391
+#, c-format
+msgid ""
+"As a fallback, they will be checked approximately every %i minute (this "
+"delay is configurable from the Properties Dialog)."
+msgid_plural ""
+"As a fallback, they will be checked approximately every %i minutes (this "
+"delay is configurable from the Properties Dialog)."
+msgstr[0] ""
+"Como medida de recurso, serão verificadas aproximadamente cada %i minuto "
+"(este atraso é configurável no Diálogo de Propriedades)."
+msgstr[1] ""
+"Como medida de recurso, serão verificadas aproximadamente cada %i minutos "
+"(este atraso é configurável no Diálogo de Propriedades)."
+
+#: src/mn-mailbox.gob:405
+msgid "A monitoring error has occurred"
+msgstr "Ocorreu um erro de monitorização"
+
+#: src/mn-mailbox.gob:406
+#, fuzzy, c-format
+msgid ""
+"Mail Notification was unable to enable immediate notification for one or "
+"more mailboxes. %s"
+msgstr ""
+"A Notificação de Correio foi incapaz de activar notificação automática para "
+"uma ou mais caixas de correio. %s"
+
+#: src/mn-mailboxes.gob:143
+#, c-format
+msgid "%s is unsupported: %s"
+msgstr "%s não é suportado: %s"
+
+#: src/mn-mailboxes.gob:170
+#, c-format
+msgid "%s has new mail"
+msgstr "%s tem correio novo"
+
+#: src/mn-mailboxes.gob:170
+#, c-format
+msgid "%s has no new mail"
+msgstr "%s não tem correio novo"
+
+#: src/mn-mailboxes.gob:186
+#, c-format
+msgid "%s reported an error: %s"
+msgstr "%s relatou um erro: %s"
+
+#: src/mn-maildir-mailbox.gob:109
+#, c-format
+msgid "unable to open folder \"new\": %s"
+msgstr "incapaz de abrir pasta \"new\": %s"
+
+#: src/mn-maildir-mailbox.gob:137
+#, c-format
+msgid "unable to close folder \"new\": %s"
+msgstr "incapaz de fechar pasta \"new\": %s"
+
+#: src/mn-maildir-mailbox.gob:140
+#, c-format
+msgid "error while reading folder \"new\": %s"
+msgstr "erro ao ler pasta \"new\": %s"
+
+#: src/mn-main.c:85
+#, c-format
+msgid "Compiled-in mailbox backends: %s\n"
+msgstr "Backends mailbox compilados: %s\n"
+
+#: src/mn-main.c:103
+#, c-format
+msgid "Compiled-in features: %s\n"
+msgstr "Características compiladas: %s\n"
+
+#: src/mn-main.c:133
+msgid "Enable informational output"
+msgstr "Activar output informacional"
+
+#: src/mn-main.c:142
+msgid "List compiled-in features and exit"
+msgstr "Listar características compiladas e sair"
+
+#: src/mn-main.c:151
+msgid "Display the properties dialog"
+msgstr "Mostrar o diálogo de propriedades"
+
+#: src/mn-main.c:160
+msgid "Display the about dialog"
+msgstr "Mostrar o diálogo Sobre"
+
+#: src/mn-main.c:169
+msgid "Update the mail status"
+msgstr "Actualizar o estado do correio"
+
+#: src/mn-main.c:178
+msgid "Report the mail status"
+msgstr "Relatar o estado do correio"
+
+#: src/mn-main.c:187
+msgid "Unset obsolete GConf configuration and exit"
+msgstr ""
+
+#.
+#. * We can't use mn_error_dialog() because gtk_init() has not been
+#. * called yet.
+#.
+#: src/mn-main.c:213
+msgid "multi-threading is not available"
+msgstr "multi-threading não está disponível"
+
+#: src/mn-main.c:258
+msgid ""
+"Bonobo could not locate the automation object. Please check your Mail "
+"Notification installation."
+msgstr ""
+"Bonobo não conseguiu encontrar o objecto de automação. Por favor verifique a "
+"sua instalação de Notificação de Correio."
+
+#: src/mn-main.c:263
+msgid "Unable to initialize the GnomeVFS library."
+msgstr "Incapaz de inicializar a biblioteca GnomeVFS."
+
+#: src/mn-main.c:285
+msgid "updating the mail status"
+msgstr "actualizando o estado do correio"
+
+#: src/mn-main.c:301
+msgid "Mail Notification is already running"
+msgstr "Notificação de Correio já está a ser executado"
+
+#: src/mn-main.c:308
+msgid ""
+"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
+"Please check your Mail Notification installation."
+msgstr ""
+"Bonobo não conseguiu encontrar o ficheiro GNOME_MailNotification_Automation."
+"server. Por favor verifique a sua instalação da Notificação de Correio."
+
+#: src/mn-main.c:312
+msgid ""
+"Bonobo was unable to register the automation server. Please check your Mail "
+"Notification installation."
+msgstr ""
+"Bonobo foi incapaz de registar o servidor de automação. Por favor verifique "
+"a sua instalação da Notificação de Correio."
+
+#: src/mn-mbox-mailbox.gob:171
+#, c-format
+msgid "error while reading mailbox: %s"
+msgstr "erro ao ler a caixa de correio: %s"
+
+#: src/mn-mbox-mailbox.gob:179
+#, c-format
+msgid "unable to open mailbox: %s"
+msgstr "erro ao abrir a caixa de correio: %s"
+
+#: src/mn-mh-mailbox.gob:122
+#, c-format
+msgid "error while reading .mh_sequences: %s"
+msgstr "erro ao ler .mh_sequences: %s"
+
+#: src/mn-mh-mailbox.gob:130
+#, c-format
+msgid "unable to open .mh_sequences: %s"
+msgstr "erro ao abrir .mh_sequences: %s"
+
+#: src/mn-pending-mailbox.gob:33
+msgid "detecting"
+msgstr "detectando"
+
+#: src/mn-pi-mailbox-properties.gob:74
+msgid "_Hostname:"
+msgstr "_Hostname:"
+
+#: src/mn-pi-mailbox-properties.gob:92
+msgid "_Details"
+msgstr "_Detalhes"
+
+#: src/mn-pi-mailbox-properties.gob:104
+msgid "sta_ndard"
+msgstr "sta_ndard"
+
+#: src/mn-pi-mailbox-properties.gob:114
+msgid "_in-band SSL/TLS"
+msgstr ""
+
+#: src/mn-pi-mailbox-properties.gob:124
+msgid "SSL/TLS on sepa_rate port"
+msgstr ""
+
+#: src/mn-pop3-mailbox-properties.gob:84
+msgid "The hostname or IP address of the POP3 server"
+msgstr "O hostname ou endereço IP do servidor POP3"
+
+#: src/mn-pop3-mailbox-properties.gob:85
+msgid "Your username on the POP3 server"
+msgstr "O seu nome de utilizador no servidor POP3"
+
+#: src/mn-pop3-mailbox-properties.gob:86
+msgid "Your password on the POP3 server"
+msgstr "A sua senha no servidor POP3"
+
+#: src/mn-pop3-mailbox-properties.gob:87 src/mn-pop3-mailbox-properties.gob:88
+msgid "The port number of the POP3 server"
+msgstr "O número do porto do servidor POP3"
+
+#: src/mn-pop3-mailbox.gob:256
+msgid "invalid arguments for the LOGIN-DELAY capability"
+msgstr "argumentos inválidos para a habilidade LOGIN-DELAY"
+
+#: src/mn-pop3-mailbox.gob:523
+#, c-format
+msgid "honouring LOGIN-DELAY, sleeping for %i second"
+msgid_plural "honouring LOGIN-DELAY, sleeping for %i seconds"
+msgstr[0] "honrando LOGIN-DELAY, dormindo por %i segundo"
+msgstr[1] "honrando LOGIN-DELAY, dormindo por %i segundos"
+
+#: src/mn-pop3-mailbox.gob:682
+msgid "server does not support APOP authentication"
+msgstr "servidor não suporta autenticação APOP"
+
+#: src/mn-pop3-mailbox.gob:710
+msgid "falling back to APOP authentication"
+msgstr "recorrendo a autenticação APOP"
+
+#: src/mn-pop3-mailbox.gob:715
+msgid "falling back to USER/PASS authentication"
+msgstr "recorrendo a autenticação USER/PASS"
+
+#: src/mn-properties.c:151
+msgid "No mailbox selected."
+msgstr "Nenhuma caixa de correio seleccionada."
+
+#: src/mn-properties.c:156
+#, c-format
+msgid "%i mailbox selected."
+msgid_plural "%i mailboxes selected."
+msgstr[0] "%i caixa de correio seleccionada."
+msgstr[1] "%i caixas de correio seleccionadas."
+
+#: src/mn-shell.gob:204
+msgid "A command error has occurred"
+msgstr "ocorreu um erro de comando"
+
+#: src/mn-shell.gob:205
+#, c-format
+msgid "Unable to execute double-clicked command: %s."
+msgstr "Incapaz de executar comando de duplo-clique: %s."
+
+#: src/mn-shell.gob:292
+msgid "The following mailbox has new mail:\n"
+msgid_plural "The following mailboxes have new mail:\n"
+msgstr[0] "A seguinte caixa de correio tem novo correio:\n"
+msgstr[1] "As seguintes caixas de correio têm novo correio:\n"
+
+#: src/mn-shell.gob:296
+msgid "You have no new mail."
+msgstr "Não tem correio novo."
+
+#: src/mn-shell.gob:299
+msgid "The following mailbox reported an error:\n"
+msgid_plural "The following mailboxes reported an error:\n"
+msgstr[0] "A seguinte caixa de correio relatou um erro:\n"
+msgstr[1] "As seguintes caixas de correios relataram um erro:\n"
+
+#: src/mn-shell.gob:304
+msgid "The following mailbox is unsupported:\n"
+msgid_plural "The following mailboxes are unsupported:\n"
+msgstr[0] "A seguinte caixa de correio não é suportada:\n"
+msgstr[1] "As seguintes caixas de correio não são suportadas:\n"
+
+#: src/mn-shell.gob:320
+msgid "You have new mail."
+msgstr "Tem novo correio."
+
+#: src/mn-shell.gob:330
+msgid "A command error has occurred in Mail Notification"
+msgstr "Ocorreu um erro de comando na Notificação de Correio"
+
+#: src/mn-shell.gob:331
+#, c-format
+msgid "Unable to execute new mail command: %s."
+msgstr "Incapaz de executar o novo comando de correio: %s."
+
+#: src/mn-ssl.c:79
+#, fuzzy
+msgid "unknown SSL/TLS error"
+msgstr "erro de servidor desconhecido"
+
+#: src/mn-stock.c:28
+msgid "Select _All"
+msgstr "Seleccionar _Todas"
+
+#: src/mn-sylpheed-mailbox.gob:93
+#, c-format
+msgid "unable to open folder: %s"
+msgstr "incapaz de abrir pasta: %s"
+
+#: src/mn-sylpheed-mailbox.gob:127
+#, c-format
+msgid "unable to close folder: %s"
+msgstr "incapaz de fechar pasta: %s"
+
+#: src/mn-sylpheed-mailbox.gob:130
+#, c-format
+msgid "error while reading folder: %s"
+msgstr "erro ao ler pasta: %s"
+
+#: src/mn-system-mailbox-properties.gob:32 src/mn-uri.gob:391
+msgid "System Mailbox"
+msgstr "Caixa de Correio de Sistema"
+
+#: src/mn-system-mailbox-properties.gob:55
+#, c-format
+msgid "Your system mailbox (<span weight=\"bold\">%s</span>) will be used."
+msgstr ""
+"Será usada a sua caixa de correio de sistema (<span weight=\"bold\">%s</"
+"span>)."
+
+#: src/mn-system-mailbox-properties.gob:62
+msgid ""
+"The location of your system mailbox could not be detected. Please set the "
+"MAIL environment variable."
+msgstr ""
+"A localização da sua caixa de correi ode sistema não pode ser detectada. Por "
+"favor defina a variável de ambiente MAIL."
+
+#: src/mn-unsupported-mailbox.gob:31
+msgid "The reason why the mailbox is unsupported"
+msgstr "A razão pela qual a caixa de correio não é suportada"
+
+#: src/mn-unsupported-mailbox.gob:38
+msgid "unsupported"
+msgstr "não suportado"
+
+#: src/mn-util.c:199
+#, c-format
+msgid "error loading image: %s"
+msgstr "erro ao carregar imagem: %s"
+
+#: src/mn-util.c:237
+#, c-format
+msgid "widget %s not found in interface %s"
+msgstr "widget %s não foi encontrada na interface %s"
+
+#: src/mn-util.c:355
+msgid "received an invalid URI list"
+msgstr "recebida uma lista de URIs inválida"
+
+#: src/mn-util.c:391
+msgid "received an invalid Mozilla URL"
+msgstr "recebido um URL Mozilla inválido"
+
+#: src/mn-util.c:484
+msgid "Unable to display help"
+msgstr "Incapaz de mostrar ajuda"
+
+#: src/mn-util.c:498
+#, c-format
+msgid "Unable to create a thread: %s."
+msgstr "Incapaz de criar uma thread: %s."
+
+#: src/mn-util.c:701
+msgid "A fatal error has occurred in Mail Notification"
+msgstr "Ocorreu um erro fatal na Notificação de Correio"
+
+#: ui/mailbox-properties.glade.h:1
+msgid "_Mailbox type:"
+msgstr "_Tipo de caixa de correio:"
+
+#: ui/properties.glade.h:1
+msgid " "
+msgstr " "
+
+#: ui/properties.glade.h:2
+msgid "*"
+msgstr "*"
+
+#: ui/properties.glade.h:3
+msgid "<span weight=\"bold\">Commands</span>"
+msgstr "<span weight=\"bold\">Comandos</span>"
+
+#: ui/properties.glade.h:4
+msgid "<span weight=\"bold\">General</span>"
+msgstr "<span weight=\"bold\">Geral</span>"
+
+#: ui/properties.glade.h:5
+msgid "<span weight=\"bold\">Mailboxes</span>"
+msgstr "<span weight=\"bold\">Caixas de Correio</span>"
+
+#: ui/properties.glade.h:6
+msgid "Mail Notification Properties"
+msgstr "Propriedades de Notificação de Correio"
+
+#: ui/properties.glade.h:7
+msgid "The amount of time to wait between mail checks"
+msgstr "A quantidade de tempo a esperar entre verificações de correio"
+
+#: ui/properties.glade.h:8
+msgid "The command to run when new mail arrives"
+msgstr "O comando a executar quando chega novo correio"
+
+#: ui/properties.glade.h:9
+msgid "The command to run when the icon is double-clicked"
+msgstr "O comando a executar quando fizer duplo-clique no ícone"
+
+#: ui/properties.glade.h:10
+msgid "When _new mail arrives:"
+msgstr "Quando chega _novo correio:"
+
+#: ui/properties.glade.h:11
+msgid "When double-click_ed:"
+msgstr "Quando há um duplo-clique:"
+
+#: ui/properties.glade.h:12
+#, fuzzy
+msgid "Whether the status icon should blink on errors or not"
+msgstr "Se a imagem pisca ou não"
+
+#: ui/properties.glade.h:13
+msgid "Whether to run a command when new mail arrives or not"
+msgstr "Se deve ser executado um comando quando chega novo correio"
+
+#: ui/properties.glade.h:14
+msgid "Whether to run a command when the icon is double-clicked or not"
+msgstr "Se deve ser executado um comando quando fizer duplo-clique no ícone"
+
+#: ui/properties.glade.h:15
+#, fuzzy
+msgid ""
+"Whether to start Mail Notification when you log into your GNOME session or "
+"not"
+msgstr "Se a Notificação de Correio já foi executada ou não."
+
+#: ui/properties.glade.h:16
+msgid "_Blink on errors"
+msgstr ""
+
+#: ui/properties.glade.h:17
+msgid "_Delay between mail checks:"
+msgstr "_Intervalo entre verificações de correio:"
+
+#: ui/properties.glade.h:18
+#, fuzzy
+msgid "_Start Mail Notification on GNOME login"
+msgstr "Um Ícone de Notificação de Correio"
+
+#: ui/properties.glade.h:19
+msgid "minutes"
+msgstr "minutos"
+
+#: ui/properties.glade.h:20
+msgid "seconds"
+msgstr "segundos"
+
+#: ui/welcome.glade.h:1
+#, fuzzy
+msgid ""
+"<span weight=\"bold\" size=\"larger\">First startup</span>\n"
+"\n"
+"Mail Notification has been loaded successfully.\n"
+"\n"
+"Since this is the first time you run Mail Notification, you might want to "
+"configure it.\n"
+"\n"
+"Note: this message will not be shown anymore. To configure Mail Notification "
+"again, choose <span weight=\"bold\">Applications</span> → <span weight=\"bold"
+"\">Desktop Preferences</span> → <span weight=\"bold\">Mail Notification</"
+"span> (or on some systems <span weight=\"bold\">Applications → Preferences → "
+"More Preferences → Mail Notification</span>)."
+msgstr ""
+"<span weight=\"bold\" size=\"larger\">Primeira Utilização</span>\n"
+"\n"
+"A Notificação de Correio foi carregada com sucesso.\n"
+"\n"
+"Como esta é a primeira vez que executa a Notificação de Correio, talvez "
+"queira configurá-la.\n"
+"\n"
+"Nota: esta mensagem não será mostrada de novo. Para configurar a Notificação "
+"de Correio outra vez, escolha <span weight=\"bold\">Aplicações</span> <span "
+"weight=\"bold\">Preferências do Ambiente</span> <span weight=\"bold"
+"\">Notificação de Correio</span>."
+
+#: ui/welcome.glade.h:8
+msgid "_Configure Mail Notification"
+msgstr "_Configurar Notificação de Correio"
+
+#: ui/welcome.glade.h:9
+msgid "_Skip configuration"
+msgstr "_Saltar configuração"
+
+#~ msgid "unable to parse Gmail URI"
+#~ msgstr "incapaz de processar URI Gmail"
+
+#~ msgid "unable to parse IMAP URI"
+#~ msgstr "incapaz de processar URI IMAP"
+
+#~ msgid "_SSL"
+#~ msgstr "_SSL"
+
+#~ msgid "unable to parse POP3 URI"
+#~ msgstr "incapaz de processar URI POP3"
diff --git a/po/ru.gmo b/po/ru.gmo
Binary files differ.
diff --git a/po/ru.po b/po/ru.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mail-notification 0.5.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-08-19 00:12+0200\n"
+"POT-Creation-Date: 2004-09-09 01:43+0200\n"
"PO-Revision-Date: 2004-07-21 21:58+0200\n"
"Last-Translator: Dan Korostelev <dan@ats.energo.ru>\n"
"Language-Team: Russian\n"
@@ -38,7 +38,7 @@ msgstr "Иконка входящих сообщений"
#: data/mail-notification-properties.desktop.in.h:2
#: data/mail-notification.desktop.in.h:2
#: data/mail-notification.soundlist.in.h:1 src/mn-about-dialog.gob:38
-#: src/mn-mail-icon.gob:160 src/mn-main.c:212
+#: src/mn-mail-icon.gob:160 src/mn-main.c:221
msgid "Mail Notification"
msgstr "Иконка входящих сообщений"
@@ -48,95 +48,121 @@ msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
#: data/mail-notification.schemas.in.h:1
-msgid "Delay between mail checks (minutes part)."
+msgid "Blink on errors"
msgstr ""
#: data/mail-notification.schemas.in.h:2
-msgid "Delay between mail checks (seconds part)."
+msgid "Delay between mail checks (minutes part)."
msgstr ""
#: data/mail-notification.schemas.in.h:3
-msgid "Double-clicked command"
+msgid "Delay between mail checks (seconds part)."
msgstr ""
#: data/mail-notification.schemas.in.h:4
-msgid "Has already been run"
+msgid "Double-clicked command"
msgstr ""
#: data/mail-notification.schemas.in.h:5
-msgid "Height of properties dialog"
+msgid "Fingerprints of trusted X509 certificates"
msgstr ""
#: data/mail-notification.schemas.in.h:6
-msgid "Mailboxes list"
+msgid "Has already been run"
msgstr ""
#: data/mail-notification.schemas.in.h:7
-msgid "Minutes between mail checks"
+msgid "Height of properties dialog"
msgstr ""
#: data/mail-notification.schemas.in.h:8
-msgid "New mail command"
+msgid "Mailboxes list"
msgstr ""
#: data/mail-notification.schemas.in.h:9
+msgid "Minutes between mail checks"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:10
+msgid "New mail command"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:11
#, fuzzy
msgid "Run a command when new mail arrives"
msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
-#: data/mail-notification.schemas.in.h:10
+#: data/mail-notification.schemas.in.h:12
#, fuzzy
msgid "Run a command when the icon is double-clicked"
msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
-#: data/mail-notification.schemas.in.h:11
+#: data/mail-notification.schemas.in.h:13
msgid "Seconds between mail checks"
msgstr ""
-#: data/mail-notification.schemas.in.h:12
+#: data/mail-notification.schemas.in.h:14
#, fuzzy
msgid "The command to run when new mail arrives."
msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
-#: data/mail-notification.schemas.in.h:13
+#: data/mail-notification.schemas.in.h:15
#, fuzzy
msgid "The command to run when the icon is double-clicked."
msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
-#: data/mail-notification.schemas.in.h:14
+#: data/mail-notification.schemas.in.h:16
msgid "The height of the properties dialog in pixels."
msgstr ""
-#: data/mail-notification.schemas.in.h:15
+#: data/mail-notification.schemas.in.h:17
msgid "The list of mailboxes to monitor."
msgstr ""
-#: data/mail-notification.schemas.in.h:16
+#: data/mail-notification.schemas.in.h:18
+msgid ""
+"The list of trusted SSL/TLS servers (hostname:port) lacking a X509 "
+"certificate."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:19
+msgid ""
+"The list of trusted X509 certificates, represented by their MD5 fingerprint."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:20
msgid "The width of the properties dialog in pixels."
msgstr ""
-#: data/mail-notification.schemas.in.h:17
-#, fuzzy
+#: data/mail-notification.schemas.in.h:21
+msgid "Trusted servers list"
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:22
msgid "Whether Mail Notification has already been run or not."
-msgstr "Иконка входящих сообщений"
+msgstr ""
-#: data/mail-notification.schemas.in.h:18
+#: data/mail-notification.schemas.in.h:23
+msgid "Whether the status icon should blink on errors or not."
+msgstr ""
+
+#: data/mail-notification.schemas.in.h:24
#, fuzzy
msgid "Whether to run a command when new mail arrives or not."
msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
-#: data/mail-notification.schemas.in.h:19
+#: data/mail-notification.schemas.in.h:25
#, fuzzy
msgid "Whether to run a command when the icon is double-clicked or not."
msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
-#: data/mail-notification.schemas.in.h:20
+#: data/mail-notification.schemas.in.h:26
msgid "Width of properties dialog"
msgstr ""
@@ -160,23 +186,23 @@ msgstr ""
msgid "Jean-Yves Lefort <jylefort@brutele.be>"
msgstr "Dan Korostelev <dan@ats.energo.ru>"
-#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:36
+#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:35
msgid "<span style=\"italic\">autodetect</span>"
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:67
+#: src/mn-autodetect-mailbox-properties.gob:66
msgid "_Location:"
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:73
+#: src/mn-autodetect-mailbox-properties.gob:72
msgid "_Browse..."
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:80
+#: src/mn-autodetect-mailbox-properties.gob:79
msgid "The URI of the mailbox"
msgstr ""
-#: src/mn-autodetect-mailbox-properties.gob:117
+#: src/mn-autodetect-mailbox-properties.gob:116
msgid "Select a File or Folder"
msgstr ""
@@ -184,222 +210,270 @@ msgstr ""
msgid "Whether the image is blinking or not"
msgstr ""
-#: src/mn-client-session.c:195 src/mn-client-session.c:202
+#: src/mn-client-session.c:196 src/mn-client-session.c:203
#, c-format
msgid "unable to read from server: %s"
msgstr ""
-#: src/mn-client-session.c:200
+#: src/mn-client-session.c:201
msgid "unable to read from server: EOF"
msgstr ""
-#: src/mn-client-session.c:212
+#: src/mn-client-session.c:213
#, c-format
msgid "unable to decode data using SASL: %s"
msgstr ""
-#: src/mn-client-session.c:286
+#: src/mn-client-session.c:284
#, c-format
msgid "resolving %s"
msgstr ""
-#: src/mn-client-session.c:296
+#: src/mn-client-session.c:294
#, c-format
msgid "unable to resolve %s: %s"
msgstr ""
-#: src/mn-client-session.c:333
+#: src/mn-client-session.c:331
#, c-format
msgid "%s: unsupported address family"
msgstr ""
-#: src/mn-client-session.c:340
+#: src/mn-client-session.c:338
#, c-format
msgid "%s: unable to create socket: %s"
msgstr ""
-#: src/mn-client-session.c:344
+#: src/mn-client-session.c:342
#, c-format
msgid "connecting to %s (%s) port %i"
msgstr ""
-#: src/mn-client-session.c:347
+#: src/mn-client-session.c:345
#, c-format
msgid "unable to connect: %s"
msgstr ""
-#: src/mn-client-session.c:352
+#: src/mn-client-session.c:350
msgid "connected successfully"
msgstr ""
#. if reached, we couldn't find a working address
-#: src/mn-client-session.c:358
+#: src/mn-client-session.c:356
#, c-format
msgid "unable to connect to %s"
msgstr ""
-#: src/mn-client-session.c:374
+#: src/mn-client-session.c:372
#, c-format
msgid "unable to initialize the OpenSSL library: %s"
msgstr ""
-#: src/mn-client-session.c:382
+#: src/mn-client-session.c:380
+#, c-format
+msgid "unable to create a SSL/TLS object: %s"
+msgstr ""
+
+#: src/mn-client-session.c:386
#, c-format
-msgid "unable to create a SSL object: %s"
+msgid "unable to set the SSL/TLS file descriptor: %s"
+msgstr ""
+
+#: src/mn-client-session.c:392
+#, c-format
+msgid "unable to perform the SSL/TLS handshake: %s"
+msgstr ""
+
+#: src/mn-client-session.c:398
+msgid "untrusted server"
+msgstr ""
+
+#: src/mn-client-session.c:402
+#, c-format
+msgid "a SSL/TLS layer is now active (%s, %s %i-bit)"
+msgstr ""
+
+#: src/mn-client-session.c:449
+#, c-format
+msgid "%s, fingerprint: %s"
+msgstr ""
+
+#: src/mn-client-session.c:478
+msgid "missing certificate"
msgstr ""
-#: src/mn-client-session.c:388
+#: src/mn-client-session.c:504
#, c-format
-msgid "unable to set the SSL file descriptor: %s"
+msgid ""
+"Mail Notification was unable to trust \"%s\" (%s). It is possible that "
+"someone is intercepting your communication to obtain your confidential "
+"information.\n"
+"\n"
+"You should only connect to the server if you are certain you are connected "
+"to \"%s\". If you choose to connect to the server, this message will not be "
+"shown again."
+msgstr ""
+
+#: src/mn-client-session.c:521
+msgid "Connect to untrusted server?"
msgstr ""
-#: src/mn-client-session.c:443
+#: src/mn-client-session.c:526
+msgid "Co_nnect"
+msgstr ""
+
+#: src/mn-client-session.c:584
#, c-format
msgid "response \"%s\" is not valid in current context"
msgstr ""
-#: src/mn-client-session.c:469
+#: src/mn-client-session.c:610
#, c-format
msgid "unable to parse response \"%s\""
msgstr ""
-#: src/mn-client-session.c:516
+#: src/mn-client-session.c:657
#, c-format
msgid "unable to encode data using SASL: %s"
msgstr ""
-#: src/mn-client-session.c:545 src/mn-client-session.c:552
+#: src/mn-client-session.c:688 src/mn-client-session.c:695
#, c-format
msgid "unable to write to server: %s"
msgstr ""
-#: src/mn-client-session.c:550
+#: src/mn-client-session.c:693
msgid "unable to write to server: EOF"
msgstr ""
-#: src/mn-client-session.c:582
+#: src/mn-client-session.c:725
#, c-format
msgid "unable to encode Base64: %s"
msgstr ""
-#: src/mn-client-session.c:685
+#: src/mn-client-session.c:828
#, c-format
msgid "unable to initialize the SASL library: %s"
msgstr ""
-#: src/mn-client-session.c:694
+#: src/mn-client-session.c:837
#, c-format
msgid "unable to retrieve local address of socket: %s"
msgstr ""
-#: src/mn-client-session.c:700
+#: src/mn-client-session.c:843
#, c-format
msgid "unable to retrieve remote address of socket: %s"
msgstr ""
-#: src/mn-client-session.c:734
+#: src/mn-client-session.c:877
#, c-format
msgid "warning: unable to set SASL security properties: %s"
msgstr ""
-#: src/mn-client-session.c:773
+#: src/mn-client-session.c:916
msgid ""
"unable to start SASL authentication: SASL asked for something we did not know"
msgstr ""
-#: src/mn-client-session.c:777
+#: src/mn-client-session.c:920
#, c-format
msgid "unable to start SASL authentication: %s"
msgstr ""
-#: src/mn-client-session.c:781
+#: src/mn-client-session.c:924
#, c-format
msgid "unable to create a SASL connection: %s"
msgstr ""
-#: src/mn-client-session.c:831
+#: src/mn-client-session.c:974
msgid "SASL asked for something we did not know, aborting SASL authentication"
msgstr ""
-#: src/mn-client-session.c:835
+#: src/mn-client-session.c:978
#, c-format
msgid "%s, aborting SASL authentication"
msgstr ""
#. compliance error
-#: src/mn-client-session.c:840
+#: src/mn-client-session.c:983
#, c-format
msgid "unable to decode Base64 input from server: %s"
msgstr ""
-#: src/mn-client-session.c:843
+#: src/mn-client-session.c:986
msgid ""
"the server sent a SASL challenge, but there was a pending initial SASL "
"client response"
msgstr ""
-#: src/mn-client-session.c:857
+#: src/mn-client-session.c:1000
msgid ""
"the server did not send a SASL challenge, but there was no pending initial "
"SASL client response"
msgstr ""
-#: src/mn-client-session.c:880
+#: src/mn-client-session.c:1023
#, c-format
msgid "a SASL security layer of strength factor %i is now active"
msgstr ""
#. a security layer is active but we can't retrieve maxoutbuf -> fatal
-#: src/mn-client-session.c:885
+#: src/mn-client-session.c:1028
#, c-format
msgid "unable to get SASL_MAXOUTBUF property: %s"
msgstr ""
-#: src/mn-client-session.c:891
+#: src/mn-client-session.c:1034
#, c-format
msgid "warning: unable to get SASL_SSF property: %s"
msgstr ""
-#: src/mn-dialog.c:108
-msgid "A fatal error has occurred in Mail Notification"
+#: src/mn-conf.c:109
+#, c-format
+msgid "recursively unsetting %s"
msgstr ""
-#: src/mn-gmail-mailbox-properties.gob:78
-msgid "Your Gmail username"
+#: src/mn-conf.c:113
+msgid "syncing the GConf database"
msgstr ""
-#: src/mn-gmail-mailbox-properties.gob:79
-msgid "Your Gmail password"
+#: src/mn-conf.c:116
+msgid "completed"
msgstr ""
-#: src/mn-gmail-mailbox.gob:65
-msgid "unable to parse Gmail URI"
+#: src/mn-gmail-mailbox-properties.gob:77
+msgid "Your Gmail username"
msgstr ""
-#: src/mn-gmail-mailbox.gob:182
+#: src/mn-gmail-mailbox-properties.gob:78
+msgid "Your Gmail password"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:220
msgid "logging in"
msgstr ""
-#: src/mn-gmail-mailbox.gob:201 src/mn-gmail-mailbox.gob:240
-#: src/mn-gmail-mailbox.gob:273 src/mn-gmail-mailbox.gob:377
+#: src/mn-gmail-mailbox.gob:239 src/mn-gmail-mailbox.gob:279
+#: src/mn-gmail-mailbox.gob:313 src/mn-gmail-mailbox.gob:418
#, c-format
msgid "unable to transfer data: %s"
msgstr ""
-#: src/mn-gmail-mailbox.gob:226 src/mn-gmail-mailbox.gob:259
-#: src/mn-gmail-mailbox.gob:293
+#: src/mn-gmail-mailbox.gob:265 src/mn-gmail-mailbox.gob:299
+#: src/mn-gmail-mailbox.gob:334
msgid "login failed"
msgstr ""
-#: src/mn-gmail-mailbox.gob:287
+#: src/mn-gmail-mailbox.gob:328
msgid "successfully logged in"
msgstr ""
-#: src/mn-gmail-mailbox.gob:365
+#: src/mn-gmail-mailbox.gob:406
msgid "searching for unread mail"
msgstr ""
-#: src/mn-gmail-mailbox.gob:384
+#: src/mn-gmail-mailbox.gob:427
msgid "unable to parse Gmail data"
msgstr ""
@@ -415,72 +489,72 @@ msgstr ""
msgid "oth_er:"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:121
+#: src/mn-imap-mailbox-properties.gob:122
msgid "The hostname or IP address of the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:122
+#: src/mn-imap-mailbox-properties.gob:123
msgid "Your username on the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:123
+#: src/mn-imap-mailbox-properties.gob:124
msgid "Your password on the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:124
#: src/mn-imap-mailbox-properties.gob:125
+#: src/mn-imap-mailbox-properties.gob:126
msgid "The port number of the IMAP server"
msgstr ""
-#: src/mn-imap-mailbox-properties.gob:126
+#: src/mn-imap-mailbox-properties.gob:127
msgid "The mailbox name"
msgstr ""
-#: src/mn-imap-mailbox.gob:124 src/mn-pop3-mailbox.gob:133
-msgid "SSL support has not been compiled in"
+#: src/mn-imap-mailbox.gob:112 src/mn-pop3-mailbox.gob:125
+msgid "SSL/TLS support has not been compiled in"
msgstr ""
-#: src/mn-imap-mailbox.gob:128
-msgid "unable to parse IMAP URI"
-msgstr ""
-
-#: src/mn-imap-mailbox.gob:195
+#: src/mn-imap-mailbox.gob:179
msgid "server did not send capabilities"
msgstr ""
-#: src/mn-imap-mailbox.gob:267
+#: src/mn-imap-mailbox.gob:292
msgid "server advertised LOGINDISABLED, not using LOGIN authentication"
msgstr ""
-#: src/mn-imap-mailbox.gob:268
+#: src/mn-imap-mailbox.gob:293
msgid "unable to login"
msgstr ""
#. compliance error
-#: src/mn-imap-mailbox.gob:336
+#: src/mn-imap-mailbox.gob:361
msgid "server did not send status"
msgstr ""
-#: src/mn-imap-mailbox.gob:554 src/mn-pop3-mailbox.gob:715
+#: src/mn-imap-mailbox.gob:583 src/mn-pop3-mailbox.gob:744
msgid "unknown server error"
msgstr ""
-#: src/mn-imap-mailbox.gob:625 src/mn-pop3-mailbox.gob:645
+#: src/mn-imap-mailbox.gob:656 src/mn-pop3-mailbox.gob:210
+msgid "server does not support in-band SSL/TLS"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:675 src/mn-pop3-mailbox.gob:674
msgid ""
"a SASL authentication mechanism was selected but SASL support has not been "
"compiled in"
msgstr ""
-#: src/mn-imap-mailbox.gob:633 src/mn-pop3-mailbox.gob:657
+#: src/mn-imap-mailbox.gob:683 src/mn-pop3-mailbox.gob:686
#, c-format
msgid "unknown authentication mechanism \"%s\""
msgstr ""
-#: src/mn-imap-mailbox.gob:651
+#: src/mn-imap-mailbox.gob:701
msgid "falling back to IMAP LOGIN authentication"
msgstr ""
-#: src/mn-imap-mailbox.gob:655 src/mn-pop3-mailbox.gob:691
+#: src/mn-imap-mailbox.gob:705 src/mn-pop3-mailbox.gob:720
msgid "authentication failed"
msgstr ""
@@ -510,23 +584,23 @@ msgstr ""
msgid "%s Properties"
msgstr ""
-#: src/mn-mailbox-properties-util.c:75
+#: src/mn-mailbox-properties-util.c:77
msgid "_Username:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:79
+#: src/mn-mailbox-properties-util.c:87
msgid "_Password:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:146
+#: src/mn-mailbox-properties-util.c:154
msgid "Connection type:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:153
+#: src/mn-mailbox-properties-util.c:161
msgid "Port:"
msgstr ""
-#: src/mn-mailbox-properties-util.c:180
+#: src/mn-mailbox-properties-util.c:189
msgid "_Authentication mechanism:"
msgstr ""
@@ -554,56 +628,56 @@ msgstr ""
msgid "Whether the properties are completely filled or not"
msgstr ""
-#: src/mn-mailbox-view.gob:91
-msgid "Unable to add mailbox"
+#: src/mn-mailbox-view.gob:254
+msgid "Mailbox"
msgstr ""
-#: src/mn-mailbox-view.gob:91
-msgid "The mailbox is already in the list."
+#: src/mn-mailbox-view.gob:268
+msgid "Format"
msgstr ""
-#: src/mn-mailbox-view.gob:283
-msgid "Mailbox"
+#: src/mn-mailbox-view.gob:543
+msgid "Unable to add mailbox"
msgstr ""
-#: src/mn-mailbox-view.gob:297
-msgid "Format"
+#: src/mn-mailbox-view.gob:543
+msgid "The mailbox is already in the list."
msgstr ""
-#: src/mn-mailbox.gob:88
+#: src/mn-mailbox.gob:122
msgid "The mailbox URI"
msgstr ""
-#: src/mn-mailbox.gob:98
+#: src/mn-mailbox.gob:133
msgid "The mailbox human-readable name"
msgstr ""
-#: src/mn-mailbox.gob:102
+#: src/mn-mailbox.gob:137
msgid "Whether the mailbox has to be manually checked or not"
msgstr ""
-#: src/mn-mailbox.gob:107
+#: src/mn-mailbox.gob:142
msgid "Whether the mailbox has new mail or not"
msgstr ""
-#: src/mn-mailbox.gob:112
+#: src/mn-mailbox.gob:147
msgid "The mailbox error, if any"
msgstr ""
-#: src/mn-mailbox.gob:218
+#: src/mn-mailbox.gob:251
msgid "does not exist"
msgstr ""
-#: src/mn-mailbox.gob:255
+#: src/mn-mailbox.gob:287
msgid "unknown format"
msgstr ""
-#: src/mn-mailbox.gob:316
+#: src/mn-mailbox.gob:355
#, c-format
msgid "unable to monitor %s: %s"
msgstr ""
-#: src/mn-mailbox.gob:330
+#: src/mn-mailbox.gob:369
#, c-format
msgid ""
"As a fallback, they will be checked every %i second (this delay is "
@@ -614,7 +688,7 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.gob:341
+#: src/mn-mailbox.gob:380
#, c-format
msgid ""
"As a fallback, they will be checked every %i minute (this delay is "
@@ -625,7 +699,7 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.gob:352
+#: src/mn-mailbox.gob:391
#, c-format
msgid ""
"As a fallback, they will be checked approximately every %i minute (this "
@@ -636,58 +710,58 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.gob:366
+#: src/mn-mailbox.gob:405
msgid "A monitoring error has occurred"
msgstr ""
-#: src/mn-mailbox.gob:367
+#: src/mn-mailbox.gob:406
#, c-format
msgid ""
-"Mail Notification was unable to enable automatic notification for one or "
+"Mail Notification was unable to enable immediate notification for one or "
"more mailboxes. %s"
msgstr ""
-#: src/mn-mailboxes.gob:130
+#: src/mn-mailboxes.gob:143
#, c-format
msgid "%s is unsupported: %s"
msgstr ""
-#: src/mn-mailboxes.gob:157
+#: src/mn-mailboxes.gob:170
#, c-format
msgid "%s has new mail"
msgstr ""
-#: src/mn-mailboxes.gob:157
+#: src/mn-mailboxes.gob:170
#, c-format
msgid "%s has no new mail"
msgstr ""
-#: src/mn-mailboxes.gob:173
+#: src/mn-mailboxes.gob:186
#, c-format
msgid "%s reported an error: %s"
msgstr ""
-#: src/mn-maildir-mailbox.gob:98
+#: src/mn-maildir-mailbox.gob:109
#, c-format
msgid "unable to open folder \"new\": %s"
msgstr ""
-#: src/mn-maildir-mailbox.gob:126
+#: src/mn-maildir-mailbox.gob:137
#, c-format
msgid "unable to close folder \"new\": %s"
msgstr ""
-#: src/mn-maildir-mailbox.gob:129
+#: src/mn-maildir-mailbox.gob:140
#, c-format
msgid "error while reading folder \"new\": %s"
msgstr ""
-#: src/mn-main.c:86
+#: src/mn-main.c:85
#, c-format
msgid "Compiled-in mailbox backends: %s\n"
msgstr ""
-#: src/mn-main.c:104
+#: src/mn-main.c:103
#, c-format
msgid "Compiled-in features: %s\n"
msgstr ""
@@ -716,61 +790,65 @@ msgstr ""
msgid "Report the mail status"
msgstr ""
+#: src/mn-main.c:187
+msgid "Unset obsolete GConf configuration and exit"
+msgstr ""
+
#.
#. * We can't use mn_error_dialog() because gtk_init() has not been
#. * called yet.
#.
-#: src/mn-main.c:204
+#: src/mn-main.c:213
msgid "multi-threading is not available"
msgstr ""
-#: src/mn-main.c:243
+#: src/mn-main.c:258
msgid ""
"Bonobo could not locate the automation object. Please check your Mail "
"Notification installation."
msgstr ""
-#: src/mn-main.c:248
+#: src/mn-main.c:263
msgid "Unable to initialize the GnomeVFS library."
msgstr ""
-#: src/mn-main.c:270
+#: src/mn-main.c:285
msgid "updating the mail status"
msgstr ""
-#: src/mn-main.c:286
+#: src/mn-main.c:301
#, fuzzy
msgid "Mail Notification is already running"
msgstr "Иконка входящих сообщений"
-#: src/mn-main.c:293
+#: src/mn-main.c:308
msgid ""
"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
"Please check your Mail Notification installation."
msgstr ""
-#: src/mn-main.c:297
+#: src/mn-main.c:312
msgid ""
"Bonobo was unable to register the automation server. Please check your Mail "
"Notification installation."
msgstr ""
-#: src/mn-mbox-mailbox.gob:165
+#: src/mn-mbox-mailbox.gob:171
#, c-format
msgid "error while reading mailbox: %s"
msgstr ""
-#: src/mn-mbox-mailbox.gob:173
+#: src/mn-mbox-mailbox.gob:179
#, c-format
msgid "unable to open mailbox: %s"
msgstr ""
-#: src/mn-mh-mailbox.gob:111
+#: src/mn-mh-mailbox.gob:122
#, c-format
msgid "error while reading .mh_sequences: %s"
msgstr ""
-#: src/mn-mh-mailbox.gob:119
+#: src/mn-mh-mailbox.gob:130
#, c-format
msgid "unable to open .mh_sequences: %s"
msgstr ""
@@ -779,20 +857,24 @@ msgstr ""
msgid "detecting"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:75
+#: src/mn-pi-mailbox-properties.gob:74
msgid "_Hostname:"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:93
+#: src/mn-pi-mailbox-properties.gob:92
msgid "_Details"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:105
+#: src/mn-pi-mailbox-properties.gob:104
msgid "sta_ndard"
msgstr ""
-#: src/mn-pi-mailbox-properties.gob:115
-msgid "_SSL"
+#: src/mn-pi-mailbox-properties.gob:114
+msgid "_in-band SSL/TLS"
+msgstr ""
+
+#: src/mn-pi-mailbox-properties.gob:124
+msgid "SSL/TLS on sepa_rate port"
msgstr ""
#: src/mn-pop3-mailbox-properties.gob:84
@@ -811,117 +893,117 @@ msgstr ""
msgid "The port number of the POP3 server"
msgstr ""
-#: src/mn-pop3-mailbox.gob:137
-msgid "unable to parse POP3 URI"
-msgstr ""
-
-#: src/mn-pop3-mailbox.gob:267
+#: src/mn-pop3-mailbox.gob:256
msgid "invalid arguments for the LOGIN-DELAY capability"
msgstr ""
-#: src/mn-pop3-mailbox.gob:495
+#: src/mn-pop3-mailbox.gob:523
#, c-format
msgid "honouring LOGIN-DELAY, sleeping for %i second"
msgid_plural "honouring LOGIN-DELAY, sleeping for %i seconds"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-pop3-mailbox.gob:653
+#: src/mn-pop3-mailbox.gob:682
msgid "server does not support APOP authentication"
msgstr ""
-#: src/mn-pop3-mailbox.gob:681
+#: src/mn-pop3-mailbox.gob:710
msgid "falling back to APOP authentication"
msgstr ""
-#: src/mn-pop3-mailbox.gob:686
+#: src/mn-pop3-mailbox.gob:715
msgid "falling back to USER/PASS authentication"
msgstr ""
-#: src/mn-properties.c:132
+#: src/mn-properties.c:151
msgid "No mailbox selected."
msgstr ""
-#: src/mn-properties.c:137
+#: src/mn-properties.c:156
#, c-format
msgid "%i mailbox selected."
msgid_plural "%i mailboxes selected."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:191
+#: src/mn-shell.gob:204
msgid "A command error has occurred"
msgstr ""
-#: src/mn-shell.gob:192
+#: src/mn-shell.gob:205
#, c-format
msgid "Unable to execute double-clicked command: %s."
msgstr ""
-#: src/mn-shell.gob:297
+#: src/mn-shell.gob:292
msgid "The following mailbox has new mail:\n"
msgid_plural "The following mailboxes have new mail:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:301
+#: src/mn-shell.gob:296
msgid "You have no new mail."
msgstr ""
-#: src/mn-shell.gob:304
+#: src/mn-shell.gob:299
msgid "The following mailbox reported an error:\n"
msgid_plural "The following mailboxes reported an error:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:309
+#: src/mn-shell.gob:304
msgid "The following mailbox is unsupported:\n"
msgid_plural "The following mailboxes are unsupported:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-shell.gob:325
+#: src/mn-shell.gob:320
msgid "You have new mail."
msgstr ""
-#: src/mn-shell.gob:338
+#: src/mn-shell.gob:330
msgid "A command error has occurred in Mail Notification"
msgstr ""
-#: src/mn-shell.gob:339
+#: src/mn-shell.gob:331
#, c-format
msgid "Unable to execute new mail command: %s."
msgstr ""
+#: src/mn-ssl.c:79
+msgid "unknown SSL/TLS error"
+msgstr ""
+
#: src/mn-stock.c:28
msgid "Select _All"
msgstr ""
-#: src/mn-sylpheed-mailbox.gob:84
+#: src/mn-sylpheed-mailbox.gob:93
#, c-format
msgid "unable to open folder: %s"
msgstr ""
-#: src/mn-sylpheed-mailbox.gob:118
+#: src/mn-sylpheed-mailbox.gob:127
#, c-format
msgid "unable to close folder: %s"
msgstr ""
-#: src/mn-sylpheed-mailbox.gob:121
+#: src/mn-sylpheed-mailbox.gob:130
#, c-format
msgid "error while reading folder: %s"
msgstr ""
-#: src/mn-system-mailbox-properties.gob:33 src/mn-uri.c:672
+#: src/mn-system-mailbox-properties.gob:32 src/mn-uri.gob:391
msgid "System Mailbox"
msgstr ""
-#: src/mn-system-mailbox-properties.gob:56
+#: src/mn-system-mailbox-properties.gob:55
#, c-format
msgid "Your system mailbox (<span weight=\"bold\">%s</span>) will be used."
msgstr ""
-#: src/mn-system-mailbox-properties.gob:63
+#: src/mn-system-mailbox-properties.gob:62
msgid ""
"The location of your system mailbox could not be detected. Please set the "
"MAIL environment variable."
@@ -935,33 +1017,37 @@ msgstr ""
msgid "unsupported"
msgstr ""
-#: src/mn-util.c:116
+#: src/mn-util.c:199
#, c-format
msgid "error loading image: %s"
msgstr ""
-#: src/mn-util.c:154
+#: src/mn-util.c:237
#, c-format
msgid "widget %s not found in interface %s"
msgstr ""
-#: src/mn-util.c:261
+#: src/mn-util.c:355
msgid "received an invalid URI list"
msgstr ""
-#: src/mn-util.c:297
+#: src/mn-util.c:391
msgid "received an invalid Mozilla URL"
msgstr ""
-#: src/mn-util.c:389
+#: src/mn-util.c:484
msgid "Unable to display help"
msgstr ""
-#: src/mn-util.c:403
+#: src/mn-util.c:498
#, c-format
msgid "Unable to create a thread: %s."
msgstr ""
+#: src/mn-util.c:701
+msgid "A fatal error has occurred in Mail Notification"
+msgstr ""
+
#: ui/mailbox-properties.glade.h:1
msgid "_Mailbox type:"
msgstr ""
@@ -1014,24 +1100,43 @@ msgid "When double-click_ed:"
msgstr ""
#: ui/properties.glade.h:12
-msgid "Whether to run a command when new mail arrives or not"
+msgid "Whether the status icon should blink on errors or not"
msgstr ""
#: ui/properties.glade.h:13
+msgid "Whether to run a command when new mail arrives or not"
+msgstr ""
+
+#: ui/properties.glade.h:14
#, fuzzy
msgid "Whether to run a command when the icon is double-clicked or not"
msgstr ""
"Иконка в области уведомления панели, уведомляющая о приходе новой почты."
-#: ui/properties.glade.h:14
+#: ui/properties.glade.h:15
+msgid ""
+"Whether to start Mail Notification when you log into your GNOME session or "
+"not"
+msgstr ""
+
+#: ui/properties.glade.h:16
+msgid "_Blink on errors"
+msgstr ""
+
+#: ui/properties.glade.h:17
msgid "_Delay between mail checks:"
msgstr ""
-#: ui/properties.glade.h:15
+#: ui/properties.glade.h:18
+#, fuzzy
+msgid "_Start Mail Notification on GNOME login"
+msgstr "Иконка входящих сообщений"
+
+#: ui/properties.glade.h:19
msgid "minutes"
msgstr ""
-#: ui/properties.glade.h:16
+#: ui/properties.glade.h:20
msgid "seconds"
msgstr ""
@@ -1047,7 +1152,8 @@ msgid ""
"Note: this message will not be shown anymore. To configure Mail Notification "
"again, choose <span weight=\"bold\">Applications</span> → <span weight=\"bold"
"\">Desktop Preferences</span> → <span weight=\"bold\">Mail Notification</"
-"span>."
+"span> (or on some systems <span weight=\"bold\">Applications → Preferences → "
+"More Preferences → Mail Notification</span>)."
msgstr ""
#: ui/welcome.glade.h:8
diff --git a/src/Makefile.am b/src/Makefile.am
@@ -125,7 +125,8 @@ gob_sources = \
mn-pending-mailbox.gob \
mn-shell.gob \
mn-system-mailbox-properties.gob \
- mn-unsupported-mailbox.gob
+ mn-unsupported-mailbox.gob \
+ mn-uri.gob
gob_built_sources = \
$(mbox_gob_built_sources) \
$(mh_gob_built_sources) \
@@ -170,7 +171,10 @@ gob_built_sources = \
mn-system-mailbox-properties.h \
mn-unsupported-mailbox-private.h \
mn-unsupported-mailbox.c \
- mn-unsupported-mailbox.h
+ mn-unsupported-mailbox.h \
+ mn-uri-private.h \
+ mn-uri.c \
+ mn-uri.h
nodist_mail_notification_SOURCES = $(idl_built_sources)
mail_notification_SOURCES = \
@@ -186,8 +190,6 @@ mail_notification_SOURCES = \
eggtrayicon.h \
mn-conf.c \
mn-conf.h \
- mn-dialog.c \
- mn-dialog.h \
mn-mailbox-properties-dialog.c \
mn-mailbox-properties-dialog.h \
mn-mailbox-properties-util.c \
@@ -199,8 +201,6 @@ mail_notification_SOURCES = \
mn-properties.h \
mn-stock.c \
mn-stock.h \
- mn-uri.c \
- mn-uri.h \
mn-util.c \
mn-util.h \
mn-vfs.c \
diff --git a/src/Makefile.in b/src/Makefile.in
@@ -41,8 +41,8 @@ subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -62,11 +62,11 @@ am__mail_notification_SOURCES_DIST = MNAutomation.idl \
mn-blinking-image.gob mn-mail-icon.gob mn-mailbox-view.gob \
mn-mailbox.gob mn-mailboxes.gob mn-pending-mailbox.gob \
mn-shell.gob mn-system-mailbox-properties.gob \
- mn-unsupported-mailbox.gob mn-mbox-mailbox-private.h \
- mn-mbox-mailbox.c mn-mbox-mailbox.h mn-mh-mailbox-private.h \
- mn-mh-mailbox.c mn-mh-mailbox.h mn-maildir-mailbox-private.h \
- mn-maildir-mailbox.c mn-maildir-mailbox.h \
- mn-pop3-mailbox-properties-private.h \
+ mn-unsupported-mailbox.gob mn-uri.gob \
+ mn-mbox-mailbox-private.h mn-mbox-mailbox.c mn-mbox-mailbox.h \
+ mn-mh-mailbox-private.h mn-mh-mailbox.c mn-mh-mailbox.h \
+ mn-maildir-mailbox-private.h mn-maildir-mailbox.c \
+ mn-maildir-mailbox.h mn-pop3-mailbox-properties-private.h \
mn-pop3-mailbox-properties.c mn-pop3-mailbox-properties.h \
mn-pop3-mailbox-private.h mn-pop3-mailbox.c mn-pop3-mailbox.h \
mn-imap-mailbox-properties-private.h \
@@ -93,15 +93,15 @@ am__mail_notification_SOURCES_DIST = MNAutomation.idl \
mn-shell.c mn-shell.h mn-system-mailbox-properties-private.h \
mn-system-mailbox-properties.c mn-system-mailbox-properties.h \
mn-unsupported-mailbox-private.h mn-unsupported-mailbox.c \
- mn-unsupported-mailbox.h mn-md5.c mn-md5.h mn-client-session.c \
- mn-client-session.h mn-soup.c mn-soup.h mn-ssl.c mn-ssl.h \
- mn-sasl.c mn-sasl.h eggtrayicon.c eggtrayicon.h mn-conf.c \
- mn-conf.h mn-dialog.c mn-dialog.h \
+ mn-unsupported-mailbox.h mn-uri-private.h mn-uri.c mn-uri.h \
+ mn-md5.c mn-md5.h mn-client-session.c mn-client-session.h \
+ mn-soup.c mn-soup.h mn-ssl.c mn-ssl.h mn-sasl.c mn-sasl.h \
+ eggtrayicon.c eggtrayicon.h mn-conf.c mn-conf.h \
mn-mailbox-properties-dialog.c mn-mailbox-properties-dialog.h \
mn-mailbox-properties-util.c mn-mailbox-properties-util.h \
mn-mailbox-properties.c mn-mailbox-properties.h mn-main.c \
- mn-properties.c mn-properties.h mn-stock.c mn-stock.h mn-uri.c \
- mn-uri.h mn-util.c mn-util.h mn-vfs.c mn-vfs.h
+ mn-properties.c mn-properties.h mn-stock.c mn-stock.h \
+ mn-util.c mn-util.h mn-vfs.c mn-vfs.h
am__objects_1 =
am__objects_2 = $(am__objects_1) $(am__objects_1) $(am__objects_1) \
$(am__objects_1) $(am__objects_1) $(am__objects_1) \
@@ -128,7 +128,7 @@ am__objects_11 = $(am__objects_3) $(am__objects_4) $(am__objects_5) \
mn-mailbox.$(OBJEXT) mn-mailboxes.$(OBJEXT) \
mn-pending-mailbox.$(OBJEXT) mn-shell.$(OBJEXT) \
mn-system-mailbox-properties.$(OBJEXT) \
- mn-unsupported-mailbox.$(OBJEXT)
+ mn-unsupported-mailbox.$(OBJEXT) mn-uri.$(OBJEXT)
@WITH_POP3_TRUE@am__objects_12 = mn-md5.$(OBJEXT)
@WITH_POP3_OR_IMAP_TRUE@am__objects_13 = mn-client-session.$(OBJEXT)
@HAVE_SOUP_TRUE@am__objects_14 = mn-soup.$(OBJEXT)
@@ -137,12 +137,12 @@ am__objects_11 = $(am__objects_3) $(am__objects_4) $(am__objects_5) \
am_mail_notification_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_11) $(am__objects_12) $(am__objects_13) \
$(am__objects_14) $(am__objects_15) $(am__objects_16) \
- eggtrayicon.$(OBJEXT) mn-conf.$(OBJEXT) mn-dialog.$(OBJEXT) \
+ eggtrayicon.$(OBJEXT) mn-conf.$(OBJEXT) \
mn-mailbox-properties-dialog.$(OBJEXT) \
mn-mailbox-properties-util.$(OBJEXT) \
mn-mailbox-properties.$(OBJEXT) mn-main.$(OBJEXT) \
- mn-properties.$(OBJEXT) mn-stock.$(OBJEXT) mn-uri.$(OBJEXT) \
- mn-util.$(OBJEXT) mn-vfs.$(OBJEXT)
+ mn-properties.$(OBJEXT) mn-stock.$(OBJEXT) mn-util.$(OBJEXT) \
+ mn-vfs.$(OBJEXT)
am__objects_17 = MNAutomation-common.$(OBJEXT) \
MNAutomation-stubs.$(OBJEXT) MNAutomation-skels.$(OBJEXT)
nodist_mail_notification_OBJECTS = $(am__objects_17)
@@ -162,7 +162,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/mn-automation.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-blinking-image.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-client-session.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/mn-conf.Po ./$(DEPDIR)/mn-dialog.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-conf.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-gmail-mailbox-properties.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-gmail-mailbox.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-imap-mailbox-properties.Po \
@@ -459,7 +459,8 @@ gob_sources = \
mn-pending-mailbox.gob \
mn-shell.gob \
mn-system-mailbox-properties.gob \
- mn-unsupported-mailbox.gob
+ mn-unsupported-mailbox.gob \
+ mn-uri.gob
gob_built_sources = \
$(mbox_gob_built_sources) \
@@ -505,7 +506,10 @@ gob_built_sources = \
mn-system-mailbox-properties.h \
mn-unsupported-mailbox-private.h \
mn-unsupported-mailbox.c \
- mn-unsupported-mailbox.h
+ mn-unsupported-mailbox.h \
+ mn-uri-private.h \
+ mn-uri.c \
+ mn-uri.h
nodist_mail_notification_SOURCES = $(idl_built_sources)
mail_notification_SOURCES = \
@@ -521,8 +525,6 @@ mail_notification_SOURCES = \
eggtrayicon.h \
mn-conf.c \
mn-conf.h \
- mn-dialog.c \
- mn-dialog.h \
mn-mailbox-properties-dialog.c \
mn-mailbox-properties-dialog.h \
mn-mailbox-properties-util.c \
@@ -534,8 +536,6 @@ mail_notification_SOURCES = \
mn-properties.h \
mn-stock.c \
mn-stock.h \
- mn-uri.c \
- mn-uri.h \
mn-util.c \
mn-util.h \
mn-vfs.c \
@@ -633,7 +633,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-blinking-image.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-client-session.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-conf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-dialog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-gmail-mailbox-properties.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-gmail-mailbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-imap-mailbox-properties.Po@am__quote@
diff --git a/src/mn-about-dialog.c b/src/mn-about-dialog.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
diff --git a/src/mn-auth-combo-box.c b/src/mn-auth-combo-box.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
diff --git a/src/mn-autodetect-mailbox-properties-private.h b/src/mn-autodetect-mailbox-properties-private.h
@@ -10,11 +10,11 @@ extern "C" {
#endif /* __cplusplus */
struct _MNAutodetectMailboxPropertiesPrivate {
-#line 38 "mn-autodetect-mailbox-properties.gob"
+#line 37 "mn-autodetect-mailbox-properties.gob"
GtkSizeGroup * size_group;
-#line 50 "mn-autodetect-mailbox-properties.gob"
+#line 49 "mn-autodetect-mailbox-properties.gob"
GtkTooltips * tooltips;
-#line 51 "mn-autodetect-mailbox-properties.gob"
+#line 50 "mn-autodetect-mailbox-properties.gob"
GtkWidget * location_entry;
#line 20 "mn-autodetect-mailbox-properties-private.h"
};
diff --git a/src/mn-autodetect-mailbox-properties.c b/src/mn-autodetect-mailbox-properties.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -27,12 +27,11 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-util.h"
static char *current_folder_uri = NULL;
-#line 36 "mn-autodetect-mailbox-properties.c"
+#line 35 "mn-autodetect-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_AUTODETECT_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_AUTODETECT_MAILBOX_PROPERTIES_CONST(x)
@@ -55,8 +54,8 @@ static GObject * ___1_mn_autodetect_mailbox_properties_constructor (GType type,
static void mn_autodetect_mailbox_properties_entry_changed_h (GtkEditable * editable, gpointer user_data) G_GNUC_UNUSED;
static void mn_autodetect_mailbox_properties_browse_clicked_h (GtkButton * button, gpointer user_data) G_GNUC_UNUSED;
static void mn_autodetect_mailbox_properties_current_folder_changed_h (GtkFileChooser * chooser, gpointer user_data) G_GNUC_UNUSED;
-static gboolean mn_autodetect_mailbox_properties_set_uri (MNMailboxProperties * self, const char * uri) G_GNUC_UNUSED;
-static char * mn_autodetect_mailbox_properties_get_uri (MNMailboxProperties * self) G_GNUC_UNUSED;
+static gboolean mn_autodetect_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri) G_GNUC_UNUSED;
+static MNURI * mn_autodetect_mailbox_properties_get_uri (MNMailboxProperties * self) G_GNUC_UNUSED;
enum {
PROP_0,
@@ -79,11 +78,11 @@ static GtkHBoxClass *parent_class = NULL;
static void
___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
{
-#line 156 "mn-autodetect-mailbox-properties.gob"
+#line 155 "mn-autodetect-mailbox-properties.gob"
iface->set_uri = self_set_uri;
-#line 164 "mn-autodetect-mailbox-properties.gob"
+#line 163 "mn-autodetect-mailbox-properties.gob"
iface->get_uri = self_get_uri;
-#line 87 "mn-autodetect-mailbox-properties.c"
+#line 86 "mn-autodetect-mailbox-properties.c"
}
GType
@@ -145,12 +144,12 @@ ___dispose (GObject *obj_self)
MNAutodetectMailboxProperties *self G_GNUC_UNUSED = MN_AUTODETECT_MAILBOX_PROPERTIES (obj_self);
if (G_OBJECT_CLASS (parent_class)->dispose) \
(* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
-#line 38 "mn-autodetect-mailbox-properties.gob"
+#line 37 "mn-autodetect-mailbox-properties.gob"
if(self->_priv->size_group) { ((*(void (*)(void *))g_object_unref)) (self->_priv->size_group); self->_priv->size_group = NULL; }
-#line 151 "mn-autodetect-mailbox-properties.c"
-#line 50 "mn-autodetect-mailbox-properties.gob"
+#line 150 "mn-autodetect-mailbox-properties.c"
+#line 49 "mn-autodetect-mailbox-properties.gob"
if(self->_priv->tooltips) { ((*(void (*)(void *))g_object_unref)) (self->_priv->tooltips); self->_priv->tooltips = NULL; }
-#line 154 "mn-autodetect-mailbox-properties.c"
+#line 153 "mn-autodetect-mailbox-properties.c"
}
#undef __GOB_FUNCTION__
@@ -172,9 +171,9 @@ mn_autodetect_mailbox_properties_init (MNAutodetectMailboxProperties * o G_GNUC_
{
#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::init"
o->_priv = g_new0 (MNAutodetectMailboxPropertiesPrivate, 1);
-#line 50 "mn-autodetect-mailbox-properties.gob"
+#line 49 "mn-autodetect-mailbox-properties.gob"
o->_priv->tooltips = mn_tooltips_new();
-#line 178 "mn-autodetect-mailbox-properties.c"
+#line 177 "mn-autodetect-mailbox-properties.c"
}
#undef __GOB_FUNCTION__
static void
@@ -185,9 +184,9 @@ mn_autodetect_mailbox_properties_class_init (MNAutodetectMailboxPropertiesClass
parent_class = g_type_class_ref (GTK_TYPE_HBOX);
-#line 53 "mn-autodetect-mailbox-properties.gob"
+#line 52 "mn-autodetect-mailbox-properties.gob"
g_object_class->constructor = ___1_mn_autodetect_mailbox_properties_constructor;
-#line 191 "mn-autodetect-mailbox-properties.c"
+#line 190 "mn-autodetect-mailbox-properties.c"
g_object_class->dispose = ___dispose;
g_object_class->finalize = ___finalize;
g_object_class->get_property = ___object_get_property;
@@ -220,9 +219,9 @@ ___object_set_property (GObject *object,
switch (property_id) {
case PROP_SIZE_GROUP:
{
-#line 39 "mn-autodetect-mailbox-properties.gob"
+#line 38 "mn-autodetect-mailbox-properties.gob"
{ GObject *___old = (GObject *)self->_priv->size_group; self->_priv->size_group = (void *)g_value_dup_object (VAL); if (___old != NULL) { g_object_unref (G_OBJECT (___old)); } }
-#line 226 "mn-autodetect-mailbox-properties.c"
+#line 225 "mn-autodetect-mailbox-properties.c"
}
break;
default:
@@ -251,28 +250,28 @@ ___object_get_property (GObject *object,
switch (property_id) {
case PROP_LABEL:
{
-#line 36 "mn-autodetect-mailbox-properties.gob"
+#line 35 "mn-autodetect-mailbox-properties.gob"
g_value_set_string(VAL, _("<span style=\"italic\">autodetect</span>"));
-#line 257 "mn-autodetect-mailbox-properties.c"
+#line 256 "mn-autodetect-mailbox-properties.c"
}
break;
case PROP_SIZE_GROUP:
{
-#line 39 "mn-autodetect-mailbox-properties.gob"
+#line 38 "mn-autodetect-mailbox-properties.gob"
g_value_set_object (VAL, (gpointer)self->_priv->size_group);
-#line 264 "mn-autodetect-mailbox-properties.c"
+#line 263 "mn-autodetect-mailbox-properties.c"
}
break;
case PROP_COMPLETE:
{
-#line 43 "mn-autodetect-mailbox-properties.gob"
+#line 42 "mn-autodetect-mailbox-properties.gob"
const char *location;
location = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->location_entry));
g_value_set_boolean(VAL, *location != 0);
-#line 276 "mn-autodetect-mailbox-properties.c"
+#line 275 "mn-autodetect-mailbox-properties.c"
}
break;
default:
@@ -289,10 +288,10 @@ g_value_set_object (VAL, (gpointer)self->_priv->size_group);
-#line 53 "mn-autodetect-mailbox-properties.gob"
+#line 52 "mn-autodetect-mailbox-properties.gob"
static GObject *
___1_mn_autodetect_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
-#line 296 "mn-autodetect-mailbox-properties.c"
+#line 295 "mn-autodetect-mailbox-properties.c"
#define PARENT_HANDLER(___type,___n_construct_properties,___construct_params) \
((G_OBJECT_CLASS(parent_class)->constructor)? \
(* G_OBJECT_CLASS(parent_class)->constructor)(___type,___n_construct_properties,___construct_params): \
@@ -300,7 +299,7 @@ ___1_mn_autodetect_mailbox_properties_constructor (GType type G_GNUC_UNUSED, gui
{
#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::constructor"
{
-#line 55 "mn-autodetect-mailbox-properties.gob"
+#line 54 "mn-autodetect-mailbox-properties.gob"
GObject *object;
Self *self;
@@ -344,47 +343,47 @@ ___1_mn_autodetect_mailbox_properties_constructor (GType type G_GNUC_UNUSED, gui
return object;
}}
-#line 348 "mn-autodetect-mailbox-properties.c"
+#line 347 "mn-autodetect-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 99 "mn-autodetect-mailbox-properties.gob"
+#line 98 "mn-autodetect-mailbox-properties.gob"
static void
mn_autodetect_mailbox_properties_entry_changed_h (GtkEditable * editable, gpointer user_data)
-#line 355 "mn-autodetect-mailbox-properties.c"
+#line 354 "mn-autodetect-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::entry_changed_h"
-#line 99 "mn-autodetect-mailbox-properties.gob"
+#line 98 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (editable != NULL);
-#line 99 "mn-autodetect-mailbox-properties.gob"
+#line 98 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (GTK_IS_EDITABLE (editable));
-#line 99 "mn-autodetect-mailbox-properties.gob"
+#line 98 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (user_data != NULL);
-#line 364 "mn-autodetect-mailbox-properties.c"
+#line 363 "mn-autodetect-mailbox-properties.c"
{
-#line 102 "mn-autodetect-mailbox-properties.gob"
+#line 101 "mn-autodetect-mailbox-properties.gob"
Self *self = user_data;
g_object_notify(G_OBJECT(self), "complete");
}}
-#line 371 "mn-autodetect-mailbox-properties.c"
+#line 370 "mn-autodetect-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 107 "mn-autodetect-mailbox-properties.gob"
+#line 106 "mn-autodetect-mailbox-properties.gob"
static void
mn_autodetect_mailbox_properties_browse_clicked_h (GtkButton * button, gpointer user_data)
-#line 377 "mn-autodetect-mailbox-properties.c"
+#line 376 "mn-autodetect-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::browse_clicked_h"
-#line 107 "mn-autodetect-mailbox-properties.gob"
+#line 106 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (button != NULL);
-#line 107 "mn-autodetect-mailbox-properties.gob"
+#line 106 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (GTK_IS_BUTTON (button));
-#line 107 "mn-autodetect-mailbox-properties.gob"
+#line 106 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (user_data != NULL);
-#line 386 "mn-autodetect-mailbox-properties.c"
+#line 385 "mn-autodetect-mailbox-properties.c"
{
-#line 110 "mn-autodetect-mailbox-properties.gob"
+#line 109 "mn-autodetect-mailbox-properties.gob"
Self *self = user_data;
GtkWidget *toplevel;
@@ -422,69 +421,71 @@ mn_autodetect_mailbox_properties_browse_clicked_h (GtkButton * button, gpointer
gtk_widget_destroy(chooser);
}}
-#line 426 "mn-autodetect-mailbox-properties.c"
+#line 425 "mn-autodetect-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 148 "mn-autodetect-mailbox-properties.gob"
+#line 147 "mn-autodetect-mailbox-properties.gob"
static void
mn_autodetect_mailbox_properties_current_folder_changed_h (GtkFileChooser * chooser, gpointer user_data)
-#line 432 "mn-autodetect-mailbox-properties.c"
+#line 431 "mn-autodetect-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::current_folder_changed_h"
-#line 148 "mn-autodetect-mailbox-properties.gob"
+#line 147 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (chooser != NULL);
-#line 148 "mn-autodetect-mailbox-properties.gob"
+#line 147 "mn-autodetect-mailbox-properties.gob"
g_return_if_fail (GTK_IS_FILE_CHOOSER (chooser));
-#line 439 "mn-autodetect-mailbox-properties.c"
+#line 438 "mn-autodetect-mailbox-properties.c"
{
-#line 151 "mn-autodetect-mailbox-properties.gob"
+#line 150 "mn-autodetect-mailbox-properties.gob"
g_free(current_folder_uri);
current_folder_uri = gtk_file_chooser_get_current_folder_uri(chooser);
}}
-#line 446 "mn-autodetect-mailbox-properties.c"
+#line 445 "mn-autodetect-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 156 "mn-autodetect-mailbox-properties.gob"
+#line 155 "mn-autodetect-mailbox-properties.gob"
static gboolean
-mn_autodetect_mailbox_properties_set_uri (MNMailboxProperties * self, const char * uri)
-#line 452 "mn-autodetect-mailbox-properties.c"
+mn_autodetect_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri)
+#line 451 "mn-autodetect-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::set_uri"
-#line 156 "mn-autodetect-mailbox-properties.gob"
+#line 155 "mn-autodetect-mailbox-properties.gob"
g_return_val_if_fail (self != NULL, (gboolean )0);
-#line 156 "mn-autodetect-mailbox-properties.gob"
+#line 155 "mn-autodetect-mailbox-properties.gob"
g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (gboolean )0);
-#line 156 "mn-autodetect-mailbox-properties.gob"
+#line 155 "mn-autodetect-mailbox-properties.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 461 "mn-autodetect-mailbox-properties.c"
+#line 155 "mn-autodetect-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 462 "mn-autodetect-mailbox-properties.c"
{
-#line 159 "mn-autodetect-mailbox-properties.gob"
+#line 158 "mn-autodetect-mailbox-properties.gob"
- gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->location_entry), uri);
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->location_entry), uri->text);
return TRUE;
}}
-#line 468 "mn-autodetect-mailbox-properties.c"
+#line 469 "mn-autodetect-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 164 "mn-autodetect-mailbox-properties.gob"
-static char *
+#line 163 "mn-autodetect-mailbox-properties.gob"
+static MNURI *
mn_autodetect_mailbox_properties_get_uri (MNMailboxProperties * self)
-#line 474 "mn-autodetect-mailbox-properties.c"
+#line 475 "mn-autodetect-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::get_uri"
-#line 164 "mn-autodetect-mailbox-properties.gob"
- g_return_val_if_fail (self != NULL, (char * )0);
-#line 164 "mn-autodetect-mailbox-properties.gob"
- g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (char * )0);
-#line 481 "mn-autodetect-mailbox-properties.c"
+#line 163 "mn-autodetect-mailbox-properties.gob"
+ g_return_val_if_fail (self != NULL, (MNURI * )0);
+#line 163 "mn-autodetect-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (MNURI * )0);
+#line 482 "mn-autodetect-mailbox-properties.c"
{
-#line 166 "mn-autodetect-mailbox-properties.gob"
+#line 165 "mn-autodetect-mailbox-properties.gob"
const char *location;
location = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->location_entry));
- return g_strdup(location);
+ return mn_uri_new(location);
}}
-#line 490 "mn-autodetect-mailbox-properties.c"
+#line 491 "mn-autodetect-mailbox-properties.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-autodetect-mailbox-properties.gob b/src/mn-autodetect-mailbox-properties.gob
@@ -24,7 +24,6 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-util.h"
static char *current_folder_uri = NULL;
@@ -155,18 +154,18 @@ class MN:Autodetect:Mailbox:Properties from Gtk:HBox (interface MN:Mailbox:Prope
interface MN:Mailbox:Properties private gboolean
set_uri (MN:Mailbox:Properties *self (check null type),
- const char *uri (check null))
+ MN:URI *uri (check null type))
{
- gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->location_entry), uri);
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->location_entry), uri->text);
return TRUE;
}
- interface MN:Mailbox:Properties private char *
+ interface MN:Mailbox:Properties private MNURI *
get_uri (MN:Mailbox:Properties *self (check null type))
{
const char *location;
location = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->location_entry));
- return g_strdup(location);
+ return mn_uri_new(location);
}
}
diff --git a/src/mn-automation.c b/src/mn-automation.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
diff --git a/src/mn-blinking-image.c b/src/mn-blinking-image.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
diff --git a/src/mn-client-session.c b/src/mn-client-session.c
@@ -31,6 +31,7 @@
#include <errno.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
+#include <eel/eel-alert-dialog.h>
#ifdef WITH_SSL
#include <openssl/err.h>
#include "mn-ssl.h"
@@ -42,6 +43,7 @@
#endif /* WITH_SASL */
#include "mn-util.h"
#include "mn-client-session.h"
+#include "mn-conf.h"
/*** cpp *********************************************************************/
@@ -63,7 +65,6 @@ struct _MNClientSession
MNClientSessionPrivate *private;
#ifdef WITH_SSL
- gboolean use_ssl;
SSL *ssl;
#endif
@@ -97,7 +98,9 @@ static struct addrinfo *mn_client_session_resolve (MNClientSession *session);
static int mn_client_session_connect (MNClientSession *session, struct addrinfo *addrinfo);
#ifdef WITH_SSL
-static gboolean mn_client_session_init_ssl (MNClientSession *session);
+static gboolean mn_client_session_ssl_verify (MNClientSession *session);
+static gboolean mn_client_session_run_untrusted_dialog (const char *hostname,
+ const char *reason);
#endif
static int mn_client_session_enter_state (MNClientSession *session, int id);
@@ -148,10 +151,6 @@ mn_client_session_run (MNClientSessionState *states,
session.password = g_strdup(password);
session.private = private;
-#ifdef WITH_SSL
- session.use_ssl = use_ssl;
-#endif
-
addrinfo = mn_client_session_resolve(&session);
if (! addrinfo)
goto end;
@@ -162,9 +161,9 @@ mn_client_session_run (MNClientSessionState *states,
goto end;
#ifdef WITH_SSL
- if (session.use_ssl)
+ if (use_ssl)
{
- if (! mn_client_session_init_ssl(&session))
+ if (! mn_client_session_enable_ssl(&session))
goto end;
}
#endif /* WITH_SSL */
@@ -182,17 +181,19 @@ mn_client_session_run (MNClientSessionState *states,
gboolean cont = TRUE;
#ifdef WITH_SSL
- if (session.use_ssl)
+ if (session.ssl)
bytes_read = SSL_read(session.ssl, buf, sizeof(buf));
else
#endif /* WITH_SSL */
- bytes_read = read(session.s, buf, sizeof(buf));
+ do
+ bytes_read = read(session.s, buf, sizeof(buf));
+ while (bytes_read < 0 && errno == EINTR);
if (bytes_read <= 0)
{
#ifdef WITH_SSL
- if (session.use_ssl)
- mn_client_session_error(&session, _("unable to read from server: %s"), ERR_reason_error_string(ERR_get_error()));
+ if (session.ssl)
+ mn_client_session_error(&session, _("unable to read from server: %s"), mn_ssl_get_error());
else
#endif /* WITH_SSL */
{
@@ -239,13 +240,10 @@ mn_client_session_run (MNClientSessionState *states,
g_free(session.username);
g_free(session.password);
if (session.s >= 0)
- close(session.s);
+ while (close(session.s) < 0 && errno == EINTR);
#ifdef WITH_SSL
- if (session.use_ssl)
- {
- if (session.ssl)
- SSL_free(session.ssl);
- }
+ if (session.ssl)
+ SSL_free(session.ssl);
#endif /* WITH_SSL */
#ifdef WITH_SASL
if (session.sasl_available)
@@ -360,8 +358,8 @@ mn_client_session_connect (MNClientSession *session, struct addrinfo *addrinfo)
}
#ifdef WITH_SSL
-static gboolean
-mn_client_session_init_ssl (MNClientSession *session)
+gboolean
+mn_client_session_enable_ssl (MNClientSession *session)
{
SSL_CTX *ctx;
GError *err = NULL;
@@ -379,20 +377,163 @@ mn_client_session_init_ssl (MNClientSession *session)
session->ssl = SSL_new(ctx);
if (! session->ssl)
{
- mn_client_session_error(session, _("unable to create a SSL object: %s"), ERR_reason_error_string(ERR_get_error()));
+ mn_client_session_error(session, _("unable to create a SSL/TLS object: %s"), mn_ssl_get_error());
return FALSE;
}
if (! SSL_set_fd(session->ssl, session->s))
{
- mn_client_session_error(session, _("unable to set the SSL file descriptor: %s"), ERR_reason_error_string(ERR_get_error()));
+ mn_client_session_error(session, _("unable to set the SSL/TLS file descriptor: %s"), mn_ssl_get_error());
return FALSE;
}
- SSL_set_connect_state(session->ssl);
+ if (SSL_connect(session->ssl) != 1)
+ {
+ mn_client_session_error(session, _("unable to perform the SSL/TLS handshake: %s"), mn_ssl_get_error());
+ return FALSE;
+ }
+
+ if (! mn_client_session_ssl_verify(session))
+ {
+ mn_client_session_error(session, _("untrusted server"));
+ return FALSE;
+ }
+
+ mn_client_session_notice(session, _("a SSL/TLS layer is now active (%s, %s %i-bit)"),
+ SSL_get_version(session->ssl),
+ SSL_get_cipher(session->ssl),
+ SSL_get_cipher_bits(session->ssl, NULL));
return TRUE;
}
+
+static gboolean
+mn_client_session_ssl_verify (MNClientSession *session)
+{
+ X509 *cert;
+ gboolean status = FALSE;
+
+ g_return_val_if_fail(session->ssl != NULL, FALSE);
+
+ cert = SSL_get_peer_certificate(session->ssl);
+ if (cert)
+ {
+ long verify_result;
+
+ verify_result = SSL_get_verify_result(session->ssl);
+ if (verify_result == X509_V_OK)
+ status = TRUE;
+ else
+ {
+ unsigned char md5sum[16];
+ unsigned char fingerprint[40];
+ int md5len;
+ int i;
+ unsigned char *f;
+ GSList *gconf_fingerprints;
+
+ /* calculate the MD5 hash of the raw certificate */
+ md5len = sizeof(md5sum);
+ X509_digest(cert, EVP_md5(), md5sum, &md5len);
+ for (i = 0, f = fingerprint; i < 16; i++, f += 3)
+ sprintf(f, "%.2x%c", md5sum[i], i != 15 ? ':' : '\0');
+
+ gconf_fingerprints = eel_gconf_get_string_list(MN_CONF_TRUSTED_X509_CERTIFICATES);
+
+ if (mn_g_str_slist_find(gconf_fingerprints, fingerprint) != NULL)
+ status = TRUE;
+ else
+ {
+ char *reason;
+
+ reason = g_strdup_printf(_("%s, fingerprint: %s"),
+ X509_verify_cert_error_string(verify_result),
+ fingerprint);
+
+ if (mn_client_session_run_untrusted_dialog(session->hostname, reason))
+ {
+ status = TRUE;
+ gconf_fingerprints = g_slist_append(gconf_fingerprints, g_strdup(fingerprint));
+ eel_gconf_set_string_list(MN_CONF_TRUSTED_X509_CERTIFICATES, gconf_fingerprints);
+ }
+ }
+
+ eel_g_slist_free_deep(gconf_fingerprints);
+ }
+
+ X509_free(cert);
+ }
+ else
+ {
+ char *server;
+ GSList *gconf_servers = NULL;
+
+ server = g_strdup_printf("%s:%i", session->hostname, session->port);
+ gconf_servers = eel_gconf_get_string_list(MN_CONF_TRUSTED_SERVERS);
+
+ if (mn_g_str_slist_find(gconf_servers, server) != NULL)
+ status = TRUE;
+ else
+ {
+ if (mn_client_session_run_untrusted_dialog(session->hostname, _("missing certificate")))
+ {
+ status = TRUE;
+ gconf_servers = g_slist_append(gconf_servers, g_strdup(server));
+ eel_gconf_set_string_list(MN_CONF_TRUSTED_SERVERS, gconf_servers);
+ }
+ }
+
+ g_free(server);
+ eel_g_slist_free_deep(gconf_servers);
+ }
+
+ return status;
+}
+
+static gboolean
+mn_client_session_run_untrusted_dialog (const char *hostname,
+ const char *reason)
+{
+ GtkWidget *dialog;
+ char *secondary;
+ gboolean status;
+
+ g_return_val_if_fail(hostname != NULL, FALSE);
+ g_return_val_if_fail(reason != NULL, FALSE);
+
+ secondary = g_strdup_printf(_("Mail Notification was unable to trust \"%s\" "
+ "(%s). It is possible that someone is "
+ "intercepting your communication to obtain "
+ "your confidential information.\n"
+ "\n"
+ "You should only connect to the server if you "
+ "are certain you are connected to \"%s\". "
+ "If you choose to connect to the server, this "
+ "message will not be shown again."),
+ hostname, reason, hostname);
+
+ GDK_THREADS_ENTER();
+
+ dialog = eel_alert_dialog_new(NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_NONE,
+ _("Connect to untrusted server?"),
+ secondary,
+ NULL);
+
+ gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), _("Co_nnect"), GTK_RESPONSE_OK);
+
+ status = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK;
+ gtk_widget_destroy(dialog);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ g_free(secondary);
+ return status;
+}
#endif /* WITH_SSL */
static int
@@ -532,17 +673,19 @@ mn_client_session_write (MNClientSession *session,
}
#ifdef WITH_SSL
- if (session->use_ssl)
+ if (session->ssl)
bytes_written = SSL_write(session->ssl, array->data, array->len);
else
#endif /* WITH_SSL */
- bytes_written = write(session->s, array->data, array->len);
+ do
+ bytes_written = write(session->s, array->data, array->len);
+ while (bytes_written < 0 && errno == EINTR);
if (bytes_written <= 0)
{
#ifdef WITH_SSL
- if (session->use_ssl)
- result = mn_client_session_error(session, _("unable to write to server: %s"), ERR_reason_error_string(ERR_get_error()));
+ if (session->ssl)
+ result = mn_client_session_error(session, _("unable to write to server: %s"), mn_ssl_get_error());
else
#endif /* WITH_SSL */
{
@@ -722,7 +865,7 @@ mn_client_session_sasl_authentication_start (MNClientSession *session,
security.maxbufsize = READ_BUFSIZE;
/* only permit plaintext mechanisms if SSL is in use */
#ifdef WITH_SSL
- if (session->use_ssl)
+ if (session->ssl)
security.security_flags = 0;
else
#endif /* WITH_SSL */
diff --git a/src/mn-client-session.h b/src/mn-client-session.h
@@ -81,6 +81,10 @@ int mn_client_session_write (MNClientSession *session,
const char *format,
...);
+#ifdef WITH_SSL
+gboolean mn_client_session_enable_ssl (MNClientSession *session);
+#endif
+
#ifdef WITH_SASL
gboolean mn_client_session_sasl_authentication_start (MNClientSession *session,
const char *service,
diff --git a/src/mn-conf.c b/src/mn-conf.c
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 1999 Free Software Foundation, Inc.
* Copyright (c) 2003, 2004 Jean-Yves Lefort <jylefort@brutele.be>
*
* This program is free software; you can redistribute it and/or modify
@@ -18,15 +19,28 @@
#include "config.h"
#include <stdarg.h>
+#include <gnome.h>
#include <eel/eel.h>
#include "mn-util.h"
#include "mn-conf.h"
/*** cpp *********************************************************************/
+#define SESSION_MANUAL_CONFIG_PREFIX "session-manual/"
+#define SESSION_MANUAL_NAME "Default"
+
#define WINDOW_WIDTH_KEY "mn-conf-window-width-key"
#define WINDOW_HEIGHT_KEY "mn-conf-window-height-key"
+/*** types *******************************************************************/
+
+typedef struct
+{
+ int order;
+ int argc;
+ char **argv;
+} StartupClient;
+
/*** functions ***************************************************************/
static gboolean mn_conf_link_window_h (GtkWidget *widget,
@@ -60,38 +74,61 @@ static void mn_conf_link_entry_notify_cb (GConfClient *client,
static void mn_conf_link_weak_notify_cb (gpointer data,
GObject *former_object);
+static void mn_conf_startup_client_free (StartupClient *client);
+static void mn_conf_startup_clients_free (GSList *list);
+
+static int mn_conf_startup_client_compare (gconstpointer a, gconstpointer b);
+
+static GSList *mn_conf_startup_list_read (const char *name);
+static void mn_conf_startup_list_write (GSList *list, const char *name);
+
+static GSList *mn_conf_get_autostart_elem (GSList *list);
+
/*** implementation **********************************************************/
void
mn_conf_init (void)
{
- GSList *gconf_mailboxes;
- GSList *l;
-
- /* convert old style locators */
+ /* monitor our namespace */
+ eel_gconf_monitor_add(MN_CONF_NAMESPACE);
+}
- gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
- MN_LIST_FOREACH(l, gconf_mailboxes)
+void
+mn_conf_unset_obsolete (void)
+{
+ const char *obsolete[] = {
+ MN_CONF_LOCAL_NAMESPACE,
+ MN_CONF_REMOTE_NAMESPACE,
+ MN_CONF_COMMANDS_CLICKED_NAMESPACE,
+ MN_CONF_PREFERENCES_DIALOG
+ };
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS(obsolete); i++)
{
- char *locator_or_uri = l->data;
- char *uri;
-
- if (locator_or_uri[0] == '/')
- uri = g_strconcat("file://", locator_or_uri, NULL);
- else if (! strncmp(locator_or_uri, "pop3:", 5))
- uri = g_strconcat("pop://", locator_or_uri + 5, NULL);
- else
- uri = g_strdup(locator_or_uri);
-
- g_free(locator_or_uri);
- l->data = uri;
+ g_message(_("recursively unsetting %s"), obsolete[i]);
+ mn_conf_recursive_unset(obsolete[i], GCONF_UNSET_INCLUDING_SCHEMA_NAMES);
}
- eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+
+ g_message(_("syncing the GConf database"));
+ eel_gconf_suggest_sync();
- /* monitor our namespace */
+ g_message(_("completed"));
+}
- eel_gconf_monitor_add(MN_CONF_NAMESPACE);
+void
+mn_conf_recursive_unset (const char *key, GConfUnsetFlags flags)
+{
+ GConfClient *client;
+ GError *err = NULL;
+
+ g_return_if_fail(key != NULL);
+
+ client = eel_gconf_client_get_global();
+ g_return_if_fail(client != NULL);
+
+ gconf_client_recursive_unset(client, key, flags, &err);
+ eel_gconf_handle_error(&err);
}
void
@@ -192,12 +229,16 @@ mn_conf_link_window_notify_cb (GConfClient *client,
gpointer user_data)
{
GtkWindow *window = user_data;
- const char *width_key = g_object_get_data(G_OBJECT(window), WINDOW_WIDTH_KEY);
- const char *height_key = g_object_get_data(G_OBJECT(window), WINDOW_HEIGHT_KEY);
+ const char *width_key;
+ const char *height_key;
+ GDK_THREADS_ENTER();
+ width_key = g_object_get_data(G_OBJECT(window), WINDOW_WIDTH_KEY);
+ height_key = g_object_get_data(G_OBJECT(window), WINDOW_HEIGHT_KEY);
gtk_window_resize(window,
eel_gconf_get_integer(width_key),
eel_gconf_get_integer(height_key));
+ GDK_THREADS_LEAVE();
}
static void
@@ -216,7 +257,9 @@ mn_conf_link_toggle_button_notify_cb (GConfClient *client,
GConfValue *value = gconf_entry_get_value(entry);
GtkToggleButton *button = user_data;
+ GDK_THREADS_ENTER();
gtk_toggle_button_set_active(button, gconf_value_get_bool(value));
+ GDK_THREADS_LEAVE();
}
static void
@@ -235,7 +278,9 @@ mn_conf_link_spin_button_notify_cb (GConfClient *client,
GConfValue *value = gconf_entry_get_value(entry);
GtkSpinButton *button = user_data;
+ GDK_THREADS_ENTER();
gtk_spin_button_set_value(button, gconf_value_get_int(value));
+ GDK_THREADS_LEAVE();
}
static void
@@ -261,9 +306,11 @@ mn_conf_link_entry_notify_cb (GConfClient *client,
GtkEntry *entry_widget = user_data;
const char *str = NULL;
+ GDK_THREADS_ENTER();
if (value)
str = gconf_value_get_string(value);
gtk_entry_set_text(entry_widget, str ? str : "");
+ GDK_THREADS_LEAVE();
}
static void
@@ -272,3 +319,191 @@ mn_conf_link_weak_notify_cb (gpointer data, GObject *former_object)
unsigned int notification_id = GPOINTER_TO_UINT(data);
eel_gconf_notification_remove(notification_id);
}
+
+/*
+ * The mn_conf_startup_* functions are based on code taken from
+ * startup-programs.c in gnome-session, written by Owen Taylor.
+ */
+
+static void
+mn_conf_startup_client_free (StartupClient *client)
+{
+ int i;
+
+ g_return_if_fail(client != NULL);
+
+ for (i = 0; i < client->argc; i++)
+ g_free(client->argv[i]);
+
+ g_free(client->argv);
+ g_free(client);
+}
+
+static void
+mn_conf_startup_clients_free (GSList *list)
+{
+ eel_g_slist_free_deep_custom(list, (GFunc) mn_conf_startup_client_free, NULL);
+}
+
+static int
+mn_conf_startup_client_compare (gconstpointer a, gconstpointer b)
+{
+ const StartupClient *client_a = a;
+ const StartupClient *client_b = b;
+
+ return client_a->order - client_b->order;
+}
+
+static GSList *
+mn_conf_startup_list_read (const char *name)
+{
+ GSList *list = NULL;
+ gpointer iterator;
+ char *p;
+ StartupClient *client = NULL;
+ char *handle = NULL;
+
+ g_return_val_if_fail(name != NULL, NULL);
+
+ gnome_config_push_prefix(SESSION_MANUAL_CONFIG_PREFIX);
+
+ iterator = gnome_config_init_iterator(name);
+ while (iterator)
+ {
+ char *key;
+ char *value;
+
+ iterator = gnome_config_iterator_next(iterator, &key, &value);
+ if (! iterator)
+ break;
+
+ p = strchr(key, ',');
+ if (p)
+ {
+ *p = 0;
+
+ if (! client || strcmp(handle, key))
+ {
+ g_free(handle);
+ handle = g_strdup(key);
+
+ client = g_new0(StartupClient, 1);
+ list = g_slist_append(list, client);
+ }
+
+ if (! strcmp(p + 1, "Priority"))
+ client->order = atoi(value);
+ else if (! strcmp(p + 1, "RestartCommand"))
+ gnome_config_make_vector(value, &client->argc, &client->argv);
+ }
+
+ g_free(key);
+ g_free(value);
+ }
+
+ g_free(handle);
+ gnome_config_pop_prefix();
+
+ return g_slist_sort(list, mn_conf_startup_client_compare);
+}
+
+static void
+mn_conf_startup_list_write (GSList *list, const char *name)
+{
+ char *prefix;
+ int i = 0;
+ GSList *l;
+
+ g_return_if_fail(name != NULL);
+
+ gnome_config_push_prefix(SESSION_MANUAL_CONFIG_PREFIX);
+ gnome_config_clean_section(name);
+ gnome_config_pop_prefix();
+
+ prefix = g_strconcat(SESSION_MANUAL_CONFIG_PREFIX, name, "/", NULL);
+ gnome_config_push_prefix(prefix);
+ g_free(prefix);
+
+ gnome_config_set_int("num_clients", g_slist_length(list));
+
+ MN_LIST_FOREACH(l, list)
+ {
+ StartupClient *client = l->data;
+ char *key;
+
+ key = g_strdup_printf("%d,%s", i, "RestartStyleHint");
+ gnome_config_set_int(key, 3); /* RestartNever */
+ g_free(key);
+
+ key = g_strdup_printf("%d,%s", i, "Priority");
+ gnome_config_set_int(key, client->order);
+ g_free(key);
+
+ key = g_strdup_printf("%d,%s", i, "RestartCommand");
+ gnome_config_set_vector(key, client->argc, (const char * const *) client->argv);
+ g_free(key);
+
+ i++;
+ }
+
+ gnome_config_pop_prefix();
+ gnome_config_sync();
+}
+
+static GSList *
+mn_conf_get_autostart_elem (GSList *list)
+{
+ GSList *l;
+
+ MN_LIST_FOREACH(l, list)
+ {
+ StartupClient *client = l->data;
+
+ if (client->argc > 0 && ! strcmp(client->argv[0], "mail-notification"))
+ return l;
+ }
+
+ return NULL;
+}
+
+gboolean
+mn_conf_get_autostart (void)
+{
+ GSList *clients;
+ gboolean autostart;
+
+ clients = mn_conf_startup_list_read(SESSION_MANUAL_NAME);
+ autostart = mn_conf_get_autostart_elem(clients) != NULL;
+ mn_conf_startup_clients_free(clients);
+
+ return autostart;
+}
+
+void
+mn_conf_set_autostart (gboolean autostart)
+{
+ GSList *clients;
+ GSList *elem;
+
+ clients = mn_conf_startup_list_read(SESSION_MANUAL_NAME);
+ elem = mn_conf_get_autostart_elem(clients);
+ if ((elem != NULL) != autostart)
+ {
+ if (autostart)
+ {
+ StartupClient *client;
+
+ client = g_new0(StartupClient, 1);
+ client->order = 50;
+ gnome_config_make_vector("mail-notification", &client->argc, &client->argv);
+
+ clients = g_slist_append(clients, client);
+ clients = g_slist_sort(clients, mn_conf_startup_client_compare);
+ }
+ else
+ clients = mn_g_slist_delete_link_deep_custom(clients, elem, (GFunc) mn_conf_startup_client_free, NULL);
+
+ mn_conf_startup_list_write(clients, SESSION_MANUAL_NAME);
+ }
+ mn_conf_startup_clients_free(clients);
+}
diff --git a/src/mn-conf.h b/src/mn-conf.h
@@ -22,33 +22,77 @@
#include <stdarg.h>
#include <eel/eel.h>
-#define MN_CONF_NAMESPACE "/apps/mail-notification"
-#define MN_CONF_LOCAL_NAMESPACE MN_CONF_NAMESPACE "/local" /* obsolete */
-#define MN_CONF_LOCAL_ENABLED MN_CONF_LOCAL_NAMESPACE "/enabled" /* obsolete */
-#define MN_CONF_LOCAL_DELAY_MINUTES MN_CONF_LOCAL_NAMESPACE "/delay/minutes" /* obsolete */
-#define MN_CONF_LOCAL_DELAY_SECONDS MN_CONF_LOCAL_NAMESPACE "/delay/seconds" /* obsolete */
-#define MN_CONF_REMOTE_NAMESPACE MN_CONF_NAMESPACE "/remote" /* obsolete */
-#define MN_CONF_REMOTE_ENABLED MN_CONF_REMOTE_NAMESPACE "/enabled" /* obsolete */
-#define MN_CONF_REMOTE_DELAY_MINUTES MN_CONF_REMOTE_NAMESPACE "/delay/minutes" /* obsolete */
-#define MN_CONF_REMOTE_DELAY_SECONDS MN_CONF_REMOTE_NAMESPACE "/delay/seconds" /* obsolete */
-#define MN_CONF_DELAY_NAMESPACE MN_CONF_NAMESPACE "/delay"
-#define MN_CONF_DELAY_MINUTES MN_CONF_DELAY_NAMESPACE "/minutes"
-#define MN_CONF_DELAY_SECONDS MN_CONF_DELAY_NAMESPACE "/seconds"
-#define MN_CONF_COMMANDS_NEW_MAIL_ENABLED MN_CONF_NAMESPACE "/commands/new-mail/enabled"
-#define MN_CONF_COMMANDS_NEW_MAIL_COMMAND MN_CONF_NAMESPACE "/commands/new-mail/command"
-#define MN_CONF_COMMANDS_CLICKED_ENABLED MN_CONF_NAMESPACE "/commands/clicked/enabled" /* obsolete */
-#define MN_CONF_COMMANDS_CLICKED_COMMAND MN_CONF_NAMESPACE "/commands/clicked/command" /* obsolete */
-#define MN_CONF_COMMANDS_DOUBLE_CLICKED_ENABLED MN_CONF_NAMESPACE "/commands/double-clicked/enabled"
-#define MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND MN_CONF_NAMESPACE "/commands/double-clicked/command"
-#define MN_CONF_MAILBOXES MN_CONF_NAMESPACE "/mailboxes"
-#define MN_CONF_UI_NAMESPACE MN_CONF_NAMESPACE "/ui"
-#define MN_CONF_PREFERENCES_DIALOG MN_CONF_UI_NAMESPACE "/preferences-dialog" /* obsolete */
-#define MN_CONF_PROPERTIES_DIALOG MN_CONF_UI_NAMESPACE "/properties-dialog"
-#define MN_CONF_ALREADY_RUN MN_CONF_NAMESPACE "/already-run"
+#define MN_CONF_NAMESPACE \
+ "/apps/mail-notification"
+#define MN_CONF_LOCAL_NAMESPACE \
+ MN_CONF_NAMESPACE "/local" /* obsolete */
+#define MN_CONF_LOCAL_ENABLED \
+ MN_CONF_LOCAL_NAMESPACE "/enabled" /* obsolete */
+#define MN_CONF_LOCAL_DELAY_MINUTES \
+ MN_CONF_LOCAL_NAMESPACE "/delay/minutes" /* obsolete */
+#define MN_CONF_LOCAL_DELAY_SECONDS \
+ MN_CONF_LOCAL_NAMESPACE "/delay/seconds" /* obsolete */
+#define MN_CONF_REMOTE_NAMESPACE \
+ MN_CONF_NAMESPACE "/remote" /* obsolete */
+#define MN_CONF_REMOTE_ENABLED \
+ MN_CONF_REMOTE_NAMESPACE "/enabled" /* obsolete */
+#define MN_CONF_REMOTE_DELAY_MINUTES \
+ MN_CONF_REMOTE_NAMESPACE "/delay/minutes" /* obsolete */
+#define MN_CONF_REMOTE_DELAY_SECONDS \
+ MN_CONF_REMOTE_NAMESPACE "/delay/seconds" /* obsolete */
+#define MN_CONF_DELAY_NAMESPACE \
+ MN_CONF_NAMESPACE "/delay"
+#define MN_CONF_DELAY_MINUTES \
+ MN_CONF_DELAY_NAMESPACE "/minutes"
+#define MN_CONF_DELAY_SECONDS \
+ MN_CONF_DELAY_NAMESPACE "/seconds"
+#define MN_CONF_COMMANDS_NAMESPACE \
+ MN_CONF_NAMESPACE "/commands"
+#define MN_CONF_COMMANDS_NEW_MAIL_NAMESPACE \
+ MN_CONF_COMMANDS_NAMESPACE "/new-mail"
+#define MN_CONF_COMMANDS_NEW_MAIL_ENABLED \
+ MN_CONF_COMMANDS_NEW_MAIL_NAMESPACE "/enabled"
+#define MN_CONF_COMMANDS_NEW_MAIL_COMMAND \
+ MN_CONF_COMMANDS_NEW_MAIL_NAMESPACE "/command"
+#define MN_CONF_COMMANDS_CLICKED_NAMESPACE \
+ MN_CONF_COMMANDS_NAMESPACE "/clicked" /* obsolete */
+#define MN_CONF_COMMANDS_CLICKED_ENABLED \
+ MN_CONF_COMMANDS_CLICKED_NAMESPACE "/enabled" /* obsolete */
+#define MN_CONF_COMMANDS_CLICKED_COMMAND \
+ MN_CONF_COMMANDS_CLICKED_NAMESPACE "/command" /* obsolete */
+#define MN_CONF_COMMANDS_DOUBLE_CLICKED_NAMESPACE \
+ MN_CONF_COMMANDS_NAMESPACE "/double-clicked"
+#define MN_CONF_COMMANDS_DOUBLE_CLICKED_ENABLED \
+ MN_CONF_COMMANDS_DOUBLE_CLICKED_NAMESPACE "/enabled"
+#define MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND \
+ MN_CONF_COMMANDS_DOUBLE_CLICKED_NAMESPACE "/command"
+#define MN_CONF_MAILBOXES \
+ MN_CONF_NAMESPACE "/mailboxes"
+#define MN_CONF_UI_NAMESPACE \
+ MN_CONF_NAMESPACE "/ui"
+#define MN_CONF_PREFERENCES_DIALOG \
+ MN_CONF_UI_NAMESPACE "/preferences-dialog" /* obsolete */
+#define MN_CONF_PROPERTIES_DIALOG \
+ MN_CONF_UI_NAMESPACE "/properties-dialog"
+#define MN_CONF_ALREADY_RUN \
+ MN_CONF_NAMESPACE "/already-run"
+#define MN_CONF_BLINK_ON_ERRORS \
+ MN_CONF_NAMESPACE "/blink-on-errors"
+#define MN_CONF_TRUSTED_X509_CERTIFICATES \
+ MN_CONF_NAMESPACE "/trusted-x509-certificates"
+#define MN_CONF_TRUSTED_SERVERS \
+ MN_CONF_NAMESPACE "/trusted-servers"
void mn_conf_init (void);
+void mn_conf_unset_obsolete (void);
+
+void mn_conf_recursive_unset (const char *key,
+ GConfUnsetFlags flags);
void mn_conf_link (GtkWidget *widget,
...);
+gboolean mn_conf_get_autostart (void);
+void mn_conf_set_autostart (gboolean autostart);
+
#endif /* _MN_CONF_H */
diff --git a/src/mn-dialog.c b/src/mn-dialog.c
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2003, 2004 Jean-Yves Lefort <jylefort@brutele.be>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-#include <stdarg.h>
-#include <stdlib.h>
-#include <glib/gi18n-lib.h>
-#include <gtk/gtk.h>
-#include "mn-util.h"
-
-/*** implementation **********************************************************/
-
-/*
- * Displays an HIG-compliant modal dialog.
- *
- * Actually, it won't fully comply to the HIG because of
- * http://bugzilla.gnome.org/show_bug.cgi?id=98779.
- */
-void
-mn_error_dialog (const char *help_link_id,
- const char *primary,
- const char *format,
- ...)
-{
- GtkWidget *dialog;
- GtkWidget *label;
- char *secondary = NULL;
- GString *message;
- char *escaped;
-
- mn_create_interface("dialog",
- "dialog", &dialog,
- "label", &label,
- NULL);
-
- gtk_window_set_title(GTK_WINDOW(dialog), "");
-
- if (help_link_id != NULL)
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_HELP, GTK_RESPONSE_HELP);
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
-
- message = g_string_new(NULL);
-
- if (format)
- {
- va_list args;
-
- va_start(args, format);
- secondary = g_strdup_vprintf(format, args);
- va_end(args);
- }
-
- if (primary)
- {
- escaped = g_markup_printf_escaped("<span weight=\"bold\" size=\"larger\">%s</span>", primary);
- g_string_append(message, escaped);
- g_free(escaped);
- }
-
- if (secondary)
- {
- if (primary)
- g_string_append(message, "\n\n");
-
- escaped = g_markup_escape_text(secondary, -1);
- g_free(secondary);
-
- g_string_append(message, escaped);
- g_free(escaped);
- }
-
- gtk_label_set_markup(GTK_LABEL(label), message->str);
- g_string_free(message, TRUE);
-
- while (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_HELP)
- mn_display_help(help_link_id);
-
- gtk_widget_destroy(dialog);
-}
-
-void
-mn_fatal_error_dialog (const char *format, ...)
-{
- va_list args;
- char *secondary;
-
- g_return_if_fail(format != NULL);
-
- va_start(args, format);
- secondary = g_strdup_vprintf(format, args);
- va_end(args);
-
- mn_error_dialog(NULL, _("A fatal error has occurred in Mail Notification"), "%s", secondary);
- g_free(secondary);
-
- exit(1);
-}
diff --git a/src/mn-dialog.h b/src/mn-dialog.h
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003 Jean-Yves Lefort <jylefort@brutele.be>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _MN_DIALOG_H
-#define _MN_DIALOG_H
-
-#include <stdarg.h>
-
-void mn_error_dialog (const char *help_link_id,
- const char *primary,
- const char *format,
- ...);
-void mn_fatal_error_dialog (const char *format,
- ...);
-
-#endif /* _MN_DIALOG_H */
diff --git a/src/mn-gmail-mailbox-private.h b/src/mn-gmail-mailbox-private.h
@@ -10,15 +10,11 @@ extern "C" {
#endif /* __cplusplus */
struct _MNGmailMailboxPrivate {
-#line 38 "mn-gmail-mailbox.gob"
- char * username;
-#line 39 "mn-gmail-mailbox.gob"
- char * password;
-#line 40 "mn-gmail-mailbox.gob"
+#line 37 "mn-gmail-mailbox.gob"
GHashTable * cookies;
-#line 41 "mn-gmail-mailbox.gob"
+#line 38 "mn-gmail-mailbox.gob"
gboolean logged_in;
-#line 22 "mn-gmail-mailbox-private.h"
+#line 18 "mn-gmail-mailbox-private.h"
};
#ifdef __cplusplus
diff --git a/src/mn-gmail-mailbox-properties-private.h b/src/mn-gmail-mailbox-properties-private.h
@@ -10,13 +10,13 @@ extern "C" {
#endif /* __cplusplus */
struct _MNGmailMailboxPropertiesPrivate {
-#line 36 "mn-gmail-mailbox-properties.gob"
+#line 35 "mn-gmail-mailbox-properties.gob"
GtkSizeGroup * size_group;
-#line 51 "mn-gmail-mailbox-properties.gob"
+#line 50 "mn-gmail-mailbox-properties.gob"
GtkWidget * username_entry;
-#line 52 "mn-gmail-mailbox-properties.gob"
+#line 51 "mn-gmail-mailbox-properties.gob"
GtkWidget * password_entry;
-#line 53 "mn-gmail-mailbox-properties.gob"
+#line 52 "mn-gmail-mailbox-properties.gob"
GtkTooltips * tooltips;
#line 22 "mn-gmail-mailbox-properties-private.h"
};
diff --git a/src/mn-gmail-mailbox-properties.c b/src/mn-gmail-mailbox-properties.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -27,10 +27,9 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-util.h"
-#line 34 "mn-gmail-mailbox-properties.c"
+#line 33 "mn-gmail-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_GMAIL_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_GMAIL_MAILBOX_PROPERTIES_CONST(x)
@@ -51,8 +50,8 @@ static void mn_gmail_mailbox_properties_init (MNGmailMailboxProperties * o) G_GN
static void mn_gmail_mailbox_properties_class_init (MNGmailMailboxPropertiesClass * c) G_GNUC_UNUSED;
static GObject * ___1_mn_gmail_mailbox_properties_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
static void mn_gmail_mailbox_properties_entry_changed_h (GtkEditable * editable, gpointer user_data) G_GNUC_UNUSED;
-static gboolean mn_gmail_mailbox_properties_set_uri (MNMailboxProperties * self, const char * uri) G_GNUC_UNUSED;
-static char * mn_gmail_mailbox_properties_get_uri (MNMailboxProperties * self) G_GNUC_UNUSED;
+static gboolean mn_gmail_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri) G_GNUC_UNUSED;
+static MNURI * mn_gmail_mailbox_properties_get_uri (MNMailboxProperties * self) G_GNUC_UNUSED;
enum {
PROP_0,
@@ -73,11 +72,11 @@ static GtkVBoxClass *parent_class = NULL;
static void
___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
{
-#line 100 "mn-gmail-mailbox-properties.gob"
+#line 99 "mn-gmail-mailbox-properties.gob"
iface->set_uri = self_set_uri;
-#line 121 "mn-gmail-mailbox-properties.gob"
+#line 114 "mn-gmail-mailbox-properties.gob"
iface->get_uri = self_get_uri;
-#line 81 "mn-gmail-mailbox-properties.c"
+#line 80 "mn-gmail-mailbox-properties.c"
}
GType
@@ -139,12 +138,12 @@ ___dispose (GObject *obj_self)
MNGmailMailboxProperties *self G_GNUC_UNUSED = MN_GMAIL_MAILBOX_PROPERTIES (obj_self);
if (G_OBJECT_CLASS (parent_class)->dispose) \
(* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
-#line 36 "mn-gmail-mailbox-properties.gob"
+#line 35 "mn-gmail-mailbox-properties.gob"
if(self->_priv->size_group) { ((*(void (*)(void *))g_object_unref)) (self->_priv->size_group); self->_priv->size_group = NULL; }
-#line 145 "mn-gmail-mailbox-properties.c"
-#line 53 "mn-gmail-mailbox-properties.gob"
+#line 144 "mn-gmail-mailbox-properties.c"
+#line 52 "mn-gmail-mailbox-properties.gob"
if(self->_priv->tooltips) { ((*(void (*)(void *))g_object_unref)) (self->_priv->tooltips); self->_priv->tooltips = NULL; }
-#line 148 "mn-gmail-mailbox-properties.c"
+#line 147 "mn-gmail-mailbox-properties.c"
}
#undef __GOB_FUNCTION__
@@ -166,9 +165,9 @@ mn_gmail_mailbox_properties_init (MNGmailMailboxProperties * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::init"
o->_priv = g_new0 (MNGmailMailboxPropertiesPrivate, 1);
-#line 53 "mn-gmail-mailbox-properties.gob"
+#line 52 "mn-gmail-mailbox-properties.gob"
o->_priv->tooltips = mn_tooltips_new();
-#line 172 "mn-gmail-mailbox-properties.c"
+#line 171 "mn-gmail-mailbox-properties.c"
}
#undef __GOB_FUNCTION__
static void
@@ -179,9 +178,9 @@ mn_gmail_mailbox_properties_class_init (MNGmailMailboxPropertiesClass * c G_GNUC
parent_class = g_type_class_ref (GTK_TYPE_VBOX);
-#line 55 "mn-gmail-mailbox-properties.gob"
+#line 54 "mn-gmail-mailbox-properties.gob"
g_object_class->constructor = ___1_mn_gmail_mailbox_properties_constructor;
-#line 185 "mn-gmail-mailbox-properties.c"
+#line 184 "mn-gmail-mailbox-properties.c"
g_object_class->dispose = ___dispose;
g_object_class->finalize = ___finalize;
g_object_class->get_property = ___object_get_property;
@@ -214,9 +213,9 @@ ___object_set_property (GObject *object,
switch (property_id) {
case PROP_SIZE_GROUP:
{
-#line 37 "mn-gmail-mailbox-properties.gob"
+#line 36 "mn-gmail-mailbox-properties.gob"
{ GObject *___old = (GObject *)self->_priv->size_group; self->_priv->size_group = (void *)g_value_dup_object (VAL); if (___old != NULL) { g_object_unref (G_OBJECT (___old)); } }
-#line 220 "mn-gmail-mailbox-properties.c"
+#line 219 "mn-gmail-mailbox-properties.c"
}
break;
default:
@@ -245,21 +244,21 @@ ___object_get_property (GObject *object,
switch (property_id) {
case PROP_LABEL:
{
-#line 34 "mn-gmail-mailbox-properties.gob"
+#line 33 "mn-gmail-mailbox-properties.gob"
g_value_set_string(VAL, "Gmail");
-#line 251 "mn-gmail-mailbox-properties.c"
+#line 250 "mn-gmail-mailbox-properties.c"
}
break;
case PROP_SIZE_GROUP:
{
-#line 37 "mn-gmail-mailbox-properties.gob"
+#line 36 "mn-gmail-mailbox-properties.gob"
g_value_set_object (VAL, (gpointer)self->_priv->size_group);
-#line 258 "mn-gmail-mailbox-properties.c"
+#line 257 "mn-gmail-mailbox-properties.c"
}
break;
case PROP_COMPLETE:
{
-#line 41 "mn-gmail-mailbox-properties.gob"
+#line 40 "mn-gmail-mailbox-properties.gob"
const char *username;
const char *password;
@@ -269,7 +268,7 @@ g_value_set_object (VAL, (gpointer)self->_priv->size_group);
g_value_set_boolean(VAL, *username && *password);
-#line 273 "mn-gmail-mailbox-properties.c"
+#line 272 "mn-gmail-mailbox-properties.c"
}
break;
default:
@@ -286,10 +285,10 @@ g_value_set_object (VAL, (gpointer)self->_priv->size_group);
-#line 55 "mn-gmail-mailbox-properties.gob"
+#line 54 "mn-gmail-mailbox-properties.gob"
static GObject *
___1_mn_gmail_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
-#line 293 "mn-gmail-mailbox-properties.c"
+#line 292 "mn-gmail-mailbox-properties.c"
#define PARENT_HANDLER(___type,___n_construct_properties,___construct_params) \
((G_OBJECT_CLASS(parent_class)->constructor)? \
(* G_OBJECT_CLASS(parent_class)->constructor)(___type,___n_construct_properties,___construct_params): \
@@ -297,7 +296,7 @@ ___1_mn_gmail_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::constructor"
{
-#line 57 "mn-gmail-mailbox-properties.gob"
+#line 56 "mn-gmail-mailbox-properties.gob"
GObject *object;
Self *self;
@@ -332,80 +331,76 @@ ___1_mn_gmail_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_
return object;
}}
-#line 336 "mn-gmail-mailbox-properties.c"
+#line 335 "mn-gmail-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 92 "mn-gmail-mailbox-properties.gob"
+#line 91 "mn-gmail-mailbox-properties.gob"
static void
mn_gmail_mailbox_properties_entry_changed_h (GtkEditable * editable, gpointer user_data)
-#line 343 "mn-gmail-mailbox-properties.c"
+#line 342 "mn-gmail-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::entry_changed_h"
-#line 92 "mn-gmail-mailbox-properties.gob"
+#line 91 "mn-gmail-mailbox-properties.gob"
g_return_if_fail (editable != NULL);
-#line 92 "mn-gmail-mailbox-properties.gob"
+#line 91 "mn-gmail-mailbox-properties.gob"
g_return_if_fail (GTK_IS_EDITABLE (editable));
-#line 92 "mn-gmail-mailbox-properties.gob"
+#line 91 "mn-gmail-mailbox-properties.gob"
g_return_if_fail (user_data != NULL);
-#line 352 "mn-gmail-mailbox-properties.c"
+#line 351 "mn-gmail-mailbox-properties.c"
{
-#line 95 "mn-gmail-mailbox-properties.gob"
+#line 94 "mn-gmail-mailbox-properties.gob"
Self *self = user_data;
g_object_notify(G_OBJECT(self), "complete");
}}
-#line 359 "mn-gmail-mailbox-properties.c"
+#line 358 "mn-gmail-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 100 "mn-gmail-mailbox-properties.gob"
+#line 99 "mn-gmail-mailbox-properties.gob"
static gboolean
-mn_gmail_mailbox_properties_set_uri (MNMailboxProperties * self, const char * uri)
-#line 365 "mn-gmail-mailbox-properties.c"
+mn_gmail_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri)
+#line 364 "mn-gmail-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::set_uri"
-#line 100 "mn-gmail-mailbox-properties.gob"
+#line 99 "mn-gmail-mailbox-properties.gob"
g_return_val_if_fail (self != NULL, (gboolean )0);
-#line 100 "mn-gmail-mailbox-properties.gob"
+#line 99 "mn-gmail-mailbox-properties.gob"
g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (gboolean )0);
-#line 100 "mn-gmail-mailbox-properties.gob"
+#line 99 "mn-gmail-mailbox-properties.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 374 "mn-gmail-mailbox-properties.c"
+#line 99 "mn-gmail-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 375 "mn-gmail-mailbox-properties.c"
{
-#line 103 "mn-gmail-mailbox-properties.gob"
+#line 102 "mn-gmail-mailbox-properties.gob"
- char *username;
- char *password;
-
- if (mn_uri_parse_gmail(uri, &username, &password))
+ if (MN_URI_IS_GMAIL(uri))
{
- gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->username_entry), username);
- gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->password_entry), password);
-
- g_free(username);
- g_free(password);
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->username_entry), uri->username);
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->password_entry), uri->password);
return TRUE;
}
else
return FALSE;
}}
-#line 394 "mn-gmail-mailbox-properties.c"
+#line 389 "mn-gmail-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 121 "mn-gmail-mailbox-properties.gob"
-static char *
+#line 114 "mn-gmail-mailbox-properties.gob"
+static MNURI *
mn_gmail_mailbox_properties_get_uri (MNMailboxProperties * self)
-#line 400 "mn-gmail-mailbox-properties.c"
+#line 395 "mn-gmail-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::get_uri"
-#line 121 "mn-gmail-mailbox-properties.gob"
- g_return_val_if_fail (self != NULL, (char * )0);
-#line 121 "mn-gmail-mailbox-properties.gob"
- g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (char * )0);
-#line 407 "mn-gmail-mailbox-properties.c"
+#line 114 "mn-gmail-mailbox-properties.gob"
+ g_return_val_if_fail (self != NULL, (MNURI * )0);
+#line 114 "mn-gmail-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (MNURI * )0);
+#line 402 "mn-gmail-mailbox-properties.c"
{
-#line 123 "mn-gmail-mailbox-properties.gob"
+#line 116 "mn-gmail-mailbox-properties.gob"
const char *username;
const char *password;
@@ -413,7 +408,7 @@ mn_gmail_mailbox_properties_get_uri (MNMailboxProperties * self)
username = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->username_entry));
password = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->password_entry));
- return mn_uri_build_gmail(username, password);
+ return mn_uri_new_gmail(username, password);
}}
-#line 419 "mn-gmail-mailbox-properties.c"
+#line 414 "mn-gmail-mailbox-properties.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-gmail-mailbox-properties.gob b/src/mn-gmail-mailbox-properties.gob
@@ -24,7 +24,6 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-util.h"
%}
@@ -99,18 +98,12 @@ class MN:Gmail:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties
interface MN:Mailbox:Properties private gboolean
set_uri (MN:Mailbox:Properties *self (check null type),
- const char *uri (check null))
+ MN:URI *uri (check null type))
{
- char *username;
- char *password;
-
- if (mn_uri_parse_gmail(uri, &username, &password))
+ if (MN_URI_IS_GMAIL(uri))
{
- gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->username_entry), username);
- gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->password_entry), password);
-
- g_free(username);
- g_free(password);
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->username_entry), uri->username);
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->password_entry), uri->password);
return TRUE;
}
@@ -118,7 +111,7 @@ class MN:Gmail:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties
return FALSE;
}
- interface MN:Mailbox:Properties private char *
+ interface MN:Mailbox:Properties private MNURI *
get_uri (MN:Mailbox:Properties *self (check null type))
{
const char *username;
@@ -127,6 +120,6 @@ class MN:Gmail:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties
username = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->username_entry));
password = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->password_entry));
- return mn_uri_build_gmail(username, password);
+ return mn_uri_new_gmail(username, password);
}
}
diff --git a/src/mn-gmail-mailbox.c b/src/mn-gmail-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -30,12 +30,11 @@
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libsoup/soup.h>
#include "mn-mailbox-private.h"
-#include "mn-uri.h"
#include "mn-util.h"
#include "mn-stock.h"
#include "mn-soup.h"
-#line 39 "mn-gmail-mailbox.c"
+#line 38 "mn-gmail-mailbox.c"
/* self casting macros */
#define SELF(x) MN_GMAIL_MAILBOX(x)
#define SELF_CONST(x) MN_GMAIL_MAILBOX_CONST(x)
@@ -54,9 +53,13 @@ static void mn_gmail_mailbox_init (MNGmailMailbox * o) G_GNUC_UNUSED;
static void mn_gmail_mailbox_class_init (MNGmailMailboxClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_gmail_mailbox_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
static void ___3_mn_gmail_mailbox_finalize (GObject * object) G_GNUC_UNUSED;
-static gboolean ___4_mn_gmail_mailbox_impl_is (MNMailbox * dummy, const char * uri) G_GNUC_UNUSED;
+static gboolean ___4_mn_gmail_mailbox_impl_is (MNMailbox * dummy, MNURI * uri) G_GNUC_UNUSED;
static void ___5_mn_gmail_mailbox_impl_check (MNMailbox * mailbox) G_GNUC_UNUSED;
static void mn_gmail_mailbox_get (MNGmailMailbox * self, const char * uri, SoupCallbackFn callback) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_dump_request (MNGmailMailbox * self, SoupMessage * message) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_dump_request_cb (gpointer key, gpointer value, gpointer user_data) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_dump_response (MNGmailMailbox * self, SoupMessage * message) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_dump_response_cb (gpointer key, gpointer value, gpointer user_data) G_GNUC_UNUSED;
static char * mn_gmail_mailbox_get_token (const char * str, const char * pre, const char * post, gboolean include_pre, gboolean include_post) G_GNUC_UNUSED;
static void mn_gmail_mailbox_login (MNGmailMailbox * self) G_GNUC_UNUSED;
static void mn_gmail_mailbox_login_cb1 (SoupMessage * message, gpointer user_data) G_GNUC_UNUSED;
@@ -74,6 +77,10 @@ static MNMailboxClass *parent_class = NULL;
/* Short form macros */
#define self_get mn_gmail_mailbox_get
+#define self_dump_request mn_gmail_mailbox_dump_request
+#define self_dump_request_cb mn_gmail_mailbox_dump_request_cb
+#define self_dump_response mn_gmail_mailbox_dump_response
+#define self_dump_response_cb mn_gmail_mailbox_dump_response_cb
#define self_get_token mn_gmail_mailbox_get_token
#define self_login mn_gmail_mailbox_login
#define self_login_cb1 mn_gmail_mailbox_login_cb1
@@ -134,18 +141,12 @@ ___finalize(GObject *obj_self)
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::finalize"
MNGmailMailbox *self G_GNUC_UNUSED = MN_GMAIL_MAILBOX (obj_self);
gpointer priv = self->_priv;
-#line 70 "mn-gmail-mailbox.gob"
+#line 58 "mn-gmail-mailbox.gob"
___3_mn_gmail_mailbox_finalize(obj_self);
-#line 140 "mn-gmail-mailbox.c"
-#line 38 "mn-gmail-mailbox.gob"
- if(self->_priv->username) { ((*(void (*)(void *))g_free)) (self->_priv->username); self->_priv->username = NULL; }
-#line 143 "mn-gmail-mailbox.c"
-#line 39 "mn-gmail-mailbox.gob"
- if(self->_priv->password) { ((*(void (*)(void *))g_free)) (self->_priv->password); self->_priv->password = NULL; }
-#line 146 "mn-gmail-mailbox.c"
-#line 40 "mn-gmail-mailbox.gob"
+#line 147 "mn-gmail-mailbox.c"
+#line 37 "mn-gmail-mailbox.gob"
if(self->_priv->cookies) { ((*(void (*)(void *))g_hash_table_destroy)) (self->_priv->cookies); self->_priv->cookies = NULL; }
-#line 149 "mn-gmail-mailbox.c"
+#line 150 "mn-gmail-mailbox.c"
g_free (priv);
}
#undef __GOB_FUNCTION__
@@ -157,10 +158,10 @@ mn_gmail_mailbox_init (MNGmailMailbox * o G_GNUC_UNUSED)
o->_priv = g_new0 (MNGmailMailboxPrivate, 1);
}
#undef __GOB_FUNCTION__
-#line 43 "mn-gmail-mailbox.gob"
+#line 40 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_class_init (MNGmailMailboxClass * class G_GNUC_UNUSED)
-#line 164 "mn-gmail-mailbox.c"
+#line 165 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::class_init"
GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
@@ -168,32 +169,32 @@ mn_gmail_mailbox_class_init (MNGmailMailboxClass * class G_GNUC_UNUSED)
parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
-#line 49 "mn-gmail-mailbox.gob"
+#line 46 "mn-gmail-mailbox.gob"
g_object_class->constructor = ___2_mn_gmail_mailbox_constructor;
-#line 70 "mn-gmail-mailbox.gob"
+#line 58 "mn-gmail-mailbox.gob"
g_object_class->finalize = ___finalize;
-#line 77 "mn-gmail-mailbox.gob"
+#line 65 "mn-gmail-mailbox.gob"
mn_mailbox_class->impl_is = ___4_mn_gmail_mailbox_impl_is;
-#line 90 "mn-gmail-mailbox.gob"
+#line 71 "mn-gmail-mailbox.gob"
mn_mailbox_class->impl_check = ___5_mn_gmail_mailbox_impl_check;
-#line 180 "mn-gmail-mailbox.c"
+#line 181 "mn-gmail-mailbox.c"
{
-#line 44 "mn-gmail-mailbox.gob"
+#line 41 "mn-gmail-mailbox.gob"
MN_MAILBOX_CLASS(class)->stock_id = MN_STOCK_GMAIL;
MN_MAILBOX_CLASS(class)->format = "Gmail";
-#line 187 "mn-gmail-mailbox.c"
+#line 188 "mn-gmail-mailbox.c"
}
}
#undef __GOB_FUNCTION__
-#line 49 "mn-gmail-mailbox.gob"
+#line 46 "mn-gmail-mailbox.gob"
static GObject *
___2_mn_gmail_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
-#line 197 "mn-gmail-mailbox.c"
+#line 198 "mn-gmail-mailbox.c"
#define PARENT_HANDLER(___type,___n_construct_properties,___construct_params) \
((G_OBJECT_CLASS(parent_class)->constructor)? \
(* G_OBJECT_CLASS(parent_class)->constructor)(___type,___n_construct_properties,___construct_params): \
@@ -201,93 +202,79 @@ ___2_mn_gmail_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_p
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::constructor"
{
-#line 51 "mn-gmail-mailbox.gob"
+#line 48 "mn-gmail-mailbox.gob"
GObject *object;
- MNMailbox *mailbox;
- Self *self;
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
- mailbox = MN_MAILBOX(object);
- self = SELF(object);
mn_soup_use();
- if (! mn_uri_parse_gmail(mn_mailbox_get_uri(mailbox),
- &selfp->username,
- &selfp->password))
- mn_mailbox_set_init_error(mailbox, _("unable to parse Gmail URI"));
-
return object;
}}
-#line 224 "mn-gmail-mailbox.c"
+#line 216 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 70 "mn-gmail-mailbox.gob"
+#line 58 "mn-gmail-mailbox.gob"
static void
___3_mn_gmail_mailbox_finalize (GObject * object G_GNUC_UNUSED)
-#line 231 "mn-gmail-mailbox.c"
+#line 223 "mn-gmail-mailbox.c"
#define PARENT_HANDLER(___object) \
{ if(G_OBJECT_CLASS(parent_class)->finalize) \
(* G_OBJECT_CLASS(parent_class)->finalize)(___object); }
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::finalize"
{
-#line 72 "mn-gmail-mailbox.gob"
+#line 60 "mn-gmail-mailbox.gob"
mn_soup_unuse();
PARENT_HANDLER(object);
}}
-#line 243 "mn-gmail-mailbox.c"
+#line 235 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 77 "mn-gmail-mailbox.gob"
+#line 65 "mn-gmail-mailbox.gob"
static gboolean
-___4_mn_gmail_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
-#line 250 "mn-gmail-mailbox.c"
+___4_mn_gmail_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, MNURI * uri)
+#line 242 "mn-gmail-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
(* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
((gboolean )0))
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::impl_is"
-#line 77 "mn-gmail-mailbox.gob"
+#line 65 "mn-gmail-mailbox.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 259 "mn-gmail-mailbox.c"
+#line 65 "mn-gmail-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 253 "mn-gmail-mailbox.c"
{
-#line 79 "mn-gmail-mailbox.gob"
+#line 67 "mn-gmail-mailbox.gob"
- char *scheme;
- gboolean is;
-
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && ! strcmp(scheme, "gmail");
- g_free(scheme);
-
- return is;
+ return MN_URI_IS_GMAIL(uri);
}}
-#line 272 "mn-gmail-mailbox.c"
+#line 259 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 90 "mn-gmail-mailbox.gob"
+#line 71 "mn-gmail-mailbox.gob"
static void
___5_mn_gmail_mailbox_impl_check (MNMailbox * mailbox G_GNUC_UNUSED)
-#line 279 "mn-gmail-mailbox.c"
+#line 266 "mn-gmail-mailbox.c"
#define PARENT_HANDLER(___mailbox) \
{ if(MN_MAILBOX_CLASS(parent_class)->impl_check) \
(* MN_MAILBOX_CLASS(parent_class)->impl_check)(___mailbox); }
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::impl_check"
-#line 90 "mn-gmail-mailbox.gob"
+#line 71 "mn-gmail-mailbox.gob"
g_return_if_fail (mailbox != NULL);
-#line 90 "mn-gmail-mailbox.gob"
+#line 71 "mn-gmail-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (mailbox));
-#line 289 "mn-gmail-mailbox.c"
+#line 276 "mn-gmail-mailbox.c"
{
-#line 92 "mn-gmail-mailbox.gob"
+#line 73 "mn-gmail-mailbox.gob"
Self *self = SELF(mailbox);
@@ -296,27 +283,27 @@ ___5_mn_gmail_mailbox_impl_check (MNMailbox * mailbox G_GNUC_UNUSED)
else
self_login(self);
}}
-#line 300 "mn-gmail-mailbox.c"
+#line 287 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 101 "mn-gmail-mailbox.gob"
+#line 82 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_get (MNGmailMailbox * self, const char * uri, SoupCallbackFn callback)
-#line 307 "mn-gmail-mailbox.c"
+#line 294 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::get"
-#line 101 "mn-gmail-mailbox.gob"
+#line 82 "mn-gmail-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 101 "mn-gmail-mailbox.gob"
+#line 82 "mn-gmail-mailbox.gob"
g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
-#line 101 "mn-gmail-mailbox.gob"
+#line 82 "mn-gmail-mailbox.gob"
g_return_if_fail (uri != NULL);
-#line 101 "mn-gmail-mailbox.gob"
+#line 82 "mn-gmail-mailbox.gob"
g_return_if_fail (callback != NULL);
-#line 318 "mn-gmail-mailbox.c"
+#line 305 "mn-gmail-mailbox.c"
{
-#line 105 "mn-gmail-mailbox.gob"
+#line 86 "mn-gmail-mailbox.gob"
SoupContext *context;
SoupMessage *message;
@@ -334,10 +321,123 @@ mn_gmail_mailbox_get (MNGmailMailbox * self, const char * uri, SoupCallbackFn ca
g_free(cookie);
}
+ self_dump_request(self, message);
soup_message_queue(message, callback, self);
/* message will be freed by libsoup after invoking the callback */
}}
-#line 341 "mn-gmail-mailbox.c"
+#line 329 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 108 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_dump_request (MNGmailMailbox * self, SoupMessage * message)
+#line 335 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::dump_request"
+#line 108 "mn-gmail-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 108 "mn-gmail-mailbox.gob"
+ g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
+#line 108 "mn-gmail-mailbox.gob"
+ g_return_if_fail (message != NULL);
+#line 344 "mn-gmail-mailbox.c"
+{
+#line 110 "mn-gmail-mailbox.gob"
+
+ const SoupUri *suri;
+ char *uri;
+
+ suri = soup_context_get_uri(message->context);
+ uri = soup_uri_to_string(suri, TRUE);
+ mn_mailbox_notice(MN_MAILBOX(self), "> GET %s", uri);
+ g_free(uri);
+
+ soup_message_foreach_header(message->request_headers, self_dump_request_cb, self);
+ }}
+#line 358 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 122 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_dump_request_cb (gpointer key, gpointer value, gpointer user_data)
+#line 364 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::dump_request_cb"
+#line 122 "mn-gmail-mailbox.gob"
+ g_return_if_fail (key != NULL);
+#line 122 "mn-gmail-mailbox.gob"
+ g_return_if_fail (value != NULL);
+#line 122 "mn-gmail-mailbox.gob"
+ g_return_if_fail (user_data != NULL);
+#line 373 "mn-gmail-mailbox.c"
+{
+#line 126 "mn-gmail-mailbox.gob"
+
+ Self *self = user_data;
+ const char *header_name = key;
+ const char *header_value = value;
+
+ mn_mailbox_notice(MN_MAILBOX(self), "> %s: %s", header_name, header_value);
+ }}
+#line 383 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 134 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_dump_response (MNGmailMailbox * self, SoupMessage * message)
+#line 389 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::dump_response"
+#line 134 "mn-gmail-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 134 "mn-gmail-mailbox.gob"
+ g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
+#line 134 "mn-gmail-mailbox.gob"
+ g_return_if_fail (message != NULL);
+#line 398 "mn-gmail-mailbox.c"
+{
+#line 136 "mn-gmail-mailbox.gob"
+
+ char *body;
+ char **lines;
+ int i;
+
+ soup_message_foreach_header(message->response_headers, self_dump_response_cb, self);
+
+ body = g_strndup(message->response.body, message->response.length);
+ lines = g_strsplit(body, "\n", 0);
+ g_free(body);
+
+ for (i = 0; lines[i]; i++)
+ mn_mailbox_notice(MN_MAILBOX(self), "< %s", lines[i]);
+ g_strfreev(lines);
+ }}
+#line 416 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 152 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_dump_response_cb (gpointer key, gpointer value, gpointer user_data)
+#line 422 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::dump_response_cb"
+#line 152 "mn-gmail-mailbox.gob"
+ g_return_if_fail (key != NULL);
+#line 152 "mn-gmail-mailbox.gob"
+ g_return_if_fail (value != NULL);
+#line 152 "mn-gmail-mailbox.gob"
+ g_return_if_fail (user_data != NULL);
+#line 431 "mn-gmail-mailbox.c"
+{
+#line 156 "mn-gmail-mailbox.gob"
+
+ Self *self = user_data;
+ const char *header_name = key;
+ const char *header_value = value;
+
+ mn_mailbox_notice(MN_MAILBOX(self), "< %s: %s", header_name, header_value);
+ }}
+#line 441 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
/**
@@ -351,23 +451,23 @@ mn_gmail_mailbox_get (MNGmailMailbox * self, const char * uri, SoupCallbackFn ca
* Gets the first token of @str included between @pre and @post.
*
* Return value: a newly allocated string containing the token or
- * NULL if not found.
+ * %NULL if not found.
**/
-#line 139 "mn-gmail-mailbox.gob"
+#line 177 "mn-gmail-mailbox.gob"
static char *
mn_gmail_mailbox_get_token (const char * str, const char * pre, const char * post, gboolean include_pre, gboolean include_post)
-#line 360 "mn-gmail-mailbox.c"
+#line 460 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::get_token"
-#line 139 "mn-gmail-mailbox.gob"
+#line 177 "mn-gmail-mailbox.gob"
g_return_val_if_fail (str != NULL, (char * )0);
-#line 139 "mn-gmail-mailbox.gob"
+#line 177 "mn-gmail-mailbox.gob"
g_return_val_if_fail (pre != NULL, (char * )0);
-#line 139 "mn-gmail-mailbox.gob"
+#line 177 "mn-gmail-mailbox.gob"
g_return_val_if_fail (post != NULL, (char * )0);
-#line 369 "mn-gmail-mailbox.c"
+#line 469 "mn-gmail-mailbox.c"
{
-#line 145 "mn-gmail-mailbox.gob"
+#line 183 "mn-gmail-mailbox.gob"
char *token = NULL;
char *pre_loc;
@@ -391,22 +491,22 @@ mn_gmail_mailbox_get_token (const char * str, const char * pre, const char * pos
return token;
}}
-#line 395 "mn-gmail-mailbox.c"
+#line 495 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 169 "mn-gmail-mailbox.gob"
+#line 207 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_login (MNGmailMailbox * self)
-#line 401 "mn-gmail-mailbox.c"
+#line 501 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login"
-#line 169 "mn-gmail-mailbox.gob"
+#line 207 "mn-gmail-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 169 "mn-gmail-mailbox.gob"
+#line 207 "mn-gmail-mailbox.gob"
g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
-#line 408 "mn-gmail-mailbox.c"
+#line 508 "mn-gmail-mailbox.c"
{
-#line 171 "mn-gmail-mailbox.gob"
+#line 209 "mn-gmail-mailbox.gob"
char *uri;
char *escaped_username;
@@ -420,8 +520,8 @@ mn_gmail_mailbox_login (MNGmailMailbox * self)
mn_mailbox_notice(MN_MAILBOX(self), _("logging in"));
- escaped_username = gnome_vfs_escape_string(selfp->username);
- escaped_password = gnome_vfs_escape_string(selfp->password);
+ escaped_username = gnome_vfs_escape_string(MN_MAILBOX(self)->uri->username);
+ escaped_password = gnome_vfs_escape_string(MN_MAILBOX(self)->uri->password);
uri = g_strdup_printf("https://www.google.com/accounts/ServiceLoginBoxAuth?service=mail&continue=http://gmail.google.com/gmail&Email=%s&Passwd=%s", escaped_username, escaped_password);
g_free(escaped_username);
g_free(escaped_password);
@@ -429,22 +529,22 @@ mn_gmail_mailbox_login (MNGmailMailbox * self)
self_get(self, uri, self_login_cb1);
g_free(uri);
}}
-#line 433 "mn-gmail-mailbox.c"
+#line 533 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 194 "mn-gmail-mailbox.gob"
+#line 232 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_login_cb1 (SoupMessage * message, gpointer user_data)
-#line 439 "mn-gmail-mailbox.c"
+#line 539 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login_cb1"
-#line 194 "mn-gmail-mailbox.gob"
+#line 232 "mn-gmail-mailbox.gob"
g_return_if_fail (message != NULL);
-#line 194 "mn-gmail-mailbox.gob"
+#line 232 "mn-gmail-mailbox.gob"
g_return_if_fail (user_data != NULL);
-#line 446 "mn-gmail-mailbox.c"
+#line 546 "mn-gmail-mailbox.c"
{
-#line 197 "mn-gmail-mailbox.gob"
+#line 235 "mn-gmail-mailbox.gob"
Self *self = user_data;
@@ -455,6 +555,7 @@ mn_gmail_mailbox_login_cb1 (SoupMessage * message, gpointer user_data)
char *body;
char *next_location;
+ self_dump_response(self, message);
self_update_cookies(self, message);
body = g_strndup(message->response.body, message->response.length);
@@ -480,22 +581,22 @@ mn_gmail_mailbox_login_cb1 (SoupMessage * message, gpointer user_data)
/* if this point is reached, an error occurred */
mn_mailbox_end_check(MN_MAILBOX(self));
}}
-#line 484 "mn-gmail-mailbox.c"
+#line 585 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 233 "mn-gmail-mailbox.gob"
+#line 272 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_login_cb2 (SoupMessage * message, gpointer user_data)
-#line 490 "mn-gmail-mailbox.c"
+#line 591 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login_cb2"
-#line 233 "mn-gmail-mailbox.gob"
+#line 272 "mn-gmail-mailbox.gob"
g_return_if_fail (message != NULL);
-#line 233 "mn-gmail-mailbox.gob"
+#line 272 "mn-gmail-mailbox.gob"
g_return_if_fail (user_data != NULL);
-#line 497 "mn-gmail-mailbox.c"
+#line 598 "mn-gmail-mailbox.c"
{
-#line 236 "mn-gmail-mailbox.gob"
+#line 275 "mn-gmail-mailbox.gob"
Self *self = user_data;
@@ -506,6 +607,7 @@ mn_gmail_mailbox_login_cb2 (SoupMessage * message, gpointer user_data)
char *body;
char *next_location;
+ self_dump_response(self, message);
self_update_cookies(self, message);
body = g_strndup(message->response.body, message->response.length);
@@ -525,22 +627,22 @@ mn_gmail_mailbox_login_cb2 (SoupMessage * message, gpointer user_data)
/* if this point is reached, an error occurred */
mn_mailbox_end_check(MN_MAILBOX(self));
}}
-#line 529 "mn-gmail-mailbox.c"
+#line 631 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 266 "mn-gmail-mailbox.gob"
+#line 306 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_login_cb3 (SoupMessage * message, gpointer user_data)
-#line 535 "mn-gmail-mailbox.c"
+#line 637 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login_cb3"
-#line 266 "mn-gmail-mailbox.gob"
+#line 306 "mn-gmail-mailbox.gob"
g_return_if_fail (message != NULL);
-#line 266 "mn-gmail-mailbox.gob"
+#line 306 "mn-gmail-mailbox.gob"
g_return_if_fail (user_data != NULL);
-#line 542 "mn-gmail-mailbox.c"
+#line 644 "mn-gmail-mailbox.c"
{
-#line 269 "mn-gmail-mailbox.gob"
+#line 309 "mn-gmail-mailbox.gob"
Self *self = user_data;
@@ -551,6 +653,7 @@ mn_gmail_mailbox_login_cb3 (SoupMessage * message, gpointer user_data)
char *body;
char *token;
+ self_dump_response(self, message);
self_update_cookies(self, message);
body = g_strndup(message->response.body, message->response.length);
@@ -571,24 +674,24 @@ mn_gmail_mailbox_login_cb3 (SoupMessage * message, gpointer user_data)
/* if this point is reached, an error occurred */
mn_mailbox_end_check(MN_MAILBOX(self));
}}
-#line 575 "mn-gmail-mailbox.c"
+#line 678 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 300 "mn-gmail-mailbox.gob"
+#line 341 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_update_cookies (MNGmailMailbox * self, SoupMessage * message)
-#line 581 "mn-gmail-mailbox.c"
+#line 684 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::update_cookies"
-#line 300 "mn-gmail-mailbox.gob"
+#line 341 "mn-gmail-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 300 "mn-gmail-mailbox.gob"
+#line 341 "mn-gmail-mailbox.gob"
g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
-#line 300 "mn-gmail-mailbox.gob"
+#line 341 "mn-gmail-mailbox.gob"
g_return_if_fail (message != NULL);
-#line 590 "mn-gmail-mailbox.c"
+#line 693 "mn-gmail-mailbox.c"
{
-#line 302 "mn-gmail-mailbox.gob"
+#line 343 "mn-gmail-mailbox.gob"
const GSList *set_cookie_headers;
const GSList *l;
@@ -617,22 +720,22 @@ mn_gmail_mailbox_update_cookies (MNGmailMailbox * self, SoupMessage * message)
}
}
}}
-#line 621 "mn-gmail-mailbox.c"
+#line 724 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 331 "mn-gmail-mailbox.gob"
+#line 372 "mn-gmail-mailbox.gob"
static char *
mn_gmail_mailbox_build_cookie (MNGmailMailbox * self)
-#line 627 "mn-gmail-mailbox.c"
+#line 730 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::build_cookie"
-#line 331 "mn-gmail-mailbox.gob"
+#line 372 "mn-gmail-mailbox.gob"
g_return_val_if_fail (self != NULL, (char * )0);
-#line 331 "mn-gmail-mailbox.gob"
+#line 372 "mn-gmail-mailbox.gob"
g_return_val_if_fail (MN_IS_GMAIL_MAILBOX (self), (char * )0);
-#line 634 "mn-gmail-mailbox.c"
+#line 737 "mn-gmail-mailbox.c"
{
-#line 333 "mn-gmail-mailbox.gob"
+#line 374 "mn-gmail-mailbox.gob"
GString *cookie;
char *str;
@@ -650,17 +753,17 @@ mn_gmail_mailbox_build_cookie (MNGmailMailbox * self)
return str;
}}
-#line 654 "mn-gmail-mailbox.c"
+#line 757 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 351 "mn-gmail-mailbox.gob"
+#line 392 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_build_cookie_cb (gpointer key, gpointer value, gpointer user_data)
-#line 660 "mn-gmail-mailbox.c"
+#line 763 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::build_cookie_cb"
{
-#line 353 "mn-gmail-mailbox.gob"
+#line 394 "mn-gmail-mailbox.gob"
GString *cookie = user_data;
@@ -669,41 +772,41 @@ mn_gmail_mailbox_build_cookie_cb (gpointer key, gpointer value, gpointer user_da
g_string_append_printf(cookie, "%s=%s", (const char *) key, (const char *) value);
}}
-#line 673 "mn-gmail-mailbox.c"
+#line 776 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 362 "mn-gmail-mailbox.gob"
+#line 403 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_check_internal (MNGmailMailbox * self)
-#line 679 "mn-gmail-mailbox.c"
+#line 782 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::check_internal"
-#line 362 "mn-gmail-mailbox.gob"
+#line 403 "mn-gmail-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 362 "mn-gmail-mailbox.gob"
+#line 403 "mn-gmail-mailbox.gob"
g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
-#line 686 "mn-gmail-mailbox.c"
+#line 789 "mn-gmail-mailbox.c"
{
-#line 364 "mn-gmail-mailbox.gob"
+#line 405 "mn-gmail-mailbox.gob"
mn_mailbox_notice(MN_MAILBOX(self), _("searching for unread mail"));
self_get(self, "https://gmail.google.com/gmail?search=adv&as_subset=unread&view=tl&start=0", self_check_internal_cb);
}}
-#line 694 "mn-gmail-mailbox.c"
+#line 797 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 370 "mn-gmail-mailbox.gob"
+#line 411 "mn-gmail-mailbox.gob"
static void
mn_gmail_mailbox_check_internal_cb (SoupMessage * message, gpointer user_data)
-#line 700 "mn-gmail-mailbox.c"
+#line 803 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::check_internal_cb"
-#line 370 "mn-gmail-mailbox.gob"
+#line 411 "mn-gmail-mailbox.gob"
g_return_if_fail (message != NULL);
-#line 705 "mn-gmail-mailbox.c"
+#line 808 "mn-gmail-mailbox.c"
{
-#line 373 "mn-gmail-mailbox.gob"
+#line 414 "mn-gmail-mailbox.gob"
Self *self = user_data;
@@ -713,6 +816,8 @@ mn_gmail_mailbox_check_internal_cb (SoupMessage * message, gpointer user_data)
{
int count;
+ self_dump_response(self, message);
+
count = self_get_unread_count(message);
if (count == -1)
mn_mailbox_set_error(MN_MAILBOX(self), _("unable to parse Gmail data"));
@@ -722,20 +827,20 @@ mn_gmail_mailbox_check_internal_cb (SoupMessage * message, gpointer user_data)
mn_mailbox_end_check(MN_MAILBOX(self));
}}
-#line 726 "mn-gmail-mailbox.c"
+#line 831 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
-#line 392 "mn-gmail-mailbox.gob"
+#line 435 "mn-gmail-mailbox.gob"
static int
mn_gmail_mailbox_get_unread_count (SoupMessage * message)
-#line 732 "mn-gmail-mailbox.c"
+#line 837 "mn-gmail-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::get_unread_count"
-#line 392 "mn-gmail-mailbox.gob"
+#line 435 "mn-gmail-mailbox.gob"
g_return_val_if_fail (message != NULL, (int )0);
-#line 737 "mn-gmail-mailbox.c"
+#line 842 "mn-gmail-mailbox.c"
{
-#line 394 "mn-gmail-mailbox.gob"
+#line 437 "mn-gmail-mailbox.gob"
int count = -1;
char *body;
@@ -761,5 +866,5 @@ mn_gmail_mailbox_get_unread_count (SoupMessage * message)
return count;
}}
-#line 765 "mn-gmail-mailbox.c"
+#line 870 "mn-gmail-mailbox.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-gmail-mailbox.gob b/src/mn-gmail-mailbox.gob
@@ -27,7 +27,6 @@
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libsoup/soup.h>
#include "mn-mailbox-private.h"
-#include "mn-uri.h"
#include "mn-util.h"
#include "mn-stock.h"
#include "mn-soup.h"
@@ -35,8 +34,6 @@
class MN:Gmail:Mailbox from MN:Mailbox
{
- private char *username destroywith g_free;
- private char *password destroywith g_free;
private GHashTable *cookies destroywith g_hash_table_destroy;
private gboolean logged_in;
@@ -50,20 +47,11 @@ class MN:Gmail:Mailbox from MN:Mailbox
constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
{
GObject *object;
- MNMailbox *mailbox;
- Self *self;
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
- mailbox = MN_MAILBOX(object);
- self = SELF(object);
mn_soup_use();
- if (! mn_uri_parse_gmail(mn_mailbox_get_uri(mailbox),
- &selfp->username,
- &selfp->password))
- mn_mailbox_set_init_error(mailbox, _("unable to parse Gmail URI"));
-
return object;
}
@@ -75,16 +63,9 @@ class MN:Gmail:Mailbox from MN:Mailbox
}
override (MN:Mailbox) gboolean
- impl_is (MNMailbox *dummy, const char *uri (check null))
+ impl_is (MNMailbox *dummy, MN:URI *uri (check null type))
{
- char *scheme;
- gboolean is;
-
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && ! strcmp(scheme, "gmail");
- g_free(scheme);
-
- return is;
+ return MN_URI_IS_GMAIL(uri);
}
override (MN:Mailbox) void
@@ -119,10 +100,67 @@ class MN:Gmail:Mailbox from MN:Mailbox
g_free(cookie);
}
+ self_dump_request(self, message);
soup_message_queue(message, callback, self);
/* message will be freed by libsoup after invoking the callback */
}
+ private void
+ dump_request (self, SoupMessage *message (check null))
+ {
+ const SoupUri *suri;
+ char *uri;
+
+ suri = soup_context_get_uri(message->context);
+ uri = soup_uri_to_string(suri, TRUE);
+ mn_mailbox_notice(MN_MAILBOX(self), "> GET %s", uri);
+ g_free(uri);
+
+ soup_message_foreach_header(message->request_headers, self_dump_request_cb, self);
+ }
+
+ private void
+ dump_request_cb (gpointer key (check null),
+ gpointer value (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ const char *header_name = key;
+ const char *header_value = value;
+
+ mn_mailbox_notice(MN_MAILBOX(self), "> %s: %s", header_name, header_value);
+ }
+
+ private void
+ dump_response (self, SoupMessage *message (check null))
+ {
+ char *body;
+ char **lines;
+ int i;
+
+ soup_message_foreach_header(message->response_headers, self_dump_response_cb, self);
+
+ body = g_strndup(message->response.body, message->response.length);
+ lines = g_strsplit(body, "\n", 0);
+ g_free(body);
+
+ for (i = 0; lines[i]; i++)
+ mn_mailbox_notice(MN_MAILBOX(self), "< %s", lines[i]);
+ g_strfreev(lines);
+ }
+
+ private void
+ dump_response_cb (gpointer key (check null),
+ gpointer value (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ const char *header_name = key;
+ const char *header_value = value;
+
+ mn_mailbox_notice(MN_MAILBOX(self), "< %s: %s", header_name, header_value);
+ }
+
/**
* get_token:
* @str: the string to search
@@ -134,8 +172,8 @@ class MN:Gmail:Mailbox from MN:Mailbox
* Gets the first token of @str included between @pre and @post.
*
* Return value: a newly allocated string containing the token or
- * NULL if not found.
- */
+ * %NULL if not found.
+ **/
private char *
get_token (const char *str (check null),
const char *pre (check null),
@@ -181,8 +219,8 @@ class MN:Gmail:Mailbox from MN:Mailbox
mn_mailbox_notice(MN_MAILBOX(self), _("logging in"));
- escaped_username = gnome_vfs_escape_string(selfp->username);
- escaped_password = gnome_vfs_escape_string(selfp->password);
+ escaped_username = gnome_vfs_escape_string(MN_MAILBOX(self)->uri->username);
+ escaped_password = gnome_vfs_escape_string(MN_MAILBOX(self)->uri->password);
uri = g_strdup_printf("https://www.google.com/accounts/ServiceLoginBoxAuth?service=mail&continue=http://gmail.google.com/gmail&Email=%s&Passwd=%s", escaped_username, escaped_password);
g_free(escaped_username);
g_free(escaped_password);
@@ -204,6 +242,7 @@ class MN:Gmail:Mailbox from MN:Mailbox
char *body;
char *next_location;
+ self_dump_response(self, message);
self_update_cookies(self, message);
body = g_strndup(message->response.body, message->response.length);
@@ -243,6 +282,7 @@ class MN:Gmail:Mailbox from MN:Mailbox
char *body;
char *next_location;
+ self_dump_response(self, message);
self_update_cookies(self, message);
body = g_strndup(message->response.body, message->response.length);
@@ -276,6 +316,7 @@ class MN:Gmail:Mailbox from MN:Mailbox
char *body;
char *token;
+ self_dump_response(self, message);
self_update_cookies(self, message);
body = g_strndup(message->response.body, message->response.length);
@@ -379,6 +420,8 @@ class MN:Gmail:Mailbox from MN:Mailbox
{
int count;
+ self_dump_response(self, message);
+
count = self_get_unread_count(message);
if (count == -1)
mn_mailbox_set_error(MN_MAILBOX(self), _("unable to parse Gmail data"));
diff --git a/src/mn-imap-mailbox-private.h b/src/mn-imap-mailbox-private.h
@@ -9,23 +9,6 @@
extern "C" {
#endif /* __cplusplus */
-struct _MNIMAPMailboxPrivate {
-#line 89 "mn-imap-mailbox.gob"
- char * hostname;
-#line 90 "mn-imap-mailbox.gob"
- int port;
-#line 91 "mn-imap-mailbox.gob"
- char * username;
-#line 92 "mn-imap-mailbox.gob"
- char * password;
-#line 93 "mn-imap-mailbox.gob"
- char * authmech;
-#line 94 "mn-imap-mailbox.gob"
- char * mailbox;
-#line 95 "mn-imap-mailbox.gob"
- gboolean ssl;
-#line 28 "mn-imap-mailbox-private.h"
-};
#ifdef __cplusplus
}
diff --git a/src/mn-imap-mailbox-properties.c b/src/mn-imap-mailbox-properties.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -28,11 +28,10 @@
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
#include "mn-pi-mailbox-properties-private.h"
-#include "mn-uri.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
-#line 36 "mn-imap-mailbox-properties.c"
+#line 35 "mn-imap-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_IMAP_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_IMAP_MAILBOX_PROPERTIES_CONST(x)
@@ -52,8 +51,8 @@ static void mn_imap_mailbox_properties_init (MNIMAPMailboxProperties * o) G_GNUC
static void mn_imap_mailbox_properties_class_init (MNIMAPMailboxPropertiesClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_imap_mailbox_properties_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
static void mn_imap_mailbox_properties_radio_toggled_h (GtkToggleButton * togglebutton, gpointer user_data) G_GNUC_UNUSED;
-static gboolean mn_imap_mailbox_properties_set_uri (MNMailboxProperties * properties, const char * uri) G_GNUC_UNUSED;
-static char * mn_imap_mailbox_properties_get_uri (MNMailboxProperties * properties) G_GNUC_UNUSED;
+static gboolean mn_imap_mailbox_properties_set_uri (MNMailboxProperties * properties, MNURI * uri) G_GNUC_UNUSED;
+static MNURI * mn_imap_mailbox_properties_get_uri (MNMailboxProperties * properties) G_GNUC_UNUSED;
enum {
PROP_0,
@@ -72,11 +71,11 @@ static MNPIMailboxPropertiesClass *parent_class = NULL;
static void
___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
{
-#line 146 "mn-imap-mailbox-properties.gob"
+#line 147 "mn-imap-mailbox-properties.gob"
iface->set_uri = self_set_uri;
-#line 189 "mn-imap-mailbox-properties.gob"
+#line 178 "mn-imap-mailbox-properties.gob"
iface->get_uri = self_get_uri;
-#line 80 "mn-imap-mailbox-properties.c"
+#line 79 "mn-imap-mailbox-properties.c"
}
GType
@@ -153,7 +152,7 @@ mn_imap_mailbox_properties_init (MNIMAPMailboxProperties * o G_GNUC_UNUSED)
#line 70 "mn-imap-mailbox-properties.gob"
static void
mn_imap_mailbox_properties_class_init (MNIMAPMailboxPropertiesClass * class G_GNUC_UNUSED)
-#line 157 "mn-imap-mailbox-properties.c"
+#line 156 "mn-imap-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::class_init"
GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
@@ -162,7 +161,7 @@ mn_imap_mailbox_properties_class_init (MNIMAPMailboxPropertiesClass * class G_GN
#line 79 "mn-imap-mailbox-properties.gob"
g_object_class->constructor = ___2_mn_imap_mailbox_properties_constructor;
-#line 166 "mn-imap-mailbox-properties.c"
+#line 165 "mn-imap-mailbox-properties.c"
g_object_class->finalize = ___finalize;
g_object_class->get_property = ___object_get_property;
{
@@ -176,10 +175,10 @@ mn_imap_mailbox_properties_class_init (MNIMAPMailboxPropertiesClass * class G_GN
MNPIMailboxPropertiesClass *pi_class = MN_PI_MAILBOX_PROPERTIES_CLASS(class);
pi_class->label = "IMAP";
- pi_class->default_port[0] = MN_URI_IMAP_PORT(FALSE);
- pi_class->default_port[1] = MN_URI_IMAP_PORT(TRUE);
+ pi_class->default_port[0] = mn_uri_get_default_port("imap");
+ pi_class->default_port[1] = mn_uri_get_default_port("imaps");
-#line 183 "mn-imap-mailbox-properties.c"
+#line 182 "mn-imap-mailbox-properties.c"
}
}
#undef __GOB_FUNCTION__
@@ -198,7 +197,7 @@ ___object_get_property (GObject *object,
switch (property_id) {
case PROP_COMPLETE:
{
-#line 37 "mn-imap-mailbox-properties.gob"
+#line 36 "mn-imap-mailbox-properties.gob"
MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
gboolean complete;
@@ -210,6 +209,7 @@ ___object_get_property (GObject *object,
mn_pi_mailbox_properties_get_contents(pi,
NULL,
+ NULL,
&username,
&password,
NULL,
@@ -285,6 +285,7 @@ ___2_mn_imap_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_c
selfp->other_radio = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(selfp->inbox_radio), _("oth_er:"));
selfp->mailbox_entry = gtk_entry_new();
gtk_widget_set_sensitive(selfp->mailbox_entry, FALSE);
+ gtk_entry_set_activates_default(GTK_ENTRY(selfp->mailbox_entry), TRUE);
hbox = gtk_hbox_new(FALSE, 12);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
@@ -310,117 +311,109 @@ ___2_mn_imap_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_c
return object;
}}
-#line 314 "mn-imap-mailbox-properties.c"
+#line 315 "mn-imap-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 136 "mn-imap-mailbox-properties.gob"
+#line 137 "mn-imap-mailbox-properties.gob"
static void
mn_imap_mailbox_properties_radio_toggled_h (GtkToggleButton * togglebutton, gpointer user_data)
-#line 321 "mn-imap-mailbox-properties.c"
+#line 322 "mn-imap-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::radio_toggled_h"
-#line 136 "mn-imap-mailbox-properties.gob"
+#line 137 "mn-imap-mailbox-properties.gob"
g_return_if_fail (togglebutton != NULL);
-#line 136 "mn-imap-mailbox-properties.gob"
+#line 137 "mn-imap-mailbox-properties.gob"
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (togglebutton));
-#line 136 "mn-imap-mailbox-properties.gob"
+#line 137 "mn-imap-mailbox-properties.gob"
g_return_if_fail (user_data != NULL);
-#line 330 "mn-imap-mailbox-properties.c"
+#line 331 "mn-imap-mailbox-properties.c"
{
-#line 139 "mn-imap-mailbox-properties.gob"
+#line 140 "mn-imap-mailbox-properties.gob"
Self *self = user_data;
gtk_widget_set_sensitive(selfp->mailbox_entry, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(selfp->other_radio)));
g_object_notify(G_OBJECT(self), "complete");
}}
-#line 339 "mn-imap-mailbox-properties.c"
+#line 340 "mn-imap-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 146 "mn-imap-mailbox-properties.gob"
+#line 147 "mn-imap-mailbox-properties.gob"
static gboolean
-mn_imap_mailbox_properties_set_uri (MNMailboxProperties * properties, const char * uri)
-#line 345 "mn-imap-mailbox-properties.c"
+mn_imap_mailbox_properties_set_uri (MNMailboxProperties * properties, MNURI * uri)
+#line 346 "mn-imap-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::set_uri"
-#line 146 "mn-imap-mailbox-properties.gob"
+#line 147 "mn-imap-mailbox-properties.gob"
g_return_val_if_fail (properties != NULL, (gboolean )0);
-#line 146 "mn-imap-mailbox-properties.gob"
+#line 147 "mn-imap-mailbox-properties.gob"
g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (properties), (gboolean )0);
-#line 146 "mn-imap-mailbox-properties.gob"
+#line 147 "mn-imap-mailbox-properties.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 354 "mn-imap-mailbox-properties.c"
+#line 147 "mn-imap-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 357 "mn-imap-mailbox-properties.c"
{
-#line 149 "mn-imap-mailbox-properties.gob"
+#line 150 "mn-imap-mailbox-properties.gob"
Self *self = SELF(properties);
- gboolean ssl;
- char *username;
- char *password;
- char *authmech;
- char *hostname;
- int port;
- char *mailbox;
- if (mn_uri_parse_imap(uri, &ssl, &username, &password, &authmech, &hostname, &port, &mailbox))
+ if (MN_URI_IS_IMAP(uri))
{
mn_pi_mailbox_properties_set_contents(MN_PI_MAILBOX_PROPERTIES(properties),
- ssl,
- username,
- password,
- authmech,
- hostname,
- port);
+ MN_URI_IS_SSL(uri),
+ MN_URI_IS_INBAND_SSL(uri),
+ uri->username,
+ uri->password,
+ uri->authmech,
+ uri->hostname,
+ uri->port);
- if (! strcmp(mailbox, "INBOX"))
+ if (! strcmp(uri->path, "INBOX"))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(selfp->inbox_radio), TRUE);
else
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(selfp->other_radio), TRUE);
- gtk_entry_set_text(GTK_ENTRY(selfp->mailbox_entry), mailbox);
+ gtk_entry_set_text(GTK_ENTRY(selfp->mailbox_entry), uri->path);
}
- g_free(username);
- g_free(password);
- g_free(authmech);
- g_free(hostname);
- g_free(mailbox);
-
return TRUE;
}
else
return FALSE;
}}
-#line 396 "mn-imap-mailbox-properties.c"
+#line 387 "mn-imap-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 189 "mn-imap-mailbox-properties.gob"
-static char *
+#line 178 "mn-imap-mailbox-properties.gob"
+static MNURI *
mn_imap_mailbox_properties_get_uri (MNMailboxProperties * properties)
-#line 402 "mn-imap-mailbox-properties.c"
+#line 393 "mn-imap-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::get_uri"
-#line 189 "mn-imap-mailbox-properties.gob"
- g_return_val_if_fail (properties != NULL, (char * )0);
-#line 189 "mn-imap-mailbox-properties.gob"
- g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (properties), (char * )0);
-#line 409 "mn-imap-mailbox-properties.c"
+#line 178 "mn-imap-mailbox-properties.gob"
+ g_return_val_if_fail (properties != NULL, (MNURI * )0);
+#line 178 "mn-imap-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (properties), (MNURI * )0);
+#line 400 "mn-imap-mailbox-properties.c"
{
-#line 191 "mn-imap-mailbox-properties.gob"
+#line 180 "mn-imap-mailbox-properties.gob"
Self *self = SELF(properties);
gboolean ssl;
+ gboolean inband_ssl;
const char *username;
const char *password;
char *authmech;
const char *hostname;
int port;
const char *mailbox = NULL;
- char *uri;
+ MNURI *uri;
mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
&ssl,
+ &inband_ssl,
&username,
&password,
&authmech,
@@ -431,10 +424,10 @@ mn_imap_mailbox_properties_get_uri (MNMailboxProperties * properties)
? "INBOX"
: gtk_entry_get_text(GTK_ENTRY(selfp->mailbox_entry));
- uri = mn_uri_build_imap(ssl, username, password, authmech, hostname, port, mailbox);
+ uri = mn_uri_new_imap(ssl, inband_ssl, username, password, authmech, hostname, port, mailbox);
g_free(authmech);
return uri;
}}
-#line 440 "mn-imap-mailbox-properties.c"
+#line 433 "mn-imap-mailbox-properties.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-imap-mailbox-properties.gob b/src/mn-imap-mailbox-properties.gob
@@ -25,7 +25,6 @@
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
#include "mn-pi-mailbox-properties-private.h"
-#include "mn-uri.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
%}
@@ -45,6 +44,7 @@ class MN:IMAP:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
mn_pi_mailbox_properties_get_contents(pi,
NULL,
+ NULL,
&username,
&password,
NULL,
@@ -72,8 +72,8 @@ class MN:IMAP:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
MNPIMailboxPropertiesClass *pi_class = MN_PI_MAILBOX_PROPERTIES_CLASS(class);
pi_class->label = "IMAP";
- pi_class->default_port[0] = MN_URI_IMAP_PORT(FALSE);
- pi_class->default_port[1] = MN_URI_IMAP_PORT(TRUE);
+ pi_class->default_port[0] = mn_uri_get_default_port("imap");
+ pi_class->default_port[1] = mn_uri_get_default_port("imaps");
}
override (G:Object) GObject *
@@ -107,6 +107,7 @@ class MN:IMAP:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
selfp->other_radio = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(selfp->inbox_radio), _("oth_er:"));
selfp->mailbox_entry = gtk_entry_new();
gtk_widget_set_sensitive(selfp->mailbox_entry, FALSE);
+ gtk_entry_set_activates_default(GTK_ENTRY(selfp->mailbox_entry), TRUE);
hbox = gtk_hbox_new(FALSE, 12);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
@@ -145,62 +146,52 @@ class MN:IMAP:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
interface MN:Mailbox:Properties private gboolean
set_uri (MN:Mailbox:Properties *properties (check null type),
- const char *uri (check null))
+ MN:URI *uri (check null type))
{
Self *self = SELF(properties);
- gboolean ssl;
- char *username;
- char *password;
- char *authmech;
- char *hostname;
- int port;
- char *mailbox;
- if (mn_uri_parse_imap(uri, &ssl, &username, &password, &authmech, &hostname, &port, &mailbox))
+ if (MN_URI_IS_IMAP(uri))
{
mn_pi_mailbox_properties_set_contents(MN_PI_MAILBOX_PROPERTIES(properties),
- ssl,
- username,
- password,
- authmech,
- hostname,
- port);
+ MN_URI_IS_SSL(uri),
+ MN_URI_IS_INBAND_SSL(uri),
+ uri->username,
+ uri->password,
+ uri->authmech,
+ uri->hostname,
+ uri->port);
- if (! strcmp(mailbox, "INBOX"))
+ if (! strcmp(uri->path, "INBOX"))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(selfp->inbox_radio), TRUE);
else
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(selfp->other_radio), TRUE);
- gtk_entry_set_text(GTK_ENTRY(selfp->mailbox_entry), mailbox);
+ gtk_entry_set_text(GTK_ENTRY(selfp->mailbox_entry), uri->path);
}
- g_free(username);
- g_free(password);
- g_free(authmech);
- g_free(hostname);
- g_free(mailbox);
-
return TRUE;
}
else
return FALSE;
}
- interface MN:Mailbox:Properties private char *
+ interface MN:Mailbox:Properties private MNURI *
get_uri (MN:Mailbox:Properties *properties (check null type))
{
Self *self = SELF(properties);
gboolean ssl;
+ gboolean inband_ssl;
const char *username;
const char *password;
char *authmech;
const char *hostname;
int port;
const char *mailbox = NULL;
- char *uri;
+ MNURI *uri;
mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
&ssl,
+ &inband_ssl,
&username,
&password,
&authmech,
@@ -211,7 +202,7 @@ class MN:IMAP:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
? "INBOX"
: gtk_entry_get_text(GTK_ENTRY(selfp->mailbox_entry));
- uri = mn_uri_build_imap(ssl, username, password, authmech, hostname, port, mailbox);
+ uri = mn_uri_new_imap(ssl, inband_ssl, username, password, authmech, hostname, port, mailbox);
g_free(authmech);
return uri;
diff --git a/src/mn-imap-mailbox.c b/src/mn-imap-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -29,9 +29,9 @@
#include <stdarg.h>
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
+#include <eel/eel.h>
#include "mn-mailbox-private.h"
#include "mn-util.h"
-#include "mn-uri.h"
#include "mn-client-session.h"
#define HAS_CURRENT_TAG(response, priv) (! strcmp((response)->tag, (priv)->tag))
@@ -45,6 +45,9 @@
{
STATE_GREETING = MN_CLIENT_SESSION_INITIAL_STATE,
STATE_CAPABILITY,
+#ifdef WITH_SSL
+ STATE_STARTTLS,
+#endif
#ifdef WITH_SASL
STATE_AUTHENTICATE,
#endif
@@ -62,18 +65,22 @@
struct _MNClientSessionPrivate
{
- MNIMAPMailbox *mailbox;
+ MNMailbox *mailbox;
+ MNIMAPMailbox *self;
MNClientSession *session;
int numeric_tag;
char *tag;
char **capabilities;
GSList *auth_mechanisms;
gboolean status_received;
+#ifdef WITH_SSL
+ gboolean starttls_completed;
+#endif
#ifdef WITH_SASL
const char *sasl_mechanism;
#endif
};
-
+
struct _MNClientSessionResponse
{
char *continuation;
@@ -83,7 +90,7 @@
char *arguments;
};
-#line 87 "mn-imap-mailbox.c"
+#line 94 "mn-imap-mailbox.c"
/* self casting macros */
#define SELF(x) MN_IMAP_MAILBOX(x)
#define SELF_CONST(x) MN_IMAP_MAILBOX_CONST(x)
@@ -101,10 +108,12 @@ typedef MNIMAPMailboxClass SelfClass;
static void mn_imap_mailbox_init (MNIMAPMailbox * o) G_GNUC_UNUSED;
static void mn_imap_mailbox_class_init (MNIMAPMailboxClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_imap_mailbox_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
-static gboolean ___3_mn_imap_mailbox_impl_is (MNMailbox * dummy, const char * uri) G_GNUC_UNUSED;
+static gboolean ___3_mn_imap_mailbox_impl_is (MNMailbox * dummy, MNURI * uri) G_GNUC_UNUSED;
static int mn_imap_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_enter_capability_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_handle_capability_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_imap_mailbox_enter_starttls_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_imap_mailbox_handle_starttls_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_enter_authenticate_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_handle_authenticate_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_enter_login_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
@@ -113,7 +122,7 @@ static int mn_imap_mailbox_enter_status_cb (MNClientSession * session, MNClientS
static int mn_imap_mailbox_handle_status_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_enter_logout_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_handle_logout_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
-static void ___f_mn_imap_mailbox_impl_threaded_check (MNMailbox * mailbox) G_GNUC_UNUSED;
+static void ___11_mn_imap_mailbox_impl_threaded_check (MNMailbox * mailbox) G_GNUC_UNUSED;
static void mn_imap_mailbox_notice_cb (MNClientSession * session, const char * str, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static MNClientSessionResponse * mn_imap_mailbox_response_new_cb (MNClientSession * session, const char * input, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static void mn_imap_mailbox_response_free_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
@@ -122,6 +131,7 @@ static void mn_imap_mailbox_session_set_error_from_arguments (MNClientSessionPri
static int mn_imap_mailbox_session_write (MNClientSessionPrivate * priv, const char * format, ...) G_GNUC_UNUSED;
static void mn_imap_mailbox_session_parse_capabilities (MNClientSessionPrivate * priv, const char * capabilities) G_GNUC_UNUSED;
static gboolean mn_imap_mailbox_session_has_capability (MNClientSessionPrivate * priv, const char * capability) G_GNUC_UNUSED;
+static int mn_imap_mailbox_session_after_capability (MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_session_authenticate (MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_imap_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static char * mn_imap_mailbox_quote (const char * str) G_GNUC_UNUSED;
@@ -133,6 +143,8 @@ static MNMailboxClass *parent_class = NULL;
#define self_handle_greeting_cb mn_imap_mailbox_handle_greeting_cb
#define self_enter_capability_cb mn_imap_mailbox_enter_capability_cb
#define self_handle_capability_cb mn_imap_mailbox_handle_capability_cb
+#define self_enter_starttls_cb mn_imap_mailbox_enter_starttls_cb
+#define self_handle_starttls_cb mn_imap_mailbox_handle_starttls_cb
#define self_enter_authenticate_cb mn_imap_mailbox_enter_authenticate_cb
#define self_handle_authenticate_cb mn_imap_mailbox_handle_authenticate_cb
#define self_enter_login_cb mn_imap_mailbox_enter_login_cb
@@ -149,6 +161,7 @@ static MNMailboxClass *parent_class = NULL;
#define self_session_write mn_imap_mailbox_session_write
#define self_session_parse_capabilities mn_imap_mailbox_session_parse_capabilities
#define self_session_has_capability mn_imap_mailbox_session_has_capability
+#define self_session_after_capability mn_imap_mailbox_session_after_capability
#define self_session_authenticate mn_imap_mailbox_session_authenticate
#define self_session_authenticate_fallback mn_imap_mailbox_session_authenticate_fallback
#define self_quote mn_imap_mailbox_quote
@@ -194,76 +207,46 @@ GET_NEW_VARG (const char *first, ...)
return ret;
}
-
-static void
-___finalize(GObject *obj_self)
-{
-#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::finalize"
- MNIMAPMailbox *self G_GNUC_UNUSED = MN_IMAP_MAILBOX (obj_self);
- gpointer priv = self->_priv;
- if(G_OBJECT_CLASS(parent_class)->finalize) \
- (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
-#line 89 "mn-imap-mailbox.gob"
- if(self->_priv->hostname) { ((*(void (*)(void *))g_free)) (self->_priv->hostname); self->_priv->hostname = NULL; }
-#line 209 "mn-imap-mailbox.c"
-#line 91 "mn-imap-mailbox.gob"
- if(self->_priv->username) { ((*(void (*)(void *))g_free)) (self->_priv->username); self->_priv->username = NULL; }
-#line 212 "mn-imap-mailbox.c"
-#line 92 "mn-imap-mailbox.gob"
- if(self->_priv->password) { ((*(void (*)(void *))g_free)) (self->_priv->password); self->_priv->password = NULL; }
-#line 215 "mn-imap-mailbox.c"
-#line 93 "mn-imap-mailbox.gob"
- if(self->_priv->authmech) { ((*(void (*)(void *))g_free)) (self->_priv->authmech); self->_priv->authmech = NULL; }
-#line 218 "mn-imap-mailbox.c"
-#line 94 "mn-imap-mailbox.gob"
- if(self->_priv->mailbox) { ((*(void (*)(void *))g_free)) (self->_priv->mailbox); self->_priv->mailbox = NULL; }
-#line 221 "mn-imap-mailbox.c"
- g_free (priv);
-}
-#undef __GOB_FUNCTION__
-
static void
mn_imap_mailbox_init (MNIMAPMailbox * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::init"
- o->_priv = g_new0 (MNIMAPMailboxPrivate, 1);
}
#undef __GOB_FUNCTION__
-#line 97 "mn-imap-mailbox.gob"
+#line 96 "mn-imap-mailbox.gob"
static void
mn_imap_mailbox_class_init (MNIMAPMailboxClass * class G_GNUC_UNUSED)
-#line 236 "mn-imap-mailbox.c"
+#line 220 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::class_init"
- GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+ GObjectClass *g_object_class = (GObjectClass *)class;
MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
-#line 102 "mn-imap-mailbox.gob"
+#line 101 "mn-imap-mailbox.gob"
g_object_class->constructor = ___2_mn_imap_mailbox_constructor;
-#line 133 "mn-imap-mailbox.gob"
+#line 118 "mn-imap-mailbox.gob"
mn_mailbox_class->impl_is = ___3_mn_imap_mailbox_impl_is;
-#line 391 "mn-imap-mailbox.gob"
- mn_mailbox_class->impl_threaded_check = ___f_mn_imap_mailbox_impl_threaded_check;
-#line 250 "mn-imap-mailbox.c"
- g_object_class->finalize = ___finalize;
+#line 416 "mn-imap-mailbox.gob"
+ mn_mailbox_class->impl_threaded_check = ___11_mn_imap_mailbox_impl_threaded_check;
+#line 234 "mn-imap-mailbox.c"
{
-#line 98 "mn-imap-mailbox.gob"
+#line 97 "mn-imap-mailbox.gob"
MN_MAILBOX_CLASS(class)->format = "IMAP";
-#line 257 "mn-imap-mailbox.c"
+#line 240 "mn-imap-mailbox.c"
}
}
#undef __GOB_FUNCTION__
-#line 102 "mn-imap-mailbox.gob"
+#line 101 "mn-imap-mailbox.gob"
static GObject *
___2_mn_imap_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
-#line 267 "mn-imap-mailbox.c"
+#line 250 "mn-imap-mailbox.c"
#define PARENT_HANDLER(___type,___n_construct_properties,___construct_params) \
((G_OBJECT_CLASS(parent_class)->constructor)? \
(* G_OBJECT_CLASS(parent_class)->constructor)(___type,___n_construct_properties,___construct_params): \
@@ -271,83 +254,64 @@ ___2_mn_imap_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_pr
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::constructor"
{
-#line 104 "mn-imap-mailbox.gob"
+#line 103 "mn-imap-mailbox.gob"
GObject *object;
MNMailbox *mailbox;
- Self *self;
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
mailbox = MN_MAILBOX(object);
- self = SELF(object);
-
- if (mn_uri_parse_imap(mn_mailbox_get_uri(mailbox),
- &selfp->ssl,
- &selfp->username,
- &selfp->password,
- &selfp->authmech,
- &selfp->hostname,
- &selfp->port,
- &selfp->mailbox))
- {
+
#ifndef WITH_SSL
- if (selfp->ssl)
- mn_mailbox_set_init_error(mailbox, _("SSL support has not been compiled in"));
+ if (MN_URI_IS_SSL(mailbox->uri) || MN_URI_IS_INBAND_SSL(mailbox->uri))
+ mn_mailbox_set_init_error(mailbox, _("SSL/TLS support has not been compiled in"));
#endif /* WITH_SSL */
- }
- else
- mn_mailbox_set_init_error(mailbox, _("unable to parse IMAP URI"));
return object;
}}
-#line 304 "mn-imap-mailbox.c"
+#line 273 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 133 "mn-imap-mailbox.gob"
+#line 118 "mn-imap-mailbox.gob"
static gboolean
-___3_mn_imap_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
-#line 311 "mn-imap-mailbox.c"
+___3_mn_imap_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, MNURI * uri)
+#line 280 "mn-imap-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
(* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
((gboolean )0))
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::impl_is"
-#line 133 "mn-imap-mailbox.gob"
+#line 118 "mn-imap-mailbox.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 320 "mn-imap-mailbox.c"
+#line 118 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 291 "mn-imap-mailbox.c"
{
-#line 135 "mn-imap-mailbox.gob"
+#line 120 "mn-imap-mailbox.gob"
- char *scheme;
- gboolean is;
-
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && (! strcmp(scheme, "imap") || ! strcmp(scheme, "imaps"));
- g_free(scheme);
-
- return is;
+ return MN_URI_IS_IMAP(uri);
}}
-#line 333 "mn-imap-mailbox.c"
+#line 297 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 146 "mn-imap-mailbox.gob"
+#line 124 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 340 "mn-imap-mailbox.c"
+#line 304 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_greeting_cb"
-#line 146 "mn-imap-mailbox.gob"
+#line 124 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 146 "mn-imap-mailbox.gob"
+#line 124 "mn-imap-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 146 "mn-imap-mailbox.gob"
+#line 124 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 349 "mn-imap-mailbox.c"
+#line 313 "mn-imap-mailbox.c"
{
-#line 150 "mn-imap-mailbox.gob"
+#line 128 "mn-imap-mailbox.gob"
priv->session = session;
@@ -362,7 +326,7 @@ mn_imap_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionRe
}
return priv->capabilities
- ? self_session_authenticate(priv)
+ ? self_session_after_capability(priv)
: STATE_CAPABILITY;
}
else if (! response->tag && IS(response, "PREAUTH"))
@@ -372,43 +336,49 @@ mn_imap_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionRe
else
return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}}
-#line 376 "mn-imap-mailbox.c"
+#line 340 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 175 "mn-imap-mailbox.gob"
+#line 153 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_enter_capability_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 382 "mn-imap-mailbox.c"
+#line 346 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_capability_cb"
-#line 175 "mn-imap-mailbox.gob"
+#line 153 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 175 "mn-imap-mailbox.gob"
+#line 153 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 389 "mn-imap-mailbox.c"
+#line 353 "mn-imap-mailbox.c"
{
-#line 178 "mn-imap-mailbox.gob"
+#line 156 "mn-imap-mailbox.gob"
+ g_strfreev(priv->capabilities);
+ priv->capabilities = NULL;
+
+ eel_g_slist_free_deep(priv->auth_mechanisms);
+ priv->auth_mechanisms = NULL;
+
return self_session_write(priv, "CAPABILITY");
}}
-#line 395 "mn-imap-mailbox.c"
+#line 365 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 182 "mn-imap-mailbox.gob"
+#line 166 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_handle_capability_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 401 "mn-imap-mailbox.c"
+#line 371 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_capability_cb"
-#line 182 "mn-imap-mailbox.gob"
+#line 166 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 182 "mn-imap-mailbox.gob"
+#line 166 "mn-imap-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 182 "mn-imap-mailbox.gob"
+#line 166 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 410 "mn-imap-mailbox.c"
+#line 380 "mn-imap-mailbox.c"
{
-#line 186 "mn-imap-mailbox.gob"
+#line 170 "mn-imap-mailbox.gob"
if (response->tag)
{
@@ -417,7 +387,7 @@ mn_imap_mailbox_handle_capability_cb (MNClientSession * session, MNClientSession
if (IS_OK(response))
{
return priv->capabilities
- ? self_session_authenticate(priv)
+ ? self_session_after_capability(priv)
: mn_client_session_error(session, _("server did not send capabilities"));
}
else if (IS_BAD(response))
@@ -434,28 +404,94 @@ mn_imap_mailbox_handle_capability_cb (MNClientSession * session, MNClientSession
return RESULT_DEFAULT_HANDLER;
}}
-#line 438 "mn-imap-mailbox.c"
+#line 408 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 212 "mn-imap-mailbox.gob"
+#line 196 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_enter_starttls_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 414 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_starttls_cb"
+#line 196 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 196 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 421 "mn-imap-mailbox.c"
+{
+#line 199 "mn-imap-mailbox.gob"
+
+#ifdef WITH_SSL
+ return self_session_write(priv, "STARTTLS");
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }}
+#line 431 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 207 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_handle_starttls_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 437 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_starttls_cb"
+#line 207 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 207 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 207 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 446 "mn-imap-mailbox.c"
+{
+#line 211 "mn-imap-mailbox.gob"
+
+#ifdef WITH_SSL
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ priv->starttls_completed = TRUE;
+ return mn_client_session_enable_ssl(session)
+ ? STATE_CAPABILITY
+ : RESULT_ERROR_END;
+ }
+ else if (IS_BAD(response))
+ return self_session_authenticate(priv);
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }}
+#line 474 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 237 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_enter_authenticate_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 444 "mn-imap-mailbox.c"
+#line 480 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_authenticate_cb"
-#line 212 "mn-imap-mailbox.gob"
+#line 237 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 212 "mn-imap-mailbox.gob"
+#line 237 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 451 "mn-imap-mailbox.c"
+#line 487 "mn-imap-mailbox.c"
{
-#line 215 "mn-imap-mailbox.gob"
+#line 240 "mn-imap-mailbox.gob"
#ifdef WITH_SASL
if (mn_client_session_sasl_authentication_start(priv->session,
"imap",
priv->auth_mechanisms,
- priv->mailbox->_priv->authmech,
+ priv->mailbox->uri->authmech,
&priv->sasl_mechanism))
return self_session_write(priv, "AUTHENTICATE %s", priv->sasl_mechanism);
else
@@ -464,24 +500,24 @@ mn_imap_mailbox_enter_authenticate_cb (MNClientSession * session, MNClientSessio
g_return_val_if_reached(0);
#endif /* WITH_SASL */
}}
-#line 468 "mn-imap-mailbox.c"
+#line 504 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 230 "mn-imap-mailbox.gob"
+#line 255 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_handle_authenticate_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 474 "mn-imap-mailbox.c"
+#line 510 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_authenticate_cb"
-#line 230 "mn-imap-mailbox.gob"
+#line 255 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 230 "mn-imap-mailbox.gob"
+#line 255 "mn-imap-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 230 "mn-imap-mailbox.gob"
+#line 255 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 483 "mn-imap-mailbox.c"
+#line 519 "mn-imap-mailbox.c"
{
-#line 234 "mn-imap-mailbox.gob"
+#line 259 "mn-imap-mailbox.gob"
#ifdef WITH_SASL
if (response->tag)
@@ -508,37 +544,37 @@ mn_imap_mailbox_handle_authenticate_cb (MNClientSession * session, MNClientSessi
g_return_val_if_reached(0);
#endif /* WITH_SASL */
}}
-#line 512 "mn-imap-mailbox.c"
+#line 548 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 261 "mn-imap-mailbox.gob"
+#line 286 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_enter_login_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 518 "mn-imap-mailbox.c"
+#line 554 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_login_cb"
-#line 261 "mn-imap-mailbox.gob"
+#line 286 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 261 "mn-imap-mailbox.gob"
+#line 286 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 525 "mn-imap-mailbox.c"
+#line 561 "mn-imap-mailbox.c"
{
-#line 264 "mn-imap-mailbox.gob"
+#line 289 "mn-imap-mailbox.gob"
if (self_session_has_capability(priv, "LOGINDISABLED"))
- {
- mn_client_session_notice(session, _("server advertised LOGINDISABLED, not using LOGIN authentication"));
- mn_client_session_error(session, _("unable to login"));
- return STATE_LOGOUT;
- }
+ {
+ mn_client_session_notice(session, _("server advertised LOGINDISABLED, not using LOGIN authentication"));
+ mn_client_session_error(session, _("unable to login"));
+ return STATE_LOGOUT;
+ }
else
{
char *quoted_username;
char *quoted_password;
int result;
- quoted_username = self_quote(priv->mailbox->_priv->username);
- quoted_password = self_quote(priv->mailbox->_priv->password);
+ quoted_username = self_quote(priv->mailbox->uri->username);
+ quoted_password = self_quote(priv->mailbox->uri->password);
result = self_session_write(priv, "LOGIN %s %s", quoted_username, quoted_password);
g_free(quoted_username);
g_free(quoted_password);
@@ -546,24 +582,24 @@ mn_imap_mailbox_enter_login_cb (MNClientSession * session, MNClientSessionPrivat
return result;
}
}}
-#line 550 "mn-imap-mailbox.c"
+#line 586 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 287 "mn-imap-mailbox.gob"
+#line 312 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_handle_login_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 556 "mn-imap-mailbox.c"
+#line 592 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_login_cb"
-#line 287 "mn-imap-mailbox.gob"
+#line 312 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 287 "mn-imap-mailbox.gob"
+#line 312 "mn-imap-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 287 "mn-imap-mailbox.gob"
+#line 312 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 565 "mn-imap-mailbox.c"
+#line 601 "mn-imap-mailbox.c"
{
-#line 291 "mn-imap-mailbox.gob"
+#line 316 "mn-imap-mailbox.gob"
if (response->tag)
{
@@ -580,50 +616,50 @@ mn_imap_mailbox_handle_login_cb (MNClientSession * session, MNClientSessionRespo
return RESULT_DEFAULT_HANDLER;
}}
-#line 584 "mn-imap-mailbox.c"
+#line 620 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 308 "mn-imap-mailbox.gob"
+#line 333 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_enter_status_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 590 "mn-imap-mailbox.c"
+#line 626 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_status_cb"
-#line 308 "mn-imap-mailbox.gob"
+#line 333 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 308 "mn-imap-mailbox.gob"
+#line 333 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 597 "mn-imap-mailbox.c"
+#line 633 "mn-imap-mailbox.c"
{
-#line 311 "mn-imap-mailbox.gob"
+#line 336 "mn-imap-mailbox.gob"
char *quoted_mailbox;
int result;
- quoted_mailbox = self_quote(priv->mailbox->_priv->mailbox);
+ quoted_mailbox = self_quote(priv->mailbox->uri->path);
result = self_session_write(priv, "STATUS %s (UNSEEN)", quoted_mailbox);
g_free(quoted_mailbox);
return result;
}}
-#line 610 "mn-imap-mailbox.c"
+#line 646 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 322 "mn-imap-mailbox.gob"
+#line 347 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_handle_status_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 616 "mn-imap-mailbox.c"
+#line 652 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_status_cb"
-#line 322 "mn-imap-mailbox.gob"
+#line 347 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 322 "mn-imap-mailbox.gob"
+#line 347 "mn-imap-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 322 "mn-imap-mailbox.gob"
+#line 347 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 625 "mn-imap-mailbox.c"
+#line 661 "mn-imap-mailbox.c"
{
-#line 326 "mn-imap-mailbox.gob"
+#line 351 "mn-imap-mailbox.gob"
if (response->tag)
{
@@ -651,7 +687,7 @@ mn_imap_mailbox_handle_status_cb (MNClientSession * session, MNClientSessionResp
priv->status_received = TRUE;
GDK_THREADS_ENTER();
- mn_mailbox_set_has_new(MN_MAILBOX(priv->mailbox), count != 0);
+ mn_mailbox_set_has_new(priv->mailbox, count != 0);
gdk_flush();
GDK_THREADS_LEAVE();
@@ -663,43 +699,43 @@ mn_imap_mailbox_handle_status_cb (MNClientSession * session, MNClientSessionResp
return RESULT_DEFAULT_HANDLER;
}}
-#line 667 "mn-imap-mailbox.c"
+#line 703 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 366 "mn-imap-mailbox.gob"
+#line 391 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_enter_logout_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 673 "mn-imap-mailbox.c"
+#line 709 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_logout_cb"
-#line 366 "mn-imap-mailbox.gob"
+#line 391 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 366 "mn-imap-mailbox.gob"
+#line 391 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 680 "mn-imap-mailbox.c"
+#line 716 "mn-imap-mailbox.c"
{
-#line 369 "mn-imap-mailbox.gob"
+#line 394 "mn-imap-mailbox.gob"
return self_session_write(priv, "LOGOUT");
}}
-#line 686 "mn-imap-mailbox.c"
+#line 722 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 373 "mn-imap-mailbox.gob"
+#line 398 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_handle_logout_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 692 "mn-imap-mailbox.c"
+#line 728 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_logout_cb"
-#line 373 "mn-imap-mailbox.gob"
+#line 398 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 373 "mn-imap-mailbox.gob"
+#line 398 "mn-imap-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 373 "mn-imap-mailbox.gob"
+#line 398 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 701 "mn-imap-mailbox.c"
+#line 737 "mn-imap-mailbox.c"
{
-#line 377 "mn-imap-mailbox.gob"
+#line 402 "mn-imap-mailbox.gob"
if (response->tag && HAS_CURRENT_TAG(response, priv))
{
@@ -713,30 +749,33 @@ mn_imap_mailbox_handle_logout_cb (MNClientSession * session, MNClientSessionResp
else
return MN_CLIENT_SESSION_RESULT_CONTINUE;
}}
-#line 717 "mn-imap-mailbox.c"
+#line 753 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 391 "mn-imap-mailbox.gob"
+#line 416 "mn-imap-mailbox.gob"
static void
-___f_mn_imap_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
-#line 723 "mn-imap-mailbox.c"
+___11_mn_imap_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
+#line 759 "mn-imap-mailbox.c"
#define PARENT_HANDLER(___mailbox) \
{ if(MN_MAILBOX_CLASS(parent_class)->impl_threaded_check) \
(* MN_MAILBOX_CLASS(parent_class)->impl_threaded_check)(___mailbox); }
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::impl_threaded_check"
-#line 391 "mn-imap-mailbox.gob"
+#line 416 "mn-imap-mailbox.gob"
g_return_if_fail (mailbox != NULL);
-#line 391 "mn-imap-mailbox.gob"
+#line 416 "mn-imap-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (mailbox));
-#line 733 "mn-imap-mailbox.c"
+#line 769 "mn-imap-mailbox.c"
{
-#line 393 "mn-imap-mailbox.gob"
+#line 418 "mn-imap-mailbox.gob"
Self *self = SELF(mailbox);
MNClientSessionState states[] = {
{ STATE_GREETING, NULL, self_handle_greeting_cb },
{ STATE_CAPABILITY, self_enter_capability_cb, self_handle_capability_cb },
+#ifdef WITH_SSL
+ { STATE_STARTTLS, self_enter_starttls_cb, self_handle_starttls_cb },
+#endif
#ifdef WITH_SASL
{ STATE_AUTHENTICATE, self_enter_authenticate_cb, self_handle_authenticate_cb },
#endif
@@ -756,17 +795,18 @@ ___f_mn_imap_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
GError *err = NULL;
memset(&priv, 0, sizeof(priv));
- priv.mailbox = self;
+ priv.mailbox = mailbox;
+ priv.self = self;
if (! mn_client_session_run(states,
&callbacks,
#ifdef WITH_SSL
- selfp->ssl,
+ MN_URI_IS_SSL(mailbox->uri),
#endif
- selfp->hostname,
- selfp->port,
- selfp->username,
- selfp->password,
+ mailbox->uri->hostname,
+ mailbox->uri->port,
+ mailbox->uri->username,
+ mailbox->uri->password,
&priv,
&err))
{
@@ -784,48 +824,48 @@ ___f_mn_imap_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
g_free(priv.tag);
g_strfreev(priv.capabilities);
- mn_pointers_free(priv.auth_mechanisms);
+ eel_g_slist_free_deep(priv.auth_mechanisms);
}}
-#line 790 "mn-imap-mailbox.c"
+#line 830 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 448 "mn-imap-mailbox.gob"
+#line 477 "mn-imap-mailbox.gob"
static void
mn_imap_mailbox_notice_cb (MNClientSession * session, const char * str, MNClientSessionPrivate * priv)
-#line 797 "mn-imap-mailbox.c"
+#line 837 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::notice_cb"
-#line 448 "mn-imap-mailbox.gob"
+#line 477 "mn-imap-mailbox.gob"
g_return_if_fail (session != NULL);
-#line 448 "mn-imap-mailbox.gob"
+#line 477 "mn-imap-mailbox.gob"
g_return_if_fail (str != NULL);
-#line 448 "mn-imap-mailbox.gob"
+#line 477 "mn-imap-mailbox.gob"
g_return_if_fail (priv != NULL);
-#line 806 "mn-imap-mailbox.c"
+#line 846 "mn-imap-mailbox.c"
{
-#line 452 "mn-imap-mailbox.gob"
+#line 481 "mn-imap-mailbox.gob"
- mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ mn_mailbox_notice(priv->mailbox, "%s", str);
}}
-#line 812 "mn-imap-mailbox.c"
+#line 852 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 456 "mn-imap-mailbox.gob"
+#line 485 "mn-imap-mailbox.gob"
static MNClientSessionResponse *
mn_imap_mailbox_response_new_cb (MNClientSession * session, const char * input, MNClientSessionPrivate * priv)
-#line 818 "mn-imap-mailbox.c"
+#line 858 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::response_new_cb"
-#line 456 "mn-imap-mailbox.gob"
+#line 485 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (MNClientSessionResponse * )0);
-#line 456 "mn-imap-mailbox.gob"
+#line 485 "mn-imap-mailbox.gob"
g_return_val_if_fail (input != NULL, (MNClientSessionResponse * )0);
-#line 456 "mn-imap-mailbox.gob"
+#line 485 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (MNClientSessionResponse * )0);
-#line 827 "mn-imap-mailbox.c"
+#line 867 "mn-imap-mailbox.c"
{
-#line 460 "mn-imap-mailbox.gob"
+#line 489 "mn-imap-mailbox.gob"
MNClientSessionResponse *response = NULL;
@@ -872,24 +912,24 @@ mn_imap_mailbox_response_new_cb (MNClientSession * session, const char * input,
return response;
}}
-#line 876 "mn-imap-mailbox.c"
+#line 916 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 507 "mn-imap-mailbox.gob"
+#line 536 "mn-imap-mailbox.gob"
static void
mn_imap_mailbox_response_free_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 882 "mn-imap-mailbox.c"
+#line 922 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::response_free_cb"
-#line 507 "mn-imap-mailbox.gob"
+#line 536 "mn-imap-mailbox.gob"
g_return_if_fail (session != NULL);
-#line 507 "mn-imap-mailbox.gob"
+#line 536 "mn-imap-mailbox.gob"
g_return_if_fail (response != NULL);
-#line 507 "mn-imap-mailbox.gob"
+#line 536 "mn-imap-mailbox.gob"
g_return_if_fail (priv != NULL);
-#line 891 "mn-imap-mailbox.c"
+#line 931 "mn-imap-mailbox.c"
{
-#line 511 "mn-imap-mailbox.gob"
+#line 540 "mn-imap-mailbox.gob"
g_free(response->continuation);
g_free(response->tag);
@@ -898,24 +938,24 @@ mn_imap_mailbox_response_free_cb (MNClientSession * session, MNClientSessionResp
g_free(response->arguments);
g_free(response);
}}
-#line 902 "mn-imap-mailbox.c"
+#line 942 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 520 "mn-imap-mailbox.gob"
+#line 549 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_custom_handler_cb (MNClientSession * session, MNClientSessionResponse * response, int result, MNClientSessionPrivate * priv)
-#line 908 "mn-imap-mailbox.c"
+#line 948 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::custom_handler_cb"
-#line 520 "mn-imap-mailbox.gob"
+#line 549 "mn-imap-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 520 "mn-imap-mailbox.gob"
+#line 549 "mn-imap-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 520 "mn-imap-mailbox.gob"
+#line 549 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 917 "mn-imap-mailbox.c"
+#line 957 "mn-imap-mailbox.c"
{
-#line 525 "mn-imap-mailbox.gob"
+#line 554 "mn-imap-mailbox.gob"
switch (result)
{
@@ -937,44 +977,44 @@ mn_imap_mailbox_custom_handler_cb (MNClientSession * session, MNClientSessionRes
g_return_val_if_reached(0);
}
}}
-#line 941 "mn-imap-mailbox.c"
+#line 981 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 547 "mn-imap-mailbox.gob"
+#line 576 "mn-imap-mailbox.gob"
static void
mn_imap_mailbox_session_set_error_from_arguments (MNClientSessionPrivate * priv, MNClientSessionResponse * response)
-#line 947 "mn-imap-mailbox.c"
+#line 987 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_set_error_from_arguments"
-#line 547 "mn-imap-mailbox.gob"
+#line 576 "mn-imap-mailbox.gob"
g_return_if_fail (priv != NULL);
-#line 547 "mn-imap-mailbox.gob"
+#line 576 "mn-imap-mailbox.gob"
g_return_if_fail (response != NULL);
-#line 954 "mn-imap-mailbox.c"
+#line 994 "mn-imap-mailbox.c"
{
-#line 550 "mn-imap-mailbox.gob"
+#line 579 "mn-imap-mailbox.gob"
if (response->arguments)
mn_client_session_error(priv->session, "\"%s\"", response->arguments);
else
mn_client_session_error(priv->session, _("unknown server error"));
}}
-#line 963 "mn-imap-mailbox.c"
+#line 1003 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 557 "mn-imap-mailbox.gob"
+#line 586 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_session_write (MNClientSessionPrivate * priv, const char * format, ...)
-#line 969 "mn-imap-mailbox.c"
+#line 1009 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_write"
-#line 557 "mn-imap-mailbox.gob"
+#line 586 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 557 "mn-imap-mailbox.gob"
+#line 586 "mn-imap-mailbox.gob"
g_return_val_if_fail (format != NULL, (int )0);
-#line 976 "mn-imap-mailbox.c"
+#line 1016 "mn-imap-mailbox.c"
{
-#line 561 "mn-imap-mailbox.gob"
+#line 590 "mn-imap-mailbox.gob"
va_list args;
char *command;
@@ -995,20 +1035,20 @@ mn_imap_mailbox_session_write (MNClientSessionPrivate * priv, const char * forma
return result;
}}
-#line 999 "mn-imap-mailbox.c"
+#line 1039 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 582 "mn-imap-mailbox.gob"
+#line 611 "mn-imap-mailbox.gob"
static void
mn_imap_mailbox_session_parse_capabilities (MNClientSessionPrivate * priv, const char * capabilities)
-#line 1005 "mn-imap-mailbox.c"
+#line 1045 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_parse_capabilities"
-#line 582 "mn-imap-mailbox.gob"
+#line 611 "mn-imap-mailbox.gob"
g_return_if_fail (priv != NULL);
-#line 1010 "mn-imap-mailbox.c"
+#line 1050 "mn-imap-mailbox.c"
{
-#line 585 "mn-imap-mailbox.gob"
+#line 614 "mn-imap-mailbox.gob"
if (capabilities)
{
@@ -1023,22 +1063,22 @@ mn_imap_mailbox_session_parse_capabilities (MNClientSessionPrivate * priv, const
else
priv->capabilities = g_new0(char *, 1);
}}
-#line 1027 "mn-imap-mailbox.c"
+#line 1067 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 600 "mn-imap-mailbox.gob"
+#line 629 "mn-imap-mailbox.gob"
static gboolean
mn_imap_mailbox_session_has_capability (MNClientSessionPrivate * priv, const char * capability)
-#line 1033 "mn-imap-mailbox.c"
+#line 1073 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_has_capability"
-#line 600 "mn-imap-mailbox.gob"
+#line 629 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (gboolean )0);
-#line 600 "mn-imap-mailbox.gob"
+#line 629 "mn-imap-mailbox.gob"
g_return_val_if_fail (capability != NULL, (gboolean )0);
-#line 1040 "mn-imap-mailbox.c"
+#line 1080 "mn-imap-mailbox.c"
{
-#line 603 "mn-imap-mailbox.gob"
+#line 632 "mn-imap-mailbox.gob"
int i;
@@ -1050,24 +1090,56 @@ mn_imap_mailbox_session_has_capability (MNClientSessionPrivate * priv, const cha
return FALSE;
}}
-#line 1054 "mn-imap-mailbox.c"
+#line 1094 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 615 "mn-imap-mailbox.gob"
+#line 644 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_session_after_capability (MNClientSessionPrivate * priv)
+#line 1100 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_after_capability"
+#line 644 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 1105 "mn-imap-mailbox.c"
+{
+#line 646 "mn-imap-mailbox.gob"
+
+#ifdef WITH_SSL
+ if (MN_URI_IS_INBAND_SSL(priv->mailbox->uri)
+ && ! MN_URI_IS_SSL(priv->mailbox->uri)
+ && ! priv->starttls_completed)
+ {
+ if (self_session_has_capability(priv, "STARTTLS"))
+ return STATE_STARTTLS;
+ else
+ {
+ mn_client_session_error(priv->session, _("server does not support in-band SSL/TLS"));
+ return STATE_LOGOUT;
+ }
+ }
+ else
+#endif /* WITH_SSL */
+ return self_session_authenticate(priv);
+ }}
+#line 1126 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 665 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_session_authenticate (MNClientSessionPrivate * priv)
-#line 1060 "mn-imap-mailbox.c"
+#line 1132 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_authenticate"
-#line 615 "mn-imap-mailbox.gob"
+#line 665 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 1065 "mn-imap-mailbox.c"
+#line 1137 "mn-imap-mailbox.c"
{
-#line 617 "mn-imap-mailbox.gob"
+#line 667 "mn-imap-mailbox.gob"
- if (priv->mailbox->_priv->authmech)
+ if (priv->mailbox->uri->authmech)
{
- if (*priv->mailbox->_priv->authmech != '+')
+ if (*priv->mailbox->uri->authmech != '+')
{
#ifdef WITH_SASL
return STATE_AUTHENTICATE;
@@ -1077,10 +1149,10 @@ mn_imap_mailbox_session_authenticate (MNClientSessionPrivate * priv)
}
else
{
- if (! strcmp(priv->mailbox->_priv->authmech, "+LOGIN"))
+ if (! strcmp(priv->mailbox->uri->authmech, "+LOGIN"))
return STATE_LOGIN;
else
- return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->uri->authmech);
}
}
else
@@ -1092,22 +1164,22 @@ mn_imap_mailbox_session_authenticate (MNClientSessionPrivate * priv)
return STATE_LOGIN;
}
}}
-#line 1096 "mn-imap-mailbox.c"
+#line 1168 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
-#line 646 "mn-imap-mailbox.gob"
+#line 696 "mn-imap-mailbox.gob"
static int
mn_imap_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv)
-#line 1102 "mn-imap-mailbox.c"
+#line 1174 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_authenticate_fallback"
-#line 646 "mn-imap-mailbox.gob"
+#line 696 "mn-imap-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 1107 "mn-imap-mailbox.c"
+#line 1179 "mn-imap-mailbox.c"
{
-#line 648 "mn-imap-mailbox.gob"
+#line 698 "mn-imap-mailbox.gob"
- if (! priv->mailbox->_priv->authmech)
+ if (! priv->mailbox->uri->authmech)
{
mn_client_session_notice(priv->session, _("falling back to IMAP LOGIN authentication"));
return STATE_LOGIN;
@@ -1115,7 +1187,7 @@ mn_imap_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv)
return mn_client_session_error(priv->session, _("authentication failed"));
}}
-#line 1119 "mn-imap-mailbox.c"
+#line 1191 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
/**
@@ -1126,17 +1198,17 @@ mn_imap_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv)
*
* Return value: the quoted string.
**/
-#line 666 "mn-imap-mailbox.gob"
+#line 716 "mn-imap-mailbox.gob"
static char *
mn_imap_mailbox_quote (const char * str)
-#line 1133 "mn-imap-mailbox.c"
+#line 1205 "mn-imap-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::quote"
-#line 666 "mn-imap-mailbox.gob"
+#line 716 "mn-imap-mailbox.gob"
g_return_val_if_fail (str != NULL, (char * )0);
-#line 1138 "mn-imap-mailbox.c"
+#line 1210 "mn-imap-mailbox.c"
{
-#line 668 "mn-imap-mailbox.gob"
+#line 718 "mn-imap-mailbox.gob"
GString *quoted;
int i;
@@ -1151,5 +1223,5 @@ mn_imap_mailbox_quote (const char * str)
return g_string_free(quoted, FALSE);
}}
-#line 1155 "mn-imap-mailbox.c"
+#line 1227 "mn-imap-mailbox.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-imap-mailbox.gob b/src/mn-imap-mailbox.gob
@@ -29,9 +29,9 @@
#include <stdarg.h>
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
+#include <eel/eel.h>
#include "mn-mailbox-private.h"
#include "mn-util.h"
-#include "mn-uri.h"
#include "mn-client-session.h"
#define HAS_CURRENT_TAG(response, priv) (! strcmp((response)->tag, (priv)->tag))
@@ -45,6 +45,9 @@
{
STATE_GREETING = MN_CLIENT_SESSION_INITIAL_STATE,
STATE_CAPABILITY,
+#ifdef WITH_SSL
+ STATE_STARTTLS,
+#endif
#ifdef WITH_SASL
STATE_AUTHENTICATE,
#endif
@@ -62,18 +65,22 @@
struct _MNClientSessionPrivate
{
- MNIMAPMailbox *mailbox;
+ MNMailbox *mailbox;
+ MNIMAPMailbox *self;
MNClientSession *session;
int numeric_tag;
char *tag;
char **capabilities;
GSList *auth_mechanisms;
gboolean status_received;
+#ifdef WITH_SSL
+ gboolean starttls_completed;
+#endif
#ifdef WITH_SASL
const char *sasl_mechanism;
#endif
};
-
+
struct _MNClientSessionResponse
{
char *continuation;
@@ -86,14 +93,6 @@
class MN:IMAP:Mailbox from MN:Mailbox
{
- private char *hostname destroywith g_free;
- private int port;
- private char *username destroywith g_free;
- private char *password destroywith g_free;
- private char *authmech destroywith g_free;
- private char *mailbox destroywith g_free;
- private gboolean ssl;
-
class_init (class)
{
MN_MAILBOX_CLASS(class)->format = "IMAP";
@@ -104,43 +103,22 @@ class MN:IMAP:Mailbox from MN:Mailbox
{
GObject *object;
MNMailbox *mailbox;
- Self *self;
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
mailbox = MN_MAILBOX(object);
- self = SELF(object);
-
- if (mn_uri_parse_imap(mn_mailbox_get_uri(mailbox),
- &selfp->ssl,
- &selfp->username,
- &selfp->password,
- &selfp->authmech,
- &selfp->hostname,
- &selfp->port,
- &selfp->mailbox))
- {
+
#ifndef WITH_SSL
- if (selfp->ssl)
- mn_mailbox_set_init_error(mailbox, _("SSL support has not been compiled in"));
+ if (MN_URI_IS_SSL(mailbox->uri) || MN_URI_IS_INBAND_SSL(mailbox->uri))
+ mn_mailbox_set_init_error(mailbox, _("SSL/TLS support has not been compiled in"));
#endif /* WITH_SSL */
- }
- else
- mn_mailbox_set_init_error(mailbox, _("unable to parse IMAP URI"));
return object;
}
override (MN:Mailbox) gboolean
- impl_is (MNMailbox *dummy, const char *uri (check null))
+ impl_is (MNMailbox *dummy, MN:URI *uri (check null type))
{
- char *scheme;
- gboolean is;
-
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && (! strcmp(scheme, "imap") || ! strcmp(scheme, "imaps"));
- g_free(scheme);
-
- return is;
+ return MN_URI_IS_IMAP(uri);
}
private int
@@ -161,7 +139,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
}
return priv->capabilities
- ? self_session_authenticate(priv)
+ ? self_session_after_capability(priv)
: STATE_CAPABILITY;
}
else if (! response->tag && IS(response, "PREAUTH"))
@@ -176,6 +154,12 @@ class MN:IMAP:Mailbox from MN:Mailbox
enter_capability_cb (MNClientSession *session (check null),
MNClientSessionPrivate *priv (check null))
{
+ g_strfreev(priv->capabilities);
+ priv->capabilities = NULL;
+
+ eel_g_slist_free_deep(priv->auth_mechanisms);
+ priv->auth_mechanisms = NULL;
+
return self_session_write(priv, "CAPABILITY");
}
@@ -191,7 +175,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
if (IS_OK(response))
{
return priv->capabilities
- ? self_session_authenticate(priv)
+ ? self_session_after_capability(priv)
: mn_client_session_error(session, _("server did not send capabilities"));
}
else if (IS_BAD(response))
@@ -210,6 +194,47 @@ class MN:IMAP:Mailbox from MN:Mailbox
}
private int
+ enter_starttls_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SSL
+ return self_session_write(priv, "STARTTLS");
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }
+
+ private int
+ handle_starttls_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SSL
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ priv->starttls_completed = TRUE;
+ return mn_client_session_enable_ssl(session)
+ ? STATE_CAPABILITY
+ : RESULT_ERROR_END;
+ }
+ else if (IS_BAD(response))
+ return self_session_authenticate(priv);
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }
+
+ private int
enter_authenticate_cb (MNClientSession *session (check null),
MNClientSessionPrivate *priv (check null))
{
@@ -217,7 +242,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
if (mn_client_session_sasl_authentication_start(priv->session,
"imap",
priv->auth_mechanisms,
- priv->mailbox->_priv->authmech,
+ priv->mailbox->uri->authmech,
&priv->sasl_mechanism))
return self_session_write(priv, "AUTHENTICATE %s", priv->sasl_mechanism);
else
@@ -263,19 +288,19 @@ class MN:IMAP:Mailbox from MN:Mailbox
MNClientSessionPrivate *priv (check null))
{
if (self_session_has_capability(priv, "LOGINDISABLED"))
- {
- mn_client_session_notice(session, _("server advertised LOGINDISABLED, not using LOGIN authentication"));
- mn_client_session_error(session, _("unable to login"));
- return STATE_LOGOUT;
- }
+ {
+ mn_client_session_notice(session, _("server advertised LOGINDISABLED, not using LOGIN authentication"));
+ mn_client_session_error(session, _("unable to login"));
+ return STATE_LOGOUT;
+ }
else
{
char *quoted_username;
char *quoted_password;
int result;
- quoted_username = self_quote(priv->mailbox->_priv->username);
- quoted_password = self_quote(priv->mailbox->_priv->password);
+ quoted_username = self_quote(priv->mailbox->uri->username);
+ quoted_password = self_quote(priv->mailbox->uri->password);
result = self_session_write(priv, "LOGIN %s %s", quoted_username, quoted_password);
g_free(quoted_username);
g_free(quoted_password);
@@ -312,7 +337,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
char *quoted_mailbox;
int result;
- quoted_mailbox = self_quote(priv->mailbox->_priv->mailbox);
+ quoted_mailbox = self_quote(priv->mailbox->uri->path);
result = self_session_write(priv, "STATUS %s (UNSEEN)", quoted_mailbox);
g_free(quoted_mailbox);
@@ -350,7 +375,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
priv->status_received = TRUE;
GDK_THREADS_ENTER();
- mn_mailbox_set_has_new(MN_MAILBOX(priv->mailbox), count != 0);
+ mn_mailbox_set_has_new(priv->mailbox, count != 0);
gdk_flush();
GDK_THREADS_LEAVE();
@@ -395,6 +420,9 @@ class MN:IMAP:Mailbox from MN:Mailbox
MNClientSessionState states[] = {
{ STATE_GREETING, NULL, self_handle_greeting_cb },
{ STATE_CAPABILITY, self_enter_capability_cb, self_handle_capability_cb },
+#ifdef WITH_SSL
+ { STATE_STARTTLS, self_enter_starttls_cb, self_handle_starttls_cb },
+#endif
#ifdef WITH_SASL
{ STATE_AUTHENTICATE, self_enter_authenticate_cb, self_handle_authenticate_cb },
#endif
@@ -414,17 +442,18 @@ class MN:IMAP:Mailbox from MN:Mailbox
GError *err = NULL;
memset(&priv, 0, sizeof(priv));
- priv.mailbox = self;
+ priv.mailbox = mailbox;
+ priv.self = self;
if (! mn_client_session_run(states,
&callbacks,
#ifdef WITH_SSL
- selfp->ssl,
+ MN_URI_IS_SSL(mailbox->uri),
#endif
- selfp->hostname,
- selfp->port,
- selfp->username,
- selfp->password,
+ mailbox->uri->hostname,
+ mailbox->uri->port,
+ mailbox->uri->username,
+ mailbox->uri->password,
&priv,
&err))
{
@@ -442,7 +471,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
g_free(priv.tag);
g_strfreev(priv.capabilities);
- mn_pointers_free(priv.auth_mechanisms);
+ eel_g_slist_free_deep(priv.auth_mechanisms);
}
private void
@@ -450,7 +479,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
const char *str (check null),
MNClientSessionPrivate *priv (check null))
{
- mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ mn_mailbox_notice(priv->mailbox, "%s", str);
}
private MNClientSessionResponse *
@@ -613,11 +642,32 @@ class MN:IMAP:Mailbox from MN:Mailbox
}
private int
+ session_after_capability (MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SSL
+ if (MN_URI_IS_INBAND_SSL(priv->mailbox->uri)
+ && ! MN_URI_IS_SSL(priv->mailbox->uri)
+ && ! priv->starttls_completed)
+ {
+ if (self_session_has_capability(priv, "STARTTLS"))
+ return STATE_STARTTLS;
+ else
+ {
+ mn_client_session_error(priv->session, _("server does not support in-band SSL/TLS"));
+ return STATE_LOGOUT;
+ }
+ }
+ else
+#endif /* WITH_SSL */
+ return self_session_authenticate(priv);
+ }
+
+ private int
session_authenticate (MNClientSessionPrivate *priv (check null))
{
- if (priv->mailbox->_priv->authmech)
+ if (priv->mailbox->uri->authmech)
{
- if (*priv->mailbox->_priv->authmech != '+')
+ if (*priv->mailbox->uri->authmech != '+')
{
#ifdef WITH_SASL
return STATE_AUTHENTICATE;
@@ -627,10 +677,10 @@ class MN:IMAP:Mailbox from MN:Mailbox
}
else
{
- if (! strcmp(priv->mailbox->_priv->authmech, "+LOGIN"))
+ if (! strcmp(priv->mailbox->uri->authmech, "+LOGIN"))
return STATE_LOGIN;
else
- return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->uri->authmech);
}
}
else
@@ -646,7 +696,7 @@ class MN:IMAP:Mailbox from MN:Mailbox
private int
session_authenticate_fallback (MNClientSessionPrivate *priv (check null))
{
- if (! priv->mailbox->_priv->authmech)
+ if (! priv->mailbox->uri->authmech)
{
mn_client_session_notice(priv->session, _("falling back to IMAP LOGIN authentication"));
return STATE_LOGIN;
diff --git a/src/mn-imap-mailbox.h b/src/mn-imap-mailbox.h
@@ -25,9 +25,6 @@ extern "C" {
#define MN_IMAP_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_imap_mailbox_get_type(), MNIMAPMailboxClass)
-/* Private structure type */
-typedef struct _MNIMAPMailboxPrivate MNIMAPMailboxPrivate;
-
/*
* Main object structure
*/
@@ -37,8 +34,6 @@ typedef struct _MNIMAPMailbox MNIMAPMailbox;
#endif
struct _MNIMAPMailbox {
MNMailbox __parent__;
- /*< private >*/
- MNIMAPMailboxPrivate *_priv;
};
/*
diff --git a/src/mn-mail-icon.c b/src/mn-mail-icon.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
diff --git a/src/mn-mailbox-private.h b/src/mn-mailbox-private.h
@@ -10,7 +10,7 @@ extern "C" {
#endif /* __cplusplus */
-#line 23 "mn-mailbox.gob"
+#line 24 "mn-mailbox.gob"
#include <libgnomevfs/gnome-vfs.h>
@@ -26,27 +26,25 @@ extern "C" {
#line 28 "mn-mailbox-private.h"
struct _MNMailboxPrivate {
-#line 87 "mn-mailbox.gob"
- char * uri;
-#line 97 "mn-mailbox.gob"
+#line 132 "mn-mailbox.gob"
char * name;
-#line 101 "mn-mailbox.gob"
+#line 136 "mn-mailbox.gob"
gboolean automatic;
-#line 106 "mn-mailbox.gob"
+#line 141 "mn-mailbox.gob"
gboolean has_new;
-#line 111 "mn-mailbox.gob"
+#line 146 "mn-mailbox.gob"
char * error;
-#line 131 "mn-mailbox.gob"
+#line 166 "mn-mailbox.gob"
GnomeVFSMonitorHandle * monitor_handle;
-#line 132 "mn-mailbox.gob"
+#line 167 "mn-mailbox.gob"
char * monitor_uri;
-#line 133 "mn-mailbox.gob"
+#line 168 "mn-mailbox.gob"
MNMailboxMonitorEventType monitor_events;
-#line 135 "mn-mailbox.gob"
+#line 170 "mn-mailbox.gob"
gboolean checking;
-#line 276 "mn-mailbox.gob"
+#line 310 "mn-mailbox.gob"
char * init_error;
-#line 50 "mn-mailbox-private.h"
+#line 48 "mn-mailbox-private.h"
};
void mn_mailbox_set_error (MNMailbox * self, const char * format, ...);
void mn_mailbox_set_init_error (MNMailbox * self, const char * format, ...);
diff --git a/src/mn-mailbox-properties-dialog.c b/src/mn-mailbox-properties-dialog.c
@@ -33,8 +33,8 @@
#endif
#include "mn-conf.h"
#include "mn-util.h"
-#include "mn-uri.h"
#include "mn-stock.h"
+#include "mn-mailboxes.h"
/*** types *******************************************************************/
@@ -45,7 +45,7 @@ typedef struct
GtkWidget *properties_event_box;
MNMailboxPropertiesDialogMode mode;
- char *uri;
+ MNURI *uri;
GtkWidget *apply_button;
GtkWidget *accept_button;
GtkListStore *store;
@@ -73,7 +73,7 @@ static void mn_mailbox_properties_dialog_set_active_properties (MNMailboxPropert
static MNMailboxProperties *mn_mailbox_properties_dialog_get_active_properties (MNMailboxPropertiesDialog *dialog);
static MNMailboxProperties *mn_mailbox_properties_dialog_get_properties_by_type (MNMailboxPropertiesDialog *dialog, GType type);
-static void mn_mailbox_properties_dialog_set_uri_internal (MNMailboxPropertiesDialog *dialog, const char *uri);
+static void mn_mailbox_properties_dialog_set_uri_internal (MNMailboxPropertiesDialog *dialog, MNURI *uri);
static void mn_mailbox_properties_dialog_update_sensitivity (MNMailboxPropertiesDialog *dialog);
/*** implementation **********************************************************/
@@ -168,7 +168,8 @@ mn_mailbox_properties_dialog_private_free (Private *private)
{
g_return_if_fail(private != NULL);
- g_free(private->uri);
+ if (private->uri)
+ g_object_unref(private->uri);
g_object_unref(private->store);
g_free(private);
}
@@ -314,30 +315,27 @@ mn_mailbox_properties_dialog_get_properties_by_type (MNMailboxPropertiesDialog *
static void
mn_mailbox_properties_dialog_set_uri_internal (MNMailboxPropertiesDialog *dialog,
- const char *uri)
+ MNURI *uri)
{
Private *private;
- char *name;
char *title;
g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
- g_return_if_fail(uri != NULL);
+ g_return_if_fail(MN_IS_URI(uri));
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- g_free(private->uri);
- private->uri = g_strdup(uri);
-
- name = mn_uri_format_for_display(private->uri);
- title = g_strdup_printf(_("%s Properties"), name);
- g_free(name);
+ if (private->uri)
+ g_object_unref(private->uri);
+ private->uri = g_object_ref(uri);
+ title = g_strdup_printf(_("%s Properties"), uri->human_readable);
gtk_window_set_title(GTK_WINDOW(dialog), title);
g_free(title);
}
void
mn_mailbox_properties_dialog_set_uri (MNMailboxPropertiesDialog *dialog,
- const char *uri)
+ MNURI *uri)
{
Private *private;
gboolean valid;
@@ -375,7 +373,7 @@ mn_mailbox_properties_dialog_set_uri (MNMailboxPropertiesDialog *dialog,
mn_mailbox_properties_dialog_set_active_properties(dialog, properties);
}
-char *
+MNURI *
mn_mailbox_properties_dialog_get_uri (MNMailboxPropertiesDialog *dialog)
{
Private *private;
@@ -392,34 +390,34 @@ void
mn_mailbox_properties_dialog_apply (MNMailboxPropertiesDialog *dialog)
{
Private *private;
- char *new_uri;
+ MNURI *new_uri;
g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
new_uri = mn_mailbox_properties_dialog_get_uri(dialog);
- g_return_if_fail(new_uri != NULL);
+ g_return_if_fail(MN_IS_URI(new_uri));
- if (mn_uri_cmp(new_uri, private->uri))
+ if (strcmp(new_uri->text, private->uri->text))
{
GSList *gconf_mailboxes;
GSList *elem;
gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
- elem = g_slist_find_custom(gconf_mailboxes, private->uri, (GCompareFunc) mn_uri_cmp);
+ elem = mn_mailboxes_conf_find_uri(gconf_mailboxes, private->uri);
if (elem)
{
g_free(elem->data);
- elem->data = g_strdup(new_uri);
+ elem->data = g_strdup(new_uri->text);
}
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
mn_mailbox_properties_dialog_set_uri_internal(dialog, new_uri);
}
- g_free(new_uri);
+ g_object_unref(new_uri);
}
static void
diff --git a/src/mn-mailbox-properties-dialog.h b/src/mn-mailbox-properties-dialog.h
@@ -20,6 +20,7 @@
#define _MN_MAILBOX_PROPERTIES_DIALOG_H
#include <gtk/gtk.h>
+#include "mn-uri.h"
#define MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE_KEY "mn-mailbox-properties-dialog-private"
#define MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(obj) (g_object_get_data(G_OBJECT(obj), MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE_KEY))
@@ -44,8 +45,8 @@ GtkWidget *mn_mailbox_properties_dialog_new (GtkWindow *parent,
MNMailboxPropertiesDialogMode mode);
void mn_mailbox_properties_dialog_set_uri (MNMailboxPropertiesDialog *dialog,
- const char *uri);
-char *mn_mailbox_properties_dialog_get_uri (MNMailboxPropertiesDialog *dialog);
+ MNURI *uri);
+MNURI *mn_mailbox_properties_dialog_get_uri (MNMailboxPropertiesDialog *dialog);
void mn_mailbox_properties_dialog_apply (MNMailboxPropertiesDialog *dialog);
diff --git a/src/mn-mailbox-properties-util.c b/src/mn-mailbox-properties-util.c
@@ -65,6 +65,8 @@ mn_mailbox_properties_credentials_new (GtkVBox *vbox,
GtkWidget **password_label,
GtkWidget **password_entry)
{
+ const char *username;
+
g_return_if_fail(GTK_IS_VBOX(vbox));
g_return_if_fail(username_label != NULL);
g_return_if_fail(username_entry != NULL);
@@ -75,6 +77,12 @@ mn_mailbox_properties_credentials_new (GtkVBox *vbox,
_("_Username:"),
username_label,
username_entry);
+
+ /* defaults to the login name */
+ username = g_get_user_name();
+ if (username)
+ gtk_entry_set_text(GTK_ENTRY(*username_entry), username);
+
mn_mailbox_properties_field_new(vbox,
_("_Password:"),
password_label,
@@ -153,6 +161,7 @@ mn_mailbox_properties_connection_type_new (GtkVBox *vbox,
port_label = gtk_label_new(_("Port:"));
*spin = gtk_spin_button_new_with_range(0, 0xFFFF, 1);
+ gtk_entry_set_activates_default(GTK_ENTRY(*spin), TRUE);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(*spin), default_port);
gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(*spin), TRUE);
diff --git a/src/mn-mailbox-properties.c b/src/mn-mailbox-properties.c
@@ -104,15 +104,15 @@ mn_mailbox_properties_get_label (MNMailboxProperties *properties)
gboolean
mn_mailbox_properties_set_uri (MNMailboxProperties *properties,
- const char *uri)
+ MNURI *uri)
{
g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES(properties), FALSE);
- g_return_val_if_fail(uri != NULL, FALSE);
+ g_return_val_if_fail(MN_IS_URI(uri), FALSE);
return MN_MAILBOX_PROPERTIES_GET_IFACE(properties)->set_uri(properties, uri);
}
-char *
+MNURI *
mn_mailbox_properties_get_uri (MNMailboxProperties *properties)
{
g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES(properties), NULL);
diff --git a/src/mn-mailbox-properties.h b/src/mn-mailbox-properties.h
@@ -20,6 +20,7 @@
#define _MN_MAILBOX_PROPERTIES_H
#include <glib-object.h>
+#include "mn-uri.h"
#define MN_TYPE_MAILBOX_PROPERTIES (mn_mailbox_properties_get_type ())
#define MN_MAILBOX_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_MAILBOX_PROPERTIES, MNMailboxProperties))
@@ -33,8 +34,8 @@ typedef struct
GTypeInterface parent;
gboolean (* set_uri) (MNMailboxProperties *properties,
- const char *uri);
- char * (* get_uri) (MNMailboxProperties *properties);
+ MNURI *uri);
+ MNURI * (* get_uri) (MNMailboxProperties *properties);
} MNMailboxPropertiesIface;
GType mn_mailbox_properties_get_type (void);
@@ -42,7 +43,7 @@ GType mn_mailbox_properties_get_type (void);
GtkSizeGroup *mn_mailbox_properties_get_size_group (MNMailboxProperties *properties);
char *mn_mailbox_properties_get_label (MNMailboxProperties *properties);
gboolean mn_mailbox_properties_set_uri (MNMailboxProperties *properties,
- const char *uri);
-char *mn_mailbox_properties_get_uri (MNMailboxProperties *properties);
+ MNURI *uri);
+MNURI *mn_mailbox_properties_get_uri (MNMailboxProperties *properties);
#endif /* _MN_MAILBOX_PROPERTIES_H */
diff --git a/src/mn-mailbox-view-private.h b/src/mn-mailbox-view-private.h
@@ -10,17 +10,17 @@ extern "C" {
#endif /* __cplusplus */
struct _MNMailboxViewPrivate {
-#line 50 "mn-mailbox-view.gob"
+#line 49 "mn-mailbox-view.gob"
GtkWidget * menu;
-#line 51 "mn-mailbox-view.gob"
+#line 50 "mn-mailbox-view.gob"
GtkWidget * remove_item;
-#line 52 "mn-mailbox-view.gob"
+#line 51 "mn-mailbox-view.gob"
GtkWidget * cut_item;
-#line 53 "mn-mailbox-view.gob"
+#line 52 "mn-mailbox-view.gob"
GtkWidget * copy_item;
-#line 54 "mn-mailbox-view.gob"
+#line 53 "mn-mailbox-view.gob"
GtkWidget * paste_item;
-#line 55 "mn-mailbox-view.gob"
+#line 54 "mn-mailbox-view.gob"
GtkWidget * properties_item;
#line 26 "mn-mailbox-view-private.h"
};
diff --git a/src/mn-mailbox-view.c b/src/mn-mailbox-view.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -33,7 +33,6 @@
#include "mn-stock.h"
#include "mn-mailbox-properties-dialog.h"
#include "mn-conf.h"
-#include "mn-dialog.h"
#include "mn-uri.h"
#define GNOME_COPIED_FILES "x-special/gnome-copied-files"
@@ -49,7 +48,7 @@
static GtkClipboard *global_clipboard;
static GdkAtom gnome_copied_files_atom;
-#line 53 "mn-mailbox-view.c"
+#line 52 "mn-mailbox-view.c"
/* self casting macros */
#define SELF(x) MN_MAILBOX_VIEW(x)
#define SELF_CONST(x) MN_MAILBOX_VIEW_CONST(x)
@@ -86,7 +85,8 @@ static void mn_mailbox_view_copy_mailbox_cb (GtkTreeModel * model, GtkTreePath *
static void mn_mailbox_view_get_clipboard_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, unsigned int info, gpointer user_data_or_owner) G_GNUC_UNUSED;
static void mn_mailbox_view_clear_clipboard_cb (GtkClipboard * clipboard, gpointer user_data_or_owner) G_GNUC_UNUSED;
static void mn_mailbox_view_select_all (MNMailboxView * self) G_GNUC_UNUSED;
-static void mn_mailbox_view_properties_response_h (GtkDialog * dialog, int response, gpointer user_data) G_GNUC_UNUSED;
+static void mn_mailbox_view_properties_add_response_h (GtkDialog * dialog, int response, gpointer user_data) G_GNUC_UNUSED;
+static void mn_mailbox_view_properties_edit_response_h (GtkDialog * dialog, int response, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailbox_view_popup_menu (MNMailboxView * self, unsigned int button, guint32 activate_time) G_GNUC_UNUSED;
static void mn_mailbox_view_popup_menu_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data) G_GNUC_UNUSED;
static gboolean mn_mailbox_view_popup_menu_h (GtkWidget * widget, gpointer user_data) G_GNUC_UNUSED;
@@ -150,7 +150,8 @@ static GtkTreeViewClass *parent_class = NULL;
#define self_get_clipboard_cb mn_mailbox_view_get_clipboard_cb
#define self_clear_clipboard_cb mn_mailbox_view_clear_clipboard_cb
#define self_select_all mn_mailbox_view_select_all
-#define self_properties_response_h mn_mailbox_view_properties_response_h
+#define self_properties_add_response_h mn_mailbox_view_properties_add_response_h
+#define self_properties_edit_response_h mn_mailbox_view_properties_edit_response_h
#define self_popup_menu mn_mailbox_view_popup_menu
#define self_popup_menu_receive_cb mn_mailbox_view_popup_menu_receive_cb
#define self_popup_menu_h mn_mailbox_view_popup_menu_h
@@ -206,20 +207,20 @@ ___finalize(GObject *obj_self)
#define __GOB_FUNCTION__ "MN:Mailbox:View::finalize"
MNMailboxView *self G_GNUC_UNUSED = MN_MAILBOX_VIEW (obj_self);
gpointer priv = self->_priv;
-#line 322 "mn-mailbox-view.gob"
+#line 293 "mn-mailbox-view.gob"
___b_mn_mailbox_view_finalize(obj_self);
-#line 212 "mn-mailbox-view.c"
-#line 50 "mn-mailbox-view.gob"
+#line 213 "mn-mailbox-view.c"
+#line 49 "mn-mailbox-view.gob"
if(self->_priv->menu) { ((*(void (*)(void *))gtk_widget_destroy)) (self->_priv->menu); self->_priv->menu = NULL; }
-#line 215 "mn-mailbox-view.c"
+#line 216 "mn-mailbox-view.c"
g_free (priv);
}
#undef __GOB_FUNCTION__
-#line 214 "mn-mailbox-view.gob"
+#line 185 "mn-mailbox-view.gob"
static void
mn_mailbox_view_class_init (MNMailboxViewClass * class G_GNUC_UNUSED)
-#line 223 "mn-mailbox-view.c"
+#line 224 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::class_init"
GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
@@ -275,23 +276,23 @@ mn_mailbox_view_class_init (MNMailboxViewClass * class G_GNUC_UNUSED)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-#line 57 "mn-mailbox-view.gob"
+#line 56 "mn-mailbox-view.gob"
class->activate_add = ___real_mn_mailbox_view_activate_add;
-#line 102 "mn-mailbox-view.gob"
+#line 73 "mn-mailbox-view.gob"
class->activate_remove = ___real_mn_mailbox_view_activate_remove;
-#line 108 "mn-mailbox-view.gob"
+#line 79 "mn-mailbox-view.gob"
class->activate_cut = ___real_mn_mailbox_view_activate_cut;
-#line 115 "mn-mailbox-view.gob"
+#line 86 "mn-mailbox-view.gob"
class->activate_copy = ___real_mn_mailbox_view_activate_copy;
-#line 121 "mn-mailbox-view.gob"
+#line 92 "mn-mailbox-view.gob"
class->activate_paste = ___real_mn_mailbox_view_activate_paste;
-#line 179 "mn-mailbox-view.gob"
+#line 150 "mn-mailbox-view.gob"
class->activate_properties = ___real_mn_mailbox_view_activate_properties;
-#line 322 "mn-mailbox-view.gob"
+#line 293 "mn-mailbox-view.gob"
g_object_class->finalize = ___finalize;
-#line 293 "mn-mailbox-view.c"
+#line 294 "mn-mailbox-view.c"
{
-#line 215 "mn-mailbox-view.gob"
+#line 186 "mn-mailbox-view.gob"
GtkBindingSet *binding_set;
@@ -319,22 +320,22 @@ mn_mailbox_view_class_init (MNMailboxViewClass * class G_GNUC_UNUSED)
gtk_binding_entry_add_signal(binding_set, GDK_ISO_Enter, GDK_MOD1_MASK, "activate-properties", 0);
gtk_binding_entry_add_signal(binding_set, GDK_KP_Enter, GDK_MOD1_MASK, "activate-properties", 0);
-#line 323 "mn-mailbox-view.c"
+#line 324 "mn-mailbox-view.c"
}
}
#undef __GOB_FUNCTION__
-#line 243 "mn-mailbox-view.gob"
+#line 214 "mn-mailbox-view.gob"
static void
mn_mailbox_view_init (MNMailboxView * self G_GNUC_UNUSED)
-#line 330 "mn-mailbox-view.c"
+#line 331 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::init"
self->_priv = g_new0 (MNMailboxViewPrivate, 1);
-#line 50 "mn-mailbox-view.gob"
+#line 49 "mn-mailbox-view.gob"
self->_priv->menu = gtk_menu_new();
-#line 336 "mn-mailbox-view.c"
+#line 337 "mn-mailbox-view.c"
{
-#line 244 "mn-mailbox-view.gob"
+#line 215 "mn-mailbox-view.gob"
GtkMenuShell *shell;
GtkWidget *add_item;
@@ -366,7 +367,7 @@ mn_mailbox_view_init (MNMailboxView * self G_GNUC_UNUSED)
g_signal_connect_swapped(G_OBJECT(selfp->properties_item), "activate", G_CALLBACK(self_activate_properties), self);
store = gtk_list_store_new(N_COLUMNS,
- G_TYPE_STRING,
+ MN_TYPE_URI,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING);
@@ -412,15 +413,15 @@ mn_mailbox_view_init (MNMailboxView * self G_GNUC_UNUSED)
g_signal_connect(G_OBJECT(self), "button-press-event", G_CALLBACK(self_button_press_event_h), NULL);
g_signal_connect(G_OBJECT(self), "row-activated", G_CALLBACK(self_row_activated_h), NULL);
-#line 416 "mn-mailbox-view.c"
+#line 417 "mn-mailbox-view.c"
}
}
#undef __GOB_FUNCTION__
-#line 57 "mn-mailbox-view.gob"
+#line 56 "mn-mailbox-view.gob"
void
mn_mailbox_view_activate_add (MNMailboxView * self)
-#line 424 "mn-mailbox-view.c"
+#line 425 "mn-mailbox-view.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -428,11 +429,11 @@ mn_mailbox_view_activate_add (MNMailboxView * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 57 "mn-mailbox-view.gob"
+#line 56 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 57 "mn-mailbox-view.gob"
+#line 56 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 436 "mn-mailbox-view.c"
+#line 437 "mn-mailbox-view.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -445,14 +446,14 @@ memset (&___param_values, 0, sizeof (___param_values));
g_value_unset (&___param_values[0]);
}
-#line 57 "mn-mailbox-view.gob"
+#line 56 "mn-mailbox-view.gob"
static void
___real_mn_mailbox_view_activate_add (MNMailboxView * self G_GNUC_UNUSED)
-#line 452 "mn-mailbox-view.c"
+#line 453 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_add"
{
-#line 59 "mn-mailbox-view.gob"
+#line 58 "mn-mailbox-view.gob"
GtkWidget *toplevel;
GtkWidget *dialog;
@@ -460,48 +461,20 @@ ___real_mn_mailbox_view_activate_add (MNMailboxView * self G_GNUC_UNUSED)
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(self));
dialog = mn_mailbox_properties_dialog_new((GtkWindow *) toplevel, MN_MAILBOX_PROPERTIES_DIALOG_MODE_ADD);
- run:
- switch (gtk_dialog_run(GTK_DIALOG(dialog)))
- {
- case GTK_RESPONSE_HELP:
- mn_display_help("mailbox-properties");
- goto run;
-
- case GTK_RESPONSE_ACCEPT:
- {
- char *uri;
-
- uri = mn_mailbox_properties_dialog_get_uri(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
- g_return_if_fail(uri != NULL);
-
- if (! mn_mailboxes_find(mn_shell->mailboxes, uri))
- {
- GSList *gconf_mailboxes;
-
- gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
- gconf_mailboxes = g_slist_append(gconf_mailboxes, uri);
- eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
- }
- else
- {
- mn_error_dialog(NULL, _("Unable to add mailbox"), _("The mailbox is already in the list."));
- g_free(uri);
- goto run;
- }
- }
- break;
- }
-
- gtk_widget_destroy(dialog);
+ g_signal_connect(G_OBJECT(dialog),
+ "response",
+ G_CALLBACK(self_properties_add_response_h),
+ NULL);
+
+ gtk_widget_show(dialog);
}}
-#line 499 "mn-mailbox-view.c"
+#line 472 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 102 "mn-mailbox-view.gob"
+#line 73 "mn-mailbox-view.gob"
void
mn_mailbox_view_activate_remove (MNMailboxView * self)
-#line 505 "mn-mailbox-view.c"
+#line 478 "mn-mailbox-view.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -509,11 +482,11 @@ mn_mailbox_view_activate_remove (MNMailboxView * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 102 "mn-mailbox-view.gob"
+#line 73 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 102 "mn-mailbox-view.gob"
+#line 73 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 517 "mn-mailbox-view.c"
+#line 490 "mn-mailbox-view.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -526,24 +499,24 @@ memset (&___param_values, 0, sizeof (___param_values));
g_value_unset (&___param_values[0]);
}
-#line 102 "mn-mailbox-view.gob"
+#line 73 "mn-mailbox-view.gob"
static void
___real_mn_mailbox_view_activate_remove (MNMailboxView * self G_GNUC_UNUSED)
-#line 533 "mn-mailbox-view.c"
+#line 506 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_remove"
{
-#line 104 "mn-mailbox-view.gob"
+#line 75 "mn-mailbox-view.gob"
self_remove_mailbox(self);
}}
-#line 541 "mn-mailbox-view.c"
+#line 514 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 108 "mn-mailbox-view.gob"
+#line 79 "mn-mailbox-view.gob"
void
mn_mailbox_view_activate_cut (MNMailboxView * self)
-#line 547 "mn-mailbox-view.c"
+#line 520 "mn-mailbox-view.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -551,11 +524,11 @@ mn_mailbox_view_activate_cut (MNMailboxView * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 108 "mn-mailbox-view.gob"
+#line 79 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 108 "mn-mailbox-view.gob"
+#line 79 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 559 "mn-mailbox-view.c"
+#line 532 "mn-mailbox-view.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -568,25 +541,25 @@ memset (&___param_values, 0, sizeof (___param_values));
g_value_unset (&___param_values[0]);
}
-#line 108 "mn-mailbox-view.gob"
+#line 79 "mn-mailbox-view.gob"
static void
___real_mn_mailbox_view_activate_cut (MNMailboxView * self G_GNUC_UNUSED)
-#line 575 "mn-mailbox-view.c"
+#line 548 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_cut"
{
-#line 110 "mn-mailbox-view.gob"
+#line 81 "mn-mailbox-view.gob"
self_copy_mailbox(self);
self_remove_mailbox(self);
}}
-#line 584 "mn-mailbox-view.c"
+#line 557 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 115 "mn-mailbox-view.gob"
+#line 86 "mn-mailbox-view.gob"
void
mn_mailbox_view_activate_copy (MNMailboxView * self)
-#line 590 "mn-mailbox-view.c"
+#line 563 "mn-mailbox-view.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -594,11 +567,11 @@ mn_mailbox_view_activate_copy (MNMailboxView * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 115 "mn-mailbox-view.gob"
+#line 86 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 115 "mn-mailbox-view.gob"
+#line 86 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 602 "mn-mailbox-view.c"
+#line 575 "mn-mailbox-view.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -611,24 +584,24 @@ memset (&___param_values, 0, sizeof (___param_values));
g_value_unset (&___param_values[0]);
}
-#line 115 "mn-mailbox-view.gob"
+#line 86 "mn-mailbox-view.gob"
static void
___real_mn_mailbox_view_activate_copy (MNMailboxView * self G_GNUC_UNUSED)
-#line 618 "mn-mailbox-view.c"
+#line 591 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_copy"
{
-#line 117 "mn-mailbox-view.gob"
+#line 88 "mn-mailbox-view.gob"
self_copy_mailbox(self);
}}
-#line 626 "mn-mailbox-view.c"
+#line 599 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 121 "mn-mailbox-view.gob"
+#line 92 "mn-mailbox-view.gob"
void
mn_mailbox_view_activate_paste (MNMailboxView * self)
-#line 632 "mn-mailbox-view.c"
+#line 605 "mn-mailbox-view.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -636,11 +609,11 @@ mn_mailbox_view_activate_paste (MNMailboxView * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 121 "mn-mailbox-view.gob"
+#line 92 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 121 "mn-mailbox-view.gob"
+#line 92 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 644 "mn-mailbox-view.c"
+#line 617 "mn-mailbox-view.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -653,36 +626,36 @@ memset (&___param_values, 0, sizeof (___param_values));
g_value_unset (&___param_values[0]);
}
-#line 121 "mn-mailbox-view.gob"
+#line 92 "mn-mailbox-view.gob"
static void
___real_mn_mailbox_view_activate_paste (MNMailboxView * self G_GNUC_UNUSED)
-#line 660 "mn-mailbox-view.c"
+#line 633 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_paste"
{
-#line 123 "mn-mailbox-view.gob"
+#line 94 "mn-mailbox-view.gob"
gtk_clipboard_request_contents(global_clipboard,
gnome_copied_files_atom,
self_activate_paste_receive_cb,
NULL);
}}
-#line 671 "mn-mailbox-view.c"
+#line 644 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 130 "mn-mailbox-view.gob"
+#line 101 "mn-mailbox-view.gob"
static void
mn_mailbox_view_activate_paste_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data)
-#line 677 "mn-mailbox-view.c"
+#line 650 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_paste_receive_cb"
-#line 130 "mn-mailbox-view.gob"
+#line 101 "mn-mailbox-view.gob"
g_return_if_fail (clipboard != NULL);
-#line 130 "mn-mailbox-view.gob"
+#line 101 "mn-mailbox-view.gob"
g_return_if_fail (selection_data != NULL);
-#line 684 "mn-mailbox-view.c"
+#line 657 "mn-mailbox-view.c"
{
-#line 134 "mn-mailbox-view.gob"
+#line 105 "mn-mailbox-view.gob"
if (selection_data->type == gnome_copied_files_atom
&& selection_data->format == 8
@@ -719,21 +692,21 @@ mn_mailbox_view_activate_paste_receive_cb (GtkClipboard * clipboard, GtkSelectio
gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
gconf_mailboxes = g_slist_concat(gconf_mailboxes, new_mailboxes);
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
}
}
- mn_pointers_free(uri_list);
+ eel_g_slist_free_deep(uri_list);
}
}
}}
-#line 731 "mn-mailbox-view.c"
+#line 704 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 179 "mn-mailbox-view.gob"
+#line 150 "mn-mailbox-view.gob"
void
mn_mailbox_view_activate_properties (MNMailboxView * self)
-#line 737 "mn-mailbox-view.c"
+#line 710 "mn-mailbox-view.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -741,11 +714,11 @@ mn_mailbox_view_activate_properties (MNMailboxView * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 179 "mn-mailbox-view.gob"
+#line 150 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 179 "mn-mailbox-view.gob"
+#line 150 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 749 "mn-mailbox-view.c"
+#line 722 "mn-mailbox-view.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -758,109 +731,108 @@ memset (&___param_values, 0, sizeof (___param_values));
g_value_unset (&___param_values[0]);
}
-#line 179 "mn-mailbox-view.gob"
+#line 150 "mn-mailbox-view.gob"
static void
___real_mn_mailbox_view_activate_properties (MNMailboxView * self G_GNUC_UNUSED)
-#line 765 "mn-mailbox-view.c"
+#line 738 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_properties"
{
-#line 181 "mn-mailbox-view.gob"
+#line 152 "mn-mailbox-view.gob"
GtkTreeSelection *selection;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
gtk_tree_selection_selected_foreach(selection, self_activate_properties_cb, self);
}}
-#line 776 "mn-mailbox-view.c"
+#line 749 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 188 "mn-mailbox-view.gob"
+#line 159 "mn-mailbox-view.gob"
static void
mn_mailbox_view_activate_properties_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
-#line 782 "mn-mailbox-view.c"
+#line 755 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_properties_cb"
-#line 188 "mn-mailbox-view.gob"
+#line 159 "mn-mailbox-view.gob"
g_return_if_fail (model != NULL);
-#line 188 "mn-mailbox-view.gob"
+#line 159 "mn-mailbox-view.gob"
g_return_if_fail (GTK_IS_TREE_MODEL (model));
-#line 188 "mn-mailbox-view.gob"
+#line 159 "mn-mailbox-view.gob"
g_return_if_fail (path != NULL);
-#line 188 "mn-mailbox-view.gob"
+#line 159 "mn-mailbox-view.gob"
g_return_if_fail (iter != NULL);
-#line 188 "mn-mailbox-view.gob"
+#line 159 "mn-mailbox-view.gob"
g_return_if_fail (data != NULL);
-#line 795 "mn-mailbox-view.c"
+#line 768 "mn-mailbox-view.c"
{
-#line 193 "mn-mailbox-view.gob"
+#line 164 "mn-mailbox-view.gob"
Self *self = data;
GtkWidget *toplevel;
GtkWidget *dialog;
- char *uri;
+ MNURI *uri;
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(self));
dialog = mn_mailbox_properties_dialog_new((GtkWindow *) toplevel, MN_MAILBOX_PROPERTIES_DIALOG_MODE_EDIT);
gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);
mn_mailbox_properties_dialog_set_uri(MN_MAILBOX_PROPERTIES_DIALOG(dialog), uri);
- g_free(uri);
+ g_object_unref(uri);
g_signal_connect(G_OBJECT(dialog),
"response",
- G_CALLBACK(self_properties_response_h),
+ G_CALLBACK(self_properties_edit_response_h),
NULL);
gtk_widget_show(dialog);
}}
-#line 818 "mn-mailbox-view.c"
+#line 791 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 322 "mn-mailbox-view.gob"
+#line 293 "mn-mailbox-view.gob"
static void
___b_mn_mailbox_view_finalize (GObject * object G_GNUC_UNUSED)
-#line 826 "mn-mailbox-view.c"
+#line 799 "mn-mailbox-view.c"
#define PARENT_HANDLER(___object) \
{ if(G_OBJECT_CLASS(parent_class)->finalize) \
(* G_OBJECT_CLASS(parent_class)->finalize)(___object); }
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::finalize"
-#line 322 "mn-mailbox-view.gob"
+#line 293 "mn-mailbox-view.gob"
g_return_if_fail (object != NULL);
-#line 322 "mn-mailbox-view.gob"
+#line 293 "mn-mailbox-view.gob"
g_return_if_fail (G_IS_OBJECT (object));
-#line 836 "mn-mailbox-view.c"
+#line 809 "mn-mailbox-view.c"
{
-#line 324 "mn-mailbox-view.gob"
+#line 295 "mn-mailbox-view.gob"
g_signal_handlers_disconnect_by_func(mn_shell->mailboxes, self_update, object);
PARENT_HANDLER(object);
}}
-#line 843 "mn-mailbox-view.c"
+#line 816 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 329 "mn-mailbox-view.gob"
+#line 300 "mn-mailbox-view.gob"
static void
mn_mailbox_view_update (MNMailboxView * self)
-#line 850 "mn-mailbox-view.c"
+#line 823 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::update"
-#line 329 "mn-mailbox-view.gob"
+#line 300 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 329 "mn-mailbox-view.gob"
+#line 300 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 857 "mn-mailbox-view.c"
+#line 830 "mn-mailbox-view.c"
{
-#line 331 "mn-mailbox-view.gob"
+#line 302 "mn-mailbox-view.gob"
GtkTreeModel *model;
GtkTreeIter iter;
gboolean valid;
- MNMailbox *mailbox;
GSList *l;
model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
@@ -870,15 +842,16 @@ mn_mailbox_view_update (MNMailboxView * self)
valid = gtk_tree_model_get_iter_first(model, &iter);
while (valid)
{
- char *uri;
+ MNURI *uri;
+ GSList *elem;
gtk_tree_model_get(model, &iter, COLUMN_URI, &uri, -1);
- mailbox = mn_mailboxes_find(mn_shell->mailboxes, uri);
- g_free(uri);
+ elem = mn_mailboxes_find_uri(mn_shell->mailboxes, uri);
+ g_object_unref(uri);
- if (mailbox)
+ if (elem)
{
- self_update_iter(self, &iter, mailbox);
+ self_update_iter(self, &iter, elem->data);
valid = gtk_tree_model_iter_next(model, &iter);
}
else
@@ -889,7 +862,7 @@ mn_mailbox_view_update (MNMailboxView * self)
MN_LIST_FOREACH(l, mn_mailboxes_get(mn_shell->mailboxes))
{
- mailbox = l->data;
+ MNMailbox *mailbox = l->data;
if (! self_has_mailbox(self, mailbox))
{
@@ -898,95 +871,88 @@ mn_mailbox_view_update (MNMailboxView * self)
}
}
}}
-#line 902 "mn-mailbox-view.c"
+#line 875 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 374 "mn-mailbox-view.gob"
+#line 345 "mn-mailbox-view.gob"
static void
mn_mailbox_view_update_iter (MNMailboxView * self, GtkTreeIter * iter, MNMailbox * mailbox)
-#line 908 "mn-mailbox-view.c"
+#line 881 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::update_iter"
-#line 374 "mn-mailbox-view.gob"
+#line 345 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 374 "mn-mailbox-view.gob"
+#line 345 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 374 "mn-mailbox-view.gob"
+#line 345 "mn-mailbox-view.gob"
g_return_if_fail (iter != NULL);
-#line 374 "mn-mailbox-view.gob"
+#line 345 "mn-mailbox-view.gob"
g_return_if_fail (mailbox != NULL);
-#line 374 "mn-mailbox-view.gob"
+#line 345 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX (mailbox));
-#line 921 "mn-mailbox-view.c"
+#line 894 "mn-mailbox-view.c"
{
-#line 378 "mn-mailbox-view.gob"
+#line 349 "mn-mailbox-view.gob"
MNMailboxClass *class;
- const char *uri;
- const char *system_uri;
const char *stock_id;
GtkTreeModel *model;
class = MN_MAILBOX_GET_CLASS(mailbox);
- uri = mn_mailbox_get_uri(mailbox);
- system_uri = mn_uri_get_system_mailbox();
- if (system_uri && ! mn_uri_cmp(uri, system_uri))
+ if (MN_URI_IS_SYSTEM_MAILBOX(mailbox->uri))
stock_id = MN_STOCK_SYSTEM_MAILBOX;
else
{
if (class->stock_id)
stock_id = class->stock_id;
else
- stock_id = mn_uri_is_local(uri) ? MN_STOCK_LOCAL : MN_STOCK_REMOTE;
+ stock_id = MN_URI_IS_LOCAL(mailbox->uri) ? MN_STOCK_LOCAL : MN_STOCK_REMOTE;
}
model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- COLUMN_URI, uri,
+ COLUMN_URI, mailbox->uri,
COLUMN_MAILBOX_ICON, stock_id,
COLUMN_MAILBOX, mn_mailbox_get_name(mailbox),
COLUMN_FORMAT, class->format,
-1);
}}
-#line 953 "mn-mailbox-view.c"
+#line 922 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 408 "mn-mailbox-view.gob"
+#line 375 "mn-mailbox-view.gob"
static gboolean
mn_mailbox_view_has_mailbox (MNMailboxView * self, MNMailbox * mailbox)
-#line 959 "mn-mailbox-view.c"
+#line 928 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::has_mailbox"
-#line 408 "mn-mailbox-view.gob"
+#line 375 "mn-mailbox-view.gob"
g_return_val_if_fail (self != NULL, (gboolean )0);
-#line 408 "mn-mailbox-view.gob"
+#line 375 "mn-mailbox-view.gob"
g_return_val_if_fail (MN_IS_MAILBOX_VIEW (self), (gboolean )0);
-#line 408 "mn-mailbox-view.gob"
+#line 375 "mn-mailbox-view.gob"
g_return_val_if_fail (mailbox != NULL, (gboolean )0);
-#line 408 "mn-mailbox-view.gob"
+#line 375 "mn-mailbox-view.gob"
g_return_val_if_fail (MN_IS_MAILBOX (mailbox), (gboolean )0);
-#line 970 "mn-mailbox-view.c"
+#line 939 "mn-mailbox-view.c"
{
-#line 410 "mn-mailbox-view.gob"
+#line 377 "mn-mailbox-view.gob"
- const char *uri;
GtkTreeModel *model;
GtkTreeIter iter;
gboolean valid;
gboolean has = FALSE;
- uri = mn_mailbox_get_uri(mailbox);
-
model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
valid = gtk_tree_model_get_iter_first(model, &iter);
while (valid)
{
- char *this_uri;
+ MNURI *uri;
- gtk_tree_model_get(model, &iter, COLUMN_URI, &this_uri, -1);
- has = ! mn_uri_cmp(this_uri, uri);
- g_free(this_uri);
+ gtk_tree_model_get(model, &iter, COLUMN_URI, &uri, -1);
+ has = ! strcmp(uri->text, mailbox->uri->text);
+ g_object_unref(uri);
if (has)
break;
@@ -996,22 +962,22 @@ mn_mailbox_view_has_mailbox (MNMailboxView * self, MNMailbox * mailbox)
return has;
}}
-#line 1000 "mn-mailbox-view.c"
+#line 966 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 438 "mn-mailbox-view.gob"
+#line 402 "mn-mailbox-view.gob"
static void
mn_mailbox_view_update_sensitivity (MNMailboxView * self)
-#line 1006 "mn-mailbox-view.c"
+#line 972 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::update_sensitivity"
-#line 438 "mn-mailbox-view.gob"
+#line 402 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 438 "mn-mailbox-view.gob"
+#line 402 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 1013 "mn-mailbox-view.c"
+#line 979 "mn-mailbox-view.c"
{
-#line 440 "mn-mailbox-view.gob"
+#line 404 "mn-mailbox-view.gob"
GtkTreeSelection *selection;
gboolean has_selection;
@@ -1024,22 +990,22 @@ mn_mailbox_view_update_sensitivity (MNMailboxView * self)
gtk_widget_set_sensitive(selfp->copy_item, has_selection);
gtk_widget_set_sensitive(selfp->properties_item, has_selection);
}}
-#line 1028 "mn-mailbox-view.c"
+#line 994 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 453 "mn-mailbox-view.gob"
+#line 417 "mn-mailbox-view.gob"
static void
mn_mailbox_view_remove_mailbox (MNMailboxView * self)
-#line 1034 "mn-mailbox-view.c"
+#line 1000 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::remove_mailbox"
-#line 453 "mn-mailbox-view.gob"
+#line 417 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 453 "mn-mailbox-view.gob"
+#line 417 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 1041 "mn-mailbox-view.c"
+#line 1007 "mn-mailbox-view.c"
{
-#line 455 "mn-mailbox-view.gob"
+#line 419 "mn-mailbox-view.gob"
GtkTreeSelection *selection;
GSList *gconf_mailboxes;
@@ -1049,63 +1015,59 @@ mn_mailbox_view_remove_mailbox (MNMailboxView * self)
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
gtk_tree_selection_selected_foreach(selection, self_remove_mailbox_cb, &gconf_mailboxes);
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
}}
-#line 1055 "mn-mailbox-view.c"
+#line 1021 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 467 "mn-mailbox-view.gob"
+#line 431 "mn-mailbox-view.gob"
static void
mn_mailbox_view_remove_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
-#line 1061 "mn-mailbox-view.c"
+#line 1027 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::remove_mailbox_cb"
-#line 467 "mn-mailbox-view.gob"
+#line 431 "mn-mailbox-view.gob"
g_return_if_fail (model != NULL);
-#line 467 "mn-mailbox-view.gob"
+#line 431 "mn-mailbox-view.gob"
g_return_if_fail (GTK_IS_TREE_MODEL (model));
-#line 467 "mn-mailbox-view.gob"
+#line 431 "mn-mailbox-view.gob"
g_return_if_fail (path != NULL);
-#line 467 "mn-mailbox-view.gob"
+#line 431 "mn-mailbox-view.gob"
g_return_if_fail (iter != NULL);
-#line 467 "mn-mailbox-view.gob"
+#line 431 "mn-mailbox-view.gob"
g_return_if_fail (data != NULL);
-#line 1074 "mn-mailbox-view.c"
+#line 1040 "mn-mailbox-view.c"
{
-#line 472 "mn-mailbox-view.gob"
+#line 436 "mn-mailbox-view.gob"
GSList **gconf_mailboxes = data;
- char *uri;
+ MNURI *uri;
GSList *elem;
gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);
/* remove all the mailboxes with that URI */
- while ((elem = g_slist_find_custom(*gconf_mailboxes, uri, (GCompareFunc) mn_uri_cmp)))
- {
- *gconf_mailboxes = g_slist_remove_link(*gconf_mailboxes, elem);
- g_free(elem->data);
- g_slist_free(elem);
- }
+ while ((elem = mn_mailboxes_conf_find_uri(*gconf_mailboxes, uri)))
+ *gconf_mailboxes = mn_g_slist_delete_link_deep(*gconf_mailboxes, elem);
- g_free(uri);
+ g_object_unref(uri);
}}
-#line 1094 "mn-mailbox-view.c"
+#line 1056 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 490 "mn-mailbox-view.gob"
+#line 450 "mn-mailbox-view.gob"
static void
mn_mailbox_view_copy_mailbox (MNMailboxView * self)
-#line 1100 "mn-mailbox-view.c"
+#line 1062 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::copy_mailbox"
-#line 490 "mn-mailbox-view.gob"
+#line 450 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 490 "mn-mailbox-view.gob"
+#line 450 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 1107 "mn-mailbox-view.c"
+#line 1069 "mn-mailbox-view.c"
{
-#line 492 "mn-mailbox-view.gob"
+#line 452 "mn-mailbox-view.gob"
GtkTreeSelection *selection;
GSList *uri_list = NULL;
@@ -1117,7 +1079,7 @@ mn_mailbox_view_copy_mailbox (MNMailboxView * self)
gtk_tree_selection_selected_foreach(selection, self_copy_mailbox_cb, &uri_list);
gnome_copied_files = mn_build_gnome_copied_files(MN_GNOME_COPIED_FILES_COPY, uri_list);
- mn_pointers_free(uri_list);
+ eel_g_slist_free_deep(uri_list);
status = gtk_clipboard_set_with_data(global_clipboard,
&target,
@@ -1127,116 +1089,161 @@ mn_mailbox_view_copy_mailbox (MNMailboxView * self)
gnome_copied_files);
g_return_if_fail(status == TRUE);
}}
-#line 1131 "mn-mailbox-view.c"
+#line 1093 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 514 "mn-mailbox-view.gob"
+#line 474 "mn-mailbox-view.gob"
static void
mn_mailbox_view_copy_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
-#line 1137 "mn-mailbox-view.c"
+#line 1099 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::copy_mailbox_cb"
-#line 514 "mn-mailbox-view.gob"
+#line 474 "mn-mailbox-view.gob"
g_return_if_fail (model != NULL);
-#line 514 "mn-mailbox-view.gob"
+#line 474 "mn-mailbox-view.gob"
g_return_if_fail (GTK_IS_TREE_MODEL (model));
-#line 514 "mn-mailbox-view.gob"
+#line 474 "mn-mailbox-view.gob"
g_return_if_fail (path != NULL);
-#line 514 "mn-mailbox-view.gob"
+#line 474 "mn-mailbox-view.gob"
g_return_if_fail (iter != NULL);
-#line 514 "mn-mailbox-view.gob"
+#line 474 "mn-mailbox-view.gob"
g_return_if_fail (data != NULL);
-#line 1150 "mn-mailbox-view.c"
+#line 1112 "mn-mailbox-view.c"
{
-#line 519 "mn-mailbox-view.gob"
+#line 479 "mn-mailbox-view.gob"
GSList **uri_list = data;
- char *uri;
+ MNURI *uri;
gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);
- *uri_list = g_slist_append(*uri_list, uri);
- /* uri is now owned by uri_list, do not free */
+ *uri_list = g_slist_append(*uri_list, g_strdup(uri->text));
+ g_object_unref(uri);
}}
-#line 1161 "mn-mailbox-view.c"
+#line 1123 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 528 "mn-mailbox-view.gob"
+#line 488 "mn-mailbox-view.gob"
static void
mn_mailbox_view_get_clipboard_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, unsigned int info, gpointer user_data_or_owner)
-#line 1167 "mn-mailbox-view.c"
+#line 1129 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::get_clipboard_cb"
-#line 528 "mn-mailbox-view.gob"
+#line 488 "mn-mailbox-view.gob"
g_return_if_fail (clipboard != NULL);
-#line 528 "mn-mailbox-view.gob"
+#line 488 "mn-mailbox-view.gob"
g_return_if_fail (selection_data != NULL);
-#line 528 "mn-mailbox-view.gob"
+#line 488 "mn-mailbox-view.gob"
g_return_if_fail (user_data_or_owner != NULL);
-#line 1176 "mn-mailbox-view.c"
+#line 1138 "mn-mailbox-view.c"
{
-#line 533 "mn-mailbox-view.gob"
+#line 493 "mn-mailbox-view.gob"
const char *gnome_copied_files = user_data_or_owner;
gtk_selection_data_set(selection_data, gnome_copied_files_atom, 8, gnome_copied_files, strlen(gnome_copied_files));
}}
-#line 1183 "mn-mailbox-view.c"
+#line 1145 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 538 "mn-mailbox-view.gob"
+#line 498 "mn-mailbox-view.gob"
static void
mn_mailbox_view_clear_clipboard_cb (GtkClipboard * clipboard, gpointer user_data_or_owner)
-#line 1189 "mn-mailbox-view.c"
+#line 1151 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::clear_clipboard_cb"
-#line 538 "mn-mailbox-view.gob"
+#line 498 "mn-mailbox-view.gob"
g_return_if_fail (clipboard != NULL);
-#line 538 "mn-mailbox-view.gob"
+#line 498 "mn-mailbox-view.gob"
g_return_if_fail (user_data_or_owner != NULL);
-#line 1196 "mn-mailbox-view.c"
+#line 1158 "mn-mailbox-view.c"
{
-#line 541 "mn-mailbox-view.gob"
+#line 501 "mn-mailbox-view.gob"
char *gnome_copied_files = user_data_or_owner;
g_free(gnome_copied_files);
}}
-#line 1203 "mn-mailbox-view.c"
+#line 1165 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 546 "mn-mailbox-view.gob"
+#line 506 "mn-mailbox-view.gob"
static void
mn_mailbox_view_select_all (MNMailboxView * self)
-#line 1209 "mn-mailbox-view.c"
+#line 1171 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::select_all"
-#line 546 "mn-mailbox-view.gob"
+#line 506 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 546 "mn-mailbox-view.gob"
+#line 506 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 1216 "mn-mailbox-view.c"
+#line 1178 "mn-mailbox-view.c"
{
-#line 548 "mn-mailbox-view.gob"
+#line 508 "mn-mailbox-view.gob"
GtkTreeSelection *selection;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
gtk_tree_selection_select_all(selection);
}}
-#line 1225 "mn-mailbox-view.c"
+#line 1187 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 555 "mn-mailbox-view.gob"
+#line 515 "mn-mailbox-view.gob"
static void
-mn_mailbox_view_properties_response_h (GtkDialog * dialog, int response, gpointer user_data)
-#line 1231 "mn-mailbox-view.c"
+mn_mailbox_view_properties_add_response_h (GtkDialog * dialog, int response, gpointer user_data)
+#line 1193 "mn-mailbox-view.c"
{
-#define __GOB_FUNCTION__ "MN:Mailbox:View::properties_response_h"
-#line 555 "mn-mailbox-view.gob"
+#define __GOB_FUNCTION__ "MN:Mailbox:View::properties_add_response_h"
+#line 515 "mn-mailbox-view.gob"
g_return_if_fail (dialog != NULL);
-#line 555 "mn-mailbox-view.gob"
+#line 515 "mn-mailbox-view.gob"
g_return_if_fail (GTK_IS_DIALOG (dialog));
+#line 1200 "mn-mailbox-view.c"
+{
+#line 519 "mn-mailbox-view.gob"
+
+ if (response == GTK_RESPONSE_HELP)
+ mn_display_help("mailbox-properties");
+ else if (response == GTK_RESPONSE_CANCEL)
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ else if (response == GTK_RESPONSE_ACCEPT)
+ {
+ MNURI *uri;
+
+ uri = mn_mailbox_properties_dialog_get_uri(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
+ g_return_if_fail(MN_IS_URI(uri));
+
+ if (! mn_mailboxes_find_uri(mn_shell->mailboxes, uri))
+ {
+ GSList *gconf_mailboxes;
+
+ gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
+ gconf_mailboxes = g_slist_append(gconf_mailboxes, g_strdup(uri->text));
+ eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
+
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ }
+ else
+ mn_error_dialog(NULL, _("Unable to add mailbox"), _("The mailbox is already in the list."));
+
+ g_object_unref(uri);
+ }
+ }}
+#line 1232 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 549 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_properties_edit_response_h (GtkDialog * dialog, int response, gpointer user_data)
#line 1238 "mn-mailbox-view.c"
{
-#line 559 "mn-mailbox-view.gob"
+#define __GOB_FUNCTION__ "MN:Mailbox:View::properties_edit_response_h"
+#line 549 "mn-mailbox-view.gob"
+ g_return_if_fail (dialog != NULL);
+#line 549 "mn-mailbox-view.gob"
+ g_return_if_fail (GTK_IS_DIALOG (dialog));
+#line 1245 "mn-mailbox-view.c"
+{
+#line 553 "mn-mailbox-view.gob"
if (response == GTK_RESPONSE_HELP)
mn_display_help("mailbox-properties");
@@ -1248,22 +1255,22 @@ mn_mailbox_view_properties_response_h (GtkDialog * dialog, int response, gpointe
gtk_widget_destroy(GTK_WIDGET(dialog));
}
}}
-#line 1252 "mn-mailbox-view.c"
+#line 1259 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 571 "mn-mailbox-view.gob"
+#line 565 "mn-mailbox-view.gob"
static void
mn_mailbox_view_popup_menu (MNMailboxView * self, unsigned int button, guint32 activate_time)
-#line 1258 "mn-mailbox-view.c"
+#line 1265 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu"
-#line 571 "mn-mailbox-view.gob"
+#line 565 "mn-mailbox-view.gob"
g_return_if_fail (self != NULL);
-#line 571 "mn-mailbox-view.gob"
+#line 565 "mn-mailbox-view.gob"
g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
-#line 1265 "mn-mailbox-view.c"
+#line 1272 "mn-mailbox-view.c"
{
-#line 573 "mn-mailbox-view.gob"
+#line 567 "mn-mailbox-view.gob"
gtk_clipboard_request_contents(global_clipboard,
gnome_copied_files_atom,
@@ -1271,24 +1278,24 @@ mn_mailbox_view_popup_menu (MNMailboxView * self, unsigned int button, guint32 a
self);
gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, button, activate_time);
}}
-#line 1275 "mn-mailbox-view.c"
+#line 1282 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 581 "mn-mailbox-view.gob"
+#line 575 "mn-mailbox-view.gob"
static void
mn_mailbox_view_popup_menu_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data)
-#line 1281 "mn-mailbox-view.c"
+#line 1288 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu_receive_cb"
-#line 581 "mn-mailbox-view.gob"
+#line 575 "mn-mailbox-view.gob"
g_return_if_fail (clipboard != NULL);
-#line 581 "mn-mailbox-view.gob"
+#line 575 "mn-mailbox-view.gob"
g_return_if_fail (selection_data != NULL);
-#line 581 "mn-mailbox-view.gob"
+#line 575 "mn-mailbox-view.gob"
g_return_if_fail (data != NULL);
-#line 1290 "mn-mailbox-view.c"
+#line 1297 "mn-mailbox-view.c"
{
-#line 585 "mn-mailbox-view.gob"
+#line 579 "mn-mailbox-view.gob"
Self *self = data;
gboolean can_paste = FALSE;
@@ -1310,94 +1317,95 @@ mn_mailbox_view_popup_menu_receive_cb (GtkClipboard * clipboard, GtkSelectionDat
{
if (type == MN_GNOME_COPIED_FILES_COPY && uri_list)
can_paste = TRUE;
- mn_pointers_free(uri_list);
+ eel_g_slist_free_deep(uri_list);
}
}
gtk_widget_set_sensitive(selfp->paste_item, can_paste);
}}
-#line 1320 "mn-mailbox-view.c"
+#line 1327 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 613 "mn-mailbox-view.gob"
+#line 607 "mn-mailbox-view.gob"
static gboolean
mn_mailbox_view_popup_menu_h (GtkWidget * widget, gpointer user_data)
-#line 1326 "mn-mailbox-view.c"
+#line 1333 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu_h"
-#line 613 "mn-mailbox-view.gob"
+#line 607 "mn-mailbox-view.gob"
g_return_val_if_fail (widget != NULL, (gboolean )0);
-#line 613 "mn-mailbox-view.gob"
+#line 607 "mn-mailbox-view.gob"
g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
-#line 1333 "mn-mailbox-view.c"
+#line 1340 "mn-mailbox-view.c"
{
-#line 616 "mn-mailbox-view.gob"
+#line 610 "mn-mailbox-view.gob"
self_popup_menu(SELF(widget), 0, gtk_get_current_event_time());
return TRUE; /* a menu was activated */
}}
-#line 1340 "mn-mailbox-view.c"
+#line 1347 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 621 "mn-mailbox-view.gob"
+#line 615 "mn-mailbox-view.gob"
static gboolean
mn_mailbox_view_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
-#line 1346 "mn-mailbox-view.c"
+#line 1353 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::button_press_event_h"
-#line 621 "mn-mailbox-view.gob"
+#line 615 "mn-mailbox-view.gob"
g_return_val_if_fail (widget != NULL, (gboolean )0);
-#line 621 "mn-mailbox-view.gob"
+#line 615 "mn-mailbox-view.gob"
g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
-#line 621 "mn-mailbox-view.gob"
+#line 615 "mn-mailbox-view.gob"
g_return_val_if_fail (event != NULL, (gboolean )0);
-#line 1355 "mn-mailbox-view.c"
+#line 1362 "mn-mailbox-view.c"
{
-#line 625 "mn-mailbox-view.gob"
+#line 619 "mn-mailbox-view.gob"
if (event->button == 3)
self_popup_menu(SELF(widget), event->button, event->time);
return FALSE; /* propagate event */
}}
-#line 1364 "mn-mailbox-view.c"
+#line 1371 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 632 "mn-mailbox-view.gob"
+#line 626 "mn-mailbox-view.gob"
static void
mn_mailbox_view_row_activated_h (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * column, gpointer user_data)
-#line 1370 "mn-mailbox-view.c"
+#line 1377 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::row_activated_h"
-#line 632 "mn-mailbox-view.gob"
+#line 626 "mn-mailbox-view.gob"
g_return_if_fail (treeview != NULL);
-#line 632 "mn-mailbox-view.gob"
+#line 626 "mn-mailbox-view.gob"
g_return_if_fail (GTK_IS_TREE_VIEW (treeview));
-#line 632 "mn-mailbox-view.gob"
+#line 626 "mn-mailbox-view.gob"
g_return_if_fail (path != NULL);
-#line 632 "mn-mailbox-view.gob"
+#line 626 "mn-mailbox-view.gob"
g_return_if_fail (column != NULL);
-#line 632 "mn-mailbox-view.gob"
+#line 626 "mn-mailbox-view.gob"
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
-#line 1383 "mn-mailbox-view.c"
+#line 1390 "mn-mailbox-view.c"
{
-#line 637 "mn-mailbox-view.gob"
+#line 631 "mn-mailbox-view.gob"
self_activate_properties(SELF(treeview));
}}
-#line 1389 "mn-mailbox-view.c"
+#line 1396 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
-#line 641 "mn-mailbox-view.gob"
+#line 635 "mn-mailbox-view.gob"
GtkWidget *
mn_mailbox_view_new (void)
-#line 1395 "mn-mailbox-view.c"
+#line 1402 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::new"
{
-#line 643 "mn-mailbox-view.gob"
+#line 637 "mn-mailbox-view.gob"
+ g_return_val_if_fail(mn_shell != NULL, NULL);
return GTK_WIDGET(GET_NEW);
}}
-#line 1403 "mn-mailbox-view.c"
+#line 1411 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-mailbox-view.gob b/src/mn-mailbox-view.gob
@@ -28,7 +28,6 @@
#include "mn-stock.h"
#include "mn-mailbox-properties-dialog.h"
#include "mn-conf.h"
-#include "mn-dialog.h"
#include "mn-uri.h"
#define GNOME_COPIED_FILES "x-special/gnome-copied-files"
@@ -63,40 +62,12 @@ class MN:Mailbox:View from Gtk:Tree:View
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(self));
dialog = mn_mailbox_properties_dialog_new((GtkWindow *) toplevel, MN_MAILBOX_PROPERTIES_DIALOG_MODE_ADD);
- run:
- switch (gtk_dialog_run(GTK_DIALOG(dialog)))
- {
- case GTK_RESPONSE_HELP:
- mn_display_help("mailbox-properties");
- goto run;
-
- case GTK_RESPONSE_ACCEPT:
- {
- char *uri;
-
- uri = mn_mailbox_properties_dialog_get_uri(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
- g_return_if_fail(uri != NULL);
-
- if (! mn_mailboxes_find(mn_shell->mailboxes, uri))
- {
- GSList *gconf_mailboxes;
-
- gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
- gconf_mailboxes = g_slist_append(gconf_mailboxes, uri);
- eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
- }
- else
- {
- mn_error_dialog(NULL, _("Unable to add mailbox"), _("The mailbox is already in the list."));
- g_free(uri);
- goto run;
- }
- }
- break;
- }
-
- gtk_widget_destroy(dialog);
+ g_signal_connect(G_OBJECT(dialog),
+ "response",
+ G_CALLBACK(self_properties_add_response_h),
+ NULL);
+
+ gtk_widget_show(dialog);
}
signal (ACTION) public NONE (NONE)
@@ -167,11 +138,11 @@ class MN:Mailbox:View from Gtk:Tree:View
gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
gconf_mailboxes = g_slist_concat(gconf_mailboxes, new_mailboxes);
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
}
}
- mn_pointers_free(uri_list);
+ eel_g_slist_free_deep(uri_list);
}
}
}
@@ -194,18 +165,18 @@ class MN:Mailbox:View from Gtk:Tree:View
Self *self = data;
GtkWidget *toplevel;
GtkWidget *dialog;
- char *uri;
+ MNURI *uri;
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(self));
dialog = mn_mailbox_properties_dialog_new((GtkWindow *) toplevel, MN_MAILBOX_PROPERTIES_DIALOG_MODE_EDIT);
gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);
mn_mailbox_properties_dialog_set_uri(MN_MAILBOX_PROPERTIES_DIALOG(dialog), uri);
- g_free(uri);
+ g_object_unref(uri);
g_signal_connect(G_OBJECT(dialog),
"response",
- G_CALLBACK(self_properties_response_h),
+ G_CALLBACK(self_properties_edit_response_h),
NULL);
gtk_widget_show(dialog);
@@ -272,7 +243,7 @@ class MN:Mailbox:View from Gtk:Tree:View
g_signal_connect_swapped(G_OBJECT(selfp->properties_item), "activate", G_CALLBACK(self_activate_properties), self);
store = gtk_list_store_new(N_COLUMNS,
- G_TYPE_STRING,
+ MN_TYPE_URI,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING);
@@ -332,7 +303,6 @@ class MN:Mailbox:View from Gtk:Tree:View
GtkTreeModel *model;
GtkTreeIter iter;
gboolean valid;
- MNMailbox *mailbox;
GSList *l;
model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
@@ -342,15 +312,16 @@ class MN:Mailbox:View from Gtk:Tree:View
valid = gtk_tree_model_get_iter_first(model, &iter);
while (valid)
{
- char *uri;
+ MNURI *uri;
+ GSList *elem;
gtk_tree_model_get(model, &iter, COLUMN_URI, &uri, -1);
- mailbox = mn_mailboxes_find(mn_shell->mailboxes, uri);
- g_free(uri);
+ elem = mn_mailboxes_find_uri(mn_shell->mailboxes, uri);
+ g_object_unref(uri);
- if (mailbox)
+ if (elem)
{
- self_update_iter(self, &iter, mailbox);
+ self_update_iter(self, &iter, elem->data);
valid = gtk_tree_model_iter_next(model, &iter);
}
else
@@ -361,7 +332,7 @@ class MN:Mailbox:View from Gtk:Tree:View
MN_LIST_FOREACH(l, mn_mailboxes_get(mn_shell->mailboxes))
{
- mailbox = l->data;
+ MNMailbox *mailbox = l->data;
if (! self_has_mailbox(self, mailbox))
{
@@ -377,28 +348,24 @@ class MN:Mailbox:View from Gtk:Tree:View
MN:Mailbox *mailbox (check null type))
{
MNMailboxClass *class;
- const char *uri;
- const char *system_uri;
const char *stock_id;
GtkTreeModel *model;
class = MN_MAILBOX_GET_CLASS(mailbox);
- uri = mn_mailbox_get_uri(mailbox);
- system_uri = mn_uri_get_system_mailbox();
- if (system_uri && ! mn_uri_cmp(uri, system_uri))
+ if (MN_URI_IS_SYSTEM_MAILBOX(mailbox->uri))
stock_id = MN_STOCK_SYSTEM_MAILBOX;
else
{
if (class->stock_id)
stock_id = class->stock_id;
else
- stock_id = mn_uri_is_local(uri) ? MN_STOCK_LOCAL : MN_STOCK_REMOTE;
+ stock_id = MN_URI_IS_LOCAL(mailbox->uri) ? MN_STOCK_LOCAL : MN_STOCK_REMOTE;
}
model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- COLUMN_URI, uri,
+ COLUMN_URI, mailbox->uri,
COLUMN_MAILBOX_ICON, stock_id,
COLUMN_MAILBOX, mn_mailbox_get_name(mailbox),
COLUMN_FORMAT, class->format,
@@ -408,23 +375,20 @@ class MN:Mailbox:View from Gtk:Tree:View
private gboolean
has_mailbox (self, MN:Mailbox *mailbox (check null type))
{
- const char *uri;
GtkTreeModel *model;
GtkTreeIter iter;
gboolean valid;
gboolean has = FALSE;
- uri = mn_mailbox_get_uri(mailbox);
-
model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
valid = gtk_tree_model_get_iter_first(model, &iter);
while (valid)
{
- char *this_uri;
+ MNURI *uri;
- gtk_tree_model_get(model, &iter, COLUMN_URI, &this_uri, -1);
- has = ! mn_uri_cmp(this_uri, uri);
- g_free(this_uri);
+ gtk_tree_model_get(model, &iter, COLUMN_URI, &uri, -1);
+ has = ! strcmp(uri->text, mailbox->uri->text);
+ g_object_unref(uri);
if (has)
break;
@@ -461,7 +425,7 @@ class MN:Mailbox:View from Gtk:Tree:View
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
gtk_tree_selection_selected_foreach(selection, self_remove_mailbox_cb, &gconf_mailboxes);
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
}
private void
@@ -471,20 +435,16 @@ class MN:Mailbox:View from Gtk:Tree:View
gpointer data (check null))
{
GSList **gconf_mailboxes = data;
- char *uri;
+ MNURI *uri;
GSList *elem;
gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);
/* remove all the mailboxes with that URI */
- while ((elem = g_slist_find_custom(*gconf_mailboxes, uri, (GCompareFunc) mn_uri_cmp)))
- {
- *gconf_mailboxes = g_slist_remove_link(*gconf_mailboxes, elem);
- g_free(elem->data);
- g_slist_free(elem);
- }
+ while ((elem = mn_mailboxes_conf_find_uri(*gconf_mailboxes, uri)))
+ *gconf_mailboxes = mn_g_slist_delete_link_deep(*gconf_mailboxes, elem);
- g_free(uri);
+ g_object_unref(uri);
}
private void
@@ -500,7 +460,7 @@ class MN:Mailbox:View from Gtk:Tree:View
gtk_tree_selection_selected_foreach(selection, self_copy_mailbox_cb, &uri_list);
gnome_copied_files = mn_build_gnome_copied_files(MN_GNOME_COPIED_FILES_COPY, uri_list);
- mn_pointers_free(uri_list);
+ eel_g_slist_free_deep(uri_list);
status = gtk_clipboard_set_with_data(global_clipboard,
&target,
@@ -518,11 +478,11 @@ class MN:Mailbox:View from Gtk:Tree:View
gpointer data (check null))
{
GSList **uri_list = data;
- char *uri;
+ MNURI *uri;
gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);
- *uri_list = g_slist_append(*uri_list, uri);
- /* uri is now owned by uri_list, do not free */
+ *uri_list = g_slist_append(*uri_list, g_strdup(uri->text));
+ g_object_unref(uri);
}
private void
@@ -553,9 +513,43 @@ class MN:Mailbox:View from Gtk:Tree:View
}
private void
- properties_response_h (Gtk:Dialog *dialog (check null type),
- int response,
- gpointer user_data)
+ properties_add_response_h (Gtk:Dialog *dialog (check null type),
+ int response,
+ gpointer user_data)
+ {
+ if (response == GTK_RESPONSE_HELP)
+ mn_display_help("mailbox-properties");
+ else if (response == GTK_RESPONSE_CANCEL)
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ else if (response == GTK_RESPONSE_ACCEPT)
+ {
+ MNURI *uri;
+
+ uri = mn_mailbox_properties_dialog_get_uri(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
+ g_return_if_fail(MN_IS_URI(uri));
+
+ if (! mn_mailboxes_find_uri(mn_shell->mailboxes, uri))
+ {
+ GSList *gconf_mailboxes;
+
+ gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
+ gconf_mailboxes = g_slist_append(gconf_mailboxes, g_strdup(uri->text));
+ eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
+
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ }
+ else
+ mn_error_dialog(NULL, _("Unable to add mailbox"), _("The mailbox is already in the list."));
+
+ g_object_unref(uri);
+ }
+ }
+
+ private void
+ properties_edit_response_h (Gtk:Dialog *dialog (check null type),
+ int response,
+ gpointer user_data)
{
if (response == GTK_RESPONSE_HELP)
mn_display_help("mailbox-properties");
@@ -603,7 +597,7 @@ class MN:Mailbox:View from Gtk:Tree:View
{
if (type == MN_GNOME_COPIED_FILES_COPY && uri_list)
can_paste = TRUE;
- mn_pointers_free(uri_list);
+ eel_g_slist_free_deep(uri_list);
}
}
@@ -641,6 +635,7 @@ class MN:Mailbox:View from Gtk:Tree:View
public GtkWidget *
new (void)
{
+ g_return_val_if_fail(mn_shell != NULL, NULL);
return GTK_WIDGET(GET_NEW);
}
}
diff --git a/src/mn-mailbox.c b/src/mn-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -23,7 +23,7 @@
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */
-#line 42 "mn-mailbox.gob"
+#line 44 "mn-mailbox.gob"
#include "config.h"
#include <glib/gi18n-lib.h>
@@ -52,18 +52,16 @@
#include "mn-util.h"
#include "mn-unsupported-mailbox.h"
#include "mn-conf.h"
-#include "mn-dialog.h"
-#include "mn-uri.h"
typedef struct
{
- char *uri;
+ MNURI *uri;
void (*callback) (MNMailbox *self,
gpointer user_data);
gpointer user_data;
} NewInfo;
-#line 67 "mn-mailbox.c"
+#line 65 "mn-mailbox.c"
/* self casting macros */
#define SELF(x) MN_MAILBOX(x)
#define SELF_CONST(x) MN_MAILBOX_CONST(x)
@@ -84,7 +82,7 @@ static void mn_mailbox_init (MNMailbox * o) G_GNUC_UNUSED;
static void mn_mailbox_class_init (MNMailboxClass * c) G_GNUC_UNUSED;
static gpointer mn_mailbox_new_async_thread (gpointer data) G_GNUC_UNUSED;
static void mn_mailbox_monitor_cb (GnomeVFSMonitorHandle * handle, const char * monitor_uri, const char * info_uri, GnomeVFSMonitorEventType event_type, gpointer user_data) G_GNUC_UNUSED;
-static gboolean mn_mailbox_impl_is (MNMailbox * self, const char * uri) G_GNUC_UNUSED;
+static gboolean mn_mailbox_impl_is (MNMailbox * self, MNURI * uri) G_GNUC_UNUSED;
static void mn_mailbox_impl_check (MNMailbox * self) G_GNUC_UNUSED;
static void mn_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
@@ -101,7 +99,6 @@ enum {
static GObjectClass *parent_class = NULL;
/* Short form macros */
-#define self_get_uri mn_mailbox_get_uri
#define self_get_name mn_mailbox_get_name
#define self_get_automatic mn_mailbox_get_automatic
#define self_set_automatic mn_mailbox_set_automatic
@@ -165,6 +162,20 @@ GET_NEW_VARG (const char *first, ...)
static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::dispose"
+ MNMailbox *self G_GNUC_UNUSED = MN_MAILBOX (obj_self);
+ if (G_OBJECT_CLASS (parent_class)->dispose) \
+ (* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
+#line 121 "mn-mailbox.gob"
+ if(self->uri) { ((*(void (*)(void *))g_object_unref)) (self->uri); self->uri = NULL; }
+#line 174 "mn-mailbox.c"
+}
+#undef __GOB_FUNCTION__
+
+
+static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:Mailbox::finalize"
@@ -172,24 +183,21 @@ ___finalize(GObject *obj_self)
gpointer priv = self->_priv;
if(G_OBJECT_CLASS(parent_class)->finalize) \
(* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
-#line 87 "mn-mailbox.gob"
- if(self->_priv->uri) { ((*(void (*)(void *))g_free)) (self->_priv->uri); self->_priv->uri = NULL; }
-#line 178 "mn-mailbox.c"
-#line 97 "mn-mailbox.gob"
+#line 132 "mn-mailbox.gob"
if(self->_priv->name) { ((*(void (*)(void *))g_free)) (self->_priv->name); self->_priv->name = NULL; }
-#line 181 "mn-mailbox.c"
-#line 111 "mn-mailbox.gob"
+#line 189 "mn-mailbox.c"
+#line 146 "mn-mailbox.gob"
if(self->_priv->error) { ((*(void (*)(void *))g_free)) (self->_priv->error); self->_priv->error = NULL; }
-#line 184 "mn-mailbox.c"
-#line 131 "mn-mailbox.gob"
+#line 192 "mn-mailbox.c"
+#line 166 "mn-mailbox.gob"
if(self->_priv->monitor_handle) { ((*(void (*)(void *))gnome_vfs_monitor_cancel)) (self->_priv->monitor_handle); self->_priv->monitor_handle = NULL; }
-#line 187 "mn-mailbox.c"
-#line 132 "mn-mailbox.gob"
+#line 195 "mn-mailbox.c"
+#line 167 "mn-mailbox.gob"
if(self->_priv->monitor_uri) { ((*(void (*)(void *))g_free)) (self->_priv->monitor_uri); self->_priv->monitor_uri = NULL; }
-#line 190 "mn-mailbox.c"
-#line 276 "mn-mailbox.gob"
+#line 198 "mn-mailbox.c"
+#line 310 "mn-mailbox.gob"
if(self->_priv->init_error) { ((*(void (*)(void *))g_free)) (self->_priv->init_error); self->_priv->init_error = NULL; }
-#line 193 "mn-mailbox.c"
+#line 201 "mn-mailbox.c"
g_free (priv);
}
#undef __GOB_FUNCTION__
@@ -199,6 +207,9 @@ mn_mailbox_init (MNMailbox * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Mailbox::init"
o->_priv = g_new0 (MNMailboxPrivate, 1);
+#line 44 "mn-mailbox.gob"
+ o->uri = NULL;
+#line 213 "mn-mailbox.c"
}
#undef __GOB_FUNCTION__
static void
@@ -212,17 +223,18 @@ mn_mailbox_class_init (MNMailboxClass * c G_GNUC_UNUSED)
c->impl_is = NULL;
c->impl_check = NULL;
c->impl_threaded_check = NULL;
+ g_object_class->dispose = ___dispose;
g_object_class->finalize = ___finalize;
g_object_class->get_property = ___object_get_property;
g_object_class->set_property = ___object_set_property;
{
GParamSpec *param_spec;
- param_spec = g_param_spec_string
+ param_spec = g_param_spec_object
("uri" /* name */,
NULL /* nick */,
_("The mailbox URI") /* blurb */,
- NULL /* default_value */,
+ MN_TYPE_URI /* object_type */,
(GParamFlags)(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (g_object_class,
PROP_URI,
@@ -281,41 +293,41 @@ ___object_set_property (GObject *object,
switch (property_id) {
case PROP_URI:
{
-#line 90 "mn-mailbox.gob"
+#line 126 "mn-mailbox.gob"
- g_return_if_fail(selfp->uri == NULL);
- selfp->uri = g_value_dup_string(VAL);
- selfp->name = mn_uri_format_for_display(selfp->uri);
+ g_return_if_fail(self->uri == NULL);
+ self->uri = MN_URI(g_value_dup_object(VAL));
+ selfp->name = g_strdup(self->uri->human_readable);
-#line 291 "mn-mailbox.c"
+#line 303 "mn-mailbox.c"
}
break;
case PROP_NAME:
{
-#line 98 "mn-mailbox.gob"
+#line 133 "mn-mailbox.gob"
{ char *old = self->_priv->name; self->_priv->name = g_value_dup_string (VAL); g_free (old); }
-#line 298 "mn-mailbox.c"
+#line 310 "mn-mailbox.c"
}
break;
case PROP_AUTOMATIC:
{
-#line 102 "mn-mailbox.gob"
+#line 137 "mn-mailbox.gob"
self->_priv->automatic = g_value_get_boolean (VAL);
-#line 305 "mn-mailbox.c"
+#line 317 "mn-mailbox.c"
}
break;
case PROP_HAS_NEW:
{
-#line 107 "mn-mailbox.gob"
+#line 142 "mn-mailbox.gob"
self->_priv->has_new = g_value_get_boolean (VAL);
-#line 312 "mn-mailbox.c"
+#line 324 "mn-mailbox.c"
}
break;
case PROP_ERROR:
{
-#line 112 "mn-mailbox.gob"
+#line 147 "mn-mailbox.gob"
{ char *old = self->_priv->error; self->_priv->error = g_value_dup_string (VAL); g_free (old); }
-#line 319 "mn-mailbox.c"
+#line 331 "mn-mailbox.c"
}
break;
default:
@@ -344,30 +356,30 @@ ___object_get_property (GObject *object,
switch (property_id) {
case PROP_NAME:
{
-#line 98 "mn-mailbox.gob"
+#line 133 "mn-mailbox.gob"
g_value_set_string (VAL, self->_priv->name);
-#line 350 "mn-mailbox.c"
+#line 362 "mn-mailbox.c"
}
break;
case PROP_AUTOMATIC:
{
-#line 102 "mn-mailbox.gob"
+#line 137 "mn-mailbox.gob"
g_value_set_boolean (VAL, self->_priv->automatic);
-#line 357 "mn-mailbox.c"
+#line 369 "mn-mailbox.c"
}
break;
case PROP_HAS_NEW:
{
-#line 107 "mn-mailbox.gob"
+#line 142 "mn-mailbox.gob"
g_value_set_boolean (VAL, self->_priv->has_new);
-#line 364 "mn-mailbox.c"
+#line 376 "mn-mailbox.c"
}
break;
case PROP_ERROR:
{
-#line 112 "mn-mailbox.gob"
+#line 147 "mn-mailbox.gob"
g_value_set_string (VAL, self->_priv->error);
-#line 371 "mn-mailbox.c"
+#line 383 "mn-mailbox.c"
}
break;
default:
@@ -384,105 +396,88 @@ g_value_set_string (VAL, self->_priv->error);
-#line 95 "mn-mailbox.gob"
-const char *
-mn_mailbox_get_uri (MNMailbox * self)
-#line 391 "mn-mailbox.c"
-{
-#define __GOB_FUNCTION__ "MN:Mailbox::get_uri"
-#line 95 "mn-mailbox.gob"
- g_return_val_if_fail (self != NULL, (const char * )0);
-#line 95 "mn-mailbox.gob"
- g_return_val_if_fail (MN_IS_MAILBOX (self), (const char * )0);
-#line 398 "mn-mailbox.c"
-{
-#line 95 "mn-mailbox.gob"
- return selfp->uri; }}
-#line 402 "mn-mailbox.c"
-#undef __GOB_FUNCTION__
-
-#line 99 "mn-mailbox.gob"
+#line 134 "mn-mailbox.gob"
const char *
mn_mailbox_get_name (MNMailbox * self)
-#line 408 "mn-mailbox.c"
+#line 403 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::get_name"
-#line 99 "mn-mailbox.gob"
+#line 134 "mn-mailbox.gob"
g_return_val_if_fail (self != NULL, (const char * )0);
-#line 99 "mn-mailbox.gob"
+#line 134 "mn-mailbox.gob"
g_return_val_if_fail (MN_IS_MAILBOX (self), (const char * )0);
-#line 415 "mn-mailbox.c"
+#line 410 "mn-mailbox.c"
{
-#line 99 "mn-mailbox.gob"
+#line 134 "mn-mailbox.gob"
return selfp->name; }}
-#line 419 "mn-mailbox.c"
+#line 414 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 102 "mn-mailbox.gob"
+#line 137 "mn-mailbox.gob"
gboolean
mn_mailbox_get_automatic (MNMailbox * self)
-#line 425 "mn-mailbox.c"
+#line 420 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::get_automatic"
{
-#line 102 "mn-mailbox.gob"
+#line 137 "mn-mailbox.gob"
gboolean val; g_object_get (G_OBJECT (self), "automatic", &val, NULL); return val;
}}
-#line 432 "mn-mailbox.c"
+#line 427 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 102 "mn-mailbox.gob"
+#line 137 "mn-mailbox.gob"
void
mn_mailbox_set_automatic (MNMailbox * self, gboolean val)
-#line 438 "mn-mailbox.c"
+#line 433 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::set_automatic"
{
-#line 102 "mn-mailbox.gob"
+#line 137 "mn-mailbox.gob"
g_object_set (G_OBJECT (self), "automatic", val, NULL);
}}
-#line 445 "mn-mailbox.c"
+#line 440 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 107 "mn-mailbox.gob"
+#line 142 "mn-mailbox.gob"
gboolean
mn_mailbox_get_has_new (MNMailbox * self)
-#line 451 "mn-mailbox.c"
+#line 446 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::get_has_new"
{
-#line 107 "mn-mailbox.gob"
+#line 142 "mn-mailbox.gob"
gboolean val; g_object_get (G_OBJECT (self), "has_new", &val, NULL); return val;
}}
-#line 458 "mn-mailbox.c"
+#line 453 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 107 "mn-mailbox.gob"
+#line 142 "mn-mailbox.gob"
void
mn_mailbox_set_has_new (MNMailbox * self, gboolean val)
-#line 464 "mn-mailbox.c"
+#line 459 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::set_has_new"
{
-#line 107 "mn-mailbox.gob"
+#line 142 "mn-mailbox.gob"
g_object_set (G_OBJECT (self), "has_new", val, NULL);
}}
-#line 471 "mn-mailbox.c"
+#line 466 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 113 "mn-mailbox.gob"
+#line 148 "mn-mailbox.gob"
void
mn_mailbox_set_error (MNMailbox * self, const char * format, ...)
-#line 477 "mn-mailbox.c"
+#line 472 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::set_error"
-#line 113 "mn-mailbox.gob"
+#line 148 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 113 "mn-mailbox.gob"
+#line 148 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 484 "mn-mailbox.c"
+#line 479 "mn-mailbox.c"
{
-#line 115 "mn-mailbox.gob"
+#line 150 "mn-mailbox.gob"
va_list args;
char *error = NULL;
@@ -497,34 +492,34 @@ mn_mailbox_set_error (MNMailbox * self, const char * format, ...)
g_object_set(G_OBJECT(self), MN_MAILBOX_PROP_ERROR(error), NULL);
g_free(error);
}}
-#line 501 "mn-mailbox.c"
+#line 496 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 129 "mn-mailbox.gob"
+#line 164 "mn-mailbox.gob"
const char *
mn_mailbox_get_error (MNMailbox * self)
-#line 507 "mn-mailbox.c"
+#line 502 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::get_error"
-#line 129 "mn-mailbox.gob"
+#line 164 "mn-mailbox.gob"
g_return_val_if_fail (self != NULL, (const char * )0);
-#line 129 "mn-mailbox.gob"
+#line 164 "mn-mailbox.gob"
g_return_val_if_fail (MN_IS_MAILBOX (self), (const char * )0);
-#line 514 "mn-mailbox.c"
+#line 509 "mn-mailbox.c"
{
-#line 129 "mn-mailbox.gob"
+#line 164 "mn-mailbox.gob"
return selfp->error; }}
-#line 518 "mn-mailbox.c"
+#line 513 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 137 "mn-mailbox.gob"
+#line 172 "mn-mailbox.gob"
const GType *
mn_mailbox_get_types (void)
-#line 524 "mn-mailbox.c"
+#line 519 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::get_types"
{
-#line 139 "mn-mailbox.gob"
+#line 174 "mn-mailbox.gob"
static GType *types = NULL;
G_LOCK_DEFINE_STATIC(types);
@@ -567,7 +562,7 @@ mn_mailbox_get_types (void)
return types;
}}
-#line 571 "mn-mailbox.c"
+#line 566 "mn-mailbox.c"
#undef __GOB_FUNCTION__
/**
@@ -580,51 +575,50 @@ mn_mailbox_get_types (void)
* Creates a new #MNMailbox asynchronously. The newly created
* #MNMailbox will be passed to @callback.
**/
-#line 192 "mn-mailbox.gob"
+#line 227 "mn-mailbox.gob"
void
-mn_mailbox_new_async (const char * uri, gpointer callback, gpointer user_data)
-#line 587 "mn-mailbox.c"
+mn_mailbox_new_async (MNURI * uri, gpointer callback, gpointer user_data)
+#line 582 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::new_async"
-#line 192 "mn-mailbox.gob"
+#line 227 "mn-mailbox.gob"
g_return_if_fail (uri != NULL);
-#line 192 "mn-mailbox.gob"
+#line 227 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_URI (uri));
+#line 227 "mn-mailbox.gob"
g_return_if_fail (callback != NULL);
-#line 594 "mn-mailbox.c"
+#line 591 "mn-mailbox.c"
{
-#line 196 "mn-mailbox.gob"
+#line 231 "mn-mailbox.gob"
NewInfo *info;
info = g_new(NewInfo, 1);
- info->uri = g_strdup(uri);
+ info->uri = g_object_ref(uri);
info->callback = callback;
info->user_data = user_data;
mn_thread_create(self_new_async_thread, info);
}}
-#line 607 "mn-mailbox.c"
+#line 604 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 207 "mn-mailbox.gob"
+#line 242 "mn-mailbox.gob"
static gpointer
mn_mailbox_new_async_thread (gpointer data)
-#line 613 "mn-mailbox.c"
+#line 610 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::new_async_thread"
{
-#line 209 "mn-mailbox.gob"
+#line 244 "mn-mailbox.gob"
NewInfo *info = data;
- GnomeVFSURI *vfs_uri;
Self *mailbox = NULL;
- vfs_uri = gnome_vfs_uri_new(info->uri);
- if (vfs_uri) /* the scheme is supported by GnomeVFS, therefore we require that the URI exists */
+ if (info->uri->vfs)
{
- if (! mn_vfs_test(info->uri, G_FILE_TEST_EXISTS))
+ if (! mn_vfs_test(info->uri->vfs, G_FILE_TEST_EXISTS))
mailbox = mn_unsupported_mailbox_new(info->uri, _("does not exist"));
- gnome_vfs_uri_unref(vfs_uri);
}
if (! mailbox)
@@ -644,7 +638,7 @@ mn_mailbox_new_async_thread (gpointer data)
if (is)
{
- mailbox = g_object_new(types[i], MN_MAILBOX_PROP_URI(info->uri), NULL);
+ mailbox = g_object_new(types[i], MN_MAILBOX_PROP_URI(G_OBJECT(info->uri)), NULL);
if (mailbox->_priv->init_error)
{
MNMailbox *old_mailbox;
@@ -663,7 +657,9 @@ mn_mailbox_new_async_thread (gpointer data)
mailbox = mn_unsupported_mailbox_new(info->uri, _("unknown format"));
GDK_THREADS_ENTER();
+
info->callback(mailbox, info->user_data);
+
/*
* A note on gdk_flush(): as adviced in the GDK threads
* documentation, we only call gdk_flush() from a thread other
@@ -675,29 +671,29 @@ mn_mailbox_new_async_thread (gpointer data)
/* mailbox is now owned by the callback, do not unref it */
- g_free(info->uri);
+ g_object_unref(info->uri);
g_free(info);
return NULL;
}}
-#line 684 "mn-mailbox.c"
+#line 680 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 277 "mn-mailbox.gob"
+#line 311 "mn-mailbox.gob"
void
mn_mailbox_set_init_error (MNMailbox * self, const char * format, ...)
-#line 690 "mn-mailbox.c"
+#line 686 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::set_init_error"
-#line 277 "mn-mailbox.gob"
+#line 311 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 277 "mn-mailbox.gob"
+#line 311 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 277 "mn-mailbox.gob"
+#line 311 "mn-mailbox.gob"
g_return_if_fail (format != NULL);
-#line 699 "mn-mailbox.c"
+#line 695 "mn-mailbox.c"
{
-#line 279 "mn-mailbox.gob"
+#line 313 "mn-mailbox.gob"
va_list args;
@@ -707,35 +703,40 @@ mn_mailbox_set_init_error (MNMailbox * self, const char * format, ...)
selfp->init_error = g_strdup_vprintf(format, args);
va_end(args);
}}
-#line 711 "mn-mailbox.c"
+#line 707 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 289 "mn-mailbox.gob"
+#line 323 "mn-mailbox.gob"
void
mn_mailbox_monitor (MNMailbox * self, const char * uri, GnomeVFSMonitorType monitor_type, MNMailboxMonitorEventType events)
-#line 717 "mn-mailbox.c"
+#line 713 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::monitor"
-#line 289 "mn-mailbox.gob"
+#line 323 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 289 "mn-mailbox.gob"
+#line 323 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 289 "mn-mailbox.gob"
+#line 323 "mn-mailbox.gob"
g_return_if_fail (uri != NULL);
-#line 726 "mn-mailbox.c"
+#line 722 "mn-mailbox.c"
{
-#line 294 "mn-mailbox.gob"
+#line 328 "mn-mailbox.gob"
GnomeVFSResult result;
g_return_if_fail(MN_MAILBOX_CAN_CHECK(self));
g_return_if_fail(selfp->monitor_handle == NULL);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
result = gnome_vfs_monitor_add(&selfp->monitor_handle,
uri,
monitor_type,
self_monitor_cb,
self);
+
+ GDK_THREADS_ENTER();
if (result == GNOME_VFS_OK)
{
@@ -796,48 +797,50 @@ mn_mailbox_monitor (MNMailbox * self, const char * uri, GnomeVFSMonitorType moni
minutes),
minutes);
- mn_error_dialog("automatic-notification",
+ mn_error_dialog("immediate-notification",
_("A monitoring error has occurred"),
- _("Mail Notification was unable to enable automatic "
+ _("Mail Notification was unable to enable immediate "
"notification for one or more mailboxes. %s"), str);
g_free(str);
}
}
}}
-#line 808 "mn-mailbox.c"
+#line 809 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 374 "mn-mailbox.gob"
+#line 413 "mn-mailbox.gob"
static void
mn_mailbox_monitor_cb (GnomeVFSMonitorHandle * handle, const char * monitor_uri, const char * info_uri, GnomeVFSMonitorEventType event_type, gpointer user_data)
-#line 814 "mn-mailbox.c"
+#line 815 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::monitor_cb"
-#line 374 "mn-mailbox.gob"
+#line 413 "mn-mailbox.gob"
g_return_if_fail (user_data != NULL);
-#line 819 "mn-mailbox.c"
+#line 820 "mn-mailbox.c"
{
-#line 380 "mn-mailbox.gob"
+#line 419 "mn-mailbox.gob"
Self *self = user_data;
+ GDK_THREADS_ENTER();
if (selfp->monitor_events & (1 << event_type))
self_check(self);
+ GDK_THREADS_LEAVE();
}}
-#line 828 "mn-mailbox.c"
+#line 831 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 387 "mn-mailbox.gob"
+#line 428 "mn-mailbox.gob"
static gboolean
-mn_mailbox_impl_is (MNMailbox * self, const char * uri)
-#line 834 "mn-mailbox.c"
+mn_mailbox_impl_is (MNMailbox * self, MNURI * uri)
+#line 837 "mn-mailbox.c"
{
MNMailboxClass *klass;
-#line 387 "mn-mailbox.gob"
+#line 428 "mn-mailbox.gob"
g_return_val_if_fail (self != NULL, (gboolean )0);
-#line 387 "mn-mailbox.gob"
+#line 428 "mn-mailbox.gob"
g_return_val_if_fail (MN_IS_MAILBOX (self), (gboolean )0);
-#line 841 "mn-mailbox.c"
+#line 844 "mn-mailbox.c"
klass = MN_MAILBOX_GET_CLASS(self);
if(klass->impl_is)
@@ -846,53 +849,53 @@ mn_mailbox_impl_is (MNMailbox * self, const char * uri)
return (gboolean )(0);
}
-#line 389 "mn-mailbox.gob"
+#line 430 "mn-mailbox.gob"
static void
mn_mailbox_impl_check (MNMailbox * self)
-#line 853 "mn-mailbox.c"
+#line 856 "mn-mailbox.c"
{
MNMailboxClass *klass;
-#line 389 "mn-mailbox.gob"
+#line 430 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 389 "mn-mailbox.gob"
+#line 430 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 860 "mn-mailbox.c"
+#line 863 "mn-mailbox.c"
klass = MN_MAILBOX_GET_CLASS(self);
if(klass->impl_check)
(*klass->impl_check)(self);
}
-#line 391 "mn-mailbox.gob"
+#line 432 "mn-mailbox.gob"
static void
mn_mailbox_impl_threaded_check (MNMailbox * self)
-#line 870 "mn-mailbox.c"
+#line 873 "mn-mailbox.c"
{
MNMailboxClass *klass;
-#line 391 "mn-mailbox.gob"
+#line 432 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 391 "mn-mailbox.gob"
+#line 432 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 877 "mn-mailbox.c"
+#line 880 "mn-mailbox.c"
klass = MN_MAILBOX_GET_CLASS(self);
if(klass->impl_threaded_check)
(*klass->impl_threaded_check)(self);
}
-#line 394 "mn-mailbox.gob"
+#line 435 "mn-mailbox.gob"
void
mn_mailbox_check (MNMailbox * self)
-#line 887 "mn-mailbox.c"
+#line 890 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::check"
-#line 394 "mn-mailbox.gob"
+#line 435 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 394 "mn-mailbox.gob"
+#line 435 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 894 "mn-mailbox.c"
+#line 897 "mn-mailbox.c"
{
-#line 396 "mn-mailbox.gob"
+#line 437 "mn-mailbox.gob"
g_return_if_fail(MN_MAILBOX_CAN_CHECK(self));
@@ -908,46 +911,46 @@ mn_mailbox_check (MNMailbox * self)
SELF_GET_CLASS(self)->impl_check(self);
}
}}
-#line 912 "mn-mailbox.c"
+#line 915 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 412 "mn-mailbox.gob"
+#line 453 "mn-mailbox.gob"
void
mn_mailbox_end_check (MNMailbox * self)
-#line 918 "mn-mailbox.c"
+#line 921 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::end_check"
-#line 412 "mn-mailbox.gob"
+#line 453 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 412 "mn-mailbox.gob"
+#line 453 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 925 "mn-mailbox.c"
+#line 928 "mn-mailbox.c"
{
-#line 414 "mn-mailbox.gob"
+#line 455 "mn-mailbox.gob"
g_return_if_fail(selfp->checking == TRUE);
selfp->checking = FALSE;
g_object_unref(self);
}}
-#line 934 "mn-mailbox.c"
+#line 937 "mn-mailbox.c"
#undef __GOB_FUNCTION__
-#line 421 "mn-mailbox.gob"
+#line 462 "mn-mailbox.gob"
void
mn_mailbox_notice (MNMailbox * self, const char * format, ...)
-#line 940 "mn-mailbox.c"
+#line 943 "mn-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox::notice"
-#line 421 "mn-mailbox.gob"
+#line 462 "mn-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 421 "mn-mailbox.gob"
+#line 462 "mn-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 421 "mn-mailbox.gob"
+#line 462 "mn-mailbox.gob"
g_return_if_fail (format != NULL);
-#line 949 "mn-mailbox.c"
+#line 952 "mn-mailbox.c"
{
-#line 423 "mn-mailbox.gob"
+#line 464 "mn-mailbox.gob"
va_list args;
char *notice;
@@ -957,11 +960,11 @@ mn_mailbox_notice (MNMailbox * self, const char * format, ...)
notice = g_strdup_vprintf(format, args);
va_end(args);
- prefixed_notice = g_strdup_printf("%s: %s", selfp->uri, notice);
+ prefixed_notice = g_strdup_printf("%s: %s", self->uri->text, notice);
g_free(notice);
mn_info("%s", prefixed_notice);
g_free(prefixed_notice);
}}
-#line 967 "mn-mailbox.c"
+#line 970 "mn-mailbox.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-mailbox.gob b/src/mn-mailbox.gob
@@ -18,6 +18,7 @@
%headertop{
#include <stdarg.h>
+#include "mn-uri.h"
%}
%privateheader{
@@ -36,7 +37,8 @@
%h{
#define MN_MAILBOX_CAN_CHECK(self) \
- (MN_MAILBOX_GET_CLASS((self))->impl_check != NULL || MN_MAILBOX_GET_CLASS((self))->impl_threaded_check != NULL)
+ (MN_MAILBOX_GET_CLASS((self))->impl_check != NULL \
+ || MN_MAILBOX_GET_CLASS((self))->impl_threaded_check != NULL)
%}
%{
@@ -67,32 +69,65 @@
#include "mn-util.h"
#include "mn-unsupported-mailbox.h"
#include "mn-conf.h"
-#include "mn-dialog.h"
-#include "mn-uri.h"
typedef struct
{
- char *uri;
+ MNURI *uri;
void (*callback) (MNMailbox *self,
gpointer user_data);
gpointer user_data;
} NewInfo;
%}
+/******************************************************************************
+ *** IMPORTANT REMARKS ABOUT GDK LOCKING AND MULTI-THREADING ******************
+ ******************************************************************************
+ *
+ * MNMailbox API functions must be called with the GDK lock
+ * held. Exceptions are:
+ *
+ * mn_mailbox_get_types()
+ * mn_mailbox_notice()
+ * mn_mailbox_set_init_error()
+ *
+ * (No code can be hooked to these functions through signals or other
+ * means, therefore we are sure GDK will never be used from these
+ * functions.)
+ *
+ * Mailboxes are constructed with the GDK lock not held. Use
+ * GDK_THREADS_ENTER() and GDK_THREADS_LEAVE() where appropriate in
+ * the construction phase.
+ *
+ * Virtual methods called with the GDK lock held:
+ *
+ * mn_mailbox_impl_check()
+ *
+ * Virtual methods called with the GDK lock not held:
+ *
+ * mn_mailbox_impl_is()
+ * mn_mailbox_impl_threaded_check()
+ *
+ * Do not assume anything about the thread from which a virtual method
+ * is called. For instance, mn_mailbox_impl_check() may be called both
+ * from the thread running the GTK+ main loop and from a separate
+ * thread.
+ */
+
class MN:Mailbox from G:Object
{
classwide const char *stock_id;
classwide const char *format;
- private char *uri destroywith g_free;
- property STRING uri (blurb = _("The mailbox URI"), flags = CONSTRUCT_ONLY)
+ public MNURI *uri = NULL unrefwith g_object_unref;
+ property OBJECT uri (blurb = _("The mailbox URI"),
+ object_type = MN:URI,
+ flags = CONSTRUCT_ONLY)
set
{
- g_return_if_fail(selfp->uri == NULL);
- selfp->uri = g_value_dup_string(VAL);
- selfp->name = mn_uri_format_for_display(selfp->uri);
+ g_return_if_fail(self->uri == NULL);
+ self->uri = MN_URI(g_value_dup_object(VAL));
+ selfp->name = g_strdup(self->uri->human_readable);
};
- public const char *get_uri (self) { return selfp->uri; }
private char *name destroywith g_free;
property STRING name (blurb = _("The mailbox human-readable name"), link);
@@ -190,14 +225,14 @@ class MN:Mailbox from G:Object
* #MNMailbox will be passed to @callback.
**/
public void
- new_async (const char *uri (check null),
+ new_async (MN:URI *uri (check null type),
gpointer callback (check null),
gpointer user_data)
{
NewInfo *info;
info = g_new(NewInfo, 1);
- info->uri = g_strdup(uri);
+ info->uri = g_object_ref(uri);
info->callback = callback;
info->user_data = user_data;
@@ -208,15 +243,12 @@ class MN:Mailbox from G:Object
new_async_thread (gpointer data)
{
NewInfo *info = data;
- GnomeVFSURI *vfs_uri;
Self *mailbox = NULL;
- vfs_uri = gnome_vfs_uri_new(info->uri);
- if (vfs_uri) /* the scheme is supported by GnomeVFS, therefore we require that the URI exists */
+ if (info->uri->vfs)
{
- if (! mn_vfs_test(info->uri, G_FILE_TEST_EXISTS))
+ if (! mn_vfs_test(info->uri->vfs, G_FILE_TEST_EXISTS))
mailbox = mn_unsupported_mailbox_new(info->uri, _("does not exist"));
- gnome_vfs_uri_unref(vfs_uri);
}
if (! mailbox)
@@ -236,7 +268,7 @@ class MN:Mailbox from G:Object
if (is)
{
- mailbox = g_object_new(types[i], MN_MAILBOX_PROP_URI(info->uri), NULL);
+ mailbox = g_object_new(types[i], MN_MAILBOX_PROP_URI(G_OBJECT(info->uri)), NULL);
if (mailbox->_priv->init_error)
{
MNMailbox *old_mailbox;
@@ -255,7 +287,9 @@ class MN:Mailbox from G:Object
mailbox = mn_unsupported_mailbox_new(info->uri, _("unknown format"));
GDK_THREADS_ENTER();
+
info->callback(mailbox, info->user_data);
+
/*
* A note on gdk_flush(): as adviced in the GDK threads
* documentation, we only call gdk_flush() from a thread other
@@ -267,7 +301,7 @@ class MN:Mailbox from G:Object
/* mailbox is now owned by the callback, do not unref it */
- g_free(info->uri);
+ g_object_unref(info->uri);
g_free(info);
return NULL;
@@ -297,11 +331,16 @@ class MN:Mailbox from G:Object
g_return_if_fail(MN_MAILBOX_CAN_CHECK(self));
g_return_if_fail(selfp->monitor_handle == NULL);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
result = gnome_vfs_monitor_add(&selfp->monitor_handle,
uri,
monitor_type,
self_monitor_cb,
self);
+
+ GDK_THREADS_ENTER();
if (result == GNOME_VFS_OK)
{
@@ -362,9 +401,9 @@ class MN:Mailbox from G:Object
minutes),
minutes);
- mn_error_dialog("automatic-notification",
+ mn_error_dialog("immediate-notification",
_("A monitoring error has occurred"),
- _("Mail Notification was unable to enable automatic "
+ _("Mail Notification was unable to enable immediate "
"notification for one or more mailboxes. %s"), str);
g_free(str);
}
@@ -380,12 +419,14 @@ class MN:Mailbox from G:Object
{
Self *self = user_data;
+ GDK_THREADS_ENTER();
if (selfp->monitor_events & (1 << event_type))
self_check(self);
+ GDK_THREADS_LEAVE();
}
virtual private gboolean
- impl_is (self, const char *uri);
+ impl_is (self, MNURI *uri);
virtual private void
impl_check (self);
virtual private void
@@ -429,7 +470,7 @@ class MN:Mailbox from G:Object
notice = g_strdup_vprintf(format, args);
va_end(args);
- prefixed_notice = g_strdup_printf("%s: %s", selfp->uri, notice);
+ prefixed_notice = g_strdup_printf("%s: %s", self->uri->text, notice);
g_free(notice);
mn_info("%s", prefixed_notice);
diff --git a/src/mn-mailbox.h b/src/mn-mailbox.h
@@ -5,6 +5,7 @@
#include <stdarg.h>
+#include "mn-uri.h"
#ifndef __MN_MAILBOX_H__
#define __MN_MAILBOX_H__
@@ -16,7 +17,8 @@ extern "C" {
#define MN_MAILBOX_CAN_CHECK(self) \
- (MN_MAILBOX_GET_CLASS((self))->impl_check != NULL || MN_MAILBOX_GET_CLASS((self))->impl_threaded_check != NULL)
+ (MN_MAILBOX_GET_CLASS((self))->impl_check != NULL \
+ || MN_MAILBOX_GET_CLASS((self))->impl_threaded_check != NULL)
/*
@@ -42,6 +44,8 @@ typedef struct _MNMailbox MNMailbox;
#endif
struct _MNMailbox {
GObject __parent__;
+ /*< public >*/
+ MNURI * uri;
/*< private >*/
MNMailboxPrivate *_priv;
};
@@ -52,7 +56,7 @@ struct _MNMailbox {
typedef struct _MNMailboxClass MNMailboxClass;
struct _MNMailboxClass {
GObjectClass __parent__;
- gboolean (* impl_is) (MNMailbox * self, const char * uri);
+ gboolean (* impl_is) (MNMailbox * self, MNURI * uri);
void (* impl_check) (MNMailbox * self);
void (* impl_threaded_check) (MNMailbox * self);
const char * stock_id;
@@ -64,7 +68,6 @@ struct _MNMailboxClass {
* Public methods
*/
GType mn_mailbox_get_type (void);
-const char * mn_mailbox_get_uri (MNMailbox * self);
const char * mn_mailbox_get_name (MNMailbox * self);
gboolean mn_mailbox_get_automatic (MNMailbox * self);
void mn_mailbox_set_automatic (MNMailbox * self,
@@ -74,7 +77,7 @@ void mn_mailbox_set_has_new (MNMailbox * self,
gboolean val);
const char * mn_mailbox_get_error (MNMailbox * self);
const GType * mn_mailbox_get_types (void);
-void mn_mailbox_new_async (const char * uri,
+void mn_mailbox_new_async (MNURI * uri,
gpointer callback,
gpointer user_data);
void mn_mailbox_check (MNMailbox * self);
@@ -83,7 +86,7 @@ void mn_mailbox_check (MNMailbox * self);
* Argument wrapping macros
*/
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-#define MN_MAILBOX_PROP_URI(arg) "uri", __extension__ ({gchar *z = (arg); z;})
+#define MN_MAILBOX_PROP_URI(arg) "uri", __extension__ ({GObject *z = (arg); z;})
#define MN_MAILBOX_PROP_NAME(arg) "name", __extension__ ({gchar *z = (arg); z;})
#define MN_MAILBOX_GET_PROP_NAME(arg) "name", __extension__ ({gchar **z = (arg); z;})
#define MN_MAILBOX_PROP_AUTOMATIC(arg) "automatic", __extension__ ({gboolean z = (arg); z;})
@@ -93,7 +96,7 @@ void mn_mailbox_check (MNMailbox * self);
#define MN_MAILBOX_PROP_ERROR(arg) "error", __extension__ ({gchar *z = (arg); z;})
#define MN_MAILBOX_GET_PROP_ERROR(arg) "error", __extension__ ({gchar **z = (arg); z;})
#else /* __GNUC__ && !__STRICT_ANSI__ */
-#define MN_MAILBOX_PROP_URI(arg) "uri",(gchar *)(arg)
+#define MN_MAILBOX_PROP_URI(arg) "uri",(GObject *)(arg)
#define MN_MAILBOX_PROP_NAME(arg) "name",(gchar *)(arg)
#define MN_MAILBOX_GET_PROP_NAME(arg) "name",(gchar **)(arg)
#define MN_MAILBOX_PROP_AUTOMATIC(arg) "automatic",(gboolean )(arg)
diff --git a/src/mn-mailboxes-private.h b/src/mn-mailboxes-private.h
@@ -14,7 +14,11 @@ struct _MNMailboxesPrivate {
GSList * list;
#line 35 "mn-mailboxes.gob"
unsigned int timeout_id;
-#line 18 "mn-mailboxes-private.h"
+#line 37 "mn-mailboxes.gob"
+ unsigned int delay_notification_id;
+#line 39 "mn-mailboxes.gob"
+ unsigned int mailboxes_notification_id;
+#line 22 "mn-mailboxes-private.h"
};
#ifdef __cplusplus
diff --git a/src/mn-mailboxes.c b/src/mn-mailboxes.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -9,6 +9,8 @@
#define selfp (self->_priv)
+#include <string.h> /* memset() */
+
#include "mn-mailboxes.h"
#include "mn-mailboxes-private.h"
@@ -25,13 +27,13 @@
#include "config.h"
#include <glib/gi18n-lib.h>
+#include <eel/eel.h>
#include "mn-conf.h"
#include "mn-util.h"
-#include "mn-uri.h"
#include "mn-pending-mailbox.h"
#include "mn-unsupported-mailbox.h"
-#line 35 "mn-mailboxes.c"
+#line 37 "mn-mailboxes.c"
/* self casting macros */
#define SELF(x) MN_MAILBOXES(x)
#define SELF_CONST(x) MN_MAILBOXES_CONST(x)
@@ -58,7 +60,8 @@ static void mn_mailboxes_notify_has_new_h (GObject * object, GParamSpec * pspec,
static void mn_mailboxes_notify_error_h (GObject * object, GParamSpec * pspec, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailboxes_install_timeout (MNMailboxes * self) G_GNUC_UNUSED;
static gboolean mn_mailboxes_timeout_cb (gpointer data) G_GNUC_UNUSED;
-static int mn_mailboxes_compare_func (gconstpointer a, gconstpointer b) G_GNUC_UNUSED;
+static int mn_mailboxes_find_compare_func (gconstpointer a, gconstpointer b) G_GNUC_UNUSED;
+static int mn_mailboxes_conf_find_compare_func (gconstpointer a, gconstpointer b) G_GNUC_UNUSED;
/*
* Signal connection wrapper macro shortcuts
@@ -95,7 +98,12 @@ static GObjectClass *parent_class = NULL;
#define self_check mn_mailboxes_check
#define self_get mn_mailboxes_get
#define self_find mn_mailboxes_find
-#define self_compare_func mn_mailboxes_compare_func
+#define self_find_uri mn_mailboxes_find_uri
+#define self_find_compare_func mn_mailboxes_find_compare_func
+#define self_conf_find mn_mailboxes_conf_find
+#define self_conf_find_uri mn_mailboxes_conf_find_uri
+#define self_conf_find_compare_func mn_mailboxes_conf_find_compare_func
+#define self_has_manual mn_mailboxes_has_manual
#define self_new mn_mailboxes_new
GType
mn_mailboxes_get_type (void)
@@ -148,6 +156,36 @@ ___finalize(GObject *obj_self)
gpointer priv = self->_priv;
if(G_OBJECT_CLASS(parent_class)->finalize) \
(* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+#line 34 "mn-mailboxes.gob"
+ if(self->_priv->list) { ((*(void (*)(void *))mn_g_object_slist_free)) (self->_priv->list); self->_priv->list = NULL; }
+#line 162 "mn-mailboxes.c"
+#define timeout_id (self->_priv->timeout_id)
+#define VAR timeout_id
+ {
+#line 36 "mn-mailboxes.gob"
+ if (VAR) g_source_remove(VAR); }
+#line 168 "mn-mailboxes.c"
+ memset(&timeout_id, 0, sizeof(timeout_id));
+#undef VAR
+#undef timeout_id
+#define delay_notification_id (self->_priv->delay_notification_id)
+#define VAR delay_notification_id
+ {
+#line 38 "mn-mailboxes.gob"
+ eel_gconf_notification_remove(VAR); }
+#line 177 "mn-mailboxes.c"
+ memset(&delay_notification_id, 0, sizeof(delay_notification_id));
+#undef VAR
+#undef delay_notification_id
+#define mailboxes_notification_id (self->_priv->mailboxes_notification_id)
+#define VAR mailboxes_notification_id
+ {
+#line 40 "mn-mailboxes.gob"
+ eel_gconf_notification_remove(VAR); }
+#line 186 "mn-mailboxes.c"
+ memset(&mailboxes_notification_id, 0, sizeof(mailboxes_notification_id));
+#undef VAR
+#undef mailboxes_notification_id
g_free (priv);
}
#undef __GOB_FUNCTION__
@@ -182,32 +220,32 @@ mn_mailboxes_class_init (MNMailboxesClass * c G_GNUC_UNUSED)
g_object_class->finalize = ___finalize;
}
#undef __GOB_FUNCTION__
-#line 42 "mn-mailboxes.gob"
+#line 47 "mn-mailboxes.gob"
static void
mn_mailboxes_init (MNMailboxes * self G_GNUC_UNUSED)
-#line 189 "mn-mailboxes.c"
+#line 227 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::init"
self->_priv = g_new0 (MNMailboxesPrivate, 1);
{
-#line 43 "mn-mailboxes.gob"
+#line 48 "mn-mailboxes.gob"
self_update_from_conf(self);
self_install_timeout(self);
- eel_gconf_notification_add(MN_CONF_DELAY_NAMESPACE, self_notify_delay_cb, self);
- eel_gconf_notification_add(MN_CONF_MAILBOXES, self_notify_mailboxes_cb, self);
+ selfp->delay_notification_id = eel_gconf_notification_add(MN_CONF_DELAY_NAMESPACE, self_notify_delay_cb, self);
+ selfp->mailboxes_notification_id = eel_gconf_notification_add(MN_CONF_MAILBOXES, self_notify_mailboxes_cb, self);
-#line 202 "mn-mailboxes.c"
+#line 240 "mn-mailboxes.c"
}
}
#undef __GOB_FUNCTION__
-#line 37 "mn-mailboxes.gob"
+#line 42 "mn-mailboxes.gob"
static void
mn_mailboxes_list_changed (MNMailboxes * self)
-#line 211 "mn-mailboxes.c"
+#line 249 "mn-mailboxes.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -215,11 +253,11 @@ mn_mailboxes_list_changed (MNMailboxes * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 37 "mn-mailboxes.gob"
+#line 42 "mn-mailboxes.gob"
g_return_if_fail (self != NULL);
-#line 37 "mn-mailboxes.gob"
+#line 42 "mn-mailboxes.gob"
g_return_if_fail (MN_IS_MAILBOXES (self));
-#line 223 "mn-mailboxes.c"
+#line 261 "mn-mailboxes.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -233,10 +271,10 @@ memset (&___param_values, 0, sizeof (___param_values));
g_value_unset (&___param_values[0]);
}
-#line 39 "mn-mailboxes.gob"
+#line 44 "mn-mailboxes.gob"
static void
mn_mailboxes_status_changed (MNMailboxes * self)
-#line 240 "mn-mailboxes.c"
+#line 278 "mn-mailboxes.c"
{
GValue ___param_values[1];
GValue ___return_val;
@@ -244,11 +282,11 @@ mn_mailboxes_status_changed (MNMailboxes * self)
memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));
-#line 39 "mn-mailboxes.gob"
+#line 44 "mn-mailboxes.gob"
g_return_if_fail (self != NULL);
-#line 39 "mn-mailboxes.gob"
+#line 44 "mn-mailboxes.gob"
g_return_if_fail (MN_IS_MAILBOXES (self));
-#line 252 "mn-mailboxes.c"
+#line 290 "mn-mailboxes.c"
___param_values[0].g_type = 0;
g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
@@ -263,55 +301,61 @@ memset (&___param_values, 0, sizeof (___param_values));
}
-#line 51 "mn-mailboxes.gob"
+#line 56 "mn-mailboxes.gob"
static void
mn_mailboxes_notify_delay_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data)
-#line 270 "mn-mailboxes.c"
+#line 308 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::notify_delay_cb"
-#line 51 "mn-mailboxes.gob"
+#line 56 "mn-mailboxes.gob"
g_return_if_fail (user_data != NULL);
-#line 275 "mn-mailboxes.c"
+#line 313 "mn-mailboxes.c"
{
-#line 56 "mn-mailboxes.gob"
+#line 61 "mn-mailboxes.gob"
Self *self = user_data;
+
+ GDK_THREADS_ENTER();
self_install_timeout(self);
+ GDK_THREADS_LEAVE();
}}
-#line 282 "mn-mailboxes.c"
+#line 323 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 61 "mn-mailboxes.gob"
+#line 69 "mn-mailboxes.gob"
static void
mn_mailboxes_notify_mailboxes_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data)
-#line 288 "mn-mailboxes.c"
+#line 329 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::notify_mailboxes_cb"
-#line 61 "mn-mailboxes.gob"
+#line 69 "mn-mailboxes.gob"
g_return_if_fail (user_data != NULL);
-#line 293 "mn-mailboxes.c"
+#line 334 "mn-mailboxes.c"
{
-#line 66 "mn-mailboxes.gob"
+#line 74 "mn-mailboxes.gob"
Self *self = user_data;
+
+ GDK_THREADS_ENTER();
self_update_from_conf(self);
+ GDK_THREADS_LEAVE();
}}
-#line 300 "mn-mailboxes.c"
+#line 344 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 71 "mn-mailboxes.gob"
+#line 82 "mn-mailboxes.gob"
static void
mn_mailboxes_update_from_conf (MNMailboxes * self)
-#line 306 "mn-mailboxes.c"
+#line 350 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::update_from_conf"
-#line 71 "mn-mailboxes.gob"
+#line 82 "mn-mailboxes.gob"
g_return_if_fail (self != NULL);
-#line 71 "mn-mailboxes.gob"
+#line 82 "mn-mailboxes.gob"
g_return_if_fail (MN_IS_MAILBOXES (self));
-#line 313 "mn-mailboxes.c"
+#line 357 "mn-mailboxes.c"
{
-#line 73 "mn-mailboxes.gob"
+#line 84 "mn-mailboxes.gob"
GSList *gconf_mailboxes;
GSList *l;
@@ -326,10 +370,9 @@ mn_mailboxes_update_from_conf (MNMailboxes * self)
{
MNMailbox *mailbox = l->data;
- if (! g_slist_find_custom(gconf_mailboxes, mn_mailbox_get_uri(mailbox), (GCompareFunc) mn_uri_cmp))
+ if (! self_conf_find_uri(gconf_mailboxes, mailbox->uri))
{
- g_object_unref(mailbox);
- selfp->list = g_slist_delete_link(selfp->list, l);
+ selfp->list = mn_g_object_slist_delete_link(selfp->list, l);
changed = TRUE;
goto loop;
}
@@ -339,47 +382,50 @@ mn_mailboxes_update_from_conf (MNMailboxes * self)
MN_LIST_FOREACH(l, gconf_mailboxes)
{
- const char *uri = l->data;
+ const char *text_uri = l->data;
+ MNURI *uri;
- if (! self_find(self, uri))
+ uri = mn_uri_new(text_uri);
+ if (! self_find_uri(self, uri))
{
MNMailbox *mailbox;
-
+
mailbox = mn_pending_mailbox_new(uri);
selfp->list = g_slist_append(selfp->list, mailbox);
changed = TRUE;
mn_mailbox_new_async(uri, self_new_cb, self);
}
+ g_object_unref(uri);
}
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
if (changed)
self_list_changed(self);
}}
-#line 361 "mn-mailboxes.c"
+#line 407 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 119 "mn-mailboxes.gob"
+#line 132 "mn-mailboxes.gob"
static void
mn_mailboxes_new_cb (MNMailbox * mailbox, gpointer user_data)
-#line 367 "mn-mailboxes.c"
+#line 413 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::new_cb"
-#line 119 "mn-mailboxes.gob"
+#line 132 "mn-mailboxes.gob"
g_return_if_fail (mailbox != NULL);
-#line 119 "mn-mailboxes.gob"
+#line 132 "mn-mailboxes.gob"
g_return_if_fail (MN_IS_MAILBOX (mailbox));
-#line 119 "mn-mailboxes.gob"
+#line 132 "mn-mailboxes.gob"
g_return_if_fail (user_data != NULL);
-#line 376 "mn-mailboxes.c"
+#line 422 "mn-mailboxes.c"
{
-#line 122 "mn-mailboxes.gob"
+#line 135 "mn-mailboxes.gob"
Self *self = user_data;
GSList *elem;
- elem = g_slist_find_custom(selfp->list, mn_mailbox_get_uri(mailbox), self_compare_func);
+ elem = self_find_uri(self, mailbox->uri);
if (elem)
{
if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
@@ -399,26 +445,26 @@ mn_mailboxes_new_cb (MNMailbox * mailbox, gpointer user_data)
else
g_object_unref(mailbox);
}}
-#line 403 "mn-mailboxes.c"
+#line 449 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 147 "mn-mailboxes.gob"
+#line 160 "mn-mailboxes.gob"
static void
mn_mailboxes_notify_has_new_h (GObject * object, GParamSpec * pspec, gpointer user_data)
-#line 409 "mn-mailboxes.c"
+#line 455 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::notify_has_new_h"
-#line 147 "mn-mailboxes.gob"
+#line 160 "mn-mailboxes.gob"
g_return_if_fail (object != NULL);
-#line 147 "mn-mailboxes.gob"
+#line 160 "mn-mailboxes.gob"
g_return_if_fail (G_IS_OBJECT (object));
-#line 147 "mn-mailboxes.gob"
+#line 160 "mn-mailboxes.gob"
g_return_if_fail (pspec != NULL);
-#line 147 "mn-mailboxes.gob"
+#line 160 "mn-mailboxes.gob"
g_return_if_fail (user_data != NULL);
-#line 420 "mn-mailboxes.c"
+#line 466 "mn-mailboxes.c"
{
-#line 151 "mn-mailboxes.gob"
+#line 164 "mn-mailboxes.gob"
Self *self = user_data;
MNMailbox *mailbox = MN_MAILBOX(object);
@@ -429,26 +475,26 @@ mn_mailboxes_notify_has_new_h (GObject * object, GParamSpec * pspec, gpointer us
self_status_changed(self);
}}
-#line 433 "mn-mailboxes.c"
+#line 479 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 162 "mn-mailboxes.gob"
+#line 175 "mn-mailboxes.gob"
static void
mn_mailboxes_notify_error_h (GObject * object, GParamSpec * pspec, gpointer user_data)
-#line 439 "mn-mailboxes.c"
+#line 485 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::notify_error_h"
-#line 162 "mn-mailboxes.gob"
+#line 175 "mn-mailboxes.gob"
g_return_if_fail (object != NULL);
-#line 162 "mn-mailboxes.gob"
+#line 175 "mn-mailboxes.gob"
g_return_if_fail (G_IS_OBJECT (object));
-#line 162 "mn-mailboxes.gob"
+#line 175 "mn-mailboxes.gob"
g_return_if_fail (pspec != NULL);
-#line 162 "mn-mailboxes.gob"
+#line 175 "mn-mailboxes.gob"
g_return_if_fail (user_data != NULL);
-#line 450 "mn-mailboxes.c"
+#line 496 "mn-mailboxes.c"
{
-#line 166 "mn-mailboxes.gob"
+#line 179 "mn-mailboxes.gob"
Self *self = user_data;
MNMailbox *mailbox = MN_MAILBOX(object);
@@ -460,22 +506,22 @@ mn_mailboxes_notify_error_h (GObject * object, GParamSpec * pspec, gpointer user
self_status_changed(self);
}}
-#line 464 "mn-mailboxes.c"
+#line 510 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 178 "mn-mailboxes.gob"
+#line 191 "mn-mailboxes.gob"
static void
mn_mailboxes_install_timeout (MNMailboxes * self)
-#line 470 "mn-mailboxes.c"
+#line 516 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::install_timeout"
-#line 178 "mn-mailboxes.gob"
+#line 191 "mn-mailboxes.gob"
g_return_if_fail (self != NULL);
-#line 178 "mn-mailboxes.gob"
+#line 191 "mn-mailboxes.gob"
g_return_if_fail (MN_IS_MAILBOXES (self));
-#line 477 "mn-mailboxes.c"
+#line 523 "mn-mailboxes.c"
{
-#line 180 "mn-mailboxes.gob"
+#line 193 "mn-mailboxes.gob"
int minutes;
int seconds;
@@ -494,20 +540,20 @@ mn_mailboxes_install_timeout (MNMailboxes * self)
self_timeout_cb,
self);
}}
-#line 498 "mn-mailboxes.c"
+#line 544 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 199 "mn-mailboxes.gob"
+#line 212 "mn-mailboxes.gob"
static gboolean
mn_mailboxes_timeout_cb (gpointer data)
-#line 504 "mn-mailboxes.c"
+#line 550 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::timeout_cb"
-#line 199 "mn-mailboxes.gob"
+#line 212 "mn-mailboxes.gob"
g_return_val_if_fail (data != NULL, (gboolean )0);
-#line 509 "mn-mailboxes.c"
+#line 555 "mn-mailboxes.c"
{
-#line 201 "mn-mailboxes.gob"
+#line 214 "mn-mailboxes.gob"
Self *self = data;
@@ -517,22 +563,22 @@ mn_mailboxes_timeout_cb (gpointer data)
return TRUE; /* continue */
}}
-#line 521 "mn-mailboxes.c"
+#line 567 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 211 "mn-mailboxes.gob"
+#line 224 "mn-mailboxes.gob"
void
mn_mailboxes_check (MNMailboxes * self)
-#line 527 "mn-mailboxes.c"
+#line 573 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::check"
-#line 211 "mn-mailboxes.gob"
+#line 224 "mn-mailboxes.gob"
g_return_if_fail (self != NULL);
-#line 211 "mn-mailboxes.gob"
+#line 224 "mn-mailboxes.gob"
g_return_if_fail (MN_IS_MAILBOXES (self));
-#line 534 "mn-mailboxes.c"
+#line 580 "mn-mailboxes.c"
{
-#line 213 "mn-mailboxes.gob"
+#line 226 "mn-mailboxes.gob"
GSList *l;
@@ -540,83 +586,208 @@ mn_mailboxes_check (MNMailboxes * self)
{
MNMailbox *mailbox = l->data;
- if (MN_MAILBOX_CAN_CHECK(mailbox))
+ if (MN_MAILBOX_CAN_CHECK(mailbox) && ! mn_mailbox_get_automatic(mailbox))
mn_mailbox_check(mailbox);
}
}}
-#line 548 "mn-mailboxes.c"
+#line 594 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 225 "mn-mailboxes.gob"
+#line 238 "mn-mailboxes.gob"
GSList *
mn_mailboxes_get (MNMailboxes * self)
-#line 554 "mn-mailboxes.c"
+#line 600 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::get"
-#line 225 "mn-mailboxes.gob"
+#line 238 "mn-mailboxes.gob"
g_return_val_if_fail (self != NULL, (GSList * )0);
-#line 225 "mn-mailboxes.gob"
+#line 238 "mn-mailboxes.gob"
g_return_val_if_fail (MN_IS_MAILBOXES (self), (GSList * )0);
-#line 561 "mn-mailboxes.c"
+#line 607 "mn-mailboxes.c"
{
-#line 227 "mn-mailboxes.gob"
+#line 240 "mn-mailboxes.gob"
return selfp->list;
}}
-#line 567 "mn-mailboxes.c"
+#line 613 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 231 "mn-mailboxes.gob"
-MNMailbox *
-mn_mailboxes_find (MNMailboxes * self, const char * uri)
-#line 573 "mn-mailboxes.c"
+#line 244 "mn-mailboxes.gob"
+GSList *
+mn_mailboxes_find (MNMailboxes * self, const char * text_uri)
+#line 619 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::find"
-#line 231 "mn-mailboxes.gob"
- g_return_val_if_fail (self != NULL, (MNMailbox * )0);
-#line 231 "mn-mailboxes.gob"
- g_return_val_if_fail (MN_IS_MAILBOXES (self), (MNMailbox * )0);
-#line 231 "mn-mailboxes.gob"
- g_return_val_if_fail (uri != NULL, (MNMailbox * )0);
-#line 582 "mn-mailboxes.c"
-{
-#line 233 "mn-mailboxes.gob"
+#line 244 "mn-mailboxes.gob"
+ g_return_val_if_fail (self != NULL, (GSList * )0);
+#line 244 "mn-mailboxes.gob"
+ g_return_val_if_fail (MN_IS_MAILBOXES (self), (GSList * )0);
+#line 244 "mn-mailboxes.gob"
+ g_return_val_if_fail (text_uri != NULL, (GSList * )0);
+#line 628 "mn-mailboxes.c"
+{
+#line 246 "mn-mailboxes.gob"
+ MNURI *uri;
GSList *elem;
- elem = g_slist_find_custom(selfp->list, uri, self_compare_func);
- return elem ? elem->data : NULL;
+ uri = mn_uri_new(text_uri);
+ elem = self_find_uri(self, uri);
+ g_object_unref(uri);
+
+ return elem;
}}
-#line 591 "mn-mailboxes.c"
+#line 641 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 240 "mn-mailboxes.gob"
+#line 257 "mn-mailboxes.gob"
+GSList *
+mn_mailboxes_find_uri (MNMailboxes * self, MNURI * uri)
+#line 647 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::find_uri"
+#line 257 "mn-mailboxes.gob"
+ g_return_val_if_fail (self != NULL, (GSList * )0);
+#line 257 "mn-mailboxes.gob"
+ g_return_val_if_fail (MN_IS_MAILBOXES (self), (GSList * )0);
+#line 257 "mn-mailboxes.gob"
+ g_return_val_if_fail (uri != NULL, (GSList * )0);
+#line 257 "mn-mailboxes.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (GSList * )0);
+#line 658 "mn-mailboxes.c"
+{
+#line 259 "mn-mailboxes.gob"
+
+ return g_slist_find_custom(selfp->list, uri, self_find_compare_func);
+ }}
+#line 664 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 263 "mn-mailboxes.gob"
static int
-mn_mailboxes_compare_func (gconstpointer a, gconstpointer b)
-#line 597 "mn-mailboxes.c"
+mn_mailboxes_find_compare_func (gconstpointer a, gconstpointer b)
+#line 670 "mn-mailboxes.c"
{
-#define __GOB_FUNCTION__ "MN:Mailboxes::compare_func"
+#define __GOB_FUNCTION__ "MN:Mailboxes::find_compare_func"
{
-#line 242 "mn-mailboxes.gob"
+#line 265 "mn-mailboxes.gob"
MNMailbox *mailbox = (MNMailbox *) a;
- const char *uri = b;
+ MNURI *uri = (MNURI *) b;
+
+ return strcmp(mailbox->uri->text, uri->text);
+ }}
+#line 681 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 272 "mn-mailboxes.gob"
+GSList *
+mn_mailboxes_conf_find (GSList * gconf_mailboxes, const char * text_uri)
+#line 687 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::conf_find"
+#line 272 "mn-mailboxes.gob"
+ g_return_val_if_fail (text_uri != NULL, (GSList * )0);
+#line 692 "mn-mailboxes.c"
+{
+#line 274 "mn-mailboxes.gob"
+
+ MNURI *uri;
+ GSList *elem;
+
+ uri = mn_uri_new(text_uri);
+ elem = self_conf_find_uri(gconf_mailboxes, uri);
+ g_object_unref(uri);
+
+ return elem;
+ }}
+#line 705 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 285 "mn-mailboxes.gob"
+GSList *
+mn_mailboxes_conf_find_uri (GSList * gconf_mailboxes, MNURI * uri)
+#line 711 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::conf_find_uri"
+#line 285 "mn-mailboxes.gob"
+ g_return_val_if_fail (uri != NULL, (GSList * )0);
+#line 285 "mn-mailboxes.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (GSList * )0);
+#line 718 "mn-mailboxes.c"
+{
+#line 287 "mn-mailboxes.gob"
+
+ return g_slist_find_custom(gconf_mailboxes, uri, self_conf_find_compare_func);
+ }}
+#line 724 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 291 "mn-mailboxes.gob"
+static int
+mn_mailboxes_conf_find_compare_func (gconstpointer a, gconstpointer b)
+#line 730 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::conf_find_compare_func"
+{
+#line 293 "mn-mailboxes.gob"
+
+ MNURI *uri_a;
+ MNURI *uri_b = (MNURI *) b;
+ int cmp;
+
+ uri_a = mn_uri_new(a);
+ cmp = strcmp(uri_a->text, uri_b->text);
+ g_object_unref(uri_a);
+
+ return cmp;
+ }}
+#line 746 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 305 "mn-mailboxes.gob"
+gboolean
+mn_mailboxes_has_manual (MNMailboxes * self)
+#line 752 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::has_manual"
+#line 305 "mn-mailboxes.gob"
+ g_return_val_if_fail (self != NULL, (gboolean )0);
+#line 305 "mn-mailboxes.gob"
+ g_return_val_if_fail (MN_IS_MAILBOXES (self), (gboolean )0);
+#line 759 "mn-mailboxes.c"
+{
+#line 307 "mn-mailboxes.gob"
+
+ gboolean has_manual = FALSE;
+ GSList *l;
+
+ MN_LIST_FOREACH(l, selfp->list)
+ {
+ MNMailbox *mailbox = l->data;
+
+ if (MN_MAILBOX_CAN_CHECK(mailbox) && ! mn_mailbox_get_automatic(mailbox))
+ {
+ has_manual = TRUE;
+ break;
+ }
+ }
- return mn_uri_cmp(mn_mailbox_get_uri(mailbox), uri);
+ return has_manual;
}}
-#line 608 "mn-mailboxes.c"
+#line 779 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
-#line 249 "mn-mailboxes.gob"
+#line 325 "mn-mailboxes.gob"
MNMailboxes *
mn_mailboxes_new (void)
-#line 614 "mn-mailboxes.c"
+#line 785 "mn-mailboxes.c"
{
#define __GOB_FUNCTION__ "MN:Mailboxes::new"
{
-#line 251 "mn-mailboxes.gob"
+#line 327 "mn-mailboxes.gob"
return MN_MAILBOXES(GET_NEW);
}}
-#line 622 "mn-mailboxes.c"
+#line 793 "mn-mailboxes.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-mailboxes.gob b/src/mn-mailboxes.gob
@@ -22,18 +22,23 @@
%{
#include "config.h"
#include <glib/gi18n-lib.h>
+#include <eel/eel.h>
#include "mn-conf.h"
#include "mn-util.h"
-#include "mn-uri.h"
#include "mn-pending-mailbox.h"
#include "mn-unsupported-mailbox.h"
%}
class MN:Mailboxes from G:Object
{
- private GSList *list;
- private unsigned int timeout_id;
-
+ private GSList *list destroywith mn_g_object_slist_free;
+ private unsigned int timeout_id
+ destroy { if (VAR) g_source_remove(VAR); };
+ private unsigned int delay_notification_id
+ destroy { eel_gconf_notification_remove(VAR); };
+ private unsigned int mailboxes_notification_id
+ destroy { eel_gconf_notification_remove(VAR); };
+
signal private NONE (NONE)
void list_changed (self);
signal private NONE (NONE)
@@ -44,8 +49,8 @@ class MN:Mailboxes from G:Object
self_update_from_conf(self);
self_install_timeout(self);
- eel_gconf_notification_add(MN_CONF_DELAY_NAMESPACE, self_notify_delay_cb, self);
- eel_gconf_notification_add(MN_CONF_MAILBOXES, self_notify_mailboxes_cb, self);
+ selfp->delay_notification_id = eel_gconf_notification_add(MN_CONF_DELAY_NAMESPACE, self_notify_delay_cb, self);
+ selfp->mailboxes_notification_id = eel_gconf_notification_add(MN_CONF_MAILBOXES, self_notify_mailboxes_cb, self);
}
private void
@@ -55,7 +60,10 @@ class MN:Mailboxes from G:Object
gpointer user_data (check null))
{
Self *self = user_data;
+
+ GDK_THREADS_ENTER();
self_install_timeout(self);
+ GDK_THREADS_LEAVE();
}
private void
@@ -65,7 +73,10 @@ class MN:Mailboxes from G:Object
gpointer user_data (check null))
{
Self *self = user_data;
+
+ GDK_THREADS_ENTER();
self_update_from_conf(self);
+ GDK_THREADS_LEAVE();
}
private void
@@ -84,10 +95,9 @@ class MN:Mailboxes from G:Object
{
MNMailbox *mailbox = l->data;
- if (! g_slist_find_custom(gconf_mailboxes, mn_mailbox_get_uri(mailbox), (GCompareFunc) mn_uri_cmp))
+ if (! self_conf_find_uri(gconf_mailboxes, mailbox->uri))
{
- g_object_unref(mailbox);
- selfp->list = g_slist_delete_link(selfp->list, l);
+ selfp->list = mn_g_object_slist_delete_link(selfp->list, l);
changed = TRUE;
goto loop;
}
@@ -97,21 +107,24 @@ class MN:Mailboxes from G:Object
MN_LIST_FOREACH(l, gconf_mailboxes)
{
- const char *uri = l->data;
+ const char *text_uri = l->data;
+ MNURI *uri;
- if (! self_find(self, uri))
+ uri = mn_uri_new(text_uri);
+ if (! self_find_uri(self, uri))
{
MNMailbox *mailbox;
-
+
mailbox = mn_pending_mailbox_new(uri);
selfp->list = g_slist_append(selfp->list, mailbox);
changed = TRUE;
mn_mailbox_new_async(uri, self_new_cb, self);
}
+ g_object_unref(uri);
}
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
if (changed)
self_list_changed(self);
}
@@ -123,7 +136,7 @@ class MN:Mailboxes from G:Object
Self *self = user_data;
GSList *elem;
- elem = g_slist_find_custom(selfp->list, mn_mailbox_get_uri(mailbox), self_compare_func);
+ elem = self_find_uri(self, mailbox->uri);
if (elem)
{
if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
@@ -217,7 +230,7 @@ class MN:Mailboxes from G:Object
{
MNMailbox *mailbox = l->data;
- if (MN_MAILBOX_CAN_CHECK(mailbox))
+ if (MN_MAILBOX_CAN_CHECK(mailbox) && ! mn_mailbox_get_automatic(mailbox))
mn_mailbox_check(mailbox);
}
}
@@ -228,24 +241,87 @@ class MN:Mailboxes from G:Object
return selfp->list;
}
- public MNMailbox *
- find (self, const char *uri (check null))
+ public GSList *
+ find (self, const char *text_uri (check null))
{
+ MNURI *uri;
GSList *elem;
- elem = g_slist_find_custom(selfp->list, uri, self_compare_func);
- return elem ? elem->data : NULL;
- }
+ uri = mn_uri_new(text_uri);
+ elem = self_find_uri(self, uri);
+ g_object_unref(uri);
+ return elem;
+ }
+
+ public GSList *
+ find_uri (self, MN:URI *uri (check null type))
+ {
+ return g_slist_find_custom(selfp->list, uri, self_find_compare_func);
+ }
+
private int
- compare_func (gconstpointer a, gconstpointer b)
+ find_compare_func (gconstpointer a, gconstpointer b)
{
MNMailbox *mailbox = (MNMailbox *) a;
- const char *uri = b;
+ MNURI *uri = (MNURI *) b;
- return mn_uri_cmp(mn_mailbox_get_uri(mailbox), uri);
+ return strcmp(mailbox->uri->text, uri->text);
}
+ public GSList *
+ conf_find (GSList *gconf_mailboxes, const char *text_uri (check null))
+ {
+ MNURI *uri;
+ GSList *elem;
+
+ uri = mn_uri_new(text_uri);
+ elem = self_conf_find_uri(gconf_mailboxes, uri);
+ g_object_unref(uri);
+
+ return elem;
+ }
+
+ public GSList *
+ conf_find_uri (GSList *gconf_mailboxes, MN:URI *uri (check null type))
+ {
+ return g_slist_find_custom(gconf_mailboxes, uri, self_conf_find_compare_func);
+ }
+
+ private int
+ conf_find_compare_func (gconstpointer a, gconstpointer b)
+ {
+ MNURI *uri_a;
+ MNURI *uri_b = (MNURI *) b;
+ int cmp;
+
+ uri_a = mn_uri_new(a);
+ cmp = strcmp(uri_a->text, uri_b->text);
+ g_object_unref(uri_a);
+
+ return cmp;
+ }
+
+ public gboolean
+ has_manual (self)
+ {
+ gboolean has_manual = FALSE;
+ GSList *l;
+
+ MN_LIST_FOREACH(l, selfp->list)
+ {
+ MNMailbox *mailbox = l->data;
+
+ if (MN_MAILBOX_CAN_CHECK(mailbox) && ! mn_mailbox_get_automatic(mailbox))
+ {
+ has_manual = TRUE;
+ break;
+ }
+ }
+
+ return has_manual;
+ }
+
public MNMailboxes *
new (void)
{
diff --git a/src/mn-mailboxes.h b/src/mn-mailboxes.h
@@ -58,8 +58,15 @@ struct _MNMailboxesClass {
GType mn_mailboxes_get_type (void);
void mn_mailboxes_check (MNMailboxes * self);
GSList * mn_mailboxes_get (MNMailboxes * self);
-MNMailbox * mn_mailboxes_find (MNMailboxes * self,
- const char * uri);
+GSList * mn_mailboxes_find (MNMailboxes * self,
+ const char * text_uri);
+GSList * mn_mailboxes_find_uri (MNMailboxes * self,
+ MNURI * uri);
+GSList * mn_mailboxes_conf_find (GSList * gconf_mailboxes,
+ const char * text_uri);
+GSList * mn_mailboxes_conf_find_uri (GSList * gconf_mailboxes,
+ MNURI * uri);
+gboolean mn_mailboxes_has_manual (MNMailboxes * self);
MNMailboxes * mn_mailboxes_new (void);
/*
diff --git a/src/mn-maildir-mailbox.c b/src/mn-maildir-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:30 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -47,7 +47,7 @@ typedef MNMaildirMailboxClass SelfClass;
static void mn_maildir_mailbox_init (MNMaildirMailbox * o) G_GNUC_UNUSED;
static void mn_maildir_mailbox_class_init (MNMaildirMailboxClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_maildir_mailbox_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
-static gboolean ___3_mn_maildir_mailbox_impl_is (MNMailbox * dummy, const char * uri) G_GNUC_UNUSED;
+static gboolean ___3_mn_maildir_mailbox_impl_is (MNMailbox * dummy, MNURI * uri) G_GNUC_UNUSED;
static void ___4_mn_maildir_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
/* pointer to the class of our parent */
@@ -114,9 +114,9 @@ mn_maildir_mailbox_class_init (MNMaildirMailboxClass * class G_GNUC_UNUSED)
#line 37 "mn-maildir-mailbox.gob"
g_object_class->constructor = ___2_mn_maildir_mailbox_constructor;
-#line 58 "mn-maildir-mailbox.gob"
+#line 65 "mn-maildir-mailbox.gob"
mn_mailbox_class->impl_is = ___3_mn_maildir_mailbox_impl_is;
-#line 80 "mn-maildir-mailbox.gob"
+#line 91 "mn-maildir-mailbox.gob"
mn_mailbox_class->impl_threaded_check = ___4_mn_maildir_mailbox_impl_threaded_check;
#line 122 "mn-maildir-mailbox.c"
{
@@ -151,85 +151,96 @@ ___2_mn_maildir_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
- new_uri = g_build_path("/", mn_mailbox_get_uri(self), "new", NULL);
+ new_uri = g_build_path("/", self->uri->text, "new", NULL);
+
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
new_uri,
GNOME_VFS_MONITOR_DIRECTORY,
MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
g_free(new_uri);
return object;
}}
-#line 165 "mn-maildir-mailbox.c"
+#line 172 "mn-maildir-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 58 "mn-maildir-mailbox.gob"
+#line 65 "mn-maildir-mailbox.gob"
static gboolean
-___3_mn_maildir_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
-#line 172 "mn-maildir-mailbox.c"
+___3_mn_maildir_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, MNURI * uri)
+#line 179 "mn-maildir-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
(* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
((gboolean )0))
{
#define __GOB_FUNCTION__ "MN:Maildir:Mailbox::impl_is"
-#line 58 "mn-maildir-mailbox.gob"
+#line 65 "mn-maildir-mailbox.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 181 "mn-maildir-mailbox.c"
+#line 188 "mn-maildir-mailbox.c"
{
-#line 60 "mn-maildir-mailbox.gob"
+#line 67 "mn-maildir-mailbox.gob"
- gboolean is;
- int i;
- const char *constitutive_dirs[] = { "cur", "new", "tmp" };
+ gboolean is = FALSE;
- for (i = 0; i < G_N_ELEMENTS(constitutive_dirs); i++)
+ if (uri->vfs)
{
- char *dir_uri;
+ int i;
+ const char *constitutive_dirs[] = { "cur", "new", "tmp" };
+
+ for (i = 0; i < G_N_ELEMENTS(constitutive_dirs); i++)
+ {
+ GnomeVFSURI *dir_uri;
- dir_uri = g_build_path("/", uri, constitutive_dirs[i], NULL);
- is = mn_vfs_test(dir_uri, G_FILE_TEST_IS_DIR);
- g_free(dir_uri);
+ dir_uri = gnome_vfs_uri_append_path(uri->vfs, constitutive_dirs[i]);
+ is = mn_vfs_test(dir_uri, G_FILE_TEST_IS_DIR);
+ gnome_vfs_uri_unref(dir_uri);
- if (! is)
- break;
+ if (! is)
+ break;
+ }
}
return is;
}}
-#line 203 "mn-maildir-mailbox.c"
+#line 214 "mn-maildir-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 80 "mn-maildir-mailbox.gob"
+#line 91 "mn-maildir-mailbox.gob"
static void
___4_mn_maildir_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
-#line 210 "mn-maildir-mailbox.c"
+#line 221 "mn-maildir-mailbox.c"
#define PARENT_HANDLER(___self) \
{ if(MN_MAILBOX_CLASS(parent_class)->impl_threaded_check) \
(* MN_MAILBOX_CLASS(parent_class)->impl_threaded_check)(___self); }
{
#define __GOB_FUNCTION__ "MN:Maildir:Mailbox::impl_threaded_check"
-#line 80 "mn-maildir-mailbox.gob"
+#line 91 "mn-maildir-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 80 "mn-maildir-mailbox.gob"
+#line 91 "mn-maildir-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 220 "mn-maildir-mailbox.c"
+#line 231 "mn-maildir-mailbox.c"
{
-#line 82 "mn-maildir-mailbox.gob"
+#line 93 "mn-maildir-mailbox.gob"
- char *new_uri;
+ GnomeVFSURI *new_uri;
GnomeVFSResult result;
GnomeVFSResult close_result;
GnomeVFSDirectoryHandle *handle;
GnomeVFSFileInfo *file_info;
gboolean has_new = FALSE;
- new_uri = g_build_path("/", mn_mailbox_get_uri(self), "new", NULL);
- result = gnome_vfs_directory_open(&handle, new_uri, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
- g_free(new_uri);
+ new_uri = gnome_vfs_uri_append_path(self->uri->vfs, "new");
+ result = gnome_vfs_directory_open_from_uri(&handle, new_uri, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+ gnome_vfs_uri_unref(new_uri);
if (result != GNOME_VFS_OK)
{
@@ -272,6 +283,6 @@ ___4_mn_maildir_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
gdk_flush();
GDK_THREADS_LEAVE();
}}
-#line 276 "mn-maildir-mailbox.c"
+#line 287 "mn-maildir-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
diff --git a/src/mn-maildir-mailbox.gob b/src/mn-maildir-mailbox.gob
@@ -44,34 +44,45 @@ class MN:Maildir:Mailbox from MN:Mailbox
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
- new_uri = g_build_path("/", mn_mailbox_get_uri(self), "new", NULL);
+ new_uri = g_build_path("/", self->uri->text, "new", NULL);
+
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
new_uri,
GNOME_VFS_MONITOR_DIRECTORY,
MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
g_free(new_uri);
return object;
}
override (MN:Mailbox) gboolean
- impl_is (MNMailbox *dummy, const char *uri (check null))
+ impl_is (MNMailbox *dummy, MN:URI *uri (check null))
{
- gboolean is;
- int i;
- const char *constitutive_dirs[] = { "cur", "new", "tmp" };
+ gboolean is = FALSE;
- for (i = 0; i < G_N_ELEMENTS(constitutive_dirs); i++)
+ if (uri->vfs)
{
- char *dir_uri;
+ int i;
+ const char *constitutive_dirs[] = { "cur", "new", "tmp" };
+
+ for (i = 0; i < G_N_ELEMENTS(constitutive_dirs); i++)
+ {
+ GnomeVFSURI *dir_uri;
- dir_uri = g_build_path("/", uri, constitutive_dirs[i], NULL);
- is = mn_vfs_test(dir_uri, G_FILE_TEST_IS_DIR);
- g_free(dir_uri);
+ dir_uri = gnome_vfs_uri_append_path(uri->vfs, constitutive_dirs[i]);
+ is = mn_vfs_test(dir_uri, G_FILE_TEST_IS_DIR);
+ gnome_vfs_uri_unref(dir_uri);
- if (! is)
- break;
+ if (! is)
+ break;
+ }
}
return is;
@@ -80,16 +91,16 @@ class MN:Maildir:Mailbox from MN:Mailbox
override (MN:Mailbox) void
impl_threaded_check (MN:Mailbox *self (check null type))
{
- char *new_uri;
+ GnomeVFSURI *new_uri;
GnomeVFSResult result;
GnomeVFSResult close_result;
GnomeVFSDirectoryHandle *handle;
GnomeVFSFileInfo *file_info;
gboolean has_new = FALSE;
- new_uri = g_build_path("/", mn_mailbox_get_uri(self), "new", NULL);
- result = gnome_vfs_directory_open(&handle, new_uri, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
- g_free(new_uri);
+ new_uri = gnome_vfs_uri_append_path(self->uri->vfs, "new");
+ result = gnome_vfs_directory_open_from_uri(&handle, new_uri, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+ gnome_vfs_uri_unref(new_uri);
if (result != GNOME_VFS_OK)
{
diff --git a/src/mn-main.c b/src/mn-main.c
@@ -25,7 +25,6 @@
#include "mn-util.h"
#include "mn-stock.h"
#include "mn-automation.h"
-#include "mn-dialog.h"
#include "mn-shell.h"
/*** cpp *********************************************************************/
@@ -88,7 +87,7 @@ mn_main_list_features (void)
features = g_string_new(NULL);
#ifdef WITH_SSL
- g_string_append(features, "SSL");
+ g_string_append(features, "SSL/TLS");
#endif /* WITH_SSL */
#ifdef WITH_SASL
if (*features->str)
@@ -123,6 +122,7 @@ main (int argc, char **argv)
gboolean arg_display_about = FALSE;
gboolean arg_update = FALSE;
gboolean arg_report = FALSE;
+ gboolean arg_unset_obsolete_configuration = FALSE;
const struct poptOption popt_options[] = {
{
"enable-info",
@@ -178,6 +178,15 @@ main (int argc, char **argv)
N_("Report the mail status"),
NULL
},
+ {
+ "unset-obsolete-configuration",
+ '\0',
+ POPT_ARG_NONE,
+ &arg_unset_obsolete_configuration,
+ 0,
+ N_("Unset obsolete GConf configuration and exit"),
+ NULL
+ },
POPT_TABLEEND
};
BonoboGenericFactory *automation_factory;
@@ -220,6 +229,12 @@ main (int argc, char **argv)
exit(0);
}
+ if (arg_unset_obsolete_configuration)
+ {
+ mn_conf_unset_obsolete();
+ exit(0);
+ }
+
/* mn-client-session uses sockets, we don't want to die on SIGPIPE */
signal(SIGPIPE, SIG_IGN);
diff --git a/src/mn-mbox-mailbox.c b/src/mn-mbox-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:30 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:00 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -48,7 +48,7 @@ typedef MNmboxMailboxClass SelfClass;
static void mn_mbox_mailbox_init (MNmboxMailbox * o) G_GNUC_UNUSED;
static void mn_mbox_mailbox_class_init (MNmboxMailboxClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_mbox_mailbox_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
-static gboolean ___3_mn_mbox_mailbox_impl_is (MNMailbox * dummy, const char * uri) G_GNUC_UNUSED;
+static gboolean ___3_mn_mbox_mailbox_impl_is (MNMailbox * dummy, MNURI * uri) G_GNUC_UNUSED;
static void ___4_mn_mbox_mailbox_impl_threaded_check (MNMailbox * mailbox) G_GNUC_UNUSED;
/* pointer to the class of our parent */
@@ -129,9 +129,9 @@ mn_mbox_mailbox_class_init (MNmboxMailboxClass * class G_GNUC_UNUSED)
#line 43 "mn-mbox-mailbox.gob"
g_object_class->constructor = ___2_mn_mbox_mailbox_constructor;
-#line 62 "mn-mbox-mailbox.gob"
+#line 67 "mn-mbox-mailbox.gob"
mn_mailbox_class->impl_is = ___3_mn_mbox_mailbox_impl_is;
-#line 99 "mn-mbox-mailbox.gob"
+#line 108 "mn-mbox-mailbox.gob"
mn_mailbox_class->impl_threaded_check = ___4_mn_mbox_mailbox_impl_threaded_check;
#line 137 "mn-mbox-mailbox.c"
g_object_class->finalize = ___finalize;
@@ -166,95 +166,103 @@ ___2_mn_mbox_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_pr
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
- mn_mailbox_get_uri(self),
+ self->uri->text,
GNOME_VFS_MONITOR_FILE,
MN_MAILBOX_MONITOR_EVENT_CHANGED
| MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
return object;
}}
-#line 179 "mn-mbox-mailbox.c"
+#line 184 "mn-mbox-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 62 "mn-mbox-mailbox.gob"
+#line 67 "mn-mbox-mailbox.gob"
static gboolean
-___3_mn_mbox_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
-#line 186 "mn-mbox-mailbox.c"
+___3_mn_mbox_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, MNURI * uri)
+#line 191 "mn-mbox-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
(* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
((gboolean )0))
{
#define __GOB_FUNCTION__ "MN:mbox:Mailbox::impl_is"
-#line 62 "mn-mbox-mailbox.gob"
+#line 67 "mn-mbox-mailbox.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 195 "mn-mbox-mailbox.c"
+#line 67 "mn-mbox-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 202 "mn-mbox-mailbox.c"
{
-#line 64 "mn-mbox-mailbox.gob"
+#line 69 "mn-mbox-mailbox.gob"
- GnomeVFSFileInfo *file_info;
gboolean is = FALSE;
- file_info = gnome_vfs_file_info_new();
- if (gnome_vfs_get_file_info(uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK
- && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE
- && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE
- && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR)
+ if (uri->vfs)
{
- if (file_info->size == 0) /* can be an empty mbox */
- is = TRUE;
- else
+ GnomeVFSFileInfo *file_info;
+
+ file_info = gnome_vfs_file_info_new();
+ if (gnome_vfs_get_file_info_uri(uri->vfs, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK
+ && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE
+ && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE
+ && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR)
{
- GnomeVFSHandle *handle;
-
- if (gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ) == GNOME_VFS_OK)
+ if (file_info->size == 0) /* can be an empty mbox */
+ is = TRUE;
+ else
{
- char buf[5];
- GnomeVFSFileSize bytes_read;
+ GnomeVFSHandle *handle;
+
+ if (gnome_vfs_open_uri(&handle, uri->vfs, GNOME_VFS_OPEN_READ) == GNOME_VFS_OK)
+ {
+ char buf[5];
+ GnomeVFSFileSize bytes_read;
- if (gnome_vfs_read(handle, buf, sizeof(buf), &bytes_read) == GNOME_VFS_OK
- && bytes_read == sizeof(buf)
- && ! strncmp(buf, "From ", sizeof(buf)))
- is = TRUE;
+ if (gnome_vfs_read(handle, buf, sizeof(buf), &bytes_read) == GNOME_VFS_OK
+ && bytes_read == sizeof(buf)
+ && ! strncmp(buf, "From ", sizeof(buf)))
+ is = TRUE;
- gnome_vfs_close(handle);
+ gnome_vfs_close(handle);
+ }
}
}
+ gnome_vfs_file_info_unref(file_info);
}
- gnome_vfs_file_info_unref(file_info);
return is;
}}
-#line 232 "mn-mbox-mailbox.c"
+#line 243 "mn-mbox-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 99 "mn-mbox-mailbox.gob"
+#line 108 "mn-mbox-mailbox.gob"
static void
___4_mn_mbox_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
-#line 239 "mn-mbox-mailbox.c"
+#line 250 "mn-mbox-mailbox.c"
#define PARENT_HANDLER(___mailbox) \
{ if(MN_MAILBOX_CLASS(parent_class)->impl_threaded_check) \
(* MN_MAILBOX_CLASS(parent_class)->impl_threaded_check)(___mailbox); }
{
#define __GOB_FUNCTION__ "MN:mbox:Mailbox::impl_threaded_check"
-#line 99 "mn-mbox-mailbox.gob"
+#line 108 "mn-mbox-mailbox.gob"
g_return_if_fail (mailbox != NULL);
-#line 99 "mn-mbox-mailbox.gob"
+#line 108 "mn-mbox-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (mailbox));
-#line 249 "mn-mbox-mailbox.c"
+#line 260 "mn-mbox-mailbox.c"
{
-#line 101 "mn-mbox-mailbox.gob"
+#line 110 "mn-mbox-mailbox.gob"
Self *self = SELF(mailbox);
- const char *uri;
gboolean check = TRUE;
- uri = mn_mailbox_get_uri(mailbox);
-
if (! mn_mailbox_get_automatic(mailbox))
{
GnomeVFSFileInfo *file_info;
@@ -262,7 +270,7 @@ ___4_mn_mbox_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
/* we're polling, so check only if the mailbox has changed since our last check */
file_info = gnome_vfs_file_info_new();
- if (gnome_vfs_get_file_info(uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK)
+ if (gnome_vfs_get_file_info_uri(mailbox->uri->vfs, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK)
{
if (file_info->mtime == selfp->last_mtime)
check = FALSE;
@@ -277,7 +285,7 @@ ___4_mn_mbox_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
GnomeVFSResult result;
GnomeVFSHandle *handle;
- result = gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ);
+ result = gnome_vfs_open_uri(&handle, mailbox->uri->vfs, GNOME_VFS_OPEN_READ);
if (result == GNOME_VFS_OK)
{
MNVFSReadLineContext *context = NULL;
@@ -331,6 +339,6 @@ ___4_mn_mbox_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
gdk_flush();
GDK_THREADS_LEAVE();
}}
-#line 335 "mn-mbox-mailbox.c"
+#line 343 "mn-mbox-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
diff --git a/src/mn-mbox-mailbox.gob b/src/mn-mbox-mailbox.gob
@@ -49,49 +49,58 @@ class MN:mbox:Mailbox from MN:Mailbox
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
- mn_mailbox_get_uri(self),
+ self->uri->text,
GNOME_VFS_MONITOR_FILE,
MN_MAILBOX_MONITOR_EVENT_CHANGED
| MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
return object;
}
override (MN:Mailbox) gboolean
- impl_is (MNMailbox *dummy, const char *uri (check null))
+ impl_is (MNMailbox *dummy, MN:URI *uri (check null type))
{
- GnomeVFSFileInfo *file_info;
gboolean is = FALSE;
- file_info = gnome_vfs_file_info_new();
- if (gnome_vfs_get_file_info(uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK
- && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE
- && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE
- && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR)
+ if (uri->vfs)
{
- if (file_info->size == 0) /* can be an empty mbox */
- is = TRUE;
- else
+ GnomeVFSFileInfo *file_info;
+
+ file_info = gnome_vfs_file_info_new();
+ if (gnome_vfs_get_file_info_uri(uri->vfs, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK
+ && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE
+ && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE
+ && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR)
{
- GnomeVFSHandle *handle;
-
- if (gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ) == GNOME_VFS_OK)
+ if (file_info->size == 0) /* can be an empty mbox */
+ is = TRUE;
+ else
{
- char buf[5];
- GnomeVFSFileSize bytes_read;
+ GnomeVFSHandle *handle;
+
+ if (gnome_vfs_open_uri(&handle, uri->vfs, GNOME_VFS_OPEN_READ) == GNOME_VFS_OK)
+ {
+ char buf[5];
+ GnomeVFSFileSize bytes_read;
- if (gnome_vfs_read(handle, buf, sizeof(buf), &bytes_read) == GNOME_VFS_OK
- && bytes_read == sizeof(buf)
- && ! strncmp(buf, "From ", sizeof(buf)))
- is = TRUE;
+ if (gnome_vfs_read(handle, buf, sizeof(buf), &bytes_read) == GNOME_VFS_OK
+ && bytes_read == sizeof(buf)
+ && ! strncmp(buf, "From ", sizeof(buf)))
+ is = TRUE;
- gnome_vfs_close(handle);
+ gnome_vfs_close(handle);
+ }
}
}
+ gnome_vfs_file_info_unref(file_info);
}
- gnome_vfs_file_info_unref(file_info);
return is;
}
@@ -100,11 +109,8 @@ class MN:mbox:Mailbox from MN:Mailbox
impl_threaded_check (MN:Mailbox *mailbox (check null type))
{
Self *self = SELF(mailbox);
- const char *uri;
gboolean check = TRUE;
- uri = mn_mailbox_get_uri(mailbox);
-
if (! mn_mailbox_get_automatic(mailbox))
{
GnomeVFSFileInfo *file_info;
@@ -112,7 +118,7 @@ class MN:mbox:Mailbox from MN:Mailbox
/* we're polling, so check only if the mailbox has changed since our last check */
file_info = gnome_vfs_file_info_new();
- if (gnome_vfs_get_file_info(uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK)
+ if (gnome_vfs_get_file_info_uri(mailbox->uri->vfs, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) == GNOME_VFS_OK)
{
if (file_info->mtime == selfp->last_mtime)
check = FALSE;
@@ -127,7 +133,7 @@ class MN:mbox:Mailbox from MN:Mailbox
GnomeVFSResult result;
GnomeVFSHandle *handle;
- result = gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ);
+ result = gnome_vfs_open_uri(&handle, mailbox->uri->vfs, GNOME_VFS_OPEN_READ);
if (result == GNOME_VFS_OK)
{
MNVFSReadLineContext *context = NULL;
diff --git a/src/mn-md5.c b/src/mn-md5.c
@@ -22,7 +22,7 @@
* These notices must be retained in any copies of any part of this
* documentation and/or software.
*
- * This code is the same as the code published by RSA Inc. It has been
+ * This code is the same as the code published by RSA Inc. It has been
* edited for clarity and style only.
*/
@@ -33,16 +33,16 @@
/*** cpp *********************************************************************/
-#ifdef i386
+#if defined(i386) || defined(__i386) || defined(__i386__)
#define mn_md5_encode memcpy
#define mn_md5_decode memcpy
-#else /* i386 */
+#else /* i386 || __i386 || __i386__ */
/*
* Encodes input (u_int32_t) into output (unsigned char). Assumes len
* is a multiple of 4.
*/
static void
-mn_md5_encode (unsigned char *output, u_int32_t input, unsigned int len)
+mn_md5_encode (unsigned char *output, u_int32_t *input, unsigned int len)
{
unsigned int i, j;
@@ -68,7 +68,7 @@ mn_md5_decode (u_int32_t *output, const unsigned char *input, unsigned int len)
output[i] = ((u_int32_t) input[j]) | (((u_int32_t) input[j + 1]) << 8) |
(((u_int32_t) input[j + 2]) << 16) | (((u_int32_t) input[j + 3]) << 24);
}
-#endif /* i386 */
+#endif /* i386 || __i386 || __i386__ */
/* F, G, H and I are basic MD5 functions */
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
diff --git a/src/mn-mh-mailbox.c b/src/mn-mh-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:30 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:00 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -49,7 +49,7 @@ typedef MNMHMailboxClass SelfClass;
static void mn_mh_mailbox_init (MNMHMailbox * o) G_GNUC_UNUSED;
static void mn_mh_mailbox_class_init (MNMHMailboxClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_mh_mailbox_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
-static gboolean ___3_mn_mh_mailbox_impl_is (MNMailbox * dummy, const char * uri) G_GNUC_UNUSED;
+static gboolean ___3_mn_mh_mailbox_impl_is (MNMailbox * dummy, MNURI * uri) G_GNUC_UNUSED;
static void ___4_mn_mh_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
/* pointer to the class of our parent */
@@ -116,9 +116,9 @@ mn_mh_mailbox_class_init (MNMHMailboxClass * class G_GNUC_UNUSED)
#line 39 "mn-mh-mailbox.gob"
g_object_class->constructor = ___2_mn_mh_mailbox_constructor;
-#line 61 "mn-mh-mailbox.gob"
+#line 68 "mn-mh-mailbox.gob"
mn_mailbox_class->impl_is = ___3_mn_mh_mailbox_impl_is;
-#line 74 "mn-mh-mailbox.gob"
+#line 85 "mn-mh-mailbox.gob"
mn_mailbox_class->impl_threaded_check = ___4_mn_mh_mailbox_impl_threaded_check;
#line 124 "mn-mh-mailbox.c"
{
@@ -153,74 +153,87 @@ ___2_mn_mh_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_prop
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
- sequences_uri = g_build_path("/", mn_mailbox_get_uri(self), ".mh_sequences", NULL);
+ sequences_uri = g_build_path("/", self->uri->text, ".mh_sequences", NULL);
+
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
sequences_uri,
GNOME_VFS_MONITOR_FILE,
MN_MAILBOX_MONITOR_EVENT_CHANGED
| MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
g_free(sequences_uri);
return object;
}}
-#line 168 "mn-mh-mailbox.c"
+#line 175 "mn-mh-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 61 "mn-mh-mailbox.gob"
+#line 68 "mn-mh-mailbox.gob"
static gboolean
-___3_mn_mh_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
-#line 175 "mn-mh-mailbox.c"
+___3_mn_mh_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, MNURI * uri)
+#line 182 "mn-mh-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
(* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
((gboolean )0))
{
#define __GOB_FUNCTION__ "MN:MH:Mailbox::impl_is"
-#line 61 "mn-mh-mailbox.gob"
+#line 68 "mn-mh-mailbox.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 184 "mn-mh-mailbox.c"
+#line 68 "mn-mh-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 193 "mn-mh-mailbox.c"
{
-#line 63 "mn-mh-mailbox.gob"
+#line 70 "mn-mh-mailbox.gob"
- char *sequences_uri;
- gboolean is;
+ gboolean is = FALSE;
- sequences_uri = g_build_path("/", uri, ".mh_sequences", NULL);
- is = mn_vfs_test(sequences_uri, G_FILE_TEST_IS_REGULAR);
- g_free(sequences_uri);
+ if (uri->vfs)
+ {
+ GnomeVFSURI *sequences_uri;
+
+ sequences_uri = gnome_vfs_uri_append_file_name(uri->vfs, ".mh_sequences");
+ is = mn_vfs_test(sequences_uri, G_FILE_TEST_IS_REGULAR);
+ gnome_vfs_uri_unref(sequences_uri);
+ }
return is;
}}
-#line 197 "mn-mh-mailbox.c"
+#line 210 "mn-mh-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 74 "mn-mh-mailbox.gob"
+#line 85 "mn-mh-mailbox.gob"
static void
___4_mn_mh_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
-#line 204 "mn-mh-mailbox.c"
+#line 217 "mn-mh-mailbox.c"
#define PARENT_HANDLER(___self) \
{ if(MN_MAILBOX_CLASS(parent_class)->impl_threaded_check) \
(* MN_MAILBOX_CLASS(parent_class)->impl_threaded_check)(___self); }
{
#define __GOB_FUNCTION__ "MN:MH:Mailbox::impl_threaded_check"
-#line 74 "mn-mh-mailbox.gob"
+#line 85 "mn-mh-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 74 "mn-mh-mailbox.gob"
+#line 85 "mn-mh-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 214 "mn-mh-mailbox.c"
+#line 227 "mn-mh-mailbox.c"
{
-#line 76 "mn-mh-mailbox.gob"
+#line 87 "mn-mh-mailbox.gob"
- char *sequences_uri;
+ GnomeVFSURI *sequences_uri;
GnomeVFSResult result;
GnomeVFSHandle *handle;
- sequences_uri = g_build_path("/", mn_mailbox_get_uri(self), ".mh_sequences", NULL);
- result = gnome_vfs_open(&handle, sequences_uri, GNOME_VFS_OPEN_READ);
- g_free(sequences_uri);
+ sequences_uri = gnome_vfs_uri_append_file_name(self->uri->vfs, ".mh_sequences");
+ result = gnome_vfs_open_uri(&handle, sequences_uri, GNOME_VFS_OPEN_READ);
+ gnome_vfs_uri_unref(sequences_uri);
if (result == GNOME_VFS_OK)
{
@@ -266,6 +279,6 @@ ___4_mn_mh_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
gdk_flush();
GDK_THREADS_LEAVE();
}}
-#line 270 "mn-mh-mailbox.c"
+#line 283 "mn-mh-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
diff --git a/src/mn-mh-mailbox.gob b/src/mn-mh-mailbox.gob
@@ -46,27 +46,38 @@ class MN:MH:Mailbox from MN:Mailbox
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
- sequences_uri = g_build_path("/", mn_mailbox_get_uri(self), ".mh_sequences", NULL);
+ sequences_uri = g_build_path("/", self->uri->text, ".mh_sequences", NULL);
+
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
sequences_uri,
GNOME_VFS_MONITOR_FILE,
MN_MAILBOX_MONITOR_EVENT_CHANGED
| MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
g_free(sequences_uri);
return object;
}
override (MN:Mailbox) gboolean
- impl_is (MNMailbox *dummy, const char *uri (check null))
+ impl_is (MNMailbox *dummy, MN:URI *uri (check null type))
{
- char *sequences_uri;
- gboolean is;
+ gboolean is = FALSE;
- sequences_uri = g_build_path("/", uri, ".mh_sequences", NULL);
- is = mn_vfs_test(sequences_uri, G_FILE_TEST_IS_REGULAR);
- g_free(sequences_uri);
+ if (uri->vfs)
+ {
+ GnomeVFSURI *sequences_uri;
+
+ sequences_uri = gnome_vfs_uri_append_file_name(uri->vfs, ".mh_sequences");
+ is = mn_vfs_test(sequences_uri, G_FILE_TEST_IS_REGULAR);
+ gnome_vfs_uri_unref(sequences_uri);
+ }
return is;
}
@@ -74,13 +85,13 @@ class MN:MH:Mailbox from MN:Mailbox
override (MN:Mailbox) void
impl_threaded_check (MN:Mailbox *self (check null type))
{
- char *sequences_uri;
+ GnomeVFSURI *sequences_uri;
GnomeVFSResult result;
GnomeVFSHandle *handle;
- sequences_uri = g_build_path("/", mn_mailbox_get_uri(self), ".mh_sequences", NULL);
- result = gnome_vfs_open(&handle, sequences_uri, GNOME_VFS_OPEN_READ);
- g_free(sequences_uri);
+ sequences_uri = gnome_vfs_uri_append_file_name(self->uri->vfs, ".mh_sequences");
+ result = gnome_vfs_open_uri(&handle, sequences_uri, GNOME_VFS_OPEN_READ);
+ gnome_vfs_uri_unref(sequences_uri);
if (result == GNOME_VFS_OK)
{
diff --git a/src/mn-pending-mailbox.c b/src/mn-pending-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -122,17 +122,19 @@ mn_pending_mailbox_class_init (MNPendingMailboxClass * class G_GNUC_UNUSED)
#line 36 "mn-pending-mailbox.gob"
MNMailbox *
-mn_pending_mailbox_new (const char * uri)
+mn_pending_mailbox_new (MNURI * uri)
#line 127 "mn-pending-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Pending:Mailbox::new"
#line 36 "mn-pending-mailbox.gob"
g_return_val_if_fail (uri != NULL, (MNMailbox * )0);
-#line 132 "mn-pending-mailbox.c"
+#line 36 "mn-pending-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (MNMailbox * )0);
+#line 134 "mn-pending-mailbox.c"
{
#line 38 "mn-pending-mailbox.gob"
- return g_object_new(TYPE_SELF, MN_MAILBOX_PROP_URI((char *) uri), NULL);
+ return g_object_new(TYPE_SELF, MN_MAILBOX_PROP_URI(G_OBJECT(uri)), NULL);
}}
-#line 138 "mn-pending-mailbox.c"
+#line 140 "mn-pending-mailbox.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-pending-mailbox.gob b/src/mn-pending-mailbox.gob
@@ -34,8 +34,8 @@ class MN:Pending:Mailbox from MN:Mailbox
}
public MNMailbox *
- new (const char *uri (check null))
+ new (MN:URI *uri (check null type))
{
- return g_object_new(TYPE_SELF, MN_MAILBOX_PROP_URI((char *) uri), NULL);
+ return g_object_new(TYPE_SELF, MN_MAILBOX_PROP_URI(G_OBJECT(uri)), NULL);
}
}
diff --git a/src/mn-pending-mailbox.h b/src/mn-pending-mailbox.h
@@ -49,7 +49,7 @@ struct _MNPendingMailboxClass {
* Public methods
*/
GType mn_pending_mailbox_get_type (void);
-MNMailbox * mn_pending_mailbox_new (const char * uri);
+MNMailbox * mn_pending_mailbox_new (MNURI * uri);
#ifdef __cplusplus
}
diff --git a/src/mn-pi-mailbox-properties.c b/src/mn-pi-mailbox-properties.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -27,11 +27,10 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
-#line 35 "mn-pi-mailbox-properties.c"
+#line 34 "mn-pi-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_PI_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_PI_MAILBOX_PROPERTIES_CONST(x)
@@ -136,12 +135,12 @@ ___dispose (GObject *obj_self)
MNPIMailboxProperties *self G_GNUC_UNUSED = MN_PI_MAILBOX_PROPERTIES (obj_self);
if (G_OBJECT_CLASS (parent_class)->dispose) \
(* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
-#line 43 "mn-pi-mailbox-properties.gob"
+#line 42 "mn-pi-mailbox-properties.gob"
if(self->size_group) { ((*(void (*)(void *))g_object_unref)) (self->size_group); self->size_group = NULL; }
-#line 142 "mn-pi-mailbox-properties.c"
-#line 49 "mn-pi-mailbox-properties.gob"
+#line 141 "mn-pi-mailbox-properties.c"
+#line 48 "mn-pi-mailbox-properties.gob"
if(self->tooltips) { ((*(void (*)(void *))g_object_unref)) (self->tooltips); self->tooltips = NULL; }
-#line 145 "mn-pi-mailbox-properties.c"
+#line 144 "mn-pi-mailbox-properties.c"
}
#undef __GOB_FUNCTION__
@@ -149,9 +148,9 @@ static void
mn_pi_mailbox_properties_init (MNPIMailboxProperties * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::init"
-#line 49 "mn-pi-mailbox-properties.gob"
+#line 48 "mn-pi-mailbox-properties.gob"
o->tooltips = mn_tooltips_new();
-#line 155 "mn-pi-mailbox-properties.c"
+#line 154 "mn-pi-mailbox-properties.c"
}
#undef __GOB_FUNCTION__
static void
@@ -162,9 +161,9 @@ mn_pi_mailbox_properties_class_init (MNPIMailboxPropertiesClass * c G_GNUC_UNUSE
parent_class = g_type_class_ref (GTK_TYPE_VBOX);
-#line 56 "mn-pi-mailbox-properties.gob"
+#line 55 "mn-pi-mailbox-properties.gob"
g_object_class->constructor = ___1_mn_pi_mailbox_properties_constructor;
-#line 168 "mn-pi-mailbox-properties.c"
+#line 167 "mn-pi-mailbox-properties.c"
g_object_class->dispose = ___dispose;
g_object_class->get_property = ___object_get_property;
g_object_class->set_property = ___object_set_property;
@@ -196,9 +195,9 @@ ___object_set_property (GObject *object,
switch (property_id) {
case PROP_SIZE_GROUP:
{
-#line 44 "mn-pi-mailbox-properties.gob"
+#line 43 "mn-pi-mailbox-properties.gob"
{ GObject *___old = (GObject *)self->size_group; self->size_group = (void *)g_value_dup_object (VAL); if (___old != NULL) { g_object_unref (G_OBJECT (___old)); } }
-#line 202 "mn-pi-mailbox-properties.c"
+#line 201 "mn-pi-mailbox-properties.c"
}
break;
default:
@@ -227,23 +226,23 @@ ___object_get_property (GObject *object,
switch (property_id) {
case PROP_COMPLETE:
{
-#line 38 "mn-pi-mailbox-properties.gob"
+#line 37 "mn-pi-mailbox-properties.gob"
-#line 233 "mn-pi-mailbox-properties.c"
+#line 232 "mn-pi-mailbox-properties.c"
}
break;
case PROP_LABEL:
{
-#line 41 "mn-pi-mailbox-properties.gob"
+#line 40 "mn-pi-mailbox-properties.gob"
g_value_set_string(VAL, SELF_GET_CLASS(self)->label);
-#line 240 "mn-pi-mailbox-properties.c"
+#line 239 "mn-pi-mailbox-properties.c"
}
break;
case PROP_SIZE_GROUP:
{
-#line 44 "mn-pi-mailbox-properties.gob"
+#line 43 "mn-pi-mailbox-properties.gob"
g_value_set_object (VAL, (gpointer)self->size_group);
-#line 247 "mn-pi-mailbox-properties.c"
+#line 246 "mn-pi-mailbox-properties.c"
}
break;
default:
@@ -260,10 +259,10 @@ g_value_set_object (VAL, (gpointer)self->size_group);
-#line 56 "mn-pi-mailbox-properties.gob"
+#line 55 "mn-pi-mailbox-properties.gob"
static GObject *
___1_mn_pi_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
-#line 267 "mn-pi-mailbox-properties.c"
+#line 266 "mn-pi-mailbox-properties.c"
#define PARENT_HANDLER(___type,___n_construct_properties,___construct_params) \
((G_OBJECT_CLASS(parent_class)->constructor)? \
(* G_OBJECT_CLASS(parent_class)->constructor)(___type,___n_construct_properties,___construct_params): \
@@ -271,7 +270,7 @@ ___1_mn_pi_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_con
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::constructor"
{
-#line 58 "mn-pi-mailbox-properties.gob"
+#line 57 "mn-pi-mailbox-properties.gob"
GObject *object;
Self *self;
@@ -329,8 +328,8 @@ ___1_mn_pi_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_con
gtk_size_group_add_widget(radio_size_group, self->conn_radio[0]);
mn_mailbox_properties_connection_type_new(GTK_VBOX(self->details_vbox),
- _("_SSL"),
- SELF_GET_CLASS(self)->default_port[1],
+ _("_in-band SSL/TLS"),
+ SELF_GET_CLASS(self)->default_port[0],
GTK_RADIO_BUTTON(self->conn_radio[0]),
&label1,
&self->conn_radio[1],
@@ -338,14 +337,26 @@ ___1_mn_pi_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_con
gtk_size_group_add_widget(self->details_size_group, label1);
gtk_size_group_add_widget(radio_size_group, self->conn_radio[1]);
+ mn_mailbox_properties_connection_type_new(GTK_VBOX(self->details_vbox),
+ _("SSL/TLS on sepa_rate port"),
+ SELF_GET_CLASS(self)->default_port[1],
+ GTK_RADIO_BUTTON(self->conn_radio[0]),
+ &label1,
+ &self->conn_radio[2],
+ &self->port_spin[2]);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ gtk_size_group_add_widget(radio_size_group, self->conn_radio[2]);
+
g_object_unref(radio_size_group);
#ifndef WITH_SSL
gtk_widget_set_sensitive(self->conn_radio[1], FALSE);
+ gtk_widget_set_sensitive(self->conn_radio[2], FALSE);
#endif
/* by default, standard is enabled */
gtk_widget_set_sensitive(self->port_spin[1], FALSE);
+ gtk_widget_set_sensitive(self->port_spin[2], FALSE);
mn_mailbox_properties_authentication_new(GTK_VBOX(self->details_vbox),
&label1,
@@ -359,7 +370,7 @@ ___1_mn_pi_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_con
g_signal_connect(G_OBJECT(expander), "notify::expanded", G_CALLBACK(self_notify_expanded_h), self);
- for (i = 0; i < 2; i++)
+ for (i = 0; i < 3; i++)
g_signal_connect(G_OBJECT(self->conn_radio[i]), "toggled", G_CALLBACK(self_radio_toggled_h), self);
g_signal_connect(G_OBJECT(self->hostname_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
@@ -368,27 +379,27 @@ ___1_mn_pi_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_con
return object;
}}
-#line 372 "mn-pi-mailbox-properties.c"
+#line 383 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 155 "mn-pi-mailbox-properties.gob"
+#line 166 "mn-pi-mailbox-properties.gob"
static void
mn_pi_mailbox_properties_notify_expanded_h (GObject * object, GParamSpec * pspec, gpointer user_data)
-#line 379 "mn-pi-mailbox-properties.c"
+#line 390 "mn-pi-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::notify_expanded_h"
-#line 155 "mn-pi-mailbox-properties.gob"
+#line 166 "mn-pi-mailbox-properties.gob"
g_return_if_fail (object != NULL);
-#line 155 "mn-pi-mailbox-properties.gob"
+#line 166 "mn-pi-mailbox-properties.gob"
g_return_if_fail (G_IS_OBJECT (object));
-#line 155 "mn-pi-mailbox-properties.gob"
+#line 166 "mn-pi-mailbox-properties.gob"
g_return_if_fail (pspec != NULL);
-#line 155 "mn-pi-mailbox-properties.gob"
+#line 166 "mn-pi-mailbox-properties.gob"
g_return_if_fail (user_data != NULL);
-#line 390 "mn-pi-mailbox-properties.c"
+#line 401 "mn-pi-mailbox-properties.c"
{
-#line 159 "mn-pi-mailbox-properties.gob"
+#line 170 "mn-pi-mailbox-properties.gob"
Self *self = user_data;
@@ -397,110 +408,116 @@ mn_pi_mailbox_properties_notify_expanded_h (GObject * object, GParamSpec * pspec
? GTK_SIZE_GROUP_HORIZONTAL
: GTK_SIZE_GROUP_NONE);
}}
-#line 401 "mn-pi-mailbox-properties.c"
+#line 412 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 168 "mn-pi-mailbox-properties.gob"
+#line 179 "mn-pi-mailbox-properties.gob"
void
mn_pi_mailbox_properties_entry_changed_h (GtkEditable * editable, gpointer user_data)
-#line 407 "mn-pi-mailbox-properties.c"
+#line 418 "mn-pi-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::entry_changed_h"
-#line 168 "mn-pi-mailbox-properties.gob"
+#line 179 "mn-pi-mailbox-properties.gob"
g_return_if_fail (editable != NULL);
-#line 168 "mn-pi-mailbox-properties.gob"
+#line 179 "mn-pi-mailbox-properties.gob"
g_return_if_fail (GTK_IS_EDITABLE (editable));
-#line 168 "mn-pi-mailbox-properties.gob"
+#line 179 "mn-pi-mailbox-properties.gob"
g_return_if_fail (user_data != NULL);
-#line 416 "mn-pi-mailbox-properties.c"
+#line 427 "mn-pi-mailbox-properties.c"
{
-#line 171 "mn-pi-mailbox-properties.gob"
+#line 182 "mn-pi-mailbox-properties.gob"
Self *self = user_data;
g_object_notify(G_OBJECT(self), "complete");
}}
-#line 423 "mn-pi-mailbox-properties.c"
+#line 434 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 176 "mn-pi-mailbox-properties.gob"
+#line 187 "mn-pi-mailbox-properties.gob"
static void
mn_pi_mailbox_properties_radio_toggled_h (GtkToggleButton * togglebutton, gpointer user_data)
-#line 429 "mn-pi-mailbox-properties.c"
+#line 440 "mn-pi-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::radio_toggled_h"
-#line 176 "mn-pi-mailbox-properties.gob"
+#line 187 "mn-pi-mailbox-properties.gob"
g_return_if_fail (togglebutton != NULL);
-#line 176 "mn-pi-mailbox-properties.gob"
+#line 187 "mn-pi-mailbox-properties.gob"
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (togglebutton));
-#line 176 "mn-pi-mailbox-properties.gob"
+#line 187 "mn-pi-mailbox-properties.gob"
g_return_if_fail (user_data != NULL);
-#line 438 "mn-pi-mailbox-properties.c"
+#line 449 "mn-pi-mailbox-properties.c"
{
-#line 179 "mn-pi-mailbox-properties.gob"
+#line 190 "mn-pi-mailbox-properties.gob"
Self *self = user_data;
int i;
- for (i = 0; i < 2; i++)
- gtk_widget_set_sensitive(self->port_spin[i], gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[i])));
+ for (i = 0; i < 3; i++)
+ gtk_widget_set_sensitive(self->port_spin[i], GTK_WIDGET_SENSITIVE(self->conn_radio[i]) && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[i])));
+
+ g_object_notify(G_OBJECT(self), "complete");
}}
-#line 448 "mn-pi-mailbox-properties.c"
+#line 461 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
void
-mn_pi_mailbox_properties_set_contents (MNPIMailboxProperties * self, gboolean ssl, const char * username, const char * password, const char * authmech, const char * hostname, int port)
-#line 454 "mn-pi-mailbox-properties.c"
+mn_pi_mailbox_properties_set_contents (MNPIMailboxProperties * self, gboolean ssl, gboolean inband_ssl, const char * username, const char * password, const char * authmech, const char * hostname, int port)
+#line 467 "mn-pi-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::set_contents"
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
g_return_if_fail (self != NULL);
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
g_return_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self));
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
g_return_if_fail (username != NULL);
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
g_return_if_fail (password != NULL);
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
g_return_if_fail (hostname != NULL);
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
g_return_if_fail (port >= 0);
-#line 187 "mn-pi-mailbox-properties.gob"
+#line 200 "mn-pi-mailbox-properties.gob"
g_return_if_fail (port <= 0xFFFF);
-#line 471 "mn-pi-mailbox-properties.c"
+#line 484 "mn-pi-mailbox-properties.c"
{
-#line 195 "mn-pi-mailbox-properties.gob"
+#line 209 "mn-pi-mailbox-properties.gob"
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->conn_radio[ssl ? 1 : 0]), TRUE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->conn_radio[ssl ? 2 : (inband_ssl ? 1 : 0)]), TRUE);
gtk_entry_set_text(GTK_ENTRY(self->username_entry), username);
gtk_entry_set_text(GTK_ENTRY(self->password_entry), password);
mn_auth_combo_box_set_active_mechanism(MN_AUTH_COMBO_BOX(self->auth_combo), (char *) authmech);
gtk_entry_set_text(GTK_ENTRY(self->hostname_entry), hostname);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(self->port_spin[ssl ? 1 : 0]), port);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(self->port_spin[ssl ? 2 : (inband_ssl ? 1 : 0)]), port);
}}
-#line 482 "mn-pi-mailbox-properties.c"
+#line 495 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 204 "mn-pi-mailbox-properties.gob"
+#line 218 "mn-pi-mailbox-properties.gob"
void
-mn_pi_mailbox_properties_get_contents (MNPIMailboxProperties * self, gboolean * ssl, const char ** username, const char ** password, char ** authmech, const char ** hostname, int * port)
-#line 488 "mn-pi-mailbox-properties.c"
+mn_pi_mailbox_properties_get_contents (MNPIMailboxProperties * self, gboolean * ssl, gboolean * inband_ssl, const char ** username, const char ** password, char ** authmech, const char ** hostname, int * port)
+#line 501 "mn-pi-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::get_contents"
-#line 204 "mn-pi-mailbox-properties.gob"
+#line 218 "mn-pi-mailbox-properties.gob"
g_return_if_fail (self != NULL);
-#line 204 "mn-pi-mailbox-properties.gob"
+#line 218 "mn-pi-mailbox-properties.gob"
g_return_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self));
-#line 495 "mn-pi-mailbox-properties.c"
+#line 508 "mn-pi-mailbox-properties.c"
{
-#line 212 "mn-pi-mailbox-properties.gob"
+#line 227 "mn-pi-mailbox-properties.gob"
gboolean _ssl;
+ gboolean _inband_ssl;
- _ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[1]));
+ _ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[2]));
+ _inband_ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[1]));
if (ssl)
*ssl = _ssl;
+ if (inband_ssl)
+ *inband_ssl = _inband_ssl;
if (username)
*username = gtk_entry_get_text(GTK_ENTRY(self->username_entry));
if (password)
@@ -510,7 +527,7 @@ mn_pi_mailbox_properties_get_contents (MNPIMailboxProperties * self, gboolean *
if (hostname)
*hostname = gtk_entry_get_text(GTK_ENTRY(self->hostname_entry));
if (port)
- *port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(self->port_spin[_ssl ? 1 : 0]));
+ *port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(self->port_spin[_ssl ? 2 : (_inband_ssl ? 1 : 0)]));
}}
-#line 516 "mn-pi-mailbox-properties.c"
+#line 533 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-pi-mailbox-properties.gob b/src/mn-pi-mailbox-properties.gob
@@ -24,7 +24,6 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
%}
@@ -32,7 +31,7 @@
class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
{
classwide const char *label;
- classwide int default_port[2]; /* 0: standard, 1: SSL */
+ classwide int default_port[2]; /* 0: standard, 1: SSL/TLS */
property BOOLEAN complete (override)
get {}; /* dummy, implemented by subclasses */
@@ -49,8 +48,8 @@ class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
protected GtkTooltips *tooltips = {mn_tooltips_new()} unrefwith g_object_unref;
protected GtkWidget *details_vbox;
protected GtkSizeGroup *details_size_group;
- protected GtkWidget *conn_radio[2];
- protected GtkWidget *port_spin[2];
+ protected GtkWidget *conn_radio[3];
+ protected GtkWidget *port_spin[3];
protected GtkWidget *auth_combo;
override (G:Object) GObject *
@@ -112,8 +111,8 @@ class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
gtk_size_group_add_widget(radio_size_group, self->conn_radio[0]);
mn_mailbox_properties_connection_type_new(GTK_VBOX(self->details_vbox),
- _("_SSL"),
- SELF_GET_CLASS(self)->default_port[1],
+ _("_in-band SSL/TLS"),
+ SELF_GET_CLASS(self)->default_port[0],
GTK_RADIO_BUTTON(self->conn_radio[0]),
&label1,
&self->conn_radio[1],
@@ -121,14 +120,26 @@ class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
gtk_size_group_add_widget(self->details_size_group, label1);
gtk_size_group_add_widget(radio_size_group, self->conn_radio[1]);
+ mn_mailbox_properties_connection_type_new(GTK_VBOX(self->details_vbox),
+ _("SSL/TLS on sepa_rate port"),
+ SELF_GET_CLASS(self)->default_port[1],
+ GTK_RADIO_BUTTON(self->conn_radio[0]),
+ &label1,
+ &self->conn_radio[2],
+ &self->port_spin[2]);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ gtk_size_group_add_widget(radio_size_group, self->conn_radio[2]);
+
g_object_unref(radio_size_group);
#ifndef WITH_SSL
gtk_widget_set_sensitive(self->conn_radio[1], FALSE);
+ gtk_widget_set_sensitive(self->conn_radio[2], FALSE);
#endif
/* by default, standard is enabled */
gtk_widget_set_sensitive(self->port_spin[1], FALSE);
+ gtk_widget_set_sensitive(self->port_spin[2], FALSE);
mn_mailbox_properties_authentication_new(GTK_VBOX(self->details_vbox),
&label1,
@@ -142,7 +153,7 @@ class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
g_signal_connect(G_OBJECT(expander), "notify::expanded", G_CALLBACK(self_notify_expanded_h), self);
- for (i = 0; i < 2; i++)
+ for (i = 0; i < 3; i++)
g_signal_connect(G_OBJECT(self->conn_radio[i]), "toggled", G_CALLBACK(self_radio_toggled_h), self);
g_signal_connect(G_OBJECT(self->hostname_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
@@ -180,30 +191,34 @@ class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
Self *self = user_data;
int i;
- for (i = 0; i < 2; i++)
- gtk_widget_set_sensitive(self->port_spin[i], gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[i])));
+ for (i = 0; i < 3; i++)
+ gtk_widget_set_sensitive(self->port_spin[i], GTK_WIDGET_SENSITIVE(self->conn_radio[i]) && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[i])));
+
+ g_object_notify(G_OBJECT(self), "complete");
}
public void
set_contents (self,
gboolean ssl,
+ gboolean inband_ssl,
const char *username (check null),
const char *password (check null),
const char *authmech,
const char *hostname (check null),
int port (check >= 0 <= 0xFFFF))
{
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->conn_radio[ssl ? 1 : 0]), TRUE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->conn_radio[ssl ? 2 : (inband_ssl ? 1 : 0)]), TRUE);
gtk_entry_set_text(GTK_ENTRY(self->username_entry), username);
gtk_entry_set_text(GTK_ENTRY(self->password_entry), password);
mn_auth_combo_box_set_active_mechanism(MN_AUTH_COMBO_BOX(self->auth_combo), (char *) authmech);
gtk_entry_set_text(GTK_ENTRY(self->hostname_entry), hostname);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(self->port_spin[ssl ? 1 : 0]), port);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(self->port_spin[ssl ? 2 : (inband_ssl ? 1 : 0)]), port);
}
public void
get_contents (self,
gboolean *ssl,
+ gboolean *inband_ssl,
const char **username,
const char **password,
char **authmech,
@@ -211,11 +226,15 @@ class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
int *port)
{
gboolean _ssl;
+ gboolean _inband_ssl;
- _ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[1]));
+ _ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[2]));
+ _inband_ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[1]));
if (ssl)
*ssl = _ssl;
+ if (inband_ssl)
+ *inband_ssl = _inband_ssl;
if (username)
*username = gtk_entry_get_text(GTK_ENTRY(self->username_entry));
if (password)
@@ -225,6 +244,6 @@ class MN:PI:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
if (hostname)
*hostname = gtk_entry_get_text(GTK_ENTRY(self->hostname_entry));
if (port)
- *port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(self->port_spin[_ssl ? 1 : 0]));
+ *port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(self->port_spin[_ssl ? 2 : (_inband_ssl ? 1 : 0)]));
}
}
diff --git a/src/mn-pi-mailbox-properties.h b/src/mn-pi-mailbox-properties.h
@@ -42,8 +42,8 @@ struct _MNPIMailboxProperties {
GtkTooltips * tooltips; /* protected */
GtkWidget * details_vbox; /* protected */
GtkSizeGroup * details_size_group; /* protected */
- GtkWidget * conn_radio[2]; /* protected */
- GtkWidget * port_spin[2]; /* protected */
+ GtkWidget * conn_radio[3]; /* protected */
+ GtkWidget * port_spin[3]; /* protected */
GtkWidget * auth_combo; /* protected */
};
@@ -64,6 +64,7 @@ struct _MNPIMailboxPropertiesClass {
GType mn_pi_mailbox_properties_get_type (void);
void mn_pi_mailbox_properties_set_contents (MNPIMailboxProperties * self,
gboolean ssl,
+ gboolean inband_ssl,
const char * username,
const char * password,
const char * authmech,
@@ -71,6 +72,7 @@ void mn_pi_mailbox_properties_set_contents (MNPIMailboxProperties * self,
int port);
void mn_pi_mailbox_properties_get_contents (MNPIMailboxProperties * self,
gboolean * ssl,
+ gboolean * inband_ssl,
const char ** username,
const char ** password,
char ** authmech,
diff --git a/src/mn-pop3-mailbox-private.h b/src/mn-pop3-mailbox-private.h
@@ -10,23 +10,11 @@ extern "C" {
#endif /* __cplusplus */
struct _MNPOP3MailboxPrivate {
-#line 97 "mn-pop3-mailbox.gob"
- char * hostname;
-#line 98 "mn-pop3-mailbox.gob"
- int port;
-#line 99 "mn-pop3-mailbox.gob"
- char * username;
-#line 100 "mn-pop3-mailbox.gob"
- char * password;
-#line 101 "mn-pop3-mailbox.gob"
- char * authmech;
-#line 102 "mn-pop3-mailbox.gob"
- gboolean ssl;
-#line 104 "mn-pop3-mailbox.gob"
+#line 106 "mn-pop3-mailbox.gob"
int login_delay;
-#line 105 "mn-pop3-mailbox.gob"
+#line 107 "mn-pop3-mailbox.gob"
GTimer * authentication_timer;
-#line 30 "mn-pop3-mailbox-private.h"
+#line 18 "mn-pop3-mailbox-private.h"
};
#ifdef __cplusplus
diff --git a/src/mn-pop3-mailbox-properties.c b/src/mn-pop3-mailbox-properties.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:30 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -27,11 +27,10 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
-#line 35 "mn-pop3-mailbox-properties.c"
+#line 34 "mn-pop3-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_POP3_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_POP3_MAILBOX_PROPERTIES_CONST(x)
@@ -50,8 +49,8 @@ static void ___object_get_property (GObject *object, guint property_id, GValue *
static void mn_pop3_mailbox_properties_init (MNPOP3MailboxProperties * o) G_GNUC_UNUSED;
static void mn_pop3_mailbox_properties_class_init (MNPOP3MailboxPropertiesClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_pop3_mailbox_properties_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
-static gboolean mn_pop3_mailbox_properties_set_uri (MNMailboxProperties * properties, const char * uri) G_GNUC_UNUSED;
-static char * mn_pop3_mailbox_properties_get_uri (MNMailboxProperties * properties) G_GNUC_UNUSED;
+static gboolean mn_pop3_mailbox_properties_set_uri (MNMailboxProperties * properties, MNURI * uri) G_GNUC_UNUSED;
+static MNURI * mn_pop3_mailbox_properties_get_uri (MNMailboxProperties * properties) G_GNUC_UNUSED;
enum {
PROP_0,
@@ -71,9 +70,9 @@ ___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
{
#line 94 "mn-pop3-mailbox-properties.gob"
iface->set_uri = self_set_uri;
-#line 126 "mn-pop3-mailbox-properties.gob"
+#line 114 "mn-pop3-mailbox-properties.gob"
iface->get_uri = self_get_uri;
-#line 77 "mn-pop3-mailbox-properties.c"
+#line 76 "mn-pop3-mailbox-properties.c"
}
GType
@@ -136,7 +135,7 @@ mn_pop3_mailbox_properties_init (MNPOP3MailboxProperties * o G_GNUC_UNUSED)
#line 60 "mn-pop3-mailbox-properties.gob"
static void
mn_pop3_mailbox_properties_class_init (MNPOP3MailboxPropertiesClass * class G_GNUC_UNUSED)
-#line 140 "mn-pop3-mailbox-properties.c"
+#line 139 "mn-pop3-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::class_init"
GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
@@ -145,7 +144,7 @@ mn_pop3_mailbox_properties_class_init (MNPOP3MailboxPropertiesClass * class G_GN
#line 69 "mn-pop3-mailbox-properties.gob"
g_object_class->constructor = ___2_mn_pop3_mailbox_properties_constructor;
-#line 149 "mn-pop3-mailbox-properties.c"
+#line 148 "mn-pop3-mailbox-properties.c"
g_object_class->get_property = ___object_get_property;
{
g_object_class_override_property (g_object_class,
@@ -158,10 +157,10 @@ mn_pop3_mailbox_properties_class_init (MNPOP3MailboxPropertiesClass * class G_GN
MNPIMailboxPropertiesClass *pi_class = MN_PI_MAILBOX_PROPERTIES_CLASS(class);
pi_class->label = "POP3";
- pi_class->default_port[0] = MN_URI_POP3_PORT(FALSE);
- pi_class->default_port[1] = MN_URI_POP3_PORT(TRUE);
+ pi_class->default_port[0] = mn_uri_get_default_port("pop");
+ pi_class->default_port[1] = mn_uri_get_default_port("pops");
-#line 165 "mn-pop3-mailbox-properties.c"
+#line 164 "mn-pop3-mailbox-properties.c"
}
}
#undef __GOB_FUNCTION__
@@ -180,7 +179,7 @@ ___object_get_property (GObject *object,
switch (property_id) {
case PROP_COMPLETE:
{
-#line 36 "mn-pop3-mailbox-properties.gob"
+#line 35 "mn-pop3-mailbox-properties.gob"
MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
gboolean complete;
@@ -190,6 +189,7 @@ ___object_get_property (GObject *object,
mn_pi_mailbox_properties_get_contents(pi,
NULL,
+ NULL,
&username,
&password,
NULL,
@@ -261,7 +261,7 @@ ___2_mn_pop3_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_c
#line 94 "mn-pop3-mailbox-properties.gob"
static gboolean
-mn_pop3_mailbox_properties_set_uri (MNMailboxProperties * properties, const char * uri)
+mn_pop3_mailbox_properties_set_uri (MNMailboxProperties * properties, MNURI * uri)
#line 266 "mn-pop3-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::set_uri"
@@ -271,74 +271,66 @@ mn_pop3_mailbox_properties_set_uri (MNMailboxProperties * properties, const char
g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (properties), (gboolean )0);
#line 94 "mn-pop3-mailbox-properties.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 275 "mn-pop3-mailbox-properties.c"
+#line 94 "mn-pop3-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 277 "mn-pop3-mailbox-properties.c"
{
#line 97 "mn-pop3-mailbox-properties.gob"
- gboolean ssl;
- char *username;
- char *password;
- char *authmech;
- char *hostname;
- int port;
-
- if (mn_uri_parse_pop(uri, &ssl, &username, &password, &authmech, &hostname, &port))
+ if (MN_URI_IS_POP(uri))
{
mn_pi_mailbox_properties_set_contents(MN_PI_MAILBOX_PROPERTIES(properties),
- ssl,
- username,
- password,
- authmech,
- hostname,
- port);
-
- g_free(username);
- g_free(password);
- g_free(authmech);
- g_free(hostname);
-
+ MN_URI_IS_SSL(uri),
+ MN_URI_IS_INBAND_SSL(uri),
+ uri->username,
+ uri->password,
+ uri->authmech,
+ uri->hostname,
+ uri->port);
return TRUE;
}
else
return FALSE;
}}
-#line 306 "mn-pop3-mailbox-properties.c"
+#line 296 "mn-pop3-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 126 "mn-pop3-mailbox-properties.gob"
-static char *
+#line 114 "mn-pop3-mailbox-properties.gob"
+static MNURI *
mn_pop3_mailbox_properties_get_uri (MNMailboxProperties * properties)
-#line 312 "mn-pop3-mailbox-properties.c"
+#line 302 "mn-pop3-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::get_uri"
-#line 126 "mn-pop3-mailbox-properties.gob"
- g_return_val_if_fail (properties != NULL, (char * )0);
-#line 126 "mn-pop3-mailbox-properties.gob"
- g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (properties), (char * )0);
-#line 319 "mn-pop3-mailbox-properties.c"
+#line 114 "mn-pop3-mailbox-properties.gob"
+ g_return_val_if_fail (properties != NULL, (MNURI * )0);
+#line 114 "mn-pop3-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (properties), (MNURI * )0);
+#line 309 "mn-pop3-mailbox-properties.c"
{
-#line 128 "mn-pop3-mailbox-properties.gob"
+#line 116 "mn-pop3-mailbox-properties.gob"
gboolean ssl;
+ gboolean inband_ssl;
const char *username;
const char *password;
char *authmech;
const char *hostname;
int port;
- char *uri;
+ MNURI *uri;
mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
&ssl,
+ &inband_ssl,
&username,
&password,
&authmech,
&hostname,
&port);
- uri = mn_uri_build_pop(ssl, username, password, authmech, hostname, port);
+ uri = mn_uri_new_pop(ssl, inband_ssl, username, password, authmech, hostname, port);
g_free(authmech);
return uri;
}}
-#line 344 "mn-pop3-mailbox-properties.c"
+#line 336 "mn-pop3-mailbox-properties.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-pop3-mailbox-properties.gob b/src/mn-pop3-mailbox-properties.gob
@@ -24,7 +24,6 @@
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties.h"
#include "mn-mailbox-properties-util.h"
-#include "mn-uri.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
%}
@@ -42,6 +41,7 @@ class MN:POP3:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
mn_pi_mailbox_properties_get_contents(pi,
NULL,
+ NULL,
&username,
&password,
NULL,
@@ -62,8 +62,8 @@ class MN:POP3:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
MNPIMailboxPropertiesClass *pi_class = MN_PI_MAILBOX_PROPERTIES_CLASS(class);
pi_class->label = "POP3";
- pi_class->default_port[0] = MN_URI_POP3_PORT(FALSE);
- pi_class->default_port[1] = MN_URI_POP3_PORT(TRUE);
+ pi_class->default_port[0] = mn_uri_get_default_port("pop");
+ pi_class->default_port[1] = mn_uri_get_default_port("pops");
}
override (G:Object) GObject *
@@ -93,56 +93,46 @@ class MN:POP3:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mai
interface MN:Mailbox:Properties private gboolean
set_uri (MN:Mailbox:Properties *properties (check null type),
- const char *uri (check null))
+ MN:URI *uri (check null type))
{
- gboolean ssl;
- char *username;
- char *password;
- char *authmech;
- char *hostname;
- int port;
-
- if (mn_uri_parse_pop(uri, &ssl, &username, &password, &authmech, &hostname, &port))
+ if (MN_URI_IS_POP(uri))
{
mn_pi_mailbox_properties_set_contents(MN_PI_MAILBOX_PROPERTIES(properties),
- ssl,
- username,
- password,
- authmech,
- hostname,
- port);
-
- g_free(username);
- g_free(password);
- g_free(authmech);
- g_free(hostname);
-
+ MN_URI_IS_SSL(uri),
+ MN_URI_IS_INBAND_SSL(uri),
+ uri->username,
+ uri->password,
+ uri->authmech,
+ uri->hostname,
+ uri->port);
return TRUE;
}
else
return FALSE;
}
- interface MN:Mailbox:Properties private char *
+ interface MN:Mailbox:Properties private MNURI *
get_uri (MN:Mailbox:Properties *properties (check null type))
{
gboolean ssl;
+ gboolean inband_ssl;
const char *username;
const char *password;
char *authmech;
const char *hostname;
int port;
- char *uri;
+ MNURI *uri;
mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
&ssl,
+ &inband_ssl,
&username,
&password,
&authmech,
&hostname,
&port);
- uri = mn_uri_build_pop(ssl, username, password, authmech, hostname, port);
+ uri = mn_uri_new_pop(ssl, inband_ssl, username, password, authmech, hostname, port);
g_free(authmech);
return uri;
diff --git a/src/mn-pop3-mailbox.c b/src/mn-pop3-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:30 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -21,7 +21,7 @@
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */
-#line 30 "mn-pop3-mailbox.gob"
+#line 31 "mn-pop3-mailbox.gob"
#include "config.h"
#include <stdio.h>
@@ -31,19 +31,22 @@
#include <unistd.h>
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
+#include <eel/eel.h>
#include "mn-mailbox-private.h"
#include "mn-client-session.h"
#include "mn-util.h"
-#include "mn-uri.h"
#include "mn-md5.h"
enum
{
STATE_GREETING = MN_CLIENT_SESSION_INITIAL_STATE,
STATE_CAPA,
+#ifdef WITH_SSL
+ STATE_STLS,
+#endif
#ifdef WITH_SASL
STATE_AUTH,
-#endif /* WITH_SASL */
+#endif
STATE_APOP,
STATE_USER,
STATE_PASS,
@@ -59,14 +62,19 @@
struct _MNClientSessionPrivate
{
- MNPOP3Mailbox *mailbox;
+ MNMailbox *mailbox;
+ MNPOP3Mailbox *self;
MNClientSession *session;
gboolean in_list;
char *apop_timestamp;
GSList *auth_mechanisms;
+#ifdef WITH_SSL
+ gboolean stls_supported;
+ gboolean stls_completed;
+#endif
#ifdef WITH_SASL
const char *sasl_mechanism;
-#endif /* WITH_SASL */
+#endif
gboolean authenticated;
gboolean login_delay_user;
};
@@ -86,7 +94,7 @@
char *arguments;
};
-#line 90 "mn-pop3-mailbox.c"
+#line 98 "mn-pop3-mailbox.c"
/* self casting macros */
#define SELF(x) MN_POP3_MAILBOX(x)
#define SELF_CONST(x) MN_POP3_MAILBOX_CONST(x)
@@ -104,10 +112,12 @@ typedef MNPOP3MailboxClass SelfClass;
static void mn_pop3_mailbox_init (MNPOP3Mailbox * o) G_GNUC_UNUSED;
static void mn_pop3_mailbox_class_init (MNPOP3MailboxClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_pop3_mailbox_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
-static gboolean ___3_mn_pop3_mailbox_impl_is (MNMailbox * dummy, const char * uri) G_GNUC_UNUSED;
+static gboolean ___3_mn_pop3_mailbox_impl_is (MNMailbox * dummy, MNURI * uri) G_GNUC_UNUSED;
static int mn_pop3_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_pop3_mailbox_enter_capa_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_pop3_mailbox_handle_capa_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_enter_stls_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_handle_stls_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_pop3_mailbox_enter_auth_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_pop3_mailbox_handle_auth_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_pop3_mailbox_enter_apop_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
@@ -120,7 +130,7 @@ static int mn_pop3_mailbox_enter_stat_cb (MNClientSession * session, MNClientSes
static int mn_pop3_mailbox_handle_stat_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_pop3_mailbox_enter_quit_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static int mn_pop3_mailbox_handle_quit_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
-static void ___13_mn_pop3_mailbox_impl_threaded_check (MNMailbox * mailbox) G_GNUC_UNUSED;
+static void ___15_mn_pop3_mailbox_impl_threaded_check (MNMailbox * mailbox) G_GNUC_UNUSED;
static void mn_pop3_mailbox_notice_cb (MNClientSession * session, const char * str, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static MNClientSessionResponse * mn_pop3_mailbox_response_new_cb (MNClientSession * session, const char * input, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
static void mn_pop3_mailbox_response_free_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
@@ -137,6 +147,8 @@ static MNMailboxClass *parent_class = NULL;
#define self_handle_greeting_cb mn_pop3_mailbox_handle_greeting_cb
#define self_enter_capa_cb mn_pop3_mailbox_enter_capa_cb
#define self_handle_capa_cb mn_pop3_mailbox_handle_capa_cb
+#define self_enter_stls_cb mn_pop3_mailbox_enter_stls_cb
+#define self_handle_stls_cb mn_pop3_mailbox_handle_stls_cb
#define self_enter_auth_cb mn_pop3_mailbox_enter_auth_cb
#define self_handle_auth_cb mn_pop3_mailbox_handle_auth_cb
#define self_enter_apop_cb mn_pop3_mailbox_enter_apop_cb
@@ -208,18 +220,6 @@ ___finalize(GObject *obj_self)
gpointer priv = self->_priv;
if(G_OBJECT_CLASS(parent_class)->finalize) \
(* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
-#line 97 "mn-pop3-mailbox.gob"
- if(self->_priv->hostname) { ((*(void (*)(void *))g_free)) (self->_priv->hostname); self->_priv->hostname = NULL; }
-#line 214 "mn-pop3-mailbox.c"
-#line 99 "mn-pop3-mailbox.gob"
- if(self->_priv->username) { ((*(void (*)(void *))g_free)) (self->_priv->username); self->_priv->username = NULL; }
-#line 217 "mn-pop3-mailbox.c"
-#line 100 "mn-pop3-mailbox.gob"
- if(self->_priv->password) { ((*(void (*)(void *))g_free)) (self->_priv->password); self->_priv->password = NULL; }
-#line 220 "mn-pop3-mailbox.c"
-#line 101 "mn-pop3-mailbox.gob"
- if(self->_priv->authmech) { ((*(void (*)(void *))g_free)) (self->_priv->authmech); self->_priv->authmech = NULL; }
-#line 223 "mn-pop3-mailbox.c"
g_free (priv);
}
#undef __GOB_FUNCTION__
@@ -231,7 +231,7 @@ mn_pop3_mailbox_init (MNPOP3Mailbox * o G_GNUC_UNUSED)
o->_priv = g_new0 (MNPOP3MailboxPrivate, 1);
}
#undef __GOB_FUNCTION__
-#line 107 "mn-pop3-mailbox.gob"
+#line 109 "mn-pop3-mailbox.gob"
static void
mn_pop3_mailbox_class_init (MNPOP3MailboxClass * class G_GNUC_UNUSED)
#line 238 "mn-pop3-mailbox.c"
@@ -242,16 +242,16 @@ mn_pop3_mailbox_class_init (MNPOP3MailboxClass * class G_GNUC_UNUSED)
parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
-#line 112 "mn-pop3-mailbox.gob"
+#line 114 "mn-pop3-mailbox.gob"
g_object_class->constructor = ___2_mn_pop3_mailbox_constructor;
-#line 142 "mn-pop3-mailbox.gob"
+#line 131 "mn-pop3-mailbox.gob"
mn_mailbox_class->impl_is = ___3_mn_pop3_mailbox_impl_is;
-#line 455 "mn-pop3-mailbox.gob"
- mn_mailbox_class->impl_threaded_check = ___13_mn_pop3_mailbox_impl_threaded_check;
+#line 480 "mn-pop3-mailbox.gob"
+ mn_mailbox_class->impl_threaded_check = ___15_mn_pop3_mailbox_impl_threaded_check;
#line 252 "mn-pop3-mailbox.c"
g_object_class->finalize = ___finalize;
{
-#line 108 "mn-pop3-mailbox.gob"
+#line 110 "mn-pop3-mailbox.gob"
MN_MAILBOX_CLASS(class)->format = "POP3";
@@ -262,7 +262,7 @@ mn_pop3_mailbox_class_init (MNPOP3MailboxClass * class G_GNUC_UNUSED)
-#line 112 "mn-pop3-mailbox.gob"
+#line 114 "mn-pop3-mailbox.gob"
static GObject *
___2_mn_pop3_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
#line 269 "mn-pop3-mailbox.c"
@@ -273,82 +273,64 @@ ___2_mn_pop3_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_pr
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::constructor"
{
-#line 114 "mn-pop3-mailbox.gob"
+#line 116 "mn-pop3-mailbox.gob"
GObject *object;
MNMailbox *mailbox;
- Self *self;
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
mailbox = MN_MAILBOX(object);
- self = SELF(object);
-
- if (mn_uri_parse_pop(mn_mailbox_get_uri(mailbox),
- &selfp->ssl,
- &selfp->username,
- &selfp->password,
- &selfp->authmech,
- &selfp->hostname,
- &selfp->port))
- {
+
#ifndef WITH_SSL
- if (selfp->ssl)
- mn_mailbox_set_init_error(mailbox, _("SSL support has not been compiled in"));
+ if (MN_URI_IS_SSL(mailbox->uri) || MN_URI_IS_INBAND_SSL(mailbox->uri))
+ mn_mailbox_set_init_error(mailbox, _("SSL/TLS support has not been compiled in"));
#endif /* WITH_SSL */
- }
- else
- mn_mailbox_set_init_error(mailbox, _("unable to parse POP3 URI"));
return object;
}}
-#line 305 "mn-pop3-mailbox.c"
+#line 292 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 142 "mn-pop3-mailbox.gob"
+#line 131 "mn-pop3-mailbox.gob"
static gboolean
-___3_mn_pop3_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
-#line 312 "mn-pop3-mailbox.c"
+___3_mn_pop3_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, MNURI * uri)
+#line 299 "mn-pop3-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
(* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
((gboolean )0))
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::impl_is"
-#line 142 "mn-pop3-mailbox.gob"
+#line 131 "mn-pop3-mailbox.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 321 "mn-pop3-mailbox.c"
+#line 131 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 310 "mn-pop3-mailbox.c"
{
-#line 144 "mn-pop3-mailbox.gob"
+#line 133 "mn-pop3-mailbox.gob"
- char *scheme;
- gboolean is;
-
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && (! strcmp(scheme, "pop") || ! strcmp(scheme, "pops"));
- g_free(scheme);
-
- return is;
+ return MN_URI_IS_POP(uri);
}}
-#line 334 "mn-pop3-mailbox.c"
+#line 316 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 155 "mn-pop3-mailbox.gob"
+#line 137 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 341 "mn-pop3-mailbox.c"
+#line 323 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_greeting_cb"
-#line 155 "mn-pop3-mailbox.gob"
+#line 137 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 155 "mn-pop3-mailbox.gob"
+#line 137 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 155 "mn-pop3-mailbox.gob"
+#line 137 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 350 "mn-pop3-mailbox.c"
+#line 332 "mn-pop3-mailbox.c"
{
-#line 159 "mn-pop3-mailbox.gob"
+#line 141 "mn-pop3-mailbox.gob"
priv->session = session;
@@ -375,53 +357,56 @@ mn_pop3_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionRe
default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}
}}
-#line 379 "mn-pop3-mailbox.c"
+#line 361 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 186 "mn-pop3-mailbox.gob"
+#line 168 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_enter_capa_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 385 "mn-pop3-mailbox.c"
+#line 367 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_capa_cb"
-#line 186 "mn-pop3-mailbox.gob"
+#line 168 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 186 "mn-pop3-mailbox.gob"
+#line 168 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 392 "mn-pop3-mailbox.c"
+#line 374 "mn-pop3-mailbox.c"
{
-#line 189 "mn-pop3-mailbox.gob"
+#line 171 "mn-pop3-mailbox.gob"
return mn_client_session_write(session, "CAPA");
}}
-#line 398 "mn-pop3-mailbox.c"
+#line 380 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 193 "mn-pop3-mailbox.gob"
+#line 175 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_capa_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 404 "mn-pop3-mailbox.c"
+#line 386 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_capa_cb"
-#line 193 "mn-pop3-mailbox.gob"
+#line 175 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 193 "mn-pop3-mailbox.gob"
+#line 175 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 193 "mn-pop3-mailbox.gob"
+#line 175 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 413 "mn-pop3-mailbox.c"
+#line 395 "mn-pop3-mailbox.c"
{
-#line 197 "mn-pop3-mailbox.gob"
+#line 179 "mn-pop3-mailbox.gob"
switch (response->type)
{
case RESPONSE_OK:
priv->in_list = TRUE;
- mn_pointers_free(priv->auth_mechanisms);
+ eel_g_slist_free_deep(priv->auth_mechanisms);
priv->auth_mechanisms = NULL;
- priv->mailbox->_priv->login_delay = 0;
+ priv->self->_priv->login_delay = 0;
priv->login_delay_user = FALSE;
+#ifdef WITH_SSL
+ priv->stls_supported = FALSE;
+#endif
return MN_CLIENT_SESSION_RESULT_CONTINUE;
@@ -430,7 +415,22 @@ mn_pop3_mailbox_handle_capa_cb (MNClientSession * session, MNClientSessionRespon
priv->in_list = FALSE;
if (priv->authenticated)
return STATE_STAT;
+
+#ifdef WITH_SSL
+ if (MN_URI_IS_INBAND_SSL(priv->mailbox->uri)
+ && ! MN_URI_IS_SSL(priv->mailbox->uri)
+ && ! priv->stls_completed)
+ {
+ if (priv->stls_supported)
+ return STATE_STLS;
+ else
+ {
+ mn_client_session_error(priv->session, _("server does not support in-band SSL/TLS"));
+ return STATE_QUIT;
+ }
+ }
else
+#endif /* WITH_SSL */
return self_session_authenticate(priv);
case RESPONSE_LIST_ITEM:
@@ -448,32 +448,21 @@ mn_pop3_mailbox_handle_capa_cb (MNClientSession * session, MNClientSessionRespon
for (i = 1; tokens[i]; i++)
priv->auth_mechanisms = g_slist_append(priv->auth_mechanisms, g_strdup(tokens[i]));
}
+#ifdef WITH_SSL
+ else if (! strcmp(tokens[0], "STLS"))
+ priv->stls_supported = TRUE;
+#endif /* WITH_SSL */
else if (! strcmp(tokens[0], "LOGIN-DELAY"))
{
- if (tokens[1])
+ if (tokens[1] && mn_str_isnumeric(tokens[1])
+ && (! tokens[2]
+ || (! tokens[3]
+ && ! priv->authenticated
+ && ! strcmp(tokens[2], "USER"))))
{
- if (mn_str_isnumeric(tokens[1]))
- {
- priv->mailbox->_priv->login_delay = atoi(tokens[1]);
- if (tokens[2])
- {
- if (! priv->authenticated)
- {
- if (! strcmp(tokens[2], "USER"))
- {
- priv->login_delay_user = TRUE;
- if (tokens[3])
- login_delay_error = TRUE;
- }
- else
- login_delay_error = TRUE;
- }
- else
- login_delay_error = TRUE;
- }
- }
- else
- login_delay_error = TRUE;
+ priv->self->_priv->login_delay = atoi(tokens[1]);
+ if (tokens[2])
+ priv->login_delay_user = TRUE;
}
else
login_delay_error = TRUE;
@@ -491,28 +480,89 @@ mn_pop3_mailbox_handle_capa_cb (MNClientSession * session, MNClientSessionRespon
return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}
}}
-#line 495 "mn-pop3-mailbox.c"
+#line 484 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 266 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_stls_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 490 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_stls_cb"
+#line 266 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 266 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 497 "mn-pop3-mailbox.c"
+{
+#line 269 "mn-pop3-mailbox.gob"
+
+#ifdef WITH_SSL
+ return mn_client_session_write(session, "STLS");
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }}
+#line 507 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
#line 277 "mn-pop3-mailbox.gob"
static int
-mn_pop3_mailbox_enter_auth_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 501 "mn-pop3-mailbox.c"
+mn_pop3_mailbox_handle_stls_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 513 "mn-pop3-mailbox.c"
{
-#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_auth_cb"
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_stls_cb"
#line 277 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
#line 277 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 277 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 522 "mn-pop3-mailbox.c"
+{
+#line 281 "mn-pop3-mailbox.gob"
+
+#ifdef WITH_SSL
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ priv->stls_completed = TRUE;
+ return mn_client_session_enable_ssl(session)
+ ? STATE_CAPA
+ : RESULT_ERROR_END;
+
+ case RESPONSE_ERR:
+ return self_session_authenticate(priv);
+
+ default:
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }}
+#line 545 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 302 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_auth_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 551 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_auth_cb"
+#line 302 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 302 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 508 "mn-pop3-mailbox.c"
+#line 558 "mn-pop3-mailbox.c"
{
-#line 280 "mn-pop3-mailbox.gob"
+#line 305 "mn-pop3-mailbox.gob"
#ifdef WITH_SASL
if (mn_client_session_sasl_authentication_start(priv->session,
"pop",
priv->auth_mechanisms,
- priv->mailbox->_priv->authmech,
+ priv->mailbox->uri->authmech,
&priv->sasl_mechanism))
return mn_client_session_write(session, "AUTH %s", priv->sasl_mechanism);
else
@@ -521,24 +571,24 @@ mn_pop3_mailbox_enter_auth_cb (MNClientSession * session, MNClientSessionPrivate
g_return_val_if_reached(0);
#endif /* WITH_SASL */
}}
-#line 525 "mn-pop3-mailbox.c"
+#line 575 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 295 "mn-pop3-mailbox.gob"
+#line 320 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_auth_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 531 "mn-pop3-mailbox.c"
+#line 581 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_auth_cb"
-#line 295 "mn-pop3-mailbox.gob"
+#line 320 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 295 "mn-pop3-mailbox.gob"
+#line 320 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 295 "mn-pop3-mailbox.gob"
+#line 320 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 540 "mn-pop3-mailbox.c"
+#line 590 "mn-pop3-mailbox.c"
{
-#line 299 "mn-pop3-mailbox.gob"
+#line 324 "mn-pop3-mailbox.gob"
#ifdef WITH_SASL
switch (response->type)
@@ -561,22 +611,22 @@ mn_pop3_mailbox_handle_auth_cb (MNClientSession * session, MNClientSessionRespon
g_return_val_if_reached(0);
#endif /* WITH_SASL */
}}
-#line 565 "mn-pop3-mailbox.c"
+#line 615 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 322 "mn-pop3-mailbox.gob"
+#line 347 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_enter_apop_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 571 "mn-pop3-mailbox.c"
+#line 621 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_apop_cb"
-#line 322 "mn-pop3-mailbox.gob"
+#line 347 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 322 "mn-pop3-mailbox.gob"
+#line 347 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 578 "mn-pop3-mailbox.c"
+#line 628 "mn-pop3-mailbox.c"
{
-#line 325 "mn-pop3-mailbox.gob"
+#line 350 "mn-pop3-mailbox.gob"
MNMD5Context context;
char buf[33];
@@ -585,29 +635,29 @@ mn_pop3_mailbox_enter_apop_cb (MNClientSession * session, MNClientSessionPrivate
mn_md5_init(&context);
mn_md5_update(&context, priv->apop_timestamp, strlen(priv->apop_timestamp));
- mn_md5_update(&context, priv->mailbox->_priv->password, strlen(priv->mailbox->_priv->password));
+ mn_md5_update(&context, priv->mailbox->uri->password, strlen(priv->mailbox->uri->password));
mn_md5_end(&context, buf);
- return mn_client_session_write(session, "APOP %s %s", priv->mailbox->_priv->username, buf);
+ return mn_client_session_write(session, "APOP %s %s", priv->mailbox->uri->username, buf);
}}
-#line 594 "mn-pop3-mailbox.c"
+#line 644 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 339 "mn-pop3-mailbox.gob"
+#line 364 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_apop_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 600 "mn-pop3-mailbox.c"
+#line 650 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_apop_cb"
-#line 339 "mn-pop3-mailbox.gob"
+#line 364 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 339 "mn-pop3-mailbox.gob"
+#line 364 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 339 "mn-pop3-mailbox.gob"
+#line 364 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 609 "mn-pop3-mailbox.c"
+#line 659 "mn-pop3-mailbox.c"
{
-#line 343 "mn-pop3-mailbox.gob"
+#line 368 "mn-pop3-mailbox.gob"
switch (response->type)
{
@@ -621,43 +671,43 @@ mn_pop3_mailbox_handle_apop_cb (MNClientSession * session, MNClientSessionRespon
return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}
}}
-#line 625 "mn-pop3-mailbox.c"
+#line 675 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 357 "mn-pop3-mailbox.gob"
+#line 382 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_enter_user_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 631 "mn-pop3-mailbox.c"
+#line 681 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_user_cb"
-#line 357 "mn-pop3-mailbox.gob"
+#line 382 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 357 "mn-pop3-mailbox.gob"
+#line 382 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 638 "mn-pop3-mailbox.c"
+#line 688 "mn-pop3-mailbox.c"
{
-#line 360 "mn-pop3-mailbox.gob"
+#line 385 "mn-pop3-mailbox.gob"
- return mn_client_session_write(session, "USER %s", priv->mailbox->_priv->username);
+ return mn_client_session_write(session, "USER %s", priv->mailbox->uri->username);
}}
-#line 644 "mn-pop3-mailbox.c"
+#line 694 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 364 "mn-pop3-mailbox.gob"
+#line 389 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_user_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 650 "mn-pop3-mailbox.c"
+#line 700 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_user_cb"
-#line 364 "mn-pop3-mailbox.gob"
+#line 389 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 364 "mn-pop3-mailbox.gob"
+#line 389 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 364 "mn-pop3-mailbox.gob"
+#line 389 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 659 "mn-pop3-mailbox.c"
+#line 709 "mn-pop3-mailbox.c"
{
-#line 368 "mn-pop3-mailbox.gob"
+#line 393 "mn-pop3-mailbox.gob"
switch (response->type)
{
@@ -666,43 +716,43 @@ mn_pop3_mailbox_handle_user_cb (MNClientSession * session, MNClientSessionRespon
default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}
}}
-#line 670 "mn-pop3-mailbox.c"
+#line 720 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 377 "mn-pop3-mailbox.gob"
+#line 402 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_enter_pass_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 676 "mn-pop3-mailbox.c"
+#line 726 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_pass_cb"
-#line 377 "mn-pop3-mailbox.gob"
+#line 402 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 377 "mn-pop3-mailbox.gob"
+#line 402 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 683 "mn-pop3-mailbox.c"
+#line 733 "mn-pop3-mailbox.c"
{
-#line 380 "mn-pop3-mailbox.gob"
+#line 405 "mn-pop3-mailbox.gob"
- return mn_client_session_write(session, "PASS %s", priv->mailbox->_priv->password);
+ return mn_client_session_write(session, "PASS %s", priv->mailbox->uri->password);
}}
-#line 689 "mn-pop3-mailbox.c"
+#line 739 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 384 "mn-pop3-mailbox.gob"
+#line 409 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_pass_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 695 "mn-pop3-mailbox.c"
+#line 745 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_pass_cb"
-#line 384 "mn-pop3-mailbox.gob"
+#line 409 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 384 "mn-pop3-mailbox.gob"
+#line 409 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 384 "mn-pop3-mailbox.gob"
+#line 409 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 704 "mn-pop3-mailbox.c"
+#line 754 "mn-pop3-mailbox.c"
{
-#line 388 "mn-pop3-mailbox.gob"
+#line 413 "mn-pop3-mailbox.gob"
switch (response->type)
{
@@ -711,43 +761,43 @@ mn_pop3_mailbox_handle_pass_cb (MNClientSession * session, MNClientSessionRespon
default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}
}}
-#line 715 "mn-pop3-mailbox.c"
+#line 765 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 397 "mn-pop3-mailbox.gob"
+#line 422 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_enter_stat_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 721 "mn-pop3-mailbox.c"
+#line 771 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_stat_cb"
-#line 397 "mn-pop3-mailbox.gob"
+#line 422 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 397 "mn-pop3-mailbox.gob"
+#line 422 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 728 "mn-pop3-mailbox.c"
+#line 778 "mn-pop3-mailbox.c"
{
-#line 400 "mn-pop3-mailbox.gob"
+#line 425 "mn-pop3-mailbox.gob"
return mn_client_session_write(session, "STAT");
}}
-#line 734 "mn-pop3-mailbox.c"
+#line 784 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 404 "mn-pop3-mailbox.gob"
+#line 429 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_stat_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 740 "mn-pop3-mailbox.c"
+#line 790 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_stat_cb"
-#line 404 "mn-pop3-mailbox.gob"
+#line 429 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 404 "mn-pop3-mailbox.gob"
+#line 429 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 404 "mn-pop3-mailbox.gob"
+#line 429 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 749 "mn-pop3-mailbox.c"
+#line 799 "mn-pop3-mailbox.c"
{
-#line 408 "mn-pop3-mailbox.gob"
+#line 433 "mn-pop3-mailbox.gob"
switch (response->type)
{
@@ -759,7 +809,7 @@ mn_pop3_mailbox_handle_stat_cb (MNClientSession * session, MNClientSessionRespon
if (response->arguments && sscanf(response->arguments, "%d %d", &count, &size) == 2)
{
GDK_THREADS_ENTER();
- mn_mailbox_set_has_new(MN_MAILBOX(priv->mailbox), count != 0);
+ mn_mailbox_set_has_new(priv->mailbox, count != 0);
gdk_flush();
GDK_THREADS_LEAVE();
@@ -774,43 +824,43 @@ mn_pop3_mailbox_handle_stat_cb (MNClientSession * session, MNClientSessionRespon
default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}
}}
-#line 778 "mn-pop3-mailbox.c"
+#line 828 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 435 "mn-pop3-mailbox.gob"
+#line 460 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_enter_quit_cb (MNClientSession * session, MNClientSessionPrivate * priv)
-#line 784 "mn-pop3-mailbox.c"
+#line 834 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_quit_cb"
-#line 435 "mn-pop3-mailbox.gob"
+#line 460 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 435 "mn-pop3-mailbox.gob"
+#line 460 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 791 "mn-pop3-mailbox.c"
+#line 841 "mn-pop3-mailbox.c"
{
-#line 438 "mn-pop3-mailbox.gob"
+#line 463 "mn-pop3-mailbox.gob"
return mn_client_session_write(session, "QUIT");
}}
-#line 797 "mn-pop3-mailbox.c"
+#line 847 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 442 "mn-pop3-mailbox.gob"
+#line 467 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_handle_quit_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 803 "mn-pop3-mailbox.c"
+#line 853 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_quit_cb"
-#line 442 "mn-pop3-mailbox.gob"
+#line 467 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 442 "mn-pop3-mailbox.gob"
+#line 467 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 442 "mn-pop3-mailbox.gob"
+#line 467 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 812 "mn-pop3-mailbox.c"
+#line 862 "mn-pop3-mailbox.c"
{
-#line 446 "mn-pop3-mailbox.gob"
+#line 471 "mn-pop3-mailbox.gob"
switch (response->type)
{
@@ -819,33 +869,36 @@ mn_pop3_mailbox_handle_quit_cb (MNClientSession * session, MNClientSessionRespon
default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
}
}}
-#line 823 "mn-pop3-mailbox.c"
+#line 873 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 455 "mn-pop3-mailbox.gob"
+#line 480 "mn-pop3-mailbox.gob"
static void
-___13_mn_pop3_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
-#line 829 "mn-pop3-mailbox.c"
+___15_mn_pop3_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
+#line 879 "mn-pop3-mailbox.c"
#define PARENT_HANDLER(___mailbox) \
{ if(MN_MAILBOX_CLASS(parent_class)->impl_threaded_check) \
(* MN_MAILBOX_CLASS(parent_class)->impl_threaded_check)(___mailbox); }
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::impl_threaded_check"
-#line 455 "mn-pop3-mailbox.gob"
+#line 480 "mn-pop3-mailbox.gob"
g_return_if_fail (mailbox != NULL);
-#line 455 "mn-pop3-mailbox.gob"
+#line 480 "mn-pop3-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (mailbox));
-#line 839 "mn-pop3-mailbox.c"
+#line 889 "mn-pop3-mailbox.c"
{
-#line 457 "mn-pop3-mailbox.gob"
+#line 482 "mn-pop3-mailbox.gob"
Self *self = SELF(mailbox);
MNClientSessionState states[] = {
{ STATE_GREETING, NULL, self_handle_greeting_cb },
{ STATE_CAPA, self_enter_capa_cb, self_handle_capa_cb },
+#ifdef WITH_SSL
+ { STATE_STLS, self_enter_stls_cb, self_handle_stls_cb },
+#endif
#ifdef WITH_SASL
{ STATE_AUTH, self_enter_auth_cb, self_handle_auth_cb },
-#endif /* WITH_SASL */
+#endif
{ STATE_APOP, self_enter_apop_cb, self_handle_apop_cb },
{ STATE_USER, self_enter_user_cb, self_handle_user_cb },
{ STATE_PASS, self_enter_pass_cb, self_handle_pass_cb },
@@ -885,17 +938,18 @@ ___13_mn_pop3_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
}
memset(&priv, 0, sizeof(priv));
- priv.mailbox = self;
+ priv.mailbox = mailbox;
+ priv.self = self;
if (! mn_client_session_run(states,
&callbacks,
#ifdef WITH_SSL
- selfp->ssl,
+ MN_URI_IS_SSL(mailbox->uri),
#endif
- selfp->hostname,
- selfp->port,
- selfp->username,
- selfp->password,
+ mailbox->uri->hostname,
+ mailbox->uri->port,
+ mailbox->uri->username,
+ mailbox->uri->password,
&priv,
&err))
{
@@ -912,48 +966,48 @@ ___13_mn_pop3_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
GDK_THREADS_LEAVE();
g_free(priv.apop_timestamp);
- mn_pointers_free(priv.auth_mechanisms);
+ eel_g_slist_free_deep(priv.auth_mechanisms);
}}
-#line 918 "mn-pop3-mailbox.c"
+#line 972 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 534 "mn-pop3-mailbox.gob"
+#line 563 "mn-pop3-mailbox.gob"
static void
mn_pop3_mailbox_notice_cb (MNClientSession * session, const char * str, MNClientSessionPrivate * priv)
-#line 925 "mn-pop3-mailbox.c"
+#line 979 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::notice_cb"
-#line 534 "mn-pop3-mailbox.gob"
+#line 563 "mn-pop3-mailbox.gob"
g_return_if_fail (session != NULL);
-#line 534 "mn-pop3-mailbox.gob"
+#line 563 "mn-pop3-mailbox.gob"
g_return_if_fail (str != NULL);
-#line 534 "mn-pop3-mailbox.gob"
+#line 563 "mn-pop3-mailbox.gob"
g_return_if_fail (priv != NULL);
-#line 934 "mn-pop3-mailbox.c"
+#line 988 "mn-pop3-mailbox.c"
{
-#line 538 "mn-pop3-mailbox.gob"
+#line 567 "mn-pop3-mailbox.gob"
- mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ mn_mailbox_notice(priv->mailbox, "%s", str);
}}
-#line 940 "mn-pop3-mailbox.c"
+#line 994 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 542 "mn-pop3-mailbox.gob"
+#line 571 "mn-pop3-mailbox.gob"
static MNClientSessionResponse *
mn_pop3_mailbox_response_new_cb (MNClientSession * session, const char * input, MNClientSessionPrivate * priv)
-#line 946 "mn-pop3-mailbox.c"
+#line 1000 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::response_new_cb"
-#line 542 "mn-pop3-mailbox.gob"
+#line 571 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (MNClientSessionResponse * )0);
-#line 542 "mn-pop3-mailbox.gob"
+#line 571 "mn-pop3-mailbox.gob"
g_return_val_if_fail (input != NULL, (MNClientSessionResponse * )0);
-#line 542 "mn-pop3-mailbox.gob"
+#line 571 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (MNClientSessionResponse * )0);
-#line 955 "mn-pop3-mailbox.c"
+#line 1009 "mn-pop3-mailbox.c"
{
-#line 546 "mn-pop3-mailbox.gob"
+#line 575 "mn-pop3-mailbox.gob"
MNClientSessionResponse *response = NULL;
@@ -1012,46 +1066,46 @@ mn_pop3_mailbox_response_new_cb (MNClientSession * session, const char * input,
return response;
}}
-#line 1016 "mn-pop3-mailbox.c"
+#line 1070 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 605 "mn-pop3-mailbox.gob"
+#line 634 "mn-pop3-mailbox.gob"
static void
mn_pop3_mailbox_response_free_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
-#line 1022 "mn-pop3-mailbox.c"
+#line 1076 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::response_free_cb"
-#line 605 "mn-pop3-mailbox.gob"
+#line 634 "mn-pop3-mailbox.gob"
g_return_if_fail (session != NULL);
-#line 605 "mn-pop3-mailbox.gob"
+#line 634 "mn-pop3-mailbox.gob"
g_return_if_fail (response != NULL);
-#line 605 "mn-pop3-mailbox.gob"
+#line 634 "mn-pop3-mailbox.gob"
g_return_if_fail (priv != NULL);
-#line 1031 "mn-pop3-mailbox.c"
+#line 1085 "mn-pop3-mailbox.c"
{
-#line 609 "mn-pop3-mailbox.gob"
+#line 638 "mn-pop3-mailbox.gob"
g_free(response->arguments);
g_free(response);
}}
-#line 1038 "mn-pop3-mailbox.c"
+#line 1092 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 614 "mn-pop3-mailbox.gob"
+#line 643 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_custom_handler_cb (MNClientSession * session, MNClientSessionResponse * response, int result, MNClientSessionPrivate * priv)
-#line 1044 "mn-pop3-mailbox.c"
+#line 1098 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::custom_handler_cb"
-#line 614 "mn-pop3-mailbox.gob"
+#line 643 "mn-pop3-mailbox.gob"
g_return_val_if_fail (session != NULL, (int )0);
-#line 614 "mn-pop3-mailbox.gob"
+#line 643 "mn-pop3-mailbox.gob"
g_return_val_if_fail (response != NULL, (int )0);
-#line 614 "mn-pop3-mailbox.gob"
+#line 643 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 1053 "mn-pop3-mailbox.c"
+#line 1107 "mn-pop3-mailbox.c"
{
-#line 619 "mn-pop3-mailbox.gob"
+#line 648 "mn-pop3-mailbox.gob"
switch (result)
{
@@ -1067,24 +1121,24 @@ mn_pop3_mailbox_custom_handler_cb (MNClientSession * session, MNClientSessionRes
g_return_val_if_reached(0);
}
}}
-#line 1071 "mn-pop3-mailbox.c"
+#line 1125 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 635 "mn-pop3-mailbox.gob"
+#line 664 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_session_authenticate (MNClientSessionPrivate * priv)
-#line 1077 "mn-pop3-mailbox.c"
+#line 1131 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_authenticate"
-#line 635 "mn-pop3-mailbox.gob"
+#line 664 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 1082 "mn-pop3-mailbox.c"
+#line 1136 "mn-pop3-mailbox.c"
{
-#line 637 "mn-pop3-mailbox.gob"
+#line 666 "mn-pop3-mailbox.gob"
- if (priv->mailbox->_priv->authmech)
+ if (priv->mailbox->uri->authmech)
{
- if (*priv->mailbox->_priv->authmech != '+')
+ if (*priv->mailbox->uri->authmech != '+')
{
#ifdef WITH_SASL
return STATE_AUTH;
@@ -1094,14 +1148,14 @@ mn_pop3_mailbox_session_authenticate (MNClientSessionPrivate * priv)
}
else
{
- if (! strcmp(priv->mailbox->_priv->authmech, "+APOP"))
+ if (! strcmp(priv->mailbox->uri->authmech, "+APOP"))
return priv->apop_timestamp
? STATE_APOP
: mn_client_session_error(priv->session, _("server does not support APOP authentication"));
- else if (! strcmp(priv->mailbox->_priv->authmech, "+USERPASS"))
+ else if (! strcmp(priv->mailbox->uri->authmech, "+USERPASS"))
return STATE_USER;
else
- return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->uri->authmech);
}
}
else
@@ -1116,22 +1170,22 @@ mn_pop3_mailbox_session_authenticate (MNClientSessionPrivate * priv)
return STATE_USER;
}
}}
-#line 1120 "mn-pop3-mailbox.c"
+#line 1174 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 673 "mn-pop3-mailbox.gob"
+#line 702 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv, gboolean tried_apop)
-#line 1126 "mn-pop3-mailbox.c"
+#line 1180 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_authenticate_fallback"
-#line 673 "mn-pop3-mailbox.gob"
+#line 702 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 1131 "mn-pop3-mailbox.c"
+#line 1185 "mn-pop3-mailbox.c"
{
-#line 676 "mn-pop3-mailbox.gob"
+#line 705 "mn-pop3-mailbox.gob"
- if (! priv->mailbox->_priv->authmech)
+ if (! priv->mailbox->uri->authmech)
{
if (! tried_apop && priv->apop_timestamp)
{
@@ -1147,52 +1201,52 @@ mn_pop3_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv, gb
return mn_client_session_error(priv->session, _("authentication failed"));
}}
-#line 1151 "mn-pop3-mailbox.c"
+#line 1205 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 694 "mn-pop3-mailbox.gob"
+#line 723 "mn-pop3-mailbox.gob"
static int
mn_pop3_mailbox_session_authenticated (MNClientSessionPrivate * priv)
-#line 1157 "mn-pop3-mailbox.c"
+#line 1211 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_authenticated"
-#line 694 "mn-pop3-mailbox.gob"
+#line 723 "mn-pop3-mailbox.gob"
g_return_val_if_fail (priv != NULL, (int )0);
-#line 1162 "mn-pop3-mailbox.c"
+#line 1216 "mn-pop3-mailbox.c"
{
-#line 696 "mn-pop3-mailbox.gob"
+#line 725 "mn-pop3-mailbox.gob"
priv->authenticated = TRUE;
- if (priv->mailbox->_priv->login_delay)
+ if (priv->self->_priv->login_delay)
{
- if (priv->mailbox->_priv->authentication_timer)
- g_timer_start(priv->mailbox->_priv->authentication_timer);
+ if (priv->self->_priv->authentication_timer)
+ g_timer_start(priv->self->_priv->authentication_timer);
else
- priv->mailbox->_priv->authentication_timer = g_timer_new();
+ priv->self->_priv->authentication_timer = g_timer_new();
}
return priv->login_delay_user ? STATE_CAPA : STATE_STAT;
}}
-#line 1176 "mn-pop3-mailbox.c"
+#line 1230 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
-#line 708 "mn-pop3-mailbox.gob"
+#line 737 "mn-pop3-mailbox.gob"
static void
mn_pop3_mailbox_session_set_error_from_arguments (MNClientSessionPrivate * priv, MNClientSessionResponse * response)
-#line 1182 "mn-pop3-mailbox.c"
+#line 1236 "mn-pop3-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_set_error_from_arguments"
-#line 708 "mn-pop3-mailbox.gob"
+#line 737 "mn-pop3-mailbox.gob"
g_return_if_fail (priv != NULL);
-#line 708 "mn-pop3-mailbox.gob"
+#line 737 "mn-pop3-mailbox.gob"
g_return_if_fail (response != NULL);
-#line 1189 "mn-pop3-mailbox.c"
+#line 1243 "mn-pop3-mailbox.c"
{
-#line 711 "mn-pop3-mailbox.gob"
+#line 740 "mn-pop3-mailbox.gob"
if (response->arguments)
mn_client_session_error(priv->session, "\"%s\"", response->arguments);
else
mn_client_session_error(priv->session, _("unknown server error"));
}}
-#line 1198 "mn-pop3-mailbox.c"
+#line 1252 "mn-pop3-mailbox.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-pop3-mailbox.gob b/src/mn-pop3-mailbox.gob
@@ -6,6 +6,7 @@
* - RFC 1939
* - RFC 2449
* - RFC 1734
+ * - RFC 2595
*
* Copyright (c) 2003, 2004 Jean-Yves Lefort <jylefort@brutele.be>
*
@@ -36,19 +37,22 @@
#include <unistd.h>
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
+#include <eel/eel.h>
#include "mn-mailbox-private.h"
#include "mn-client-session.h"
#include "mn-util.h"
-#include "mn-uri.h"
#include "mn-md5.h"
enum
{
STATE_GREETING = MN_CLIENT_SESSION_INITIAL_STATE,
STATE_CAPA,
+#ifdef WITH_SSL
+ STATE_STLS,
+#endif
#ifdef WITH_SASL
STATE_AUTH,
-#endif /* WITH_SASL */
+#endif
STATE_APOP,
STATE_USER,
STATE_PASS,
@@ -64,14 +68,19 @@
struct _MNClientSessionPrivate
{
- MNPOP3Mailbox *mailbox;
+ MNMailbox *mailbox;
+ MNPOP3Mailbox *self;
MNClientSession *session;
gboolean in_list;
char *apop_timestamp;
GSList *auth_mechanisms;
+#ifdef WITH_SSL
+ gboolean stls_supported;
+ gboolean stls_completed;
+#endif
#ifdef WITH_SASL
const char *sasl_mechanism;
-#endif /* WITH_SASL */
+#endif
gboolean authenticated;
gboolean login_delay_user;
};
@@ -94,13 +103,6 @@
class MN:POP3:Mailbox from MN:Mailbox
{
- private char *hostname destroywith g_free;
- private int port;
- private char *username destroywith g_free;
- private char *password destroywith g_free;
- private char *authmech destroywith g_free;
- private gboolean ssl;
-
private int login_delay;
private GTimer *authentication_timer;
@@ -114,42 +116,22 @@ class MN:POP3:Mailbox from MN:Mailbox
{
GObject *object;
MNMailbox *mailbox;
- Self *self;
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
mailbox = MN_MAILBOX(object);
- self = SELF(object);
-
- if (mn_uri_parse_pop(mn_mailbox_get_uri(mailbox),
- &selfp->ssl,
- &selfp->username,
- &selfp->password,
- &selfp->authmech,
- &selfp->hostname,
- &selfp->port))
- {
+
#ifndef WITH_SSL
- if (selfp->ssl)
- mn_mailbox_set_init_error(mailbox, _("SSL support has not been compiled in"));
+ if (MN_URI_IS_SSL(mailbox->uri) || MN_URI_IS_INBAND_SSL(mailbox->uri))
+ mn_mailbox_set_init_error(mailbox, _("SSL/TLS support has not been compiled in"));
#endif /* WITH_SSL */
- }
- else
- mn_mailbox_set_init_error(mailbox, _("unable to parse POP3 URI"));
return object;
}
override (MN:Mailbox) gboolean
- impl_is (MNMailbox *dummy, const char *uri (check null))
+ impl_is (MNMailbox *dummy, MN:URI *uri (check null type))
{
- char *scheme;
- gboolean is;
-
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && (! strcmp(scheme, "pop") || ! strcmp(scheme, "pops"));
- g_free(scheme);
-
- return is;
+ return MN_URI_IS_POP(uri);
}
private int
@@ -200,10 +182,13 @@ class MN:POP3:Mailbox from MN:Mailbox
case RESPONSE_OK:
priv->in_list = TRUE;
- mn_pointers_free(priv->auth_mechanisms);
+ eel_g_slist_free_deep(priv->auth_mechanisms);
priv->auth_mechanisms = NULL;
- priv->mailbox->_priv->login_delay = 0;
+ priv->self->_priv->login_delay = 0;
priv->login_delay_user = FALSE;
+#ifdef WITH_SSL
+ priv->stls_supported = FALSE;
+#endif
return MN_CLIENT_SESSION_RESULT_CONTINUE;
@@ -212,7 +197,22 @@ class MN:POP3:Mailbox from MN:Mailbox
priv->in_list = FALSE;
if (priv->authenticated)
return STATE_STAT;
+
+#ifdef WITH_SSL
+ if (MN_URI_IS_INBAND_SSL(priv->mailbox->uri)
+ && ! MN_URI_IS_SSL(priv->mailbox->uri)
+ && ! priv->stls_completed)
+ {
+ if (priv->stls_supported)
+ return STATE_STLS;
+ else
+ {
+ mn_client_session_error(priv->session, _("server does not support in-band SSL/TLS"));
+ return STATE_QUIT;
+ }
+ }
else
+#endif /* WITH_SSL */
return self_session_authenticate(priv);
case RESPONSE_LIST_ITEM:
@@ -230,32 +230,21 @@ class MN:POP3:Mailbox from MN:Mailbox
for (i = 1; tokens[i]; i++)
priv->auth_mechanisms = g_slist_append(priv->auth_mechanisms, g_strdup(tokens[i]));
}
+#ifdef WITH_SSL
+ else if (! strcmp(tokens[0], "STLS"))
+ priv->stls_supported = TRUE;
+#endif /* WITH_SSL */
else if (! strcmp(tokens[0], "LOGIN-DELAY"))
{
- if (tokens[1])
+ if (tokens[1] && mn_str_isnumeric(tokens[1])
+ && (! tokens[2]
+ || (! tokens[3]
+ && ! priv->authenticated
+ && ! strcmp(tokens[2], "USER"))))
{
- if (mn_str_isnumeric(tokens[1]))
- {
- priv->mailbox->_priv->login_delay = atoi(tokens[1]);
- if (tokens[2])
- {
- if (! priv->authenticated)
- {
- if (! strcmp(tokens[2], "USER"))
- {
- priv->login_delay_user = TRUE;
- if (tokens[3])
- login_delay_error = TRUE;
- }
- else
- login_delay_error = TRUE;
- }
- else
- login_delay_error = TRUE;
- }
- }
- else
- login_delay_error = TRUE;
+ priv->self->_priv->login_delay = atoi(tokens[1]);
+ if (tokens[2])
+ priv->login_delay_user = TRUE;
}
else
login_delay_error = TRUE;
@@ -275,6 +264,42 @@ class MN:POP3:Mailbox from MN:Mailbox
}
private int
+ enter_stls_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SSL
+ return mn_client_session_write(session, "STLS");
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }
+
+ private int
+ handle_stls_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SSL
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ priv->stls_completed = TRUE;
+ return mn_client_session_enable_ssl(session)
+ ? STATE_CAPA
+ : RESULT_ERROR_END;
+
+ case RESPONSE_ERR:
+ return self_session_authenticate(priv);
+
+ default:
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SSL */
+ }
+
+ private int
enter_auth_cb (MNClientSession *session (check null),
MNClientSessionPrivate *priv (check null))
{
@@ -282,7 +307,7 @@ class MN:POP3:Mailbox from MN:Mailbox
if (mn_client_session_sasl_authentication_start(priv->session,
"pop",
priv->auth_mechanisms,
- priv->mailbox->_priv->authmech,
+ priv->mailbox->uri->authmech,
&priv->sasl_mechanism))
return mn_client_session_write(session, "AUTH %s", priv->sasl_mechanism);
else
@@ -330,10 +355,10 @@ class MN:POP3:Mailbox from MN:Mailbox
mn_md5_init(&context);
mn_md5_update(&context, priv->apop_timestamp, strlen(priv->apop_timestamp));
- mn_md5_update(&context, priv->mailbox->_priv->password, strlen(priv->mailbox->_priv->password));
+ mn_md5_update(&context, priv->mailbox->uri->password, strlen(priv->mailbox->uri->password));
mn_md5_end(&context, buf);
- return mn_client_session_write(session, "APOP %s %s", priv->mailbox->_priv->username, buf);
+ return mn_client_session_write(session, "APOP %s %s", priv->mailbox->uri->username, buf);
}
private int
@@ -358,7 +383,7 @@ class MN:POP3:Mailbox from MN:Mailbox
enter_user_cb (MNClientSession *session (check null),
MNClientSessionPrivate *priv (check null))
{
- return mn_client_session_write(session, "USER %s", priv->mailbox->_priv->username);
+ return mn_client_session_write(session, "USER %s", priv->mailbox->uri->username);
}
private int
@@ -378,7 +403,7 @@ class MN:POP3:Mailbox from MN:Mailbox
enter_pass_cb (MNClientSession *session (check null),
MNClientSessionPrivate *priv (check null))
{
- return mn_client_session_write(session, "PASS %s", priv->mailbox->_priv->password);
+ return mn_client_session_write(session, "PASS %s", priv->mailbox->uri->password);
}
private int
@@ -416,7 +441,7 @@ class MN:POP3:Mailbox from MN:Mailbox
if (response->arguments && sscanf(response->arguments, "%d %d", &count, &size) == 2)
{
GDK_THREADS_ENTER();
- mn_mailbox_set_has_new(MN_MAILBOX(priv->mailbox), count != 0);
+ mn_mailbox_set_has_new(priv->mailbox, count != 0);
gdk_flush();
GDK_THREADS_LEAVE();
@@ -459,9 +484,12 @@ class MN:POP3:Mailbox from MN:Mailbox
MNClientSessionState states[] = {
{ STATE_GREETING, NULL, self_handle_greeting_cb },
{ STATE_CAPA, self_enter_capa_cb, self_handle_capa_cb },
+#ifdef WITH_SSL
+ { STATE_STLS, self_enter_stls_cb, self_handle_stls_cb },
+#endif
#ifdef WITH_SASL
{ STATE_AUTH, self_enter_auth_cb, self_handle_auth_cb },
-#endif /* WITH_SASL */
+#endif
{ STATE_APOP, self_enter_apop_cb, self_handle_apop_cb },
{ STATE_USER, self_enter_user_cb, self_handle_user_cb },
{ STATE_PASS, self_enter_pass_cb, self_handle_pass_cb },
@@ -501,17 +529,18 @@ class MN:POP3:Mailbox from MN:Mailbox
}
memset(&priv, 0, sizeof(priv));
- priv.mailbox = self;
+ priv.mailbox = mailbox;
+ priv.self = self;
if (! mn_client_session_run(states,
&callbacks,
#ifdef WITH_SSL
- selfp->ssl,
+ MN_URI_IS_SSL(mailbox->uri),
#endif
- selfp->hostname,
- selfp->port,
- selfp->username,
- selfp->password,
+ mailbox->uri->hostname,
+ mailbox->uri->port,
+ mailbox->uri->username,
+ mailbox->uri->password,
&priv,
&err))
{
@@ -528,7 +557,7 @@ class MN:POP3:Mailbox from MN:Mailbox
GDK_THREADS_LEAVE();
g_free(priv.apop_timestamp);
- mn_pointers_free(priv.auth_mechanisms);
+ eel_g_slist_free_deep(priv.auth_mechanisms);
}
private void
@@ -536,7 +565,7 @@ class MN:POP3:Mailbox from MN:Mailbox
const char *str (check null),
MNClientSessionPrivate *priv (check null))
{
- mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ mn_mailbox_notice(priv->mailbox, "%s", str);
}
private MNClientSessionResponse *
@@ -635,9 +664,9 @@ class MN:POP3:Mailbox from MN:Mailbox
private int
session_authenticate (MNClientSessionPrivate *priv (check null))
{
- if (priv->mailbox->_priv->authmech)
+ if (priv->mailbox->uri->authmech)
{
- if (*priv->mailbox->_priv->authmech != '+')
+ if (*priv->mailbox->uri->authmech != '+')
{
#ifdef WITH_SASL
return STATE_AUTH;
@@ -647,14 +676,14 @@ class MN:POP3:Mailbox from MN:Mailbox
}
else
{
- if (! strcmp(priv->mailbox->_priv->authmech, "+APOP"))
+ if (! strcmp(priv->mailbox->uri->authmech, "+APOP"))
return priv->apop_timestamp
? STATE_APOP
: mn_client_session_error(priv->session, _("server does not support APOP authentication"));
- else if (! strcmp(priv->mailbox->_priv->authmech, "+USERPASS"))
+ else if (! strcmp(priv->mailbox->uri->authmech, "+USERPASS"))
return STATE_USER;
else
- return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->uri->authmech);
}
}
else
@@ -674,7 +703,7 @@ class MN:POP3:Mailbox from MN:Mailbox
session_authenticate_fallback (MNClientSessionPrivate *priv (check null),
gboolean tried_apop)
{
- if (! priv->mailbox->_priv->authmech)
+ if (! priv->mailbox->uri->authmech)
{
if (! tried_apop && priv->apop_timestamp)
{
@@ -695,12 +724,12 @@ class MN:POP3:Mailbox from MN:Mailbox
session_authenticated (MNClientSessionPrivate *priv (check null))
{
priv->authenticated = TRUE;
- if (priv->mailbox->_priv->login_delay)
+ if (priv->self->_priv->login_delay)
{
- if (priv->mailbox->_priv->authentication_timer)
- g_timer_start(priv->mailbox->_priv->authentication_timer);
+ if (priv->self->_priv->authentication_timer)
+ g_timer_start(priv->self->_priv->authentication_timer);
else
- priv->mailbox->_priv->authentication_timer = g_timer_new();
+ priv->self->_priv->authentication_timer = g_timer_new();
}
return priv->login_delay_user ? STATE_CAPA : STATE_STAT;
}
diff --git a/src/mn-properties.c b/src/mn-properties.c
@@ -23,6 +23,7 @@
#include "mn-properties.h"
#include "mn-util.h"
#include "mn-mailbox-view.h"
+#include "mn-shell.h"
/*** types *******************************************************************/
@@ -34,6 +35,9 @@ typedef struct
GtkWidget *minutes_spin;
GtkWidget *seconds_spin;
+ GtkWidget *autostart_check;
+ GtkWidget *blink_check;
+
GtkWidget *scrolled;
GtkWidget *list;
GtkWidget *selected_label;
@@ -57,6 +61,11 @@ static void mn_properties_update_sensitivity (void);
static void mn_properties_selection_changed_h (GtkTreeSelection *selection,
gpointer user_data);
+static void mn_properties_mailboxes_list_changed_h (MNMailboxes *mailboxes,
+ gpointer user_data);
+
+static void mn_properties_weak_notify_cb (gpointer data,
+ GObject *former_properties);
/*** implementation **********************************************************/
@@ -66,6 +75,8 @@ mn_properties_display (void)
GtkSizeGroup *size_group;
GtkTreeSelection *selection;
+ g_return_if_fail(mn_shell != NULL);
+
if (properties.dialog)
{
gtk_window_present(GTK_WINDOW(properties.dialog));
@@ -77,6 +88,8 @@ mn_properties_display (void)
"delay_label", &properties.delay_label,
"minutes_spin", &properties.minutes_spin,
"seconds_spin", &properties.seconds_spin,
+ "autostart_check", &properties.autostart_check,
+ "blink_check", &properties.blink_check,
"scrolled", &properties.scrolled,
"selected_label", &properties.selected_label,
"remove", &properties.remove,
@@ -104,9 +117,12 @@ mn_properties_display (void)
gtk_size_group_add_widget(size_group, properties.command_double_clicked_check);
g_object_unref(size_group);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(properties.autostart_check), mn_conf_get_autostart());
+
mn_conf_link(properties.dialog, MN_CONF_PROPERTIES_DIALOG,
properties.minutes_spin, MN_CONF_DELAY_MINUTES,
properties.seconds_spin, MN_CONF_DELAY_SECONDS,
+ properties.blink_check, MN_CONF_BLINK_ON_ERRORS,
properties.command_new_mail_check, MN_CONF_COMMANDS_NEW_MAIL_ENABLED,
properties.command_new_mail_entry, MN_CONF_COMMANDS_NEW_MAIL_COMMAND,
properties.command_double_clicked_check, MN_CONF_COMMANDS_DOUBLE_CLICKED_ENABLED,
@@ -116,6 +132,9 @@ mn_properties_display (void)
mn_properties_update_selected_label();
mn_properties_update_sensitivity();
+ g_signal_connect(G_OBJECT(mn_shell->mailboxes), "list-changed", G_CALLBACK(mn_properties_mailboxes_list_changed_h), NULL);
+ g_object_weak_ref(G_OBJECT(properties.dialog), mn_properties_weak_notify_cb, NULL);
+
gtk_widget_show(properties.dialog);
}
@@ -145,11 +164,16 @@ mn_properties_update_selected_label (void)
static void
mn_properties_update_sensitivity (void)
{
+ gboolean has_manual;
GtkTreeSelection *selection;
gboolean has_selection;
gboolean command_new_mail_enabled;
gboolean command_double_clicked_enabled;
+ has_manual = mn_mailboxes_has_manual(mn_shell->mailboxes);
+ gtk_widget_set_sensitive(properties.minutes_spin, has_manual);
+ gtk_widget_set_sensitive(properties.seconds_spin, has_manual);
+
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(properties.list));
has_selection = gtk_tree_selection_count_selected_rows(selection) > 0;
@@ -171,9 +195,29 @@ mn_properties_selection_changed_h (GtkTreeSelection *selection,
mn_properties_update_sensitivity();
}
+static void
+mn_properties_mailboxes_list_changed_h (MNMailboxes *mailboxes,
+ gpointer user_data)
+{
+ mn_properties_update_sensitivity();
+}
+
+static void
+mn_properties_weak_notify_cb (gpointer data, GObject *former_properties)
+{
+ g_signal_handlers_disconnect_by_func(mn_shell->mailboxes, mn_properties_mailboxes_list_changed_h, NULL);
+}
+
/* libglade callbacks */
void
+mn_properties_autostart_toggled_h (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ mn_conf_set_autostart(gtk_toggle_button_get_active(togglebutton));
+}
+
+void
mn_properties_toggled_h (GtkToggleButton *togglebutton, gpointer user_data)
{
mn_properties_update_sensitivity();
diff --git a/src/mn-shell.c b/src/mn-shell.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -24,9 +24,9 @@
#line 25 "mn-shell.gob"
#include "config.h"
+#include <errno.h>
#include <gnome.h>
#include "mn-properties.h"
-#include "mn-dialog.h"
#include "mn-util.h"
#include "mn-conf.h"
#include "mn-mailboxes.h"
@@ -57,6 +57,7 @@ static void mn_shell_mailboxes_list_changed_h (MNMailboxes * mailboxes, gpointer
static void mn_shell_mailboxes_status_changed_h (MNMailboxes * mailboxes, gpointer user_data) G_GNUC_UNUSED;
static void mn_shell_init_icon (MNShell * self) G_GNUC_UNUSED;
static void mn_shell_notify_double_clicked_command_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data) G_GNUC_UNUSED;
+static void mn_shell_notify_blink_on_errors_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data) G_GNUC_UNUSED;
static void mn_shell_icon_activate_h (MNMailIcon * icon, gpointer user_data) G_GNUC_UNUSED;
static void mn_shell_icon_activate_run_h (MNMailIcon * icon, gpointer user_data) G_GNUC_UNUSED;
static void mn_shell_icon_activate_update_h (MNMailIcon * icon, gpointer user_data) G_GNUC_UNUSED;
@@ -78,6 +79,7 @@ static GObjectClass *parent_class = NULL;
#define self_mailboxes_status_changed_h mn_shell_mailboxes_status_changed_h
#define self_init_icon mn_shell_init_icon
#define self_notify_double_clicked_command_cb mn_shell_notify_double_clicked_command_cb
+#define self_notify_blink_on_errors_cb mn_shell_notify_blink_on_errors_cb
#define self_icon_activate_h mn_shell_icon_activate_h
#define self_icon_activate_run_h mn_shell_icon_activate_run_h
#define self_icon_activate_update_h mn_shell_icon_activate_update_h
@@ -146,7 +148,7 @@ ___dispose (GObject *obj_self)
(* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
#line 41 "mn-shell.gob"
if(self->mailboxes) { ((*(void (*)(void *))g_object_unref)) (self->mailboxes); self->mailboxes = NULL; }
-#line 150 "mn-shell.c"
+#line 152 "mn-shell.c"
}
#undef __GOB_FUNCTION__
@@ -157,9 +159,9 @@ ___finalize(GObject *obj_self)
#define __GOB_FUNCTION__ "MN:Shell::finalize"
MNShell *self G_GNUC_UNUSED = MN_SHELL (obj_self);
gpointer priv = self->_priv;
-#line 57 "mn-shell.gob"
+#line 58 "mn-shell.gob"
___2_mn_shell_finalize(obj_self);
-#line 163 "mn-shell.c"
+#line 165 "mn-shell.c"
g_free (priv);
}
#undef __GOB_FUNCTION__
@@ -172,22 +174,22 @@ mn_shell_class_init (MNShellClass * c G_GNUC_UNUSED)
parent_class = g_type_class_ref (G_TYPE_OBJECT);
-#line 57 "mn-shell.gob"
+#line 58 "mn-shell.gob"
g_object_class->finalize = ___finalize;
-#line 178 "mn-shell.c"
+#line 180 "mn-shell.c"
g_object_class->dispose = ___dispose;
}
#undef __GOB_FUNCTION__
#line 45 "mn-shell.gob"
static void
mn_shell_init (MNShell * self G_GNUC_UNUSED)
-#line 185 "mn-shell.c"
+#line 187 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::init"
self->_priv = g_new0 (MNShellPrivate, 1);
#line 41 "mn-shell.gob"
self->mailboxes = mn_mailboxes_new();
-#line 191 "mn-shell.c"
+#line 193 "mn-shell.c"
{
#line 46 "mn-shell.gob"
@@ -196,96 +198,97 @@ mn_shell_init (MNShell * self G_GNUC_UNUSED)
self_init_icon(self);
eel_gconf_notification_add(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND, self_notify_double_clicked_command_cb, self);
+ eel_gconf_notification_add(MN_CONF_BLINK_ON_ERRORS, self_notify_blink_on_errors_cb, self);
g_signal_connect(G_OBJECT(self->mailboxes), "list-changed", G_CALLBACK(self_mailboxes_list_changed_h), self);
g_signal_connect(G_OBJECT(self->mailboxes), "status-changed", G_CALLBACK(self_mailboxes_status_changed_h), self);
-#line 204 "mn-shell.c"
+#line 207 "mn-shell.c"
}
}
#undef __GOB_FUNCTION__
-#line 57 "mn-shell.gob"
+#line 58 "mn-shell.gob"
static void
___2_mn_shell_finalize (GObject * object G_GNUC_UNUSED)
-#line 214 "mn-shell.c"
+#line 217 "mn-shell.c"
#define PARENT_HANDLER(___object) \
{ if(G_OBJECT_CLASS(parent_class)->finalize) \
(* G_OBJECT_CLASS(parent_class)->finalize)(___object); }
{
#define __GOB_FUNCTION__ "MN:Shell::finalize"
{
-#line 59 "mn-shell.gob"
+#line 60 "mn-shell.gob"
gtk_main_quit();
PARENT_HANDLER(object);
}}
-#line 226 "mn-shell.c"
+#line 229 "mn-shell.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 64 "mn-shell.gob"
+#line 65 "mn-shell.gob"
static void
mn_shell_mailboxes_list_changed_h (MNMailboxes * mailboxes, gpointer user_data)
-#line 233 "mn-shell.c"
+#line 236 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::mailboxes_list_changed_h"
-#line 64 "mn-shell.gob"
+#line 65 "mn-shell.gob"
g_return_if_fail (mailboxes != NULL);
-#line 64 "mn-shell.gob"
+#line 65 "mn-shell.gob"
g_return_if_fail (MN_IS_MAILBOXES (mailboxes));
-#line 64 "mn-shell.gob"
+#line 65 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 242 "mn-shell.c"
+#line 245 "mn-shell.c"
{
-#line 67 "mn-shell.gob"
+#line 68 "mn-shell.gob"
Self *self = user_data;
self_update_sensitivity(self);
self_update_icon(self);
}}
-#line 251 "mn-shell.c"
+#line 254 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 74 "mn-shell.gob"
+#line 75 "mn-shell.gob"
static void
mn_shell_mailboxes_status_changed_h (MNMailboxes * mailboxes, gpointer user_data)
-#line 257 "mn-shell.c"
+#line 260 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::mailboxes_status_changed_h"
-#line 74 "mn-shell.gob"
+#line 75 "mn-shell.gob"
g_return_if_fail (mailboxes != NULL);
-#line 74 "mn-shell.gob"
+#line 75 "mn-shell.gob"
g_return_if_fail (MN_IS_MAILBOXES (mailboxes));
-#line 74 "mn-shell.gob"
+#line 75 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 266 "mn-shell.c"
+#line 269 "mn-shell.c"
{
-#line 77 "mn-shell.gob"
+#line 78 "mn-shell.gob"
Self *self = user_data;
self_update_icon(self);
}}
-#line 274 "mn-shell.c"
+#line 277 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 83 "mn-shell.gob"
+#line 84 "mn-shell.gob"
static void
mn_shell_init_icon (MNShell * self)
-#line 280 "mn-shell.c"
+#line 283 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::init_icon"
-#line 83 "mn-shell.gob"
+#line 84 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 83 "mn-shell.gob"
+#line 84 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
-#line 287 "mn-shell.c"
+#line 290 "mn-shell.c"
{
-#line 85 "mn-shell.gob"
+#line 86 "mn-shell.gob"
selfp->icon = MN_MAIL_ICON(mn_mail_icon_new());
@@ -302,254 +305,272 @@ mn_shell_init_icon (MNShell * self)
self_update_sensitivity(self);
self_update_icon(self);
}}
-#line 306 "mn-shell.c"
+#line 309 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 102 "mn-shell.gob"
+#line 103 "mn-shell.gob"
static void
mn_shell_notify_double_clicked_command_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data)
-#line 312 "mn-shell.c"
+#line 315 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::notify_double_clicked_command_cb"
-#line 102 "mn-shell.gob"
+#line 103 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 317 "mn-shell.c"
+#line 320 "mn-shell.c"
{
-#line 107 "mn-shell.gob"
+#line 108 "mn-shell.gob"
Self *self = user_data;
+ GDK_THREADS_ENTER();
self_update_command(self);
+ GDK_THREADS_LEAVE();
}}
-#line 325 "mn-shell.c"
+#line 330 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 113 "mn-shell.gob"
+#line 116 "mn-shell.gob"
+static void
+mn_shell_notify_blink_on_errors_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data)
+#line 336 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::notify_blink_on_errors_cb"
+#line 116 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 341 "mn-shell.c"
+{
+#line 121 "mn-shell.gob"
+
+ Self *self = user_data;
+
+ GDK_THREADS_ENTER();
+ self_update_icon(self);
+ GDK_THREADS_LEAVE();
+ }}
+#line 351 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 129 "mn-shell.gob"
static void
mn_shell_icon_activate_h (MNMailIcon * icon, gpointer user_data)
-#line 331 "mn-shell.c"
+#line 357 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_activate_h"
-#line 113 "mn-shell.gob"
+#line 129 "mn-shell.gob"
g_return_if_fail (icon != NULL);
-#line 113 "mn-shell.gob"
+#line 129 "mn-shell.gob"
g_return_if_fail (MN_IS_MAIL_ICON (icon));
-#line 113 "mn-shell.gob"
+#line 129 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 340 "mn-shell.c"
+#line 366 "mn-shell.c"
{
-#line 116 "mn-shell.gob"
+#line 132 "mn-shell.gob"
Self *self = user_data;
if (eel_gconf_get_boolean(MN_CONF_COMMANDS_DOUBLE_CLICKED_ENABLED))
self_run_double_clicked_command(self);
}}
-#line 348 "mn-shell.c"
+#line 374 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 122 "mn-shell.gob"
+#line 138 "mn-shell.gob"
static void
mn_shell_icon_activate_run_h (MNMailIcon * icon, gpointer user_data)
-#line 354 "mn-shell.c"
+#line 380 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_activate_run_h"
-#line 122 "mn-shell.gob"
+#line 138 "mn-shell.gob"
g_return_if_fail (icon != NULL);
-#line 122 "mn-shell.gob"
+#line 138 "mn-shell.gob"
g_return_if_fail (MN_IS_MAIL_ICON (icon));
-#line 122 "mn-shell.gob"
+#line 138 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 363 "mn-shell.c"
+#line 389 "mn-shell.c"
{
-#line 125 "mn-shell.gob"
+#line 141 "mn-shell.gob"
Self *self = user_data;
self_run_double_clicked_command(self);
}}
-#line 370 "mn-shell.c"
+#line 396 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 130 "mn-shell.gob"
+#line 146 "mn-shell.gob"
static void
mn_shell_icon_activate_update_h (MNMailIcon * icon, gpointer user_data)
-#line 376 "mn-shell.c"
+#line 402 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_activate_update_h"
-#line 130 "mn-shell.gob"
+#line 146 "mn-shell.gob"
g_return_if_fail (icon != NULL);
-#line 130 "mn-shell.gob"
+#line 146 "mn-shell.gob"
g_return_if_fail (MN_IS_MAIL_ICON (icon));
-#line 130 "mn-shell.gob"
+#line 146 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 385 "mn-shell.c"
+#line 411 "mn-shell.c"
{
-#line 133 "mn-shell.gob"
+#line 149 "mn-shell.gob"
Self *self = user_data;
mn_mailboxes_check(self->mailboxes);
}}
-#line 392 "mn-shell.c"
+#line 418 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 138 "mn-shell.gob"
+#line 154 "mn-shell.gob"
static void
mn_shell_icon_activate_properties_h (MNMailIcon * icon, gpointer user_data)
-#line 398 "mn-shell.c"
+#line 424 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_activate_properties_h"
-#line 138 "mn-shell.gob"
+#line 154 "mn-shell.gob"
g_return_if_fail (icon != NULL);
-#line 138 "mn-shell.gob"
+#line 154 "mn-shell.gob"
g_return_if_fail (MN_IS_MAIL_ICON (icon));
-#line 138 "mn-shell.gob"
+#line 154 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 407 "mn-shell.c"
+#line 433 "mn-shell.c"
{
-#line 141 "mn-shell.gob"
+#line 157 "mn-shell.gob"
mn_properties_display();
}}
-#line 413 "mn-shell.c"
+#line 439 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 145 "mn-shell.gob"
+#line 161 "mn-shell.gob"
static void
mn_shell_icon_activate_help_h (MNMailIcon * icon, gpointer user_data)
-#line 419 "mn-shell.c"
+#line 445 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_activate_help_h"
-#line 145 "mn-shell.gob"
+#line 161 "mn-shell.gob"
g_return_if_fail (icon != NULL);
-#line 145 "mn-shell.gob"
+#line 161 "mn-shell.gob"
g_return_if_fail (MN_IS_MAIL_ICON (icon));
-#line 145 "mn-shell.gob"
+#line 161 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 428 "mn-shell.c"
+#line 454 "mn-shell.c"
{
-#line 148 "mn-shell.gob"
+#line 164 "mn-shell.gob"
mn_display_help(NULL);
}}
-#line 434 "mn-shell.c"
+#line 460 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 152 "mn-shell.gob"
+#line 168 "mn-shell.gob"
static void
mn_shell_icon_activate_about_h (MNMailIcon * icon, gpointer user_data)
-#line 440 "mn-shell.c"
+#line 466 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_activate_about_h"
-#line 152 "mn-shell.gob"
+#line 168 "mn-shell.gob"
g_return_if_fail (icon != NULL);
-#line 152 "mn-shell.gob"
+#line 168 "mn-shell.gob"
g_return_if_fail (MN_IS_MAIL_ICON (icon));
-#line 152 "mn-shell.gob"
+#line 168 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 449 "mn-shell.c"
+#line 475 "mn-shell.c"
{
-#line 155 "mn-shell.gob"
+#line 171 "mn-shell.gob"
Self *self = user_data;
self_display_about(self);
}}
-#line 456 "mn-shell.c"
+#line 482 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 160 "mn-shell.gob"
+#line 176 "mn-shell.gob"
static void
mn_shell_icon_activate_remove_h (MNMailIcon * icon, gpointer user_data)
-#line 462 "mn-shell.c"
+#line 488 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_activate_remove_h"
-#line 160 "mn-shell.gob"
+#line 176 "mn-shell.gob"
g_return_if_fail (icon != NULL);
-#line 160 "mn-shell.gob"
+#line 176 "mn-shell.gob"
g_return_if_fail (MN_IS_MAIL_ICON (icon));
-#line 160 "mn-shell.gob"
+#line 176 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 471 "mn-shell.c"
+#line 497 "mn-shell.c"
{
-#line 163 "mn-shell.gob"
+#line 179 "mn-shell.gob"
Self *self = user_data;
g_object_unref(self);
}}
-#line 478 "mn-shell.c"
+#line 504 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 168 "mn-shell.gob"
+#line 184 "mn-shell.gob"
static void
mn_shell_icon_destroy_h (GtkObject * object, gpointer user_data)
-#line 484 "mn-shell.c"
+#line 510 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::icon_destroy_h"
-#line 168 "mn-shell.gob"
+#line 184 "mn-shell.gob"
g_return_if_fail (object != NULL);
-#line 168 "mn-shell.gob"
+#line 184 "mn-shell.gob"
g_return_if_fail (GTK_IS_OBJECT (object));
-#line 168 "mn-shell.gob"
+#line 184 "mn-shell.gob"
g_return_if_fail (user_data != NULL);
-#line 493 "mn-shell.c"
+#line 519 "mn-shell.c"
{
-#line 171 "mn-shell.gob"
+#line 187 "mn-shell.gob"
Self *self = user_data;
/* The Notification Area applet has been terminated. Recreate the icon. */
self_init_icon(self);
}}
-#line 502 "mn-shell.c"
+#line 528 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 178 "mn-shell.gob"
+#line 194 "mn-shell.gob"
static void
mn_shell_run_double_clicked_command (MNShell * self)
-#line 508 "mn-shell.c"
+#line 534 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::run_double_clicked_command"
-#line 178 "mn-shell.gob"
+#line 194 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 178 "mn-shell.gob"
+#line 194 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
-#line 515 "mn-shell.c"
+#line 541 "mn-shell.c"
{
-#line 180 "mn-shell.gob"
+#line 196 "mn-shell.gob"
char *command;
command = eel_gconf_get_string(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND);
if (command)
{
- GError *err = NULL;
-
- if (! g_spawn_command_line_async(command, &err))
- {
- mn_error_dialog(NULL,
- _("A command error has occurred"),
- _("Unable to execute double-clicked command: %s."),
- err->message);
- g_error_free(err);
- }
+ if (gnome_execute_shell(NULL, command) < 0)
+ mn_error_dialog(NULL,
+ _("A command error has occurred"),
+ _("Unable to execute double-clicked command: %s."),
+ g_strerror(errno));
g_free(command);
}
}}
-#line 538 "mn-shell.c"
+#line 559 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 201 "mn-shell.gob"
+#line 212 "mn-shell.gob"
static void
mn_shell_update_command (MNShell * self)
-#line 544 "mn-shell.c"
+#line 565 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::update_command"
-#line 201 "mn-shell.gob"
+#line 212 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 201 "mn-shell.gob"
+#line 212 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
-#line 551 "mn-shell.c"
+#line 572 "mn-shell.c"
{
-#line 203 "mn-shell.gob"
+#line 214 "mn-shell.gob"
char *command;
@@ -557,55 +578,41 @@ mn_shell_update_command (MNShell * self)
mn_mail_icon_set_command(selfp->icon, command);
g_free(command);
}}
-#line 561 "mn-shell.c"
+#line 582 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 211 "mn-shell.gob"
+#line 222 "mn-shell.gob"
static void
mn_shell_update_sensitivity (MNShell * self)
-#line 567 "mn-shell.c"
+#line 588 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::update_sensitivity"
-#line 211 "mn-shell.gob"
+#line 222 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 211 "mn-shell.gob"
+#line 222 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
-#line 574 "mn-shell.c"
+#line 595 "mn-shell.c"
{
-#line 213 "mn-shell.gob"
-
- gboolean has_manual = FALSE;
- GSList *l;
-
- MN_LIST_FOREACH(l, mn_mailboxes_get(self->mailboxes))
- {
- MNMailbox *mailbox = l->data;
+#line 224 "mn-shell.gob"
- if (MN_MAILBOX_CAN_CHECK(mailbox) && ! mn_mailbox_get_automatic(mailbox))
- {
- has_manual = TRUE;
- break;
- }
- }
-
- gtk_widget_set_sensitive(selfp->icon->update_item, has_manual);
+ gtk_widget_set_sensitive(selfp->icon->update_item, mn_mailboxes_has_manual(self->mailboxes));
}}
-#line 594 "mn-shell.c"
+#line 601 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 231 "mn-shell.gob"
+#line 228 "mn-shell.gob"
static void
mn_shell_update_icon (MNShell * self)
-#line 600 "mn-shell.c"
+#line 607 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::update_icon"
-#line 231 "mn-shell.gob"
+#line 228 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 231 "mn-shell.gob"
+#line 228 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
-#line 607 "mn-shell.c"
+#line 614 "mn-shell.c"
{
-#line 233 "mn-shell.gob"
+#line 230 "mn-shell.gob"
GSList *mailboxes;
gboolean show = FALSE;
@@ -662,12 +669,10 @@ mn_shell_update_icon (MNShell * self)
}
}
- if (n_new > 0 || n_error > 0 || n_unsupported > 0)
- {
- show = TRUE;
- if (n_error > 0 || n_unsupported > 0)
- blink = TRUE;
- }
+ if (n_new > 0)
+ show = TRUE;
+ if ((n_error > 0 || n_unsupported > 0) && eel_gconf_get_boolean(MN_CONF_BLINK_ON_ERRORS))
+ blink = TRUE;
if (n_new > 0)
g_string_prepend(new_string, ngettext("The following mailbox has new mail:\n",
@@ -706,16 +711,11 @@ mn_shell_update_icon (MNShell * self)
command = eel_gconf_get_string(MN_CONF_COMMANDS_NEW_MAIL_COMMAND);
if (command)
{
- GError *err = NULL;
-
- if (! g_spawn_command_line_async(command, &err))
- {
- mn_error_dialog(NULL,
- _("A command error has occurred in Mail Notification"),
- _("Unable to execute new mail command: %s."),
- err->message);
- g_error_free(err);
- }
+ if (gnome_execute_shell(NULL, command) < 0)
+ mn_error_dialog(NULL,
+ _("A command error has occurred in Mail Notification"),
+ _("Unable to execute new mail command: %s."),
+ g_strerror(errno));
g_free(command);
}
@@ -724,7 +724,7 @@ mn_shell_update_icon (MNShell * self)
old_n_new = n_new;
}
- if (show)
+ if (show || blink)
{
mn_tooltips_set_tip(selfp->icon->tooltips, GTK_WIDGET(selfp->icon), tooltip->str);
mn_blinking_image_set_blinking(MN_BLINKING_IMAGE(selfp->icon->image), blink);
@@ -739,33 +739,33 @@ mn_shell_update_icon (MNShell * self)
#line 740 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 364 "mn-shell.gob"
+#line 354 "mn-shell.gob"
MNShell *
mn_shell_new (void)
#line 746 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::new"
{
-#line 366 "mn-shell.gob"
+#line 356 "mn-shell.gob"
return MN_SHELL(GET_NEW);
}}
#line 754 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 370 "mn-shell.gob"
+#line 360 "mn-shell.gob"
void
mn_shell_display_about (MNShell * self)
#line 760 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::display_about"
-#line 370 "mn-shell.gob"
+#line 360 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 370 "mn-shell.gob"
+#line 360 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
#line 767 "mn-shell.c"
{
-#line 372 "mn-shell.gob"
+#line 362 "mn-shell.gob"
if (selfp->about)
{
@@ -780,19 +780,19 @@ mn_shell_display_about (MNShell * self)
#line 781 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 384 "mn-shell.gob"
+#line 374 "mn-shell.gob"
void
mn_shell_run_welcome (MNShell * self)
#line 787 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::run_welcome"
-#line 384 "mn-shell.gob"
+#line 374 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 384 "mn-shell.gob"
+#line 374 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
#line 794 "mn-shell.c"
{
-#line 386 "mn-shell.gob"
+#line 376 "mn-shell.gob"
GtkWidget *dialog;
int response;
@@ -809,21 +809,21 @@ mn_shell_run_welcome (MNShell * self)
#line 810 "mn-shell.c"
#undef __GOB_FUNCTION__
-#line 400 "mn-shell.gob"
+#line 390 "mn-shell.gob"
void
mn_shell_report (MNShell * self, char ** report)
#line 816 "mn-shell.c"
{
#define __GOB_FUNCTION__ "MN:Shell::report"
-#line 400 "mn-shell.gob"
+#line 390 "mn-shell.gob"
g_return_if_fail (self != NULL);
-#line 400 "mn-shell.gob"
+#line 390 "mn-shell.gob"
g_return_if_fail (MN_IS_SHELL (self));
-#line 400 "mn-shell.gob"
+#line 390 "mn-shell.gob"
g_return_if_fail (report != NULL);
#line 825 "mn-shell.c"
{
-#line 402 "mn-shell.gob"
+#line 392 "mn-shell.gob"
GString *string;
GSList *l;
@@ -832,13 +832,11 @@ mn_shell_report (MNShell * self, char ** report)
MN_LIST_FOREACH(l, mn_mailboxes_get(self->mailboxes))
{
MNMailbox *mailbox = l->data;
- const char *uri;
const char *error;
- uri = mn_mailbox_get_uri(mailbox);
error = mn_mailbox_get_error(mailbox);
- g_string_append_printf(string, "%s\n", uri);
+ g_string_append_printf(string, "%s\n", mailbox->uri->text);
if (mn_mailbox_get_has_new(mailbox))
g_string_append(string, " has-new\n");
@@ -851,5 +849,5 @@ mn_shell_report (MNShell * self, char ** report)
*report = string->str;
g_string_free(string, FALSE);
}}
-#line 855 "mn-shell.c"
+#line 853 "mn-shell.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-shell.gob b/src/mn-shell.gob
@@ -24,9 +24,9 @@
%}
%{
#include "config.h"
+#include <errno.h>
#include <gnome.h>
#include "mn-properties.h"
-#include "mn-dialog.h"
#include "mn-util.h"
#include "mn-conf.h"
#include "mn-mailboxes.h"
@@ -49,6 +49,7 @@ class MN:Shell from G:Object
self_init_icon(self);
eel_gconf_notification_add(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND, self_notify_double_clicked_command_cb, self);
+ eel_gconf_notification_add(MN_CONF_BLINK_ON_ERRORS, self_notify_blink_on_errors_cb, self);
g_signal_connect(G_OBJECT(self->mailboxes), "list-changed", G_CALLBACK(self_mailboxes_list_changed_h), self);
g_signal_connect(G_OBJECT(self->mailboxes), "status-changed", G_CALLBACK(self_mailboxes_status_changed_h), self);
@@ -107,10 +108,25 @@ class MN:Shell from G:Object
{
Self *self = user_data;
+ GDK_THREADS_ENTER();
self_update_command(self);
+ GDK_THREADS_LEAVE();
}
private void
+ notify_blink_on_errors_cb (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ GDK_THREADS_ENTER();
+ self_update_icon(self);
+ GDK_THREADS_LEAVE();
+ }
+
+ private void
icon_activate_h (MN:Mail:Icon *icon (check null type),
gpointer user_data (check null))
{
@@ -183,16 +199,11 @@ class MN:Shell from G:Object
command = eel_gconf_get_string(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND);
if (command)
{
- GError *err = NULL;
-
- if (! g_spawn_command_line_async(command, &err))
- {
- mn_error_dialog(NULL,
- _("A command error has occurred"),
- _("Unable to execute double-clicked command: %s."),
- err->message);
- g_error_free(err);
- }
+ if (gnome_execute_shell(NULL, command) < 0)
+ mn_error_dialog(NULL,
+ _("A command error has occurred"),
+ _("Unable to execute double-clicked command: %s."),
+ g_strerror(errno));
g_free(command);
}
@@ -211,21 +222,7 @@ class MN:Shell from G:Object
private void
update_sensitivity (self)
{
- gboolean has_manual = FALSE;
- GSList *l;
-
- MN_LIST_FOREACH(l, mn_mailboxes_get(self->mailboxes))
- {
- MNMailbox *mailbox = l->data;
-
- if (MN_MAILBOX_CAN_CHECK(mailbox) && ! mn_mailbox_get_automatic(mailbox))
- {
- has_manual = TRUE;
- break;
- }
- }
-
- gtk_widget_set_sensitive(selfp->icon->update_item, has_manual);
+ gtk_widget_set_sensitive(selfp->icon->update_item, mn_mailboxes_has_manual(self->mailboxes));
}
private void
@@ -286,12 +283,10 @@ class MN:Shell from G:Object
}
}
- if (n_new > 0 || n_error > 0 || n_unsupported > 0)
- {
- show = TRUE;
- if (n_error > 0 || n_unsupported > 0)
- blink = TRUE;
- }
+ if (n_new > 0)
+ show = TRUE;
+ if ((n_error > 0 || n_unsupported > 0) && eel_gconf_get_boolean(MN_CONF_BLINK_ON_ERRORS))
+ blink = TRUE;
if (n_new > 0)
g_string_prepend(new_string, ngettext("The following mailbox has new mail:\n",
@@ -330,16 +325,11 @@ class MN:Shell from G:Object
command = eel_gconf_get_string(MN_CONF_COMMANDS_NEW_MAIL_COMMAND);
if (command)
{
- GError *err = NULL;
-
- if (! g_spawn_command_line_async(command, &err))
- {
- mn_error_dialog(NULL,
- _("A command error has occurred in Mail Notification"),
- _("Unable to execute new mail command: %s."),
- err->message);
- g_error_free(err);
- }
+ if (gnome_execute_shell(NULL, command) < 0)
+ mn_error_dialog(NULL,
+ _("A command error has occurred in Mail Notification"),
+ _("Unable to execute new mail command: %s."),
+ g_strerror(errno));
g_free(command);
}
@@ -348,7 +338,7 @@ class MN:Shell from G:Object
old_n_new = n_new;
}
- if (show)
+ if (show || blink)
{
mn_tooltips_set_tip(selfp->icon->tooltips, GTK_WIDGET(selfp->icon), tooltip->str);
mn_blinking_image_set_blinking(MN_BLINKING_IMAGE(selfp->icon->image), blink);
@@ -407,13 +397,11 @@ class MN:Shell from G:Object
MN_LIST_FOREACH(l, mn_mailboxes_get(self->mailboxes))
{
MNMailbox *mailbox = l->data;
- const char *uri;
const char *error;
- uri = mn_mailbox_get_uri(mailbox);
error = mn_mailbox_get_error(mailbox);
- g_string_append_printf(string, "%s\n", uri);
+ g_string_append_printf(string, "%s\n", mailbox->uri->text);
if (mn_mailbox_get_has_new(mailbox))
g_string_append(string, " has-new\n");
diff --git a/src/mn-soup.c b/src/mn-soup.c
@@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <signal.h>
#include <eel/eel.h>
#include <libsoup/soup.h>
@@ -40,7 +39,6 @@ static int use_count = 0;
G_LOCK_DEFINE_STATIC(use_count);
static unsigned int http_proxy_notification_id;
static unsigned int proxy_notification_id;
-static gpointer chld_handler;
/*** functions ***************************************************************/
@@ -58,14 +56,6 @@ mn_soup_use (void)
G_LOCK(use_count);
if (++use_count == 1)
{
- /*
- * libsoup use a child process for name resolution (see
- * soup-address.c) but does not handle the SIGCHLD signal, which
- * can interrupt our connect(), read() etc system calls: we
- * therefore ignore the SIGCHLD signal.
- */
- chld_handler = signal(SIGCHLD, SIG_IGN);
-
eel_gconf_monitor_add(CONF_HTTP_PROXY_NAMESPACE);
eel_gconf_monitor_add(CONF_PROXY_NAMESPACE);
@@ -90,9 +80,6 @@ mn_soup_unuse (void)
eel_gconf_monitor_remove(CONF_PROXY_NAMESPACE);
soup_shutdown();
-
- /* restore default handler of SIGCHLD */
- signal(SIGCHLD, chld_handler);
}
G_UNLOCK(use_count);
}
@@ -103,7 +90,9 @@ mn_soup_notify_proxy_cb (GConfClient *client,
GConfEntry *entry,
gpointer user_data)
{
+ GDK_THREADS_ENTER();
mn_soup_update_proxy();
+ GDK_THREADS_LEAVE();
}
static void
diff --git a/src/mn-ssl.c b/src/mn-ssl.c
@@ -16,9 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include "config.h"
#include <glib.h>
+#include <glib/gi18n-lib.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
+#include "mn-ssl.h"
/*** variables ***************************************************************/
@@ -47,8 +50,10 @@ mn_ssl_init (GError **err)
SSL_load_error_strings();
global_ctx = SSL_CTX_new(SSLv23_client_method());
- if (! global_ctx)
- init_error = g_strdup(ERR_reason_error_string(ERR_get_error()));
+ if (global_ctx)
+ SSL_CTX_set_mode(global_ctx, SSL_MODE_AUTO_RETRY);
+ else
+ init_error = g_strdup(mn_ssl_get_error());
initialized = TRUE;
}
@@ -63,3 +68,15 @@ mn_ssl_init (GError **err)
return ctx;
}
+
+const char *
+mn_ssl_get_error (void)
+{
+ const char *error;
+
+ error = ERR_reason_error_string(ERR_get_error());
+ if (! error)
+ error = _("unknown SSL/TLS error");
+
+ return error;
+}
diff --git a/src/mn-ssl.h b/src/mn-ssl.h
@@ -23,5 +23,6 @@
#include <openssl/ssl.h>
SSL_CTX *mn_ssl_init (GError **err);
+const char *mn_ssl_get_error (void);
#endif /* _MN_SSL_H */
diff --git a/src/mn-sylpheed-mailbox.c b/src/mn-sylpheed-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -47,7 +47,7 @@ typedef MNSylpheedMailboxClass SelfClass;
static void mn_sylpheed_mailbox_init (MNSylpheedMailbox * o) G_GNUC_UNUSED;
static void mn_sylpheed_mailbox_class_init (MNSylpheedMailboxClass * class) G_GNUC_UNUSED;
static GObject * ___2_mn_sylpheed_mailbox_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
-static gboolean ___3_mn_sylpheed_mailbox_impl_is (MNMailbox * dummy, const char * uri) G_GNUC_UNUSED;
+static gboolean ___3_mn_sylpheed_mailbox_impl_is (MNMailbox * dummy, MNURI * uri) G_GNUC_UNUSED;
static void ___4_mn_sylpheed_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
/* pointer to the class of our parent */
@@ -114,9 +114,9 @@ mn_sylpheed_mailbox_class_init (MNSylpheedMailboxClass * class G_GNUC_UNUSED)
#line 37 "mn-sylpheed-mailbox.gob"
g_object_class->constructor = ___2_mn_sylpheed_mailbox_constructor;
-#line 56 "mn-sylpheed-mailbox.gob"
+#line 61 "mn-sylpheed-mailbox.gob"
mn_mailbox_class->impl_is = ___3_mn_sylpheed_mailbox_impl_is;
-#line 69 "mn-sylpheed-mailbox.gob"
+#line 78 "mn-sylpheed-mailbox.gob"
mn_mailbox_class->impl_threaded_check = ___4_mn_sylpheed_mailbox_impl_threaded_check;
#line 122 "mn-sylpheed-mailbox.c"
{
@@ -150,64 +150,75 @@ ___2_mn_sylpheed_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construc
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
- mn_mailbox_get_uri(self),
+ self->uri->text,
GNOME_VFS_MONITOR_DIRECTORY,
MN_MAILBOX_MONITOR_EVENT_CHANGED
| MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
return object;
}}
-#line 163 "mn-sylpheed-mailbox.c"
+#line 168 "mn-sylpheed-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 56 "mn-sylpheed-mailbox.gob"
+#line 61 "mn-sylpheed-mailbox.gob"
static gboolean
-___3_mn_sylpheed_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
-#line 170 "mn-sylpheed-mailbox.c"
+___3_mn_sylpheed_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, MNURI * uri)
+#line 175 "mn-sylpheed-mailbox.c"
#define PARENT_HANDLER(___dummy,___uri) \
((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
(* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
((gboolean )0))
{
#define __GOB_FUNCTION__ "MN:Sylpheed:Mailbox::impl_is"
-#line 56 "mn-sylpheed-mailbox.gob"
+#line 61 "mn-sylpheed-mailbox.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 179 "mn-sylpheed-mailbox.c"
+#line 61 "mn-sylpheed-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (gboolean )0);
+#line 186 "mn-sylpheed-mailbox.c"
{
-#line 58 "mn-sylpheed-mailbox.gob"
+#line 63 "mn-sylpheed-mailbox.gob"
- char *markfile_uri;
- gboolean is;
+ gboolean is = FALSE;
+
+ if (uri->vfs)
+ {
+ GnomeVFSURI *markfile_uri;
- markfile_uri = g_build_path("/", uri, ".sylpheed_mark", NULL);
- is = mn_vfs_test(markfile_uri, G_FILE_TEST_IS_REGULAR);
- g_free(markfile_uri);
+ markfile_uri = gnome_vfs_uri_append_file_name(uri->vfs, ".sylpheed_mark");
+ is = mn_vfs_test(markfile_uri, G_FILE_TEST_IS_REGULAR);
+ gnome_vfs_uri_unref(markfile_uri);
+ }
return is;
}}
-#line 192 "mn-sylpheed-mailbox.c"
+#line 203 "mn-sylpheed-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
-#line 69 "mn-sylpheed-mailbox.gob"
+#line 78 "mn-sylpheed-mailbox.gob"
static void
___4_mn_sylpheed_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
-#line 199 "mn-sylpheed-mailbox.c"
+#line 210 "mn-sylpheed-mailbox.c"
#define PARENT_HANDLER(___self) \
{ if(MN_MAILBOX_CLASS(parent_class)->impl_threaded_check) \
(* MN_MAILBOX_CLASS(parent_class)->impl_threaded_check)(___self); }
{
#define __GOB_FUNCTION__ "MN:Sylpheed:Mailbox::impl_threaded_check"
-#line 69 "mn-sylpheed-mailbox.gob"
+#line 78 "mn-sylpheed-mailbox.gob"
g_return_if_fail (self != NULL);
-#line 69 "mn-sylpheed-mailbox.gob"
+#line 78 "mn-sylpheed-mailbox.gob"
g_return_if_fail (MN_IS_MAILBOX (self));
-#line 209 "mn-sylpheed-mailbox.c"
+#line 220 "mn-sylpheed-mailbox.c"
{
-#line 71 "mn-sylpheed-mailbox.gob"
+#line 80 "mn-sylpheed-mailbox.gob"
GnomeVFSResult result;
GnomeVFSResult close_result;
@@ -216,7 +227,7 @@ ___4_mn_sylpheed_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
int total_count = 0;
int mark_count = 0;
- result = gnome_vfs_directory_open(&handle, mn_mailbox_get_uri(self), GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+ result = gnome_vfs_directory_open_from_uri(&handle, self->uri->vfs, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
if (result != GNOME_VFS_OK)
{
GDK_THREADS_ENTER();
@@ -264,6 +275,6 @@ ___4_mn_sylpheed_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
gdk_flush();
GDK_THREADS_LEAVE();
}}
-#line 268 "mn-sylpheed-mailbox.c"
+#line 279 "mn-sylpheed-mailbox.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER
diff --git a/src/mn-sylpheed-mailbox.gob b/src/mn-sylpheed-mailbox.gob
@@ -43,25 +43,34 @@ class MN:Sylpheed:Mailbox from MN:Mailbox
object = PARENT_HANDLER(type, n_construct_properties, construct_params);
self = MN_MAILBOX(object);
+ GDK_THREADS_ENTER();
+
mn_mailbox_monitor(self,
- mn_mailbox_get_uri(self),
+ self->uri->text,
GNOME_VFS_MONITOR_DIRECTORY,
MN_MAILBOX_MONITOR_EVENT_CHANGED
| MN_MAILBOX_MONITOR_EVENT_DELETED
| MN_MAILBOX_MONITOR_EVENT_CREATED);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
return object;
}
override (MN:Mailbox) gboolean
- impl_is (MNMailbox *dummy, const char *uri (check null))
+ impl_is (MNMailbox *dummy, MN:URI *uri (check null type))
{
- char *markfile_uri;
- gboolean is;
+ gboolean is = FALSE;
+
+ if (uri->vfs)
+ {
+ GnomeVFSURI *markfile_uri;
- markfile_uri = g_build_path("/", uri, ".sylpheed_mark", NULL);
- is = mn_vfs_test(markfile_uri, G_FILE_TEST_IS_REGULAR);
- g_free(markfile_uri);
+ markfile_uri = gnome_vfs_uri_append_file_name(uri->vfs, ".sylpheed_mark");
+ is = mn_vfs_test(markfile_uri, G_FILE_TEST_IS_REGULAR);
+ gnome_vfs_uri_unref(markfile_uri);
+ }
return is;
}
@@ -76,7 +85,7 @@ class MN:Sylpheed:Mailbox from MN:Mailbox
int total_count = 0;
int mark_count = 0;
- result = gnome_vfs_directory_open(&handle, mn_mailbox_get_uri(self), GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+ result = gnome_vfs_directory_open_from_uri(&handle, self->uri->vfs, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
if (result != GNOME_VFS_OK)
{
GDK_THREADS_ENTER();
diff --git a/src/mn-system-mailbox-properties-private.h b/src/mn-system-mailbox-properties-private.h
@@ -10,9 +10,9 @@ extern "C" {
#endif /* __cplusplus */
struct _MNSystemMailboxPropertiesPrivate {
-#line 35 "mn-system-mailbox-properties.gob"
+#line 34 "mn-system-mailbox-properties.gob"
GtkSizeGroup * size_group;
-#line 41 "mn-system-mailbox-properties.gob"
+#line 40 "mn-system-mailbox-properties.gob"
const char * system_uri;
#line 18 "mn-system-mailbox-properties-private.h"
};
diff --git a/src/mn-system-mailbox-properties.c b/src/mn-system-mailbox-properties.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:31 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -27,9 +27,8 @@
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include "mn-mailbox-properties.h"
-#include "mn-uri.h"
-#line 33 "mn-system-mailbox-properties.c"
+#line 32 "mn-system-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_SYSTEM_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_SYSTEM_MAILBOX_PROPERTIES_CONST(x)
@@ -48,8 +47,8 @@ static void ___object_set_property (GObject *object, guint property_id, const GV
static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void mn_system_mailbox_properties_class_init (MNSystemMailboxPropertiesClass * c) G_GNUC_UNUSED;
static void mn_system_mailbox_properties_init (MNSystemMailboxProperties * self) G_GNUC_UNUSED;
-static gboolean mn_system_mailbox_properties_set_uri (MNMailboxProperties * self, const char * uri) G_GNUC_UNUSED;
-static char * mn_system_mailbox_properties_get_uri (MNMailboxProperties * self) G_GNUC_UNUSED;
+static gboolean mn_system_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri) G_GNUC_UNUSED;
+static MNURI * mn_system_mailbox_properties_get_uri (MNMailboxProperties * self) G_GNUC_UNUSED;
enum {
PROP_0,
@@ -69,11 +68,11 @@ static GtkLabelClass *parent_class = NULL;
static void
___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
{
-#line 66 "mn-system-mailbox-properties.gob"
+#line 65 "mn-system-mailbox-properties.gob"
iface->set_uri = self_set_uri;
-#line 74 "mn-system-mailbox-properties.gob"
+#line 72 "mn-system-mailbox-properties.gob"
iface->get_uri = self_get_uri;
-#line 77 "mn-system-mailbox-properties.c"
+#line 76 "mn-system-mailbox-properties.c"
}
GType
@@ -135,9 +134,9 @@ ___dispose (GObject *obj_self)
MNSystemMailboxProperties *self G_GNUC_UNUSED = MN_SYSTEM_MAILBOX_PROPERTIES (obj_self);
if (G_OBJECT_CLASS (parent_class)->dispose) \
(* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
-#line 35 "mn-system-mailbox-properties.gob"
+#line 34 "mn-system-mailbox-properties.gob"
if(self->_priv->size_group) { ((*(void (*)(void *))g_object_unref)) (self->_priv->size_group); self->_priv->size_group = NULL; }
-#line 141 "mn-system-mailbox-properties.c"
+#line 140 "mn-system-mailbox-properties.c"
}
#undef __GOB_FUNCTION__
@@ -179,15 +178,15 @@ mn_system_mailbox_properties_class_init (MNSystemMailboxPropertiesClass * c G_GN
}
}
#undef __GOB_FUNCTION__
-#line 43 "mn-system-mailbox-properties.gob"
+#line 42 "mn-system-mailbox-properties.gob"
static void
mn_system_mailbox_properties_init (MNSystemMailboxProperties * self G_GNUC_UNUSED)
-#line 186 "mn-system-mailbox-properties.c"
+#line 185 "mn-system-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::init"
self->_priv = g_new0 (MNSystemMailboxPropertiesPrivate, 1);
{
-#line 44 "mn-system-mailbox-properties.gob"
+#line 43 "mn-system-mailbox-properties.gob"
gtk_label_set_line_wrap(GTK_LABEL(self), TRUE);
gtk_misc_set_alignment(GTK_MISC(self), 0.0, 0.5);
@@ -209,7 +208,7 @@ mn_system_mailbox_properties_init (MNSystemMailboxProperties * self G_GNUC_UNUSE
else
gtk_label_set_text(GTK_LABEL(self), _("The location of your system mailbox could not be detected. Please set the MAIL environment variable."));
-#line 213 "mn-system-mailbox-properties.c"
+#line 212 "mn-system-mailbox-properties.c"
}
}
#undef __GOB_FUNCTION__
@@ -228,9 +227,9 @@ ___object_set_property (GObject *object,
switch (property_id) {
case PROP_SIZE_GROUP:
{
-#line 36 "mn-system-mailbox-properties.gob"
+#line 35 "mn-system-mailbox-properties.gob"
{ GObject *___old = (GObject *)self->_priv->size_group; self->_priv->size_group = (void *)g_value_dup_object (VAL); if (___old != NULL) { g_object_unref (G_OBJECT (___old)); } }
-#line 234 "mn-system-mailbox-properties.c"
+#line 233 "mn-system-mailbox-properties.c"
}
break;
default:
@@ -259,23 +258,23 @@ ___object_get_property (GObject *object,
switch (property_id) {
case PROP_LABEL:
{
-#line 33 "mn-system-mailbox-properties.gob"
+#line 32 "mn-system-mailbox-properties.gob"
g_value_set_string(VAL, _("System Mailbox"));
-#line 265 "mn-system-mailbox-properties.c"
+#line 264 "mn-system-mailbox-properties.c"
}
break;
case PROP_SIZE_GROUP:
{
-#line 36 "mn-system-mailbox-properties.gob"
+#line 35 "mn-system-mailbox-properties.gob"
g_value_set_object (VAL, (gpointer)self->_priv->size_group);
-#line 272 "mn-system-mailbox-properties.c"
+#line 271 "mn-system-mailbox-properties.c"
}
break;
case PROP_COMPLETE:
{
-#line 39 "mn-system-mailbox-properties.gob"
+#line 38 "mn-system-mailbox-properties.gob"
g_value_set_boolean(VAL, selfp->system_uri != NULL);
-#line 279 "mn-system-mailbox-properties.c"
+#line 278 "mn-system-mailbox-properties.c"
}
break;
default:
@@ -292,43 +291,42 @@ g_value_set_object (VAL, (gpointer)self->_priv->size_group);
-#line 66 "mn-system-mailbox-properties.gob"
+#line 65 "mn-system-mailbox-properties.gob"
static gboolean
-mn_system_mailbox_properties_set_uri (MNMailboxProperties * self, const char * uri)
-#line 299 "mn-system-mailbox-properties.c"
+mn_system_mailbox_properties_set_uri (MNMailboxProperties * self, MNURI * uri)
+#line 298 "mn-system-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::set_uri"
-#line 66 "mn-system-mailbox-properties.gob"
+#line 65 "mn-system-mailbox-properties.gob"
g_return_val_if_fail (self != NULL, (gboolean )0);
-#line 66 "mn-system-mailbox-properties.gob"
+#line 65 "mn-system-mailbox-properties.gob"
g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (gboolean )0);
-#line 66 "mn-system-mailbox-properties.gob"
+#line 65 "mn-system-mailbox-properties.gob"
g_return_val_if_fail (uri != NULL, (gboolean )0);
-#line 308 "mn-system-mailbox-properties.c"
+#line 307 "mn-system-mailbox-properties.c"
{
-#line 69 "mn-system-mailbox-properties.gob"
+#line 68 "mn-system-mailbox-properties.gob"
- return SELF(self)->_priv->system_uri
- && ! mn_uri_cmp(uri, SELF(self)->_priv->system_uri);
+ return MN_URI_IS_SYSTEM_MAILBOX(uri);
}}
-#line 315 "mn-system-mailbox-properties.c"
+#line 313 "mn-system-mailbox-properties.c"
#undef __GOB_FUNCTION__
-#line 74 "mn-system-mailbox-properties.gob"
-static char *
+#line 72 "mn-system-mailbox-properties.gob"
+static MNURI *
mn_system_mailbox_properties_get_uri (MNMailboxProperties * self)
-#line 321 "mn-system-mailbox-properties.c"
+#line 319 "mn-system-mailbox-properties.c"
{
#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::get_uri"
-#line 74 "mn-system-mailbox-properties.gob"
- g_return_val_if_fail (self != NULL, (char * )0);
-#line 74 "mn-system-mailbox-properties.gob"
- g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (char * )0);
-#line 328 "mn-system-mailbox-properties.c"
+#line 72 "mn-system-mailbox-properties.gob"
+ g_return_val_if_fail (self != NULL, (MNURI * )0);
+#line 72 "mn-system-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (MNURI * )0);
+#line 326 "mn-system-mailbox-properties.c"
{
-#line 76 "mn-system-mailbox-properties.gob"
+#line 74 "mn-system-mailbox-properties.gob"
- return g_strdup(SELF(self)->_priv->system_uri);
+ return mn_uri_new(SELF(self)->_priv->system_uri);
}}
-#line 334 "mn-system-mailbox-properties.c"
+#line 332 "mn-system-mailbox-properties.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-system-mailbox-properties.gob b/src/mn-system-mailbox-properties.gob
@@ -24,7 +24,6 @@
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include "mn-mailbox-properties.h"
-#include "mn-uri.h"
%}
class MN:System:Mailbox:Properties from Gtk:Label (interface MN:Mailbox:Properties)
@@ -65,15 +64,14 @@ class MN:System:Mailbox:Properties from Gtk:Label (interface MN:Mailbox:Properti
interface MN:Mailbox:Properties private gboolean
set_uri (MN:Mailbox:Properties *self (check null type),
- const char *uri (check null))
+ MN:URI *uri (check null))
{
- return SELF(self)->_priv->system_uri
- && ! mn_uri_cmp(uri, SELF(self)->_priv->system_uri);
+ return MN_URI_IS_SYSTEM_MAILBOX(uri);
}
- interface MN:Mailbox:Properties private char *
+ interface MN:Mailbox:Properties private MNURI *
get_uri (MN:Mailbox:Properties *self (check null type))
{
- return g_strdup(SELF(self)->_priv->system_uri);
+ return mn_uri_new(SELF(self)->_priv->system_uri);
}
}
diff --git a/src/mn-unsupported-mailbox.c b/src/mn-unsupported-mailbox.c
@@ -1,4 +1,4 @@
-/* Generated by GOB (v2.0.9) on Thu Aug 19 00:41:32 2004
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
(do not edit directly) */
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
@@ -245,22 +245,24 @@ mn_unsupported_mailbox_get_reason (MNUnsupportedMailbox * self)
#line 41 "mn-unsupported-mailbox.gob"
MNMailbox *
-mn_unsupported_mailbox_new (const char * uri, const char * reason)
+mn_unsupported_mailbox_new (MNURI * uri, const char * reason)
#line 250 "mn-unsupported-mailbox.c"
{
#define __GOB_FUNCTION__ "MN:Unsupported:Mailbox::new"
#line 41 "mn-unsupported-mailbox.gob"
g_return_val_if_fail (uri != NULL, (MNMailbox * )0);
#line 41 "mn-unsupported-mailbox.gob"
+ g_return_val_if_fail (MN_IS_URI (uri), (MNMailbox * )0);
+#line 41 "mn-unsupported-mailbox.gob"
g_return_val_if_fail (reason != NULL, (MNMailbox * )0);
-#line 257 "mn-unsupported-mailbox.c"
+#line 259 "mn-unsupported-mailbox.c"
{
#line 44 "mn-unsupported-mailbox.gob"
return g_object_new(TYPE_SELF,
- MN_MAILBOX_PROP_URI((char *) uri),
+ MN_MAILBOX_PROP_URI(G_OBJECT(uri)),
MN_UNSUPPORTED_MAILBOX_PROP_REASON((char *) reason),
NULL);
}}
-#line 266 "mn-unsupported-mailbox.c"
+#line 268 "mn-unsupported-mailbox.c"
#undef __GOB_FUNCTION__
diff --git a/src/mn-unsupported-mailbox.gob b/src/mn-unsupported-mailbox.gob
@@ -39,11 +39,11 @@ class MN:Unsupported:Mailbox from MN:Mailbox
}
public MNMailbox *
- new (const char *uri (check null),
+ new (MN:URI *uri (check null type),
const char *reason (check null))
{
return g_object_new(TYPE_SELF,
- MN_MAILBOX_PROP_URI((char *) uri),
+ MN_MAILBOX_PROP_URI(G_OBJECT(uri)),
MN_UNSUPPORTED_MAILBOX_PROP_REASON((char *) reason),
NULL);
}
diff --git a/src/mn-unsupported-mailbox.h b/src/mn-unsupported-mailbox.h
@@ -55,7 +55,7 @@ struct _MNUnsupportedMailboxClass {
*/
GType mn_unsupported_mailbox_get_type (void);
const char * mn_unsupported_mailbox_get_reason (MNUnsupportedMailbox * self);
-MNMailbox * mn_unsupported_mailbox_new (const char * uri,
+MNMailbox * mn_unsupported_mailbox_new (MNURI * uri,
const char * reason);
/*
diff --git a/src/mn-uri-private.h b/src/mn-uri-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_URI_PRIVATE_H__
+#define __MN_URI_PRIVATE_H__
+
+#include "mn-uri.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-uri.c b/src/mn-uri.c
@@ -1,24 +1,32 @@
-/*
- * Copyright (c) 2004 Jean-Yves Lefort <jylefort@brutele.be>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
+/* Generated by GOB (v2.0.9) on Thu Sep 9 01:42:01 2004
+ (do not edit directly) */
+
+/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
+
+#define GOB_VERSION_MAJOR 2
+#define GOB_VERSION_MINOR 0
+#define GOB_VERSION_PATCHLEVEL 9
+
+#define selfp (self->_priv)
+
+#include "mn-uri.h"
+
+#include "mn-uri-private.h"
+
+#ifdef G_LIKELY
+#define ___GOB_LIKELY(expr) G_LIKELY(expr)
+#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
+#else /* ! G_LIKELY */
+#define ___GOB_LIKELY(expr) (expr)
+#define ___GOB_UNLIKELY(expr) (expr)
+#endif /* G_LIKELY */
+
+#line 52 "mn-uri.gob"
#include "config.h"
#include <stdio.h> /* required by stdlib.h on Darwin */
#include <stdlib.h> /* required by sys/socket.h on Darwin */
+#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -26,751 +34,811 @@
#include <arpa/inet.h>
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
-#include "mn-uri.h"
+#include <eel/eel.h>
#include "mn-util.h"
-/*** functions ***************************************************************/
-
-static gboolean mn_uri_is_ipv6_address (const char *hostname);
+ typedef struct
+ {
+ const char *name;
+
+ MNURIType type;
+ MNURIFlags flags;
+
+ int default_port;
+ const char *default_path;
+ } SchemeInfo;
+
+ static const SchemeInfo our_schemes[] = {
+ { "pop", MN_URI_POP, 0, 110, NULL },
+ { "pops", MN_URI_POP, MN_URI_SSL, 995, NULL },
+ { "imap", MN_URI_IMAP, 0, 143, "INBOX" },
+ { "imaps", MN_URI_IMAP, MN_URI_SSL, 993, "INBOX" },
+ { "gmail", MN_URI_GMAIL, 0, -1, NULL }
+ };
+
+#line 60 "mn-uri.c"
+/* self casting macros */
+#define SELF(x) MN_URI(x)
+#define SELF_CONST(x) MN_URI_CONST(x)
+#define IS_SELF(x) MN_IS_URI(x)
+#define TYPE_SELF MN_TYPE_URI
+#define SELF_CLASS(x) MN_URI_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_URI_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNURI Self;
+typedef MNURIClass SelfClass;
+
+/* here are local prototypes */
+static void mn_uri_init (MNURI * o) G_GNUC_UNUSED;
+static void mn_uri_class_init (MNURIClass * c) G_GNUC_UNUSED;
+static gboolean mn_uri_is_ipv6_address (const char * hostname) G_GNUC_UNUSED;
+static const SchemeInfo * mn_uri_get_scheme_info (const char * scheme) G_GNUC_UNUSED;
+static void mn_uri_parse (MNURI * self) G_GNUC_UNUSED;
+static void mn_uri_build (MNURI * self) G_GNUC_UNUSED;
+static void mn_uri_set_human_readable (MNURI * self) G_GNUC_UNUSED;
+static void mn_uri_post_init (MNURI * self) G_GNUC_UNUSED;
+
+/* pointer to the class of our parent */
+static GObjectClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_is_ipv6_address mn_uri_is_ipv6_address
+#define self_has_query mn_uri_has_query
+#define self_get_system_mailbox mn_uri_get_system_mailbox
+#define self_get_scheme_info mn_uri_get_scheme_info
+#define self_get_default_port mn_uri_get_default_port
+#define self_get_default_path mn_uri_get_default_path
+#define self_parse mn_uri_parse
+#define self_build mn_uri_build
+#define self_set_human_readable mn_uri_set_human_readable
+#define self_post_init mn_uri_post_init
+#define self_new mn_uri_new
+#define self_new_pop mn_uri_new_pop
+#define self_new_imap mn_uri_new_imap
+#define self_new_gmail mn_uri_new_gmail
+GType
+mn_uri_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNURIClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_uri_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNURI),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_uri_init,
+ NULL
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "MNURI", &info, (GTypeFlags)0);
+ }
-static char *mn_uri_build_generic (const char *scheme,
- const char *username,
- const char *password,
- const char *authmech,
- const char *hostname,
- int port,
- const char *path);
-static gboolean mn_uri_parse_generic (const char *uri,
- char **scheme,
- char **username,
- char **password,
- char **authmech,
- char **hostname,
- int *port,
- char **path);
+ return type;
+}
-/*** implementation **********************************************************/
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNURI *)g_object_new(mn_uri_get_type(), NULL))
-static gboolean
-mn_uri_is_ipv6_address (const char *hostname)
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNURI * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNURI *
+GET_NEW_VARG (const char *first, ...)
{
- char dummy[16]; /* sizeof(struct in6_addr) */
+ MNURI *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNURI *)g_object_new_valist (mn_uri_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
- g_return_val_if_fail(hostname != NULL, FALSE);
- return inet_pton(AF_INET6, hostname, dummy) == 1;
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:URI::dispose"
+ MNURI *self G_GNUC_UNUSED = MN_URI (obj_self);
+ if (G_OBJECT_CLASS (parent_class)->dispose) \
+ (* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
+#line 90 "mn-uri.gob"
+ if(self->vfs) { ((*(void (*)(void *))gnome_vfs_uri_unref)) (self->vfs); self->vfs = NULL; }
+#line 154 "mn-uri.c"
}
+#undef __GOB_FUNCTION__
-/**
- * mn_uri_build_generic:
- * @scheme: the URI scheme
- * @username: the username, or NULL
- * @password: the password, or NULL
- * @authmech: the authentication mechanism, or NULL
- * @hostname: the hostname, or NULL
- * @port: the port number, or -1 (if specified, @hostname must not be NULL)
- * @path: the path, or NULL
- *
- * Builds a RFC 1738 URI. If @authmech is specified, a RFC 2384-style
- * notation will be used.
- *
- * If hostname is an IPv6 address, a RFC 2732-style notation will be
- * used.
- *
- * Return value: the new URI.
- **/
-static char *
-mn_uri_build_generic (const char *scheme,
- const char *username,
- const char *password,
- const char *authmech,
- const char *hostname,
- int port,
- const char *path)
-{
- GString *uri;
- char *escaped;
-
- g_return_val_if_fail(scheme != NULL, NULL);
-
- escaped = gnome_vfs_escape_string(scheme);
- uri = g_string_new(escaped);
- g_free(escaped);
-
- g_string_append(uri, "://");
-
- if (username)
- {
- escaped = gnome_vfs_escape_string(username);
- g_string_append(uri, escaped);
- g_free(escaped);
- }
- if (password)
- {
- escaped = gnome_vfs_escape_string(password);
- g_string_append_printf(uri, ":%s", escaped);
- g_free(escaped);
- }
- if (authmech)
- {
- escaped = gnome_vfs_escape_string(authmech);
- g_string_append_printf(uri, ";AUTH=%s", escaped);
- g_free(escaped);
- }
- if (hostname)
- {
- escaped = gnome_vfs_escape_host_and_path_string(hostname);
- g_string_append_printf(uri, mn_uri_is_ipv6_address(hostname) ? "@[%s]" : "@%s", escaped);
- g_free(escaped);
- }
- if (port >= 0)
- {
- g_return_val_if_fail(hostname != NULL, NULL);
- g_string_append_printf(uri, ":%i", port);
- }
- if (path)
- {
- escaped = gnome_vfs_escape_path_string(path);
- g_string_append_printf(uri, "/%s", escaped);
- g_free(escaped);
- }
- return g_string_free(uri, FALSE);
+static void
+___finalize(GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:URI::finalize"
+ MNURI *self G_GNUC_UNUSED = MN_URI (obj_self);
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+#line 89 "mn-uri.gob"
+ if(self->text) { ((*(void (*)(void *))g_free)) (self->text); self->text = NULL; }
+#line 168 "mn-uri.c"
+#line 91 "mn-uri.gob"
+ if(self->human_readable) { ((*(void (*)(void *))g_free)) (self->human_readable); self->human_readable = NULL; }
+#line 171 "mn-uri.c"
+#line 93 "mn-uri.gob"
+ if(self->scheme) { ((*(void (*)(void *))g_free)) (self->scheme); self->scheme = NULL; }
+#line 174 "mn-uri.c"
+#line 94 "mn-uri.gob"
+ if(self->username) { ((*(void (*)(void *))g_free)) (self->username); self->username = NULL; }
+#line 177 "mn-uri.c"
+#line 95 "mn-uri.gob"
+ if(self->password) { ((*(void (*)(void *))g_free)) (self->password); self->password = NULL; }
+#line 180 "mn-uri.c"
+#line 96 "mn-uri.gob"
+ if(self->authmech) { ((*(void (*)(void *))g_free)) (self->authmech); self->authmech = NULL; }
+#line 183 "mn-uri.c"
+#line 97 "mn-uri.gob"
+ if(self->hostname) { ((*(void (*)(void *))g_free)) (self->hostname); self->hostname = NULL; }
+#line 186 "mn-uri.c"
+#line 99 "mn-uri.gob"
+ if(self->path) { ((*(void (*)(void *))g_free)) (self->path); self->path = NULL; }
+#line 189 "mn-uri.c"
+#line 100 "mn-uri.gob"
+ if(self->queries) { ((*(void (*)(void *))g_strfreev)) (self->queries); self->queries = NULL; }
+#line 192 "mn-uri.c"
}
+#undef __GOB_FUNCTION__
-/**
- * mn_uri_parse_generic:
- * @uri: the URI to parse
- * @scheme: a location to store the scheme, or NULL
- * @username: a location to store the username, or NULL
- * @password: a location to store the password, or NULL
- * @authmech: a location to store the authentication mechanism, or NULL
- * @hostname: a location to store the hostname, or NULL
- * @port: a location to store the port number, or NULL
- * @path: a location to store the path, or NULL
- *
- * Parses a RFC 1738 URI. RFC 2384-style authentication mechanism
- * notation and RFC 2732-style IPv6 address notation are supported.
- *
- * WARNING: the parsing is very lax, this function is NOT intended to
- * be used on untrusted URIs.
- *
- * Return value: TRUE is @uri has at least a scheme, username and
- * password, FALSE otherwise.
- **/
-static gboolean
-mn_uri_parse_generic (const char *uri,
- char **scheme,
- char **username,
- char **password,
- char **authmech,
- char **hostname,
- int *port,
- char **path)
-{
- int len;
-
- g_return_val_if_fail(uri != NULL, FALSE);
-
- len = strlen(uri);
-
- {
- char *pat;
- int n;
- char scheme_buf[len + 1];
- char username_buf[len + 1];
- char password_buf[len + 1];
- char authmech_buf[len + 1];
- char hostpart_buf[len + 1];
- char hostname_buf[len + 1];
- int _port;
- char path_buf[len + 1];
- gboolean has_authmech = FALSE;
- gboolean has_hostpart = FALSE;
- gboolean has_port = FALSE;
- gboolean has_path = FALSE;
-
- /*
- * For backward compatibility with previous versions of Mail
- * Notification, we also support ;auth= (in lowercase).
- */
-
- pat = g_strdup_printf("%%%i[^:]://%%%i[^:]:%%%i[^;];%%*1[aA]%%*1[uU]%%*1[tT]%%*1[hH]=%%%i[^@]@%%%is", len, len, len, len, len);
- n = sscanf(uri, pat, scheme_buf, username_buf, password_buf, authmech_buf, hostpart_buf);
- g_free(pat);
-
- if (n >= 4)
- {
- has_authmech = TRUE;
- has_hostpart = n > 4;
- }
- else
- {
- pat = g_strdup_printf("%%%i[^:]://%%%i[^:]:%%%i[^@]@%%%is", len, len, len, len);
- n = sscanf(uri, pat, scheme_buf, username_buf, password_buf, hostpart_buf);
- g_free(pat);
+static void
+mn_uri_init (MNURI * o G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:URI::init"
+#line 52 "mn-uri.gob"
+ o->text = NULL;
+#line 202 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->vfs = NULL;
+#line 205 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->human_readable = NULL;
+#line 208 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->scheme = NULL;
+#line 211 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->username = NULL;
+#line 214 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->password = NULL;
+#line 217 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->authmech = NULL;
+#line 220 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->hostname = NULL;
+#line 223 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->port = -1;
+#line 226 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->path = NULL;
+#line 229 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->queries = NULL;
+#line 232 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->type = MN_URI_UNKNOWN;
+#line 235 "mn-uri.c"
+#line 52 "mn-uri.gob"
+ o->flags = 0;
+#line 238 "mn-uri.c"
+}
+#undef __GOB_FUNCTION__
+static void
+mn_uri_class_init (MNURIClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:URI::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
- if (n >= 3)
- has_hostpart = n > 3;
- else
- return FALSE;
- }
-
- if (has_hostpart)
- {
- pat = g_strdup_printf("[%%%i[^]]]:%%u/%%%is", len, len);
- n = sscanf(hostpart_buf, pat, hostname_buf, &_port, path_buf);
- g_free(pat);
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
- if (n < 1)
- {
- pat = g_strdup_printf("%%%i[^:]:%%u/%%%is", len, len);
- n = sscanf(hostpart_buf, pat, hostname_buf, &_port, path_buf);
- g_free(pat);
- }
+ g_object_class->dispose = ___dispose;
+ g_object_class->finalize = ___finalize;
+}
+#undef __GOB_FUNCTION__
- if (n >= 2)
- {
- has_port = TRUE;
- has_path = n > 2;
- }
- else
- {
- pat = g_strdup_printf("[%%%i[^]]]/%%%is", len, len);
- n = sscanf(hostpart_buf, pat, hostname_buf, path_buf);
- g_free(pat);
- if (n < 1)
- {
- pat = g_strdup_printf("%%%i[^/]/%%%is", len, len);
- n = sscanf(hostpart_buf, pat, hostname_buf, path_buf);
- g_free(pat);
- }
- if (n < 1)
- return FALSE;
+#line 105 "mn-uri.gob"
+static gboolean
+mn_uri_is_ipv6_address (const char * hostname)
+#line 259 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::is_ipv6_address"
+{
+#line 107 "mn-uri.gob"
+
+ char dummy[16]; /* sizeof(struct in6_addr) */
+
+ g_return_val_if_fail(hostname != NULL, FALSE);
- has_path = n > 1;
- }
+ return inet_pton(AF_INET6, hostname, dummy) == 1;
+ }}
+#line 271 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 115 "mn-uri.gob"
+gboolean
+mn_uri_has_query (MNURI * self, const char * query)
+#line 277 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::has_query"
+#line 115 "mn-uri.gob"
+ g_return_val_if_fail (self != NULL, (gboolean )0);
+#line 115 "mn-uri.gob"
+ g_return_val_if_fail (MN_IS_URI (self), (gboolean )0);
+#line 115 "mn-uri.gob"
+ g_return_val_if_fail (query != NULL, (gboolean )0);
+#line 286 "mn-uri.c"
+{
+#line 117 "mn-uri.gob"
+
+ return self->queries && eel_g_strv_find(self->queries, query) != -1;
+ }}
+#line 292 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 121 "mn-uri.gob"
+const char *
+mn_uri_get_system_mailbox (void)
+#line 298 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::get_system_mailbox"
+{
+#line 123 "mn-uri.gob"
+
+ static char *global_uri = NULL;
+ G_LOCK_DEFINE_STATIC(global_uri);
+ const char *uri;
+
+ G_LOCK(global_uri);
+ if (! global_uri)
+ {
+ const char *mail = g_getenv("MAIL");
+ if (mail)
+ global_uri = gnome_vfs_get_uri_from_local_path(mail);
}
+ uri = global_uri;
+ G_UNLOCK(global_uri);
+
+ return uri;
+ }}
+#line 320 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 141 "mn-uri.gob"
+static const SchemeInfo *
+mn_uri_get_scheme_info (const char * scheme)
+#line 326 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::get_scheme_info"
+{
+#line 143 "mn-uri.gob"
+
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS(our_schemes); i++)
+ if (! strcmp(scheme, our_schemes[i].name))
+ return &our_schemes[i];
+
+ return NULL;
+ }}
+#line 340 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 153 "mn-uri.gob"
+int
+mn_uri_get_default_port (const char * scheme)
+#line 346 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::get_default_port"
+#line 153 "mn-uri.gob"
+ g_return_val_if_fail (scheme != NULL, (int )0);
+#line 351 "mn-uri.c"
+{
+#line 155 "mn-uri.gob"
+
+ const SchemeInfo *scheme_info;
+
+ scheme_info = self_get_scheme_info(scheme);
+ return scheme_info ? scheme_info->default_port : -1;
+ }}
+#line 360 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 162 "mn-uri.gob"
+const char *
+mn_uri_get_default_path (const char * scheme)
+#line 366 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::get_default_path"
+#line 162 "mn-uri.gob"
+ g_return_val_if_fail (scheme != NULL, (const char * )0);
+#line 371 "mn-uri.c"
+{
+#line 164 "mn-uri.gob"
+
+ const SchemeInfo *scheme_info;
+
+ scheme_info = self_get_scheme_info(scheme);
+ return scheme_info ? scheme_info->default_path : NULL;
+ }}
+#line 380 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 171 "mn-uri.gob"
+static void
+mn_uri_parse (MNURI * self)
+#line 386 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::parse"
+#line 171 "mn-uri.gob"
+ g_return_if_fail (self != NULL);
+#line 171 "mn-uri.gob"
+ g_return_if_fail (MN_IS_URI (self));
+#line 393 "mn-uri.c"
+{
+#line 173 "mn-uri.gob"
+
+ int len;
+ int buflen;
- if (scheme)
- *scheme = gnome_vfs_unescape_string(scheme_buf, NULL);
- if (username)
- *username = gnome_vfs_unescape_string(username_buf, NULL);
- if (password)
- *password = gnome_vfs_unescape_string(password_buf, NULL);
- if (authmech)
- *authmech = has_authmech ? gnome_vfs_unescape_string(authmech_buf, NULL) : NULL;
- if (hostname)
- *hostname = has_hostpart ? gnome_vfs_unescape_string(hostname_buf, NULL) : NULL;
- if (port)
- *port = has_port ? _port : -1;
- if (path)
- *path = has_path ? gnome_vfs_unescape_string(path_buf, NULL) : NULL;
-
- return TRUE;
- }
-}
+ if (self->vfs || ! self->text) /* no need to parse, or already parsed */
+ return;
-/**
- * mn_uri_build_pop:
- * @ssl: whether to build a SSL URI or not
- * @username: the username
- * @password: the password
- * @authmech: the authentication mechanism, or NULL
- * @hostname: the hostname
- * @port: the port number, or -1
- *
- * Builds a RFC 1738 pop or pops URI. Does not conform to RFC 2384
- * because it forbids the use of a password.
- *
- * If @port is -1, the default POP3 port number for @ssl will be used.
- *
- * Return value: the new URI.
- **/
-char *
-mn_uri_build_pop (gboolean ssl,
- const char *username,
- const char *password,
- const char *authmech,
- const char *hostname,
- int port)
-{
- g_return_val_if_fail(username != NULL, NULL);
- g_return_val_if_fail(password != NULL, NULL);
- g_return_val_if_fail(hostname != NULL, NULL);
-
- return mn_uri_build_generic(ssl ? "pops" : "pop",
- username,
- password,
- authmech,
- hostname,
- port == MN_URI_POP3_PORT(ssl) ? -1 : port,
- NULL);
-}
+ len = strlen(self->text);
+ buflen = len + 1;
-/**
- * mn_uri_parse_pop:
- * @uri: the URI to parse
- * @ssl: a location to store the SSL status, or NULL
- * @username: a location to store the username, or NULL
- * @password: a location to store the password, or NULL
- * @authmech: a location to store the authentication mechanism, or NULL
- * @hostname: a location to store the hostname, or NULL
- * @port: a location to store the port number, or NULL
- *
- * Parses a RFC 1738 pop or pops URI.
- *
- * WARNING: the parsing is very lax, this function is NOT intended to
- * be used on untrusted URIs.
- *
- * Return value: TRUE if @uri is a valid pop or pops URI, FALSE otherwise.
- **/
-gboolean
-mn_uri_parse_pop (const char *uri,
- gboolean *ssl,
- char **username,
- char **password,
- char **authmech,
- char **hostname,
- int *port)
-{
- char *scheme;
- char *_username;
- char *_password;
- char *_authmech;
- char *_hostname;
- int _port;
- gboolean is_pop = FALSE;
-
- g_return_val_if_fail(uri != NULL, FALSE);
-
- if (mn_uri_parse_generic(uri,
- &scheme,
- &_username,
- &_password,
- &_authmech,
- &_hostname,
- &_port,
- NULL))
{
- gboolean _ssl;
-
- if (_hostname)
+ char *pat;
+ char scheme_buf[buflen];
+ char auth_buf[buflen];
+ char location_buf[buflen];
+ char username_buf[buflen];
+ char password_buf[buflen];
+ char authmech_buf[buflen];
+ char hostname_buf[buflen];
+ int _port;
+ char path_buf[buflen];
+ char queries_buf[buflen];
+ gboolean has_location = FALSE;
+ gboolean has_authmech = FALSE;
+ gboolean has_port = FALSE;
+ gboolean has_path = FALSE;
+ gboolean has_queries = FALSE;
+ int n;
+
+ /* split URI in 3 parts: scheme, auth and location */
+
+ pat = g_strdup_printf("%%%i[^:]://%%%i[^@]@%%%is", len, len, len);
+ n = sscanf(self->text, pat, scheme_buf, auth_buf, location_buf);
+ g_free(pat);
+
+ if (n >= 2)
{
- if (! strcmp(scheme, "pop"))
- {
- is_pop = TRUE;
- _ssl = FALSE;
- }
- else if (! strcmp(scheme, "pops"))
- {
- is_pop = TRUE;
- _ssl = TRUE;
- }
+ if (n == 3)
+ has_location = TRUE;
}
+ else
+ return; /* unparsable */
+
+ /* split auth part in 3 subparts: username, password and authmech */
+
+ /*
+ * For backward compatibility with previous versions of Mail
+ * Notification, we also support ;auth= (in lowercase).
+ */
+ pat = g_strdup_printf("%%%i[^:]:%%%i[^;];%%*1[aA]%%*1[uU]%%*1[tT]%%*1[hH]=%%%is", len, len, len);
+ n = sscanf(auth_buf, pat, username_buf, password_buf, authmech_buf);
+ g_free(pat);
- if (is_pop)
+ if (n >= 2)
{
- if (ssl)
- *ssl = _ssl;
- if (username)
- *username = g_strdup(_username);
- if (password)
- *password = g_strdup(_password);
- if (authmech)
- *authmech = g_strdup(_authmech);
- if (hostname)
- *hostname = g_strdup(_hostname);
- if (port)
- *port = _port >= 0 ? _port : MN_URI_POP3_PORT(_ssl);
+ if (n == 3)
+ has_authmech = TRUE;
}
+ else
+ return; /* unparsable */
- g_free(scheme);
- g_free(_username);
- g_free(_password);
- g_free(_authmech);
- g_free(_hostname);
- }
-
- return is_pop;
-}
+ if (has_location)
+ {
+ char hostport_buf[buflen];
-/**
- * mn_uri_build_imap:
- * @ssl: whether to build a SSL URI or not
- * @username: the username
- * @password: the password
- * @authmech: the authentication mechanism, or NULL
- * @hostname: the hostname
- * @port: the port number, or -1
- * @mailbox: the mailbox name, or NULL
- *
- * Builds a RFC 1738 imap or imaps URI. Does not conform to RFC 2192
- * because it forbids the use of a password.
- *
- * If @port is -1, the default IMAP4 port number for @ssl will be used.
- *
- * If @mailbox is not specified, INBOX will be used.
- *
- * Return value: the new URI.
- **/
-char *
-mn_uri_build_imap (gboolean ssl,
- const char *username,
- const char *password,
- const char *authmech,
- const char *hostname,
- int port,
- const char *mailbox)
-{
- g_return_val_if_fail(username != NULL, NULL);
- g_return_val_if_fail(password != NULL, NULL);
- g_return_val_if_fail(hostname != NULL, NULL);
- g_return_val_if_fail(mailbox != NULL, NULL);
-
- return mn_uri_build_generic(ssl ? "imaps" : "imap",
- username,
- password,
- authmech,
- hostname,
- port == MN_URI_IMAP_PORT(ssl) ? -1 : port,
- ! strcmp(mailbox, "INBOX") ? NULL : mailbox);
-}
+ /* split location part in 3 subparts: hostport, path and queries */
-/**
- * mn_uri_parse_imap:
- * @uri: the URI to parse
- * @ssl: a location to store the SSL status, or NULL
- * @username: a location to store the username, or NULL
- * @password: a location to store the password, or NULL
- * @authmech: a location to store the authentication mechanism, or NULL
- * @hostname: a location to store the hostname, or NULL
- * @port: a location to store the port number, or NULL
- * @mailbox: a location to store the mailbox, or NULL
- *
- * Parses a RFC 1738 imap or imaps URI.
- *
- * WARNING: the parsing is very lax, this function is NOT intended to
- * be used on untrusted URIs.
- *
- * Return value: TRUE if @uri is a valid imap or imaps URI, FALSE otherwise.
- **/
-gboolean
-mn_uri_parse_imap (const char *uri,
- gboolean *ssl,
- char **username,
- char **password,
- char **authmech,
- char **hostname,
- int *port,
- char **mailbox)
-{
- char *scheme;
- char *_username;
- char *_password;
- char *_authmech;
- char *_hostname;
- int _port;
- char *_mailbox;
- gboolean is_imap = FALSE;
-
- g_return_val_if_fail(uri != NULL, FALSE);
-
- if (mn_uri_parse_generic(uri,
- &scheme,
- &_username,
- &_password,
- &_authmech,
- &_hostname,
- &_port,
- &_mailbox))
- {
- gboolean _ssl;
+ pat = g_strdup_printf("%%%i[^/]/%%%i[^?]?%%%is", len, len, len);
+ n = sscanf(location_buf, pat, hostport_buf, path_buf, queries_buf);
+ g_free(pat);
- if (_hostname)
- {
- if (! strcmp(scheme, "imap"))
+ if (n >= 2)
{
- is_imap = TRUE;
- _ssl = FALSE;
+ has_path = TRUE;
+ if (n == 3)
+ has_queries = TRUE;
}
- else if (! strcmp(scheme, "imaps"))
+ else
{
- is_imap = TRUE;
- _ssl = TRUE;
- }
- }
+ pat = g_strdup_printf("%%%i[^?]?%%%is", len, len);
+ n = sscanf(location_buf, pat, hostport_buf, queries_buf);
+ g_free(pat);
- if (is_imap)
- {
- if (ssl)
- *ssl = _ssl;
- if (username)
- *username = g_strdup(_username);
- if (password)
- *password = g_strdup(_password);
- if (authmech)
- *authmech = g_strdup(_authmech);
- if (hostname)
- *hostname = g_strdup(_hostname);
- if (port)
- *port = _port >= 0 ? _port : MN_URI_IMAP_PORT(_ssl);
- if (mailbox)
- *mailbox = g_strdup(_mailbox ? _mailbox : "INBOX");
- }
+ if (n == 2)
+ has_queries = TRUE;
+ }
- g_free(scheme);
- g_free(_username);
- g_free(_password);
- g_free(_authmech);
- g_free(_hostname);
- g_free(_mailbox);
- }
+ /* split hostport in 2 subparts: host and port */
- return is_imap;
-}
+ pat = g_strdup_printf("[%%%i[^]]]:%%u", len);
+ n = sscanf(hostport_buf, pat, hostname_buf, &_port);
+ g_free(pat);
+
+ if (n < 1)
+ {
+ pat = g_strdup_printf("%%%i[^:]:%%u", len);
+ n = sscanf(hostport_buf, pat, hostname_buf, &_port);
+ g_free(pat);
+ }
+
+ if (n == 2)
+ has_port = TRUE;
+ }
-/**
- * mn_uri_build_gmail:
- * @username: the username
- * @password: the password
- *
- * Builds a Gmail URI (gmail://username:password).
- *
- * Return value: the new URI.
- **/
-char *
-mn_uri_build_gmail (const char *username, const char *password)
-{
- g_return_val_if_fail(username != NULL, NULL);
- g_return_val_if_fail(password != NULL, NULL);
-
- return mn_uri_build_generic("gmail",
- username,
- password,
- NULL,
- NULL,
- -1,
- NULL);
-}
+ self->scheme = gnome_vfs_unescape_string(scheme_buf, NULL);
+ self->username = gnome_vfs_unescape_string(username_buf, NULL);
+ self->password = gnome_vfs_unescape_string(password_buf, NULL);
+ if (has_authmech)
+ self->authmech = gnome_vfs_unescape_string(authmech_buf, NULL);
+ if (has_location)
+ self->hostname = gnome_vfs_unescape_string(hostname_buf, NULL);
+ self->port = has_port ? _port : self_get_default_port(self->scheme);
+ self->path = has_path ? gnome_vfs_unescape_string(path_buf, NULL) : g_strdup(self_get_default_path(self->scheme));
+ if (has_queries)
+ {
+ int i;
+
+ self->queries = g_strsplit(queries_buf, "&", 0);
+ for (i = 0; self->queries[i]; i++)
+ {
+ char *unescaped;
-/**
- * mn_uri_parse_gmail:
- * @uri: the URI to parse
- * @username: a location to store the username, or NULL
- * @password: a location to store the password, or NULL
- *
- * Parses a Gmail URI (gmail://username:password).
- *
- * WARNING: the parsing is very lax, this function is NOT intended to
- * be used on untrusted URIs.
- *
- * Return value: TRUE if @uri is a valid Gmail URI, FALSE otherwise.
- **/
-gboolean
-mn_uri_parse_gmail (const char *uri, char **username, char **password)
-{
- char *scheme;
- char *_username;
- char *_password;
- gboolean is_gmail = FALSE;
-
- g_return_val_if_fail(uri != NULL, FALSE);
-
- if (mn_uri_parse_generic(uri,
- &scheme,
- &_username,
- &_password,
- NULL,
- NULL,
- NULL,
- NULL))
- {
- is_gmail = ! strcmp(scheme, "gmail") && _password;
+ unescaped = gnome_vfs_unescape_string(self->queries[i], NULL);
- if (is_gmail)
- {
- if (username)
- *username = g_strdup(_username);
- if (password)
- *password = g_strdup(_password);
+ g_free(self->queries[i]);
+ self->queries[i] = unescaped;
+ }
}
-
- g_free(scheme);
- g_free(_username);
- g_free(_password);
}
-
- return is_gmail;
-}
-
-char *
-mn_uri_canonicalize (const char *uri)
-{
- char *canonical_uri;
- gboolean ssl;
- char *username = NULL;
- char *password = NULL;
- char *authmech = NULL;
- char *hostname = NULL;
- int port;
- char *mailbox = NULL;
-
- g_return_val_if_fail(uri != NULL, NULL);
-
- if (mn_uri_parse_pop(uri, &ssl, &username, &password, &authmech, &hostname, &port))
- canonical_uri = mn_uri_build_pop(ssl, username, password, authmech, hostname, port);
- else if (mn_uri_parse_imap(uri, &ssl, &username, &password, &authmech, &hostname, &port, &mailbox))
- canonical_uri = mn_uri_build_imap(ssl, username, password, authmech, hostname, port, mailbox);
- else if (mn_uri_parse_gmail(uri, &username, &password))
- canonical_uri = mn_uri_build_gmail(username, password);
- else
- canonical_uri = gnome_vfs_make_uri_canonical(uri);
-
- g_free(username);
- g_free(password);
- g_free(authmech);
- g_free(hostname);
- g_free(mailbox);
-
- return canonical_uri;
-}
-
-int
-mn_uri_cmp (const char *uri1, const char *uri2)
+ }}
+#line 526 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 304 "mn-uri.gob"
+static void
+mn_uri_build (MNURI * self)
+#line 532 "mn-uri.c"
{
- char *canonicalized1;
- char *canonicalized2;
- int cmp;
-
- g_return_val_if_fail(uri1 != NULL, 0);
- g_return_val_if_fail(uri2 != NULL, 0);
-
- canonicalized1 = mn_uri_canonicalize(uri1);
- canonicalized2 = mn_uri_canonicalize(uri2);
-
- cmp = strcmp(canonicalized1, canonicalized2);
-
- g_free(canonicalized1);
- g_free(canonicalized2);
+#define __GOB_FUNCTION__ "MN:URI::build"
+#line 304 "mn-uri.gob"
+ g_return_if_fail (self != NULL);
+#line 304 "mn-uri.gob"
+ g_return_if_fail (MN_IS_URI (self));
+#line 539 "mn-uri.c"
+{
+#line 306 "mn-uri.gob"
+
+ char *canonical = NULL;
- return cmp;
-}
+ if (self->vfs)
+ {
+ g_return_if_fail(self->text != NULL);
+ canonical = gnome_vfs_make_uri_canonical(self->text);
+ }
+ else if (self->scheme)
+ {
+ GString *string;
+ char *escaped;
+ int i;
+
+ g_return_if_fail(self->username != NULL);
+ g_return_if_fail(self->password != NULL);
+
+ escaped = gnome_vfs_escape_string(self->scheme);
+ string = g_string_new(escaped);
+ g_free(escaped);
+
+ escaped = gnome_vfs_escape_string(self->username);
+ g_string_append_printf(string, "://%s", escaped);
+ g_free(escaped);
+
+ escaped = gnome_vfs_escape_string(self->password);
+ g_string_append_printf(string, ":%s", escaped);
+ g_free(escaped);
+
+ if (self->authmech)
+ {
+ escaped = gnome_vfs_escape_string(self->authmech);
+ g_string_append_printf(string, ";AUTH=%s", escaped);
+ g_free(escaped);
+ }
-char *
-mn_uri_format_for_display (const char *uri)
-{
- const char *system_uri;
- char *name = NULL;
+ if (self->hostname)
+ {
+ escaped = gnome_vfs_escape_host_and_path_string(self->hostname);
+ g_string_append_printf(string, self_is_ipv6_address(self->hostname) ? "@[%s]" : "@%s", escaped);
+ g_free(escaped);
+ }
- g_return_val_if_fail(uri != NULL, NULL);
+ if (self->port >= 0 && self->port != self_get_default_port(self->scheme))
+ g_string_append_printf(string, ":%i", self->port);
- system_uri = mn_uri_get_system_mailbox();
- if (system_uri && ! mn_uri_cmp(uri, system_uri))
- name = g_strdup(_("System Mailbox"));
+ if (self->path)
+ {
+ const char *default_path;
- if (! name)
- {
- char *path;
-
- path = gnome_vfs_get_local_path_from_uri(uri);
- if (path)
- {
- name = g_filename_to_utf8(path, -1, NULL, NULL, NULL);
- g_free(path);
- }
- }
- if (! name)
- {
- GnomeVFSURI *vfs_uri;
-
- vfs_uri = gnome_vfs_uri_new(uri);
- if (vfs_uri)
- {
- name = gnome_vfs_uri_to_string(vfs_uri, GNOME_VFS_URI_HIDE_PASSWORD);
- gnome_vfs_uri_unref(vfs_uri);
- }
- }
- if (! name)
- {
- char *username;
- char *hostname;
+ default_path = self_get_default_path(self->scheme);
+ if (! default_path || strcmp(self->path, default_path))
+ {
+ escaped = gnome_vfs_escape_path_string(self->path);
+ g_string_append_printf(string, "/%s", escaped);
+ g_free(escaped);
+ }
+ }
- if (mn_uri_parse_pop(uri, NULL, &username, NULL, NULL, &hostname, NULL))
- {
- name = g_strdup_printf("%s@%s", username, hostname);
- g_free(username);
- g_free(hostname);
- }
- }
- if (! name)
- {
- char *username;
- char *hostname;
- char *mailbox;
+ if (self->queries)
+ for (i = 0; self->queries[i]; i++)
+ {
+ g_string_append_c(string, i == 0 ? '?' : '&');
- if (mn_uri_parse_imap(uri, NULL, &username, NULL, NULL, &hostname, NULL, &mailbox))
- {
- name = ! strcmp(mailbox, "INBOX")
- ? g_strdup_printf("%s@%s", username, hostname)
- : g_strdup_printf("%s@%s/%s", username, hostname, mailbox);
- g_free(username);
- g_free(hostname);
- g_free(mailbox);
- }
- }
- if (! name)
- {
- char *username;
+ escaped = gnome_vfs_escape_string(self->queries[i]);
+ g_string_append(string, escaped);
+ g_free(escaped);
+ }
- if (mn_uri_parse_gmail(uri, &username, NULL))
- {
- name = g_strdup_printf("%s@gmail.com", username);
- g_free(username);
- }
- }
- if (! name)
- name = g_strdup(uri); /* fallback to the URI */
-
- return name;
-}
+ canonical = g_string_free(string, FALSE);
+ }
-gboolean
-mn_uri_is_local (const char *uri)
+ if (canonical)
+ {
+ g_free(self->text);
+ self->text = canonical;
+ }
+ }}
+#line 620 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 385 "mn-uri.gob"
+static void
+mn_uri_set_human_readable (MNURI * self)
+#line 626 "mn-uri.c"
{
- GnomeVFSURI *vfs_uri;
- gboolean is_local = FALSE;
+#define __GOB_FUNCTION__ "MN:URI::set_human_readable"
+#line 385 "mn-uri.gob"
+ g_return_if_fail (self != NULL);
+#line 385 "mn-uri.gob"
+ g_return_if_fail (MN_IS_URI (self));
+#line 633 "mn-uri.c"
+{
+#line 387 "mn-uri.gob"
+
+ g_return_if_fail(self->human_readable == NULL);
- g_return_val_if_fail(uri != NULL, NULL);
+ if (MN_URI_IS_SYSTEM_MAILBOX(self))
+ self->human_readable = g_strdup(_("System Mailbox"));
+ else if (self->vfs)
+ {
+ char *path;
+
+ path = gnome_vfs_get_local_path_from_uri(self->text);
+ if (path)
+ {
+ self->human_readable = g_filename_to_utf8(path, -1, NULL, NULL, NULL);
+ g_free(path);
+ }
+ else
+ self->human_readable = gnome_vfs_uri_to_string(self->vfs, GNOME_VFS_URI_HIDE_PASSWORD);
+ }
+ else if (MN_URI_IS_POP(self) || MN_URI_IS_IMAP(self))
+ self->human_readable = g_strdup_printf("%s@%s", self->username, self->hostname);
+ else if (MN_URI_IS_GMAIL(self))
+ self->human_readable = g_strdup_printf("%s@gmail.com", self->username);
+ else
+ self->human_readable = g_strdup(self->text);
+ }}
+#line 661 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 413 "mn-uri.gob"
+static void
+mn_uri_post_init (MNURI * self)
+#line 667 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::post_init"
+#line 413 "mn-uri.gob"
+ g_return_if_fail (self != NULL);
+#line 413 "mn-uri.gob"
+ g_return_if_fail (MN_IS_URI (self));
+#line 674 "mn-uri.c"
+{
+#line 415 "mn-uri.gob"
+
+ const char *system_uri;
+
+ self_parse(self);
+ self_build(self);
+
+ if (self->vfs)
+ {
+ self->type = MN_URI_VFS;
+ if (gnome_vfs_uri_is_local(self->vfs))
+ self->flags |= MN_URI_LOCAL;
+ }
+ else if (self->scheme)
+ {
+ const SchemeInfo *scheme_info;
- vfs_uri = gnome_vfs_uri_new(uri);
- if (vfs_uri)
- {
- is_local = gnome_vfs_uri_is_local(vfs_uri);
- gnome_vfs_uri_unref(vfs_uri);
- }
+ scheme_info = self_get_scheme_info(self->scheme);
+ if (scheme_info)
+ {
+ self->type = scheme_info->type;
+ self->flags |= scheme_info->flags;
+ }
- return is_local;
-}
+ if ((MN_URI_IS_POP(self) && self_has_query(self, "STLS"))
+ || (MN_URI_IS_IMAP(self) && self_has_query(self, "STARTTLS")))
+ self->flags |= MN_URI_INBAND_SSL;
+ }
-const char *
-mn_uri_get_system_mailbox (void)
-{
- static char *global_uri = NULL;
- G_LOCK_DEFINE_STATIC(global_uri);
- const char *uri;
+ system_uri = self_get_system_mailbox();
+ if (system_uri && ! strcmp(system_uri, self->text))
+ self->flags |= MN_URI_SYSTEM_MAILBOX;
- G_LOCK(global_uri);
- if (! global_uri)
- {
- const char *mail = g_getenv("MAIL");
- if (mail)
- global_uri = gnome_vfs_get_uri_from_local_path(mail);
- }
- uri = global_uri;
- G_UNLOCK(global_uri);
+ self_set_human_readable(self);
+ }}
+#line 711 "mn-uri.c"
+#undef __GOB_FUNCTION__
- return uri;
-}
+#line 450 "mn-uri.gob"
+MNURI *
+mn_uri_new (const char * text_uri)
+#line 717 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::new"
+#line 450 "mn-uri.gob"
+ g_return_val_if_fail (text_uri != NULL, (MNURI * )0);
+#line 722 "mn-uri.c"
+{
+#line 452 "mn-uri.gob"
+
+ Self *self;
+ char *scheme;
+
+ self = GET_NEW;
+ self->text = ! strncmp(text_uri, "pop3:", 5) /* also handle obsolete pop3 locators */
+ ? g_strconcat("pop://", text_uri + 5, NULL)
+ : g_strdup(text_uri);
+
+ /* only use GnomeVFS if we can't handle it ourselves */
+ scheme = gnome_vfs_get_uri_scheme(self->text);
+ if (! scheme || ! self_get_scheme_info(scheme))
+ self->vfs = gnome_vfs_uri_new(self->text);
+ g_free(scheme);
+
+ self_post_init(self);
+ return self;
+ }}
+#line 743 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 471 "mn-uri.gob"
+MNURI *
+mn_uri_new_pop (gboolean ssl, gboolean stls, const char * username, const char * password, const char * authmech, const char * hostname, int port)
+#line 749 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::new_pop"
+#line 471 "mn-uri.gob"
+ g_return_val_if_fail (username != NULL, (MNURI * )0);
+#line 471 "mn-uri.gob"
+ g_return_val_if_fail (password != NULL, (MNURI * )0);
+#line 471 "mn-uri.gob"
+ g_return_val_if_fail (hostname != NULL, (MNURI * )0);
+#line 758 "mn-uri.c"
+{
+#line 479 "mn-uri.gob"
+
+ Self *self;
+
+ self = GET_NEW;
+
+ self->scheme = g_strdup(ssl ? "pops" : "pop");
+ self->username = g_strdup(username);
+ self->password = g_strdup(password);
+ self->authmech = g_strdup(authmech);
+ self->hostname = g_strdup(hostname);
+ self->port = port;
+ if (stls)
+ self->queries = g_strsplit("STLS", " ", 0);
+
+ self_post_init(self);
+ return self;
+ }}
+#line 778 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 497 "mn-uri.gob"
+MNURI *
+mn_uri_new_imap (gboolean ssl, gboolean starttls, const char * username, const char * password, const char * authmech, const char * hostname, int port, const char * mailbox)
+#line 784 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::new_imap"
+#line 497 "mn-uri.gob"
+ g_return_val_if_fail (username != NULL, (MNURI * )0);
+#line 497 "mn-uri.gob"
+ g_return_val_if_fail (password != NULL, (MNURI * )0);
+#line 497 "mn-uri.gob"
+ g_return_val_if_fail (hostname != NULL, (MNURI * )0);
+#line 497 "mn-uri.gob"
+ g_return_val_if_fail (mailbox != NULL, (MNURI * )0);
+#line 795 "mn-uri.c"
+{
+#line 506 "mn-uri.gob"
+
+ Self *self;
+
+ self = GET_NEW;
+
+ self->scheme = g_strdup(ssl ? "imaps" : "imap");
+ self->username = g_strdup(username);
+ self->password = g_strdup(password);
+ self->authmech = g_strdup(authmech);
+ self->hostname = g_strdup(hostname);
+ self->port = port;
+ self->path = g_strdup(mailbox);
+ if (starttls)
+ self->queries = g_strsplit("STARTTLS", " ", 0);
+
+ self_post_init(self);
+ return self;
+ }}
+#line 816 "mn-uri.c"
+#undef __GOB_FUNCTION__
+
+#line 525 "mn-uri.gob"
+MNURI *
+mn_uri_new_gmail (const char * username, const char * password)
+#line 822 "mn-uri.c"
+{
+#define __GOB_FUNCTION__ "MN:URI::new_gmail"
+#line 525 "mn-uri.gob"
+ g_return_val_if_fail (username != NULL, (MNURI * )0);
+#line 525 "mn-uri.gob"
+ g_return_val_if_fail (password != NULL, (MNURI * )0);
+#line 829 "mn-uri.c"
+{
+#line 528 "mn-uri.gob"
+
+ Self *self;
+
+ self = GET_NEW;
+
+ self->scheme = g_strdup("gmail");
+ self->username = g_strdup(username);
+ self->password = g_strdup(password);
+
+ self_post_init(self);
+ return self;
+ }}
+#line 844 "mn-uri.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-uri.gob b/src/mn-uri.gob
@@ -0,0 +1,540 @@
+/*
+ * Copyright (c) 2004 Jean-Yves Lefort <jylefort@brutele.be>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+%headertop{
+#include <libgnomevfs/gnome-vfs.h>
+%}
+
+%h{
+ typedef enum
+ {
+ MN_URI_VFS,
+ MN_URI_POP,
+ MN_URI_IMAP,
+ MN_URI_GMAIL,
+ MN_URI_UNKNOWN
+ } MNURIType;
+
+ typedef enum
+ {
+ MN_URI_LOCAL = 1 << 0,
+ MN_URI_SYSTEM_MAILBOX = 1 << 1,
+ MN_URI_SSL = 1 << 2,
+ MN_URI_INBAND_SSL = 1 << 3
+ } MNURIFlags;
+
+#define MN_URI_IS_VFS(uri) ((uri)->type == MN_URI_VFS)
+#define MN_URI_IS_POP(uri) ((uri)->type == MN_URI_POP)
+#define MN_URI_IS_IMAP(uri) ((uri)->type == MN_URI_IMAP)
+#define MN_URI_IS_GMAIL(uri) ((uri)->type == MN_URI_GMAIL)
+
+#define MN_URI_IS_LOCAL(uri) (((uri)->flags & MN_URI_LOCAL) != 0)
+#define MN_URI_IS_SYSTEM_MAILBOX(uri) (((uri)->flags & MN_URI_SYSTEM_MAILBOX) != 0)
+#define MN_URI_IS_SSL(uri) (((uri)->flags & MN_URI_SSL) != 0)
+#define MN_URI_IS_INBAND_SSL(uri) (((uri)->flags & MN_URI_INBAND_SSL) != 0)
+%}
+
+%{
+#include "config.h"
+#include <stdio.h> /* required by stdlib.h on Darwin */
+#include <stdlib.h> /* required by sys/socket.h on Darwin */
+#include <stdarg.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <glib/gi18n-lib.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
+#include <eel/eel.h>
+#include "mn-util.h"
+
+ typedef struct
+ {
+ const char *name;
+
+ MNURIType type;
+ MNURIFlags flags;
+
+ int default_port;
+ const char *default_path;
+ } SchemeInfo;
+
+ static const SchemeInfo our_schemes[] = {
+ { "pop", MN_URI_POP, 0, 110, NULL },
+ { "pops", MN_URI_POP, MN_URI_SSL, 995, NULL },
+ { "imap", MN_URI_IMAP, 0, 143, "INBOX" },
+ { "imaps", MN_URI_IMAP, MN_URI_SSL, 993, "INBOX" },
+ { "gmail", MN_URI_GMAIL, 0, -1, NULL }
+ };
+%}
+
+class MN:URI from G:Object
+{
+ public char *text = NULL destroywith g_free; /* always defined */
+ public GnomeVFSURI *vfs = NULL unrefwith gnome_vfs_uri_unref;
+ public char *human_readable = NULL destroywith g_free; /* always defined */
+
+ public char *scheme = NULL destroywith g_free;
+ public char *username = NULL destroywith g_free; /* if scheme is defined, always defined */
+ public char *password = NULL destroywith g_free; /* if scheme is defined, always defined */
+ public char *authmech = NULL destroywith g_free;
+ public char *hostname = NULL destroywith g_free;
+ public int port = -1;
+ public char *path = NULL destroywith g_free;
+ public char **queries = NULL destroywith g_strfreev;
+
+ public MNURIType type = MN_URI_UNKNOWN;
+ public MNURIFlags flags = 0;
+
+ private gboolean
+ is_ipv6_address (const char *hostname)
+ {
+ char dummy[16]; /* sizeof(struct in6_addr) */
+
+ g_return_val_if_fail(hostname != NULL, FALSE);
+
+ return inet_pton(AF_INET6, hostname, dummy) == 1;
+ }
+
+ public gboolean
+ has_query (self, const char *query (check null))
+ {
+ return self->queries && eel_g_strv_find(self->queries, query) != -1;
+ }
+
+ public const char *
+ get_system_mailbox (void)
+ {
+ static char *global_uri = NULL;
+ G_LOCK_DEFINE_STATIC(global_uri);
+ const char *uri;
+
+ G_LOCK(global_uri);
+ if (! global_uri)
+ {
+ const char *mail = g_getenv("MAIL");
+ if (mail)
+ global_uri = gnome_vfs_get_uri_from_local_path(mail);
+ }
+ uri = global_uri;
+ G_UNLOCK(global_uri);
+
+ return uri;
+ }
+
+ private const SchemeInfo *
+ get_scheme_info (const char *scheme)
+ {
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS(our_schemes); i++)
+ if (! strcmp(scheme, our_schemes[i].name))
+ return &our_schemes[i];
+
+ return NULL;
+ }
+
+ public int
+ get_default_port (const char *scheme (check null))
+ {
+ const SchemeInfo *scheme_info;
+
+ scheme_info = self_get_scheme_info(scheme);
+ return scheme_info ? scheme_info->default_port : -1;
+ }
+
+ public const char *
+ get_default_path (const char *scheme (check null))
+ {
+ const SchemeInfo *scheme_info;
+
+ scheme_info = self_get_scheme_info(scheme);
+ return scheme_info ? scheme_info->default_path : NULL;
+ }
+
+ private void
+ parse (self)
+ {
+ int len;
+ int buflen;
+
+ if (self->vfs || ! self->text) /* no need to parse, or already parsed */
+ return;
+
+ len = strlen(self->text);
+ buflen = len + 1;
+
+ {
+ char *pat;
+ char scheme_buf[buflen];
+ char auth_buf[buflen];
+ char location_buf[buflen];
+ char username_buf[buflen];
+ char password_buf[buflen];
+ char authmech_buf[buflen];
+ char hostname_buf[buflen];
+ int _port;
+ char path_buf[buflen];
+ char queries_buf[buflen];
+ gboolean has_location = FALSE;
+ gboolean has_authmech = FALSE;
+ gboolean has_port = FALSE;
+ gboolean has_path = FALSE;
+ gboolean has_queries = FALSE;
+ int n;
+
+ /* split URI in 3 parts: scheme, auth and location */
+
+ pat = g_strdup_printf("%%%i[^:]://%%%i[^@]@%%%is", len, len, len);
+ n = sscanf(self->text, pat, scheme_buf, auth_buf, location_buf);
+ g_free(pat);
+
+ if (n >= 2)
+ {
+ if (n == 3)
+ has_location = TRUE;
+ }
+ else
+ return; /* unparsable */
+
+ /* split auth part in 3 subparts: username, password and authmech */
+
+ /*
+ * For backward compatibility with previous versions of Mail
+ * Notification, we also support ;auth= (in lowercase).
+ */
+ pat = g_strdup_printf("%%%i[^:]:%%%i[^;];%%*1[aA]%%*1[uU]%%*1[tT]%%*1[hH]=%%%is", len, len, len);
+ n = sscanf(auth_buf, pat, username_buf, password_buf, authmech_buf);
+ g_free(pat);
+
+ if (n >= 2)
+ {
+ if (n == 3)
+ has_authmech = TRUE;
+ }
+ else
+ return; /* unparsable */
+
+ if (has_location)
+ {
+ char hostport_buf[buflen];
+
+ /* split location part in 3 subparts: hostport, path and queries */
+
+ pat = g_strdup_printf("%%%i[^/]/%%%i[^?]?%%%is", len, len, len);
+ n = sscanf(location_buf, pat, hostport_buf, path_buf, queries_buf);
+ g_free(pat);
+
+ if (n >= 2)
+ {
+ has_path = TRUE;
+ if (n == 3)
+ has_queries = TRUE;
+ }
+ else
+ {
+ pat = g_strdup_printf("%%%i[^?]?%%%is", len, len);
+ n = sscanf(location_buf, pat, hostport_buf, queries_buf);
+ g_free(pat);
+
+ if (n == 2)
+ has_queries = TRUE;
+ }
+
+ /* split hostport in 2 subparts: host and port */
+
+ pat = g_strdup_printf("[%%%i[^]]]:%%u", len);
+ n = sscanf(hostport_buf, pat, hostname_buf, &_port);
+ g_free(pat);
+
+ if (n < 1)
+ {
+ pat = g_strdup_printf("%%%i[^:]:%%u", len);
+ n = sscanf(hostport_buf, pat, hostname_buf, &_port);
+ g_free(pat);
+ }
+
+ if (n == 2)
+ has_port = TRUE;
+ }
+
+ self->scheme = gnome_vfs_unescape_string(scheme_buf, NULL);
+ self->username = gnome_vfs_unescape_string(username_buf, NULL);
+ self->password = gnome_vfs_unescape_string(password_buf, NULL);
+ if (has_authmech)
+ self->authmech = gnome_vfs_unescape_string(authmech_buf, NULL);
+ if (has_location)
+ self->hostname = gnome_vfs_unescape_string(hostname_buf, NULL);
+ self->port = has_port ? _port : self_get_default_port(self->scheme);
+ self->path = has_path ? gnome_vfs_unescape_string(path_buf, NULL) : g_strdup(self_get_default_path(self->scheme));
+ if (has_queries)
+ {
+ int i;
+
+ self->queries = g_strsplit(queries_buf, "&", 0);
+ for (i = 0; self->queries[i]; i++)
+ {
+ char *unescaped;
+
+ unescaped = gnome_vfs_unescape_string(self->queries[i], NULL);
+
+ g_free(self->queries[i]);
+ self->queries[i] = unescaped;
+ }
+ }
+ }
+ }
+
+ private void
+ build (self)
+ {
+ char *canonical = NULL;
+
+ if (self->vfs)
+ {
+ g_return_if_fail(self->text != NULL);
+ canonical = gnome_vfs_make_uri_canonical(self->text);
+ }
+ else if (self->scheme)
+ {
+ GString *string;
+ char *escaped;
+ int i;
+
+ g_return_if_fail(self->username != NULL);
+ g_return_if_fail(self->password != NULL);
+
+ escaped = gnome_vfs_escape_string(self->scheme);
+ string = g_string_new(escaped);
+ g_free(escaped);
+
+ escaped = gnome_vfs_escape_string(self->username);
+ g_string_append_printf(string, "://%s", escaped);
+ g_free(escaped);
+
+ escaped = gnome_vfs_escape_string(self->password);
+ g_string_append_printf(string, ":%s", escaped);
+ g_free(escaped);
+
+ if (self->authmech)
+ {
+ escaped = gnome_vfs_escape_string(self->authmech);
+ g_string_append_printf(string, ";AUTH=%s", escaped);
+ g_free(escaped);
+ }
+
+ if (self->hostname)
+ {
+ escaped = gnome_vfs_escape_host_and_path_string(self->hostname);
+ g_string_append_printf(string, self_is_ipv6_address(self->hostname) ? "@[%s]" : "@%s", escaped);
+ g_free(escaped);
+ }
+
+ if (self->port >= 0 && self->port != self_get_default_port(self->scheme))
+ g_string_append_printf(string, ":%i", self->port);
+
+ if (self->path)
+ {
+ const char *default_path;
+
+ default_path = self_get_default_path(self->scheme);
+ if (! default_path || strcmp(self->path, default_path))
+ {
+ escaped = gnome_vfs_escape_path_string(self->path);
+ g_string_append_printf(string, "/%s", escaped);
+ g_free(escaped);
+ }
+ }
+
+ if (self->queries)
+ for (i = 0; self->queries[i]; i++)
+ {
+ g_string_append_c(string, i == 0 ? '?' : '&');
+
+ escaped = gnome_vfs_escape_string(self->queries[i]);
+ g_string_append(string, escaped);
+ g_free(escaped);
+ }
+
+ canonical = g_string_free(string, FALSE);
+ }
+
+ if (canonical)
+ {
+ g_free(self->text);
+ self->text = canonical;
+ }
+ }
+
+ private void
+ set_human_readable (self)
+ {
+ g_return_if_fail(self->human_readable == NULL);
+
+ if (MN_URI_IS_SYSTEM_MAILBOX(self))
+ self->human_readable = g_strdup(_("System Mailbox"));
+ else if (self->vfs)
+ {
+ char *path;
+
+ path = gnome_vfs_get_local_path_from_uri(self->text);
+ if (path)
+ {
+ self->human_readable = g_filename_to_utf8(path, -1, NULL, NULL, NULL);
+ g_free(path);
+ }
+ else
+ self->human_readable = gnome_vfs_uri_to_string(self->vfs, GNOME_VFS_URI_HIDE_PASSWORD);
+ }
+ else if (MN_URI_IS_POP(self) || MN_URI_IS_IMAP(self))
+ self->human_readable = g_strdup_printf("%s@%s", self->username, self->hostname);
+ else if (MN_URI_IS_GMAIL(self))
+ self->human_readable = g_strdup_printf("%s@gmail.com", self->username);
+ else
+ self->human_readable = g_strdup(self->text);
+ }
+
+ private void
+ post_init (self)
+ {
+ const char *system_uri;
+
+ self_parse(self);
+ self_build(self);
+
+ if (self->vfs)
+ {
+ self->type = MN_URI_VFS;
+ if (gnome_vfs_uri_is_local(self->vfs))
+ self->flags |= MN_URI_LOCAL;
+ }
+ else if (self->scheme)
+ {
+ const SchemeInfo *scheme_info;
+
+ scheme_info = self_get_scheme_info(self->scheme);
+ if (scheme_info)
+ {
+ self->type = scheme_info->type;
+ self->flags |= scheme_info->flags;
+ }
+
+ if ((MN_URI_IS_POP(self) && self_has_query(self, "STLS"))
+ || (MN_URI_IS_IMAP(self) && self_has_query(self, "STARTTLS")))
+ self->flags |= MN_URI_INBAND_SSL;
+ }
+
+ system_uri = self_get_system_mailbox();
+ if (system_uri && ! strcmp(system_uri, self->text))
+ self->flags |= MN_URI_SYSTEM_MAILBOX;
+
+ self_set_human_readable(self);
+ }
+
+ public MNURI *
+ new (const char *text_uri (check null))
+ {
+ Self *self;
+ char *scheme;
+
+ self = GET_NEW;
+ self->text = ! strncmp(text_uri, "pop3:", 5) /* also handle obsolete pop3 locators */
+ ? g_strconcat("pop://", text_uri + 5, NULL)
+ : g_strdup(text_uri);
+
+ /* only use GnomeVFS if we can't handle it ourselves */
+ scheme = gnome_vfs_get_uri_scheme(self->text);
+ if (! scheme || ! self_get_scheme_info(scheme))
+ self->vfs = gnome_vfs_uri_new(self->text);
+ g_free(scheme);
+
+ self_post_init(self);
+ return self;
+ }
+
+ public MNURI *
+ new_pop (gboolean ssl,
+ gboolean stls,
+ const char *username (check null),
+ const char *password (check null),
+ const char *authmech,
+ const char *hostname (check null),
+ int port)
+ {
+ Self *self;
+
+ self = GET_NEW;
+
+ self->scheme = g_strdup(ssl ? "pops" : "pop");
+ self->username = g_strdup(username);
+ self->password = g_strdup(password);
+ self->authmech = g_strdup(authmech);
+ self->hostname = g_strdup(hostname);
+ self->port = port;
+ if (stls)
+ self->queries = g_strsplit("STLS", " ", 0);
+
+ self_post_init(self);
+ return self;
+ }
+
+ public MNURI *
+ new_imap (gboolean ssl,
+ gboolean starttls,
+ const char *username (check null),
+ const char *password (check null),
+ const char *authmech,
+ const char *hostname (check null),
+ int port,
+ const char *mailbox (check null))
+ {
+ Self *self;
+
+ self = GET_NEW;
+
+ self->scheme = g_strdup(ssl ? "imaps" : "imap");
+ self->username = g_strdup(username);
+ self->password = g_strdup(password);
+ self->authmech = g_strdup(authmech);
+ self->hostname = g_strdup(hostname);
+ self->port = port;
+ self->path = g_strdup(mailbox);
+ if (starttls)
+ self->queries = g_strsplit("STARTTLS", " ", 0);
+
+ self_post_init(self);
+ return self;
+ }
+
+ public MNURI *
+ new_gmail (const char *username (check null),
+ const char *password (check null))
+ {
+ Self *self;
+
+ self = GET_NEW;
+
+ self->scheme = g_strdup("gmail");
+ self->username = g_strdup(username);
+ self->password = g_strdup(password);
+
+ self_post_init(self);
+ return self;
+ }
+}
diff --git a/src/mn-uri.h b/src/mn-uri.h
@@ -1,70 +1,123 @@
-/*
- * Copyright (c) 2004 Jean-Yves Lefort <jylefort@brutele.be>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <libgnomevfs/gnome-vfs.h>
+
+#ifndef __MN_URI_H__
+#define __MN_URI_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+ typedef enum
+ {
+ MN_URI_VFS,
+ MN_URI_POP,
+ MN_URI_IMAP,
+ MN_URI_GMAIL,
+ MN_URI_UNKNOWN
+ } MNURIType;
+
+ typedef enum
+ {
+ MN_URI_LOCAL = 1 << 0,
+ MN_URI_SYSTEM_MAILBOX = 1 << 1,
+ MN_URI_SSL = 1 << 2,
+ MN_URI_INBAND_SSL = 1 << 3
+ } MNURIFlags;
+
+#define MN_URI_IS_VFS(uri) ((uri)->type == MN_URI_VFS)
+#define MN_URI_IS_POP(uri) ((uri)->type == MN_URI_POP)
+#define MN_URI_IS_IMAP(uri) ((uri)->type == MN_URI_IMAP)
+#define MN_URI_IS_GMAIL(uri) ((uri)->type == MN_URI_GMAIL)
+
+#define MN_URI_IS_LOCAL(uri) (((uri)->flags & MN_URI_LOCAL) != 0)
+#define MN_URI_IS_SYSTEM_MAILBOX(uri) (((uri)->flags & MN_URI_SYSTEM_MAILBOX) != 0)
+#define MN_URI_IS_SSL(uri) (((uri)->flags & MN_URI_SSL) != 0)
+#define MN_URI_IS_INBAND_SSL(uri) (((uri)->flags & MN_URI_INBAND_SSL) != 0)
+
+
+/*
+ * Type checking and casting macros
*/
+#define MN_TYPE_URI (mn_uri_get_type())
+#define MN_URI(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_uri_get_type(), MNURI)
+#define MN_URI_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_uri_get_type(), MNURI const)
+#define MN_URI_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_uri_get_type(), MNURIClass)
+#define MN_IS_URI(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_uri_get_type ())
-#ifndef _MN_URI_H
-#define _MN_URI_H
+#define MN_URI_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_uri_get_type(), MNURIClass)
-#include <glib.h>
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_URI__
+#define __TYPEDEF_MN_URI__
+typedef struct _MNURI MNURI;
+#endif
+struct _MNURI {
+ GObject __parent__;
+ /*< public >*/
+ char * text;
+ GnomeVFSURI * vfs;
+ char * human_readable;
+ char * scheme;
+ char * username;
+ char * password;
+ char * authmech;
+ char * hostname;
+ int port;
+ char * path;
+ char ** queries;
+ MNURIType type;
+ MNURIFlags flags;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNURIClass MNURIClass;
+struct _MNURIClass {
+ GObjectClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_uri_get_type (void);
+gboolean mn_uri_has_query (MNURI * self,
+ const char * query);
+const char * mn_uri_get_system_mailbox (void);
+int mn_uri_get_default_port (const char * scheme);
+const char * mn_uri_get_default_path (const char * scheme);
+MNURI * mn_uri_new (const char * text_uri);
+MNURI * mn_uri_new_pop (gboolean ssl,
+ gboolean stls,
+ const char * username,
+ const char * password,
+ const char * authmech,
+ const char * hostname,
+ int port);
+MNURI * mn_uri_new_imap (gboolean ssl,
+ gboolean starttls,
+ const char * username,
+ const char * password,
+ const char * authmech,
+ const char * hostname,
+ int port,
+ const char * mailbox);
+MNURI * mn_uri_new_gmail (const char * username,
+ const char * password);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
-#define MN_URI_POP3_PORT(ssl) ((ssl) ? 995 : 110)
-#define MN_URI_IMAP_PORT(ssl) ((ssl) ? 993 : 143)
-
-char *mn_uri_build_pop (gboolean ssl,
- const char *username,
- const char *password,
- const char *authmech,
- const char *hostname,
- int port);
-gboolean mn_uri_parse_pop (const char *uri,
- gboolean *ssl,
- char **username,
- char **password,
- char **authmech,
- char **hostname,
- int *port);
-
-char *mn_uri_build_imap (gboolean ssl,
- const char *username,
- const char *password,
- const char *authmech,
- const char *hostname,
- int port,
- const char *mailbox);
-gboolean mn_uri_parse_imap (const char *uri,
- gboolean *ssl,
- char **username,
- char **password,
- char **authmech,
- char **hostname,
- int *port,
- char **mailbox);
-
-char *mn_uri_build_gmail (const char *username, const char *password);
-gboolean mn_uri_parse_gmail (const char *uri,
- char **username,
- char **password);
-
-char *mn_uri_canonicalize (const char *uri);
-int mn_uri_cmp (const char *uri1, const char *uri2);
-
-char *mn_uri_format_for_display (const char *uri);
-
-gboolean mn_uri_is_local (const char *uri);
-const char *mn_uri_get_system_mailbox (void);
-
-#endif /* _MN_URI_H */
+#endif
diff --git a/src/mn-util.c b/src/mn-util.c
@@ -19,12 +19,14 @@
#include "config.h"
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <gnome.h>
#include <glade/glade.h>
+#include <eel/eel.h>
+#include <eel/eel-alert-dialog.h>
#include "mn-util.h"
#include "mn-conf.h"
#include "mn-mailboxes.h"
-#include "mn-dialog.h"
#include "mn-shell.h"
/*** types *******************************************************************/
@@ -36,6 +38,8 @@ enum {
/*** functions ***************************************************************/
+static int mn_g_str_slist_compare_func (gconstpointer a, gconstpointer b);
+
static void mn_file_chooser_dialog_file_activated_h (GtkFileChooser *chooser,
gpointer user_data);
static void mn_file_chooser_dialog_response_h (GtkDialog *dialog,
@@ -67,20 +71,99 @@ mn_info (const char *format, ...)
va_end(args);
}
-/*
- * Free a singly linked list of heap pointers.
- */
-void
-mn_pointers_free (GSList *list)
+/**
+ * mn_g_slist_delete_link_deep:
+ * @list: a #GSList of g_free'able objects
+ * @link_: an element in the #GSList
+ *
+ * Equivalent of g_slist_delete_link() for a list of g_free'able
+ * objects.
+ *
+ * Return value: new head of @list.
+ **/
+GSList *
+mn_g_slist_delete_link_deep (GSList *list, GSList *link_)
{
- GSList *l;
+ return mn_g_slist_delete_link_deep_custom(list, link_, (GFunc) g_free, NULL);
+}
- MN_LIST_FOREACH(l, list)
- g_free(l->data);
+/**
+ * mn_g_slist_delete_link_deep_custom:
+ * @list: a #GSList of @element_free_func-freeable objects
+ * @link_: an element in the #GSList
+ * @element_free_func: a function to free @link_->data
+ * @user_data: user data to pass to @element_free_func
+ *
+ * Equivalent of g_slist_delete_link() for a list of
+ * @element_free_func-freeable objects.
+ *
+ * Return value: new head of @list.
+ **/
+GSList *
+mn_g_slist_delete_link_deep_custom (GSList *list,
+ GSList *link_,
+ GFunc element_free_func,
+ gpointer user_data)
+{
+ g_return_val_if_fail(element_free_func != NULL, NULL);
+
+ if (link_)
+ element_free_func(link_->data, user_data);
- g_slist_free(list);
+ return g_slist_delete_link(list, link_);
}
+GSList *
+mn_g_str_slist_find (GSList *list, const char *str)
+{
+ g_return_val_if_fail(str != NULL, NULL);
+
+ return g_slist_find_custom(list, str, mn_g_str_slist_compare_func);
+}
+
+static int
+mn_g_str_slist_compare_func (gconstpointer a, gconstpointer b)
+{
+ return strcmp(a, b);
+}
+
+/**
+ * mn_g_object_slist_free:
+ * @list: a #GSList of #GObject instances
+ *
+ * Equivalent of eel_g_object_list_free() for a singly-linked list.
+ **/
+void
+mn_g_object_slist_free (GSList *list)
+{
+ eel_g_slist_free_deep_custom(list, (GFunc) g_object_unref, NULL);
+}
+
+/**
+ * mn_g_object_slist_delete_link:
+ * @list: a #GSList of #GObject instances
+ * @link_: an element in the #GSList
+ *
+ * Equivalent of g_slist_delete_link() for a list of GObject
+ * instances.
+ *
+ * Return value: new head of @list.
+ **/
+GSList *
+mn_g_object_slist_delete_link (GSList *list, GSList *link_)
+{
+ return mn_g_slist_delete_link_deep_custom(list, link_, (GFunc) g_object_unref, NULL);
+}
+
+/**
+ * mn_str_isnumeric:
+ * @str: the ASCII string to test
+ *
+ * Tests if the ASCII string @str is numeric. Implemented by calling
+ * g_ascii_isdigit() on each character of @str.
+ *
+ * Return value: %TRUE if the ASCII string @str only consists of digits
+ **/
gboolean
mn_str_isnumeric (const char *str)
{
@@ -158,13 +241,17 @@ mn_create_interface (const char *name, ...)
g_object_unref(xml);
}
-/*
- * The GtkFileChooser API does not allow a chooser to pick a file
- * (GTK_FILE_CHOOSER_ACTION_OPEN) and select a folder
- * (GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) at the same time.
+/**
+ * mn_file_chooser_dialog_allow_select_folder:
+ * @dialog: a #GtkFileChooserDialog
+ * @accept_id: the "accept" response ID (must not be
+ * GTK_RESPONSE_ACCEPT, GTK_RESPONSE_OK, GTK_RESPONSE_YES
+ * or GTK_RESPONSE_APPLY)
*
- * This function provides a workaround.
- */
+ * Allows @dialog to pick a file (%GTK_FILE_CHOOSER_ACTION_OPEN) or
+ * select a folder (%GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) at the
+ * same time.
+ **/
void
mn_file_chooser_dialog_allow_select_folder (GtkFileChooserDialog *dialog,
int accept_id)
@@ -214,6 +301,13 @@ mn_file_chooser_dialog_response_h (GtkDialog *dialog,
}
}
+/**
+ * mn_setup_dnd:
+ * @widget: a widget to setup mailbox drag-and-drop for
+ *
+ * Configures @widget so that when mailboxes are dropped on it, they
+ * will be added to the Mail Notification mailbox list.
+ **/
void
mn_setup_dnd (GtkWidget *widget)
{
@@ -279,7 +373,7 @@ mn_drag_data_received_h (GtkWidget *widget,
gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
gconf_mailboxes = g_slist_concat(gconf_mailboxes, new_mailboxes);
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
}
}
break;
@@ -305,6 +399,7 @@ mn_drag_data_received_h (GtkWidget *widget,
for (i = 0; i < char_len && char_data[i] != '\n'; i++)
g_string_append_unichar(url, char_data[i]);
+ g_return_if_fail(mn_shell != NULL);
if (! mn_mailboxes_find(mn_shell->mailboxes, url->str))
{
GSList *gconf_mailboxes;
@@ -312,7 +407,7 @@ mn_drag_data_received_h (GtkWidget *widget,
gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
gconf_mailboxes = g_slist_append(gconf_mailboxes, g_strdup(url->str));
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_pointers_free(gconf_mailboxes);
+ eel_g_slist_free_deep(gconf_mailboxes);
}
g_string_free(url, TRUE);
@@ -405,6 +500,14 @@ mn_thread_create (GThreadFunc func, gpointer data)
}
}
+/**
+ * mn_tooltips_new:
+ *
+ * Creates and sinks a #GtkTooltips object.
+ *
+ * Return value: the new #GtkTooltips object (sunk and with a
+ * reference count of 1).
+ **/
GtkTooltips *
mn_tooltips_new (void)
{
@@ -417,6 +520,20 @@ mn_tooltips_new (void)
return tooltips;
}
+/**
+ * mn_tooltips_set_tips:
+ * @tooltips: a #GtkTooltips object
+ * @...: a %NULL-terminated list of widget-tip pairs
+ *
+ * Sets the tooltips of several widgets at once.
+ *
+ * <example>
+ * mn_tooltips_set_tips(tooltips,
+ * button, "Click here to proceed",
+ * entry, "Your username",
+ * NULL);
+ * </example>
+ **/
void
mn_tooltips_set_tips (GtkTooltips *tooltips, ...)
{
@@ -443,8 +560,8 @@ mn_tooltips_set_tips (GtkTooltips *tooltips, ...)
/**
* mn_menu_shell_append:
* @shell: the #GtkMenuShell to append to
- * @stock_id: the stock ID of the item, or NULL
- * @mnemonic: the mnemonic of the item, or NULL
+ * @stock_id: the stock ID of the item or %NULL
+ * @mnemonic: the mnemonic of the item or %NULL
*
* Creates a new menu item, shows it and appends it to @shell.
*
@@ -458,11 +575,11 @@ mn_tooltips_set_tips (GtkTooltips *tooltips, ...)
* If only @mnemonic is provided, a #GtkMenuItem will be created using
* the text of @mnemonic.
*
- * If @stock_id and @mnemonic are both NULL, a #GtkSeparatorMenuItem
+ * If @stock_id and @mnemonic are both %NULL, a #GtkSeparatorMenuItem
* will be created.
*
- * Return value: the new menu item
- */
+ * Return value: the new menu item.
+ **/
GtkWidget *
mn_menu_shell_append (GtkMenuShell *shell,
const char *stock_id,
@@ -479,6 +596,17 @@ mn_menu_shell_append (GtkMenuShell *shell,
return item;
}
+/**
+ * mn_menu_shell_prepend:
+ * @shell: the #GtkMenuShell to prepend to
+ * @stock_id: the stock ID of the item or %NULL
+ * @mnemonic: the mnemonic of the item or %NULL
+ *
+ * Same as mn_menu_shell_append(), but prepends the item instead of
+ * appending it.
+ *
+ * Return value: the new menu item.
+ **/
GtkWidget *
mn_menu_shell_prepend (GtkMenuShell *shell,
const char *stock_id,
@@ -519,3 +647,59 @@ mn_menu_item_new (const char *stock_id, const char *mnemonic)
return item;
}
+
+void
+mn_error_dialog (const char *help_link_id,
+ const char *primary,
+ const char *format,
+ ...)
+{
+ GtkWidget *dialog;
+ char *secondary = NULL;
+
+ if (format)
+ {
+ va_list args;
+
+ va_start(args, format);
+ secondary = g_strdup_vprintf(format, args);
+ va_end(args);
+ }
+
+ dialog = eel_alert_dialog_new(NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_NONE,
+ primary,
+ secondary,
+ NULL);
+
+ if (help_link_id != NULL)
+ gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_HELP, GTK_RESPONSE_HELP);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
+
+ gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+
+ while (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_HELP)
+ mn_display_help(help_link_id);
+
+ gtk_widget_destroy(dialog);
+}
+
+void
+mn_fatal_error_dialog (const char *format, ...)
+{
+ va_list args;
+ char *secondary;
+
+ g_return_if_fail(format != NULL);
+
+ va_start(args, format);
+ secondary = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ mn_error_dialog(NULL, _("A fatal error has occurred in Mail Notification"), "%s", secondary);
+ g_free(secondary);
+
+ exit(1);
+}
diff --git a/src/mn-util.h b/src/mn-util.h
@@ -30,7 +30,20 @@ for ((var) = (head); \
void mn_info (const char *format,
...);
-void mn_pointers_free (GSList *list);
+
+GSList *mn_g_slist_delete_link_deep (GSList *list,
+ GSList *link_);
+GSList *mn_g_slist_delete_link_deep_custom (GSList *list,
+ GSList *link_,
+ GFunc element_free_func,
+ gpointer user_data);
+
+GSList *mn_g_str_slist_find (GSList *list,
+ const char *str);
+
+void mn_g_object_slist_free (GSList *list);
+GSList *mn_g_object_slist_delete_link (GSList *list,
+ GSList *link_);
gboolean mn_str_isnumeric (const char *str);
@@ -73,4 +86,11 @@ GtkWidget *mn_menu_shell_prepend (GtkMenuShell *shell,
const char *stock_id,
const char *mnemonic);
+void mn_error_dialog (const char *help_link_id,
+ const char *primary,
+ const char *format,
+ ...);
+void mn_fatal_error_dialog (const char *format,
+ ...);
+
#endif /* _MN_UTIL_H */
diff --git a/src/mn-vfs.c b/src/mn-vfs.c
@@ -118,7 +118,7 @@ mn_vfs_read_line_context_free (MNVFSReadLineContext *context)
}
gboolean
-mn_vfs_test (const char *uri, GFileTest test)
+mn_vfs_test (GnomeVFSURI *uri, GFileTest test)
{
GnomeVFSFileInfoOptions options;
GnomeVFSFileInfo *file_info;
@@ -133,7 +133,7 @@ mn_vfs_test (const char *uri, GFileTest test)
options |= GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS;
file_info = gnome_vfs_file_info_new();
- if (gnome_vfs_get_file_info(uri, file_info, options) == GNOME_VFS_OK)
+ if (gnome_vfs_get_file_info_uri(uri, file_info, options) == GNOME_VFS_OK)
{
if (file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE)
{
diff --git a/src/mn-vfs.h b/src/mn-vfs.h
@@ -30,6 +30,6 @@ GnomeVFSResult mn_vfs_read_line (MNVFSReadLineContext **context,
const char **line);
void mn_vfs_read_line_context_free (MNVFSReadLineContext *context);
-gboolean mn_vfs_test (const char *uri, GFileTest test);
+gboolean mn_vfs_test (GnomeVFSURI *uri, GFileTest test);
#endif /* _MN_VFS_H */
diff --git a/tests/Makefile.am b/tests/Makefile.am
@@ -1,5 +1,5 @@
tests = \
- test-uri.output \
+ test-uri.stamp \
test-vfs-read-line1-smallblock.output \
test-vfs-read-line1-largeblock.output \
test-vfs-read-line2-smallblock.output \
@@ -34,9 +34,9 @@ AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) \
-I$(top_srcdir)/src \
-DMN_REGRESSION_TEST
-test-uri.output: test-uri test-uri.expected
- ./test-uri > test-uri.output
- @if cmp test-uri.output test-uri.expected > /dev/null; then echo "+++ URI TEST PASSED"; else echo "--- URI TEST FAILED"; exit 1; fi
+test-uri.stamp: test-uri
+ ./test-uri
+ @touch test-uri.stamp
test-vfs-read-line1-smallblock.output: test-vfs-read-line-smallblock test-vfs-read-line1.input test-vfs-read-line1.expected
./test-vfs-read-line-smallblock file://`pwd`/test-vfs-read-line1.input > test-vfs-read-line1-smallblock.output
@@ -57,7 +57,6 @@ test-vfs-read-line2-largeblock.output: test-vfs-read-line-largeblock test-vfs-re
MOSTLYCLEANFILES = $(tests)
EXTRA_DIST = \
- test-uri.expected \
test-vfs-read-line1.input \
test-vfs-read-line1.expected \
test-vfs-read-line2.input \
diff --git a/tests/Makefile.in b/tests/Makefile.in
@@ -44,8 +44,8 @@ subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -243,7 +243,7 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
tests = \
- test-uri.output \
+ test-uri.stamp \
test-vfs-read-line1-smallblock.output \
test-vfs-read-line1-largeblock.output \
test-vfs-read-line2-smallblock.output \
@@ -275,7 +275,6 @@ AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) \
MOSTLYCLEANFILES = $(tests)
EXTRA_DIST = \
- test-uri.expected \
test-vfs-read-line1.input \
test-vfs-read-line1.expected \
test-vfs-read-line2.input \
@@ -602,9 +601,9 @@ uninstall-am: uninstall-info-am
uninstall-am uninstall-info-am
-test-uri.output: test-uri test-uri.expected
- ./test-uri > test-uri.output
- @if cmp test-uri.output test-uri.expected > /dev/null; then echo "+++ URI TEST PASSED"; else echo "--- URI TEST FAILED"; exit 1; fi
+test-uri.stamp: test-uri
+ ./test-uri
+ @touch test-uri.stamp
test-vfs-read-line1-smallblock.output: test-vfs-read-line-smallblock test-vfs-read-line1.input test-vfs-read-line1.expected
./test-vfs-read-line-smallblock file://`pwd`/test-vfs-read-line1.input > test-vfs-read-line1-smallblock.output
diff --git a/tests/test-uri.c b/tests/test-uri.c
@@ -18,236 +18,138 @@
#include "mn-uri.h"
-int
-main (int argc, char **argv)
+static char *
+build_uri (const char *scheme,
+ const char *authmech,
+ const char *hostname,
+ int port,
+ const char *path,
+ const char *queries)
+{
+ GString *uri;
+
+ uri = g_string_new(scheme);
+ g_string_append(uri, "://username:password");
+
+ if (authmech)
+ g_string_append_printf(uri, ";AUTH=%s", authmech);
+ if (hostname)
+ g_string_append_printf(uri, "@%s", hostname);
+ if (port != -1)
+ g_string_append_printf(uri, ":%i", port);
+ if (path)
+ g_string_append_printf(uri, "/%s", path);
+ if (queries)
+ g_string_append_printf(uri, "?%s", queries);
+
+ return g_string_free(uri, FALSE);
+}
+
+static char *
+build_canonical_uri (const char *scheme,
+ const char *authmech,
+ const char *hostname,
+ int port,
+ const char *path,
+ const char *queries)
{
- /*
- * The parser is very lax (unsuitable for handling untrusted URIs),
- * we are only interested in making sure it can handle all the URIs
- * we'll have to deal with.
- */
- const char *pop_uri_list[] = {
- "pop://invalid",
-
- "pop://usern%40me:password@hostname",
- "pop://usern%40me:password@hostname:110",
- "pop://usern%40me:password@hostname:555",
-
- "pop://usern%40me:password@[::1]",
- "pop://usern%40me:password@[::1]:110",
- "pop://usern%40me:password@[::1]:555",
-
- "pop://usern%40me:password;auth=MECH@hostname",
- "pop://usern%40me:password;auth=MECH@hostname:110",
- "pop://usern%40me:password;auth=MECH@hostname:555",
-
- "pop://usern%40me:password;auth=MECH@[::1]",
- "pop://usern%40me:password;auth=MECH@[::1]:110",
- "pop://usern%40me:password;auth=MECH@[::1]:555",
-
- "pops://invalid",
-
- "pops://usern%40me:password@hostname",
- "pops://usern%40me:password@hostname:995",
- "pops://usern%40me:password@hostname:555",
-
- "pops://usern%40me:password@[::1]",
- "pops://usern%40me:password@[::1]:995",
- "pops://usern%40me:password@[::1]:555",
-
- "pops://usern%40me:password;auth=MECH@hostname",
- "pops://usern%40me:password;auth=MECH@hostname:995",
- "pops://usern%40me:password;auth=MECH@hostname:555",
-
- "pops://usern%40me:password;auth=MECH@[::1]",
- "pops://usern%40me:password;auth=MECH@[::1]:995",
- "pops://usern%40me:password;auth=MECH@[::1]:555",
- };
- const char *imap_uri_list[] = {
- "imap://invalid",
-
- "imap://usern%40me:password@hostname",
- "imap://usern%40me:password@hostname/mailbox",
- "imap://usern%40me:password@hostname:143",
- "imap://usern%40me:password@hostname:143/mailbox",
- "imap://usern%40me:password@hostname:555",
- "imap://usern%40me:password@hostname:555/mailbox",
-
- "imap://usern%40me:password@[::1]",
- "imap://usern%40me:password@[::1]/mailbox",
- "imap://usern%40me:password@[::1]:143",
- "imap://usern%40me:password@[::1]:143/mailbox",
- "imap://usern%40me:password@[::1]:555",
- "imap://usern%40me:password@[::1]:555/mailbox",
-
- "imap://usern%40me:password;auth=MECH@hostname",
- "imap://usern%40me:password;auth=MECH@hostname/mailbox",
- "imap://usern%40me:password;auth=MECH@hostname:143",
- "imap://usern%40me:password;auth=MECH@hostname:143/mailbox",
- "imap://usern%40me:password;auth=MECH@hostname:555",
- "imap://usern%40me:password;auth=MECH@hostname:555/mailbox",
-
- "imap://usern%40me:password;auth=MECH@[::1]",
- "imap://usern%40me:password;auth=MECH@[::1]/mailbox",
- "imap://usern%40me:password;auth=MECH@[::1]:143",
- "imap://usern%40me:password;auth=MECH@[::1]:143/mailbox",
- "imap://usern%40me:password;auth=MECH@[::1]:555",
- "imap://usern%40me:password;auth=MECH@[::1]:555/mailbox",
-
- "imaps://invalid",
-
- "imaps://usern%40me:password@hostname",
- "imaps://usern%40me:password@hostname/mailbox",
- "imaps://usern%40me:password@hostname:993",
- "imaps://usern%40me:password@hostname:993/mailbox",
- "imaps://usern%40me:password@hostname:555",
- "imaps://usern%40me:password@hostname:555/mailbox",
-
- "imaps://usern%40me:password@[::1]",
- "imaps://usern%40me:password@[::1]/mailbox",
- "imaps://usern%40me:password@[::1]:993",
- "imaps://usern%40me:password@[::1]:993/mailbox",
- "imaps://usern%40me:password@[::1]:555",
- "imaps://usern%40me:password@[::1]:555/mailbox",
-
- "imaps://usern%40me:password;auth=MECH@hostname",
- "imaps://usern%40me:password;auth=MECH@hostname/mailbox",
- "imaps://usern%40me:password;auth=MECH@hostname:993",
- "imaps://usern%40me:password;auth=MECH@hostname:993/mailbox",
- "imaps://usern%40me:password;auth=MECH@hostname:555",
- "imaps://usern%40me:password;auth=MECH@hostname:555/mailbox",
-
- "imaps://usern%40me:password;auth=MECH@[::1]",
- "imaps://usern%40me:password;auth=MECH@[::1]/mailbox",
- "imaps://usern%40me:password;auth=MECH@[::1]:993",
- "imaps://usern%40me:password;auth=MECH@[::1]:993/mailbox",
- "imaps://usern%40me:password;auth=MECH@[::1]:555",
- "imaps://usern%40me:password;auth=MECH@[::1]:555/mailbox",
- };
- const char *gmail_uri_list[] = {
- "gmail://invalid",
-
- "gmail://usern%40me:password"
- };
- int i;
-
- for (i = 0; i < G_N_ELEMENTS(pop_uri_list); i++)
+ int default_port = -1;
+ const char *default_path = NULL;
+
+ if (! strcmp(scheme, "pop") || ! strcmp(scheme, "pops"))
{
- gboolean ssl = FALSE;
- char *username = NULL;
- char *password = NULL;
- char *authmech = NULL;
- char *hostname = NULL;
- int port = -1;
-
- g_print("pop %i: ", i);
- if (mn_uri_parse_pop(pop_uri_list[i], &ssl, &username, &password, &authmech, &hostname, &port))
- {
- char *uri;
- char *canonicalized;
-
- uri = mn_uri_build_pop(ssl, username, password, authmech, hostname, port);
- g_assert(uri != NULL);
-
- canonicalized = mn_uri_canonicalize(uri);
- g_assert(strcmp(canonicalized, uri) == 0);
- g_free(canonicalized);
-
- g_free(username);
- g_free(password);
- g_free(authmech);
- g_free(hostname);
-
- g_print("%s\n", uri);
- g_free(uri);
- }
- else
- {
- g_assert(ssl == FALSE
- && username == NULL
- && password == NULL
- && authmech == NULL
- && hostname == NULL
- && port == -1);
- g_print("invalid\n");
- }
+ if (! hostname || path)
+ return NULL;
}
-
- for (i = 0; i < G_N_ELEMENTS(imap_uri_list); i++)
+ else if (! strcmp(scheme, "imap") || ! strcmp(scheme, "imaps"))
+ {
+ if (! hostname)
+ return NULL;
+ }
+ else if (! strcmp(scheme, "gmail"))
{
- gboolean ssl = FALSE;
- char *username = NULL;
- char *password = NULL;
- char *authmech = NULL;
- char *hostname = NULL;
- int port = -1;
- char *mailbox = NULL;
-
- g_print("imap %i: ", i);
- if (mn_uri_parse_imap(imap_uri_list[i], &ssl, &username, &password, &authmech, &hostname, &port, &mailbox))
- {
- char *uri;
- char *canonicalized;
-
- uri = mn_uri_build_imap(ssl, username, password, authmech, hostname, port, mailbox);
- g_assert(uri != NULL);
-
- canonicalized = mn_uri_canonicalize(uri);
- g_assert(strcmp(canonicalized, uri) == 0);
- g_free(canonicalized);
-
- g_free(username);
- g_free(password);
- g_free(authmech);
- g_free(hostname);
- g_free(mailbox);
-
- g_print("%s\n", uri);
- g_free(uri);
- }
- else
- {
- g_assert(ssl == FALSE
- && username == NULL
- && password == NULL
- && authmech == NULL
- && hostname == NULL
- && port == -1
- && mailbox == NULL);
- g_print("invalid\n");
- }
+ if (authmech || hostname || port != -1 || path || queries)
+ return NULL;
}
+
+ if (! strcmp(scheme, "pop"))
+ default_port = 110;
+ else if (! strcmp(scheme, "pops"))
+ default_port = 995;
+ else if (! strcmp(scheme, "imap"))
+ default_port = 143;
+ else if (! strcmp(scheme, "imaps"))
+ default_port = 993;
+
+ if (! strcmp(scheme, "imap") || ! strcmp(scheme, "imaps"))
+ default_path = "INBOX";
+
+ return build_uri(scheme,
+ authmech,
+ hostname,
+ port != default_port ? port : -1,
+ (! path || ! default_path || strcmp(path, default_path)) ? path : NULL,
+ queries);
+}
- for (i = 0; i < G_N_ELEMENTS(gmail_uri_list); i++)
+static void
+assert_strequal (const char *uri, const char *str1, const char *str2)
+{
+ if (! ((! str1 && ! str2) || (str1 && str2 && ! strcmp(str1, str2))))
{
- char *username = NULL;
- char *password = NULL;
-
- g_print("gmail %i: ", i);
- if (mn_uri_parse_gmail(gmail_uri_list[i], &username, &password))
- {
- char *uri;
- char *canonicalized;
-
- uri = mn_uri_build_gmail(username, password);
- g_assert(uri != NULL);
-
- canonicalized = mn_uri_canonicalize(uri);
- g_assert(strcmp(canonicalized, uri) == 0);
- g_free(canonicalized);
-
- g_free(username);
- g_free(password);
-
- g_print("%s\n", uri);
- g_free(uri);
- }
- else
- {
- g_assert(username == NULL && password == NULL);
- g_print("invalid\n");
- }
+ g_print("%s and %s differ\n", str1, str2);
+ g_print("uri was %s\n", uri);
+ exit(1);
}
+}
+
+int
+main (int argc, char **argv)
+{
+#define FOR(iterator, var) \
+ for (iterator = 0; iterator < G_N_ELEMENTS(var); iterator++)
+
+ int a, b, c, d, e, f;
+ const char *schemes[] = { "pop", "pops", "imap", "imaps", "gmail" };
+ const char *authmechs[] = { NULL, "CRAM-MD5" };
+ const char *hostnames[] = { NULL, "hostname", "[::1]" };
+ int ports[] = { -1, 110, 995, 143, 993, 555 };
+ const char *paths[] = { NULL, "INBOX", "foo-path" };
+ const char *queries[] = { NULL, "STARTTLS", "STLS", "foo-query" };
+ int n_uri = 0;
+ int n_canonical = 0;
+
+ g_type_init();
+
+ FOR(a, schemes)
+ FOR(b, authmechs)
+ FOR(c, hostnames)
+ FOR(d, ports)
+ FOR(e, paths)
+ FOR(f, queries)
+ {
+ char *uri;
+ char *canonical_uri;
+ MNURI *obj;
+
+ n_uri++;
+
+ uri = build_uri(schemes[a], authmechs[b], hostnames[c], ports[d], paths[e], queries[f]);
+ canonical_uri = build_canonical_uri(schemes[a], authmechs[b], hostnames[c], ports[d], paths[e], queries[f]);
+
+ obj = mn_uri_new(uri);
+ if (canonical_uri)
+ {
+ n_canonical++;
+ assert_strequal(uri, obj->text, canonical_uri);
+ }
+
+ g_free(uri);
+ g_free(canonical_uri);
+ g_object_unref(obj);
+ }
+
+ g_print("+++ URI TEST PASSED (%i URI tested, %i could be canonicalized)\n", n_uri, n_canonical);
return 0;
}
diff --git a/tests/test-uri.expected b/tests/test-uri.expected
@@ -1,78 +0,0 @@
-pop 0: invalid
-pop 1: pop://usern%40me:password@hostname
-pop 2: pop://usern%40me:password@hostname
-pop 3: pop://usern%40me:password@hostname:555
-pop 4: pop://usern%40me:password@[::1]
-pop 5: pop://usern%40me:password@[::1]
-pop 6: pop://usern%40me:password@[::1]:555
-pop 7: pop://usern%40me:password;AUTH=MECH@hostname
-pop 8: pop://usern%40me:password;AUTH=MECH@hostname
-pop 9: pop://usern%40me:password;AUTH=MECH@hostname:555
-pop 10: pop://usern%40me:password;AUTH=MECH@[::1]
-pop 11: pop://usern%40me:password;AUTH=MECH@[::1]
-pop 12: pop://usern%40me:password;AUTH=MECH@[::1]:555
-pop 13: invalid
-pop 14: pops://usern%40me:password@hostname
-pop 15: pops://usern%40me:password@hostname
-pop 16: pops://usern%40me:password@hostname:555
-pop 17: pops://usern%40me:password@[::1]
-pop 18: pops://usern%40me:password@[::1]
-pop 19: pops://usern%40me:password@[::1]:555
-pop 20: pops://usern%40me:password;AUTH=MECH@hostname
-pop 21: pops://usern%40me:password;AUTH=MECH@hostname
-pop 22: pops://usern%40me:password;AUTH=MECH@hostname:555
-pop 23: pops://usern%40me:password;AUTH=MECH@[::1]
-pop 24: pops://usern%40me:password;AUTH=MECH@[::1]
-pop 25: pops://usern%40me:password;AUTH=MECH@[::1]:555
-imap 0: invalid
-imap 1: imap://usern%40me:password@hostname
-imap 2: imap://usern%40me:password@hostname/mailbox
-imap 3: imap://usern%40me:password@hostname
-imap 4: imap://usern%40me:password@hostname/mailbox
-imap 5: imap://usern%40me:password@hostname:555
-imap 6: imap://usern%40me:password@hostname:555/mailbox
-imap 7: imap://usern%40me:password@[::1]
-imap 8: imap://usern%40me:password@[::1]/mailbox
-imap 9: imap://usern%40me:password@[::1]
-imap 10: imap://usern%40me:password@[::1]/mailbox
-imap 11: imap://usern%40me:password@[::1]:555
-imap 12: imap://usern%40me:password@[::1]:555/mailbox
-imap 13: imap://usern%40me:password;AUTH=MECH@hostname
-imap 14: imap://usern%40me:password;AUTH=MECH@hostname/mailbox
-imap 15: imap://usern%40me:password;AUTH=MECH@hostname
-imap 16: imap://usern%40me:password;AUTH=MECH@hostname/mailbox
-imap 17: imap://usern%40me:password;AUTH=MECH@hostname:555
-imap 18: imap://usern%40me:password;AUTH=MECH@hostname:555/mailbox
-imap 19: imap://usern%40me:password;AUTH=MECH@[::1]
-imap 20: imap://usern%40me:password;AUTH=MECH@[::1]/mailbox
-imap 21: imap://usern%40me:password;AUTH=MECH@[::1]
-imap 22: imap://usern%40me:password;AUTH=MECH@[::1]/mailbox
-imap 23: imap://usern%40me:password;AUTH=MECH@[::1]:555
-imap 24: imap://usern%40me:password;AUTH=MECH@[::1]:555/mailbox
-imap 25: invalid
-imap 26: imaps://usern%40me:password@hostname
-imap 27: imaps://usern%40me:password@hostname/mailbox
-imap 28: imaps://usern%40me:password@hostname
-imap 29: imaps://usern%40me:password@hostname/mailbox
-imap 30: imaps://usern%40me:password@hostname:555
-imap 31: imaps://usern%40me:password@hostname:555/mailbox
-imap 32: imaps://usern%40me:password@[::1]
-imap 33: imaps://usern%40me:password@[::1]/mailbox
-imap 34: imaps://usern%40me:password@[::1]
-imap 35: imaps://usern%40me:password@[::1]/mailbox
-imap 36: imaps://usern%40me:password@[::1]:555
-imap 37: imaps://usern%40me:password@[::1]:555/mailbox
-imap 38: imaps://usern%40me:password;AUTH=MECH@hostname
-imap 39: imaps://usern%40me:password;AUTH=MECH@hostname/mailbox
-imap 40: imaps://usern%40me:password;AUTH=MECH@hostname
-imap 41: imaps://usern%40me:password;AUTH=MECH@hostname/mailbox
-imap 42: imaps://usern%40me:password;AUTH=MECH@hostname:555
-imap 43: imaps://usern%40me:password;AUTH=MECH@hostname:555/mailbox
-imap 44: imaps://usern%40me:password;AUTH=MECH@[::1]
-imap 45: imaps://usern%40me:password;AUTH=MECH@[::1]/mailbox
-imap 46: imaps://usern%40me:password;AUTH=MECH@[::1]
-imap 47: imaps://usern%40me:password;AUTH=MECH@[::1]/mailbox
-imap 48: imaps://usern%40me:password;AUTH=MECH@[::1]:555
-imap 49: imaps://usern%40me:password;AUTH=MECH@[::1]:555/mailbox
-gmail 0: invalid
-gmail 1: gmail://usern%40me:password
diff --git a/ui/Makefile.am b/ui/Makefile.am
@@ -1,13 +1,11 @@
uidir = $(pkgdatadir)/ui
interfaces = \
- dialog.glade \
mailbox-properties.glade \
properties.glade \
welcome.glade
projects = \
- dialog.gladep \
mailbox-properties.gladep \
properties.gladep \
welcome.gladep
diff --git a/ui/Makefile.in b/ui/Makefile.in
@@ -39,8 +39,8 @@ DIST_COMMON = $(dist_ui_DATA) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/openssl.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/sasl2.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/sasl2.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -208,13 +208,11 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
uidir = $(pkgdatadir)/ui
interfaces = \
- dialog.glade \
mailbox-properties.glade \
properties.glade \
welcome.glade
projects = \
- dialog.gladep \
mailbox-properties.gladep \
properties.gladep \
welcome.gladep
diff --git a/ui/dialog.glade b/ui/dialog.glade
@@ -1,98 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="dialog">
- <property name="border_width">6</property>
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER</property>
- <property name="modal">False</property>
- <property name="resizable">False</property>
- <property name="destroy_with_parent">False</property>
- <property name="icon">mail-notification.png</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-dialog-error</property>
- <property name="icon_size">6</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/ui/dialog.gladep b/ui/dialog.gladep
@@ -1,14 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
-
-<glade-project>
- <name>Mail Notification Dialog</name>
- <program_name>mail-notification</program_name>
- <directory>../</directory>
- <source_directory>../src</source_directory>
- <pixmaps_directory>../art</pixmaps_directory>
- <output_main_file>FALSE</output_main_file>
- <output_support_files>FALSE</output_support_files>
- <output_build_files>FALSE</output_build_files>
- <translatable_strings_file>dialog-strings.c</translatable_strings_file>
-</glade-project>
diff --git a/ui/properties.glade b/ui/properties.glade
@@ -262,6 +262,47 @@
<property name="fill">True</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="autostart_check">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Whether to start Mail Notification when you log into your GNOME session or not</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Start Mail Notification on GNOME login</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="mn_properties_autostart_toggled_h" last_modification_time="Mon, 23 Aug 2004 01:36:43 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="blink_check">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Whether the status icon should blink on errors or not</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Blink on errors</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/ui/welcome.glade b/ui/welcome.glade
@@ -205,20 +205,21 @@
</child>
<child>
- <widget class="GtkLabel" id="label1">
+ <widget class="GtkLabel" id="label5">
<property name="visible">True</property>
+ <property name="can_focus">True</property>
<property name="label" translatable="yes"><span weight="bold" size="larger">First startup</span>
Mail Notification has been loaded successfully.
Since this is the first time you run Mail Notification, you might want to configure it.
-Note: this message will not be shown anymore. To configure Mail Notification again, choose <span weight="bold">Applications</span> → <span weight="bold">Desktop Preferences</span> → <span weight="bold">Mail Notification</span>.</property>
+Note: this message will not be shown anymore. To configure Mail Notification again, choose <span weight="bold">Applications</span> → <span weight="bold">Desktop Preferences</span> → <span weight="bold">Mail Notification</span> (or on some systems <span weight="bold">Applications → Preferences → More Preferences → Mail Notification</span>).</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
- <property name="selectable">False</property>
+ <property name="selectable">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0</property>
<property name="xpad">0</property>