commit 2829733b35a59b67d5a7b69ffb6794b0137dc952
parent cf18f5212d91fbc0ca7fa1acdbbf9fd2c3b27f5b
Author: Jean-Yves Lefort <jylefort@brutele.be>
Date: Tue, 17 Aug 2004 02:17:38 +1000
mail-notification-0.6.0
* Added IMAP support
* Added SSL support for POP3 and IMAP (requires OpenSSL)
* Added SASL authentication support for POP3 and IMAP
(requires Cyrus SASL 2)
* Added APOP authentication support
* Gmail support has been fixed
* If there is no new mail, the icon is now hidden
* Now complies with the HIG 2.0
* Now installs a GNOME sound event
* The user interface has been improved
* The mail icon is now taken from the icon theme
* The command line arguments have been modified
* The POP3 handler now honours the LOGIN-DELAY capability
* Objects are now generated with GOB
* Some cleanups have been performed
* A few minor bugs have been fixed
* Does not depend on GNet anymore
Diffstat:
193 files changed, 30098 insertions(+), 8026 deletions(-)
diff --git a/AUTHORS b/AUTHORS
@@ -2,15 +2,13 @@
mail-notification credits
-------------------------------------------------------------------------------
-Jean-Yves Lefort <jylefort@brutele.be> has created and is the
-copyright holder for all the files in the distribution, except:
+Developed by Jean-Yves Lefort <jylefort@brutele.be>.
- * files saying otherwise in their top notice
+Contributors:
+ * Dan Korostelev <dan@ats.energo.ru> (russian translations)
- * art/about-icon.png
- art/gmail.png
- art/logo.png
- art/mail-notification.png
- art/mail.png
- art/no-mail.png
- art/preferences-icon.png
+External art sources:
+ * GNOME (about-icon.png)
+ * Google (gmail.png)
+ * Evolution (mail-notification.png, properties-icon.png)
+ * GTK+ (unsupported.png)
diff --git a/INSTALL b/INSTALL
@@ -5,21 +5,21 @@
Index
0. About this document
- 1. Requirements
+ 1. Dependencies
2. Instructions
0. About this document
- $Id: INSTALL,v 1.6 2004/07/21 18:52:06 jylefort Exp $
+ $Id: INSTALL,v 1.7 2004/08/16 16:08:17 jylefort Exp $
Copyright (c) 2003, 2004 Jean-Yves Lefort.
This document is part of Mail Notification.
It may be distributed under the same terms as Mail Notification.
-1. Requirements
+1. Dependencies
- Mail Notification requires the following libraries:
+ Mandatory libraries:
* GTK+ (version 2.4.0 or superior)
http://www.gtk.org/
@@ -27,12 +27,23 @@ Index
* GNOME (version 2.0 or superior)
http://www.gnome.org/
- * for POP3 support: GNet (version 2.0 or superior)
- http://www.gnetlibrary.org/
+ Optional libraries:
- * for Gmail support: libsoup (version 1.99.28)
+ * for Gmail support:
+
+ libsoup (version 1.99.28)
ftp://ftp.gnome.org/pub/GNOME/sources/libsoup/1.99/
+ * for SSL support:
+
+ OpenSSL (version 0.9.5b or superior)
+ http://www.openssl.org/
+
+ * for SASL authentication support:
+
+ Cyrus SASL (version 2.0 or superior)
+ http://asg.web.cmu.edu/sasl/sasl-library.html
+
2. Instructions
Mail Notification uses the well-known GNU build system. Hence,
@@ -47,14 +58,17 @@ Index
command-line options: type "./configure --help" for an
exhaustive list.
- Six options are specific to Mail Notification:
+ These options are specific to Mail Notification:
--enable-mbox
--enable-mh
--enable-maildir
--enable-pop3
+ --enable-imap
+ --enable-ssl
+ --enable-sasl
--enable-sylpheed
--enable-gmail
+ --enable-ipv6
- They may be used to disable the compilation of some format
- handlers. They are all enabled by default.
+ They are all enabled by default.
diff --git a/Makefile.am b/Makefile.am
@@ -1,4 +1,8 @@
-SUBDIRS = art data help m4 po src ui
+if WITH_REGRESSION_TESTS
+tests = tests
+endif
+
+SUBDIRS = art data help m4 po src $(tests) ui
EXTRA_DIST = \
autogen.sh \
diff --git a/Makefile.in b/Makefile.in
@@ -40,7 +40,8 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
compile config.guess config.sub depcomp install-sh missing \
mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -59,7 +60,7 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = art data help m4 po src tests ui
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -79,6 +80,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -103,10 +105,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -139,6 +140,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -149,6 +151,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -161,6 +166,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -171,6 +178,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -178,7 +187,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
@@ -209,7 +226,8 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-SUBDIRS = art data help m4 po src ui
+@WITH_REGRESSION_TESTS_TRUE@tests = tests
+SUBDIRS = art data help m4 po src $(tests) ui
EXTRA_DIST = \
autogen.sh \
autotools.conf \
@@ -428,7 +446,7 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
- list='$(SUBDIRS)'; for subdir in $$list; do \
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| mkdir "$(distdir)/$$subdir" \
diff --git a/NEWS b/NEWS
@@ -1,3 +1,23 @@
+0.6.0 16 August 2004
+
+ * Added IMAP support
+ * Added SSL support for POP3 and IMAP (requires OpenSSL)
+ * Added SASL authentication support for POP3 and IMAP
+ (requires Cyrus SASL 2)
+ * Added APOP authentication support
+ * Gmail support has been fixed
+ * If there is no new mail, the icon is now hidden
+ * Now complies with the HIG 2.0
+ * Now installs a GNOME sound event
+ * The user interface has been improved
+ * The mail icon is now taken from the icon theme
+ * The command line arguments have been modified
+ * The POP3 handler now honours the LOGIN-DELAY capability
+ * Objects are now generated with GOB
+ * Some cleanups have been performed
+ * A few minor bugs have been fixed
+ * Does not depend on GNet anymore
+
0.5.0 21 July 2004
* Added Gmail support (requires libsoup)
diff --git a/README b/README
@@ -6,11 +6,12 @@ Index
0. About this document
1. About Mail Notification
- 2. Installation instructions
+ 2. Release notes
+ 3. Installation instructions
0. About this document
- $Id: README,v 1.14 2004/07/21 17:56:33 jylefort Exp $
+ $Id: README,v 1.16 2004/08/16 16:11:07 jylefort Exp $
Copyright (c) 2003, 2004 Jean-Yves Lefort.
@@ -29,12 +30,25 @@ Index
Mail Notification features include:
- - multiple mailbox support
- - mbox, MH, Maildir, Sylpheed, POP3 and Gmail support
- - automatic detection of mailbox format
- - automatic notification
- - HIG compliance
+ * multiple mailbox support
+ * mbox, MH, Maildir, Sylpheed, POP3, IMAP and Gmail
+ support
+ * SASL authentication support
+ * APOP authentication support
+ * SSL support
+ * automatic detection of mailbox format
+ * automatic notification
+ * HIG 2.0 compliance
-2. Installation instructions
+2. Release notes
+
+ Some configuration keys have been obsoleted. For the sake of
+ cleanliness, you should remove them:
+
+ $ gconftool-2 --recursive-unset \
+ /apps/mail-notification/commands/clicked \
+ /apps/mail-notification/preferences-dialog
+
+3. Installation instructions
See the INSTALL file.
diff --git a/TODO b/TODO
@@ -1 +1 @@
-- implement pop3s, imap and imaps support
+* add STARTTLS support to the IMAP backend
diff --git a/aclocal.m4 b/aclocal.m4
@@ -1731,5 +1731,7 @@ fi
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.am b/art/Makefile.am
@@ -3,11 +3,7 @@ APP_IMAGES = \
about-icon.png \
logo.png \
gmail.png \
- mail-error.png \
- mail.png \
- no-mail-error.png \
- no-mail.png \
- preferences-icon.png \
+ properties-icon.png \
unsupported.png
gnome_pixmapsdir = $(datadir)/pixmaps
diff --git a/art/Makefile.in b/art/Makefile.in
@@ -38,7 +38,8 @@ subdir = art
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/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -60,6 +61,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -84,10 +86,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -120,6 +121,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -130,6 +132,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -142,6 +147,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -152,6 +159,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -159,7 +168,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
@@ -195,11 +212,7 @@ APP_IMAGES = \
about-icon.png \
logo.png \
gmail.png \
- mail-error.png \
- mail.png \
- no-mail-error.png \
- no-mail.png \
- preferences-icon.png \
+ properties-icon.png \
unsupported.png
gnome_pixmapsdir = $(datadir)/pixmaps
diff --git a/art/logo.png b/art/logo.png
Binary files differ.
diff --git a/art/mail-error.png b/art/mail-error.png
Binary files differ.
diff --git a/art/mail.png b/art/mail.png
Binary files differ.
diff --git a/art/no-mail-error.png b/art/no-mail-error.png
Binary files differ.
diff --git a/art/no-mail.png b/art/no-mail.png
Binary files differ.
diff --git a/art/preferences-icon.png b/art/properties-icon.png
Binary files differ.
diff --git a/config.h.in b/config.h.in
@@ -6,9 +6,6 @@
/* Define to the gettext package name */
#undef GETTEXT_PACKAGE
-/* log domain */
-#undef G_LOG_DOMAIN
-
/* Define to 1 if you have the `atoi' function. */
#undef HAVE_ATOI
@@ -24,6 +21,24 @@
/* Define to 1 if you have the `exit' function. */
#undef HAVE_EXIT
+/* Define to 1 if you have the `freeaddrinfo' function. */
+#undef HAVE_FREEADDRINFO
+
+/* Define to 1 if you have the `gai_strerror' function. */
+#undef HAVE_GAI_STRERROR
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#undef HAVE_GETADDRINFO
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#undef HAVE_GETNAMEINFO
+
+/* Define to 1 if you have the `getpeername' function. */
+#undef HAVE_GETPEERNAME
+
+/* Define to 1 if you have the `getsockname' function. */
+#undef HAVE_GETSOCKNAME
+
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
@@ -36,9 +51,30 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
+/* Define to 1 if you have the `memcpy' function. */
+#undef HAVE_MEMCPY
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `read' function. */
+#undef HAVE_READ
+
+/* Define to 1 if you have the `signal' function. */
+#undef HAVE_SIGNAL
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `sleep' function. */
+#undef HAVE_SLEEP
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
/* Define to 1 if you have the `sscanf' function. */
#undef HAVE_SSCANF
@@ -72,6 +108,9 @@
/* Define to 1 if you have the `strncmp' function. */
#undef HAVE_STRNCMP
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
@@ -81,6 +120,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `write' function. */
+#undef HAVE_WRITE
+
/* Name of package */
#undef PACKAGE
@@ -108,6 +150,12 @@
/* Define to 1 if Gmail support is enabled */
#undef WITH_GMAIL
+/* Define to 1 if IMAP support is enabled */
+#undef WITH_IMAP
+
+/* Define to 1 if IPv6 support is enabled */
+#undef WITH_IPV6
+
/* Define to 1 if Maildir support is enabled */
#undef WITH_MAILDIR
@@ -120,6 +168,12 @@
/* Define to 1 if POP3 support is enabled */
#undef WITH_POP3
+/* Define to 1 if SASL support is enabled */
+#undef WITH_SASL
+
+/* Define to 1 if SSL support is enabled */
+#undef WITH_SSL
+
/* Define to 1 if Sylpheed support is enabled */
#undef WITH_SYLPHEED
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.5.0.
+# Generated by GNU Autoconf 2.59 for mail-notification 0.6.0.
#
# 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.5.0'
-PACKAGE_STRING='mail-notification 0.5.0'
+PACKAGE_VERSION='0.6.0'
+PACKAGE_STRING='mail-notification 0.6.0'
PACKAGE_BUGREPORT='jylefort@brutele.be'
ac_unique_file="src/mn-main.c"
@@ -311,7 +311,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS G_ASSERTIONS WARN_CFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GETTEXT_PACKAGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP USE_NLS MSGFMT GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS INTLTOOL_DESKTOP_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_KEYS_RULE INTLTOOL_PROP_RULE INTLTOOL_OAF_RULE INTLTOOL_PONG_RULE INTLTOOL_SERVER_RULE INTLTOOL_SHEET_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_UI_RULE INTLTOOL_XAM_RULE INTLTOOL_KBD_RULE INTLTOOL_XML_RULE INTLTOOL_CAVES_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_THEME_RULE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE INTLTOOL_PERL PKG_CONFIG GTK_CFLAGS GTK_LIBS GNOME_CFLAGS GNOME_LIBS GCONF_SCHEMA_CONFIG_SOURCE GCONF_SCHEMA_FILE_DIR GCONF_SCHEMAS_INSTALL_TRUE GCONF_SCHEMAS_INSTALL_FALSE GCONFTOOL GNET_CFLAGS GNET_LIBS SOUP_CFLAGS SOUP_LIBS WITH_MBOX_TRUE WITH_MBOX_FALSE WITH_MH_TRUE WITH_MH_FALSE WITH_MAILDIR_TRUE WITH_MAILDIR_FALSE WITH_POP3_TRUE WITH_POP3_FALSE WITH_SYLPHEED_TRUE WITH_SYLPHEED_FALSE WITH_GMAIL_TRUE WITH_GMAIL_FALSE HAVE_SOUP_TRUE HAVE_SOUP_FALSE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS G_ASSERTIONS WARN_CFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GETTEXT_PACKAGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP USE_NLS MSGFMT GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS INTLTOOL_DESKTOP_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_KEYS_RULE INTLTOOL_PROP_RULE INTLTOOL_OAF_RULE INTLTOOL_PONG_RULE INTLTOOL_SERVER_RULE INTLTOOL_SHEET_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_UI_RULE INTLTOOL_XAM_RULE INTLTOOL_KBD_RULE INTLTOOL_XML_RULE INTLTOOL_CAVES_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_THEME_RULE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE INTLTOOL_PERL PKG_CONFIG GTK_CFLAGS GTK_LIBS GNOME_CFLAGS GNOME_LIBS GCONF_SCHEMA_CONFIG_SOURCE GCONF_SCHEMA_FILE_DIR GCONF_SCHEMAS_INSTALL_TRUE GCONF_SCHEMAS_INSTALL_FALSE GCONFTOOL OPENSSL_CFLAGS OPENSSL_LIBS SASL_CFLAGS SASL_LIBS SOUP_CFLAGS SOUP_LIBS ORBIT_IDL LIBBONOBO_IDL BONOBO_ACTIVATION_IDL GOB2 WITH_MBOX_TRUE WITH_MBOX_FALSE WITH_MH_TRUE WITH_MH_FALSE WITH_MAILDIR_TRUE WITH_MAILDIR_FALSE WITH_POP3_TRUE WITH_POP3_FALSE WITH_IMAP_TRUE WITH_IMAP_FALSE WITH_POP3_OR_IMAP_TRUE WITH_POP3_OR_IMAP_FALSE WITH_SSL_TRUE WITH_SSL_FALSE WITH_SASL_TRUE WITH_SASL_FALSE WITH_SYLPHEED_TRUE WITH_SYLPHEED_FALSE WITH_GMAIL_TRUE WITH_GMAIL_FALSE HAVE_SOUP_TRUE HAVE_SOUP_FALSE WITH_REGRESSION_TESTS_TRUE WITH_REGRESSION_TESTS_FALSE LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -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.5.0 to adapt to many kinds of systems.
+\`configure' configures mail-notification 0.6.0 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.5.0:";;
+ short | recursive ) echo "Configuration of mail-notification 0.6.0:";;
esac
cat <<\_ACEOF
@@ -853,11 +853,17 @@ Optional Features:
--disable-mh disable MH support
--disable-maildir disable Maildir support
--disable-pop3 disable POP3 support
+ --disable-imap disable IMAP support
+ --disable-ssl disable SSL support
+ --disable-sasl disable SASL authentication support
--disable-sylpheed disable Sylpheed support
--disable-gmail disable Gmail support
+ --disable-ipv6 disable IPv6 support
--disable-assertions disable GLib assertions (not recommended)
--enable-compile-warnings=no|yes|error
enable compiler warnings [no]
+ --enable-regression-tests
+ build and run regression tests [no]
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--disable-dependency-tracking speeds up one-time build
@@ -980,7 +986,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-mail-notification configure 0.5.0
+mail-notification configure 0.6.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -994,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.5.0, which was
+It was created by mail-notification $as_me 0.6.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1388,6 +1394,45 @@ else
enable_pop3=yes
fi;
+# Check whether --enable-imap or --disable-imap was given.
+if test "${enable_imap+set}" = set; then
+ enableval="$enable_imap"
+ case "$enableval" in
+ yes|no) enable_imap=$enableval ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-imap" >&5
+echo "$as_me: error: bad value $enableval for --enable-imap" >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ enable_imap=yes
+fi;
+
+# Check whether --enable-ssl or --disable-ssl was given.
+if test "${enable_ssl+set}" = set; then
+ enableval="$enable_ssl"
+ case "$enableval" in
+ yes|no) enable_ssl=$enableval ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-ssl" >&5
+echo "$as_me: error: bad value $enableval for --enable-ssl" >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ enable_ssl=yes
+fi;
+
+# Check whether --enable-sasl or --disable-sasl was given.
+if test "${enable_sasl+set}" = set; then
+ enableval="$enable_sasl"
+ case "$enableval" in
+ yes|no) enable_sasl=$enableval ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-sasl" >&5
+echo "$as_me: error: bad value $enableval for --enable-sasl" >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ enable_sasl=yes
+fi;
+
# Check whether --enable-sylpheed or --disable-sylpheed was given.
if test "${enable_sylpheed+set}" = set; then
enableval="$enable_sylpheed"
@@ -1414,6 +1459,19 @@ else
enable_gmail=yes
fi;
+# Check whether --enable-ipv6 or --disable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then
+ enableval="$enable_ipv6"
+ case "$enableval" in
+ yes|no) enable_ipv6=$enableval ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-ipv6" >&5
+echo "$as_me: error: bad value $enableval for --enable-ipv6" >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ enable_ipv6=yes
+fi;
+
# Check whether --enable-assertions or --disable-assertions was given.
if test "${enable_assertions+set}" = set; then
enableval="$enable_assertions"
@@ -1456,6 +1514,19 @@ fi
+# Check whether --enable-regression-tests or --disable-regression-tests was given.
+if test "${enable_regression_tests+set}" = set; then
+ enableval="$enable_regression_tests"
+ case "$enableval" in
+ yes|no) enable_regression_tests=$enableval ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-regression-tests" >&5
+echo "$as_me: error: bad value $enableval for --enable-regression-tests" >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ enable_regression_tests=no
+fi;
+
### initialization
am__api_version="1.8"
@@ -1757,7 +1828,7 @@ fi
# Define the identity of the package.
PACKAGE='mail-notification'
- VERSION='0.5.0'
+ VERSION='0.6.0'
cat >>confdefs.h <<_ACEOF
@@ -6233,12 +6304,15 @@ rm -f conftest*
fi
+# the order of these tests matters
+
+
-for ac_header in errno.h stdarg.h stdio.h stdlib.h string.h
+for ac_header in errno.h signal.h stdarg.h stdio.h stdlib.h string.h sys/types.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -6391,19 +6465,9 @@ fi
done
-
-
-
-
-
-
-
-for ac_func in atoi exit sscanf strchr strcmp strlen strncmp
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for sys/uio.h" >&5
+echo $ECHO_N "checking for sys/uio.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_uio_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -6412,54 +6476,13 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+#include <sys/types.h>
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
+#include <sys/uio.h>
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
@@ -6473,105 +6496,468 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
+ ac_cv_header_sys_uio_h=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-eval "$as_ac_var=no"
+ac_cv_header_sys_uio_h=no
fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_uio_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_uio_h" >&6
+if test $ac_cv_header_sys_uio_h = yes; then
+ :
else
- { { echo "$as_me:$LINENO: error: library function not found" >&5
-echo "$as_me: error: library function not found" >&2;}
+ { { echo "$as_me:$LINENO: error: header not found" >&5
+echo "$as_me: error: header not found" >&2;}
{ (exit 1); exit 1; }; }
fi
-done
-### build dependencies
-
-# Check whether --enable-gtktest or --disable-gtktest was given.
-if test "${enable_gtktest+set}" = set; then
- enableval="$enable_gtktest"
+echo "$as_me:$LINENO: checking for sys/socket.h" >&5
+echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_socket_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_sys_socket_h=yes
else
- enable_gtktest=yes
-fi;
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- pkg_config_args=gtk+-2.0
- for module in .
- do
- case "$module" in
- gthread)
- pkg_config_args="$pkg_config_args gthread-2.0"
- ;;
- esac
- done
+ac_cv_header_sys_socket_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6
+if test $ac_cv_header_sys_socket_h = yes; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: header not found" >&5
+echo "$as_me: error: header not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
- no_gtk=""
- # 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
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+echo "$as_me:$LINENO: checking for netdb.h" >&5
+echo $ECHO_N "checking for netdb.h... $ECHO_C" >&6
+if test "${ac_cv_header_netdb_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+#include <netdb.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_netdb_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test -n "$PKG_CONFIG"; then
- echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6
+ac_cv_header_netdb_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_netdb_h" >&5
+echo "${ECHO_T}$ac_cv_header_netdb_h" >&6
+if test $ac_cv_header_netdb_h = yes; then
+ :
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { { echo "$as_me:$LINENO: error: header not found" >&5
+echo "$as_me: error: header not found" >&2;}
+ { (exit 1); exit 1; }; }
fi
- if test x$PKG_CONFIG != xno ; then
- if pkg-config --atleast-pkgconfig-version 0.7 ; then
- :
- else
- echo "*** pkg-config too old; version 0.7 or better required."
+echo "$as_me:$LINENO: checking for netinet/in.h" >&5
+echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6
+if test "${ac_cv_header_netinet_in_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_netinet_in_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_netinet_in_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
+echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6
+if test $ac_cv_header_netinet_in_h = yes; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: header not found" >&5
+echo "$as_me: error: header not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
+echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6
+if test "${ac_cv_header_arpa_inet_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include <arpa/inet.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_arpa_inet_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_arpa_inet_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
+echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6
+if test $ac_cv_header_arpa_inet_h = yes; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: header not found" >&5
+echo "$as_me: error: header not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in atoi exit freeaddrinfo gai_strerror getaddrinfo getnameinfo getpeername getsockname memcpy memset read signal sleep socket sscanf strchr strcmp strlen strncmp strstr write
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+ { { echo "$as_me:$LINENO: error: library function not found" >&5
+echo "$as_me: error: library function not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+done
+
+
+### build dependencies
+
+# Check whether --enable-gtktest or --disable-gtktest was given.
+if test "${enable_gtktest+set}" = set; then
+ enableval="$enable_gtktest"
+
+else
+ enable_gtktest=yes
+fi;
+
+ pkg_config_args=gtk+-2.0
+ for module in .
+ do
+ case "$module" in
+ gthread)
+ pkg_config_args="$pkg_config_args gthread-2.0"
+ ;;
+ esac
+ done
+
+ no_gtk=""
+
+ # 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
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+ if test x$PKG_CONFIG != xno ; then
+ if pkg-config --atleast-pkgconfig-version 0.7 ; then
+ :
+ else
+ echo "*** pkg-config too old; version 0.7 or better required."
no_gtk=yes
PKG_CONFIG=no
fi
@@ -6866,14 +7252,14 @@ 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 libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0" >&5
-echo $ECHO_N "checking for libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0... $ECHO_C" >&6
+ 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 "libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0"; then
+ 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
- GNOME_CFLAGS=`$PKG_CONFIG --cflags "libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0"`
- GNOME_LIBS=`$PKG_CONFIG --libs "libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0"`
+ 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
@@ -7003,87 +7389,174 @@ echo "$as_me: error: unable to find the gconftool-2 program" >&2;}
{ (exit 1); exit 1; }; }
fi
-if test $enable_pop3 = yes; then
- found=no
-GNET_CFLAGS=""
-GNET_LIBS=""
+if test $enable_pop3 = no && test $enable_imap = no; then
+ if test $enable_ssl = yes; then
+ { echo "$as_me:$LINENO: POP3 and IMAP support disabled: forcing --disable-ssl" >&5
+echo "$as_me: POP3 and IMAP support disabled: forcing --disable-ssl" >&6;}
+ enable_ssl=no
+ disable_ssl_reason="(not needed)"
+ fi
+ if test $enable_sasl = yes; then
+ { echo "$as_me:$LINENO: POP3 and IMAP support disabled: forcing --disable-sasl" >&5
+echo "$as_me: POP3 and IMAP support disabled: forcing --disable-sasl" >&6;}
+ enable_sasl=no
+ disable_sasl_reason="(not needed)"
+ fi
+fi
-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
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $enable_ssl = yes; then
+ OPENSSL_CFLAGS=""
+OPENSSL_LIBS="-lssl -lcrypto"
+
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
+LIBS="$LIBS $OPENSSL_LIBS"
+
+# the OPENSSL_VERSION_NUMBER format we use appeared in 0.9.5b
+openssl_min_version=0.9.5b
+
+echo "$as_me:$LINENO: checking for OpenSSL - version >= $openssl_min_version" >&5
+echo $ECHO_N "checking for OpenSSL - version >= $openssl_min_version... $ECHO_C" >&6
+if test "$cross_compiling" = yes; then
+ found=yes
else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
+ cat >conftest.$ac_ext <<_ACEOF
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
- ;;
-esac
+#include <openssl/opensslv.h>
+
+int main() {
+ int n;
+ char cpatch = 0;
+ int major, minor, fix, patch = 0;
+ int openssl_major, openssl_minor, openssl_fix, openssl_patch;
+
+ n = sscanf("$openssl_min_version", "%d.%d.%d%c", &major, &minor, &fix, &cpatch);
+ if (n < 3)
+ exit(1); /* bad version string */
+ if (cpatch)
+ patch = cpatch - 96; /* letter -> number */
+
+ if (OPENSSL_VERSION_NUMBER <
+ (major << 28) + (minor << 20) + (fix << 12) + (patch << 4))
+ exit(2); /* version too old */
+
+ exit(0);
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ found=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+found=no
fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $found" >&5
+echo "${ECHO_T}$found" >&6
-if test -n "$PKG_CONFIG"; then
- echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+
+if test $found = yes; then
+ :
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ OPENSSL_CFLAGS=""
+ OPENSSL_LIBS=""
+ { echo "$as_me:$LINENO: WARNING: unable to find the OpenSSL library: forcing --disable-ssl" >&5
+echo "$as_me: WARNING: unable to find the OpenSSL library: forcing --disable-ssl" >&2;}; enable_ssl=no; disable_ssl_reason="(OpenSSL not found)"
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;}
+if test $enable_sasl = yes; then
+ SASL_CFLAGS=""
+SASL_LIBS="-lsasl2"
+
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $SASL_CFLAGS"
+LIBS="$LIBS $SASL_LIBS"
+
+sasl2_min_version=2.0
+
+echo "$as_me:$LINENO: checking for Cyrus SASL - version >= $sasl2_min_version" >&5
+echo $ECHO_N "checking for Cyrus SASL - version >= $sasl2_min_version... $ECHO_C" >&6
+if test "$cross_compiling" = yes; then
+ found=yes
else
- PKG_CONFIG_MIN_VERSION=0.9.0
+ cat >conftest.$ac_ext <<_ACEOF
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
- echo "$as_me:$LINENO: checking for gnet-2.0" >&5
-echo $ECHO_N "checking for gnet-2.0... $ECHO_C" >&6
+#include <sasl/sasl.h>
- if $PKG_CONFIG --exists "gnet-2.0"; then
- found=yes
+int main() {
+ int major, minor, step = 0, patch = 0;
+ int sasl_major, sasl_minor, sasl_step, sasl_patch;
- GNET_CFLAGS=`$PKG_CONFIG --cflags "gnet-2.0"`
- GNET_LIBS=`$PKG_CONFIG --libs "gnet-2.0"`
+ if (sscanf("$sasl2_min_version", "%d.%d.%d.%d", &major, &minor, &step, &patch) < 2)
+ exit(1); /* bad version string */
- 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
+ sasl_version_info(0, 0, &sasl_major, &sasl_minor, &sasl_step, &sasl_patch);
+ if ((sasl_major << 24) + (sasl_minor << 16) + (sasl_step << 8) + sasl_patch
+ < (major << 24) + (minor << 16) + (step << 8) + patch)
+ exit(2); /* version too old */
-if test $found = no; then
- { echo "$as_me:$LINENO: WARNING: unable to find the GNet library: forcing --disable-pop3" >&5
-echo "$as_me: WARNING: unable to find the GNet library: forcing --disable-pop3" >&2;}; enable_pop3=no; disable_pop3_reason="(GNet not found)"
+ exit(0);
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ found=yes
else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+found=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $found" >&5
+echo "${ECHO_T}$found" >&6
+
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+
+if test $found = yes; then
:
+else
+ SASL_CFLAGS=""
+ SASL_LIBS=""
+ { echo "$as_me:$LINENO: WARNING: unable to find the Cyrus SASL library: forcing --disable-sasl" >&5
+echo "$as_me: WARNING: unable to find the Cyrus SASL library: forcing --disable-sasl" >&2;}; enable_sasl=no; disable_sasl_reason="(Cyrus SASL not found)"
fi
@@ -7178,11 +7651,60 @@ fi
fi
+ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
+
+
+LIBBONOBO_IDL="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
+
+
+BONOBO_ACTIVATION_IDL="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
+
+
+# Extract the first word of "gob2", so it can be a program name with args.
+set dummy gob2; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GOB2+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $GOB2 in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GOB2="$GOB2" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GOB2="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ ;;
+esac
+fi
+GOB2=$ac_cv_path_GOB2
+
+if test -n "$GOB2"; then
+ echo "$as_me:$LINENO: result: $GOB2" >&5
+echo "${ECHO_T}$GOB2" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
### Automake conditionals
-if test $enable_mbox != no; then
+if test $enable_mbox = yes; then
WITH_MBOX_TRUE=
WITH_MBOX_FALSE='#'
else
@@ -7192,7 +7714,7 @@ fi
-if test $enable_mh != no; then
+if test $enable_mh = yes; then
WITH_MH_TRUE=
WITH_MH_FALSE='#'
else
@@ -7202,7 +7724,7 @@ fi
-if test $enable_maildir != no; then
+if test $enable_maildir = yes; then
WITH_MAILDIR_TRUE=
WITH_MAILDIR_FALSE='#'
else
@@ -7212,7 +7734,7 @@ fi
-if test $enable_pop3 != no; then
+if test $enable_pop3 = yes; then
WITH_POP3_TRUE=
WITH_POP3_FALSE='#'
else
@@ -7222,7 +7744,47 @@ fi
-if test $enable_sylpheed != no; then
+if test $enable_imap = yes; then
+ WITH_IMAP_TRUE=
+ WITH_IMAP_FALSE='#'
+else
+ WITH_IMAP_TRUE='#'
+ WITH_IMAP_FALSE=
+fi
+
+
+
+if test $enable_pop3 = yes || test $enable_imap = yes; then
+ WITH_POP3_OR_IMAP_TRUE=
+ WITH_POP3_OR_IMAP_FALSE='#'
+else
+ WITH_POP3_OR_IMAP_TRUE='#'
+ WITH_POP3_OR_IMAP_FALSE=
+fi
+
+
+
+if test $enable_ssl = yes; then
+ WITH_SSL_TRUE=
+ WITH_SSL_FALSE='#'
+else
+ WITH_SSL_TRUE='#'
+ WITH_SSL_FALSE=
+fi
+
+
+
+if test $enable_sasl = yes; then
+ WITH_SASL_TRUE=
+ WITH_SASL_FALSE='#'
+else
+ WITH_SASL_TRUE='#'
+ WITH_SASL_FALSE=
+fi
+
+
+
+if test $enable_sylpheed = yes; then
WITH_SYLPHEED_TRUE=
WITH_SYLPHEED_FALSE='#'
else
@@ -7232,7 +7794,7 @@ fi
-if test $enable_gmail != no; then
+if test $enable_gmail = yes; then
WITH_GMAIL_TRUE=
WITH_GMAIL_FALSE='#'
else
@@ -7242,7 +7804,7 @@ fi
-if test $have_soup != no; then
+if test $have_soup = yes; then
HAVE_SOUP_TRUE=
HAVE_SOUP_FALSE='#'
else
@@ -7251,13 +7813,17 @@ else
fi
-### config.h definitions
+if test $enable_regression_tests = yes; then
+ WITH_REGRESSION_TESTS_TRUE=
+ WITH_REGRESSION_TESTS_FALSE='#'
+else
+ WITH_REGRESSION_TESTS_TRUE='#'
+ WITH_REGRESSION_TESTS_FALSE=
+fi
-cat >>confdefs.h <<\_ACEOF
-#define G_LOG_DOMAIN "mail-notification"
-_ACEOF
+### config.h definitions
if test $enable_mbox = yes; then
@@ -7287,6 +7853,27 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
+if test $enable_imap = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WITH_IMAP 1
+_ACEOF
+
+fi
+if test $enable_ssl = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WITH_SSL 1
+_ACEOF
+
+fi
+if test $enable_sasl = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WITH_SASL 1
+_ACEOF
+
+fi
if test $enable_sylpheed = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -7301,10 +7888,17 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
+if test $enable_ipv6 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WITH_IPV6 1
+_ACEOF
+
+fi
### output
- ac_config_files="$ac_config_files Makefile art/Makefile data/Makefile help/Makefile help/C/Makefile m4/Makefile po/Makefile.in src/Makefile ui/Makefile"
+ ac_config_files="$ac_config_files Makefile art/Makefile data/Makefile help/Makefile help/C/Makefile m4/Makefile po/Makefile.in src/Makefile tests/Makefile ui/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -7467,6 +8061,34 @@ echo "$as_me: error: conditional \"WITH_POP3\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${WITH_IMAP_TRUE}" && test -z "${WITH_IMAP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WITH_IMAP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WITH_IMAP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${WITH_POP3_OR_IMAP_TRUE}" && test -z "${WITH_POP3_OR_IMAP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WITH_POP3_OR_IMAP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WITH_POP3_OR_IMAP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${WITH_SSL_TRUE}" && test -z "${WITH_SSL_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WITH_SSL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WITH_SSL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${WITH_SASL_TRUE}" && test -z "${WITH_SASL_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WITH_SASL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WITH_SASL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${WITH_SYLPHEED_TRUE}" && test -z "${WITH_SYLPHEED_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"WITH_SYLPHEED\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -7488,6 +8110,13 @@ echo "$as_me: error: conditional \"HAVE_SOUP\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${WITH_REGRESSION_TESTS_TRUE}" && test -z "${WITH_REGRESSION_TESTS_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WITH_REGRESSION_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WITH_REGRESSION_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
@@ -7759,7 +8388,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by mail-notification $as_me 0.5.0, which was
+This file was extended by mail-notification $as_me 0.6.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7822,7 +8451,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-mail-notification config.status 0.5.0
+mail-notification config.status 0.6.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -7942,6 +8571,7 @@ do
"m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
"po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"ui/Makefile" ) CONFIG_FILES="$CONFIG_FILES ui/Makefile" ;;
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
@@ -8121,10 +8751,16 @@ s,@GCONF_SCHEMA_FILE_DIR@,$GCONF_SCHEMA_FILE_DIR,;t t
s,@GCONF_SCHEMAS_INSTALL_TRUE@,$GCONF_SCHEMAS_INSTALL_TRUE,;t t
s,@GCONF_SCHEMAS_INSTALL_FALSE@,$GCONF_SCHEMAS_INSTALL_FALSE,;t t
s,@GCONFTOOL@,$GCONFTOOL,;t t
-s,@GNET_CFLAGS@,$GNET_CFLAGS,;t t
-s,@GNET_LIBS@,$GNET_LIBS,;t t
+s,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t
+s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t
+s,@SASL_CFLAGS@,$SASL_CFLAGS,;t t
+s,@SASL_LIBS@,$SASL_LIBS,;t t
s,@SOUP_CFLAGS@,$SOUP_CFLAGS,;t t
s,@SOUP_LIBS@,$SOUP_LIBS,;t t
+s,@ORBIT_IDL@,$ORBIT_IDL,;t t
+s,@LIBBONOBO_IDL@,$LIBBONOBO_IDL,;t t
+s,@BONOBO_ACTIVATION_IDL@,$BONOBO_ACTIVATION_IDL,;t t
+s,@GOB2@,$GOB2,;t t
s,@WITH_MBOX_TRUE@,$WITH_MBOX_TRUE,;t t
s,@WITH_MBOX_FALSE@,$WITH_MBOX_FALSE,;t t
s,@WITH_MH_TRUE@,$WITH_MH_TRUE,;t t
@@ -8133,12 +8769,22 @@ s,@WITH_MAILDIR_TRUE@,$WITH_MAILDIR_TRUE,;t t
s,@WITH_MAILDIR_FALSE@,$WITH_MAILDIR_FALSE,;t t
s,@WITH_POP3_TRUE@,$WITH_POP3_TRUE,;t t
s,@WITH_POP3_FALSE@,$WITH_POP3_FALSE,;t t
+s,@WITH_IMAP_TRUE@,$WITH_IMAP_TRUE,;t t
+s,@WITH_IMAP_FALSE@,$WITH_IMAP_FALSE,;t t
+s,@WITH_POP3_OR_IMAP_TRUE@,$WITH_POP3_OR_IMAP_TRUE,;t t
+s,@WITH_POP3_OR_IMAP_FALSE@,$WITH_POP3_OR_IMAP_FALSE,;t t
+s,@WITH_SSL_TRUE@,$WITH_SSL_TRUE,;t t
+s,@WITH_SSL_FALSE@,$WITH_SSL_FALSE,;t t
+s,@WITH_SASL_TRUE@,$WITH_SASL_TRUE,;t t
+s,@WITH_SASL_FALSE@,$WITH_SASL_FALSE,;t t
s,@WITH_SYLPHEED_TRUE@,$WITH_SYLPHEED_TRUE,;t t
s,@WITH_SYLPHEED_FALSE@,$WITH_SYLPHEED_FALSE,;t t
s,@WITH_GMAIL_TRUE@,$WITH_GMAIL_TRUE,;t t
s,@WITH_GMAIL_FALSE@,$WITH_GMAIL_FALSE,;t t
s,@HAVE_SOUP_TRUE@,$HAVE_SOUP_TRUE,;t t
s,@HAVE_SOUP_FALSE@,$HAVE_SOUP_FALSE,;t t
+s,@WITH_REGRESSION_TESTS_TRUE@,$WITH_REGRESSION_TESTS_TRUE,;t t
+s,@WITH_REGRESSION_TESTS_FALSE@,$WITH_REGRESSION_TESTS_FALSE,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
@@ -8918,6 +9564,10 @@ Features
--enable-mh $enable_mh
--enable-maildir $enable_maildir
--enable-pop3 $enable_pop3 $disable_pop3_reason
+ --enable-imap $enable_imap $disable_imap_reason
+ --enable-ssl $enable_ssl $disable_ssl_reason
+ --enable-sasl $enable_sasl $disable_sasl_reason
--enable-sylpheed $enable_sylpheed
--enable-gmail $enable_gmail $disable_gmail_reason
+ --enable-ipv6 $enable_ipv6
EOF
diff --git a/configure.ac b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(mail-notification, 0.5.0, jylefort@brutele.be)
+AC_INIT(mail-notification, 0.6.0, jylefort@brutele.be)
AC_CONFIG_SRCDIR(src/mn-main.c)
AC_PREREQ(2.59)
@@ -33,6 +33,27 @@ AC_HELP_STRING([--disable-pop3], [disable POP3 support]),
*) AC_MSG_ERROR([bad value $enableval for --enable-pop3]) ;;
esac], [enable_pop3=yes])
+AC_ARG_ENABLE(imap,
+AC_HELP_STRING([--disable-imap], [disable IMAP support]),
+[case "$enableval" in
+ yes|no) enable_imap=$enableval ;;
+ *) AC_MSG_ERROR([bad value $enableval for --enable-imap]) ;;
+esac], [enable_imap=yes])
+
+AC_ARG_ENABLE(ssl,
+AC_HELP_STRING([--disable-ssl], [disable SSL support]),
+[case "$enableval" in
+ yes|no) enable_ssl=$enableval ;;
+ *) AC_MSG_ERROR([bad value $enableval for --enable-ssl]) ;;
+esac], [enable_ssl=yes])
+
+AC_ARG_ENABLE(sasl,
+AC_HELP_STRING([--disable-sasl], [disable SASL authentication support]),
+[case "$enableval" in
+ yes|no) enable_sasl=$enableval ;;
+ *) AC_MSG_ERROR([bad value $enableval for --enable-sasl]) ;;
+esac], [enable_sasl=yes])
+
AC_ARG_ENABLE(sylpheed,
AC_HELP_STRING([--disable-sylpheed], [disable Sylpheed support]),
[case "$enableval" in
@@ -47,9 +68,23 @@ AC_HELP_STRING([--disable-gmail], [disable Gmail support]),
*) AC_MSG_ERROR([bad value $enableval for --enable-gmail]) ;;
esac], [enable_gmail=yes])
+AC_ARG_ENABLE(ipv6,
+AC_HELP_STRING([--disable-ipv6], [disable IPv6 support]),
+[case "$enableval" in
+ yes|no) enable_ipv6=$enableval ;;
+ *) AC_MSG_ERROR([bad value $enableval for --enable-ipv6]) ;;
+esac], [enable_ipv6=yes])
+
AC_ARG_G_ASSERTIONS
AC_ARG_COMPILE_WARNINGS
+AC_ARG_ENABLE(regression-tests,
+AC_HELP_STRING([--enable-regression-tests], [build and run regression tests [[no]]]),
+[case "$enableval" in
+ yes|no) enable_regression_tests=$enableval ;;
+ *) AC_MSG_ERROR([bad value $enableval for --enable-regression-tests]) ;;
+esac], [enable_regression_tests=no])
+
### initialization
AM_INIT_AUTOMAKE(foreign)
@@ -72,14 +107,38 @@ AC_PROG_INTLTOOL
AC_PROG_CC
AC_SYS_LARGEFILE
-AC_CHECK_HEADERS(errno.h stdarg.h stdio.h stdlib.h string.h,, [AC_MSG_ERROR([header not found])])
-AC_CHECK_FUNCS(atoi exit sscanf strchr strcmp strlen strncmp,, [AC_MSG_ERROR([library function not found])])
+# the order of these tests matters
+AC_CHECK_HEADERS(errno.h signal.h stdarg.h stdio.h stdlib.h string.h sys/types.h,, [AC_MSG_ERROR([header not found])])
+AC_CHECK_HEADER(sys/uio.h,, [AC_MSG_ERROR([header not found])],
+[#include <sys/types.h>])
+AC_CHECK_HEADER(sys/socket.h,, [AC_MSG_ERROR([header not found])],
+[#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>])
+AC_CHECK_HEADER(netdb.h,, [AC_MSG_ERROR([header not found])],
+[#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>])
+AC_CHECK_HEADER(netinet/in.h,, [AC_MSG_ERROR([header not found])],
+[#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>])
+AC_CHECK_HEADER(arpa/inet.h,, [AC_MSG_ERROR([header not found])],
+[#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>])
+
+AC_CHECK_FUNCS(atoi exit freeaddrinfo gai_strerror getaddrinfo getnameinfo getpeername getsockname memcpy memset read signal sleep socket sscanf strchr strcmp strlen strncmp strstr write,, [AC_MSG_ERROR([library function not found])])
### build dependencies
AM_PATH_GTK_2_0(2.4.0,, [AC_MSG_ERROR([unable to find the GTK+ library])])
-AM_PATH_PKG(GNOME, [libgnomeui-2.0 gnome-vfs-2.0 libglade-2.0 eel-2.0],, [AC_MSG_ERROR([unable to find the GNOME libraries])])
+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])])
AC_SUBST(GNOME_CFLAGS)
AC_SUBST(GNOME_LIBS)
@@ -90,8 +149,25 @@ if test -z "$GCONFTOOL"; then
AC_MSG_ERROR([unable to find the gconftool-2 program])
fi
-if test $enable_pop3 = yes; then
- AM_PATH_PKG(GNET, gnet-2.0,, [AC_MSG_WARN([unable to find the GNet library: forcing --disable-pop3]); enable_pop3=no; disable_pop3_reason="(GNet not found)"])
+if test $enable_pop3 = no && test $enable_imap = no; then
+ if test $enable_ssl = yes; then
+ AC_MSG_NOTICE([POP3 and IMAP support disabled: forcing --disable-ssl])
+ enable_ssl=no
+ disable_ssl_reason="(not needed)"
+ fi
+ if test $enable_sasl = yes; then
+ AC_MSG_NOTICE([POP3 and IMAP support disabled: forcing --disable-sasl])
+ enable_sasl=no
+ disable_sasl_reason="(not needed)"
+ fi
+fi
+
+if test $enable_ssl = yes; then
+ AM_PATH_OPENSSL(,, [AC_MSG_WARN([unable to find the OpenSSL library: forcing --disable-ssl]); enable_ssl=no; disable_ssl_reason="(OpenSSL not found)"])
+fi
+
+if test $enable_sasl = yes; then
+ AM_PATH_SASL2(,, [AC_MSG_WARN([unable to find the Cyrus SASL library: forcing --disable-sasl]); enable_sasl=no; disable_sasl_reason="(Cyrus SASL not found)"])
fi
have_soup=no
@@ -99,20 +175,34 @@ 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)"])
fi
+ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
+AC_SUBST(ORBIT_IDL)
+
+LIBBONOBO_IDL="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
+AC_SUBST(LIBBONOBO_IDL)
+
+BONOBO_ACTIVATION_IDL="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
+AC_SUBST(BONOBO_ACTIVATION_IDL)
+
+AC_PATH_PROG(GOB2, gob2)
+
### Automake conditionals
-AM_CONDITIONAL(WITH_MBOX, [test $enable_mbox != no])
-AM_CONDITIONAL(WITH_MH, [test $enable_mh != no])
-AM_CONDITIONAL(WITH_MAILDIR, [test $enable_maildir != no])
-AM_CONDITIONAL(WITH_POP3, [test $enable_pop3 != no])
-AM_CONDITIONAL(WITH_SYLPHEED, [test $enable_sylpheed != no])
-AM_CONDITIONAL(WITH_GMAIL, [test $enable_gmail != no])
-AM_CONDITIONAL(HAVE_SOUP, [test $have_soup != no])
+AM_CONDITIONAL(WITH_MBOX, [test $enable_mbox = yes])
+AM_CONDITIONAL(WITH_MH, [test $enable_mh = yes])
+AM_CONDITIONAL(WITH_MAILDIR, [test $enable_maildir = yes])
+AM_CONDITIONAL(WITH_POP3, [test $enable_pop3 = yes])
+AM_CONDITIONAL(WITH_IMAP, [test $enable_imap = yes])
+AM_CONDITIONAL(WITH_POP3_OR_IMAP, [test $enable_pop3 = yes || test $enable_imap = yes])
+AM_CONDITIONAL(WITH_SSL, [test $enable_ssl = yes])
+AM_CONDITIONAL(WITH_SASL, [test $enable_sasl = yes])
+AM_CONDITIONAL(WITH_SYLPHEED, [test $enable_sylpheed = yes])
+AM_CONDITIONAL(WITH_GMAIL, [test $enable_gmail = yes])
+AM_CONDITIONAL(HAVE_SOUP, [test $have_soup = yes])
+AM_CONDITIONAL(WITH_REGRESSION_TESTS, [test $enable_regression_tests = yes])
### config.h definitions
-AC_DEFINE(G_LOG_DOMAIN, ["AC_PACKAGE_NAME"], [log domain])
-
if test $enable_mbox = yes; then
AC_DEFINE(WITH_MBOX, 1, [Define to 1 if mbox support is enabled])
fi
@@ -125,12 +215,24 @@ fi
if test $enable_pop3 = yes; then
AC_DEFINE(WITH_POP3, 1, [Define to 1 if POP3 support is enabled])
fi
+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])
+fi
+if test $enable_sasl = yes; then
+ AC_DEFINE(WITH_SASL, 1, [Define to 1 if SASL support is enabled])
+fi
if test $enable_sylpheed = yes; then
AC_DEFINE(WITH_SYLPHEED, 1, [Define to 1 if Sylpheed support is enabled])
fi
if test $enable_gmail = yes; then
AC_DEFINE(WITH_GMAIL, 1, [Define to 1 if Gmail support is enabled])
fi
+if test $enable_ipv6 = yes; then
+ AC_DEFINE(WITH_IPV6, 1, [Define to 1 if IPv6 support is enabled])
+fi
### output
@@ -142,6 +244,7 @@ AC_CONFIG_FILES(Makefile
m4/Makefile
po/Makefile.in
src/Makefile
+ tests/Makefile
ui/Makefile)
AC_OUTPUT
@@ -166,6 +269,10 @@ Features
--enable-mh $enable_mh
--enable-maildir $enable_maildir
--enable-pop3 $enable_pop3 $disable_pop3_reason
+ --enable-imap $enable_imap $disable_imap_reason
+ --enable-ssl $enable_ssl $disable_ssl_reason
+ --enable-sasl $enable_sasl $disable_sasl_reason
--enable-sylpheed $enable_sylpheed
--enable-gmail $enable_gmail $disable_gmail_reason
+ --enable-ipv6 $enable_ipv6
EOF
diff --git a/data/GNOME_MailNotification_Automation.server.in.in b/data/GNOME_MailNotification_Automation.server.in.in
@@ -0,0 +1,18 @@
+<oaf_info>
+ <oaf_server iid="OAFIID:GNOME_MailNotification_Automation_Factory" type="exe" location="@bindir@/mail-notification">
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/ObjectFactory:1.0"/>
+ </oaf_attribute>
+ <oaf_attribute name="name" type="string" _value="Mail Notification automation"/>
+ <oaf_attribute name="description" type="string" _value="Mail Notification automation factory"/>
+ </oaf_server>
+
+ <oaf_server iid="OAFIID:GNOME_MailNotification_Automation" type="factory" location="OAFIID:GNOME_MailNotification_Automation_Factory">
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:Bonobo/Unknown:1.0"/>
+ <item value="IDL:GNOME/MailNotificationAutomation:1.0"/>
+ </oaf_attribute>
+ <oaf_attribute name="name" type="string" _value="Mail Notification automation"/>
+ <oaf_attribute name="description" type="string" _value="Mail Notification automation"/>
+ </oaf_server>
+</oaf_info>
diff --git a/data/Makefile.am b/data/Makefile.am
@@ -2,12 +2,26 @@ applicationsdir = $(datadir)/applications
applications_in_files = mail-notification.desktop.in
applications_DATA = mail-notification.desktop
+settingsdir = $(datadir)/control-center-2.0/capplets
+settings_in_files = mail-notification-properties.desktop.in
+settings_DATA = mail-notification-properties.desktop
+
+serverdir = $(libdir)/bonobo/servers
+server_in_files = GNOME_MailNotification_Automation.server.in
+server_DATA = GNOME_MailNotification_Automation.server
+
schemasdir = $(sysconfdir)/gconf/schemas
schemas_in_files = mail-notification.schemas.in
schemas_DATA = mail-notification.schemas
+soundlistdir = $(sysconfdir)/sound/events
+soundlist_in_files = mail-notification.soundlist.in
+soundlist_DATA = mail-notification.soundlist
+
@INTLTOOL_DESKTOP_RULE@
+@INTLTOOL_SERVER_RULE@
@INTLTOOL_SCHEMAS_RULE@
+@INTLTOOL_SOUNDLIST_RULE@
if GCONF_SCHEMAS_INSTALL
install-data-local: install-schemas
@@ -16,5 +30,20 @@ install-schemas:
$(GCONFTOOL) --makefile-install-rule mail-notification.schemas
endif
-EXTRA_DIST = mail-notification.desktop.in mail-notification.schemas.in
-CLEANFILES = mail-notification.desktop mail-notification.schemas
+EXTRA_DIST = \
+ mail-notification.desktop.in \
+ mail-notification-properties.desktop.in \
+ GNOME_MailNotification_Automation.server.in.in \
+ mail-notification.schemas.in \
+ mail-notification.soundlist.in
+
+CLEANFILES = \
+ mail-notification.desktop \
+ mail-notification-properties.desktop \
+ GNOME_MailNotification_Automation.server \
+ GNOME_MailNotification_Automation.server.in \
+ mail-notification.schemas \
+ mail-notification.soundlist
+
+GNOME_MailNotification_Automation.server.in: GNOME_MailNotification_Automation.server.in.in
+ sed -e 's|\@bindir\@|$(bindir)|' GNOME_MailNotification_Automation.server.in.in > GNOME_MailNotification_Automation.server.in
diff --git a/data/Makefile.in b/data/Makefile.in
@@ -37,7 +37,8 @@ POST_UNINSTALL = :
subdir = data
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -46,10 +47,14 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
-am__installdirs = "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(schemasdir)"
+am__installdirs = "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(schemasdir)" "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(settingsdir)" "$(DESTDIR)$(soundlistdir)"
applicationsDATA_INSTALL = $(INSTALL_DATA)
schemasDATA_INSTALL = $(INSTALL_DATA)
-DATA = $(applications_DATA) $(schemas_DATA)
+serverDATA_INSTALL = $(INSTALL_DATA)
+settingsDATA_INSTALL = $(INSTALL_DATA)
+soundlistDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(applications_DATA) $(schemas_DATA) $(server_DATA) \
+ $(settings_DATA) $(soundlist_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
@@ -59,6 +64,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -83,10 +89,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -119,6 +124,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -129,6 +135,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -141,6 +150,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -151,6 +162,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -158,7 +171,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
@@ -192,11 +213,33 @@ target_alias = @target_alias@
applicationsdir = $(datadir)/applications
applications_in_files = mail-notification.desktop.in
applications_DATA = mail-notification.desktop
+settingsdir = $(datadir)/control-center-2.0/capplets
+settings_in_files = mail-notification-properties.desktop.in
+settings_DATA = mail-notification-properties.desktop
+serverdir = $(libdir)/bonobo/servers
+server_in_files = GNOME_MailNotification_Automation.server.in
+server_DATA = GNOME_MailNotification_Automation.server
schemasdir = $(sysconfdir)/gconf/schemas
schemas_in_files = mail-notification.schemas.in
schemas_DATA = mail-notification.schemas
-EXTRA_DIST = mail-notification.desktop.in mail-notification.schemas.in
-CLEANFILES = mail-notification.desktop mail-notification.schemas
+soundlistdir = $(sysconfdir)/sound/events
+soundlist_in_files = mail-notification.soundlist.in
+soundlist_DATA = mail-notification.soundlist
+EXTRA_DIST = \
+ mail-notification.desktop.in \
+ mail-notification-properties.desktop.in \
+ GNOME_MailNotification_Automation.server.in.in \
+ mail-notification.schemas.in \
+ mail-notification.soundlist.in
+
+CLEANFILES = \
+ mail-notification.desktop \
+ mail-notification-properties.desktop \
+ GNOME_MailNotification_Automation.server \
+ GNOME_MailNotification_Automation.server.in \
+ mail-notification.schemas \
+ mail-notification.soundlist
+
all: all-am
.SUFFIXES:
@@ -264,6 +307,57 @@ uninstall-schemasDATA:
echo " rm -f '$(DESTDIR)$(schemasdir)/$$f'"; \
rm -f "$(DESTDIR)$(schemasdir)/$$f"; \
done
+install-serverDATA: $(server_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(serverdir)" || $(mkdir_p) "$(DESTDIR)$(serverdir)"
+ @list='$(server_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(serverDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(serverdir)/$$f'"; \
+ $(serverDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(serverdir)/$$f"; \
+ done
+
+uninstall-serverDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(server_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f '$(DESTDIR)$(serverdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(serverdir)/$$f"; \
+ done
+install-settingsDATA: $(settings_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(settingsdir)" || $(mkdir_p) "$(DESTDIR)$(settingsdir)"
+ @list='$(settings_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(settingsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(settingsdir)/$$f'"; \
+ $(settingsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(settingsdir)/$$f"; \
+ done
+
+uninstall-settingsDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(settings_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f '$(DESTDIR)$(settingsdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(settingsdir)/$$f"; \
+ done
+install-soundlistDATA: $(soundlist_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(soundlistdir)" || $(mkdir_p) "$(DESTDIR)$(soundlistdir)"
+ @list='$(soundlist_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(soundlistDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(soundlistdir)/$$f'"; \
+ $(soundlistDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(soundlistdir)/$$f"; \
+ done
+
+uninstall-soundlistDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(soundlist_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f '$(DESTDIR)$(soundlistdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(soundlistdir)/$$f"; \
+ done
tags: TAGS
TAGS:
@@ -302,7 +396,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(schemasdir)"; do \
+ for dir in "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(schemasdir)" "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(settingsdir)" "$(DESTDIR)$(soundlistdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
@@ -349,7 +443,8 @@ info: info-am
info-am:
install-data-am: install-applicationsDATA install-data-local \
- install-schemasDATA
+ install-schemasDATA install-serverDATA install-settingsDATA \
+ install-soundlistDATA
install-exec-am:
@@ -376,27 +471,36 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-applicationsDATA uninstall-info-am \
- uninstall-schemasDATA
+ uninstall-schemasDATA uninstall-serverDATA \
+ uninstall-settingsDATA uninstall-soundlistDATA
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-applicationsDATA install-data \
install-data-am install-data-local install-exec \
install-exec-am install-info install-info-am install-man \
- install-schemasDATA install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
- uninstall-am uninstall-applicationsDATA uninstall-info-am \
- uninstall-schemasDATA
+ install-schemasDATA install-serverDATA install-settingsDATA \
+ install-soundlistDATA install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-applicationsDATA uninstall-info-am \
+ uninstall-schemasDATA uninstall-serverDATA \
+ uninstall-settingsDATA uninstall-soundlistDATA
@INTLTOOL_DESKTOP_RULE@
+@INTLTOOL_SERVER_RULE@
@INTLTOOL_SCHEMAS_RULE@
+@INTLTOOL_SOUNDLIST_RULE@
@GCONF_SCHEMAS_INSTALL_TRUE@install-data-local: install-schemas
@GCONF_SCHEMAS_INSTALL_TRUE@install-schemas:
@GCONF_SCHEMAS_INSTALL_TRUE@ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
@GCONF_SCHEMAS_INSTALL_TRUE@ $(GCONFTOOL) --makefile-install-rule mail-notification.schemas
+
+GNOME_MailNotification_Automation.server.in: GNOME_MailNotification_Automation.server.in.in
+ sed -e 's|\@bindir\@|$(bindir)|' GNOME_MailNotification_Automation.server.in.in > GNOME_MailNotification_Automation.server.in
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/data/mail-notification-properties.desktop.in b/data/mail-notification-properties.desktop.in
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Encoding=UTF-8
+_Name=Mail Notification
+Icon=mail-notification.png
+_Comment=Configure Mail Notification
+Type=Application
+Categories=GNOME;Application;Settings;
+Exec=mail-notification --display-properties
+Terminal=false
+StartupNotify=true
diff --git a/data/mail-notification.desktop.in b/data/mail-notification.desktop.in
@@ -4,6 +4,6 @@ _Name=Mail Notification
Icon=mail-notification.png
_Comment=Get notified when new mail arrives
Type=Application
-Categories=GTK;Application;Network;
+Categories=GNOME;Application;Network;
Exec=mail-notification
Terminal=false
diff --git a/data/mail-notification.schemas.in b/data/mail-notification.schemas.in
@@ -44,24 +44,24 @@
</locale>
</schema>
<schema>
- <key>/schemas/apps/mail-notification/commands/clicked/enabled</key>
- <applyto>/apps/mail-notification/commands/clicked/enabled</applyto>
+ <key>/schemas/apps/mail-notification/commands/double-clicked/enabled</key>
+ <applyto>/apps/mail-notification/commands/double-clicked/enabled</applyto>
<owner>mail-notification</owner>
<type>bool</type>
<default>0</default>
<locale name="C">
- <short>Run a command when the icon is clicked</short>
- <long>Whether to run a command when the icon is clicked or not.</long>
+ <short>Run a command when the icon is double-clicked</short>
+ <long>Whether to run a command when the icon is double-clicked or not.</long>
</locale>
</schema>
<schema>
- <key>/schemas/apps/mail-notification/commands/clicked/command</key>
- <applyto>/apps/mail-notification/commands/clicked/command</applyto>
+ <key>/schemas/apps/mail-notification/commands/double-clicked/command</key>
+ <applyto>/apps/mail-notification/commands/double-clicked/command</applyto>
<owner>mail-notification</owner>
<type>string</type>
<locale name="C">
- <short>Clicked command</short>
- <long>The command to run when the icon is clicked.</long>
+ <short>Double-clicked command</short>
+ <long>The command to run when the icon is double-clicked.</long>
</locale>
</schema>
<schema>
@@ -76,25 +76,25 @@
</locale>
</schema>
<schema>
- <key>/schemas/apps/mail-notification/ui/preferences-dialog/height</key>
- <applyto>/apps/mail-notification/ui/preferences-dialog/height</applyto>
+ <key>/schemas/apps/mail-notification/ui/properties-dialog/height</key>
+ <applyto>/apps/mail-notification/ui/properties-dialog/height</applyto>
<owner>mail-notification</owner>
<type>int</type>
<default>420</default>
<locale name="C">
- <short>Height of preferences dialog</short>
- <long>The height of the preferences dialog in pixels.</long>
+ <short>Height of properties dialog</short>
+ <long>The height of the properties dialog in pixels.</long>
</locale>
</schema>
<schema>
- <key>/schemas/apps/mail-notification/ui/preferences-dialog/width</key>
- <applyto>/apps/mail-notification/ui/preferences-dialog/width</applyto>
+ <key>/schemas/apps/mail-notification/ui/properties-dialog/width</key>
+ <applyto>/apps/mail-notification/ui/properties-dialog/width</applyto>
<owner>mail-notification</owner>
<type>int</type>
<default>-1</default>
<locale name="C">
- <short>Width of preferences dialog</short>
- <long>The width of the preferences dialog in pixels.</long>
+ <short>Width of properties dialog</short>
+ <long>The width of the properties dialog in pixels.</long>
</locale>
</schema>
</schemalist>
diff --git a/data/mail-notification.soundlist.in b/data/mail-notification.soundlist.in
@@ -0,0 +1,6 @@
+[__section_info__]
+_description=Mail Notification
+
+[new-mail]
+file=email.wav
+_description=New Mail
diff --git a/help/C/Makefile.in b/help/C/Makefile.in
@@ -99,7 +99,8 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/help/omf.make $(top_srcdir)/help/xmldocs.make
subdir = help/C
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -117,6 +118,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -141,10 +143,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -177,6 +178,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -187,6 +189,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -199,6 +204,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -209,6 +216,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -216,7 +225,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
diff --git a/help/C/figures/mail-error.png b/help/C/figures/mail-error.png
Binary files differ.
diff --git a/help/C/figures/mail.png b/help/C/figures/mail.png
Binary files differ.
diff --git a/help/C/figures/no-mail-error.png b/help/C/figures/no-mail-error.png
Binary files differ.
diff --git a/help/C/figures/no-mail.png b/help/C/figures/no-mail.png
Binary files differ.
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-07-21
+ 2004-08-16
</date>
- <version identifier="2.1" date="2004-07-21" description="Second release"/>
+ <version identifier="2.2" date="2004-08-16" description="Third 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.5.0">
- <!ENTITY manrevision "2.1">
- <!ENTITY date "Wednesday, July 21, 2004">
+ <!ENTITY appversion "0.6.0">
+ <!ENTITY manrevision "2.2">
+ <!ENTITY date "Monday, August 16, 2004">
<!ENTITY project "The Mail Notification Project">
@@ -17,12 +17,15 @@
<!ENTITY mbox "<link linkend="mbox">mbox</link>">
<!ENTITY mh "<link linkend="mh">MH</link>">
<!ENTITY pop3 "<link linkend="pop3">POP3</link>">
+ <!ENTITY imap "<link linkend="imap">IMAP</link>">
+ <!ENTITY sasl "<link linkend="sasl">SASL</link>">
+ <!ENTITY ssl "<link linkend="pop3">SSL</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.13 2004/07/21 16:00:41 jylefort Exp $ -->
+<!-- $Id: mail-notification.xml,v 1.36 2004/08/16 15:58:56 jylefort Exp $ -->
<!-- Mail Notification Manual -->
<!-- Copyright (c) 2004 Jean-Yves Lefort -->
@@ -130,6 +133,17 @@
</revdescription>
</revision>
<revision>
+ <revnumber>Mail Notification Manual V2.1</revnumber>
+ <date>Wednesday, July 21, 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.0</revnumber>
<date>Tuesday, June 29, 2004</date>
<revdescription>
@@ -167,7 +181,7 @@
</para>
<para>
It works with system trays implementing the freedesktop.org
- <ulink url="http://www.freedesktop.org/Standards/systemtray-spec">System Tray Specification</ulink>, such as the
+ <ulink url="http://www.freedesktop.org/Standards/systemtray-spec" type="http">System Tray Specification</ulink>, such as the
GNOME Panel Notification Area, the Xfce Notification Area and the KDE System Tray.
</para>
<para>
@@ -175,10 +189,13 @@
</para>
<itemizedlist>
<listitem><para>multiple mailbox support</para></listitem>
- <listitem><para>&mbox;, &mh;, &maildir;, &sylpheed;, &pop3; and &gmail; support</para></listitem>
+ <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>automatic detection of mailbox format</para></listitem>
<listitem><para><link linkend="automatic-notification">automatic notification</link></para></listitem>
- <listitem><para><ulink url="http://developer.gnome.org/projects/gup/hig">HIG</ulink> compliance</para></listitem>
+ <listitem><para><ulink url="http://developer.gnome.org/projects/gup/hig" type="http">HIG</ulink> 2.0 compliance</para></listitem>
</itemizedlist>
</sect1>
@@ -222,12 +239,44 @@
<variablelist>
<varlistentry>
<term>--enable-info</term>
- <listitem><para>Enable informational output</para></listitem>
+ <listitem>
+ <para>
+ Enable informational output
+ </para>
+ <warning>
+ <title>Security</title>
+ <para>
+ The output of --enable-info may contain
+ sensitive information such as passwords and
+ session transcripts.
+ </para>
+ </warning>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>--list-features</term>
+ <listitem><para>List compiled-in features and exit</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>--display-properties</term>
+ <listitem><para>Display the properties dialog</para></listitem>
</varlistentry>
<varlistentry>
- <term>--list-handlers</term>
- <listitem><para>List compiled-in handlers and exit</para></listitem>
+ <term>--display-about</term>
+ <listitem><para>Display the about dialog</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>--update</term>
+ <listitem><para>Update the mail status</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>--report</term>
+ <listitem><para>Report the mail status</para></listitem>
</varlistentry>
<varlistentry>
@@ -243,118 +292,45 @@
<sect2 id="when-start">
<title>When You Start &app;</title>
<para>
- When you start <application>&app;</application>, the following
- icon is displayed in the notification area (&aka; system
- tray).
+ When you start <application>&app;</application>, it stays in
+ the background and monitors the status of your mailboxes.
+ </para>
+ <para>
+ When new mail arrives, an icon similar to the following one is
+ displayed in the notification area (&aka; system tray):
</para>
-
<figure id="no-mail-fig">
- <title>&app; status icon</title>
+ <title>&app; when there is new mail</title>
<screenshot>
<mediaobject>
<imageobject>
- <imagedata fileref="figures/no-mail.png" format="PNG"/>
+ <imagedata fileref="figures/mail.png" format="PNG"/>
</imageobject>
- <!-- EPS versions of the figures are not required at the moment. -->
- <!--
- <imageobject>
- <imagedata fileref="figures/image.eps" format="EPS"/>
- </imageobject>
- -->
<textobject>
<phrase>Shows the &app; status icon.</phrase>
</textobject>
</mediaobject>
</screenshot>
</figure>
+ <para>
+ If an error is detected, the icon blinks.
+ </para>
+ <para>
+ Leaving your mouse over the icon will reveal more details
+ about the status of your mailboxes.
+ </para>
</sect2>
</sect1>
- <sect1 id="usage">
- <title>Usage</title>
- <para>
- &app; will monitor the state of your mailboxes and update its
- status icon according to <xref linkend="icons" />.
- </para>
- <para>
- You can add mailboxes from the
- <link linkend="preferences">Preferences</link>, or by dragging a
- file or folder into the icon.
- </para>
- <table frame="topbot" id="icons">
- <title>&app; Icons</title>
- <tgroup cols="2">
- <thead>
- <row rowsep="1">
- <entry><para>Icon</para></entry>
- <entry><para>Meaning</para></entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><screenshot>
- <mediaobject>
- <imageobject>
- <imagedata fileref="figures/no-mail.png" format="PNG"/>
- </imageobject>
- <textobject>
- <phrase>Shows the &app; status icon when you have no new mail.</phrase>
- </textobject>
- </mediaobject>
- </screenshot></entry>
- <entry><para>you have no new mail</para></entry>
- </row>
- <row>
- <entry><screenshot>
- <mediaobject>
- <imageobject>
- <imagedata fileref="figures/no-mail-error.png" format="PNG"/>
- </imageobject>
- <textobject>
- <phrase>Shows the &app; status icon when you have no new mail and there are one or more errors.</phrase>
- </textobject>
- </mediaobject>
- </screenshot></entry>
- <entry><para>you have no new mail and there are one or more errors</para></entry>
- </row>
- <row>
- <entry><screenshot>
- <mediaobject>
- <imageobject>
- <imagedata fileref="figures/mail.png" format="PNG"/>
- </imageobject>
- <textobject>
- <phrase>Shows the &app; status icon when you have new mail.</phrase>
- </textobject>
- </mediaobject>
- </screenshot></entry>
- <entry><para>you have new mail</para></entry>
- </row>
- <row>
- <entry><screenshot>
- <mediaobject>
- <imageobject>
- <imagedata fileref="figures/mail-error.png" format="PNG"/>
- </imageobject>
- <textobject>
- <phrase>Shows the &app; status icon when you have new mail and there are one or more errors.</phrase>
- </textobject>
- </mediaobject>
- </screenshot></entry>
- <entry><para>you have new mail and there are one or more errors</para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect1>
-
- <sect1 id="preferences">
- <title>Preferences</title>
- <para>To configure &app;, right-click the status icon and choose
- <menuchoice>
- <guimenuitem>Preferences</guimenuitem>
+ <sect1 id="properties">
+ <title>Properties</title>
+ <para>To configure &app;, choose
+ <menuchoice>
+ <guimenu>Applications</guimenu>
+ <guisubmenu>Desktop Preferences</guisubmenu>
+ <guimenuitem>Mail Notification</guimenuitem>
</menuchoice>. The
- <guilabel>Preferences</guilabel> dialog contains the following
+ <guilabel>Properties</guilabel> dialog contains the following
settings:
</para>
@@ -401,10 +377,10 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><guilabel>When clicked:</guilabel></term>
+ <term><guilabel>When double-clicked:</guilabel></term>
<listitem>
<para>
- This is the command to execute when the icon is clicked.
+ This is the command to execute when the icon is double-clicked.
</para>
</listitem>
</varlistentry>
@@ -421,7 +397,7 @@
<variablelist>
<varlistentry>
- <term><guilabel>Type</guilabel></term>
+ <term><guilabel>Mailbox type</guilabel></term>
<listitem>
<para>
This is the type of the mailbox. If you select <guilabel>autodetect</guilabel>,
@@ -460,14 +436,15 @@
</varlistentry>
<varlistentry>
- <term>When <guilabel>POP3</guilabel> is selected:</term>
+ <term>When <guilabel>POP3</guilabel> or <guilabel>IMAP</guilabel> is selected:</term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Hostname</guilabel></term>
<listitem>
<para>
- This is the hostname or IP address of the &pop3; server.
+ This is the hostname or IP address of the &pop3; or
+ &imap; server.
<note>
<para>
Symbolic names aswell as IPv4 and IPv6 addresses
@@ -478,32 +455,71 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><guilabel>Port</guilabel></term>
+ <term><guilabel>Username</guilabel></term>
<listitem>
<para>
- This is the port number of the &pop3; server.
- <tip>
- <para>
- &pop3; servers usually listen on port 110.
- </para>
- </tip>
+ This is your username on the &pop3; or &imap; server.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><guilabel>Username</guilabel></term>
+ <term><guilabel>Password</guilabel></term>
<listitem>
<para>
- This is your username on the &pop3; server.
+ This is your password on the &pop3; or &imap; server.
</para>
+ <warning>
+ <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.
+ </para>
+ </warning>
</listitem>
</varlistentry>
<varlistentry>
- <term><guilabel>Password</guilabel></term>
+ <term><guilabel>Connection type</guilabel> and <guilabel>Port</guilabel></term>
+ <listitem>
+ <para>
+ This is the type of connection to use and the port
+ number to connect to.
+ </para>
+ <note>
+ <para>
+ The security considerations listed below do not
+ apply if you select <guilabel>SSL</guilabel>.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Authentication mechanism</guilabel></term>
<listitem>
<para>
- This is your password on the &pop3; server.
+ This is the authentication mechanism to use.
+ If you select <guilabel>autodetect</guilabel>,
+ all the authentication mechanisms supported by the &pop3;
+ or &imap; server will be tried, in descending order of
+ security. Otherwise, the selected mechanism (and
+ <emphasis>only</emphasis> the selected mechanism) will
+ be used.
</para>
+ <warning>
+ <title>Security</title>
+ <para>
+ 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).
+ </para>
+ <para>
+ If this is a concern, select the appropriate
+ secure authentication mechanism from the drop-down
+ list.
+ </para>
+ </warning>
</listitem>
</varlistentry>
</variablelist>
@@ -511,6 +527,22 @@
</varlistentry>
<varlistentry>
+ <term>When <guilabel>IMAP</guilabel> is selected:</term>
+ <listitem>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Mailbox</guilabel></term>
+ <listitem>
+ <para>
+ This is the &imap; mailbox to use.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>When <guilabel>Gmail</guilabel> is selected:</term>
<listitem>
<variablelist>
@@ -536,32 +568,127 @@
</variablelist>
</sect1>
- <sect1 id="automatic-notification">
- <title>Automatic Notification</title>
+ <sect1 id="troubleshooting">
+ <title>Troubleshooting</title>
<para>
- Automatic 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.
+ If &app; does not work as expected, remember that you can obtain
+ more details by leaving your mouse over its icon.
</para>
<para>
- For automatic notification to be supported, &gnomevfs; must be compiled
- with <ulink url="http://oss.sgi.com/projects/fam">FAM</ulink> support,
- and FAM must be configured properly.
+ Additionally, a very efficient way to identify and solve
+ problems is to run &app; using the --enable-info option and
+ examine the output.
+ <warning>
+ <title>Security</title>
+ <para>
+ The output of --enable-info may contain sensitive
+ information such as passwords and session transcripts.
+ </para>
+ </warning>
</para>
- <para>
- Refer to the
- <citerefentry><refentrytitle>fam</refentrytitle><manvolnum>1</manvolnum></citerefentry>
- manual page for more details.
- </para>
- <note>
+ </sect1>
+
+ <sect1 id="technical-information">
+ <title>Technical Information</title>
+
+ <sect2 id="automatic-notification">
+ <title>Automatic Notification</title>
<para>
- Automatic 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.
+ Automatic 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.
</para>
- </note>
+ <para>
+ For automatic 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>
+ <para>
+ Refer to the
+ <citerefentry><refentrytitle>fam</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ manual page for more details.
+ </para>
+ <note>
+ <para>
+ Automatic 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.
+ </para>
+ </note>
+ </sect2>
+
+ <sect2>
+ <title>POP3 Implementation</title>
+ <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>.
+ </para>
+ <para>
+ The AUTH, APOP and USER/PASS authentication mechanisms are
+ supported, and the LOGIN-DELAY capability is honoured.
+ </para>
+ <para>
+ The authentication logic can be represented with the following
+ pseudo-code:
+ </para>
+ <programlisting>if has-user-selected-mechanism then
+ if server-supports-user-selected-mechanism then
+ attempt authentication using user-selected-mechanism
+ endif
+else
+ if has-sasl-support and server-supports-sasl then
+ if is-ssl-connection then
+ sasl-mechanism = any
+ else
+ sasl-mechanism = any-non-plaintext
+ endif
+ attempt authentication using sasl-mechanism
+ endif
+ if authentication-failed and server-supports-apop then
+ attempt authentication using apop
+ endif
+ if authentication-failed then
+ attempt authentication using user/pass
+ endif
+endif</programlisting>
+ </sect2>
+
+ <sect2>
+ <title>IMAP Implementation</title>
+ <para>
+ The &app; &imap; implementation strictly conforms to
+ <ulink url="http://www.ietf.org/rfc/rfc3501.txt" type="http">RFC 3501</ulink>.
+ </para>
+ <para>
+ The AUTHENTICATE and LOGIN authentication mechanisms are
+ supported.
+ </para>
+ <para>
+ The authentication logic can be represented with the following
+ pseudo-code:
+ </para>
+ <programlisting>if has-user-selected-mechanism then
+ if server-supports-user-selected-mechanism then
+ attempt authentication using user-selected-mechanism
+ endif
+else
+ if has-sasl-support and server-supports-sasl then
+ if is-ssl-connection then
+ sasl-mechanism = any
+ else
+ sasl-mechanism = any-non-plaintext
+ endif
+ attempt authentication using sasl-mechanism
+ endif
+ if authentication-failed and server-supports-login then
+ attempt authentication using login
+ endif
+endif</programlisting>
+ </sect2>
</sect1>
<sect1 id="about">
@@ -576,7 +703,7 @@
<title>Reporting Bugs and Other Feedback</title>
<para>
Bug reports and feedback should be sent to Jean-Yves Lefort
- (<email>jylefort@brutele.be></email>).
+ (<email>jylefort@brutele.be</email>).
</para>
</sect2>
@@ -603,8 +730,8 @@
<glossterm>Gmail</glossterm>
<glossdef>
<para>
- A free webmail service operated by <ulink url="http://www.google.com">Google</ulink>.
- More information can be found on the <ulink url="http://gmail.google.com">Gmail web page</ulink>.
+ A free webmail service operated by <ulink url="http://www.google.com" type="http">Google</ulink>.
+ More information can be found on the <ulink url="http://gmail.google.com" type="http">Gmail web page</ulink>.
</para>
</glossdef>
</glossentry>
@@ -615,8 +742,28 @@
<para>
A filesystem abstraction library allowing applications to access
local, remote and virtual resources in a transparent fashion.
- <ulink url="http://developer.gnome.org/doc/API/2.0/gnome-vfs-2.0">GnomeVFS</ulink>
- is part of the <ulink url="http://www.gnome.org">GNOME Desktop Environment</ulink>.
+ <ulink url="http://developer.gnome.org/doc/API/2.0/gnome-vfs-2.0" type="http">GnomeVFS</ulink>
+ is part of the <ulink url="http://www.gnome.org" type="http">GNOME Desktop Environment</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+ </glossdiv>
+
+ <glossdiv><title>I</title>
+ <glossentry>
+ <glossterm>IMAP</glossterm>
+ <glosssee otherterm="imap"/>
+ </glossentry>
+
+ <glossentry id="imap">
+ <glossterm>Internet Message Access Protocol</glossterm>
+ <acronym>IMAP</acronym>
+ <glossdef>
+ <para>
+ A protocol allowing a client to access and manipulate
+ electronic mail messages on a server. &app; implements
+ version 4rev1 of the protocol, as defined by
+ <ulink url="http://www.ietf.org/rfc/rfc3501.txt" type="http">RFC 3501</ulink>.
</para>
</glossdef>
</glossentry>
@@ -627,7 +774,7 @@
<glossterm>Maildir</glossterm>
<glossdef>
<para>
- A mailbox format popularized by the <ulink url="http://www.qmail.org">qmail</ulink> mail transfer agent.
+ A mailbox format popularized by the <ulink url="http://www.qmail.org" type="http">qmail</ulink> mail transfer agent.
Messages are stored in a structure of directories for reliability.
</para>
</glossdef>
@@ -648,7 +795,7 @@
<glossdef>
<para>
A mailbox format popularized by the
- <ulink url="http://www.ics.uci.edu/~mh">MH</ulink> mail user agent.
+ <ulink url="http://www.ics.uci.edu/~mh" type="http">MH</ulink> mail user agent.
Messages are stored as separate files for flexibility and performance.
</para>
</glossdef>
@@ -656,8 +803,14 @@
</glossdiv>
<glossdiv><title>P</title>
- <glossentry id="pop3">
+ <glossentry>
<glossterm>POP3</glossterm>
+ <glosssee otherterm="pop3"/>
+ </glossentry>
+
+ <glossentry id="pop3">
+ <glossterm>Post Office Protocol Version 3</glossterm>
+ <acronym>POP3</acronym>
<glossdef>
<para>
A protocol allowing a workstation to dynamically access
@@ -669,11 +822,44 @@
</glossdiv>
<glossdiv><title>S</title>
+ <glossentry>
+ <glossterm>SASL</glossterm>
+ <glosssee otherterm="sasl"/>
+ </glossentry>
+
+ <glossentry id="ssl">
+ <glossterm>Secure Sockets Layer</glossterm>
+ <acronym>SSL</acronym>
+ <glossdef>
+ <para>
+ A protocol securing a connection through the use of
+ cryptographic techniques.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="sasl">
+ <glossterm>Simple Authentication and Security Layer</glossterm>
+ <acronym>SASL</acronym>
+ <glossdef>
+ <para>
+ A method for adding authentication support to
+ connection-based protocols, as defined by
+ <ulink url="http://www.ietf.org/rfc/rfc2222.txt" type="http">RFC 2222</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry>
+ <glossterm>SSL</glossterm>
+ <glosssee otherterm="ssl"/>
+ </glossentry>
+
<glossentry id="sylpheed">
<glossterm>Sylpheed</glossterm>
<glossdef>
<para>
- The mailbox format used by the <ulink url="http://sylpheed.good-day.net">Sylpheed</ulink>
+ The mailbox format used by the <ulink url="http://sylpheed.good-day.net" type="http">Sylpheed</ulink>
mail user agent. The Sylpheed format adds a binary cache to MH folders
for faster indexing.
</para>
@@ -682,11 +868,6 @@
</glossdiv>
<glossdiv><title>U</title>
- <glossentry>
- <glossterm>URI</glossterm>
- <glosssee otherterm="uri"/>
- </glossentry>
-
<glossentry id="uri">
<glossterm>Uniform Resource Identifier</glossterm>
<acronym>URI</acronym>
@@ -698,6 +879,11 @@
</para>
</glossdef>
</glossentry>
+
+ <glossentry>
+ <glossterm>URI</glossterm>
+ <glosssee otherterm="uri"/>
+ </glossentry>
</glossdiv>
</glossary>
</article>
diff --git a/help/Makefile.in b/help/Makefile.in
@@ -36,7 +36,8 @@ POST_UNINSTALL = :
subdir = help
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -63,6 +64,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -87,10 +89,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -123,6 +124,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -133,6 +135,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -145,6 +150,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -155,6 +162,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -162,7 +171,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
diff --git a/m4/Makefile.in b/m4/Makefile.in
@@ -36,7 +36,8 @@ POST_UNINSTALL = :
subdir = m4
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -54,6 +55,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -78,10 +80,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -114,6 +115,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -124,6 +126,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -136,6 +141,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -146,6 +153,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -153,7 +162,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
diff --git a/m4/openssl.m4 b/m4/openssl.m4
@@ -0,0 +1,62 @@
+# $Id: openssl.m4,v 1.1 2004/08/04 22:54:08 jylefort Exp $
+#
+# This file is part of Mail Notification.
+#
+# Copyright (c) 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_OPENSSL([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl
+AC_DEFUN([AM_PATH_OPENSSL],
+[OPENSSL_CFLAGS=""
+OPENSSL_LIBS="-lssl -lcrypto"
+
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
+LIBS="$LIBS $OPENSSL_LIBS"
+
+# the OPENSSL_VERSION_NUMBER format we use appeared in 0.9.5b
+openssl_min_version=ifelse([$1],, 0.9.5b, [$1])
+
+AC_MSG_CHECKING([for OpenSSL - version >= $openssl_min_version])
+AC_RUN_IFELSE([
+#include <openssl/opensslv.h>
+
+int main() {
+ int n;
+ char cpatch = 0;
+ int major, minor, fix, patch = 0;
+ int openssl_major, openssl_minor, openssl_fix, openssl_patch;
+
+ n = sscanf("$openssl_min_version", "%d.%d.%d%c", &major, &minor, &fix, &cpatch);
+ if (n < 3)
+ exit(1); /* bad version string */
+ if (cpatch)
+ patch = cpatch - 96; /* letter -> number */
+
+ if (OPENSSL_VERSION_NUMBER <
+ (major << 28) + (minor << 20) + (fix << 12) + (patch << 4))
+ exit(2); /* version too old */
+
+ exit(0);
+}
+], [found=yes], [found=no], [found=yes])
+AC_MSG_RESULT($found)
+
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+
+if test $found = yes; then
+ ifelse([$2],, :, [$2])
+else
+ OPENSSL_CFLAGS=""
+ OPENSSL_LIBS=""
+ ifelse([$3],, :, [$3])
+fi
+
+AC_SUBST(OPENSSL_CFLAGS)
+AC_SUBST(OPENSSL_LIBS)])
diff --git a/m4/sasl2.m4 b/m4/sasl2.m4
@@ -0,0 +1,57 @@
+# $Id: sasl2.m4,v 1.2 2004/08/04 22:54:08 jylefort Exp $
+#
+# This file is part of Mail Notification.
+#
+# Copyright (c) 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_SASL2([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl
+AC_DEFUN([AM_PATH_SASL2],
+[SASL_CFLAGS=""
+SASL_LIBS="-lsasl2"
+
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $SASL_CFLAGS"
+LIBS="$LIBS $SASL_LIBS"
+
+sasl2_min_version=ifelse([$1],, 2.0, [$1])
+
+AC_MSG_CHECKING([for Cyrus SASL - version >= $sasl2_min_version])
+AC_RUN_IFELSE([
+#include <sasl/sasl.h>
+
+int main() {
+ int major, minor, step = 0, patch = 0;
+ int sasl_major, sasl_minor, sasl_step, sasl_patch;
+
+ if (sscanf("$sasl2_min_version", "%d.%d.%d.%d", &major, &minor, &step, &patch) < 2)
+ exit(1); /* bad version string */
+
+ sasl_version_info(0, 0, &sasl_major, &sasl_minor, &sasl_step, &sasl_patch);
+ if ((sasl_major << 24) + (sasl_minor << 16) + (sasl_step << 8) + sasl_patch
+ < (major << 24) + (minor << 16) + (step << 8) + patch)
+ exit(2); /* version too old */
+
+ exit(0);
+}
+], [found=yes], [found=no], [found=yes])
+AC_MSG_RESULT($found)
+
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+
+if test $found = yes; then
+ ifelse([$2],, :, [$2])
+else
+ SASL_CFLAGS=""
+ SASL_LIBS=""
+ ifelse([$3],, :, [$3])
+fi
+
+AC_SUBST(SASL_CFLAGS)
+AC_SUBST(SASL_LIBS)])
diff --git a/po/POTFILES.in b/po/POTFILES.in
@@ -1,23 +1,66 @@
+data/GNOME_MailNotification_Automation.server.in.in
+data/mail-notification-properties.desktop.in
data/mail-notification.desktop.in
data/mail-notification.schemas.in
+data/mail-notification.soundlist.in
+src/MNAutomation.idl
src/eggtrayicon.c
-src/mn-gmail-mailbox.c
-src/mn-mail-icon.c
+src/eggtrayicon.h
+src/mn-about-dialog.gob
+src/mn-auth-combo-box.gob
+src/mn-autodetect-mailbox-properties.gob
+src/mn-automation.gob
+src/mn-blinking-image.gob
+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
+src/mn-imap-mailbox.gob
+src/mn-mail-icon.gob
src/mn-mailbox-properties-dialog.c
-src/mn-mailbox.c
-src/mn-mailboxes.c
-src/mn-maildir-mailbox.c
+src/mn-mailbox-properties-dialog.h
+src/mn-mailbox-properties-util.c
+src/mn-mailbox-properties-util.h
+src/mn-mailbox-properties.c
+src/mn-mailbox-properties.h
+src/mn-mailbox-view.gob
+src/mn-mailbox.gob
+src/mn-mailboxes.gob
+src/mn-maildir-mailbox.gob
src/mn-main.c
-src/mn-mbox-mailbox.c
-src/mn-mh-mailbox.c
-src/mn-pending-mailbox.c
-src/mn-pop3-mailbox.c
-src/mn-preferences.c
-src/mn-sylpheed-mailbox.c
-src/mn-ui.c
-src/mn-unsupported-mailbox.c
+src/mn-mbox-mailbox.gob
+src/mn-md5.c
+src/mn-md5.h
+src/mn-mh-mailbox.gob
+src/mn-pending-mailbox.gob
+src/mn-pi-mailbox-properties.gob
+src/mn-pop3-mailbox-properties.gob
+src/mn-pop3-mailbox.gob
+src/mn-properties.c
+src/mn-properties.h
+src/mn-sasl.c
+src/mn-sasl.h
+src/mn-shell.gob
+src/mn-soup.c
+src/mn-soup.h
+src/mn-ssl.c
+src/mn-ssl.h
+src/mn-stock.c
+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-util.c
+src/mn-util.h
+src/mn-vfs.c
+src/mn-vfs.h
ui/dialog.glade
ui/mailbox-properties.glade
-ui/menu.glade
-ui/preferences.glade
+ui/properties.glade
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.5.0\n"
+"Project-Id-Version: mail-notification 0.6.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-07-21 18:10+0200\n"
-"PO-Revision-Date: 2004-07-21 21:58+0200\n"
+"POT-Creation-Date: 2004-08-16 18:15+0200\n"
+"PO-Revision-Date: 2004-08-16 18:12+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"
@@ -19,29 +19,44 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n>1;\n"
-#: data/mail-notification.desktop.in.h:1
-msgid "Get notified when new mail arrives"
-msgstr "Etre notifié lorsque du nouveau courrier arrive"
+#: data/GNOME_MailNotification_Automation.server.in.in.h:1
+msgid "Mail Notification automation"
+msgstr "automation Notification de Courrier"
-#: data/mail-notification.desktop.in.h:2 src/mn-main.c:112 src/mn-ui.c:262
+#: data/GNOME_MailNotification_Automation.server.in.in.h:2
+msgid "Mail Notification automation factory"
+msgstr "usine d'automation Notification de Courrier"
+
+#: data/mail-notification-properties.desktop.in.h:1
+msgid "Configure Mail Notification"
+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
msgid "Mail Notification"
msgstr "Notification de Courrier"
-#: data/mail-notification.schemas.in.h:1
-msgid "Clicked command"
-msgstr "Commande du click sur l'îcone"
+#: data/mail-notification.desktop.in.h:1
+msgid "Get notified when new mail arrives"
+msgstr "Etre notifié lorsque du nouveau courrier arrive"
-#: data/mail-notification.schemas.in.h:2
+#: data/mail-notification.schemas.in.h:1
msgid "Delay between mail checks (minutes part)."
msgstr "Délai entre les vérifications de courrier (partie minutes)."
-#: data/mail-notification.schemas.in.h:3
+#: data/mail-notification.schemas.in.h:2
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
+msgid "Double-clicked command"
+msgstr "Commande associée au double-click"
+
#: data/mail-notification.schemas.in.h:4
-msgid "Height of preferences dialog"
-msgstr "Hauteur de la boîte de dialogue contenant les préférences"
+msgid "Height of properties dialog"
+msgstr "Hauteur de la boîte de dialogue contenant les propriétés"
#: data/mail-notification.schemas.in.h:5
msgid "Mailboxes list"
@@ -60,8 +75,8 @@ msgid "Run a command when new mail arrives"
msgstr "Exécuter une commande lorsque du nouveau courrier arrive"
#: data/mail-notification.schemas.in.h:9
-msgid "Run a command when the icon is clicked"
-msgstr "Exécuter une commande lorsque l'îcone est cliquée"
+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:10
msgid "Seconds between mail checks"
@@ -72,22 +87,20 @@ 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:12
-msgid "The command to run when the icon is clicked."
-msgstr "La commande à exécuter lorsque l'îcone est cliquée."
+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:13
-msgid "The height of the preferences dialog in pixels."
-msgstr ""
-"La hauteur de la boîte de dialogue contenant les préférences en pixels."
+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:14
msgid "The list of mailboxes to monitor."
msgstr "La liste des boîtes aux lettres à surveiller."
#: data/mail-notification.schemas.in.h:15
-msgid "The width of the preferences dialog in pixels."
-msgstr ""
-"La largeur de la boîte de dialogue contenant les préférences en pixels."
+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:16
msgid "Whether to run a command when new mail arrives or not."
@@ -95,12 +108,17 @@ msgstr ""
"Si une commande doit être exécutée lorsque du nouveau courrier arrive ou pas."
#: data/mail-notification.schemas.in.h:17
-msgid "Whether to run a command when the icon is clicked or not."
-msgstr "Si une commande doit être exécutée lorsque l'îcone est cliquée ou pas."
+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:18
-msgid "Width of preferences dialog"
-msgstr "Largeur de la boîte de dialogue contenant les préférences"
+msgid "Width of properties dialog"
+msgstr "Largeur de la boîte de dialogue contenant les propriétés"
+
+#: data/mail-notification.soundlist.in.h:2
+msgid "New Mail"
+msgstr "Nouveau Courrier"
#: src/eggtrayicon.c:109
msgid "Orientation"
@@ -110,167 +128,521 @@ msgstr "Orientation"
msgid "The orientation of the tray."
msgstr "L'orientation du plateau."
-#: src/mn-gmail-mailbox.c:165
+#: src/mn-about-dialog.gob:41
+msgid "A Mail Notification Icon"
+msgstr "Une Icône de Notification de Courrier"
+
+#: src/mn-about-dialog.gob:44
+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
+msgid "<span style=\"italic\">autodetect</span>"
+msgstr "<span style=\"italic\">autodétecter</span>"
+
+#: src/mn-autodetect-mailbox-properties.gob:67
+msgid "_Location:"
+msgstr "_Emplacement:"
+
+#: src/mn-autodetect-mailbox-properties.gob:73
+msgid "_Browse..."
+msgstr "_Parcourir..."
+
+#: src/mn-autodetect-mailbox-properties.gob:80
+msgid "The URI of the mailbox"
+msgstr "L'URI de la boîte aux lettres"
+
+#: src/mn-autodetect-mailbox-properties.gob:117
+msgid "Select a File or Folder"
+msgstr "Sélectionnez un Fichier ou Dossier"
+
+#: src/mn-blinking-image.gob:30
+msgid "Whether the image is blinking or not"
+msgstr "Si l'image clignote ou pas"
+
+#: 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:201
+msgid "unable to read from server: EOF"
+msgstr "impossible de lire depuis le serveur: EOF"
+
+#: 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:287
+#, c-format
+msgid "resolving %s"
+msgstr "résolution de %s en cours"
+
+#: src/mn-client-session.c:297
+#, c-format
+msgid "unable to resolve %s: %s"
+msgstr "impossible de résoudre %s: %s"
+
+#: src/mn-client-session.c:334
+#, c-format
+msgid "%s: unsupported address family"
+msgstr "%s: famille d'adresse non prise en charge"
+
+#: src/mn-client-session.c:341
+#, c-format
+msgid "%s: unable to create socket: %s"
+msgstr "%s: impossible de créer un soquet: %s"
+
+#: src/mn-client-session.c:345
+#, c-format
+msgid "connecting to %s (%s) port %i"
+msgstr "connection à %s (%s) port %i en cours"
+
+#: src/mn-client-session.c:348
+#, c-format
+msgid "unable to connect: %s"
+msgstr "impossible de se connecter: %s"
+
+#: src/mn-client-session.c:353
+msgid "connected successfully"
+msgstr "connecté avec succès"
+
+#. if reached, we couldn't find a working address
+#: src/mn-client-session.c:359
+#, c-format
+msgid "unable to connect to %s"
+msgstr "impossible de se connecter à %s"
+
+#: src/mn-client-session.c:375
+#, c-format
+msgid "unable to initialize the OpenSSL library: %s"
+msgstr "impossible d'initialiser la bibliothèque OpenSSL: %s"
+
+#: src/mn-client-session.c:383
+#, c-format
+msgid "unable to create a SSL object: %s"
+msgstr "impossible de créer un objet SSL: %s"
+
+#: src/mn-client-session.c:389
+#, c-format
+msgid "unable to set the SSL file descriptor: %s"
+msgstr "impossible de spécifier le descripteur de fichier SSL: %s"
+
+#: src/mn-client-session.c:444
+#, 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:470
+#, c-format
+msgid "unable to parse response \"%s\""
+msgstr "impossible d'interpréter la réponse \"%s\""
+
+#: src/mn-client-session.c:517
+#, 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:546 src/mn-client-session.c:553
+#, c-format
+msgid "unable to write to server: %s"
+msgstr "impossible d'écrire vers le serveur: %s"
+
+#: src/mn-client-session.c:551
+msgid "unable to write to server: EOF"
+msgstr "impossible d'écrire vers le serveur: EOF"
+
+#: src/mn-client-session.c:583
+#, c-format
+msgid "unable to encode Base64: %s"
+msgstr "impossible d'encoder en Base64: %s"
+
+#: src/mn-client-session.c:686
+#, c-format
+msgid "unable to initialize the SASL library: %s"
+msgstr "impossible d'initialiser la bibliothèque SASL: %s"
+
+#: src/mn-client-session.c:695
+#, 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:701
+#, 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:735
+#, 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:774
+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:778
+#, c-format
+msgid "unable to start SASL authentication: %s"
+msgstr "impossible de démarrer l'authentification SASL: %s"
+
+#: src/mn-client-session.c:782
+#, c-format
+msgid "unable to create a SASL connection: %s"
+msgstr "impossible de créer une connection SASL: %s"
+
+#: src/mn-client-session.c:832
+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:836
+#, c-format
+msgid "%s, aborting SASL authentication"
+msgstr "%s, annulation de l'authentification SASL"
+
+#. compliance error
+#: src/mn-client-session.c:841
+#, 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:844
+msgid ""
+"the server sent a SASL challenge, but there was a pending initial SASL "
+"client response"
+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:858
+msgid ""
+"the server did not send a SASL challenge, but there was no pending initial "
+"SASL client response"
+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:881
+#, 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:886
+#, 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:892
+#, 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-gmail-mailbox-properties.gob:78
+msgid "Your Gmail username"
+msgstr "Votre nom d'utilisateur Gmail"
+
+#: src/mn-gmail-mailbox-properties.gob:79
+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.c:261
-#, c-format
-msgid "logging into Gmail as user %s"
-msgstr "ouverture de la session Gmail en tant que %s"
+#: src/mn-gmail-mailbox.gob:180
+msgid "logging in"
+msgstr "ouverture de session en cours"
-#: src/mn-gmail-mailbox.c:277 src/mn-gmail-mailbox.c:356
+#: src/mn-gmail-mailbox.gob:194 src/mn-gmail-mailbox.gob:233
+#: src/mn-gmail-mailbox.gob:266 src/mn-gmail-mailbox.gob:370
#, c-format
msgid "unable to transfer data: %s"
msgstr "impossible de transférer des données: %s"
-#: src/mn-gmail-mailbox.c:283
-#, c-format
-msgid "successfully logged into Gmail as user %s"
-msgstr "ouverture de la session Gmail en tant que %s effectuée avec succès"
-
-#: src/mn-gmail-mailbox.c:288
+#: src/mn-gmail-mailbox.gob:219 src/mn-gmail-mailbox.gob:252
+#: src/mn-gmail-mailbox.gob:286
msgid "login failed"
msgstr "l'ouverture de session a échoué"
-#: src/mn-gmail-mailbox.c:341
-#, c-format
-msgid "searching for unread mail in %s"
-msgstr "recherche du courrier non lu dans %s"
+#: src/mn-gmail-mailbox.gob:280
+msgid "successfully logged in"
+msgstr "ouverture de session effectuée avec succès"
+
+#: src/mn-gmail-mailbox.gob:358
+msgid "searching for unread mail"
+msgstr "recherche du courrier non lu"
-#: src/mn-gmail-mailbox.c:363
+#: src/mn-gmail-mailbox.gob:377
msgid "unable to parse Gmail data"
msgstr "impossible d'interpréter les données Gmail"
-#: src/mn-mail-icon.c:130
-msgid "You have no new mail"
-msgstr "Vous n'avez pas de courrier"
+#: src/mn-imap-mailbox-properties.gob:92
+msgid "Mailbox:"
+msgstr "Boîte aux lettres:"
-#: src/mn-mailbox-properties-dialog.c:155
+#: src/mn-imap-mailbox-properties.gob:96
+msgid "in_box"
+msgstr "_boîte de réception"
+
+#: src/mn-imap-mailbox-properties.gob:107
+msgid "oth_er:"
+msgstr "autr_e:"
+
+#: src/mn-imap-mailbox-properties.gob:121
+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
+msgid "Your username on the IMAP server"
+msgstr "Votre nom d'utilisateur sur le serveur IMAP"
+
+#: src/mn-imap-mailbox-properties.gob:123
+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
+msgid "The port number of the IMAP server"
+msgstr "Le numéro de port du serveur IMAP"
+
+#: src/mn-imap-mailbox-properties.gob:126
+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:195
+msgid "server did not send capabilities"
+msgstr "le serveur n'a pas envoyé ses possibilités"
+
+#: src/mn-imap-mailbox.gob:267
+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
+msgid "unable to login"
+msgstr "impossible d'ouvrir la session"
+
+#. compliance error
+#: src/mn-imap-mailbox.gob:319
+msgid "server did not send status"
+msgstr "le serveur n'a pas envoyé de status"
+
+#: src/mn-imap-mailbox.gob:537 src/mn-pop3-mailbox.gob:715
+msgid "unknown server error"
+msgstr "erreur serveur inconnue"
+
+#: src/mn-imap-mailbox.gob:603 src/mn-pop3-mailbox.gob:645
+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 "
+"n'a pas été inclus lors de la compilation"
+
+#: src/mn-imap-mailbox.gob:611 src/mn-pop3-mailbox.gob:657
+#, c-format
+msgid "unknown authentication mechanism \"%s\""
+msgstr "méchanisme d'authentification inconnu \"%s\""
+
+#: src/mn-imap-mailbox.gob:629
+msgid "falling back to IMAP LOGIN authentication"
+msgstr "rétrogradation vers l'authentification IMAP LOGIN"
+
+#: src/mn-imap-mailbox.gob:633 src/mn-pop3-mailbox.gob:691
+msgid "authentication failed"
+msgstr "l'authentification a échoué"
+
+#: src/mn-mail-icon.gob:81
+msgid "_Update"
+msgstr "_Mettre à Jour"
+
+#: src/mn-mail-icon.gob:87
+msgid "R_emove From Notification Area"
+msgstr "_Enlever de l'Aire de Notification"
+
+#: src/mn-mail-icon.gob:172
+#, c-format
+msgid "_Run %s"
+msgstr "_Exécuter %s"
+
+#: src/mn-mail-icon.gob:173
+msgid "_Run Default Action"
+msgstr "_Exécuter l'Action par Défaut"
+
+#: src/mn-mailbox-properties-dialog.c:109
msgid "Add a Mailbox"
msgstr "Ajouter une Boîte aux Lettres"
-#: src/mn-mailbox-properties-dialog.c:182
-msgid "autodetect"
-msgstr "détecter automatiquement"
-
-#: src/mn-mailbox-properties-dialog.c:394
+#: src/mn-mailbox-properties-dialog.c:331
#, c-format
msgid "%s Properties"
msgstr "Propriétés de %s"
-#: src/mn-mailbox-properties-dialog.c:580
-msgid "Select a File or Folder"
-msgstr "Sélectionnez un Fichier ou Dossier"
+#: src/mn-mailbox-properties-util.c:75
+msgid "_Username:"
+msgstr "_Nom d'utilisateur:"
+
+#: src/mn-mailbox-properties-util.c:79
+msgid "_Password:"
+msgstr "_Mot de passe:"
+
+#: src/mn-mailbox-properties-util.c:146
+msgid "Connection type:"
+msgstr "Type de connection:"
+
+#: src/mn-mailbox-properties-util.c:153
+msgid "Port:"
+msgstr "Port:"
+
+#: src/mn-mailbox-properties-util.c:180
+msgid "_Authentication mechanism:"
+msgstr "Méchanisme d'_authentification:"
+
+#: src/mn-mailbox-properties.c:63
+msgid "Label"
+msgstr "Etiquette"
+
+#: src/mn-mailbox-properties.c:64
+msgid "The marked up text to show in the type combo box"
+msgstr "Le texte marqué à afficher dans la boîte de type"
-#: src/mn-mailbox.c:199
-msgid "URI"
-msgstr "URI"
+#: src/mn-mailbox-properties.c:69
+msgid "Size group"
+msgstr "Groupe de taille"
-#: src/mn-mailbox.c:200
+#: src/mn-mailbox-properties.c:70
+msgid "A GtkSizeGroup for aligning control labels"
+msgstr "Un GtkSizeGroup pour aligner les étiquettes des contrôles"
+
+#: src/mn-mailbox-properties.c:75
+msgid "Complete"
+msgstr "Complet"
+
+#: src/mn-mailbox-properties.c:76
+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
+msgid "Mailbox"
+msgstr "Boîte aux lettres"
+
+#: src/mn-mailbox-view.gob:297
+msgid "Format"
+msgstr "Format"
+
+#: src/mn-mailbox.gob:88
msgid "The mailbox URI"
msgstr "L'URI de la boîte aux lettres"
-#: src/mn-mailbox.c:206
-msgid "Name"
-msgstr "Nom"
-
-#: src/mn-mailbox.c:207
+#: src/mn-mailbox.gob:98
msgid "The mailbox human-readable name"
msgstr "Le nom, lisible par un humain, de la boîte aux lettres"
-#: src/mn-mailbox.c:213
-msgid "Automatic"
-msgstr "Automatique"
-
-#: src/mn-mailbox.c:214
+#: src/mn-mailbox.gob:102
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.c:220
-msgid "Has new"
-msgstr "A du nouveau"
-
-#: src/mn-mailbox.c:221
+#: src/mn-mailbox.gob:107
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.c:227
-msgid "Error"
-msgstr "Erreur"
-
-#: src/mn-mailbox.c:228
-msgid "The mailbox error if any"
+#: src/mn-mailbox.gob:112
+msgid "The mailbox error, if any"
msgstr "L'erreur de la boîte aux lettres si il y en a une"
-#: src/mn-mailbox.c:254
-#, c-format
-msgid "unable to cancel monitoring of %s: %s"
-msgstr "impossible d'annuler la surveillance de %s: %s"
-
-#: src/mn-mailbox.c:443
+#: src/mn-mailbox.gob:218
msgid "does not exist"
msgstr "n'existe pas"
-#: src/mn-mailbox.c:460
+#: src/mn-mailbox.gob:255
msgid "unknown format"
msgstr "format inconnu"
-#: src/mn-mailbox.c:553
+#: src/mn-mailbox.gob:316
#, c-format
msgid "unable to monitor %s: %s"
msgstr "impossible de surveiller %s: %s"
-#: src/mn-mailbox.c:567
+#: src/mn-mailbox.gob:330
#, c-format
msgid ""
"As a fallback, they will be checked every %i second (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgid_plural ""
"As a fallback, they will be checked every %i seconds (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgstr[0] ""
"Comme solution de secours, elles seront vérifiées toutes les %i seconde (ce "
-"délai est configurable depuis les Préférences)."
+"délai est configurable depuis les Propriétés)."
msgstr[1] ""
"Comme solution de secours, elles seront vérifiées toutes les %i secondes (ce "
-"délai est configurable depuis les Préférences)."
+"délai est configurable depuis les Propriétés)."
-#: src/mn-mailbox.c:578
+#: src/mn-mailbox.gob:341
#, c-format
msgid ""
"As a fallback, they will be checked every %i minute (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgid_plural ""
"As a fallback, they will be checked every %i minutes (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgstr[0] ""
"Comme solution de secours, elles seront vérifiées toutes les %i minutes (ce "
-"délai est configurable depuis les Préférences)."
+"délai est configurable depuis les Propriétés)."
msgstr[1] ""
"Comme solution de secours, elles seront vérifiées toutes les %i minutes (ce "
-"délai est configurable depuis les Préférences)."
+"délai est configurable depuis les Propriétés)."
-#: src/mn-mailbox.c:589
+#: src/mn-mailbox.gob:352
#, c-format
msgid ""
"As a fallback, they will be checked approximately every %i minute (this "
-"delay is configurable from the Preferences Dialog)."
+"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 Preferences Dialog)."
+"delay is configurable from the Properties Dialog)."
msgstr[0] ""
"Comme solution de secours, elles seront vérifiées approximativement toutes "
-"les %i minute (ce délai est configurable depuis les Préférences)."
+"les %i minute (ce délai est configurable depuis les Propriétés)."
msgstr[1] ""
"Comme solution de secours, elles seront vérifiées approximativement toutes "
-"les %i minutes (ce délai est configurable depuis les Préférences)."
+"les %i minutes (ce délai est configurable depuis les Propriétés)."
-#: src/mn-mailbox.c:603
-msgid "A monitoring error has occurred."
-msgstr "Une erreur de surveillance s'est produite."
+#: src/mn-mailbox.gob:366
+msgid "A monitoring error has occurred"
+msgstr "Une erreur de surveillance s'est produite"
-#: src/mn-mailbox.c:604
+#: src/mn-mailbox.gob:367
#, c-format
msgid ""
"Mail Notification was unable to enable automatic notification for one or "
@@ -279,369 +651,389 @@ msgstr ""
"Notification de Courrier n'a pas été en mesure d'activer la notification "
"automatique pour une ou plusieures boîtes aux lettres. %s"
-#: src/mn-mailboxes.c:133
+#: src/mn-mailboxes.gob:130
+#, c-format
+msgid "%s is unsupported: %s"
+msgstr "%s n'est pas pris en charge: %s"
+
+#: src/mn-mailboxes.gob:157
#, c-format
msgid "%s has new mail"
msgstr "%s a du nouveau courrier"
-#: src/mn-mailboxes.c:133
+#: src/mn-mailboxes.gob:157
#, c-format
msgid "%s has no new mail"
msgstr "%s n'a pas de nouveau courrier"
-#: src/mn-mailboxes.c:143
+#: src/mn-mailboxes.gob:173
#, c-format
msgid "%s reported an error: %s"
msgstr "%s a indiqué une erreur: %s"
-#: src/mn-maildir-mailbox.c:226 src/mn-sylpheed-mailbox.c:209
+#: src/mn-maildir-mailbox.gob:97
#, c-format
-msgid "error while reading folder: %s"
-msgstr "erreur lors de la lecture du dossier: %s"
+msgid "unable to open folder \"new\": %s"
+msgstr "impossible d'ouvrir le dossier \"new\": %s"
+
+#: src/mn-maildir-mailbox.gob:122
+#, c-format
+msgid "error while reading folder \"new\": %s"
+msgstr "erreur lors de la lecture du dossier \"new\": %s"
+
+#: src/mn-main.c:86
+#, 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:49
-msgid "Compiled in handlers:\n"
-msgstr "Prises en charge disponibles:\n"
+#: src/mn-main.c:104
+#, c-format
+msgid "Compiled-in features: %s\n"
+msgstr "Fonctionnalités disponibles: %s\n"
-#: src/mn-main.c:83
+#: src/mn-main.c:133
msgid "Enable informational output"
msgstr "Activer la sortie informationelle"
-#: src/mn-main.c:92
-msgid "List compiled-in handlers and exit"
-msgstr "Afficher les prises en charge disponibles et quitter"
+#: src/mn-main.c:142
+msgid "List compiled-in features and exit"
+msgstr "Afficher les fonctionnalités disponibles et quitter"
-#: src/mn-main.c:124
-msgid "unable to initialize GnomeVFS"
-msgstr "impossible d'initialiser GnomeVFS"
+#: src/mn-main.c:151
+msgid "Display the properties dialog"
+msgstr "Afficher la boîte de dialogue contenant les propriétés"
-#: src/mn-mbox-mailbox.c:339
-#, c-format
-msgid "unable to get mailbox information: %s"
-msgstr "impossible d'obtenir les informations de la boîte aux lettres: %s"
+#: src/mn-main.c:160
+msgid "Display the about dialog"
+msgstr "Afficher la boîte de dialogue \"à propos\""
-#: src/mn-mbox-mailbox.c:364
-#, c-format
-msgid "unable to open mailbox: %s"
-msgstr "impossible d'ouvrir la boîte aux lettres: %s"
+#: src/mn-main.c:169
+msgid "Update the mail status"
+msgstr "Mettre à jour le status du courrier"
+
+#: src/mn-main.c:178
+msgid "Report the mail status"
+msgstr "Rapporter le status du courrier"
+
+#.
+#. * We can't use mn_error_dialog() because gtk_init() has not been
+#. * called yet.
+#.
+#: src/mn-main.c:204
+msgid "multi-threading is not available"
+msgstr "le multi-threading n'est pas disponible"
+
+#: src/mn-main.c:244
+msgid "Unable to initialize the GnomeVFS library."
+msgstr "Impossible d'initialiser la bibliothèque GnomeVFS."
+
+#: src/mn-main.c:252
+msgid ""
+"Bonobo could not locate the automation object. Please check your Mail "
+"Notification installation."
+msgstr ""
+"Bonobo n'a pas pu localiser l'objet automation. Veuillez vérifier votre "
+"installation de la Notification de Courrier."
+
+#: src/mn-main.c:263
+msgid "updating the mail status"
+msgstr "mise à jour du status du courrier"
+
+#: src/mn-main.c:279
+msgid "Mail Notification is already running"
+msgstr "La Notification de Courrier est déjà en cours d'exécution"
+
+#: src/mn-main.c:286
+msgid ""
+"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
+"Please check your Mail Notification installation."
+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:290
+msgid ""
+"Bonobo was unable to register the automation server. Please check your Mail "
+"Notification installation."
+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.c:401
+#: src/mn-mbox-mailbox.gob:165
#, 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.c:417
+#: src/mn-mbox-mailbox.gob:173
#, c-format
-msgid "unable to close mailbox: %s"
-msgstr "impossible de fermer la boîte aux lettres: %s"
-
-#: src/mn-mh-mailbox.c:185
-#, c-format
-msgid "unable to open .mh_sequences: %s"
-msgstr "impossible d'ouvrir .mh_sequences: %s"
+msgid "unable to open mailbox: %s"
+msgstr "impossible d'ouvrir la boîte aux lettres: %s"
-#: src/mn-mh-mailbox.c:215
+#: src/mn-mh-mailbox.gob:111
#, c-format
msgid "error while reading .mh_sequences: %s"
msgstr "erreur lors de la lecture de .mh_sequences: %s"
-#: src/mn-mh-mailbox.c:231
+#: src/mn-mh-mailbox.gob:119
#, c-format
-msgid "unable to close .mh_sequences: %s"
-msgstr "impossible de fermer .mh_sequences: %s"
+msgid "unable to open .mh_sequences: %s"
+msgstr "impossible d'ouvrir .mh_sequences: %s"
-#: src/mn-pending-mailbox.c:64
-msgid "detecting..."
-msgstr "en cours de détection..."
+#: src/mn-pending-mailbox.gob:33
+msgid "detecting"
+msgstr "en cours de détection"
-#: src/mn-pop3-mailbox.c:164
-msgid "unable to parse POP3 URI"
-msgstr "impossible d'interpréter l'URI POP3"
+#: src/mn-pi-mailbox-properties.gob:75
+msgid "_Hostname:"
+msgstr "Nom d'_hôte:"
-#: src/mn-pop3-mailbox.c:190
-#, c-format
-msgid "connecting to POP3 server %s"
-msgstr "connection au server POP3 %s en cours"
+#: src/mn-pi-mailbox-properties.gob:93
+msgid "_Details"
+msgstr "_Détails"
-#: src/mn-pop3-mailbox.c:227
-#, c-format
-msgid "successfully connected to %s"
-msgstr "connecté à %s"
+#: src/mn-pi-mailbox-properties.gob:105
+msgid "sta_ndard"
+msgstr "sta_ndard"
-#: src/mn-pop3-mailbox.c:233
-msgid "unable to connect to server"
-msgstr "impossible de se connecter au serveur"
+#: src/mn-pi-mailbox-properties.gob:115
+msgid "_SSL"
+msgstr "_SSL"
-#: src/mn-pop3-mailbox.c:238
-msgid "connection to server unexpectedly closed"
-msgstr "la connection au serveur s'est close de manière inattendue"
+#: src/mn-pop3-mailbox-properties.gob:84
+msgid "The hostname or IP address of the POP3 server"
+msgstr "Le nom d'hôte ou adresse IP du serveur POP3"
-#: src/mn-pop3-mailbox.c:277
-#, c-format
-msgid "invalid STAT reply \"%s\""
-msgstr "réponse STAT \"%s\" invalide"
+#: src/mn-pop3-mailbox-properties.gob:85
+msgid "Your username on the POP3 server"
+msgstr "Votre nom d'utilisateur sur le serveur POP3"
+
+#: src/mn-pop3-mailbox-properties.gob:86
+msgid "Your password on the POP3 server"
+msgstr "Votre mot de passe sur le serveur POP3"
+
+#: src/mn-pop3-mailbox-properties.gob:87 src/mn-pop3-mailbox-properties.gob:88
+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.c:296
-msgid "unknown error"
-msgstr "erreur inconnue"
+#: src/mn-pop3-mailbox.gob:267
+msgid "invalid arguments for the LOGIN-DELAY capability"
+msgstr "arguments invalides pour la possibilité LOGIN-DELAY"
-#: src/mn-pop3-mailbox.c:317
+#: src/mn-pop3-mailbox.gob:495
#, c-format
-msgid "invalid reply \"%s\""
-msgstr "réponse \"%s\" invalide"
+msgid "honouring LOGIN-DELAY, sleeping for %i second"
+msgid_plural "honouring LOGIN-DELAY, sleeping for %i seconds"
+msgstr[0] ""
+msgstr[1] ""
-#: src/mn-preferences.c:195
-msgid "Mailbox"
-msgstr "Boîte aux lettres"
+#: src/mn-pop3-mailbox.gob:653
+msgid "server does not support APOP authentication"
+msgstr "le serveur ne supporte pas l'authentification APOP"
-#: src/mn-preferences.c:209
-msgid "Format"
-msgstr "Format"
+#: src/mn-pop3-mailbox.gob:681
+msgid "falling back to APOP authentication"
+msgstr "rétrogradation vers l'authentification APOP"
-#: src/mn-preferences.c:361
+#: src/mn-pop3-mailbox.gob:686
+msgid "falling back to USER/PASS authentication"
+msgstr "rétrogradation vers l'authentification USER/PASS"
+
+#: src/mn-properties.c:132
msgid "No mailbox selected."
msgstr "Pas de boîte aux lettres sélectionnée."
-#: src/mn-preferences.c:366
+#: src/mn-properties.c:137
#, 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-preferences.c:429
-msgid "Unable to add mailbox."
-msgstr "Impossible d'ajouter la boîte aux lettres."
+#: src/mn-shell.gob:191
+msgid "A command error has occurred"
+msgstr "Une erreur de commande s'est produite"
-#: src/mn-preferences.c:429
-msgid "The mailbox is already in the list."
-msgstr "La boîte aux lettres est déjà dans la liste."
-
-#: src/mn-ui.c:87
-msgid "A command error has occurred."
-msgstr "Une erreur de commande s'est produite."
-
-#: src/mn-ui.c:88
+#: src/mn-shell.gob:192
#, c-format
-msgid "Unable to execute clicked command: %s."
-msgstr "Impossible d'exécuter la commande associée au click sur l'icône: %s."
+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-ui.c:184
+#: src/mn-shell.gob:297
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-ui.c:191
+#: src/mn-shell.gob:301
msgid "You have no new mail."
msgstr "Vous n'avez pas de nouveau courrier."
-#: src/mn-ui.c:195
+#: src/mn-shell.gob:304
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-ui.c:200
+#: src/mn-shell.gob:309
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-ui.c:217
-msgid "No mailboxes are being monitored."
-msgstr "Aucune boîte aux lettres n'est surveillée."
+#: src/mn-shell.gob:325
+msgid "You have new mail."
+msgstr "Vous avez du nouveau courrier."
-#: src/mn-ui.c:265
-msgid "A Mail Notification Icon"
-msgstr "Une Icône de Notification de Courrier"
+#: src/mn-shell.gob:338
+msgid "A command error has occurred in Mail Notification"
+msgstr "Une erreur de commande s'est produite dans la Notification de Courrier"
-#: src/mn-ui.c:268
-msgid "Jean-Yves Lefort <jylefort@brutele.be>"
-msgstr "Jean-Yves Lefort <jylefort@brutele.be>"
+#: src/mn-shell.gob:339
+#, 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-unsupported-mailbox.c:98
-msgid "unsupported"
-msgstr "non pris en charge"
+#: src/mn-stock.c:28
+msgid "Select _All"
+msgstr "Sélectionner _Tout"
+
+#: src/mn-sylpheed-mailbox.gob:83
+#, c-format
+msgid "unable to open folder: %s"
+msgstr "impossible d'ouvrir le dossier: %s"
+
+#: src/mn-sylpheed-mailbox.gob:114
+#, 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:617
+msgid "System Mailbox"
+msgstr "Boîte aux Lettres Système"
-#: src/mn-unsupported-mailbox.c:103
-msgid "Reason"
-msgstr "Raison"
+#: src/mn-system-mailbox-properties.gob:56
+#, 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-unsupported-mailbox.c:104
+#: src/mn-system-mailbox-properties.gob:63
+msgid ""
+"The location of your system mailbox could not be detected. Please set the "
+"MAIL environment variable."
+msgstr ""
+"L'emplacement de votre boîte aux lettres système n'a pu être détecté. "
+"Veuillez spécifier la variable d'environnement MAIL."
+
+#: src/mn-unsupported-mailbox.gob:31
msgid "The reason why the mailbox is unsupported"
msgstr "La raison pour laquelle la boîte aux lettres n'est pas prise en charge"
-#: src/mn-util.c:113
+#: src/mn-unsupported-mailbox.gob:38
+msgid "unsupported"
+msgstr "non pris en charge"
+
+#: src/mn-util.c:116
#, c-format
msgid "error loading image: %s"
msgstr "erreur de chargement d'image: %s"
-#: src/mn-util.c:151
+#: src/mn-util.c:154
#, c-format
msgid "widget %s not found in interface %s"
msgstr "élément %s non trouvé dans interface %s"
-#: src/mn-util.c:258
+#: src/mn-util.c:261
msgid "received an invalid URI list"
msgstr "une liste d'URI invalide a été reçue"
-#: src/mn-util.c:294
+#: src/mn-util.c:297
msgid "received an invalid Mozilla URL"
msgstr "une URL Mozilla invalide a été reçue"
-#: src/mn-util.c:386
-msgid "Unable to display help."
-msgstr "Impossible d'afficher l'aide."
-
-#: ui/mailbox-properties.glade.h:1 ui/preferences.glade.h:2
-msgid "*"
-msgstr "*"
-
-#: ui/mailbox-properties.glade.h:2
-msgid "P_ort:"
-msgstr "P_ort:"
+#: src/mn-util.c:389
+msgid "Unable to display help"
+msgstr "Impossible d'afficher l'aide"
-#: ui/mailbox-properties.glade.h:3
-msgid "The URI of the mailbox"
-msgstr "L'URI de la boîte aux lettres"
-
-#: ui/mailbox-properties.glade.h:4
-msgid "The hostname or IP address of the POP3 server"
-msgstr "Le nom d'hôte ou adresse IP du serveur POP3"
-
-#: ui/mailbox-properties.glade.h:5
-msgid "The port number of the POP3 server"
-msgstr "Le numéro de port du serveur POP3"
-
-#: ui/mailbox-properties.glade.h:6
-msgid ""
-"This mailbox type has not been compiled in and is therefore unsupported."
-msgstr ""
-"Ce type de boîte aux lettres n'a pas été inclus lors de la compilation et "
-"n'est donc pas pris en charge."
-
-#: ui/mailbox-properties.glade.h:7
-msgid "Your Gmail password"
-msgstr "Votre mot de passe Gmail"
-
-#: ui/mailbox-properties.glade.h:8
-msgid "Your Gmail username"
-msgstr "Votre nom d'utilisateur Gmail"
-
-#: ui/mailbox-properties.glade.h:9
-msgid "Your password on the POP3 server"
-msgstr "Votre mot de passe sur le serveur POP3"
-
-#: ui/mailbox-properties.glade.h:10
-msgid "Your username on the POP3 server"
-msgstr "Votre nom d'utilisateur sur le serveur POP3"
-
-#: ui/mailbox-properties.glade.h:11
-msgid "_Browse..."
-msgstr "_Parcourir..."
-
-#: ui/mailbox-properties.glade.h:12
-msgid "_Hostname:"
-msgstr "Nom d'_hôte:"
-
-#: ui/mailbox-properties.glade.h:13
-msgid "_Location:"
-msgstr "_Emplacement:"
-
-#: ui/mailbox-properties.glade.h:14
-msgid "_Password:"
-msgstr "_Mot de passe:"
-
-#: ui/mailbox-properties.glade.h:15
-msgid "_Type:"
-msgstr "_Type:"
-
-#: ui/mailbox-properties.glade.h:16
-msgid "_Username:"
-msgstr "_Nom d'utilisateur:"
-
-#: ui/menu.glade.h:1
-msgid "Show help"
-msgstr "Afficher l'aide"
-
-#: ui/menu.glade.h:2
-msgid "Update the icon"
-msgstr "Mettre l'icône à jour"
+#: src/mn-util.c:403
+#, c-format
+msgid "Unable to create a thread: %s."
+msgstr "Impossible de créer un thread: %s."
-#: ui/menu.glade.h:3
-msgid "_Help"
-msgstr "_Aide"
+#: ui/mailbox-properties.glade.h:1
+msgid "_Mailbox type:"
+msgstr "_Type de boîte aux lettres:"
-#: ui/menu.glade.h:4
-msgid "_Update"
-msgstr "_Mettre à jour"
-
-#: ui/preferences.glade.h:1
+#: ui/properties.glade.h:1
msgid " "
msgstr " "
-#: ui/preferences.glade.h:3
+#: ui/properties.glade.h:2
+msgid "*"
+msgstr "*"
+
+#: ui/properties.glade.h:3
msgid "<span weight=\"bold\">Commands</span>"
msgstr "<span weight=\"bold\">Commandes</span>"
-#: ui/preferences.glade.h:4
+#: ui/properties.glade.h:4
msgid "<span weight=\"bold\">General</span>"
msgstr "<span weight=\"bold\">Général</span>"
-#: ui/preferences.glade.h:5
+#: ui/properties.glade.h:5
msgid "<span weight=\"bold\">Mailboxes</span>"
msgstr "<span weight=\"bold\">Boîtes aux lettres</span>"
-#: ui/preferences.glade.h:6
-msgid "Mail Notification Preferences"
-msgstr "Préférences de la Notification de Courrier"
+#: ui/properties.glade.h:6
+msgid "Mail Notification Properties"
+msgstr "Propriétés de la Notification de Courrier"
-#: ui/preferences.glade.h:7
+#: ui/properties.glade.h:7
msgid "The amount of time to wait between mail checks"
msgstr "La quantité de temps à attendre entre les vérifications de courrier"
-#: ui/preferences.glade.h:8
+#: ui/properties.glade.h:8
msgid "The command to run when new mail arrives"
msgstr "La commande à exécuter lorsque du nouveau courrier arrive"
-#: ui/preferences.glade.h:9
-msgid "The command to run when the icon is clicked"
-msgstr "La commande à exécuter lorsque l'îcone est cliquée"
+#: ui/properties.glade.h:9
+msgid "The command to run when the icon is double-clicked"
+msgstr "La commande à exécuter lorsque l'îcone est double-cliquée"
-#: ui/preferences.glade.h:10
+#: ui/properties.glade.h:10
msgid "When _new mail arrives:"
msgstr "Lorsque du _nouveau courrier arrive:"
-#: ui/preferences.glade.h:11
-msgid "When click_ed:"
-msgstr "Lorsque l'îcone est cliqué_e:"
+#: ui/properties.glade.h:11
+msgid "When double-click_ed:"
+msgstr "Lorsque l'îcone est double-cliqué_e:"
-#: ui/preferences.glade.h:12
+#: ui/properties.glade.h:12
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/preferences.glade.h:13
-msgid "Whether to run a command when the icon is clicked or not"
-msgstr "Si une commande doit être exécutée lorsque l'îcone est cliquée ou pas"
-
-#: ui/preferences.glade.h:14
-msgid "_Add"
-msgstr "_Ajouter"
+#: ui/properties.glade.h:13
+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/preferences.glade.h:15
+#: ui/properties.glade.h:14
msgid "_Delay between mail checks:"
msgstr "_Délai entre les vérifications de courrier:"
-#: ui/preferences.glade.h:16
-msgid "_Remove"
-msgstr "_Enlever"
-
-#: ui/preferences.glade.h:17
+#: ui/properties.glade.h:15
msgid "minutes"
msgstr "minutes"
-#: ui/preferences.glade.h:18
+#: ui/properties.glade.h:16
msgid "seconds"
msgstr "secondes"
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-07-21 18:10+0200\n"
+"POT-Creation-Date: 2004-08-16 18:15+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"
@@ -17,28 +17,43 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-#: data/mail-notification.desktop.in.h:1
-msgid "Get notified when new mail arrives"
+#: data/GNOME_MailNotification_Automation.server.in.in.h:1
+msgid "Mail Notification automation"
+msgstr ""
+
+#: data/GNOME_MailNotification_Automation.server.in.in.h:2
+msgid "Mail Notification automation factory"
+msgstr ""
+
+#: data/mail-notification-properties.desktop.in.h:1
+msgid "Configure Mail Notification"
msgstr ""
-#: data/mail-notification.desktop.in.h:2 src/mn-main.c:112 src/mn-ui.c:262
+#: 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
msgid "Mail Notification"
msgstr ""
+#: data/mail-notification.desktop.in.h:1
+msgid "Get notified when new mail arrives"
+msgstr ""
+
#: data/mail-notification.schemas.in.h:1
-msgid "Clicked command"
+msgid "Delay between mail checks (minutes part)."
msgstr ""
#: data/mail-notification.schemas.in.h:2
-msgid "Delay between mail checks (minutes part)."
+msgid "Delay between mail checks (seconds part)."
msgstr ""
#: data/mail-notification.schemas.in.h:3
-msgid "Delay between mail checks (seconds part)."
+msgid "Double-clicked command"
msgstr ""
#: data/mail-notification.schemas.in.h:4
-msgid "Height of preferences dialog"
+msgid "Height of properties dialog"
msgstr ""
#: data/mail-notification.schemas.in.h:5
@@ -58,7 +73,7 @@ msgid "Run a command when new mail arrives"
msgstr ""
#: data/mail-notification.schemas.in.h:9
-msgid "Run a command when the icon is clicked"
+msgid "Run a command when the icon is double-clicked"
msgstr ""
#: data/mail-notification.schemas.in.h:10
@@ -70,11 +85,11 @@ msgid "The command to run when new mail arrives."
msgstr ""
#: data/mail-notification.schemas.in.h:12
-msgid "The command to run when the icon is clicked."
+msgid "The command to run when the icon is double-clicked."
msgstr ""
#: data/mail-notification.schemas.in.h:13
-msgid "The height of the preferences dialog in pixels."
+msgid "The height of the properties dialog in pixels."
msgstr ""
#: data/mail-notification.schemas.in.h:14
@@ -82,7 +97,7 @@ msgid "The list of mailboxes to monitor."
msgstr ""
#: data/mail-notification.schemas.in.h:15
-msgid "The width of the preferences dialog in pixels."
+msgid "The width of the properties dialog in pixels."
msgstr ""
#: data/mail-notification.schemas.in.h:16
@@ -90,11 +105,15 @@ msgid "Whether to run a command when new mail arrives or not."
msgstr ""
#: data/mail-notification.schemas.in.h:17
-msgid "Whether to run a command when the icon is clicked or not."
+msgid "Whether to run a command when the icon is double-clicked or not."
msgstr ""
#: data/mail-notification.schemas.in.h:18
-msgid "Width of preferences dialog"
+msgid "Width of properties dialog"
+msgstr ""
+
+#: data/mail-notification.soundlist.in.h:2
+msgid "New Mail"
msgstr ""
#: src/eggtrayicon.c:109
@@ -105,521 +124,869 @@ msgstr ""
msgid "The orientation of the tray."
msgstr ""
-#: src/mn-gmail-mailbox.c:165
-msgid "unable to parse Gmail URI"
+#: src/mn-about-dialog.gob:41
+msgid "A Mail Notification Icon"
+msgstr ""
+
+#: src/mn-about-dialog.gob:44
+msgid "Jean-Yves Lefort <jylefort@brutele.be>"
+msgstr ""
+
+#: src/mn-auth-combo-box.gob:99 src/mn-autodetect-mailbox-properties.gob:36
+msgid "<span style=\"italic\">autodetect</span>"
msgstr ""
-#: src/mn-gmail-mailbox.c:261
+#: src/mn-autodetect-mailbox-properties.gob:67
+msgid "_Location:"
+msgstr ""
+
+#: src/mn-autodetect-mailbox-properties.gob:73
+msgid "_Browse..."
+msgstr ""
+
+#: src/mn-autodetect-mailbox-properties.gob:80
+msgid "The URI of the mailbox"
+msgstr ""
+
+#: src/mn-autodetect-mailbox-properties.gob:117
+msgid "Select a File or Folder"
+msgstr ""
+
+#: src/mn-blinking-image.gob:30
+msgid "Whether the image is blinking or not"
+msgstr ""
+
+#: src/mn-client-session.c:196 src/mn-client-session.c:203
#, c-format
-msgid "logging into Gmail as user %s"
+msgid "unable to read from server: %s"
msgstr ""
-#: src/mn-gmail-mailbox.c:277 src/mn-gmail-mailbox.c:356
+#: src/mn-client-session.c:201
+msgid "unable to read from server: EOF"
+msgstr ""
+
+#: src/mn-client-session.c:213
#, c-format
-msgid "unable to transfer data: %s"
+msgid "unable to decode data using SASL: %s"
msgstr ""
-#: src/mn-gmail-mailbox.c:283
+#: src/mn-client-session.c:287
#, c-format
-msgid "successfully logged into Gmail as user %s"
+msgid "resolving %s"
msgstr ""
-#: src/mn-gmail-mailbox.c:288
-msgid "login failed"
+#: src/mn-client-session.c:297
+#, c-format
+msgid "unable to resolve %s: %s"
+msgstr ""
+
+#: src/mn-client-session.c:334
+#, c-format
+msgid "%s: unsupported address family"
msgstr ""
-#: src/mn-gmail-mailbox.c:341
+#: src/mn-client-session.c:341
#, c-format
-msgid "searching for unread mail in %s"
+msgid "%s: unable to create socket: %s"
msgstr ""
-#: src/mn-gmail-mailbox.c:363
+#: src/mn-client-session.c:345
+#, c-format
+msgid "connecting to %s (%s) port %i"
+msgstr ""
+
+#: src/mn-client-session.c:348
+#, c-format
+msgid "unable to connect: %s"
+msgstr ""
+
+#: src/mn-client-session.c:353
+msgid "connected successfully"
+msgstr ""
+
+#. if reached, we couldn't find a working address
+#: src/mn-client-session.c:359
+#, c-format
+msgid "unable to connect to %s"
+msgstr ""
+
+#: src/mn-client-session.c:375
+#, c-format
+msgid "unable to initialize the OpenSSL library: %s"
+msgstr ""
+
+#: src/mn-client-session.c:383
+#, c-format
+msgid "unable to create a SSL object: %s"
+msgstr ""
+
+#: src/mn-client-session.c:389
+#, c-format
+msgid "unable to set the SSL file descriptor: %s"
+msgstr ""
+
+#: src/mn-client-session.c:444
+#, c-format
+msgid "response \"%s\" is not valid in current context"
+msgstr ""
+
+#: src/mn-client-session.c:470
+#, c-format
+msgid "unable to parse response \"%s\""
+msgstr ""
+
+#: src/mn-client-session.c:517
+#, c-format
+msgid "unable to encode data using SASL: %s"
+msgstr ""
+
+#: src/mn-client-session.c:546 src/mn-client-session.c:553
+#, c-format
+msgid "unable to write to server: %s"
+msgstr ""
+
+#: src/mn-client-session.c:551
+msgid "unable to write to server: EOF"
+msgstr ""
+
+#: src/mn-client-session.c:583
+#, c-format
+msgid "unable to encode Base64: %s"
+msgstr ""
+
+#: src/mn-client-session.c:686
+#, c-format
+msgid "unable to initialize the SASL library: %s"
+msgstr ""
+
+#: src/mn-client-session.c:695
+#, c-format
+msgid "unable to retrieve local address of socket: %s"
+msgstr ""
+
+#: src/mn-client-session.c:701
+#, c-format
+msgid "unable to retrieve remote address of socket: %s"
+msgstr ""
+
+#: src/mn-client-session.c:735
+#, c-format
+msgid "warning: unable to set SASL security properties: %s"
+msgstr ""
+
+#: src/mn-client-session.c:774
+msgid ""
+"unable to start SASL authentication: SASL asked for something we did not know"
+msgstr ""
+
+#: src/mn-client-session.c:778
+#, c-format
+msgid "unable to start SASL authentication: %s"
+msgstr ""
+
+#: src/mn-client-session.c:782
+#, c-format
+msgid "unable to create a SASL connection: %s"
+msgstr ""
+
+#: src/mn-client-session.c:832
+msgid "SASL asked for something we did not know, aborting SASL authentication"
+msgstr ""
+
+#: src/mn-client-session.c:836
+#, c-format
+msgid "%s, aborting SASL authentication"
+msgstr ""
+
+#. compliance error
+#: src/mn-client-session.c:841
+#, c-format
+msgid "unable to decode Base64 input from server: %s"
+msgstr ""
+
+#: src/mn-client-session.c:844
+msgid ""
+"the server sent a SASL challenge, but there was a pending initial SASL "
+"client response"
+msgstr ""
+
+#: src/mn-client-session.c:858
+msgid ""
+"the server did not send a SASL challenge, but there was no pending initial "
+"SASL client response"
+msgstr ""
+
+#: src/mn-client-session.c:881
+#, 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:886
+#, c-format
+msgid "unable to get SASL_MAXOUTBUF property: %s"
+msgstr ""
+
+#: src/mn-client-session.c:892
+#, 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"
+msgstr ""
+
+#: src/mn-gmail-mailbox-properties.gob:78
+msgid "Your Gmail username"
+msgstr ""
+
+#: src/mn-gmail-mailbox-properties.gob:79
+msgid "Your Gmail password"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:65
+msgid "unable to parse Gmail URI"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:180
+msgid "logging in"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:194 src/mn-gmail-mailbox.gob:233
+#: src/mn-gmail-mailbox.gob:266 src/mn-gmail-mailbox.gob:370
+#, c-format
+msgid "unable to transfer data: %s"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:219 src/mn-gmail-mailbox.gob:252
+#: src/mn-gmail-mailbox.gob:286
+msgid "login failed"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:280
+msgid "successfully logged in"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:358
+msgid "searching for unread mail"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:377
msgid "unable to parse Gmail data"
msgstr ""
-#: src/mn-mail-icon.c:130
-msgid "You have no new mail"
+#: src/mn-imap-mailbox-properties.gob:92
+msgid "Mailbox:"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:155
-msgid "Add a Mailbox"
+#: src/mn-imap-mailbox-properties.gob:96
+msgid "in_box"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:107
+msgid "oth_er:"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:121
+msgid "The hostname or IP address of the IMAP server"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:122
+msgid "Your username on the IMAP server"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:182
-msgid "autodetect"
+#: src/mn-imap-mailbox-properties.gob:123
+msgid "Your password on the IMAP server"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:394
+#: src/mn-imap-mailbox-properties.gob:124
+#: src/mn-imap-mailbox-properties.gob:125
+msgid "The port number of the IMAP server"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:126
+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"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:128
+msgid "unable to parse IMAP URI"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:195
+msgid "server did not send capabilities"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:267
+msgid "server advertised LOGINDISABLED, not using LOGIN authentication"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:268
+msgid "unable to login"
+msgstr ""
+
+#. compliance error
+#: src/mn-imap-mailbox.gob:319
+msgid "server did not send status"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:537 src/mn-pop3-mailbox.gob:715
+msgid "unknown server error"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:603 src/mn-pop3-mailbox.gob:645
+msgid ""
+"a SASL authentication mechanism was selected but SASL support has not been "
+"compiled in"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:611 src/mn-pop3-mailbox.gob:657
+#, c-format
+msgid "unknown authentication mechanism \"%s\""
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:629
+msgid "falling back to IMAP LOGIN authentication"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:633 src/mn-pop3-mailbox.gob:691
+msgid "authentication failed"
+msgstr ""
+
+#: src/mn-mail-icon.gob:81
+msgid "_Update"
+msgstr ""
+
+#: src/mn-mail-icon.gob:87
+msgid "R_emove From Notification Area"
+msgstr ""
+
+#: src/mn-mail-icon.gob:172
+#, c-format
+msgid "_Run %s"
+msgstr ""
+
+#: src/mn-mail-icon.gob:173
+msgid "_Run Default Action"
+msgstr ""
+
+#: src/mn-mailbox-properties-dialog.c:109
+msgid "Add a Mailbox"
+msgstr ""
+
+#: src/mn-mailbox-properties-dialog.c:331
#, c-format
msgid "%s Properties"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:580
-msgid "Select a File or Folder"
+#: src/mn-mailbox-properties-util.c:75
+msgid "_Username:"
msgstr ""
-#: src/mn-mailbox.c:199
-msgid "URI"
+#: src/mn-mailbox-properties-util.c:79
+msgid "_Password:"
msgstr ""
-#: src/mn-mailbox.c:200
-msgid "The mailbox URI"
+#: src/mn-mailbox-properties-util.c:146
+msgid "Connection type:"
msgstr ""
-#: src/mn-mailbox.c:206
-msgid "Name"
+#: src/mn-mailbox-properties-util.c:153
+msgid "Port:"
msgstr ""
-#: src/mn-mailbox.c:207
-msgid "The mailbox human-readable name"
+#: src/mn-mailbox-properties-util.c:180
+msgid "_Authentication mechanism:"
msgstr ""
-#: src/mn-mailbox.c:213
-msgid "Automatic"
+#: src/mn-mailbox-properties.c:63
+msgid "Label"
msgstr ""
-#: src/mn-mailbox.c:214
-msgid "Whether the mailbox has to be manually checked or not"
+#: src/mn-mailbox-properties.c:64
+msgid "The marked up text to show in the type combo box"
msgstr ""
-#: src/mn-mailbox.c:220
-msgid "Has new"
+#: src/mn-mailbox-properties.c:69
+msgid "Size group"
msgstr ""
-#: src/mn-mailbox.c:221
-msgid "Whether the mailbox has new mail or not"
+#: src/mn-mailbox-properties.c:70
+msgid "A GtkSizeGroup for aligning control labels"
msgstr ""
-#: src/mn-mailbox.c:227
-msgid "Error"
+#: src/mn-mailbox-properties.c:75
+msgid "Complete"
msgstr ""
-#: src/mn-mailbox.c:228
-msgid "The mailbox error if any"
+#: src/mn-mailbox-properties.c:76
+msgid "Whether the properties are completely filled or not"
msgstr ""
-#: src/mn-mailbox.c:254
-#, c-format
-msgid "unable to cancel monitoring of %s: %s"
+#: src/mn-mailbox-view.gob:91
+msgid "Unable to add mailbox"
+msgstr ""
+
+#: src/mn-mailbox-view.gob:91
+msgid "The mailbox is already in the list."
+msgstr ""
+
+#: src/mn-mailbox-view.gob:283
+msgid "Mailbox"
+msgstr ""
+
+#: src/mn-mailbox-view.gob:297
+msgid "Format"
+msgstr ""
+
+#: src/mn-mailbox.gob:88
+msgid "The mailbox URI"
+msgstr ""
+
+#: src/mn-mailbox.gob:98
+msgid "The mailbox human-readable name"
+msgstr ""
+
+#: src/mn-mailbox.gob:102
+msgid "Whether the mailbox has to be manually checked or not"
msgstr ""
-#: src/mn-mailbox.c:443
+#: src/mn-mailbox.gob:107
+msgid "Whether the mailbox has new mail or not"
+msgstr ""
+
+#: src/mn-mailbox.gob:112
+msgid "The mailbox error, if any"
+msgstr ""
+
+#: src/mn-mailbox.gob:218
msgid "does not exist"
msgstr ""
-#: src/mn-mailbox.c:460
+#: src/mn-mailbox.gob:255
msgid "unknown format"
msgstr ""
-#: src/mn-mailbox.c:553
+#: src/mn-mailbox.gob:316
#, c-format
msgid "unable to monitor %s: %s"
msgstr ""
-#: src/mn-mailbox.c:567
+#: src/mn-mailbox.gob:330
#, c-format
msgid ""
"As a fallback, they will be checked every %i second (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgid_plural ""
"As a fallback, they will be checked every %i seconds (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.c:578
+#: src/mn-mailbox.gob:341
#, c-format
msgid ""
"As a fallback, they will be checked every %i minute (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgid_plural ""
"As a fallback, they will be checked every %i minutes (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.c:589
+#: src/mn-mailbox.gob:352
#, c-format
msgid ""
"As a fallback, they will be checked approximately every %i minute (this "
-"delay is configurable from the Preferences Dialog)."
+"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 Preferences Dialog)."
+"delay is configurable from the Properties Dialog)."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.c:603
-msgid "A monitoring error has occurred."
+#: src/mn-mailbox.gob:366
+msgid "A monitoring error has occurred"
msgstr ""
-#: src/mn-mailbox.c:604
+#: src/mn-mailbox.gob:367
#, c-format
msgid ""
"Mail Notification was unable to enable automatic notification for one or "
"more mailboxes. %s"
msgstr ""
-#: src/mn-mailboxes.c:133
+#: src/mn-mailboxes.gob:130
+#, c-format
+msgid "%s is unsupported: %s"
+msgstr ""
+
+#: src/mn-mailboxes.gob:157
#, c-format
msgid "%s has new mail"
msgstr ""
-#: src/mn-mailboxes.c:133
+#: src/mn-mailboxes.gob:157
#, c-format
msgid "%s has no new mail"
msgstr ""
-#: src/mn-mailboxes.c:143
+#: src/mn-mailboxes.gob:173
#, c-format
msgid "%s reported an error: %s"
msgstr ""
-#: src/mn-maildir-mailbox.c:226 src/mn-sylpheed-mailbox.c:209
+#: src/mn-maildir-mailbox.gob:97
#, c-format
-msgid "error while reading folder: %s"
+msgid "unable to open folder \"new\": %s"
+msgstr ""
+
+#: src/mn-maildir-mailbox.gob:122
+#, c-format
+msgid "error while reading folder \"new\": %s"
+msgstr ""
+
+#: src/mn-main.c:86
+#, c-format
+msgid "Compiled-in mailbox backends: %s\n"
msgstr ""
-#: src/mn-main.c:49
-msgid "Compiled in handlers:\n"
+#: src/mn-main.c:104
+#, c-format
+msgid "Compiled-in features: %s\n"
msgstr ""
-#: src/mn-main.c:83
+#: src/mn-main.c:133
msgid "Enable informational output"
msgstr ""
-#: src/mn-main.c:92
-msgid "List compiled-in handlers and exit"
+#: src/mn-main.c:142
+msgid "List compiled-in features and exit"
msgstr ""
-#: src/mn-main.c:124
-msgid "unable to initialize GnomeVFS"
+#: src/mn-main.c:151
+msgid "Display the properties dialog"
msgstr ""
-#: src/mn-mbox-mailbox.c:339
-#, c-format
-msgid "unable to get mailbox information: %s"
+#: src/mn-main.c:160
+msgid "Display the about dialog"
msgstr ""
-#: src/mn-mbox-mailbox.c:364
-#, c-format
-msgid "unable to open mailbox: %s"
+#: src/mn-main.c:169
+msgid "Update the mail status"
msgstr ""
-#: src/mn-mbox-mailbox.c:401
-#, c-format
-msgid "error while reading mailbox: %s"
+#: src/mn-main.c:178
+msgid "Report the mail status"
+msgstr ""
+
+#.
+#. * We can't use mn_error_dialog() because gtk_init() has not been
+#. * called yet.
+#.
+#: src/mn-main.c:204
+msgid "multi-threading is not available"
+msgstr ""
+
+#: src/mn-main.c:244
+msgid "Unable to initialize the GnomeVFS library."
+msgstr ""
+
+#: src/mn-main.c:252
+msgid ""
+"Bonobo could not locate the automation object. Please check your Mail "
+"Notification installation."
+msgstr ""
+
+#: src/mn-main.c:263
+msgid "updating the mail status"
+msgstr ""
+
+#: src/mn-main.c:279
+msgid "Mail Notification is already running"
+msgstr ""
+
+#: src/mn-main.c:286
+msgid ""
+"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
+"Please check your Mail Notification installation."
+msgstr ""
+
+#: src/mn-main.c:290
+msgid ""
+"Bonobo was unable to register the automation server. Please check your Mail "
+"Notification installation."
msgstr ""
-#: src/mn-mbox-mailbox.c:417
+#: src/mn-mbox-mailbox.gob:165
#, c-format
-msgid "unable to close mailbox: %s"
+msgid "error while reading mailbox: %s"
msgstr ""
-#: src/mn-mh-mailbox.c:185
+#: src/mn-mbox-mailbox.gob:173
#, c-format
-msgid "unable to open .mh_sequences: %s"
+msgid "unable to open mailbox: %s"
msgstr ""
-#: src/mn-mh-mailbox.c:215
+#: src/mn-mh-mailbox.gob:111
#, c-format
msgid "error while reading .mh_sequences: %s"
msgstr ""
-#: src/mn-mh-mailbox.c:231
+#: src/mn-mh-mailbox.gob:119
#, c-format
-msgid "unable to close .mh_sequences: %s"
+msgid "unable to open .mh_sequences: %s"
msgstr ""
-#: src/mn-pending-mailbox.c:64
-msgid "detecting..."
+#: src/mn-pending-mailbox.gob:33
+msgid "detecting"
msgstr ""
-#: src/mn-pop3-mailbox.c:164
-msgid "unable to parse POP3 URI"
+#: src/mn-pi-mailbox-properties.gob:75
+msgid "_Hostname:"
msgstr ""
-#: src/mn-pop3-mailbox.c:190
-#, c-format
-msgid "connecting to POP3 server %s"
+#: src/mn-pi-mailbox-properties.gob:93
+msgid "_Details"
msgstr ""
-#: src/mn-pop3-mailbox.c:227
-#, c-format
-msgid "successfully connected to %s"
+#: src/mn-pi-mailbox-properties.gob:105
+msgid "sta_ndard"
msgstr ""
-#: src/mn-pop3-mailbox.c:233
-msgid "unable to connect to server"
+#: src/mn-pi-mailbox-properties.gob:115
+msgid "_SSL"
msgstr ""
-#: src/mn-pop3-mailbox.c:238
-msgid "connection to server unexpectedly closed"
+#: src/mn-pop3-mailbox-properties.gob:84
+msgid "The hostname or IP address of the POP3 server"
msgstr ""
-#: src/mn-pop3-mailbox.c:277
-#, c-format
-msgid "invalid STAT reply \"%s\""
+#: src/mn-pop3-mailbox-properties.gob:85
+msgid "Your username on the POP3 server"
+msgstr ""
+
+#: src/mn-pop3-mailbox-properties.gob:86
+msgid "Your password on the POP3 server"
+msgstr ""
+
+#: src/mn-pop3-mailbox-properties.gob:87 src/mn-pop3-mailbox-properties.gob:88
+msgid "The port number of the POP3 server"
msgstr ""
-#: src/mn-pop3-mailbox.c:296
-msgid "unknown error"
+#: src/mn-pop3-mailbox.gob:137
+msgid "unable to parse POP3 URI"
msgstr ""
-#: src/mn-pop3-mailbox.c:317
+#: src/mn-pop3-mailbox.gob:267
+msgid "invalid arguments for the LOGIN-DELAY capability"
+msgstr ""
+
+#: src/mn-pop3-mailbox.gob:495
#, c-format
-msgid "invalid reply \"%s\""
+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
+msgid "server does not support APOP authentication"
msgstr ""
-#: src/mn-preferences.c:195
-msgid "Mailbox"
+#: src/mn-pop3-mailbox.gob:681
+msgid "falling back to APOP authentication"
msgstr ""
-#: src/mn-preferences.c:209
-msgid "Format"
+#: src/mn-pop3-mailbox.gob:686
+msgid "falling back to USER/PASS authentication"
msgstr ""
-#: src/mn-preferences.c:361
+#: src/mn-properties.c:132
msgid "No mailbox selected."
msgstr ""
-#: src/mn-preferences.c:366
+#: src/mn-properties.c:137
#, c-format
msgid "%i mailbox selected."
msgid_plural "%i mailboxes selected."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-preferences.c:429
-msgid "Unable to add mailbox."
+#: src/mn-shell.gob:191
+msgid "A command error has occurred"
msgstr ""
-#: src/mn-preferences.c:429
-msgid "The mailbox is already in the list."
-msgstr ""
-
-#: src/mn-ui.c:87
-msgid "A command error has occurred."
-msgstr ""
-
-#: src/mn-ui.c:88
+#: src/mn-shell.gob:192
#, c-format
-msgid "Unable to execute clicked command: %s."
+msgid "Unable to execute double-clicked command: %s."
msgstr ""
-#: src/mn-ui.c:184
+#: src/mn-shell.gob:297
msgid "The following mailbox has new mail:\n"
msgid_plural "The following mailboxes have new mail:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-ui.c:191
+#: src/mn-shell.gob:301
msgid "You have no new mail."
msgstr ""
-#: src/mn-ui.c:195
+#: src/mn-shell.gob:304
msgid "The following mailbox reported an error:\n"
msgid_plural "The following mailboxes reported an error:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-ui.c:200
+#: src/mn-shell.gob:309
msgid "The following mailbox is unsupported:\n"
msgid_plural "The following mailboxes are unsupported:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-ui.c:217
-msgid "No mailboxes are being monitored."
-msgstr ""
-
-#: src/mn-ui.c:265
-msgid "A Mail Notification Icon"
+#: src/mn-shell.gob:325
+msgid "You have new mail."
msgstr ""
-#: src/mn-ui.c:268
-msgid "Jean-Yves Lefort <jylefort@brutele.be>"
+#: src/mn-shell.gob:338
+msgid "A command error has occurred in Mail Notification"
msgstr ""
-#: src/mn-unsupported-mailbox.c:98
-msgid "unsupported"
+#: src/mn-shell.gob:339
+#, c-format
+msgid "Unable to execute new mail command: %s."
msgstr ""
-#: src/mn-unsupported-mailbox.c:103
-msgid "Reason"
+#: src/mn-stock.c:28
+msgid "Select _All"
msgstr ""
-#: src/mn-unsupported-mailbox.c:104
-msgid "The reason why the mailbox is unsupported"
-msgstr ""
-
-#: src/mn-util.c:113
+#: src/mn-sylpheed-mailbox.gob:83
#, c-format
-msgid "error loading image: %s"
+msgid "unable to open folder: %s"
msgstr ""
-#: src/mn-util.c:151
+#: src/mn-sylpheed-mailbox.gob:114
#, c-format
-msgid "widget %s not found in interface %s"
-msgstr ""
-
-#: src/mn-util.c:258
-msgid "received an invalid URI list"
-msgstr ""
-
-#: src/mn-util.c:294
-msgid "received an invalid Mozilla URL"
-msgstr ""
-
-#: src/mn-util.c:386
-msgid "Unable to display help."
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:1 ui/preferences.glade.h:2
-msgid "*"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:2
-msgid "P_ort:"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:3
-msgid "The URI of the mailbox"
+msgid "error while reading folder: %s"
msgstr ""
-#: ui/mailbox-properties.glade.h:4
-msgid "The hostname or IP address of the POP3 server"
+#: src/mn-system-mailbox-properties.gob:33 src/mn-uri.c:617
+msgid "System Mailbox"
msgstr ""
-#: ui/mailbox-properties.glade.h:5
-msgid "The port number of the POP3 server"
+#: src/mn-system-mailbox-properties.gob:56
+#, c-format
+msgid "Your system mailbox (<span weight=\"bold\">%s</span>) will be used."
msgstr ""
-#: ui/mailbox-properties.glade.h:6
+#: src/mn-system-mailbox-properties.gob:63
msgid ""
-"This mailbox type has not been compiled in and is therefore unsupported."
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:7
-msgid "Your Gmail password"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:8
-msgid "Your Gmail username"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:9
-msgid "Your password on the POP3 server"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:10
-msgid "Your username on the POP3 server"
+"The location of your system mailbox could not be detected. Please set the "
+"MAIL environment variable."
msgstr ""
-#: ui/mailbox-properties.glade.h:11
-msgid "_Browse..."
+#: src/mn-unsupported-mailbox.gob:31
+msgid "The reason why the mailbox is unsupported"
msgstr ""
-#: ui/mailbox-properties.glade.h:12
-msgid "_Hostname:"
+#: src/mn-unsupported-mailbox.gob:38
+msgid "unsupported"
msgstr ""
-#: ui/mailbox-properties.glade.h:13
-msgid "_Location:"
+#: src/mn-util.c:116
+#, c-format
+msgid "error loading image: %s"
msgstr ""
-#: ui/mailbox-properties.glade.h:14
-msgid "_Password:"
+#: src/mn-util.c:154
+#, c-format
+msgid "widget %s not found in interface %s"
msgstr ""
-#: ui/mailbox-properties.glade.h:15
-msgid "_Type:"
+#: src/mn-util.c:261
+msgid "received an invalid URI list"
msgstr ""
-#: ui/mailbox-properties.glade.h:16
-msgid "_Username:"
+#: src/mn-util.c:297
+msgid "received an invalid Mozilla URL"
msgstr ""
-#: ui/menu.glade.h:1
-msgid "Show help"
+#: src/mn-util.c:389
+msgid "Unable to display help"
msgstr ""
-#: ui/menu.glade.h:2
-msgid "Update the icon"
+#: src/mn-util.c:403
+#, c-format
+msgid "Unable to create a thread: %s."
msgstr ""
-#: ui/menu.glade.h:3
-msgid "_Help"
+#: ui/mailbox-properties.glade.h:1
+msgid "_Mailbox type:"
msgstr ""
-#: ui/menu.glade.h:4
-msgid "_Update"
+#: ui/properties.glade.h:1
+msgid " "
msgstr ""
-#: ui/preferences.glade.h:1
-msgid " "
+#: ui/properties.glade.h:2
+msgid "*"
msgstr ""
-#: ui/preferences.glade.h:3
+#: ui/properties.glade.h:3
msgid "<span weight=\"bold\">Commands</span>"
msgstr ""
-#: ui/preferences.glade.h:4
+#: ui/properties.glade.h:4
msgid "<span weight=\"bold\">General</span>"
msgstr ""
-#: ui/preferences.glade.h:5
+#: ui/properties.glade.h:5
msgid "<span weight=\"bold\">Mailboxes</span>"
msgstr ""
-#: ui/preferences.glade.h:6
-msgid "Mail Notification Preferences"
+#: ui/properties.glade.h:6
+msgid "Mail Notification Properties"
msgstr ""
-#: ui/preferences.glade.h:7
+#: ui/properties.glade.h:7
msgid "The amount of time to wait between mail checks"
msgstr ""
-#: ui/preferences.glade.h:8
+#: ui/properties.glade.h:8
msgid "The command to run when new mail arrives"
msgstr ""
-#: ui/preferences.glade.h:9
-msgid "The command to run when the icon is clicked"
+#: ui/properties.glade.h:9
+msgid "The command to run when the icon is double-clicked"
msgstr ""
-#: ui/preferences.glade.h:10
+#: ui/properties.glade.h:10
msgid "When _new mail arrives:"
msgstr ""
-#: ui/preferences.glade.h:11
-msgid "When click_ed:"
+#: ui/properties.glade.h:11
+msgid "When double-click_ed:"
msgstr ""
-#: ui/preferences.glade.h:12
+#: ui/properties.glade.h:12
msgid "Whether to run a command when new mail arrives or not"
msgstr ""
-#: ui/preferences.glade.h:13
-msgid "Whether to run a command when the icon is clicked or not"
-msgstr ""
-
-#: ui/preferences.glade.h:14
-msgid "_Add"
+#: ui/properties.glade.h:13
+msgid "Whether to run a command when the icon is double-clicked or not"
msgstr ""
-#: ui/preferences.glade.h:15
+#: ui/properties.glade.h:14
msgid "_Delay between mail checks:"
msgstr ""
-#: ui/preferences.glade.h:16
-msgid "_Remove"
-msgstr ""
-
-#: ui/preferences.glade.h:17
+#: ui/properties.glade.h:15
msgid "minutes"
msgstr ""
-#: ui/preferences.glade.h:18
+#: ui/properties.glade.h:16
msgid "seconds"
msgstr ""
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-07-21 18:10+0200\n"
+"POT-Creation-Date: 2004-08-16 18:15+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"
@@ -20,29 +20,47 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+#: data/GNOME_MailNotification_Automation.server.in.in.h:1
+#, fuzzy
+msgid "Mail Notification automation"
+msgstr "Иконка входÑщих Ñообщений"
+
+#: data/GNOME_MailNotification_Automation.server.in.in.h:2
+#, fuzzy
+msgid "Mail Notification automation factory"
+msgstr "Иконка входÑщих Ñообщений"
+
+#: data/mail-notification-properties.desktop.in.h:1
+#, fuzzy
+msgid "Configure Mail Notification"
+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
+msgid "Mail Notification"
+msgstr "Иконка входÑщих Ñообщений"
+
#: data/mail-notification.desktop.in.h:1
msgid "Get notified when new mail arrives"
msgstr ""
"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
-#: data/mail-notification.desktop.in.h:2 src/mn-main.c:112 src/mn-ui.c:262
-msgid "Mail Notification"
-msgstr "Иконка входÑщих Ñообщений"
-
#: data/mail-notification.schemas.in.h:1
-msgid "Clicked command"
+msgid "Delay between mail checks (minutes part)."
msgstr ""
#: data/mail-notification.schemas.in.h:2
-msgid "Delay between mail checks (minutes part)."
+msgid "Delay between mail checks (seconds part)."
msgstr ""
#: data/mail-notification.schemas.in.h:3
-msgid "Delay between mail checks (seconds part)."
+msgid "Double-clicked command"
msgstr ""
#: data/mail-notification.schemas.in.h:4
-msgid "Height of preferences dialog"
+msgid "Height of properties dialog"
msgstr ""
#: data/mail-notification.schemas.in.h:5
@@ -64,8 +82,10 @@ msgstr ""
"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
#: data/mail-notification.schemas.in.h:9
-msgid "Run a command when the icon is clicked"
+#, fuzzy
+msgid "Run a command when the icon is double-clicked"
msgstr ""
+"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
#: data/mail-notification.schemas.in.h:10
msgid "Seconds between mail checks"
@@ -78,11 +98,13 @@ msgstr ""
"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
#: data/mail-notification.schemas.in.h:12
-msgid "The command to run when the icon is clicked."
+#, fuzzy
+msgid "The command to run when the icon is double-clicked."
msgstr ""
+"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
#: data/mail-notification.schemas.in.h:13
-msgid "The height of the preferences dialog in pixels."
+msgid "The height of the properties dialog in pixels."
msgstr ""
#: data/mail-notification.schemas.in.h:14
@@ -90,7 +112,7 @@ msgid "The list of mailboxes to monitor."
msgstr ""
#: data/mail-notification.schemas.in.h:15
-msgid "The width of the preferences dialog in pixels."
+msgid "The width of the properties dialog in pixels."
msgstr ""
#: data/mail-notification.schemas.in.h:16
@@ -100,11 +122,17 @@ msgstr ""
"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
#: data/mail-notification.schemas.in.h:17
-msgid "Whether to run a command when the icon is clicked or not."
+#, fuzzy
+msgid "Whether to run a command when the icon is double-clicked or not."
msgstr ""
+"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
#: data/mail-notification.schemas.in.h:18
-msgid "Width of preferences dialog"
+msgid "Width of properties dialog"
+msgstr ""
+
+#: data/mail-notification.soundlist.in.h:2
+msgid "New Mail"
msgstr ""
#: src/eggtrayicon.c:109
@@ -115,521 +143,875 @@ msgstr ""
msgid "The orientation of the tray."
msgstr ""
-#: src/mn-gmail-mailbox.c:165
-msgid "unable to parse Gmail URI"
+#: src/mn-about-dialog.gob:41
+msgid "A Mail Notification Icon"
+msgstr ""
+
+#: src/mn-about-dialog.gob:44
+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
+msgid "<span style=\"italic\">autodetect</span>"
+msgstr ""
+
+#: src/mn-autodetect-mailbox-properties.gob:67
+msgid "_Location:"
+msgstr ""
+
+#: src/mn-autodetect-mailbox-properties.gob:73
+msgid "_Browse..."
+msgstr ""
+
+#: src/mn-autodetect-mailbox-properties.gob:80
+msgid "The URI of the mailbox"
+msgstr ""
+
+#: src/mn-autodetect-mailbox-properties.gob:117
+msgid "Select a File or Folder"
+msgstr ""
+
+#: src/mn-blinking-image.gob:30
+msgid "Whether the image is blinking or not"
msgstr ""
-#: src/mn-gmail-mailbox.c:261
+#: src/mn-client-session.c:196 src/mn-client-session.c:203
#, c-format
-msgid "logging into Gmail as user %s"
+msgid "unable to read from server: %s"
+msgstr ""
+
+#: src/mn-client-session.c:201
+msgid "unable to read from server: EOF"
msgstr ""
-#: src/mn-gmail-mailbox.c:277 src/mn-gmail-mailbox.c:356
+#: src/mn-client-session.c:213
#, c-format
-msgid "unable to transfer data: %s"
+msgid "unable to decode data using SASL: %s"
msgstr ""
-#: src/mn-gmail-mailbox.c:283
+#: src/mn-client-session.c:287
#, c-format
-msgid "successfully logged into Gmail as user %s"
+msgid "resolving %s"
msgstr ""
-#: src/mn-gmail-mailbox.c:288
-msgid "login failed"
+#: src/mn-client-session.c:297
+#, c-format
+msgid "unable to resolve %s: %s"
+msgstr ""
+
+#: src/mn-client-session.c:334
+#, c-format
+msgid "%s: unsupported address family"
+msgstr ""
+
+#: src/mn-client-session.c:341
+#, c-format
+msgid "%s: unable to create socket: %s"
+msgstr ""
+
+#: src/mn-client-session.c:345
+#, c-format
+msgid "connecting to %s (%s) port %i"
+msgstr ""
+
+#: src/mn-client-session.c:348
+#, c-format
+msgid "unable to connect: %s"
+msgstr ""
+
+#: src/mn-client-session.c:353
+msgid "connected successfully"
+msgstr ""
+
+#. if reached, we couldn't find a working address
+#: src/mn-client-session.c:359
+#, c-format
+msgid "unable to connect to %s"
+msgstr ""
+
+#: src/mn-client-session.c:375
+#, c-format
+msgid "unable to initialize the OpenSSL library: %s"
+msgstr ""
+
+#: src/mn-client-session.c:383
+#, c-format
+msgid "unable to create a SSL object: %s"
+msgstr ""
+
+#: src/mn-client-session.c:389
+#, c-format
+msgid "unable to set the SSL file descriptor: %s"
+msgstr ""
+
+#: src/mn-client-session.c:444
+#, c-format
+msgid "response \"%s\" is not valid in current context"
+msgstr ""
+
+#: src/mn-client-session.c:470
+#, c-format
+msgid "unable to parse response \"%s\""
+msgstr ""
+
+#: src/mn-client-session.c:517
+#, c-format
+msgid "unable to encode data using SASL: %s"
+msgstr ""
+
+#: src/mn-client-session.c:546 src/mn-client-session.c:553
+#, c-format
+msgid "unable to write to server: %s"
+msgstr ""
+
+#: src/mn-client-session.c:551
+msgid "unable to write to server: EOF"
+msgstr ""
+
+#: src/mn-client-session.c:583
+#, c-format
+msgid "unable to encode Base64: %s"
+msgstr ""
+
+#: src/mn-client-session.c:686
+#, c-format
+msgid "unable to initialize the SASL library: %s"
+msgstr ""
+
+#: src/mn-client-session.c:695
+#, c-format
+msgid "unable to retrieve local address of socket: %s"
+msgstr ""
+
+#: src/mn-client-session.c:701
+#, c-format
+msgid "unable to retrieve remote address of socket: %s"
+msgstr ""
+
+#: src/mn-client-session.c:735
+#, c-format
+msgid "warning: unable to set SASL security properties: %s"
+msgstr ""
+
+#: src/mn-client-session.c:774
+msgid ""
+"unable to start SASL authentication: SASL asked for something we did not know"
+msgstr ""
+
+#: src/mn-client-session.c:778
+#, c-format
+msgid "unable to start SASL authentication: %s"
+msgstr ""
+
+#: src/mn-client-session.c:782
+#, c-format
+msgid "unable to create a SASL connection: %s"
+msgstr ""
+
+#: src/mn-client-session.c:832
+msgid "SASL asked for something we did not know, aborting SASL authentication"
+msgstr ""
+
+#: src/mn-client-session.c:836
+#, c-format
+msgid "%s, aborting SASL authentication"
+msgstr ""
+
+#. compliance error
+#: src/mn-client-session.c:841
+#, c-format
+msgid "unable to decode Base64 input from server: %s"
+msgstr ""
+
+#: src/mn-client-session.c:844
+msgid ""
+"the server sent a SASL challenge, but there was a pending initial SASL "
+"client response"
+msgstr ""
+
+#: src/mn-client-session.c:858
+msgid ""
+"the server did not send a SASL challenge, but there was no pending initial "
+"SASL client response"
+msgstr ""
+
+#: src/mn-client-session.c:881
+#, 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:886
+#, c-format
+msgid "unable to get SASL_MAXOUTBUF property: %s"
+msgstr ""
+
+#: src/mn-client-session.c:892
+#, 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"
+msgstr ""
+
+#: src/mn-gmail-mailbox-properties.gob:78
+msgid "Your Gmail username"
+msgstr ""
+
+#: src/mn-gmail-mailbox-properties.gob:79
+msgid "Your Gmail password"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:65
+msgid "unable to parse Gmail URI"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:180
+msgid "logging in"
msgstr ""
-#: src/mn-gmail-mailbox.c:341
+#: src/mn-gmail-mailbox.gob:194 src/mn-gmail-mailbox.gob:233
+#: src/mn-gmail-mailbox.gob:266 src/mn-gmail-mailbox.gob:370
#, c-format
-msgid "searching for unread mail in %s"
+msgid "unable to transfer data: %s"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:219 src/mn-gmail-mailbox.gob:252
+#: src/mn-gmail-mailbox.gob:286
+msgid "login failed"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:280
+msgid "successfully logged in"
msgstr ""
-#: src/mn-gmail-mailbox.c:363
+#: src/mn-gmail-mailbox.gob:358
+msgid "searching for unread mail"
+msgstr ""
+
+#: src/mn-gmail-mailbox.gob:377
msgid "unable to parse Gmail data"
msgstr ""
-#: src/mn-mail-icon.c:130
-msgid "You have no new mail"
+#: src/mn-imap-mailbox-properties.gob:92
+msgid "Mailbox:"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:155
-msgid "Add a Mailbox"
+#: src/mn-imap-mailbox-properties.gob:96
+msgid "in_box"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:107
+msgid "oth_er:"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:121
+msgid "The hostname or IP address of the IMAP server"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:122
+msgid "Your username on the IMAP server"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:123
+msgid "Your password on the IMAP server"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:124
+#: src/mn-imap-mailbox-properties.gob:125
+msgid "The port number of the IMAP server"
+msgstr ""
+
+#: src/mn-imap-mailbox-properties.gob:126
+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"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:128
+msgid "unable to parse IMAP URI"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:195
+msgid "server did not send capabilities"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:267
+msgid "server advertised LOGINDISABLED, not using LOGIN authentication"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:268
+msgid "unable to login"
+msgstr ""
+
+#. compliance error
+#: src/mn-imap-mailbox.gob:319
+msgid "server did not send status"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:537 src/mn-pop3-mailbox.gob:715
+msgid "unknown server error"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:182
-msgid "autodetect"
+#: src/mn-imap-mailbox.gob:603 src/mn-pop3-mailbox.gob:645
+msgid ""
+"a SASL authentication mechanism was selected but SASL support has not been "
+"compiled in"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:611 src/mn-pop3-mailbox.gob:657
+#, c-format
+msgid "unknown authentication mechanism \"%s\""
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:629
+msgid "falling back to IMAP LOGIN authentication"
+msgstr ""
+
+#: src/mn-imap-mailbox.gob:633 src/mn-pop3-mailbox.gob:691
+msgid "authentication failed"
+msgstr ""
+
+#: src/mn-mail-icon.gob:81
+msgid "_Update"
+msgstr ""
+
+#: src/mn-mail-icon.gob:87
+msgid "R_emove From Notification Area"
+msgstr ""
+
+#: src/mn-mail-icon.gob:172
+#, c-format
+msgid "_Run %s"
+msgstr ""
+
+#: src/mn-mail-icon.gob:173
+msgid "_Run Default Action"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:394
+#: src/mn-mailbox-properties-dialog.c:109
+msgid "Add a Mailbox"
+msgstr ""
+
+#: src/mn-mailbox-properties-dialog.c:331
#, c-format
msgid "%s Properties"
msgstr ""
-#: src/mn-mailbox-properties-dialog.c:580
-msgid "Select a File or Folder"
+#: src/mn-mailbox-properties-util.c:75
+msgid "_Username:"
msgstr ""
-#: src/mn-mailbox.c:199
-msgid "URI"
+#: src/mn-mailbox-properties-util.c:79
+msgid "_Password:"
msgstr ""
-#: src/mn-mailbox.c:200
-msgid "The mailbox URI"
+#: src/mn-mailbox-properties-util.c:146
+msgid "Connection type:"
msgstr ""
-#: src/mn-mailbox.c:206
-msgid "Name"
+#: src/mn-mailbox-properties-util.c:153
+msgid "Port:"
msgstr ""
-#: src/mn-mailbox.c:207
-msgid "The mailbox human-readable name"
+#: src/mn-mailbox-properties-util.c:180
+msgid "_Authentication mechanism:"
msgstr ""
-#: src/mn-mailbox.c:213
-msgid "Automatic"
+#: src/mn-mailbox-properties.c:63
+msgid "Label"
msgstr ""
-#: src/mn-mailbox.c:214
-msgid "Whether the mailbox has to be manually checked or not"
+#: src/mn-mailbox-properties.c:64
+msgid "The marked up text to show in the type combo box"
msgstr ""
-#: src/mn-mailbox.c:220
-msgid "Has new"
+#: src/mn-mailbox-properties.c:69
+msgid "Size group"
msgstr ""
-#: src/mn-mailbox.c:221
-msgid "Whether the mailbox has new mail or not"
+#: src/mn-mailbox-properties.c:70
+msgid "A GtkSizeGroup for aligning control labels"
msgstr ""
-#: src/mn-mailbox.c:227
-msgid "Error"
+#: src/mn-mailbox-properties.c:75
+msgid "Complete"
msgstr ""
-#: src/mn-mailbox.c:228
-msgid "The mailbox error if any"
+#: src/mn-mailbox-properties.c:76
+msgid "Whether the properties are completely filled or not"
msgstr ""
-#: src/mn-mailbox.c:254
-#, c-format
-msgid "unable to cancel monitoring of %s: %s"
+#: src/mn-mailbox-view.gob:91
+msgid "Unable to add mailbox"
+msgstr ""
+
+#: src/mn-mailbox-view.gob:91
+msgid "The mailbox is already in the list."
+msgstr ""
+
+#: src/mn-mailbox-view.gob:283
+msgid "Mailbox"
+msgstr ""
+
+#: src/mn-mailbox-view.gob:297
+msgid "Format"
+msgstr ""
+
+#: src/mn-mailbox.gob:88
+msgid "The mailbox URI"
+msgstr ""
+
+#: src/mn-mailbox.gob:98
+msgid "The mailbox human-readable name"
+msgstr ""
+
+#: src/mn-mailbox.gob:102
+msgid "Whether the mailbox has to be manually checked or not"
msgstr ""
-#: src/mn-mailbox.c:443
+#: src/mn-mailbox.gob:107
+msgid "Whether the mailbox has new mail or not"
+msgstr ""
+
+#: src/mn-mailbox.gob:112
+msgid "The mailbox error, if any"
+msgstr ""
+
+#: src/mn-mailbox.gob:218
msgid "does not exist"
msgstr ""
-#: src/mn-mailbox.c:460
+#: src/mn-mailbox.gob:255
msgid "unknown format"
msgstr ""
-#: src/mn-mailbox.c:553
+#: src/mn-mailbox.gob:316
#, c-format
msgid "unable to monitor %s: %s"
msgstr ""
-#: src/mn-mailbox.c:567
+#: src/mn-mailbox.gob:330
#, c-format
msgid ""
"As a fallback, they will be checked every %i second (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgid_plural ""
"As a fallback, they will be checked every %i seconds (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.c:578
+#: src/mn-mailbox.gob:341
#, c-format
msgid ""
"As a fallback, they will be checked every %i minute (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgid_plural ""
"As a fallback, they will be checked every %i minutes (this delay is "
-"configurable from the Preferences Dialog)."
+"configurable from the Properties Dialog)."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.c:589
+#: src/mn-mailbox.gob:352
#, c-format
msgid ""
"As a fallback, they will be checked approximately every %i minute (this "
-"delay is configurable from the Preferences Dialog)."
+"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 Preferences Dialog)."
+"delay is configurable from the Properties Dialog)."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-mailbox.c:603
-msgid "A monitoring error has occurred."
+#: src/mn-mailbox.gob:366
+msgid "A monitoring error has occurred"
msgstr ""
-#: src/mn-mailbox.c:604
+#: src/mn-mailbox.gob:367
#, c-format
msgid ""
"Mail Notification was unable to enable automatic notification for one or "
"more mailboxes. %s"
msgstr ""
-#: src/mn-mailboxes.c:133
+#: src/mn-mailboxes.gob:130
+#, c-format
+msgid "%s is unsupported: %s"
+msgstr ""
+
+#: src/mn-mailboxes.gob:157
#, c-format
msgid "%s has new mail"
msgstr ""
-#: src/mn-mailboxes.c:133
+#: src/mn-mailboxes.gob:157
#, c-format
msgid "%s has no new mail"
msgstr ""
-#: src/mn-mailboxes.c:143
+#: src/mn-mailboxes.gob:173
#, c-format
msgid "%s reported an error: %s"
msgstr ""
-#: src/mn-maildir-mailbox.c:226 src/mn-sylpheed-mailbox.c:209
+#: src/mn-maildir-mailbox.gob:97
#, c-format
-msgid "error while reading folder: %s"
+msgid "unable to open folder \"new\": %s"
+msgstr ""
+
+#: src/mn-maildir-mailbox.gob:122
+#, c-format
+msgid "error while reading folder \"new\": %s"
msgstr ""
-#: src/mn-main.c:49
-msgid "Compiled in handlers:\n"
+#: src/mn-main.c:86
+#, c-format
+msgid "Compiled-in mailbox backends: %s\n"
+msgstr ""
+
+#: src/mn-main.c:104
+#, c-format
+msgid "Compiled-in features: %s\n"
msgstr ""
-#: src/mn-main.c:83
+#: src/mn-main.c:133
msgid "Enable informational output"
msgstr ""
-#: src/mn-main.c:92
-msgid "List compiled-in handlers and exit"
+#: src/mn-main.c:142
+msgid "List compiled-in features and exit"
msgstr ""
-#: src/mn-main.c:124
-msgid "unable to initialize GnomeVFS"
+#: src/mn-main.c:151
+msgid "Display the properties dialog"
msgstr ""
-#: src/mn-mbox-mailbox.c:339
-#, c-format
-msgid "unable to get mailbox information: %s"
+#: src/mn-main.c:160
+msgid "Display the about dialog"
msgstr ""
-#: src/mn-mbox-mailbox.c:364
-#, c-format
-msgid "unable to open mailbox: %s"
+#: src/mn-main.c:169
+msgid "Update the mail status"
msgstr ""
-#: src/mn-mbox-mailbox.c:401
-#, c-format
-msgid "error while reading mailbox: %s"
+#: src/mn-main.c:178
+msgid "Report the mail status"
msgstr ""
-#: src/mn-mbox-mailbox.c:417
+#.
+#. * We can't use mn_error_dialog() because gtk_init() has not been
+#. * called yet.
+#.
+#: src/mn-main.c:204
+msgid "multi-threading is not available"
+msgstr ""
+
+#: src/mn-main.c:244
+msgid "Unable to initialize the GnomeVFS library."
+msgstr ""
+
+#: src/mn-main.c:252
+msgid ""
+"Bonobo could not locate the automation object. Please check your Mail "
+"Notification installation."
+msgstr ""
+
+#: src/mn-main.c:263
+msgid "updating the mail status"
+msgstr ""
+
+#: src/mn-main.c:279
+#, fuzzy
+msgid "Mail Notification is already running"
+msgstr "Иконка входÑщих Ñообщений"
+
+#: src/mn-main.c:286
+msgid ""
+"Bonobo could not locate the GNOME_MailNotification_Automation.server file. "
+"Please check your Mail Notification installation."
+msgstr ""
+
+#: src/mn-main.c:290
+msgid ""
+"Bonobo was unable to register the automation server. Please check your Mail "
+"Notification installation."
+msgstr ""
+
+#: src/mn-mbox-mailbox.gob:165
#, c-format
-msgid "unable to close mailbox: %s"
+msgid "error while reading mailbox: %s"
msgstr ""
-#: src/mn-mh-mailbox.c:185
+#: src/mn-mbox-mailbox.gob:173
#, c-format
-msgid "unable to open .mh_sequences: %s"
+msgid "unable to open mailbox: %s"
msgstr ""
-#: src/mn-mh-mailbox.c:215
+#: src/mn-mh-mailbox.gob:111
#, c-format
msgid "error while reading .mh_sequences: %s"
msgstr ""
-#: src/mn-mh-mailbox.c:231
+#: src/mn-mh-mailbox.gob:119
#, c-format
-msgid "unable to close .mh_sequences: %s"
+msgid "unable to open .mh_sequences: %s"
msgstr ""
-#: src/mn-pending-mailbox.c:64
-msgid "detecting..."
+#: src/mn-pending-mailbox.gob:33
+msgid "detecting"
msgstr ""
-#: src/mn-pop3-mailbox.c:164
-msgid "unable to parse POP3 URI"
+#: src/mn-pi-mailbox-properties.gob:75
+msgid "_Hostname:"
msgstr ""
-#: src/mn-pop3-mailbox.c:190
-#, c-format
-msgid "connecting to POP3 server %s"
+#: src/mn-pi-mailbox-properties.gob:93
+msgid "_Details"
msgstr ""
-#: src/mn-pop3-mailbox.c:227
-#, c-format
-msgid "successfully connected to %s"
+#: src/mn-pi-mailbox-properties.gob:105
+msgid "sta_ndard"
msgstr ""
-#: src/mn-pop3-mailbox.c:233
-msgid "unable to connect to server"
+#: src/mn-pi-mailbox-properties.gob:115
+msgid "_SSL"
msgstr ""
-#: src/mn-pop3-mailbox.c:238
-msgid "connection to server unexpectedly closed"
+#: src/mn-pop3-mailbox-properties.gob:84
+msgid "The hostname or IP address of the POP3 server"
msgstr ""
-#: src/mn-pop3-mailbox.c:277
-#, c-format
-msgid "invalid STAT reply \"%s\""
+#: src/mn-pop3-mailbox-properties.gob:85
+msgid "Your username on the POP3 server"
+msgstr ""
+
+#: src/mn-pop3-mailbox-properties.gob:86
+msgid "Your password on the POP3 server"
+msgstr ""
+
+#: src/mn-pop3-mailbox-properties.gob:87 src/mn-pop3-mailbox-properties.gob:88
+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.c:296
-msgid "unknown error"
+#: src/mn-pop3-mailbox.gob:267
+msgid "invalid arguments for the LOGIN-DELAY capability"
msgstr ""
-#: src/mn-pop3-mailbox.c:317
+#: src/mn-pop3-mailbox.gob:495
#, c-format
-msgid "invalid reply \"%s\""
+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
+msgid "server does not support APOP authentication"
msgstr ""
-#: src/mn-preferences.c:195
-msgid "Mailbox"
+#: src/mn-pop3-mailbox.gob:681
+msgid "falling back to APOP authentication"
msgstr ""
-#: src/mn-preferences.c:209
-msgid "Format"
+#: src/mn-pop3-mailbox.gob:686
+msgid "falling back to USER/PASS authentication"
msgstr ""
-#: src/mn-preferences.c:361
+#: src/mn-properties.c:132
msgid "No mailbox selected."
msgstr ""
-#: src/mn-preferences.c:366
+#: src/mn-properties.c:137
#, c-format
msgid "%i mailbox selected."
msgid_plural "%i mailboxes selected."
msgstr[0] ""
msgstr[1] ""
-#: src/mn-preferences.c:429
-msgid "Unable to add mailbox."
-msgstr ""
-
-#: src/mn-preferences.c:429
-msgid "The mailbox is already in the list."
-msgstr ""
-
-#: src/mn-ui.c:87
-msgid "A command error has occurred."
+#: src/mn-shell.gob:191
+msgid "A command error has occurred"
msgstr ""
-#: src/mn-ui.c:88
+#: src/mn-shell.gob:192
#, c-format
-msgid "Unable to execute clicked command: %s."
+msgid "Unable to execute double-clicked command: %s."
msgstr ""
-#: src/mn-ui.c:184
+#: src/mn-shell.gob:297
msgid "The following mailbox has new mail:\n"
msgid_plural "The following mailboxes have new mail:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-ui.c:191
+#: src/mn-shell.gob:301
msgid "You have no new mail."
msgstr ""
-#: src/mn-ui.c:195
+#: src/mn-shell.gob:304
msgid "The following mailbox reported an error:\n"
msgid_plural "The following mailboxes reported an error:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-ui.c:200
+#: src/mn-shell.gob:309
msgid "The following mailbox is unsupported:\n"
msgid_plural "The following mailboxes are unsupported:\n"
msgstr[0] ""
msgstr[1] ""
-#: src/mn-ui.c:217
-msgid "No mailboxes are being monitored."
+#: src/mn-shell.gob:325
+msgid "You have new mail."
msgstr ""
-#: src/mn-ui.c:265
-msgid "A Mail Notification Icon"
+#: src/mn-shell.gob:338
+msgid "A command error has occurred in Mail Notification"
msgstr ""
-#: src/mn-ui.c:268
-msgid "Jean-Yves Lefort <jylefort@brutele.be>"
-msgstr "Dan Korostelev <dan@ats.energo.ru>"
-
-#: src/mn-unsupported-mailbox.c:98
-msgid "unsupported"
-msgstr ""
-
-#: src/mn-unsupported-mailbox.c:103
-msgid "Reason"
+#: src/mn-shell.gob:339
+#, c-format
+msgid "Unable to execute new mail command: %s."
msgstr ""
-#: src/mn-unsupported-mailbox.c:104
-msgid "The reason why the mailbox is unsupported"
+#: src/mn-stock.c:28
+msgid "Select _All"
msgstr ""
-#: src/mn-util.c:113
+#: src/mn-sylpheed-mailbox.gob:83
#, c-format
-msgid "error loading image: %s"
+msgid "unable to open folder: %s"
msgstr ""
-#: src/mn-util.c:151
+#: src/mn-sylpheed-mailbox.gob:114
#, c-format
-msgid "widget %s not found in interface %s"
-msgstr ""
-
-#: src/mn-util.c:258
-msgid "received an invalid URI list"
-msgstr ""
-
-#: src/mn-util.c:294
-msgid "received an invalid Mozilla URL"
-msgstr ""
-
-#: src/mn-util.c:386
-msgid "Unable to display help."
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:1 ui/preferences.glade.h:2
-msgid "*"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:2
-msgid "P_ort:"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:3
-msgid "The URI of the mailbox"
+msgid "error while reading folder: %s"
msgstr ""
-#: ui/mailbox-properties.glade.h:4
-msgid "The hostname or IP address of the POP3 server"
+#: src/mn-system-mailbox-properties.gob:33 src/mn-uri.c:617
+msgid "System Mailbox"
msgstr ""
-#: ui/mailbox-properties.glade.h:5
-msgid "The port number of the POP3 server"
+#: src/mn-system-mailbox-properties.gob:56
+#, c-format
+msgid "Your system mailbox (<span weight=\"bold\">%s</span>) will be used."
msgstr ""
-#: ui/mailbox-properties.glade.h:6
+#: src/mn-system-mailbox-properties.gob:63
msgid ""
-"This mailbox type has not been compiled in and is therefore unsupported."
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:7
-msgid "Your Gmail password"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:8
-msgid "Your Gmail username"
+"The location of your system mailbox could not be detected. Please set the "
+"MAIL environment variable."
msgstr ""
-#: ui/mailbox-properties.glade.h:9
-msgid "Your password on the POP3 server"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:10
-msgid "Your username on the POP3 server"
-msgstr ""
-
-#: ui/mailbox-properties.glade.h:11
-msgid "_Browse..."
+#: src/mn-unsupported-mailbox.gob:31
+msgid "The reason why the mailbox is unsupported"
msgstr ""
-#: ui/mailbox-properties.glade.h:12
-msgid "_Hostname:"
+#: src/mn-unsupported-mailbox.gob:38
+msgid "unsupported"
msgstr ""
-#: ui/mailbox-properties.glade.h:13
-msgid "_Location:"
+#: src/mn-util.c:116
+#, c-format
+msgid "error loading image: %s"
msgstr ""
-#: ui/mailbox-properties.glade.h:14
-msgid "_Password:"
+#: src/mn-util.c:154
+#, c-format
+msgid "widget %s not found in interface %s"
msgstr ""
-#: ui/mailbox-properties.glade.h:15
-msgid "_Type:"
+#: src/mn-util.c:261
+msgid "received an invalid URI list"
msgstr ""
-#: ui/mailbox-properties.glade.h:16
-msgid "_Username:"
+#: src/mn-util.c:297
+msgid "received an invalid Mozilla URL"
msgstr ""
-#: ui/menu.glade.h:1
-msgid "Show help"
+#: src/mn-util.c:389
+msgid "Unable to display help"
msgstr ""
-#: ui/menu.glade.h:2
-msgid "Update the icon"
+#: src/mn-util.c:403
+#, c-format
+msgid "Unable to create a thread: %s."
msgstr ""
-#: ui/menu.glade.h:3
-msgid "_Help"
+#: ui/mailbox-properties.glade.h:1
+msgid "_Mailbox type:"
msgstr ""
-#: ui/menu.glade.h:4
-msgid "_Update"
+#: ui/properties.glade.h:1
+msgid " "
msgstr ""
-#: ui/preferences.glade.h:1
-msgid " "
+#: ui/properties.glade.h:2
+msgid "*"
msgstr ""
-#: ui/preferences.glade.h:3
+#: ui/properties.glade.h:3
msgid "<span weight=\"bold\">Commands</span>"
msgstr ""
-#: ui/preferences.glade.h:4
+#: ui/properties.glade.h:4
msgid "<span weight=\"bold\">General</span>"
msgstr ""
-#: ui/preferences.glade.h:5
+#: ui/properties.glade.h:5
msgid "<span weight=\"bold\">Mailboxes</span>"
msgstr ""
-#: ui/preferences.glade.h:6
-msgid "Mail Notification Preferences"
-msgstr ""
+#: ui/properties.glade.h:6
+#, fuzzy
+msgid "Mail Notification Properties"
+msgstr "Иконка входÑщих Ñообщений"
-#: ui/preferences.glade.h:7
+#: ui/properties.glade.h:7
msgid "The amount of time to wait between mail checks"
msgstr ""
-#: ui/preferences.glade.h:8
+#: ui/properties.glade.h:8
msgid "The command to run when new mail arrives"
msgstr ""
-#: ui/preferences.glade.h:9
-msgid "The command to run when the icon is clicked"
+#: ui/properties.glade.h:9
+#, fuzzy
+msgid "The command to run when the icon is double-clicked"
msgstr ""
+"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
-#: ui/preferences.glade.h:10
+#: ui/properties.glade.h:10
msgid "When _new mail arrives:"
msgstr ""
-#: ui/preferences.glade.h:11
-msgid "When click_ed:"
+#: ui/properties.glade.h:11
+msgid "When double-click_ed:"
msgstr ""
-#: ui/preferences.glade.h:12
+#: ui/properties.glade.h:12
msgid "Whether to run a command when new mail arrives or not"
msgstr ""
-#: ui/preferences.glade.h:13
-msgid "Whether to run a command when the icon is clicked or not"
-msgstr ""
-
-#: ui/preferences.glade.h:14
-msgid "_Add"
+#: ui/properties.glade.h:13
+#, fuzzy
+msgid "Whether to run a command when the icon is double-clicked or not"
msgstr ""
+"Иконка в облаÑти ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸, уведомлÑÑŽÑ‰Ð°Ñ Ð¾ приходе новой почты."
-#: ui/preferences.glade.h:15
+#: ui/properties.glade.h:14
msgid "_Delay between mail checks:"
msgstr ""
-#: ui/preferences.glade.h:16
-msgid "_Remove"
-msgstr ""
-
-#: ui/preferences.glade.h:17
+#: ui/properties.glade.h:15
msgid "minutes"
msgstr ""
-#: ui/preferences.glade.h:18
+#: ui/properties.glade.h:16
msgid "seconds"
msgstr ""
diff --git a/src/MNAutomation.idl b/src/MNAutomation.idl
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+#include <Bonobo.idl>
+
+module GNOME
+{
+ interface MNAutomation : Bonobo::Unknown
+ {
+ void update ();
+ void report (out string report);
+ void displayProperties ();
+ void displayAbout ();
+ };
+};
diff --git a/src/Makefile.am b/src/Makefile.am
@@ -1,76 +1,229 @@
bin_PROGRAMS = mail-notification
if WITH_MBOX
-mbox_sources = mn-mbox-mailbox.c mn-mbox-mailbox.h
+mbox_gob_sources = mn-mbox-mailbox.gob
+mbox_gob_built_sources = \
+ mn-mbox-mailbox-private.h \
+ mn-mbox-mailbox.c \
+ mn-mbox-mailbox.h
endif
+
if WITH_MH
-mh_sources = mn-mh-mailbox.c mn-mh-mailbox.h
+mh_gob_sources = mn-mh-mailbox.gob
+mh_gob_built_sources = \
+ mn-mh-mailbox-private.h \
+ mn-mh-mailbox.c \
+ mn-mh-mailbox.h
endif
+
if WITH_MAILDIR
-maildir_sources = mn-maildir-mailbox.c mn-maildir-mailbox.h
+maildir_gob_sources = mn-maildir-mailbox.gob
+maildir_gob_built_sources = \
+ mn-maildir-mailbox-private.h \
+ mn-maildir-mailbox.c \
+ mn-maildir-mailbox.h
endif
+
if WITH_POP3
-pop3_sources = mn-pop3-mailbox.c mn-pop3-mailbox.h
+pop3_gob_sources = \
+ mn-pop3-mailbox-properties.gob \
+ mn-pop3-mailbox.gob
+pop3_gob_built_sources = \
+ 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
+md5_sources = mn-md5.c mn-md5.h
endif
+
+if WITH_IMAP
+imap_gob_sources = \
+ mn-imap-mailbox-properties.gob \
+ mn-imap-mailbox.gob
+imap_gob_built_sources = \
+ mn-imap-mailbox-properties-private.h \
+ mn-imap-mailbox-properties.c \
+ mn-imap-mailbox-properties.h \
+ mn-imap-mailbox-private.h \
+ mn-imap-mailbox.c \
+ mn-imap-mailbox.h
+endif
+
+if WITH_POP3_OR_IMAP
+client_session_sources = mn-client-session.c mn-client-session.h
+pi_gob_sources = \
+ mn-auth-combo-box.gob \
+ mn-pi-mailbox-properties.gob
+pi_gob_built_sources = \
+ mn-auth-combo-box-private.h \
+ mn-auth-combo-box.c \
+ mn-auth-combo-box.h \
+ mn-pi-mailbox-properties-private.h \
+ mn-pi-mailbox-properties.c \
+ mn-pi-mailbox-properties.h
+endif
+
if WITH_SYLPHEED
-sylpheed_sources = mn-sylpheed-mailbox.c mn-sylpheed-mailbox.h
+sylpheed_gob_sources = mn-sylpheed-mailbox.gob
+sylpheed_gob_built_sources = \
+ mn-sylpheed-mailbox-private.h \
+ mn-sylpheed-mailbox.c \
+ mn-sylpheed-mailbox.h
endif
+
if WITH_GMAIL
-gmail_sources = mn-gmail-mailbox.c mn-gmail-mailbox.h
+gmail_gob_sources = \
+ mn-gmail-mailbox-properties.gob \
+ mn-gmail-mailbox.gob
+gmail_gob_built_sources = \
+ mn-gmail-mailbox-properties-private.h \
+ mn-gmail-mailbox-properties.c \
+ mn-gmail-mailbox-properties.h \
+ mn-gmail-mailbox-private.h \
+ mn-gmail-mailbox.c \
+ mn-gmail-mailbox.h
endif
+
if HAVE_SOUP
soup_sources = mn-soup.c mn-soup.h
endif
+if WITH_SSL
+ssl_sources = mn-ssl.c mn-ssl.h
+endif
+
+if WITH_SASL
+sasl_sources = mn-sasl.c mn-sasl.h
+endif
+
+idl_sources = MNAutomation.idl
+idl_built_sources = \
+ MNAutomation-common.c \
+ MNAutomation-stubs.c \
+ MNAutomation-skels.c \
+ MNAutomation.h
+
+gob_sources = \
+ $(mbox_gob_sources) \
+ $(mh_gob_sources) \
+ $(maildir_gob_sources) \
+ $(pop3_gob_sources) \
+ $(imap_gob_sources) \
+ $(pi_gob_sources) \
+ $(sylpheed_gob_sources) \
+ $(gmail_gob_sources) \
+ mn-about-dialog.gob \
+ mn-autodetect-mailbox-properties.gob \
+ mn-automation.gob \
+ 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
+gob_built_sources = \
+ $(mbox_gob_built_sources) \
+ $(mh_gob_built_sources) \
+ $(maildir_gob_built_sources) \
+ $(pop3_gob_built_sources) \
+ $(imap_gob_built_sources) \
+ $(pi_gob_built_sources) \
+ $(sylpheed_gob_built_sources) \
+ $(gmail_gob_built_sources) \
+ mn-about-dialog-private.h \
+ mn-about-dialog.c \
+ mn-about-dialog.h \
+ mn-autodetect-mailbox-properties-private.h \
+ mn-autodetect-mailbox-properties.c \
+ mn-autodetect-mailbox-properties.h \
+ mn-automation-private.h \
+ mn-automation.c \
+ mn-automation.h \
+ mn-blinking-image-private.h \
+ mn-blinking-image.c \
+ mn-blinking-image.h \
+ mn-mail-icon-private.h \
+ mn-mail-icon.c \
+ mn-mail-icon.h \
+ mn-mailbox-view-private.h \
+ mn-mailbox-view.c \
+ mn-mailbox-view.h \
+ mn-mailbox-private.h \
+ mn-mailbox.c \
+ mn-mailbox.h \
+ mn-mailboxes-private.h \
+ mn-mailboxes.c \
+ mn-mailboxes.h \
+ mn-pending-mailbox-private.h \
+ mn-pending-mailbox.c \
+ mn-pending-mailbox.h \
+ mn-shell-private.h \
+ 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
+
+nodist_mail_notification_SOURCES = $(idl_built_sources)
mail_notification_SOURCES = \
+ $(idl_sources) \
+ $(gob_sources) \
+ $(gob_built_sources) \
+ $(md5_sources) \
+ $(client_session_sources) \
+ $(soup_sources) \
+ $(ssl_sources) \
+ $(sasl_sources) \
eggtrayicon.c \
eggtrayicon.h \
mn-conf.c \
mn-conf.h \
mn-dialog.c \
mn-dialog.h \
- mn-mail-icon.c \
- mn-mail-icon.h \
mn-mailbox-properties-dialog.c \
mn-mailbox-properties-dialog.h \
- mn-mailbox.c \
- mn-mailbox.h \
- mn-mailboxes.c \
- mn-mailboxes.h \
- $(mbox_sources) \
- $(mh_sources) \
- $(maildir_sources) \
- $(pop3_sources) \
- $(sylpheed_sources) \
- $(gmail_sources) \
- $(soup_sources) \
+ mn-mailbox-properties-util.c \
+ mn-mailbox-properties-util.h \
+ mn-mailbox-properties.c \
+ mn-mailbox-properties.h \
mn-main.c \
- mn-pending-mailbox.c \
- mn-pending-mailbox.h \
- mn-preferences.c \
- mn-preferences.h \
+ mn-properties.c \
+ mn-properties.h \
mn-stock.c \
mn-stock.h \
- mn-ui.c \
- mn-ui.h \
- mn-unsupported-mailbox.c \
- mn-unsupported-mailbox.h \
mn-uri.c \
mn-uri.h \
mn-util.c \
mn-util.h \
mn-vfs.c \
mn-vfs.h
+BUILT_SOURCES = $(idl_built_sources) $(gob_built_sources)
-mail_notification_LDFLAGS = $(INTLLIBS) $(GNOME_LIBS) $(GNET_LIBS) $(SOUP_LIBS)
+mail_notification_LDFLAGS = $(INTLLIBS) $(GNOME_LIBS) $(SOUP_LIBS) $(OPENSSL_LIBS) $(SASL_LIBS)
gnomelocaledir = $(datadir)/locale
-
-AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) $(GNET_CFLAGS) $(SOUP_CFLAGS) \
+AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) $(SOUP_CFLAGS) $(OPENSSL_CFLAGS) $(SASL_CFLAGS) \
-I$(top_srcdir) \
-DPREFIX="\"$(prefix)\"" \
-DSYSCONFDIR="\"$(sysconfdir)\"" \
-DDATADIR="\"$(datadir)\"" \
-DLIBDIR="\"$(libdir)\"" \
-DGNOMELOCALEDIR="\"$(gnomelocaledir)\"" \
- -DUIDIR="\"$(pkgdatadir)/ui\""
+ -DUIDIR="\"$(pkgdatadir)/ui\"" \
+ -DG_LOG_DOMAIN="\"$(PACKAGE)\""
+
+CLEANFILES = $(idl_built_sources)
+MAINTAINERCLEANFILES = $(gob_built_sources)
+
+%.c %.h %-private.h: %.gob
+ $(GOB2) --always-private-header --exit-on-warn $<
+%-common.c %-stubs.c %-skels.c %.h: %.idl $(ORBIT_IDL)
+ $(ORBIT_IDL) -I$(LIBBONOBO_IDL) -I$(BONOBO_ACTIVATION_IDL) $<
diff --git a/src/Makefile.in b/src/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-SOURCES = $(mail_notification_SOURCES)
+SOURCES = $(mail_notification_SOURCES) $(nodist_mail_notification_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -40,7 +40,8 @@ bin_PROGRAMS = mail-notification$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -50,59 +51,143 @@ CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
-am__mail_notification_SOURCES_DIST = eggtrayicon.c eggtrayicon.h \
- mn-conf.c mn-conf.h mn-dialog.c mn-dialog.h mn-mail-icon.c \
- mn-mail-icon.h mn-mailbox-properties-dialog.c \
- mn-mailbox-properties-dialog.h mn-mailbox.c mn-mailbox.h \
- mn-mailboxes.c mn-mailboxes.h mn-mbox-mailbox.c \
- mn-mbox-mailbox.h mn-mh-mailbox.c mn-mh-mailbox.h \
- mn-maildir-mailbox.c mn-maildir-mailbox.h mn-pop3-mailbox.c \
- mn-pop3-mailbox.h mn-sylpheed-mailbox.c mn-sylpheed-mailbox.h \
- mn-gmail-mailbox.c mn-gmail-mailbox.h mn-soup.c mn-soup.h \
- mn-main.c mn-pending-mailbox.c mn-pending-mailbox.h \
- mn-preferences.c mn-preferences.h mn-stock.c mn-stock.h \
- mn-ui.c mn-ui.h mn-unsupported-mailbox.c \
- mn-unsupported-mailbox.h mn-uri.c mn-uri.h mn-util.c mn-util.h \
- mn-vfs.c mn-vfs.h
-@WITH_MBOX_TRUE@am__objects_1 = mn-mbox-mailbox.$(OBJEXT)
-@WITH_MH_TRUE@am__objects_2 = mn-mh-mailbox.$(OBJEXT)
-@WITH_MAILDIR_TRUE@am__objects_3 = mn-maildir-mailbox.$(OBJEXT)
-@WITH_POP3_TRUE@am__objects_4 = mn-pop3-mailbox.$(OBJEXT)
-@WITH_SYLPHEED_TRUE@am__objects_5 = mn-sylpheed-mailbox.$(OBJEXT)
-@WITH_GMAIL_TRUE@am__objects_6 = mn-gmail-mailbox.$(OBJEXT)
-@HAVE_SOUP_TRUE@am__objects_7 = mn-soup.$(OBJEXT)
-am_mail_notification_OBJECTS = eggtrayicon.$(OBJEXT) mn-conf.$(OBJEXT) \
- mn-dialog.$(OBJEXT) mn-mail-icon.$(OBJEXT) \
- mn-mailbox-properties-dialog.$(OBJEXT) mn-mailbox.$(OBJEXT) \
- mn-mailboxes.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
- $(am__objects_3) $(am__objects_4) $(am__objects_5) \
- $(am__objects_6) $(am__objects_7) mn-main.$(OBJEXT) \
- mn-pending-mailbox.$(OBJEXT) mn-preferences.$(OBJEXT) \
- mn-stock.$(OBJEXT) mn-ui.$(OBJEXT) \
- mn-unsupported-mailbox.$(OBJEXT) mn-uri.$(OBJEXT) \
+am__mail_notification_SOURCES_DIST = MNAutomation.idl \
+ mn-mbox-mailbox.gob mn-mh-mailbox.gob mn-maildir-mailbox.gob \
+ mn-pop3-mailbox-properties.gob mn-pop3-mailbox.gob \
+ mn-imap-mailbox-properties.gob mn-imap-mailbox.gob \
+ mn-auth-combo-box.gob mn-pi-mailbox-properties.gob \
+ mn-sylpheed-mailbox.gob mn-gmail-mailbox-properties.gob \
+ mn-gmail-mailbox.gob mn-about-dialog.gob \
+ mn-autodetect-mailbox-properties.gob mn-automation.gob \
+ 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-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 \
+ mn-imap-mailbox-properties.c mn-imap-mailbox-properties.h \
+ mn-imap-mailbox-private.h mn-imap-mailbox.c mn-imap-mailbox.h \
+ mn-auth-combo-box-private.h mn-auth-combo-box.c \
+ mn-auth-combo-box.h mn-pi-mailbox-properties-private.h \
+ mn-pi-mailbox-properties.c mn-pi-mailbox-properties.h \
+ mn-sylpheed-mailbox-private.h mn-sylpheed-mailbox.c \
+ mn-sylpheed-mailbox.h mn-gmail-mailbox-properties-private.h \
+ mn-gmail-mailbox-properties.c mn-gmail-mailbox-properties.h \
+ mn-gmail-mailbox-private.h mn-gmail-mailbox.c \
+ mn-gmail-mailbox.h mn-about-dialog-private.h mn-about-dialog.c \
+ mn-about-dialog.h mn-autodetect-mailbox-properties-private.h \
+ mn-autodetect-mailbox-properties.c \
+ mn-autodetect-mailbox-properties.h mn-automation-private.h \
+ mn-automation.c mn-automation.h mn-blinking-image-private.h \
+ mn-blinking-image.c mn-blinking-image.h mn-mail-icon-private.h \
+ mn-mail-icon.c mn-mail-icon.h mn-mailbox-view-private.h \
+ mn-mailbox-view.c mn-mailbox-view.h mn-mailbox-private.h \
+ mn-mailbox.c mn-mailbox.h mn-mailboxes-private.h \
+ mn-mailboxes.c mn-mailboxes.h mn-pending-mailbox-private.h \
+ mn-pending-mailbox.c mn-pending-mailbox.h mn-shell-private.h \
+ 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-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
+am__objects_1 =
+am__objects_2 = $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1)
+@WITH_MBOX_TRUE@am__objects_3 = mn-mbox-mailbox.$(OBJEXT)
+@WITH_MH_TRUE@am__objects_4 = mn-mh-mailbox.$(OBJEXT)
+@WITH_MAILDIR_TRUE@am__objects_5 = mn-maildir-mailbox.$(OBJEXT)
+@WITH_POP3_TRUE@am__objects_6 = mn-pop3-mailbox-properties.$(OBJEXT) \
+@WITH_POP3_TRUE@ mn-pop3-mailbox.$(OBJEXT)
+@WITH_IMAP_TRUE@am__objects_7 = mn-imap-mailbox-properties.$(OBJEXT) \
+@WITH_IMAP_TRUE@ mn-imap-mailbox.$(OBJEXT)
+@WITH_POP3_OR_IMAP_TRUE@am__objects_8 = mn-auth-combo-box.$(OBJEXT) \
+@WITH_POP3_OR_IMAP_TRUE@ mn-pi-mailbox-properties.$(OBJEXT)
+@WITH_SYLPHEED_TRUE@am__objects_9 = mn-sylpheed-mailbox.$(OBJEXT)
+@WITH_GMAIL_TRUE@am__objects_10 = \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox-properties.$(OBJEXT) \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox.$(OBJEXT)
+am__objects_11 = $(am__objects_3) $(am__objects_4) $(am__objects_5) \
+ $(am__objects_6) $(am__objects_7) $(am__objects_8) \
+ $(am__objects_9) $(am__objects_10) mn-about-dialog.$(OBJEXT) \
+ mn-autodetect-mailbox-properties.$(OBJEXT) \
+ mn-automation.$(OBJEXT) mn-blinking-image.$(OBJEXT) \
+ mn-mail-icon.$(OBJEXT) mn-mailbox-view.$(OBJEXT) \
+ mn-mailbox.$(OBJEXT) mn-mailboxes.$(OBJEXT) \
+ mn-pending-mailbox.$(OBJEXT) mn-shell.$(OBJEXT) \
+ mn-system-mailbox-properties.$(OBJEXT) \
+ mn-unsupported-mailbox.$(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)
+@WITH_SSL_TRUE@am__objects_15 = mn-ssl.$(OBJEXT)
+@WITH_SASL_TRUE@am__objects_16 = mn-sasl.$(OBJEXT)
+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) \
+ 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)
-mail_notification_OBJECTS = $(am_mail_notification_OBJECTS)
+am__objects_17 = MNAutomation-common.$(OBJEXT) \
+ MNAutomation-stubs.$(OBJEXT) MNAutomation-skels.$(OBJEXT)
+nodist_mail_notification_OBJECTS = $(am__objects_17)
+mail_notification_OBJECTS = $(am_mail_notification_OBJECTS) \
+ $(nodist_mail_notification_OBJECTS)
mail_notification_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/eggtrayicon.Po \
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/MNAutomation-common.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/MNAutomation-skels.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/MNAutomation-stubs.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/eggtrayicon.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-about-dialog.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-auth-combo-box.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-autodetect-mailbox-properties.Po \
+@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-gmail-mailbox-properties.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-gmail-mailbox.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-imap-mailbox-properties.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-imap-mailbox.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-mail-icon.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-mailbox-properties-dialog.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-mailbox-properties-util.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-mailbox-properties.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-mailbox-view.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-mailbox.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-mailboxes.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-maildir-mailbox.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-main.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-mbox-mailbox.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/mn-mh-mailbox.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-md5.Po ./$(DEPDIR)/mn-mh-mailbox.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-pending-mailbox.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-pi-mailbox-properties.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-pop3-mailbox-properties.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-pop3-mailbox.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/mn-preferences.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/mn-soup.Po ./$(DEPDIR)/mn-stock.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-properties.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-sasl.Po ./$(DEPDIR)/mn-shell.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-soup.Po ./$(DEPDIR)/mn-ssl.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-stock.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-sylpheed-mailbox.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/mn-ui.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/mn-system-mailbox-properties.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-unsupported-mailbox.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-uri.Po ./$(DEPDIR)/mn-util.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/mn-vfs.Po
@@ -110,7 +195,8 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(mail_notification_SOURCES)
+SOURCES = $(mail_notification_SOURCES) \
+ $(nodist_mail_notification_SOURCES)
DIST_SOURCES = $(am__mail_notification_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
@@ -123,6 +209,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -147,10 +234,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -183,6 +269,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -193,6 +280,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -205,6 +295,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -215,6 +307,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -222,7 +316,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
@@ -253,46 +355,185 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-@WITH_MBOX_TRUE@mbox_sources = mn-mbox-mailbox.c mn-mbox-mailbox.h
-@WITH_MH_TRUE@mh_sources = mn-mh-mailbox.c mn-mh-mailbox.h
-@WITH_MAILDIR_TRUE@maildir_sources = mn-maildir-mailbox.c mn-maildir-mailbox.h
-@WITH_POP3_TRUE@pop3_sources = mn-pop3-mailbox.c mn-pop3-mailbox.h
-@WITH_SYLPHEED_TRUE@sylpheed_sources = mn-sylpheed-mailbox.c mn-sylpheed-mailbox.h
-@WITH_GMAIL_TRUE@gmail_sources = mn-gmail-mailbox.c mn-gmail-mailbox.h
+@WITH_MBOX_TRUE@mbox_gob_sources = mn-mbox-mailbox.gob
+@WITH_MBOX_TRUE@mbox_gob_built_sources = \
+@WITH_MBOX_TRUE@ mn-mbox-mailbox-private.h \
+@WITH_MBOX_TRUE@ mn-mbox-mailbox.c \
+@WITH_MBOX_TRUE@ mn-mbox-mailbox.h
+
+@WITH_MH_TRUE@mh_gob_sources = mn-mh-mailbox.gob
+@WITH_MH_TRUE@mh_gob_built_sources = \
+@WITH_MH_TRUE@ mn-mh-mailbox-private.h \
+@WITH_MH_TRUE@ mn-mh-mailbox.c \
+@WITH_MH_TRUE@ mn-mh-mailbox.h
+
+@WITH_MAILDIR_TRUE@maildir_gob_sources = mn-maildir-mailbox.gob
+@WITH_MAILDIR_TRUE@maildir_gob_built_sources = \
+@WITH_MAILDIR_TRUE@ mn-maildir-mailbox-private.h \
+@WITH_MAILDIR_TRUE@ mn-maildir-mailbox.c \
+@WITH_MAILDIR_TRUE@ mn-maildir-mailbox.h
+
+@WITH_POP3_TRUE@pop3_gob_sources = \
+@WITH_POP3_TRUE@ mn-pop3-mailbox-properties.gob \
+@WITH_POP3_TRUE@ mn-pop3-mailbox.gob
+
+@WITH_POP3_TRUE@pop3_gob_built_sources = \
+@WITH_POP3_TRUE@ mn-pop3-mailbox-properties-private.h \
+@WITH_POP3_TRUE@ mn-pop3-mailbox-properties.c \
+@WITH_POP3_TRUE@ mn-pop3-mailbox-properties.h \
+@WITH_POP3_TRUE@ mn-pop3-mailbox-private.h \
+@WITH_POP3_TRUE@ mn-pop3-mailbox.c \
+@WITH_POP3_TRUE@ mn-pop3-mailbox.h
+
+@WITH_POP3_TRUE@md5_sources = mn-md5.c mn-md5.h
+@WITH_IMAP_TRUE@imap_gob_sources = \
+@WITH_IMAP_TRUE@ mn-imap-mailbox-properties.gob \
+@WITH_IMAP_TRUE@ mn-imap-mailbox.gob
+
+@WITH_IMAP_TRUE@imap_gob_built_sources = \
+@WITH_IMAP_TRUE@ mn-imap-mailbox-properties-private.h \
+@WITH_IMAP_TRUE@ mn-imap-mailbox-properties.c \
+@WITH_IMAP_TRUE@ mn-imap-mailbox-properties.h \
+@WITH_IMAP_TRUE@ mn-imap-mailbox-private.h \
+@WITH_IMAP_TRUE@ mn-imap-mailbox.c \
+@WITH_IMAP_TRUE@ mn-imap-mailbox.h
+
+@WITH_POP3_OR_IMAP_TRUE@client_session_sources = mn-client-session.c mn-client-session.h
+@WITH_POP3_OR_IMAP_TRUE@pi_gob_sources = \
+@WITH_POP3_OR_IMAP_TRUE@ mn-auth-combo-box.gob \
+@WITH_POP3_OR_IMAP_TRUE@ mn-pi-mailbox-properties.gob
+
+@WITH_POP3_OR_IMAP_TRUE@pi_gob_built_sources = \
+@WITH_POP3_OR_IMAP_TRUE@ mn-auth-combo-box-private.h \
+@WITH_POP3_OR_IMAP_TRUE@ mn-auth-combo-box.c \
+@WITH_POP3_OR_IMAP_TRUE@ mn-auth-combo-box.h \
+@WITH_POP3_OR_IMAP_TRUE@ mn-pi-mailbox-properties-private.h \
+@WITH_POP3_OR_IMAP_TRUE@ mn-pi-mailbox-properties.c \
+@WITH_POP3_OR_IMAP_TRUE@ mn-pi-mailbox-properties.h
+
+@WITH_SYLPHEED_TRUE@sylpheed_gob_sources = mn-sylpheed-mailbox.gob
+@WITH_SYLPHEED_TRUE@sylpheed_gob_built_sources = \
+@WITH_SYLPHEED_TRUE@ mn-sylpheed-mailbox-private.h \
+@WITH_SYLPHEED_TRUE@ mn-sylpheed-mailbox.c \
+@WITH_SYLPHEED_TRUE@ mn-sylpheed-mailbox.h
+
+@WITH_GMAIL_TRUE@gmail_gob_sources = \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox-properties.gob \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox.gob
+
+@WITH_GMAIL_TRUE@gmail_gob_built_sources = \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox-properties-private.h \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox-properties.c \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox-properties.h \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox-private.h \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox.c \
+@WITH_GMAIL_TRUE@ mn-gmail-mailbox.h
+
@HAVE_SOUP_TRUE@soup_sources = mn-soup.c mn-soup.h
+@WITH_SSL_TRUE@ssl_sources = mn-ssl.c mn-ssl.h
+@WITH_SASL_TRUE@sasl_sources = mn-sasl.c mn-sasl.h
+idl_sources = MNAutomation.idl
+idl_built_sources = \
+ MNAutomation-common.c \
+ MNAutomation-stubs.c \
+ MNAutomation-skels.c \
+ MNAutomation.h
+
+gob_sources = \
+ $(mbox_gob_sources) \
+ $(mh_gob_sources) \
+ $(maildir_gob_sources) \
+ $(pop3_gob_sources) \
+ $(imap_gob_sources) \
+ $(pi_gob_sources) \
+ $(sylpheed_gob_sources) \
+ $(gmail_gob_sources) \
+ mn-about-dialog.gob \
+ mn-autodetect-mailbox-properties.gob \
+ mn-automation.gob \
+ 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
+
+gob_built_sources = \
+ $(mbox_gob_built_sources) \
+ $(mh_gob_built_sources) \
+ $(maildir_gob_built_sources) \
+ $(pop3_gob_built_sources) \
+ $(imap_gob_built_sources) \
+ $(pi_gob_built_sources) \
+ $(sylpheed_gob_built_sources) \
+ $(gmail_gob_built_sources) \
+ mn-about-dialog-private.h \
+ mn-about-dialog.c \
+ mn-about-dialog.h \
+ mn-autodetect-mailbox-properties-private.h \
+ mn-autodetect-mailbox-properties.c \
+ mn-autodetect-mailbox-properties.h \
+ mn-automation-private.h \
+ mn-automation.c \
+ mn-automation.h \
+ mn-blinking-image-private.h \
+ mn-blinking-image.c \
+ mn-blinking-image.h \
+ mn-mail-icon-private.h \
+ mn-mail-icon.c \
+ mn-mail-icon.h \
+ mn-mailbox-view-private.h \
+ mn-mailbox-view.c \
+ mn-mailbox-view.h \
+ mn-mailbox-private.h \
+ mn-mailbox.c \
+ mn-mailbox.h \
+ mn-mailboxes-private.h \
+ mn-mailboxes.c \
+ mn-mailboxes.h \
+ mn-pending-mailbox-private.h \
+ mn-pending-mailbox.c \
+ mn-pending-mailbox.h \
+ mn-shell-private.h \
+ 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
+
+nodist_mail_notification_SOURCES = $(idl_built_sources)
mail_notification_SOURCES = \
+ $(idl_sources) \
+ $(gob_sources) \
+ $(gob_built_sources) \
+ $(md5_sources) \
+ $(client_session_sources) \
+ $(soup_sources) \
+ $(ssl_sources) \
+ $(sasl_sources) \
eggtrayicon.c \
eggtrayicon.h \
mn-conf.c \
mn-conf.h \
mn-dialog.c \
mn-dialog.h \
- mn-mail-icon.c \
- mn-mail-icon.h \
mn-mailbox-properties-dialog.c \
mn-mailbox-properties-dialog.h \
- mn-mailbox.c \
- mn-mailbox.h \
- mn-mailboxes.c \
- mn-mailboxes.h \
- $(mbox_sources) \
- $(mh_sources) \
- $(maildir_sources) \
- $(pop3_sources) \
- $(sylpheed_sources) \
- $(gmail_sources) \
- $(soup_sources) \
+ mn-mailbox-properties-util.c \
+ mn-mailbox-properties-util.h \
+ mn-mailbox-properties.c \
+ mn-mailbox-properties.h \
mn-main.c \
- mn-pending-mailbox.c \
- mn-pending-mailbox.h \
- mn-preferences.c \
- mn-preferences.h \
+ mn-properties.c \
+ mn-properties.h \
mn-stock.c \
mn-stock.h \
- mn-ui.c \
- mn-ui.h \
- mn-unsupported-mailbox.c \
- mn-unsupported-mailbox.h \
mn-uri.c \
mn-uri.h \
mn-util.c \
@@ -300,18 +541,23 @@ mail_notification_SOURCES = \
mn-vfs.c \
mn-vfs.h
-mail_notification_LDFLAGS = $(INTLLIBS) $(GNOME_LIBS) $(GNET_LIBS) $(SOUP_LIBS)
+BUILT_SOURCES = $(idl_built_sources) $(gob_built_sources)
+mail_notification_LDFLAGS = $(INTLLIBS) $(GNOME_LIBS) $(SOUP_LIBS) $(OPENSSL_LIBS) $(SASL_LIBS)
gnomelocaledir = $(datadir)/locale
-AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) $(GNET_CFLAGS) $(SOUP_CFLAGS) \
+AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) $(SOUP_CFLAGS) $(OPENSSL_CFLAGS) $(SASL_CFLAGS) \
-I$(top_srcdir) \
-DPREFIX="\"$(prefix)\"" \
-DSYSCONFDIR="\"$(sysconfdir)\"" \
-DDATADIR="\"$(datadir)\"" \
-DLIBDIR="\"$(libdir)\"" \
-DGNOMELOCALEDIR="\"$(gnomelocaledir)\"" \
- -DUIDIR="\"$(pkgdatadir)/ui\""
+ -DUIDIR="\"$(pkgdatadir)/ui\"" \
+ -DG_LOG_DOMAIN="\"$(PACKAGE)\""
-all: all-am
+CLEANFILES = $(idl_built_sources)
+MAINTAINERCLEANFILES = $(gob_built_sources)
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
@@ -377,25 +623,46 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MNAutomation-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MNAutomation-skels.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MNAutomation-stubs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eggtrayicon.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-about-dialog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-auth-combo-box.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-autodetect-mailbox-properties.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-automation.Po@am__quote@
+@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@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-imap-mailbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mail-icon.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mailbox-properties-dialog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mailbox-properties-util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mailbox-properties.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mailbox-view.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mailbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mailboxes.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-maildir-mailbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mbox-mailbox.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-md5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-mh-mailbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-pending-mailbox.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-pi-mailbox-properties.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-pop3-mailbox-properties.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-pop3-mailbox.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-preferences.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-properties.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-sasl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-shell.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-soup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-ssl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-stock.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-sylpheed-mailbox.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-system-mailbox-properties.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-unsupported-mailbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-uri.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-util.Po@am__quote@
@@ -494,13 +761,15 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
-check: check-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@@ -517,6 +786,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
@@ -524,6 +794,8 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
@@ -584,6 +856,11 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-info-am
+
+%.c %.h %-private.h: %.gob
+ $(GOB2) --always-private-header --exit-on-warn $<
+%-common.c %-stubs.c %-skels.c %.h: %.idl $(ORBIT_IDL)
+ $(ORBIT_IDL) -I$(LIBBONOBO_IDL) -I$(BONOBO_ACTIVATION_IDL) $<
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/src/mn-about-dialog-private.h b/src/mn-about-dialog-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_ABOUT_DIALOG_PRIVATE_H__
+#define __MN_ABOUT_DIALOG_PRIVATE_H__
+
+#include "mn-about-dialog.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-about-dialog.c b/src/mn-about-dialog.c
@@ -0,0 +1,151 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-about-dialog.h"
+
+#include "mn-about-dialog-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 23 "mn-about-dialog.gob"
+
+#include "mn-util.h"
+
+#line 29 "mn-about-dialog.c"
+/* self casting macros */
+#define SELF(x) MN_ABOUT_DIALOG(x)
+#define SELF_CONST(x) MN_ABOUT_DIALOG_CONST(x)
+#define IS_SELF(x) MN_IS_ABOUT_DIALOG(x)
+#define TYPE_SELF MN_TYPE_ABOUT_DIALOG
+#define SELF_CLASS(x) MN_ABOUT_DIALOG_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_ABOUT_DIALOG_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNAboutDialog Self;
+typedef MNAboutDialogClass SelfClass;
+
+/* here are local prototypes */
+static void mn_about_dialog_class_init (MNAboutDialogClass * c) G_GNUC_UNUSED;
+static void mn_about_dialog_init (MNAboutDialog * self) G_GNUC_UNUSED;
+
+/* pointer to the class of our parent */
+static GnomeAboutClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_new mn_about_dialog_new
+GType
+mn_about_dialog_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNAboutDialogClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_about_dialog_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNAboutDialog),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_about_dialog_init,
+ NULL
+ };
+
+ type = g_type_register_static (GNOME_TYPE_ABOUT, "MNAboutDialog", &info, (GTypeFlags)0);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNAboutDialog *)g_object_new(mn_about_dialog_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNAboutDialog * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNAboutDialog *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNAboutDialog *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNAboutDialog *)g_object_new_valist (mn_about_dialog_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+static void
+mn_about_dialog_class_init (MNAboutDialogClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:About:Dialog::class_init"
+
+ parent_class = g_type_class_ref (GNOME_TYPE_ABOUT);
+
+}
+#undef __GOB_FUNCTION__
+#line 29 "mn-about-dialog.gob"
+static void
+mn_about_dialog_init (MNAboutDialog * self G_GNUC_UNUSED)
+#line 106 "mn-about-dialog.c"
+{
+#define __GOB_FUNCTION__ "MN:About:Dialog::init"
+ {
+#line 30 "mn-about-dialog.gob"
+
+ const char *authors[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
+ const char *documenters[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
+ GdkPixbuf *logo;
+ GdkPixbuf *icon;
+
+ logo = mn_pixbuf_new("logo.png");
+ gnome_about_construct(GNOME_ABOUT(self),
+ _("Mail Notification"),
+ VERSION,
+ "Copyright \302\251 2003, 2004 Jean-Yves Lefort",
+ _("A Mail Notification Icon"),
+ authors,
+ documenters,
+ _("Jean-Yves Lefort <jylefort@brutele.be>"),
+ logo);
+ g_object_unref(logo);
+
+ icon = mn_pixbuf_new("about-icon.png");
+ gtk_window_set_icon(GTK_WINDOW(self), icon);
+ g_object_unref(icon);
+
+#line 133 "mn-about-dialog.c"
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 53 "mn-about-dialog.gob"
+GtkWidget *
+mn_about_dialog_new (void)
+#line 143 "mn-about-dialog.c"
+{
+#define __GOB_FUNCTION__ "MN:About:Dialog::new"
+{
+#line 55 "mn-about-dialog.gob"
+
+ return GTK_WIDGET(GET_NEW);
+ }}
+#line 151 "mn-about-dialog.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-about-dialog.gob b/src/mn-about-dialog.gob
@@ -0,0 +1,58 @@
+/*
+ * 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 "config.h"
+#include <gnome.h>
+%}
+%{
+#include "mn-util.h"
+%}
+
+class MN:About:Dialog from Gnome:About
+{
+ init (self)
+ {
+ const char *authors[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
+ const char *documenters[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
+ GdkPixbuf *logo;
+ GdkPixbuf *icon;
+
+ logo = mn_pixbuf_new("logo.png");
+ gnome_about_construct(GNOME_ABOUT(self),
+ _("Mail Notification"),
+ VERSION,
+ "Copyright \302\251 2003, 2004 Jean-Yves Lefort",
+ _("A Mail Notification Icon"),
+ authors,
+ documenters,
+ _("Jean-Yves Lefort <jylefort@brutele.be>"),
+ logo);
+ g_object_unref(logo);
+
+ icon = mn_pixbuf_new("about-icon.png");
+ gtk_window_set_icon(GTK_WINDOW(self), icon);
+ g_object_unref(icon);
+ }
+
+ public GtkWidget *
+ new (void)
+ {
+ return GTK_WIDGET(GET_NEW);
+ }
+}
diff --git a/src/mn-about-dialog.h b/src/mn-about-dialog.h
@@ -0,0 +1,59 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include "config.h"
+#include <gnome.h>
+
+#ifndef __MN_ABOUT_DIALOG_H__
+#define __MN_ABOUT_DIALOG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_ABOUT_DIALOG (mn_about_dialog_get_type())
+#define MN_ABOUT_DIALOG(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_about_dialog_get_type(), MNAboutDialog)
+#define MN_ABOUT_DIALOG_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_about_dialog_get_type(), MNAboutDialog const)
+#define MN_ABOUT_DIALOG_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_about_dialog_get_type(), MNAboutDialogClass)
+#define MN_IS_ABOUT_DIALOG(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_about_dialog_get_type ())
+
+#define MN_ABOUT_DIALOG_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_about_dialog_get_type(), MNAboutDialogClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_ABOUT_DIALOG__
+#define __TYPEDEF_MN_ABOUT_DIALOG__
+typedef struct _MNAboutDialog MNAboutDialog;
+#endif
+struct _MNAboutDialog {
+ GnomeAbout __parent__;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNAboutDialogClass MNAboutDialogClass;
+struct _MNAboutDialogClass {
+ GnomeAboutClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_about_dialog_get_type (void);
+GtkWidget * mn_about_dialog_new (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-auth-combo-box-private.h b/src/mn-auth-combo-box-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_AUTH_COMBO_BOX_PRIVATE_H__
+#define __MN_AUTH_COMBO_BOX_PRIVATE_H__
+
+#include "mn-auth-combo-box.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-auth-combo-box.c b/src/mn-auth-combo-box.c
@@ -0,0 +1,361 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-auth-combo-box.h"
+
+#include "mn-auth-combo-box-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 22 "mn-auth-combo-box.gob"
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#ifdef WITH_SASL
+#include <sasl/sasl.h>
+#include "mn-sasl.h"
+#endif /* WITH_SASL */
+
+ enum
+ {
+ COLUMN_MECHANISM,
+ COLUMN_LABEL,
+ N_COLUMNS
+ };
+
+#line 41 "mn-auth-combo-box.c"
+/* self casting macros */
+#define SELF(x) MN_AUTH_COMBO_BOX(x)
+#define SELF_CONST(x) MN_AUTH_COMBO_BOX_CONST(x)
+#define IS_SELF(x) MN_IS_AUTH_COMBO_BOX(x)
+#define TYPE_SELF MN_TYPE_AUTH_COMBO_BOX
+#define SELF_CLASS(x) MN_AUTH_COMBO_BOX_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_AUTH_COMBO_BOX_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNAuthComboBox Self;
+typedef MNAuthComboBoxClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void mn_auth_combo_box_class_init (MNAuthComboBoxClass * c) G_GNUC_UNUSED;
+static void mn_auth_combo_box_init (MNAuthComboBox * self) G_GNUC_UNUSED;
+
+enum {
+ PROP_0,
+ PROP_ACTIVE_MECHANISM
+};
+
+/* pointer to the class of our parent */
+static GtkComboBoxClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_get_active_mechanism mn_auth_combo_box_get_active_mechanism
+#define self_set_active_mechanism mn_auth_combo_box_set_active_mechanism
+#define self_append mn_auth_combo_box_append
+#define self_new mn_auth_combo_box_new
+GType
+mn_auth_combo_box_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNAuthComboBoxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_auth_combo_box_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNAuthComboBox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_auth_combo_box_init,
+ NULL
+ };
+
+ type = g_type_register_static (GTK_TYPE_COMBO_BOX, "MNAuthComboBox", &info, (GTypeFlags)0);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNAuthComboBox *)g_object_new(mn_auth_combo_box_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNAuthComboBox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNAuthComboBox *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNAuthComboBox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNAuthComboBox *)g_object_new_valist (mn_auth_combo_box_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+static void
+mn_auth_combo_box_class_init (MNAuthComboBoxClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (GTK_TYPE_COMBO_BOX);
+
+ 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
+ ("active_mechanism" /* name */,
+ NULL /* nick */,
+ NULL /* blurb */,
+ NULL /* default_value */,
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (g_object_class,
+ PROP_ACTIVE_MECHANISM,
+ param_spec);
+ }
+}
+#undef __GOB_FUNCTION__
+#line 84 "mn-auth-combo-box.gob"
+static void
+mn_auth_combo_box_init (MNAuthComboBox * self G_GNUC_UNUSED)
+#line 144 "mn-auth-combo-box.c"
+{
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::init"
+ {
+#line 85 "mn-auth-combo-box.gob"
+
+ GtkListStore *store;
+ GtkCellRenderer *renderer;
+
+ store = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
+ gtk_combo_box_set_model(GTK_COMBO_BOX(self), GTK_TREE_MODEL(store));
+ g_object_unref(store);
+
+ renderer = gtk_cell_renderer_text_new();
+ gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(self), renderer, TRUE);
+ gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(self), renderer,
+ "markup", COLUMN_LABEL,
+ NULL);
+
+ self_append(self, NULL, _("<span style=\"italic\">autodetect</span>"));
+#ifdef WITH_SASL
+ if (mn_sasl_use(NULL))
+ {
+ const char **mechanisms;
+
+ mechanisms = sasl_global_listmech();
+ if (mechanisms)
+ {
+ int i;
+
+ for (i = 0; mechanisms[i]; i++)
+ {
+ char *escaped = g_markup_escape_text(mechanisms[i], -1);
+ self_append(self, mechanisms[i], escaped);
+ g_free(escaped);
+ }
+ }
+ mn_sasl_unuse();
+ }
+#endif /* WITH_SASL */
+
+ self_set_active_mechanism(self, NULL);
+
+#line 187 "mn-auth-combo-box.c"
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::set_property"
+{
+ MNAuthComboBox *self G_GNUC_UNUSED;
+
+ self = MN_AUTH_COMBO_BOX (object);
+
+ switch (property_id) {
+ case PROP_ACTIVE_MECHANISM:
+ {
+#line 42 "mn-auth-combo-box.gob"
+
+ const char *mechanism = g_value_get_string(VAL);
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gboolean valid;
+
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(self));
+ valid = gtk_tree_model_get_iter_first(model, &iter);
+
+ while (valid)
+ {
+ char *this_mech;
+ gboolean found;
+
+ gtk_tree_model_get(model, &iter, COLUMN_MECHANISM, &this_mech, -1);
+ found = (! this_mech && ! mechanism)
+ || (this_mech && mechanism && ! strcmp(this_mech, mechanism));
+ g_free(this_mech);
+
+ if (found)
+ {
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(self), &iter);
+ break;
+ }
+
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+
+#line 235 "mn-auth-combo-box.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::get_property"
+{
+ MNAuthComboBox *self G_GNUC_UNUSED;
+
+ self = MN_AUTH_COMBO_BOX (object);
+
+ switch (property_id) {
+ case PROP_ACTIVE_MECHANISM:
+ {
+#line 71 "mn-auth-combo-box.gob"
+
+ char *mechanism = NULL;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(self));
+ if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(self), &iter))
+ gtk_tree_model_get(model, &iter, COLUMN_MECHANISM, &mechanism, -1);
+
+ g_value_set_string(VAL, mechanism);
+ g_free(mechanism);
+
+#line 277 "mn-auth-combo-box.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+#line 71 "mn-auth-combo-box.gob"
+gchar *
+mn_auth_combo_box_get_active_mechanism (MNAuthComboBox * self)
+#line 296 "mn-auth-combo-box.c"
+{
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::get_active_mechanism"
+{
+#line 40 "mn-auth-combo-box.gob"
+ gchar* val; g_object_get (G_OBJECT (self), "active_mechanism", &val, NULL); return val;
+}}
+#line 303 "mn-auth-combo-box.c"
+#undef __GOB_FUNCTION__
+
+#line 42 "mn-auth-combo-box.gob"
+void
+mn_auth_combo_box_set_active_mechanism (MNAuthComboBox * self, gchar * val)
+#line 309 "mn-auth-combo-box.c"
+{
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::set_active_mechanism"
+{
+#line 40 "mn-auth-combo-box.gob"
+ g_object_set (G_OBJECT (self), "active_mechanism", val, NULL);
+}}
+#line 316 "mn-auth-combo-box.c"
+#undef __GOB_FUNCTION__
+
+
+#line 124 "mn-auth-combo-box.gob"
+void
+mn_auth_combo_box_append (MNAuthComboBox * self, const char * mechanism, const char * label)
+#line 323 "mn-auth-combo-box.c"
+{
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::append"
+#line 124 "mn-auth-combo-box.gob"
+ g_return_if_fail (self != NULL);
+#line 124 "mn-auth-combo-box.gob"
+ g_return_if_fail (MN_IS_AUTH_COMBO_BOX (self));
+#line 124 "mn-auth-combo-box.gob"
+ g_return_if_fail (label != NULL);
+#line 332 "mn-auth-combo-box.c"
+{
+#line 126 "mn-auth-combo-box.gob"
+
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(self));
+
+ gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+ gtk_list_store_set(GTK_LIST_STORE(model), &iter,
+ COLUMN_MECHANISM, mechanism,
+ COLUMN_LABEL, label,
+ -1);
+ }}
+#line 347 "mn-auth-combo-box.c"
+#undef __GOB_FUNCTION__
+
+#line 139 "mn-auth-combo-box.gob"
+GtkWidget *
+mn_auth_combo_box_new (void)
+#line 353 "mn-auth-combo-box.c"
+{
+#define __GOB_FUNCTION__ "MN:Auth:Combo:Box::new"
+{
+#line 141 "mn-auth-combo-box.gob"
+
+ return GTK_WIDGET(GET_NEW);
+ }}
+#line 361 "mn-auth-combo-box.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-auth-combo-box.gob b/src/mn-auth-combo-box.gob
@@ -0,0 +1,144 @@
+/*
+ * 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 <gtk/gtk.h>
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#ifdef WITH_SASL
+#include <sasl/sasl.h>
+#include "mn-sasl.h"
+#endif /* WITH_SASL */
+
+ enum
+ {
+ COLUMN_MECHANISM,
+ COLUMN_LABEL,
+ N_COLUMNS
+ };
+%}
+
+class MN:Auth:Combo:Box from Gtk:Combo:Box
+{
+ property STRING active_mechanism (export)
+ set
+ {
+ const char *mechanism = g_value_get_string(VAL);
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gboolean valid;
+
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(self));
+ valid = gtk_tree_model_get_iter_first(model, &iter);
+
+ while (valid)
+ {
+ char *this_mech;
+ gboolean found;
+
+ gtk_tree_model_get(model, &iter, COLUMN_MECHANISM, &this_mech, -1);
+ found = (! this_mech && ! mechanism)
+ || (this_mech && mechanism && ! strcmp(this_mech, mechanism));
+ g_free(this_mech);
+
+ if (found)
+ {
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(self), &iter);
+ break;
+ }
+
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+ }
+ get
+ {
+ char *mechanism = NULL;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(self));
+ if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(self), &iter))
+ gtk_tree_model_get(model, &iter, COLUMN_MECHANISM, &mechanism, -1);
+
+ g_value_set_string(VAL, mechanism);
+ g_free(mechanism);
+ };
+
+ init (self)
+ {
+ GtkListStore *store;
+ GtkCellRenderer *renderer;
+
+ store = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
+ gtk_combo_box_set_model(GTK_COMBO_BOX(self), GTK_TREE_MODEL(store));
+ g_object_unref(store);
+
+ renderer = gtk_cell_renderer_text_new();
+ gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(self), renderer, TRUE);
+ gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(self), renderer,
+ "markup", COLUMN_LABEL,
+ NULL);
+
+ self_append(self, NULL, _("<span style=\"italic\">autodetect</span>"));
+#ifdef WITH_SASL
+ if (mn_sasl_use(NULL))
+ {
+ const char **mechanisms;
+
+ mechanisms = sasl_global_listmech();
+ if (mechanisms)
+ {
+ int i;
+
+ for (i = 0; mechanisms[i]; i++)
+ {
+ char *escaped = g_markup_escape_text(mechanisms[i], -1);
+ self_append(self, mechanisms[i], escaped);
+ g_free(escaped);
+ }
+ }
+ mn_sasl_unuse();
+ }
+#endif /* WITH_SASL */
+
+ self_set_active_mechanism(self, NULL);
+ }
+
+ public void
+ append (self, const char *mechanism, const char *label (check null))
+ {
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(self));
+
+ gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+ gtk_list_store_set(GTK_LIST_STORE(model), &iter,
+ COLUMN_MECHANISM, mechanism,
+ COLUMN_LABEL, label,
+ -1);
+ }
+
+ public GtkWidget *
+ new (void)
+ {
+ return GTK_WIDGET(GET_NEW);
+ }
+}
diff --git a/src/mn-auth-combo-box.h b/src/mn-auth-combo-box.h
@@ -0,0 +1,76 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <gtk/gtk.h>
+
+#ifndef __MN_AUTH_COMBO_BOX_H__
+#define __MN_AUTH_COMBO_BOX_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_AUTH_COMBO_BOX (mn_auth_combo_box_get_type())
+#define MN_AUTH_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_auth_combo_box_get_type(), MNAuthComboBox)
+#define MN_AUTH_COMBO_BOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_auth_combo_box_get_type(), MNAuthComboBox const)
+#define MN_AUTH_COMBO_BOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_auth_combo_box_get_type(), MNAuthComboBoxClass)
+#define MN_IS_AUTH_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_auth_combo_box_get_type ())
+
+#define MN_AUTH_COMBO_BOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_auth_combo_box_get_type(), MNAuthComboBoxClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_AUTH_COMBO_BOX__
+#define __TYPEDEF_MN_AUTH_COMBO_BOX__
+typedef struct _MNAuthComboBox MNAuthComboBox;
+#endif
+struct _MNAuthComboBox {
+ GtkComboBox __parent__;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNAuthComboBoxClass MNAuthComboBoxClass;
+struct _MNAuthComboBoxClass {
+ GtkComboBoxClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_auth_combo_box_get_type (void);
+gchar * mn_auth_combo_box_get_active_mechanism (MNAuthComboBox * self);
+void mn_auth_combo_box_set_active_mechanism (MNAuthComboBox * self,
+ gchar * val);
+void mn_auth_combo_box_append (MNAuthComboBox * self,
+ const char * mechanism,
+ const char * label);
+GtkWidget * mn_auth_combo_box_new (void);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_AUTH_COMBO_BOX_PROP_ACTIVE_MECHANISM(arg) "active_mechanism", __extension__ ({gchar *z = (arg); z;})
+#define MN_AUTH_COMBO_BOX_GET_PROP_ACTIVE_MECHANISM(arg) "active_mechanism", __extension__ ({gchar **z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_AUTH_COMBO_BOX_PROP_ACTIVE_MECHANISM(arg) "active_mechanism",(gchar *)(arg)
+#define MN_AUTH_COMBO_BOX_GET_PROP_ACTIVE_MECHANISM(arg) "active_mechanism",(gchar **)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-autodetect-mailbox-properties-private.h b/src/mn-autodetect-mailbox-properties-private.h
@@ -0,0 +1,26 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_AUTODETECT_MAILBOX_PROPERTIES_PRIVATE_H__
+#define __MN_AUTODETECT_MAILBOX_PROPERTIES_PRIVATE_H__
+
+#include "mn-autodetect-mailbox-properties.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNAutodetectMailboxPropertiesPrivate {
+#line 38 "mn-autodetect-mailbox-properties.gob"
+ GtkSizeGroup * size_group;
+#line 50 "mn-autodetect-mailbox-properties.gob"
+ GtkTooltips * tooltips;
+#line 51 "mn-autodetect-mailbox-properties.gob"
+ GtkWidget * location_entry;
+#line 20 "mn-autodetect-mailbox-properties-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-autodetect-mailbox-properties.c b/src/mn-autodetect-mailbox-properties.c
@@ -0,0 +1,490 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-autodetect-mailbox-properties.h"
+
+#include "mn-autodetect-mailbox-properties-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 22 "mn-autodetect-mailbox-properties.gob"
+
+#include "config.h"
+#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"
+/* self casting macros */
+#define SELF(x) MN_AUTODETECT_MAILBOX_PROPERTIES(x)
+#define SELF_CONST(x) MN_AUTODETECT_MAILBOX_PROPERTIES_CONST(x)
+#define IS_SELF(x) MN_IS_AUTODETECT_MAILBOX_PROPERTIES(x)
+#define TYPE_SELF MN_TYPE_AUTODETECT_MAILBOX_PROPERTIES
+#define SELF_CLASS(x) MN_AUTODETECT_MAILBOX_PROPERTIES_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_AUTODETECT_MAILBOX_PROPERTIES_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNAutodetectMailboxProperties Self;
+typedef MNAutodetectMailboxPropertiesClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void mn_autodetect_mailbox_properties_init (MNAutodetectMailboxProperties * o) G_GNUC_UNUSED;
+static void mn_autodetect_mailbox_properties_class_init (MNAutodetectMailboxPropertiesClass * c) G_GNUC_UNUSED;
+static GObject * ___1_mn_autodetect_mailbox_properties_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
+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;
+
+enum {
+ PROP_0,
+ PROP_LABEL,
+ PROP_SIZE_GROUP,
+ PROP_COMPLETE
+};
+
+/* pointer to the class of our parent */
+static GtkHBoxClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_entry_changed_h mn_autodetect_mailbox_properties_entry_changed_h
+#define self_browse_clicked_h mn_autodetect_mailbox_properties_browse_clicked_h
+#define self_current_folder_changed_h mn_autodetect_mailbox_properties_current_folder_changed_h
+#define self_set_uri mn_autodetect_mailbox_properties_set_uri
+#define self_get_uri mn_autodetect_mailbox_properties_get_uri
+
+
+static void
+___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
+{
+#line 156 "mn-autodetect-mailbox-properties.gob"
+ iface->set_uri = self_set_uri;
+#line 164 "mn-autodetect-mailbox-properties.gob"
+ iface->get_uri = self_get_uri;
+#line 87 "mn-autodetect-mailbox-properties.c"
+}
+
+GType
+mn_autodetect_mailbox_properties_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNAutodetectMailboxPropertiesClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_autodetect_mailbox_properties_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNAutodetectMailboxProperties),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_autodetect_mailbox_properties_init,
+ NULL
+ };
+
+ static const GInterfaceInfo MN_Mailbox_Properties_info = {
+ (GInterfaceInitFunc) ___MN_Mailbox_Properties_init,
+ NULL,
+ NULL
+ };
+
+ type = g_type_register_static (GTK_TYPE_HBOX, "MNAutodetectMailboxProperties", &info, (GTypeFlags)0);
+ g_type_add_interface_static (type,
+ MN_TYPE_MAILBOX_PROPERTIES,
+ &MN_Mailbox_Properties_info);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNAutodetectMailboxProperties *)g_object_new(mn_autodetect_mailbox_properties_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNAutodetectMailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNAutodetectMailboxProperties *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNAutodetectMailboxProperties *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNAutodetectMailboxProperties *)g_object_new_valist (mn_autodetect_mailbox_properties_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::dispose"
+ 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"
+ 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"
+ if(self->_priv->tooltips) { ((*(void (*)(void *))g_object_unref)) (self->_priv->tooltips); self->_priv->tooltips = NULL; }
+#line 154 "mn-autodetect-mailbox-properties.c"
+}
+#undef __GOB_FUNCTION__
+
+
+static void
+___finalize(GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::finalize"
+ MNAutodetectMailboxProperties *self G_GNUC_UNUSED = MN_AUTODETECT_MAILBOX_PROPERTIES (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
+
+static void
+mn_autodetect_mailbox_properties_init (MNAutodetectMailboxProperties * o G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::init"
+ o->_priv = g_new0 (MNAutodetectMailboxPropertiesPrivate, 1);
+#line 50 "mn-autodetect-mailbox-properties.gob"
+ o->_priv->tooltips = mn_tooltips_new();
+#line 178 "mn-autodetect-mailbox-properties.c"
+}
+#undef __GOB_FUNCTION__
+static void
+mn_autodetect_mailbox_properties_class_init (MNAutodetectMailboxPropertiesClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (GTK_TYPE_HBOX);
+
+#line 53 "mn-autodetect-mailbox-properties.gob"
+ g_object_class->constructor = ___1_mn_autodetect_mailbox_properties_constructor;
+#line 191 "mn-autodetect-mailbox-properties.c"
+ 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;
+ {
+ g_object_class_override_property (g_object_class,
+ PROP_LABEL,
+ "label");
+ g_object_class_override_property (g_object_class,
+ PROP_SIZE_GROUP,
+ "size_group");
+ g_object_class_override_property (g_object_class,
+ PROP_COMPLETE,
+ "complete");
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::set_property"
+{
+ MNAutodetectMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_AUTODETECT_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_SIZE_GROUP:
+ {
+#line 39 "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"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::get_property"
+{
+ MNAutodetectMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_AUTODETECT_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_LABEL:
+ {
+#line 36 "mn-autodetect-mailbox-properties.gob"
+ g_value_set_string(VAL, _("<span style=\"italic\">autodetect</span>"));
+#line 257 "mn-autodetect-mailbox-properties.c"
+ }
+ break;
+ case PROP_SIZE_GROUP:
+ {
+#line 39 "mn-autodetect-mailbox-properties.gob"
+g_value_set_object (VAL, (gpointer)self->_priv->size_group);
+#line 264 "mn-autodetect-mailbox-properties.c"
+ }
+ break;
+ case PROP_COMPLETE:
+ {
+#line 43 "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"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 53 "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"
+#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): \
+ ((GObject * )0))
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::constructor"
+{
+#line 55 "mn-autodetect-mailbox-properties.gob"
+
+ GObject *object;
+ Self *self;
+ GtkWidget *hbox;
+ GtkWidget *label;
+ GtkWidget *button;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+
+ gtk_box_set_spacing(GTK_BOX(self), 12);
+
+ label = gtk_label_new_with_mnemonic(_("_Location:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+
+ hbox = gtk_hbox_new(FALSE, 6);
+
+ selfp->location_entry = gtk_entry_new();
+ button = gtk_button_new_with_mnemonic(_("_Browse..."));
+
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), selfp->location_entry);
+ gtk_entry_set_activates_default(GTK_ENTRY(selfp->location_entry), TRUE);
+
+ mn_tooltips_set_tip(selfp->tooltips,
+ selfp->location_entry,
+ _("The URI of the mailbox"));
+
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->location_entry, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+
+ gtk_box_pack_start(GTK_BOX(self), label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(self), hbox, TRUE, TRUE, 0);
+
+ gtk_widget_show(label);
+ gtk_widget_show_all(hbox);
+
+ gtk_size_group_add_widget(selfp->size_group, label);
+
+ g_signal_connect(G_OBJECT(selfp->location_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+ g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(self_browse_clicked_h), self);
+
+ return object;
+ }}
+#line 348 "mn-autodetect-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 99 "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"
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::entry_changed_h"
+#line 99 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (editable != NULL);
+#line 99 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (GTK_IS_EDITABLE (editable));
+#line 99 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (user_data != NULL);
+#line 364 "mn-autodetect-mailbox-properties.c"
+{
+#line 102 "mn-autodetect-mailbox-properties.gob"
+
+ Self *self = user_data;
+ g_object_notify(G_OBJECT(self), "complete");
+ }}
+#line 371 "mn-autodetect-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 107 "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"
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::browse_clicked_h"
+#line 107 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (button != NULL);
+#line 107 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (GTK_IS_BUTTON (button));
+#line 107 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (user_data != NULL);
+#line 386 "mn-autodetect-mailbox-properties.c"
+{
+#line 110 "mn-autodetect-mailbox-properties.gob"
+
+ Self *self = user_data;
+ GtkWidget *toplevel;
+ GtkWidget *chooser;
+ const char *location;
+
+ toplevel = gtk_widget_get_toplevel(GTK_WIDGET(button));
+ chooser = gtk_file_chooser_dialog_new_with_backend(_("Select a File or Folder"),
+ GTK_WINDOW(toplevel),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ "gnome-vfs",
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, 1,
+ NULL);
+
+ gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(chooser), FALSE);
+ mn_file_chooser_dialog_allow_select_folder(GTK_FILE_CHOOSER_DIALOG(chooser), 1);
+
+ location = gtk_entry_get_text(GTK_ENTRY(selfp->location_entry));
+ if (*location)
+ gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(chooser), location);
+ else if (current_folder_uri)
+ gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(chooser), current_folder_uri);
+
+ g_signal_connect(G_OBJECT(chooser), "current-folder-changed", G_CALLBACK(self_current_folder_changed_h), self);
+
+ if (gtk_dialog_run(GTK_DIALOG(chooser)) == 1)
+ {
+ char *uri;
+
+ uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(chooser));
+ gtk_entry_set_text(GTK_ENTRY(selfp->location_entry), uri);
+ g_free(uri);
+ }
+
+ gtk_widget_destroy(chooser);
+ }}
+#line 426 "mn-autodetect-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 148 "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"
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::current_folder_changed_h"
+#line 148 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (chooser != NULL);
+#line 148 "mn-autodetect-mailbox-properties.gob"
+ g_return_if_fail (GTK_IS_FILE_CHOOSER (chooser));
+#line 439 "mn-autodetect-mailbox-properties.c"
+{
+#line 151 "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"
+#undef __GOB_FUNCTION__
+
+#line 156 "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"
+{
+#define __GOB_FUNCTION__ "MN:Autodetect:Mailbox:Properties::set_uri"
+#line 156 "mn-autodetect-mailbox-properties.gob"
+ g_return_val_if_fail (self != NULL, (gboolean )0);
+#line 156 "mn-autodetect-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (gboolean )0);
+#line 156 "mn-autodetect-mailbox-properties.gob"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 461 "mn-autodetect-mailbox-properties.c"
+{
+#line 159 "mn-autodetect-mailbox-properties.gob"
+
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->location_entry), uri);
+ return TRUE;
+ }}
+#line 468 "mn-autodetect-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 164 "mn-autodetect-mailbox-properties.gob"
+static char *
+mn_autodetect_mailbox_properties_get_uri (MNMailboxProperties * self)
+#line 474 "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 166 "mn-autodetect-mailbox-properties.gob"
+
+ const char *location;
+
+ location = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->location_entry));
+ return g_strdup(location);
+ }}
+#line 490 "mn-autodetect-mailbox-properties.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-autodetect-mailbox-properties.gob b/src/mn-autodetect-mailbox-properties.gob
@@ -0,0 +1,172 @@
+/*
+ * 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 <gtk/gtk.h>
+%}
+%{
+#include "config.h"
+#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;
+%}
+
+class MN:Autodetect:Mailbox:Properties from Gtk:HBox (interface MN:Mailbox:Properties)
+{
+ property STRING label (override)
+ get { g_value_set_string(VAL, _("<span style=\"italic\">autodetect</span>")); };
+
+ private GtkSizeGroup *size_group unrefwith g_object_unref;
+ property OBJECT size_group (override, link);
+
+ property BOOLEAN complete (override)
+ get
+ {
+ const char *location;
+
+ location = gtk_entry_get_text(GTK_ENTRY(SELF(self)->_priv->location_entry));
+ g_value_set_boolean(VAL, *location != 0);
+ };
+
+ private GtkTooltips *tooltips = {mn_tooltips_new()} unrefwith g_object_unref;
+ private GtkWidget *location_entry;
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ Self *self;
+ GtkWidget *hbox;
+ GtkWidget *label;
+ GtkWidget *button;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+
+ gtk_box_set_spacing(GTK_BOX(self), 12);
+
+ label = gtk_label_new_with_mnemonic(_("_Location:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+
+ hbox = gtk_hbox_new(FALSE, 6);
+
+ selfp->location_entry = gtk_entry_new();
+ button = gtk_button_new_with_mnemonic(_("_Browse..."));
+
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), selfp->location_entry);
+ gtk_entry_set_activates_default(GTK_ENTRY(selfp->location_entry), TRUE);
+
+ mn_tooltips_set_tip(selfp->tooltips,
+ selfp->location_entry,
+ _("The URI of the mailbox"));
+
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->location_entry, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+
+ gtk_box_pack_start(GTK_BOX(self), label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(self), hbox, TRUE, TRUE, 0);
+
+ gtk_widget_show(label);
+ gtk_widget_show_all(hbox);
+
+ gtk_size_group_add_widget(selfp->size_group, label);
+
+ g_signal_connect(G_OBJECT(selfp->location_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+ g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(self_browse_clicked_h), self);
+
+ return object;
+ }
+
+ private void
+ entry_changed_h (Gtk:Editable *editable (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ g_object_notify(G_OBJECT(self), "complete");
+ }
+
+ private void
+ browse_clicked_h (Gtk:Button *button (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ GtkWidget *toplevel;
+ GtkWidget *chooser;
+ const char *location;
+
+ toplevel = gtk_widget_get_toplevel(GTK_WIDGET(button));
+ chooser = gtk_file_chooser_dialog_new_with_backend(_("Select a File or Folder"),
+ GTK_WINDOW(toplevel),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ "gnome-vfs",
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, 1,
+ NULL);
+
+ gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(chooser), FALSE);
+ mn_file_chooser_dialog_allow_select_folder(GTK_FILE_CHOOSER_DIALOG(chooser), 1);
+
+ location = gtk_entry_get_text(GTK_ENTRY(selfp->location_entry));
+ if (*location)
+ gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(chooser), location);
+ else if (current_folder_uri)
+ gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(chooser), current_folder_uri);
+
+ g_signal_connect(G_OBJECT(chooser), "current-folder-changed", G_CALLBACK(self_current_folder_changed_h), self);
+
+ if (gtk_dialog_run(GTK_DIALOG(chooser)) == 1)
+ {
+ char *uri;
+
+ uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(chooser));
+ gtk_entry_set_text(GTK_ENTRY(selfp->location_entry), uri);
+ g_free(uri);
+ }
+
+ gtk_widget_destroy(chooser);
+ }
+
+ private void
+ current_folder_changed_h (Gtk:File:Chooser *chooser (check null type),
+ gpointer user_data)
+ {
+ g_free(current_folder_uri);
+ current_folder_uri = gtk_file_chooser_get_current_folder_uri(chooser);
+ }
+
+ interface MN:Mailbox:Properties private gboolean
+ set_uri (MN:Mailbox:Properties *self (check null type),
+ const char *uri (check null))
+ {
+ gtk_entry_set_text(GTK_ENTRY(SELF(self)->_priv->location_entry), uri);
+ return TRUE;
+ }
+
+ interface MN:Mailbox:Properties private char *
+ 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);
+ }
+}
diff --git a/src/mn-autodetect-mailbox-properties.h b/src/mn-autodetect-mailbox-properties.h
@@ -0,0 +1,78 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <gtk/gtk.h>
+
+#ifndef __MN_AUTODETECT_MAILBOX_PROPERTIES_H__
+#define __MN_AUTODETECT_MAILBOX_PROPERTIES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_AUTODETECT_MAILBOX_PROPERTIES (mn_autodetect_mailbox_properties_get_type())
+#define MN_AUTODETECT_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_autodetect_mailbox_properties_get_type(), MNAutodetectMailboxProperties)
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_autodetect_mailbox_properties_get_type(), MNAutodetectMailboxProperties const)
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_autodetect_mailbox_properties_get_type(), MNAutodetectMailboxPropertiesClass)
+#define MN_IS_AUTODETECT_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_autodetect_mailbox_properties_get_type ())
+
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_autodetect_mailbox_properties_get_type(), MNAutodetectMailboxPropertiesClass)
+
+/* Private structure type */
+typedef struct _MNAutodetectMailboxPropertiesPrivate MNAutodetectMailboxPropertiesPrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_AUTODETECT_MAILBOX_PROPERTIES__
+#define __TYPEDEF_MN_AUTODETECT_MAILBOX_PROPERTIES__
+typedef struct _MNAutodetectMailboxProperties MNAutodetectMailboxProperties;
+#endif
+struct _MNAutodetectMailboxProperties {
+ GtkHBox __parent__;
+ /*< private >*/
+ MNAutodetectMailboxPropertiesPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNAutodetectMailboxPropertiesClass MNAutodetectMailboxPropertiesClass;
+struct _MNAutodetectMailboxPropertiesClass {
+ GtkHBoxClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_autodetect_mailbox_properties_get_type (void);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label", __extension__ ({gchar **z = (arg); z;})
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject *z = (arg); z;})
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject **z = (arg); z;})
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete", __extension__ ({gboolean *z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label",(gchar **)(arg)
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group",(GObject *)(arg)
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group",(GObject **)(arg)
+#define MN_AUTODETECT_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete",(gboolean *)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-automation-private.h b/src/mn-automation-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_AUTOMATION_PRIVATE_H__
+#define __MN_AUTOMATION_PRIVATE_H__
+
+#include "mn-automation.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-automation.c b/src/mn-automation.c
@@ -0,0 +1,205 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-automation.h"
+
+#include "mn-automation-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 23 "mn-automation.gob"
+
+#include "mn-properties.h"
+#include "mn-shell.h"
+
+#line 30 "mn-automation.c"
+/* self casting macros */
+#define SELF(x) MN_AUTOMATION(x)
+#define SELF_CONST(x) MN_AUTOMATION_CONST(x)
+#define IS_SELF(x) MN_IS_AUTOMATION(x)
+#define TYPE_SELF MN_TYPE_AUTOMATION
+#define SELF_CLASS(x) MN_AUTOMATION_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_AUTOMATION_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNAutomation Self;
+typedef MNAutomationClass SelfClass;
+
+/* here are local prototypes */
+static void mn_automation_init (MNAutomation * o) G_GNUC_UNUSED;
+static void mn_automation_class_init (MNAutomationClass * c) G_GNUC_UNUSED;
+static void mn_automation_update (PortableServer_Servant servant, CORBA_Environment * env) G_GNUC_UNUSED;
+static void mn_automation_report (PortableServer_Servant servant, CORBA_char ** report, CORBA_Environment * env) G_GNUC_UNUSED;
+static void mn_automation_displayProperties (PortableServer_Servant servant, CORBA_Environment * env) G_GNUC_UNUSED;
+static void mn_automation_displayAbout (PortableServer_Servant servant, CORBA_Environment * env) G_GNUC_UNUSED;
+
+/* pointer to the class of our parent */
+static BonoboObjectClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_update mn_automation_update
+#define self_report mn_automation_report
+#define self_displayProperties mn_automation_displayProperties
+#define self_displayAbout mn_automation_displayAbout
+#define self_new mn_automation_new
+GType
+mn_automation_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNAutomationClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_automation_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (MNAutomation),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) mn_automation_init,
+ NULL
+ };
+
+ type = bonobo_type_unique (
+ BONOBO_OBJECT_TYPE,
+ POA_GNOME_MNAutomation__init, NULL,
+ G_STRUCT_OFFSET (MNAutomationClass, _epv),
+ &info, "MNAutomation");
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNAutomation *)g_object_new(mn_automation_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNAutomation * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNAutomation *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNAutomation *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNAutomation *)g_object_new_valist (mn_automation_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+static void
+mn_automation_init (MNAutomation * o G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Automation::init"
+}
+#undef __GOB_FUNCTION__
+static void
+mn_automation_class_init (MNAutomationClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Automation::class_init"
+
+ parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
+
+#line 30 "mn-automation.gob"
+ c->_epv.update = self_update;
+#line 37 "mn-automation.gob"
+ c->_epv.report = self_report;
+#line 46 "mn-automation.gob"
+ c->_epv.displayProperties = self_displayProperties;
+#line 53 "mn-automation.gob"
+ c->_epv.displayAbout = self_displayAbout;
+#line 128 "mn-automation.c"
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 30 "mn-automation.gob"
+static void
+mn_automation_update (PortableServer_Servant servant, CORBA_Environment * env)
+#line 137 "mn-automation.c"
+{
+#define __GOB_FUNCTION__ "MN:Automation::update"
+{
+#line 32 "mn-automation.gob"
+
+ g_return_if_fail(mn_shell != NULL);
+ mn_mailboxes_check(mn_shell->mailboxes);
+ }}
+#line 146 "mn-automation.c"
+#undef __GOB_FUNCTION__
+
+#line 37 "mn-automation.gob"
+static void
+mn_automation_report (PortableServer_Servant servant, CORBA_char ** report, CORBA_Environment * env)
+#line 152 "mn-automation.c"
+{
+#define __GOB_FUNCTION__ "MN:Automation::report"
+{
+#line 41 "mn-automation.gob"
+
+ g_return_if_fail(mn_shell != NULL);
+ mn_shell_report(mn_shell, report);
+ }}
+#line 161 "mn-automation.c"
+#undef __GOB_FUNCTION__
+
+#line 46 "mn-automation.gob"
+static void
+mn_automation_displayProperties (PortableServer_Servant servant, CORBA_Environment * env)
+#line 167 "mn-automation.c"
+{
+#define __GOB_FUNCTION__ "MN:Automation::displayProperties"
+{
+#line 48 "mn-automation.gob"
+
+ g_return_if_fail(mn_shell != NULL);
+ mn_properties_display();
+ }}
+#line 176 "mn-automation.c"
+#undef __GOB_FUNCTION__
+
+#line 53 "mn-automation.gob"
+static void
+mn_automation_displayAbout (PortableServer_Servant servant, CORBA_Environment * env)
+#line 182 "mn-automation.c"
+{
+#define __GOB_FUNCTION__ "MN:Automation::displayAbout"
+{
+#line 55 "mn-automation.gob"
+
+ g_return_if_fail(mn_shell != NULL);
+ mn_shell_display_about(mn_shell);
+ }}
+#line 191 "mn-automation.c"
+#undef __GOB_FUNCTION__
+
+#line 60 "mn-automation.gob"
+MNAutomation *
+mn_automation_new (void)
+#line 197 "mn-automation.c"
+{
+#define __GOB_FUNCTION__ "MN:Automation::new"
+{
+#line 62 "mn-automation.gob"
+
+ return GET_NEW;
+ }}
+#line 205 "mn-automation.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-automation.gob b/src/mn-automation.gob
@@ -0,0 +1,65 @@
+/*
+ * 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 <libbonobo.h>
+#include "MNAutomation.h"
+%}
+%{
+#include "mn-properties.h"
+#include "mn-shell.h"
+%}
+
+class MN:Automation from Bonobo:Object (BonoboObject GNOME_MNAutomation)
+{
+ BonoboObject private void
+ update (PortableServer_Servant servant, CORBA_Environment *env)
+ {
+ g_return_if_fail(mn_shell != NULL);
+ mn_mailboxes_check(mn_shell->mailboxes);
+ }
+
+ BonoboObject private void
+ report (PortableServer_Servant servant,
+ CORBA_char **report,
+ CORBA_Environment *env)
+ {
+ g_return_if_fail(mn_shell != NULL);
+ mn_shell_report(mn_shell, report);
+ }
+
+ BonoboObject private void
+ displayProperties (PortableServer_Servant servant, CORBA_Environment *env)
+ {
+ g_return_if_fail(mn_shell != NULL);
+ mn_properties_display();
+ }
+
+ BonoboObject private void
+ displayAbout (PortableServer_Servant servant, CORBA_Environment *env)
+ {
+ g_return_if_fail(mn_shell != NULL);
+ mn_shell_display_about(mn_shell);
+ }
+
+ public MNAutomation *
+ new (void)
+ {
+ return GET_NEW;
+ }
+}
diff --git a/src/mn-automation.h b/src/mn-automation.h
@@ -0,0 +1,61 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <libbonobo.h>
+#include "MNAutomation.h"
+
+#ifndef __MN_AUTOMATION_H__
+#define __MN_AUTOMATION_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_AUTOMATION (mn_automation_get_type())
+#define MN_AUTOMATION(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_automation_get_type(), MNAutomation)
+#define MN_AUTOMATION_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_automation_get_type(), MNAutomation const)
+#define MN_AUTOMATION_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_automation_get_type(), MNAutomationClass)
+#define MN_IS_AUTOMATION(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_automation_get_type ())
+
+#define MN_AUTOMATION_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_automation_get_type(), MNAutomationClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_AUTOMATION__
+#define __TYPEDEF_MN_AUTOMATION__
+typedef struct _MNAutomation MNAutomation;
+#endif
+struct _MNAutomation {
+ BonoboObject __parent__;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNAutomationClass MNAutomationClass;
+struct _MNAutomationClass {
+ BonoboObjectClass __parent__;
+ /* Bonobo object epv */
+ POA_GNOME_MNAutomation__epv _epv;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_automation_get_type (void);
+MNAutomation * mn_automation_new (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-blinking-image-private.h b/src/mn-blinking-image-private.h
@@ -0,0 +1,30 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_BLINKING_IMAGE_PRIVATE_H__
+#define __MN_BLINKING_IMAGE_PRIVATE_H__
+
+#include "mn-blinking-image.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNBlinkingImagePrivate {
+#line 29 "mn-blinking-image.gob"
+ gboolean blinking;
+#line 49 "mn-blinking-image.gob"
+ unsigned int timeout_id;
+#line 50 "mn-blinking-image.gob"
+ gboolean is_on;
+#line 51 "mn-blinking-image.gob"
+ GdkPixbuf * on_pixbuf;
+#line 52 "mn-blinking-image.gob"
+ GdkPixbuf * off_pixbuf;
+#line 24 "mn-blinking-image-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-blinking-image.c b/src/mn-blinking-image.c
@@ -0,0 +1,365 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 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 <string.h> /* memset() */
+
+#include "mn-blinking-image.h"
+
+#include "mn-blinking-image-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 22 "mn-blinking-image.gob"
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+
+#line 32 "mn-blinking-image.c"
+/* self casting macros */
+#define SELF(x) MN_BLINKING_IMAGE(x)
+#define SELF_CONST(x) MN_BLINKING_IMAGE_CONST(x)
+#define IS_SELF(x) MN_IS_BLINKING_IMAGE(x)
+#define TYPE_SELF MN_TYPE_BLINKING_IMAGE
+#define SELF_CLASS(x) MN_BLINKING_IMAGE_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_BLINKING_IMAGE_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNBlinkingImage Self;
+typedef MNBlinkingImageClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void mn_blinking_image_init (MNBlinkingImage * o) G_GNUC_UNUSED;
+static void mn_blinking_image_class_init (MNBlinkingImageClass * c) G_GNUC_UNUSED;
+static void mn_blinking_image_update (MNBlinkingImage * self, gboolean is_on) G_GNUC_UNUSED;
+static gboolean mn_blinking_image_timeout_cb (gpointer data) G_GNUC_UNUSED;
+
+enum {
+ PROP_0,
+ PROP_BLINKING
+};
+
+/* pointer to the class of our parent */
+static GtkImageClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_get_blinking mn_blinking_image_get_blinking
+#define self_set_blinking mn_blinking_image_set_blinking
+#define self_update mn_blinking_image_update
+#define self_timeout_cb mn_blinking_image_timeout_cb
+#define self_new_from_stock mn_blinking_image_new_from_stock
+GType
+mn_blinking_image_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNBlinkingImageClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_blinking_image_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNBlinkingImage),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_blinking_image_init,
+ NULL
+ };
+
+ type = g_type_register_static (GTK_TYPE_IMAGE, "MNBlinkingImage", &info, (GTypeFlags)0);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNBlinkingImage *)g_object_new(mn_blinking_image_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNBlinkingImage * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNBlinkingImage *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNBlinkingImage *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNBlinkingImage *)g_object_new_valist (mn_blinking_image_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::dispose"
+ MNBlinkingImage *self G_GNUC_UNUSED = MN_BLINKING_IMAGE (obj_self);
+ if (G_OBJECT_CLASS (parent_class)->dispose) \
+ (* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
+#line 51 "mn-blinking-image.gob"
+ if(self->_priv->on_pixbuf) { ((*(void (*)(void *))g_object_unref)) (self->_priv->on_pixbuf); self->_priv->on_pixbuf = NULL; }
+#line 120 "mn-blinking-image.c"
+#line 52 "mn-blinking-image.gob"
+ if(self->_priv->off_pixbuf) { ((*(void (*)(void *))g_object_unref)) (self->_priv->off_pixbuf); self->_priv->off_pixbuf = NULL; }
+#line 123 "mn-blinking-image.c"
+}
+#undef __GOB_FUNCTION__
+
+
+static void
+___finalize(GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::finalize"
+ MNBlinkingImage *self G_GNUC_UNUSED = MN_BLINKING_IMAGE (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+#define timeout_id (self->_priv->timeout_id)
+#define VAR timeout_id
+ {
+#line 49 "mn-blinking-image.gob"
+ g_source_remove(VAR); }
+#line 141 "mn-blinking-image.c"
+ memset(&timeout_id, 0, sizeof(timeout_id));
+#undef VAR
+#undef timeout_id
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
+
+static void
+mn_blinking_image_init (MNBlinkingImage * o G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::init"
+ o->_priv = g_new0 (MNBlinkingImagePrivate, 1);
+#line 49 "mn-blinking-image.gob"
+ o->_priv->is_on = TRUE;
+#line 156 "mn-blinking-image.c"
+}
+#undef __GOB_FUNCTION__
+static void
+mn_blinking_image_class_init (MNBlinkingImageClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (GTK_TYPE_IMAGE);
+
+ 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_boolean
+ ("blinking" /* name */,
+ NULL /* nick */,
+ _("Whether the image is blinking or not") /* blurb */,
+ FALSE /* default_value */,
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (g_object_class,
+ PROP_BLINKING,
+ param_spec);
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Blinking:Image::set_property"
+{
+ MNBlinkingImage *self G_GNUC_UNUSED;
+
+ self = MN_BLINKING_IMAGE (object);
+
+ switch (property_id) {
+ case PROP_BLINKING:
+ {
+#line 33 "mn-blinking-image.gob"
+
+ if (selfp->blinking)
+ {
+ g_source_remove(selfp->timeout_id);
+ self_update(self, TRUE);
+ }
+
+ selfp->blinking = g_value_get_boolean(VAL);
+ if (selfp->blinking)
+ selfp->timeout_id = g_timeout_add(500, self_timeout_cb, self);
+
+#line 213 "mn-blinking-image.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Blinking:Image::get_property"
+{
+ MNBlinkingImage *self G_GNUC_UNUSED;
+
+ self = MN_BLINKING_IMAGE (object);
+
+ switch (property_id) {
+ case PROP_BLINKING:
+ {
+#line 45 "mn-blinking-image.gob"
+
+ g_value_set_boolean(VAL, selfp->blinking);
+
+#line 246 "mn-blinking-image.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 45 "mn-blinking-image.gob"
+gboolean
+mn_blinking_image_get_blinking (MNBlinkingImage * self)
+#line 266 "mn-blinking-image.c"
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::get_blinking"
+{
+#line 30 "mn-blinking-image.gob"
+ gboolean val; g_object_get (G_OBJECT (self), "blinking", &val, NULL); return val;
+}}
+#line 273 "mn-blinking-image.c"
+#undef __GOB_FUNCTION__
+
+#line 33 "mn-blinking-image.gob"
+void
+mn_blinking_image_set_blinking (MNBlinkingImage * self, gboolean val)
+#line 279 "mn-blinking-image.c"
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::set_blinking"
+{
+#line 30 "mn-blinking-image.gob"
+ g_object_set (G_OBJECT (self), "blinking", val, NULL);
+}}
+#line 286 "mn-blinking-image.c"
+#undef __GOB_FUNCTION__
+
+#line 54 "mn-blinking-image.gob"
+static void
+mn_blinking_image_update (MNBlinkingImage * self, gboolean is_on)
+#line 292 "mn-blinking-image.c"
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::update"
+#line 54 "mn-blinking-image.gob"
+ g_return_if_fail (self != NULL);
+#line 54 "mn-blinking-image.gob"
+ g_return_if_fail (MN_IS_BLINKING_IMAGE (self));
+#line 299 "mn-blinking-image.c"
+{
+#line 56 "mn-blinking-image.gob"
+
+ gtk_image_set_from_pixbuf(GTK_IMAGE(self), is_on ? selfp->on_pixbuf : selfp->off_pixbuf);
+ selfp->is_on = is_on;
+ }}
+#line 306 "mn-blinking-image.c"
+#undef __GOB_FUNCTION__
+
+#line 61 "mn-blinking-image.gob"
+static gboolean
+mn_blinking_image_timeout_cb (gpointer data)
+#line 312 "mn-blinking-image.c"
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::timeout_cb"
+#line 61 "mn-blinking-image.gob"
+ g_return_val_if_fail (data != NULL, (gboolean )0);
+#line 317 "mn-blinking-image.c"
+{
+#line 63 "mn-blinking-image.gob"
+
+ Self *self = data;
+
+ GDK_THREADS_ENTER();
+ self_update(self, ! selfp->is_on);
+ GDK_THREADS_LEAVE();
+
+ return TRUE;
+ }}
+#line 329 "mn-blinking-image.c"
+#undef __GOB_FUNCTION__
+
+#line 73 "mn-blinking-image.gob"
+GtkWidget *
+mn_blinking_image_new_from_stock (const char * stock_id, GtkIconSize icon_size)
+#line 335 "mn-blinking-image.c"
+{
+#define __GOB_FUNCTION__ "MN:Blinking:Image::new_from_stock"
+#line 73 "mn-blinking-image.gob"
+ g_return_val_if_fail (stock_id != NULL, (GtkWidget * )0);
+#line 340 "mn-blinking-image.c"
+{
+#line 76 "mn-blinking-image.gob"
+
+ Self *self;
+ int width, height;
+
+ self = GET_NEW;
+
+ selfp->on_pixbuf = gtk_widget_render_icon(GTK_WIDGET(self),
+ stock_id,
+ icon_size,
+ NULL);
+ g_return_val_if_fail(selfp->on_pixbuf != NULL, NULL);
+
+ width = gdk_pixbuf_get_width(selfp->on_pixbuf);
+ height = gdk_pixbuf_get_height(selfp->on_pixbuf);
+
+ selfp->off_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
+ gdk_pixbuf_fill(selfp->off_pixbuf, 0); /* fill with transparency */
+
+ self_update(self, selfp->is_on);
+
+ return GTK_WIDGET(self);
+ }}
+#line 365 "mn-blinking-image.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-blinking-image.gob b/src/mn-blinking-image.gob
@@ -0,0 +1,98 @@
+/*
+ * 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 <gtk/gtk.h>
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+%}
+
+class MN:Blinking:Image from Gtk:Image
+{
+ private gboolean blinking;
+ property BOOLEAN blinking (blurb = _("Whether the image is blinking or not"),
+ export)
+ set
+ {
+ if (selfp->blinking)
+ {
+ g_source_remove(selfp->timeout_id);
+ self_update(self, TRUE);
+ }
+
+ selfp->blinking = g_value_get_boolean(VAL);
+ if (selfp->blinking)
+ selfp->timeout_id = g_timeout_add(500, self_timeout_cb, self);
+ }
+ get
+ {
+ g_value_set_boolean(VAL, selfp->blinking);
+ };
+
+ private unsigned int timeout_id destroy { g_source_remove(VAR); };
+ private gboolean is_on = TRUE; /* is currently displaying the on pixbuf? */
+ private GdkPixbuf *on_pixbuf unrefwith g_object_unref;
+ private GdkPixbuf *off_pixbuf unrefwith g_object_unref;
+
+ private void
+ update (self, gboolean is_on)
+ {
+ gtk_image_set_from_pixbuf(GTK_IMAGE(self), is_on ? selfp->on_pixbuf : selfp->off_pixbuf);
+ selfp->is_on = is_on;
+ }
+
+ private gboolean
+ timeout_cb (gpointer data (check null))
+ {
+ Self *self = data;
+
+ GDK_THREADS_ENTER();
+ self_update(self, ! selfp->is_on);
+ GDK_THREADS_LEAVE();
+
+ return TRUE;
+ }
+
+ public GtkWidget *
+ new_from_stock (const char *stock_id (check null),
+ GtkIconSize icon_size)
+ {
+ Self *self;
+ int width, height;
+
+ self = GET_NEW;
+
+ selfp->on_pixbuf = gtk_widget_render_icon(GTK_WIDGET(self),
+ stock_id,
+ icon_size,
+ NULL);
+ g_return_val_if_fail(selfp->on_pixbuf != NULL, NULL);
+
+ width = gdk_pixbuf_get_width(selfp->on_pixbuf);
+ height = gdk_pixbuf_get_height(selfp->on_pixbuf);
+
+ selfp->off_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
+ gdk_pixbuf_fill(selfp->off_pixbuf, 0); /* fill with transparency */
+
+ self_update(self, selfp->is_on);
+
+ return GTK_WIDGET(self);
+ }
+}
diff --git a/src/mn-blinking-image.h b/src/mn-blinking-image.h
@@ -0,0 +1,79 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <gtk/gtk.h>
+
+#ifndef __MN_BLINKING_IMAGE_H__
+#define __MN_BLINKING_IMAGE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_BLINKING_IMAGE (mn_blinking_image_get_type())
+#define MN_BLINKING_IMAGE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_blinking_image_get_type(), MNBlinkingImage)
+#define MN_BLINKING_IMAGE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_blinking_image_get_type(), MNBlinkingImage const)
+#define MN_BLINKING_IMAGE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_blinking_image_get_type(), MNBlinkingImageClass)
+#define MN_IS_BLINKING_IMAGE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_blinking_image_get_type ())
+
+#define MN_BLINKING_IMAGE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_blinking_image_get_type(), MNBlinkingImageClass)
+
+/* Private structure type */
+typedef struct _MNBlinkingImagePrivate MNBlinkingImagePrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_BLINKING_IMAGE__
+#define __TYPEDEF_MN_BLINKING_IMAGE__
+typedef struct _MNBlinkingImage MNBlinkingImage;
+#endif
+struct _MNBlinkingImage {
+ GtkImage __parent__;
+ /*< private >*/
+ MNBlinkingImagePrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNBlinkingImageClass MNBlinkingImageClass;
+struct _MNBlinkingImageClass {
+ GtkImageClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_blinking_image_get_type (void);
+gboolean mn_blinking_image_get_blinking (MNBlinkingImage * self);
+void mn_blinking_image_set_blinking (MNBlinkingImage * self,
+ gboolean val);
+GtkWidget * mn_blinking_image_new_from_stock (const char * stock_id,
+ GtkIconSize icon_size);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_BLINKING_IMAGE_PROP_BLINKING(arg) "blinking", __extension__ ({gboolean z = (arg); z;})
+#define MN_BLINKING_IMAGE_GET_PROP_BLINKING(arg) "blinking", __extension__ ({gboolean *z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_BLINKING_IMAGE_PROP_BLINKING(arg) "blinking",(gboolean )(arg)
+#define MN_BLINKING_IMAGE_GET_PROP_BLINKING(arg) "blinking",(gboolean *)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-client-session.c b/src/mn-client-session.c
@@ -0,0 +1,938 @@
+/*
+ * 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.
+ */
+
+#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/uio.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+#ifdef WITH_SSL
+#include <openssl/err.h>
+#include "mn-ssl.h"
+#endif /* WITH_SSL */
+#ifdef WITH_SASL
+#include <sasl/sasl.h>
+#include <sasl/saslutil.h>
+#include "mn-sasl.h"
+#endif /* WITH_SASL */
+#include "mn-util.h"
+#include "mn-client-session.h"
+
+/*** cpp *********************************************************************/
+
+#define READ_BUFSIZE 2048
+
+/*** types *******************************************************************/
+
+struct _MNClientSession
+{
+ MNClientSessionState *states;
+ MNClientSessionCallbacks *callbacks;
+ char *hostname;
+ int port;
+ char *username;
+ char *password;
+ int s;
+ MNClientSessionState *state;
+ char *error;
+ MNClientSessionPrivate *private;
+
+#ifdef WITH_SSL
+ gboolean use_ssl;
+ SSL *ssl;
+#endif
+
+#ifdef WITH_SASL
+ gboolean sasl_available;
+ sasl_conn_t *sasl_conn;
+ const char *sasl_initial_clientout;
+ unsigned int sasl_initial_clientoutlen;
+ const char *sasl_clientout;
+ unsigned int sasl_clientoutlen;
+ int sasl_ssf;
+ unsigned int sasl_maxoutbuf;
+#endif /* WITH_SASL */
+};
+
+/*** variables ***************************************************************/
+
+#ifdef WITH_SASL
+static sasl_callback_t sasl_callbacks[] = {
+ { SASL_CB_USER, NULL, NULL },
+ { SASL_CB_AUTHNAME, NULL, NULL },
+ { SASL_CB_PASS, NULL, NULL },
+
+ { SASL_CB_LIST_END, NULL, NULL }
+};
+#endif /* WITH_SASL */
+
+/*** functions ***************************************************************/
+
+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);
+#endif
+
+static int mn_client_session_enter_state (MNClientSession *session, int id);
+static gboolean mn_client_session_handle_input (MNClientSession *session, const char *input);
+
+#ifdef WITH_SASL
+static int mn_client_session_write_base64 (MNClientSession *session,
+ const char *buf,
+ unsigned int len);
+static gboolean mn_client_session_sasl_fill_interact (MNClientSession *session,
+ sasl_interact_t *interact);
+static char *mn_client_session_sasl_get_ip_port (const struct sockaddr *addr);
+#endif /* WITH_SASL */
+
+/*** implementation **********************************************************/
+
+gboolean
+mn_client_session_run (MNClientSessionState *states,
+ MNClientSessionCallbacks *callbacks,
+#ifdef WITH_SSL
+ gboolean use_ssl,
+#endif
+ const char *hostname,
+ int port,
+ const char *username,
+ const char *password,
+ MNClientSessionPrivate *private,
+ GError **err)
+{
+ MNClientSession session;
+ struct addrinfo *addrinfo;
+ GString *input_buffer;
+
+ g_return_val_if_fail(states != NULL, FALSE);
+ g_return_val_if_fail(callbacks != NULL, FALSE);
+ g_return_val_if_fail(callbacks->response_new != NULL, FALSE);
+ g_return_val_if_fail(callbacks->response_free != NULL, FALSE);
+ g_return_val_if_fail(hostname != NULL, FALSE);
+ g_return_val_if_fail(username != NULL, FALSE);
+ g_return_val_if_fail(password != NULL, FALSE);
+
+ memset(&session, 0, sizeof(session));
+ session.states = states;
+ session.callbacks = callbacks;
+ session.hostname = g_strdup(hostname);
+ session.port = port;
+ session.username = g_strdup(username);
+ 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;
+
+ session.s = mn_client_session_connect(&session, addrinfo);
+ freeaddrinfo(addrinfo);
+ if (session.s < 0)
+ goto end;
+
+#ifdef WITH_SSL
+ if (session.use_ssl)
+ {
+ if (! mn_client_session_init_ssl(&session))
+ goto end;
+ }
+#endif /* WITH_SSL */
+
+ mn_client_session_enter_state(&session, MN_CLIENT_SESSION_INITIAL_STATE);
+
+ input_buffer = g_string_new(NULL);
+ while (TRUE)
+ {
+ char buf[READ_BUFSIZE];
+ ssize_t bytes_read;
+ const char *in = NULL;
+ unsigned int inlen;
+ char *terminator;
+ gboolean cont = TRUE;
+
+#ifdef WITH_SSL
+ if (session.use_ssl)
+ bytes_read = SSL_read(session.ssl, buf, sizeof(buf));
+ else
+#endif /* WITH_SSL */
+ bytes_read = read(session.s, buf, sizeof(buf));
+
+ 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()));
+ else
+#endif /* WITH_SSL */
+ {
+ if (bytes_read == 0)
+ mn_client_session_error(&session, _("unable to read from server: EOF"));
+ else
+ mn_client_session_error(&session, _("unable to read from server: %s"), g_strerror(errno));
+ }
+ break; /* end */
+ }
+
+#ifdef WITH_SASL
+ if (session.sasl_ssf)
+ {
+ if (sasl_decode(session.sasl_conn, buf, bytes_read, &in, &inlen) != SASL_OK)
+ {
+ mn_client_session_error(&session, _("unable to decode data using SASL: %s"), sasl_errdetail(session.sasl_conn));
+ break; /* end */
+ }
+ }
+#endif /* WITH_SASL */
+
+ if (! in)
+ {
+ in = buf;
+ inlen = bytes_read;
+ }
+
+ g_string_append_len(input_buffer, in, inlen);
+ while (cont && (terminator = strstr(input_buffer->str, "\r\n")))
+ {
+ *terminator = 0;
+ cont = mn_client_session_handle_input(&session, input_buffer->str);
+ g_string_erase(input_buffer, 0, terminator - input_buffer->str + 2);
+ }
+
+ if (! cont)
+ break;
+ }
+ g_string_free(input_buffer, TRUE);
+
+ end:
+ g_free(session.hostname);
+ g_free(session.username);
+ g_free(session.password);
+ if (session.s >= 0)
+ close(session.s);
+#ifdef WITH_SSL
+ if (session.use_ssl)
+ {
+ if (session.ssl)
+ SSL_free(session.ssl);
+ }
+#endif /* WITH_SSL */
+#ifdef WITH_SASL
+ if (session.sasl_available)
+ {
+ if (session.sasl_conn)
+ sasl_dispose(&session.sasl_conn);
+ mn_sasl_unuse();
+ }
+#endif /* WITH_SASL */
+ if (session.error)
+ {
+ g_set_error(err, 0, 0, session.error);
+ g_free(session.error);
+ return FALSE;
+ }
+ else
+ return TRUE;
+}
+
+static struct addrinfo *
+mn_client_session_resolve (MNClientSession *session)
+{
+ char *servname;
+ struct addrinfo hints;
+ struct addrinfo *addrinfo;
+ int status;
+
+ g_return_val_if_fail(session != NULL, NULL);
+
+ memset(&hints, 0, sizeof(hints));
+#ifdef WITH_IPV6
+ hints.ai_family = PF_UNSPEC;
+#else
+ hints.ai_family = PF_INET;
+#endif /* WITH_IPV6 */
+ hints.ai_socktype = SOCK_STREAM;
+
+ mn_client_session_notice(session, _("resolving %s"), session->hostname);
+
+ servname = g_strdup_printf("%i", session->port);
+ status = getaddrinfo(session->hostname, servname, &hints, &addrinfo);
+ g_free(servname);
+
+ if (status == 0)
+ return addrinfo;
+ else
+ {
+ mn_client_session_error(session, _("unable to resolve %s: %s"), session->hostname, gai_strerror(status));
+ return NULL;
+ }
+}
+
+static int
+mn_client_session_connect (MNClientSession *session, struct addrinfo *addrinfo)
+{
+ struct addrinfo *a;
+
+ g_return_val_if_fail(session != NULL, -1);
+ g_return_val_if_fail(addrinfo != NULL, -1);
+
+ /* iterate over addrinfo to find a working address (RFC 3484) */
+ for (a = addrinfo; a; a = a->ai_next)
+ {
+ int status;
+ int s;
+ char ip[NI_MAXHOST];
+
+ status = getnameinfo(a->ai_addr,
+ a->ai_addrlen,
+ ip,
+ sizeof(ip),
+ NULL,
+ 0,
+ NI_NUMERICHOST);
+ g_return_val_if_fail(status == 0, -1);
+
+ if (a->ai_family == AF_INET)
+ ((struct sockaddr_in *) a->ai_addr)->sin_port = g_htons(session->port);
+#ifdef WITH_IPV6
+ else if (a->ai_family == AF_INET6)
+ ((struct sockaddr_in6 *) a->ai_addr)->sin6_port = g_htons(session->port);
+#endif /* WITH_IPV6 */
+ else
+ {
+ mn_client_session_notice(session, _("%s: unsupported address family"), ip);
+ continue;
+ }
+
+ s = socket(a->ai_family, SOCK_STREAM, 0);
+ if (s < 0)
+ {
+ mn_client_session_notice(session, _("%s: unable to create socket: %s"), ip, g_strerror(errno));
+ continue;
+ }
+
+ mn_client_session_notice(session, _("connecting to %s (%s) port %i"), session->hostname, ip, session->port);
+ if (connect(s, a->ai_addr, a->ai_addrlen) < 0)
+ {
+ mn_client_session_notice(session, _("unable to connect: %s"), g_strerror(errno));
+ close(s);
+ }
+ else
+ {
+ mn_client_session_notice(session, _("connected successfully"));
+ return s; /* success */
+ }
+ }
+
+ /* if reached, we couldn't find a working address */
+ mn_client_session_error(session, _("unable to connect to %s"), session->hostname);
+ return -1;
+}
+
+#ifdef WITH_SSL
+static gboolean
+mn_client_session_init_ssl (MNClientSession *session)
+{
+ SSL_CTX *ctx;
+ GError *err = NULL;
+
+ g_return_val_if_fail(session != NULL, FALSE);
+
+ ctx = mn_ssl_init(&err);
+ if (! ctx)
+ {
+ mn_client_session_error(session, _("unable to initialize the OpenSSL library: %s"), err->message);
+ g_error_free(err);
+ return FALSE;
+ }
+
+ 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()));
+ 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()));
+ return FALSE;
+ }
+
+ SSL_set_connect_state(session->ssl);
+
+ return TRUE;
+}
+#endif /* WITH_SSL */
+
+static int
+mn_client_session_enter_state (MNClientSession *session, int id)
+{
+ int i;
+
+ g_return_val_if_fail(session != NULL, 0);
+
+ for (i = 0; session->states[i].id; i++)
+ if (session->states[i].id == id)
+ {
+ session->state = &session->states[i];
+ return session->state->enter_cb
+ ? session->state->enter_cb(session, session->private)
+ : MN_CLIENT_SESSION_RESULT_CONTINUE;
+ }
+
+ g_return_val_if_reached(0);
+}
+
+static gboolean
+mn_client_session_handle_input (MNClientSession *session, const char *input)
+{
+ MNClientSessionResponse *response;
+ gboolean cont = TRUE;
+
+ g_return_val_if_fail(session != NULL, FALSE);
+ g_return_val_if_fail(input != NULL, FALSE);
+
+ mn_client_session_notice(session, "< %s", input);
+
+ response = session->callbacks->response_new(session, input, session->private);
+ if (response)
+ {
+ int result;
+
+ g_return_val_if_fail(session->state->handle_cb != NULL, FALSE);
+ result = session->state->handle_cb(session, response, session->private);
+
+ loop:
+ switch (result)
+ {
+ case MN_CLIENT_SESSION_RESULT_CONTINUE:
+ break;
+
+ case MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT:
+ mn_client_session_error(session, _("response \"%s\" is not valid in current context"), input);
+ cont = FALSE;
+ break;
+
+ case MN_CLIENT_SESSION_RESULT_END:
+ cont = FALSE;
+ break;
+
+ case 0: /* assertion failed somewhere */
+ g_return_val_if_reached(FALSE);
+
+ default:
+ if (result > 0) /* state */
+ result = mn_client_session_enter_state(session, result);
+ else /* custom result */
+ {
+ g_return_val_if_fail(session->callbacks->custom_handler != NULL, NULL);
+ result = session->callbacks->custom_handler(session, response, result, session->private);
+ }
+ goto loop;
+ }
+
+ session->callbacks->response_free(session, response, session->private);
+ }
+ else
+ {
+ mn_client_session_error(session, _("unable to parse response \"%s\""), input);
+ cont = FALSE;
+ }
+
+ return cont;
+}
+
+int
+mn_client_session_write (MNClientSession *session,
+ const char *format,
+ ...)
+{
+ va_list args;
+ char *str;
+ char *full;
+ unsigned int len;
+ GByteArray *array = NULL;
+ ssize_t bytes_written;
+ int result = MN_CLIENT_SESSION_RESULT_CONTINUE;
+
+ g_return_val_if_fail(session != NULL, 0);
+ g_return_val_if_fail(format != NULL, 0);
+
+ va_start(args, format);
+ str = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ mn_client_session_notice(session, "> %s", str);
+ full = g_strconcat(str, "\r\n", NULL);
+ g_free(str);
+ len = strlen(full);
+
+#ifdef WITH_SASL
+ if (session->sasl_ssf)
+ {
+ unsigned int start = 0;
+
+ array = g_byte_array_new();
+ while (len > 0)
+ {
+ unsigned int chunk_len;
+ const char *out;
+ unsigned int outlen;
+
+ chunk_len = MIN(len, session->sasl_maxoutbuf);
+ if (sasl_encode(session->sasl_conn, full + start, chunk_len, &out, &outlen) != SASL_OK)
+ {
+ result = mn_client_session_error(session, _("unable to encode data using SASL: %s"), sasl_errdetail(session->sasl_conn));
+ goto end;
+ }
+
+ g_byte_array_append(array, out, outlen);
+
+ start += chunk_len;
+ len -= chunk_len;
+ }
+ }
+#endif /* WITH_SASL */
+
+ if (! array)
+ {
+ array = g_byte_array_sized_new(len);
+ g_byte_array_append(array, full, len);
+ }
+
+#ifdef WITH_SSL
+ if (session->use_ssl)
+ bytes_written = SSL_write(session->ssl, array->data, array->len);
+ else
+#endif /* WITH_SSL */
+ bytes_written = write(session->s, array->data, array->len);
+
+ 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()));
+ else
+#endif /* WITH_SSL */
+ {
+ if (bytes_written == 0)
+ result = mn_client_session_error(session, _("unable to write to server: EOF"));
+ else
+ result = mn_client_session_error(session, _("unable to write to server: %s"), g_strerror(errno));
+ }
+ }
+
+#ifdef WITH_SASL
+ end:
+#endif
+ g_free(full);
+ g_byte_array_free(array, TRUE);
+
+ return result;
+}
+
+#ifdef WITH_SASL
+static int
+mn_client_session_write_base64 (MNClientSession *session,
+ const char *buf,
+ unsigned int len)
+{
+ unsigned int buf64len = len * 2; /* Base64 is 33% larger than the data it encodes */
+ char buf64[buf64len];
+ unsigned int outlen;
+ char *str;
+ int result;
+
+ g_return_val_if_fail(session != NULL, 0);
+ g_return_val_if_fail(buf != NULL, 0);
+
+ result = sasl_encode64(buf, len, buf64, buf64len, &outlen);
+ if (result != SASL_OK)
+ return mn_client_session_error(session, _("unable to encode Base64: %s"), sasl_errstring(result, NULL, NULL));
+
+ str = g_strndup(buf64, outlen);
+ result = mn_client_session_write(session, "%s", str);
+ g_free(str);
+
+ return result;
+}
+
+static gboolean
+mn_client_session_sasl_fill_interact (MNClientSession *session,
+ sasl_interact_t *interact)
+{
+ sasl_interact_t *i;
+
+ g_return_val_if_fail(session != NULL, FALSE);
+ g_return_val_if_fail(interact != NULL, FALSE);
+
+ for (i = interact; i->id; i++)
+ {
+ const char *data = NULL;
+
+ switch (i->id)
+ {
+ case SASL_CB_USER:
+ case SASL_CB_AUTHNAME:
+ data = session->username;
+ break;
+
+ case SASL_CB_PASS:
+ data = session->password;
+ break;
+ };
+
+ if (data)
+ {
+ i->result = data;
+ i->len = strlen(data);
+ }
+ else
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static char *
+mn_client_session_sasl_get_ip_port (const struct sockaddr *addr)
+{
+#ifdef WITH_IPV6
+ char buf[INET6_ADDRSTRLEN];
+#else
+ char buf[INET_ADDRSTRLEN];
+#endif /* WITH_IPV6 */
+ int port;
+
+ g_return_val_if_fail(addr != NULL, NULL);
+
+ if (addr->sa_family == AF_INET)
+ {
+ struct sockaddr_in *in = (struct sockaddr_in *) addr;
+
+ if (! inet_ntop(addr->sa_family, &in->sin_addr, buf, sizeof(buf)))
+ return NULL;
+ port = g_ntohs(in->sin_port);
+ }
+#ifdef WITH_IPV6
+ else if (addr->sa_family == AF_INET6)
+ {
+ struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) addr;
+
+ if (! inet_ntop(addr->sa_family, &in6->sin6_addr, buf, sizeof(buf)))
+ return NULL;
+ port = g_ntohs(in6->sin6_port);
+ }
+#endif
+ else
+ return NULL;
+
+ return g_strdup_printf("%s;%i", buf, port);
+}
+
+gboolean
+mn_client_session_sasl_authentication_start (MNClientSession *session,
+ const char *service,
+ GSList *mechanisms,
+ const char *forced_mechanism,
+ const char **used_mechanism)
+{
+ GError *err = NULL;
+ int result;
+ struct sockaddr name;
+ socklen_t namelen;
+ char *local_ip_port = NULL;
+ char *remote_ip_port = NULL;
+
+ g_return_val_if_fail(session != NULL, 0);
+ g_return_val_if_fail(service != NULL, 0);
+ g_return_val_if_fail(mechanisms != NULL, 0);
+
+ session->sasl_available = mn_sasl_use(&err);
+ if (! session->sasl_available)
+ {
+ mn_client_session_notice(session, _("unable to initialize the SASL library: %s"), err->message);
+ g_error_free(err);
+ return FALSE;
+ }
+
+ namelen = sizeof(name);
+ if (getsockname(session->s, &name, &namelen) >= 0)
+ local_ip_port = mn_client_session_sasl_get_ip_port(&name);
+ else
+ mn_client_session_notice(session, _("unable to retrieve local address of socket: %s"), g_strerror(errno));
+
+ namelen = sizeof(name);
+ if (getpeername(session->s, &name, &namelen) >= 0)
+ remote_ip_port = mn_client_session_sasl_get_ip_port(&name);
+ else
+ mn_client_session_notice(session, _("unable to retrieve remote address of socket: %s"), g_strerror(errno));
+
+ result = sasl_client_new(service,
+ session->hostname,
+ local_ip_port,
+ remote_ip_port,
+ sasl_callbacks,
+ 0,
+ &session->sasl_conn);
+
+ g_free(local_ip_port);
+ g_free(remote_ip_port);
+
+ if (result == SASL_OK)
+ {
+ sasl_security_properties_t security;
+ sasl_interact_t *interact = NULL;
+ GString *mechanisms_string;
+ GSList *l;
+
+ security.min_ssf = 0;
+ security.max_ssf = 256;
+ security.maxbufsize = READ_BUFSIZE;
+ /* only permit plaintext mechanisms if SSL is in use */
+#ifdef WITH_SSL
+ if (session->use_ssl)
+ security.security_flags = 0;
+ else
+#endif /* WITH_SSL */
+ security.security_flags = SASL_SEC_NOPLAINTEXT;
+ security.property_names = NULL;
+ security.property_values = NULL;
+
+ if (sasl_setprop(session->sasl_conn, SASL_SEC_PROPS, &security) != SASL_OK)
+ mn_client_session_notice(session, _("warning: unable to set SASL security properties: %s"), sasl_errdetail(session->sasl_conn));
+
+ mechanisms_string = g_string_new(NULL);
+ if (forced_mechanism)
+ g_string_append(mechanisms_string, forced_mechanism);
+ else
+ MN_LIST_FOREACH(l, mechanisms)
+ {
+ if (*mechanisms_string->str)
+ g_string_append_c(mechanisms_string, ' ');
+ g_string_append(mechanisms_string, l->data);
+ }
+
+ do
+ {
+ result = sasl_client_start(session->sasl_conn,
+ mechanisms_string->str,
+ &interact,
+ &session->sasl_initial_clientout,
+ &session->sasl_initial_clientoutlen,
+ used_mechanism);
+
+ if (result == SASL_INTERACT)
+ {
+ if (! mn_client_session_sasl_fill_interact(session, interact))
+ break;
+ }
+ }
+ while (result == SASL_INTERACT);
+
+ g_string_free(mechanisms_string, TRUE);
+
+ switch (result)
+ {
+ case SASL_OK:
+ case SASL_CONTINUE:
+ return TRUE;
+
+ case SASL_INTERACT:
+ mn_client_session_notice(session, _("unable to start SASL authentication: SASL asked for something we did not know"));
+ break;
+
+ default:
+ mn_client_session_notice(session, _("unable to start SASL authentication: %s"), sasl_errdetail(session->sasl_conn));
+ }
+ }
+ else
+ mn_client_session_notice(session, _("unable to create a SASL connection: %s"), sasl_errdetail(session->sasl_conn));
+
+ return FALSE;
+}
+
+int
+mn_client_session_sasl_authentication_step (MNClientSession *session,
+ const char *input)
+{
+ g_return_val_if_fail(session != NULL, 0);
+ g_return_val_if_fail(input != NULL, 0);
+
+ if (*input)
+ {
+ if (! session->sasl_initial_clientout)
+ {
+ unsigned int inlen = strlen(input);
+ char buf[inlen];
+ unsigned int outlen;
+ int result;
+
+ result = sasl_decode64(input, inlen, buf, inlen, &outlen);
+ if (result == SASL_OK)
+ {
+ sasl_interact_t *interact = NULL;
+
+ do
+ {
+ result = sasl_client_step(session->sasl_conn,
+ buf,
+ outlen,
+ &interact,
+ &session->sasl_clientout,
+ &session->sasl_clientoutlen);
+
+ if (result == SASL_INTERACT)
+ {
+ if (! mn_client_session_sasl_fill_interact(session, interact))
+ break;
+ }
+ }
+ while (result == SASL_INTERACT);
+
+ switch (result)
+ {
+ case SASL_OK:
+ case SASL_CONTINUE:
+ return mn_client_session_write_base64(session, session->sasl_clientout, session->sasl_clientoutlen);
+
+ case SASL_INTERACT:
+ mn_client_session_notice(session, _("SASL asked for something we did not know, aborting SASL authentication"));
+ return mn_client_session_write(session, "*");
+
+ default:
+ mn_client_session_notice(session, _("%s, aborting SASL authentication"), sasl_errdetail(session->sasl_conn));
+ return mn_client_session_write(session, "*");
+ }
+ }
+ else /* compliance error */
+ return mn_client_session_error(session, _("unable to decode Base64 input from server: %s"), sasl_errstring(result, NULL, NULL));
+ }
+ else
+ return mn_client_session_error(session, _("the server sent a SASL challenge, but there was a pending initial SASL client response"));
+ }
+ else
+ {
+ if (session->sasl_initial_clientout)
+ {
+ int result;
+
+ result = mn_client_session_write_base64(session, session->sasl_initial_clientout, session->sasl_initial_clientoutlen);
+ session->sasl_initial_clientout = NULL;
+ session->sasl_initial_clientoutlen = 0;
+ return result;
+ }
+ else
+ return mn_client_session_error(session, _("the server did not send a SASL challenge, but there was no pending initial SASL client response"));
+ }
+}
+
+gboolean
+mn_client_session_sasl_authentication_done (MNClientSession *session)
+{
+ int *ssf;
+
+ g_return_val_if_fail(session != NULL, FALSE);
+
+ if (sasl_getprop(session->sasl_conn, SASL_SSF, (const void **) &ssf) == SASL_OK)
+ {
+ if (*ssf)
+ {
+ unsigned int *maxoutbuf;
+
+ if (sasl_getprop(session->sasl_conn, SASL_MAXOUTBUF, (const void **) &maxoutbuf) == SASL_OK)
+ {
+ session->sasl_ssf = *ssf;
+ session->sasl_maxoutbuf = *maxoutbuf;
+
+ if (session->sasl_ssf)
+ mn_client_session_notice(session, _("a SASL security layer of strength factor %i is now active"), session->sasl_ssf);
+ }
+ else
+ {
+ /* a security layer is active but we can't retrieve maxoutbuf -> fatal */
+ mn_client_session_error(session, _("unable to get SASL_MAXOUTBUF property: %s"), sasl_errdetail(session->sasl_conn));
+ return FALSE;
+ }
+ }
+ }
+ else
+ mn_client_session_notice(session, _("warning: unable to get SASL_SSF property: %s"), sasl_errdetail(session->sasl_conn));
+
+ return TRUE;
+}
+#endif /* WITH_SASL */
+
+void
+mn_client_session_notice (MNClientSession *session,
+ const char *format,
+ ...)
+{
+ g_return_if_fail(session != NULL);
+ g_return_if_fail(format != NULL);
+
+ if (session->callbacks->notice)
+ {
+ va_list args;
+ char *str;
+
+ va_start(args, format);
+ str = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ session->callbacks->notice(session, str, session->private);
+ g_free(str);
+ }
+}
+
+int
+mn_client_session_error (MNClientSession *session,
+ const char *format,
+ ...)
+{
+ g_return_val_if_fail(session != NULL, 0);
+ g_return_val_if_fail(format != NULL, 0);
+
+ if (! session->error)
+ {
+ va_list args;
+
+ va_start(args, format);
+ session->error = g_strdup_vprintf(format, args);
+ va_end(args);
+ }
+
+ return MN_CLIENT_SESSION_RESULT_END;
+}
diff --git a/src/mn-client-session.h b/src/mn-client-session.h
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+
+#ifndef _MN_CLIENT_SESSION_H
+#define _MN_CLIENT_SESSION_H
+
+#include "config.h"
+#include <glib.h>
+
+typedef struct _MNClientSession MNClientSession;
+typedef struct _MNClientSessionPrivate MNClientSessionPrivate;
+typedef struct _MNClientSessionResponse MNClientSessionResponse;
+
+enum
+{
+ MN_CLIENT_SESSION_RESULT_CONTINUE = -1001,
+ MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT = -1002,
+ MN_CLIENT_SESSION_RESULT_END = -1003,
+};
+
+typedef struct
+{
+ unsigned int id;
+ int (*enter_cb) (MNClientSession *session,
+ MNClientSessionPrivate *private);
+ int (*handle_cb) (MNClientSession *session,
+ MNClientSessionResponse *response,
+ MNClientSessionPrivate *private);
+} MNClientSessionState;
+
+#define MN_CLIENT_SESSION_INITIAL_STATE 1
+#define MN_CLIENT_SESSION_STATES_END { 0, NULL, NULL }
+
+typedef struct
+{
+ void (*notice) (MNClientSession *session,
+ const char *str,
+ MNClientSessionPrivate *private);
+
+ MNClientSessionResponse *(*response_new) (MNClientSession *session,
+ const char *input,
+ MNClientSessionPrivate *private);
+ void (*response_free) (MNClientSession *session,
+ MNClientSessionResponse *response,
+ MNClientSessionPrivate *private);
+
+ int (*custom_handler) (MNClientSession *session,
+ MNClientSessionResponse *response,
+ int result,
+ MNClientSessionPrivate *private);
+} MNClientSessionCallbacks;
+
+gboolean mn_client_session_run (MNClientSessionState *states,
+ MNClientSessionCallbacks *callbacks,
+#ifdef WITH_SSL
+ gboolean use_ssl,
+#endif
+ const char *hostname,
+ int port,
+ const char *username,
+ const char *password,
+ MNClientSessionPrivate *private,
+ GError **err);
+
+int mn_client_session_write (MNClientSession *session,
+ const char *format,
+ ...);
+
+#ifdef WITH_SASL
+gboolean mn_client_session_sasl_authentication_start (MNClientSession *session,
+ const char *service,
+ GSList *mechanisms,
+ const char *forced_mechanism,
+ const char **used_mechanism);
+int mn_client_session_sasl_authentication_step (MNClientSession *session,
+ const char *input);
+gboolean mn_client_session_sasl_authentication_done (MNClientSession *session);
+#endif /* WITH_SASL */
+
+void mn_client_session_notice (MNClientSession *session,
+ const char *format,
+ ...);
+int mn_client_session_error (MNClientSession *session,
+ const char *format,
+ ...);
+
+#endif /* _MN_CLIENT_SESSION_H */
diff --git a/src/mn-conf.c b/src/mn-conf.c
@@ -19,7 +19,6 @@
#include "config.h"
#include <stdarg.h>
#include <eel/eel.h>
-#include "mn-mailboxes.h"
#include "mn-util.h"
#include "mn-conf.h"
@@ -30,15 +29,6 @@
/*** functions ***************************************************************/
-static void mn_conf_notify_delay_cb (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data);
-static void mn_conf_notify_mailboxes_cb (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data);
-
static gboolean mn_conf_link_window_h (GtkWidget *widget,
GdkEventConfigure *event,
gpointer user_data);
@@ -72,24 +62,6 @@ static void mn_conf_link_weak_notify_cb (gpointer data,
/*** implementation **********************************************************/
-static void
-mn_conf_notify_delay_cb (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
-{
- mn_mailboxes_install_timeout();
-}
-
-static void
-mn_conf_notify_mailboxes_cb (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
-{
- mn_mailboxes_register();
-}
-
void
mn_conf_init (void)
{
@@ -115,14 +87,11 @@ mn_conf_init (void)
l->data = uri;
}
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_slist_free(gconf_mailboxes);
+ mn_pointers_free(gconf_mailboxes);
- /* monitor some keys */
+ /* monitor our namespace */
eel_gconf_monitor_add(MN_CONF_NAMESPACE);
-
- eel_gconf_notification_add(MN_CONF_DELAY_NAMESPACE, mn_conf_notify_delay_cb, NULL);
- eel_gconf_notification_add(MN_CONF_MAILBOXES, mn_conf_notify_mailboxes_cb, NULL);
}
void
@@ -290,9 +259,10 @@ mn_conf_link_entry_notify_cb (GConfClient *client,
{
GConfValue *value = gconf_entry_get_value(entry);
GtkEntry *entry_widget = user_data;
- const char *str;
+ const char *str = NULL;
- str = gconf_value_get_string(value);
+ if (value)
+ str = gconf_value_get_string(value);
gtk_entry_set_text(entry_widget, str ? str : "");
}
diff --git a/src/mn-conf.h b/src/mn-conf.h
@@ -36,11 +36,14 @@
#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"
-#define MN_CONF_COMMANDS_CLICKED_COMMAND MN_CONF_NAMESPACE "/commands/clicked/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"
+#define MN_CONF_PREFERENCES_DIALOG MN_CONF_UI_NAMESPACE "/preferences-dialog" /* obsolete */
+#define MN_CONF_PROPERTIES_DIALOG MN_CONF_UI_NAMESPACE "/properties-dialog"
void mn_conf_init (void);
diff --git a/src/mn-dialog.c b/src/mn-dialog.c
@@ -92,3 +92,21 @@ mn_error_dialog (const char *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
@@ -21,9 +21,11 @@
#include <stdarg.h>
-void mn_error_dialog (const char *help_link_id,
- const char *primary,
- const char *format,
- ...);
+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
@@ -0,0 +1,28 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_GMAIL_MAILBOX_PRIVATE_H__
+#define __MN_GMAIL_MAILBOX_PRIVATE_H__
+
+#include "mn-gmail-mailbox.h"
+
+#ifdef __cplusplus
+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"
+ GHashTable * cookies;
+#line 41 "mn-gmail-mailbox.gob"
+ gboolean logged_in;
+#line 22 "mn-gmail-mailbox-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-gmail-mailbox-properties-private.h b/src/mn-gmail-mailbox-properties-private.h
@@ -0,0 +1,28 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_GMAIL_MAILBOX_PROPERTIES_PRIVATE_H__
+#define __MN_GMAIL_MAILBOX_PROPERTIES_PRIVATE_H__
+
+#include "mn-gmail-mailbox-properties.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNGmailMailboxPropertiesPrivate {
+#line 36 "mn-gmail-mailbox-properties.gob"
+ GtkSizeGroup * size_group;
+#line 51 "mn-gmail-mailbox-properties.gob"
+ GtkWidget * username_entry;
+#line 52 "mn-gmail-mailbox-properties.gob"
+ GtkWidget * password_entry;
+#line 53 "mn-gmail-mailbox-properties.gob"
+ GtkTooltips * tooltips;
+#line 22 "mn-gmail-mailbox-properties-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-gmail-mailbox-properties.c b/src/mn-gmail-mailbox-properties.c
@@ -0,0 +1,419 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-gmail-mailbox-properties.h"
+
+#include "mn-gmail-mailbox-properties-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 22 "mn-gmail-mailbox-properties.gob"
+
+#include "config.h"
+#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"
+/* self casting macros */
+#define SELF(x) MN_GMAIL_MAILBOX_PROPERTIES(x)
+#define SELF_CONST(x) MN_GMAIL_MAILBOX_PROPERTIES_CONST(x)
+#define IS_SELF(x) MN_IS_GMAIL_MAILBOX_PROPERTIES(x)
+#define TYPE_SELF MN_TYPE_GMAIL_MAILBOX_PROPERTIES
+#define SELF_CLASS(x) MN_GMAIL_MAILBOX_PROPERTIES_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_GMAIL_MAILBOX_PROPERTIES_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNGmailMailboxProperties Self;
+typedef MNGmailMailboxPropertiesClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void mn_gmail_mailbox_properties_init (MNGmailMailboxProperties * o) G_GNUC_UNUSED;
+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;
+
+enum {
+ PROP_0,
+ PROP_LABEL,
+ PROP_SIZE_GROUP,
+ PROP_COMPLETE
+};
+
+/* pointer to the class of our parent */
+static GtkVBoxClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_entry_changed_h mn_gmail_mailbox_properties_entry_changed_h
+#define self_set_uri mn_gmail_mailbox_properties_set_uri
+#define self_get_uri mn_gmail_mailbox_properties_get_uri
+
+
+static void
+___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
+{
+#line 100 "mn-gmail-mailbox-properties.gob"
+ iface->set_uri = self_set_uri;
+#line 121 "mn-gmail-mailbox-properties.gob"
+ iface->get_uri = self_get_uri;
+#line 81 "mn-gmail-mailbox-properties.c"
+}
+
+GType
+mn_gmail_mailbox_properties_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNGmailMailboxPropertiesClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_gmail_mailbox_properties_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNGmailMailboxProperties),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_gmail_mailbox_properties_init,
+ NULL
+ };
+
+ static const GInterfaceInfo MN_Mailbox_Properties_info = {
+ (GInterfaceInitFunc) ___MN_Mailbox_Properties_init,
+ NULL,
+ NULL
+ };
+
+ type = g_type_register_static (GTK_TYPE_VBOX, "MNGmailMailboxProperties", &info, (GTypeFlags)0);
+ g_type_add_interface_static (type,
+ MN_TYPE_MAILBOX_PROPERTIES,
+ &MN_Mailbox_Properties_info);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNGmailMailboxProperties *)g_object_new(mn_gmail_mailbox_properties_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNGmailMailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNGmailMailboxProperties *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNGmailMailboxProperties *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNGmailMailboxProperties *)g_object_new_valist (mn_gmail_mailbox_properties_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::dispose"
+ 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"
+ 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"
+ if(self->_priv->tooltips) { ((*(void (*)(void *))g_object_unref)) (self->_priv->tooltips); self->_priv->tooltips = NULL; }
+#line 148 "mn-gmail-mailbox-properties.c"
+}
+#undef __GOB_FUNCTION__
+
+
+static void
+___finalize(GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::finalize"
+ MNGmailMailboxProperties *self G_GNUC_UNUSED = MN_GMAIL_MAILBOX_PROPERTIES (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
+
+static void
+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"
+ o->_priv->tooltips = mn_tooltips_new();
+#line 172 "mn-gmail-mailbox-properties.c"
+}
+#undef __GOB_FUNCTION__
+static void
+mn_gmail_mailbox_properties_class_init (MNGmailMailboxPropertiesClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (GTK_TYPE_VBOX);
+
+#line 55 "mn-gmail-mailbox-properties.gob"
+ g_object_class->constructor = ___1_mn_gmail_mailbox_properties_constructor;
+#line 185 "mn-gmail-mailbox-properties.c"
+ 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;
+ {
+ g_object_class_override_property (g_object_class,
+ PROP_LABEL,
+ "label");
+ g_object_class_override_property (g_object_class,
+ PROP_SIZE_GROUP,
+ "size_group");
+ g_object_class_override_property (g_object_class,
+ PROP_COMPLETE,
+ "complete");
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::set_property"
+{
+ MNGmailMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_GMAIL_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_SIZE_GROUP:
+ {
+#line 37 "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"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::get_property"
+{
+ MNGmailMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_GMAIL_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_LABEL:
+ {
+#line 34 "mn-gmail-mailbox-properties.gob"
+ g_value_set_string(VAL, "Gmail");
+#line 251 "mn-gmail-mailbox-properties.c"
+ }
+ break;
+ case PROP_SIZE_GROUP:
+ {
+#line 37 "mn-gmail-mailbox-properties.gob"
+g_value_set_object (VAL, (gpointer)self->_priv->size_group);
+#line 258 "mn-gmail-mailbox-properties.c"
+ }
+ break;
+ case PROP_COMPLETE:
+ {
+#line 41 "mn-gmail-mailbox-properties.gob"
+
+ const char *username;
+ const char *password;
+
+ username = gtk_entry_get_text(GTK_ENTRY(selfp->username_entry));
+ password = gtk_entry_get_text(GTK_ENTRY(selfp->password_entry));
+
+ g_value_set_boolean(VAL, *username && *password);
+
+#line 273 "mn-gmail-mailbox-properties.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 55 "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"
+#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): \
+ ((GObject * )0))
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::constructor"
+{
+#line 57 "mn-gmail-mailbox-properties.gob"
+
+ GObject *object;
+ Self *self;
+ GtkWidget *label1;
+ GtkWidget *label2;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+
+ gtk_box_set_spacing(GTK_BOX(self), 6);
+
+ mn_mailbox_properties_credentials_new(GTK_VBOX(self),
+ &label1,
+ &selfp->username_entry,
+ &label2,
+ &selfp->password_entry);
+
+ gtk_size_group_add_widget(selfp->size_group, label1);
+ gtk_size_group_add_widget(selfp->size_group, label2);
+
+ mn_tooltips_set_tips(selfp->tooltips,
+ selfp->username_entry, _("Your Gmail username"),
+ selfp->password_entry, _("Your Gmail password"),
+ NULL);
+
+ mn_mailbox_properties_link_entries(GTK_ENTRY(selfp->username_entry),
+ GTK_ENTRY(selfp->password_entry),
+ NULL);
+
+ g_signal_connect(G_OBJECT(selfp->username_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+ g_signal_connect(G_OBJECT(selfp->password_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+
+ return object;
+ }}
+#line 336 "mn-gmail-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 92 "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"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::entry_changed_h"
+#line 92 "mn-gmail-mailbox-properties.gob"
+ g_return_if_fail (editable != NULL);
+#line 92 "mn-gmail-mailbox-properties.gob"
+ g_return_if_fail (GTK_IS_EDITABLE (editable));
+#line 92 "mn-gmail-mailbox-properties.gob"
+ g_return_if_fail (user_data != NULL);
+#line 352 "mn-gmail-mailbox-properties.c"
+{
+#line 95 "mn-gmail-mailbox-properties.gob"
+
+ Self *self = user_data;
+ g_object_notify(G_OBJECT(self), "complete");
+ }}
+#line 359 "mn-gmail-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 100 "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"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox:Properties::set_uri"
+#line 100 "mn-gmail-mailbox-properties.gob"
+ g_return_val_if_fail (self != NULL, (gboolean )0);
+#line 100 "mn-gmail-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (gboolean )0);
+#line 100 "mn-gmail-mailbox-properties.gob"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 374 "mn-gmail-mailbox-properties.c"
+{
+#line 103 "mn-gmail-mailbox-properties.gob"
+
+ char *username;
+ char *password;
+
+ if (mn_uri_parse_gmail(uri, &username, &password))
+ {
+ 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);
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }}
+#line 394 "mn-gmail-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 121 "mn-gmail-mailbox-properties.gob"
+static char *
+mn_gmail_mailbox_properties_get_uri (MNMailboxProperties * self)
+#line 400 "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 123 "mn-gmail-mailbox-properties.gob"
+
+ const char *username;
+ const char *password;
+
+ 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);
+ }}
+#line 419 "mn-gmail-mailbox-properties.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-gmail-mailbox-properties.gob b/src/mn-gmail-mailbox-properties.gob
@@ -0,0 +1,132 @@
+/*
+ * 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 <gtk/gtk.h>
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include "mn-mailbox-properties.h"
+#include "mn-mailbox-properties-util.h"
+#include "mn-uri.h"
+#include "mn-util.h"
+%}
+
+class MN:Gmail:Mailbox:Properties from Gtk:VBox (interface MN:Mailbox:Properties)
+{
+ property STRING label (override)
+ get { g_value_set_string(VAL, "Gmail"); };
+
+ private GtkSizeGroup *size_group unrefwith g_object_unref;
+ property OBJECT size_group (override, link);
+
+ property BOOLEAN complete (override)
+ get
+ {
+ const char *username;
+ const char *password;
+
+ username = gtk_entry_get_text(GTK_ENTRY(selfp->username_entry));
+ password = gtk_entry_get_text(GTK_ENTRY(selfp->password_entry));
+
+ g_value_set_boolean(VAL, *username && *password);
+ };
+
+ private GtkWidget *username_entry;
+ private GtkWidget *password_entry;
+ private GtkTooltips *tooltips = {mn_tooltips_new()} unrefwith g_object_unref;
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ Self *self;
+ GtkWidget *label1;
+ GtkWidget *label2;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+
+ gtk_box_set_spacing(GTK_BOX(self), 6);
+
+ mn_mailbox_properties_credentials_new(GTK_VBOX(self),
+ &label1,
+ &selfp->username_entry,
+ &label2,
+ &selfp->password_entry);
+
+ gtk_size_group_add_widget(selfp->size_group, label1);
+ gtk_size_group_add_widget(selfp->size_group, label2);
+
+ mn_tooltips_set_tips(selfp->tooltips,
+ selfp->username_entry, _("Your Gmail username"),
+ selfp->password_entry, _("Your Gmail password"),
+ NULL);
+
+ mn_mailbox_properties_link_entries(GTK_ENTRY(selfp->username_entry),
+ GTK_ENTRY(selfp->password_entry),
+ NULL);
+
+ g_signal_connect(G_OBJECT(selfp->username_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+ g_signal_connect(G_OBJECT(selfp->password_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+
+ return object;
+ }
+
+ private void
+ entry_changed_h (Gtk:Editable *editable (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ g_object_notify(G_OBJECT(self), "complete");
+ }
+
+ interface MN:Mailbox:Properties private gboolean
+ set_uri (MN:Mailbox:Properties *self (check null type),
+ const char *uri (check null))
+ {
+ char *username;
+ char *password;
+
+ if (mn_uri_parse_gmail(uri, &username, &password))
+ {
+ 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);
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+
+ interface MN:Mailbox:Properties private char *
+ get_uri (MN:Mailbox:Properties *self (check null type))
+ {
+ const char *username;
+ const char *password;
+
+ 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);
+ }
+}
diff --git a/src/mn-gmail-mailbox-properties.h b/src/mn-gmail-mailbox-properties.h
@@ -0,0 +1,78 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <gtk/gtk.h>
+
+#ifndef __MN_GMAIL_MAILBOX_PROPERTIES_H__
+#define __MN_GMAIL_MAILBOX_PROPERTIES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_GMAIL_MAILBOX_PROPERTIES (mn_gmail_mailbox_properties_get_type())
+#define MN_GMAIL_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_gmail_mailbox_properties_get_type(), MNGmailMailboxProperties)
+#define MN_GMAIL_MAILBOX_PROPERTIES_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_gmail_mailbox_properties_get_type(), MNGmailMailboxProperties const)
+#define MN_GMAIL_MAILBOX_PROPERTIES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_gmail_mailbox_properties_get_type(), MNGmailMailboxPropertiesClass)
+#define MN_IS_GMAIL_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_gmail_mailbox_properties_get_type ())
+
+#define MN_GMAIL_MAILBOX_PROPERTIES_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_gmail_mailbox_properties_get_type(), MNGmailMailboxPropertiesClass)
+
+/* Private structure type */
+typedef struct _MNGmailMailboxPropertiesPrivate MNGmailMailboxPropertiesPrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_GMAIL_MAILBOX_PROPERTIES__
+#define __TYPEDEF_MN_GMAIL_MAILBOX_PROPERTIES__
+typedef struct _MNGmailMailboxProperties MNGmailMailboxProperties;
+#endif
+struct _MNGmailMailboxProperties {
+ GtkVBox __parent__;
+ /*< private >*/
+ MNGmailMailboxPropertiesPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNGmailMailboxPropertiesClass MNGmailMailboxPropertiesClass;
+struct _MNGmailMailboxPropertiesClass {
+ GtkVBoxClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_gmail_mailbox_properties_get_type (void);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_GMAIL_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label", __extension__ ({gchar **z = (arg); z;})
+#define MN_GMAIL_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject *z = (arg); z;})
+#define MN_GMAIL_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject **z = (arg); z;})
+#define MN_GMAIL_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete", __extension__ ({gboolean *z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_GMAIL_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label",(gchar **)(arg)
+#define MN_GMAIL_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group",(GObject *)(arg)
+#define MN_GMAIL_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group",(GObject **)(arg)
+#define MN_GMAIL_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete",(gboolean *)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-gmail-mailbox.c b/src/mn-gmail-mailbox.c
@@ -1,20 +1,27 @@
-/*
- * 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 Mon Aug 16 18:13:52 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-gmail-mailbox.h"
+
+#include "mn-gmail-mailbox-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 22 "mn-gmail-mailbox.gob"
#include "config.h"
#include <string.h>
@@ -22,378 +29,730 @@
#include <glib/gi18n-lib.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libsoup/soup.h>
-#include "mn-gmail-mailbox.h"
+#include "mn-mailbox-private.h"
#include "mn-uri.h"
#include "mn-util.h"
#include "mn-stock.h"
#include "mn-soup.h"
-/*** types *******************************************************************/
-
-struct _MNGmailMailboxPrivate
-{
- char *username;
- char *password;
- char *cookie;
-};
-
-/*** variables ***************************************************************/
-
-static GObjectClass *parent_class = NULL;
-
-/*** functions ***************************************************************/
-
-static void mn_gmail_mailbox_class_init (MNGmailMailboxClass *class);
-static void mn_gmail_mailbox_init (MNGmailMailbox *mailbox);
-static void mn_gmail_mailbox_finalize (GObject *object);
-
-static GObject *mn_gmail_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params);
-
-static void mn_gmail_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data);
-static void mn_gmail_mailbox_check (MNMailbox *mailbox);
-
-static SoupMessage *mn_gmail_mailbox_soup_message_new (const char *uri,
- const char *method);
-
-static char *mn_gmail_mailbox_get_token (const char *str,
- const char *pre,
- const char *post,
- gboolean include_pre,
- gboolean include_post);
-
-static void mn_gmail_mailbox_login (MNGmailMailbox *mailbox);
-static void mn_gmail_mailbox_login_cb (SoupMessage *message, gpointer user_data);
-
-static char *mn_gmail_mailbox_get_cookie (SoupMessage *message);
-
-static void mn_gmail_mailbox_check_internal (MNGmailMailbox *mailbox);
-static void mn_gmail_mailbox_check_internal_cb (SoupMessage *message,
- gpointer user_data);
-
-static int mn_gmail_mailbox_get_unread_count (SoupMessage *message);
-
-/*** implementation **********************************************************/
-
+#line 39 "mn-gmail-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_GMAIL_MAILBOX(x)
+#define SELF_CONST(x) MN_GMAIL_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_GMAIL_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_GMAIL_MAILBOX
+#define SELF_CLASS(x) MN_GMAIL_MAILBOX_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_GMAIL_MAILBOX_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNGmailMailbox Self;
+typedef MNGmailMailboxClass SelfClass;
+
+/* here are local prototypes */
+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 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 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;
+static void mn_gmail_mailbox_login_cb2 (SoupMessage * message, gpointer user_data) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_login_cb3 (SoupMessage * message, gpointer user_data) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_update_cookies (MNGmailMailbox * self, SoupMessage * message) G_GNUC_UNUSED;
+static char * mn_gmail_mailbox_build_cookie (MNGmailMailbox * self) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_build_cookie_cb (gpointer key, gpointer value, gpointer user_data) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_check_internal (MNGmailMailbox * self) G_GNUC_UNUSED;
+static void mn_gmail_mailbox_check_internal_cb (SoupMessage * message, gpointer user_data) G_GNUC_UNUSED;
+static int mn_gmail_mailbox_get_unread_count (SoupMessage * message) G_GNUC_UNUSED;
+
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_get mn_gmail_mailbox_get
+#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
+#define self_login_cb2 mn_gmail_mailbox_login_cb2
+#define self_login_cb3 mn_gmail_mailbox_login_cb3
+#define self_update_cookies mn_gmail_mailbox_update_cookies
+#define self_build_cookie mn_gmail_mailbox_build_cookie
+#define self_build_cookie_cb mn_gmail_mailbox_build_cookie_cb
+#define self_check_internal mn_gmail_mailbox_check_internal
+#define self_check_internal_cb mn_gmail_mailbox_check_internal_cb
+#define self_get_unread_count mn_gmail_mailbox_get_unread_count
GType
mn_gmail_mailbox_get_type (void)
{
- static GType gmail_mailbox_type = 0;
-
- if (! gmail_mailbox_type)
- {
- static const GTypeInfo gmail_mailbox_info = {
- sizeof(MNGmailMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_gmail_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNGmailMailbox),
- 0,
- (GInstanceInitFunc) mn_gmail_mailbox_init,
- };
-
- gmail_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNGmailMailbox",
- &gmail_mailbox_info,
- 0);
- }
-
- return gmail_mailbox_type;
-}
-
-static void
-mn_gmail_mailbox_class_init (MNGmailMailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
-
- parent_class = g_type_class_peek_parent(class);
-
- object_class->constructor = mn_gmail_mailbox_constructor;
- object_class->finalize = mn_gmail_mailbox_finalize;
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNGmailMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_gmail_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNGmailMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_gmail_mailbox_init,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNGmailMailbox", &info, (GTypeFlags)0);
+ }
- mailbox_class->stock_id = MN_STOCK_GMAIL;
- mailbox_class->format = "Gmail";
- mailbox_class->is = mn_gmail_mailbox_is;
- mailbox_class->check = mn_gmail_mailbox_check;
+ return type;
}
-static void
-mn_gmail_mailbox_init (MNGmailMailbox *mailbox)
-{
- mn_soup_use();
- mailbox->priv = g_new0(MNGmailMailboxPrivate, 1);
-}
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNGmailMailbox *)g_object_new(mn_gmail_mailbox_get_type(), NULL))
-static void
-mn_gmail_mailbox_finalize (GObject *object)
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNGmailMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNGmailMailbox *
+GET_NEW_VARG (const char *first, ...)
{
- MNGmailMailbox *gmail_mailbox = MN_GMAIL_MAILBOX(object);
-
- g_free(gmail_mailbox->priv->username);
- g_free(gmail_mailbox->priv->password);
- g_free(gmail_mailbox->priv->cookie);
- g_free(gmail_mailbox->priv);
- mn_soup_unuse();
-
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ MNGmailMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNGmailMailbox *)g_object_new_valist (mn_gmail_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
-static GObject *
-mn_gmail_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
-{
- GObject *object;
- MNMailbox *mailbox;
- MNGmailMailbox *gmail_mailbox;
-
- object = G_OBJECT_CLASS(parent_class)->constructor(type,
- n_construct_properties,
- construct_params);
- mailbox = MN_MAILBOX(object);
- gmail_mailbox = MN_GMAIL_MAILBOX(object);
-
- if (! mn_uri_parse_gmail(mn_mailbox_get_uri(mailbox),
- &gmail_mailbox->priv->username,
- &gmail_mailbox->priv->password))
- mn_mailbox_set_init_error(mailbox, _("unable to parse Gmail URI"));
-
- return object;
-}
static void
-mn_gmail_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data)
+___finalize(GObject *obj_self)
{
- char *scheme;
- gboolean is;
-
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && ! strcmp(scheme, "gmail");
- g_free(scheme);
-
- callback(is, user_data);
+#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"
+ ___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"
+ if(self->_priv->cookies) { ((*(void (*)(void *))g_hash_table_destroy)) (self->_priv->cookies); self->_priv->cookies = NULL; }
+#line 149 "mn-gmail-mailbox.c"
+ g_free (priv);
}
+#undef __GOB_FUNCTION__
-static void
-mn_gmail_mailbox_check (MNMailbox *mailbox)
+static void
+mn_gmail_mailbox_init (MNGmailMailbox * o G_GNUC_UNUSED)
{
- MNGmailMailbox *gmail_mailbox = MN_GMAIL_MAILBOX(mailbox);
-
- if (gmail_mailbox->priv->cookie)
- mn_gmail_mailbox_check_internal(gmail_mailbox);
- else
- mn_gmail_mailbox_login(gmail_mailbox);
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::init"
+ o->_priv = g_new0 (MNGmailMailboxPrivate, 1);
}
-
-static SoupMessage *
-mn_gmail_mailbox_soup_message_new (const char *uri, const char *method)
+#undef __GOB_FUNCTION__
+#line 43 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_class_init (MNGmailMailboxClass * class G_GNUC_UNUSED)
+#line 164 "mn-gmail-mailbox.c"
{
- SoupContext *context;
- SoupMessage *message;
-
- context = soup_context_get(uri);
- message = soup_message_new(context, method);
- soup_context_unref(context);
-
- soup_message_add_header(message->request_headers, "User-Agent", "Mail Notification");
-
- return message;
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+ MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
+
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
+
+#line 49 "mn-gmail-mailbox.gob"
+ g_object_class->constructor = ___2_mn_gmail_mailbox_constructor;
+#line 70 "mn-gmail-mailbox.gob"
+ g_object_class->finalize = ___finalize;
+#line 77 "mn-gmail-mailbox.gob"
+ mn_mailbox_class->impl_is = ___4_mn_gmail_mailbox_impl_is;
+#line 90 "mn-gmail-mailbox.gob"
+ mn_mailbox_class->impl_check = ___5_mn_gmail_mailbox_impl_check;
+#line 180 "mn-gmail-mailbox.c"
+ {
+#line 44 "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"
+ }
}
+#undef __GOB_FUNCTION__
-/*
- * Gets the token of STR included between the first occurrence of PRE
- * and the last occurrence of POST.
- *
- * If INCLUDE_PRE is true, include PRE in the result.
- * If INCLUDE_POST is true, include POST in the result.
- */
-static char *
-mn_gmail_mailbox_get_token (const char *str,
- const char *pre,
- const char *post,
- gboolean include_pre,
- gboolean include_post)
-{
- char *token = NULL;
- char *pre_loc;
-
- g_return_val_if_fail(str != NULL, NULL);
- g_return_val_if_fail(pre != NULL, NULL);
- g_return_val_if_fail(post != NULL, NULL);
-
- pre_loc = strstr(str, pre);
- if (pre_loc)
- {
- char *after_pre_loc;
- char *post_loc;
-
- after_pre_loc = pre_loc + strlen(pre);
- post_loc = strstr(after_pre_loc, post);
- if (post_loc)
- {
- char *start = include_pre ? pre_loc : after_pre_loc;
- char *end = include_post ? post_loc + strlen(post) : post_loc;
-
- token = g_strndup(start, end - start);
- }
- }
- return token;
-}
-static void
-mn_gmail_mailbox_login (MNGmailMailbox *mailbox)
+#line 49 "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"
+#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): \
+ ((GObject * )0))
{
- char *uri;
- SoupMessage *message;
-
- g_return_if_fail(MN_IS_GMAIL_MAILBOX(mailbox));
- g_return_if_fail(mailbox->priv->cookie == NULL);
-
- mn_info(_("logging into Gmail as user %s"), mailbox->priv->username);
-
- uri = g_strdup_printf("https://gmail.google.com/accounts/ServiceLoginBoxAuth?Email=%s&Passwd=%s&null=Sign%%20in&service=mail", mailbox->priv->username, mailbox->priv->password);
- message = mn_gmail_mailbox_soup_message_new(uri, SOUP_METHOD_GET);
- g_free(uri);
-
- soup_message_queue(message, mn_gmail_mailbox_login_cb, mailbox);
- /* message will be freed by libsoup after invoking the callback */
-}
-
-static void
-mn_gmail_mailbox_login_cb (SoupMessage *message, gpointer user_data)
-{
- MNGmailMailbox *mailbox = user_data;
-
- if (SOUP_MESSAGE_IS_ERROR(message))
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unable to transfer data: %s"), message->errorphrase);
- else
- {
- mailbox->priv->cookie = mn_gmail_mailbox_get_cookie(message);
- if (mailbox->priv->cookie)
- {
- mn_info(_("successfully logged into Gmail as user %s"), mailbox->priv->username);
- mn_gmail_mailbox_check_internal(mailbox);
- return;
- }
- else
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("login failed"));
- }
-
- /* if this point is reached, an error occurred */
- mn_mailbox_end_check(MN_MAILBOX(mailbox));
-}
-
-static char *
-mn_gmail_mailbox_get_cookie (SoupMessage *message)
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::constructor"
{
- char *cookie = NULL;
- const GSList *set_cookie_headers;
- const GSList *l;
- char *sid = NULL;
-
- set_cookie_headers = soup_message_get_header_list(message->response_headers, "Set-Cookie");
- MN_LIST_FOREACH(l, set_cookie_headers)
- {
- const char *value = l->data;
-
- sid = mn_gmail_mailbox_get_token(value, "SID=", "=", TRUE, TRUE);
- if (sid)
- break;
- }
-
- if (sid)
- {
- char *body;
- char *cookie_val;
-
- body = g_strndup(message->response.body, message->response.length);
- cookie_val = mn_gmail_mailbox_get_token(body, "var cookieVal= \"", "\"", FALSE, FALSE);
- g_free(body);
-
- if (cookie_val)
- {
- cookie = g_strdup_printf("%s; GV=%s", sid, cookie_val);
- g_free(cookie_val);
- }
-
- g_free(sid);
- }
-
- return cookie;
-}
-
-static void
-mn_gmail_mailbox_check_internal (MNGmailMailbox *mailbox)
+#line 51 "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"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 70 "mn-gmail-mailbox.gob"
+static void
+___3_mn_gmail_mailbox_finalize (GObject * object G_GNUC_UNUSED)
+#line 231 "mn-gmail-mailbox.c"
+#define PARENT_HANDLER(___object) \
+ { if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(___object); }
{
- SoupMessage *message;
-
- g_return_if_fail(MN_IS_GMAIL_MAILBOX(mailbox));
-
- mn_info(_("searching for unread mail in %s"), mn_mailbox_get_name(MN_MAILBOX(mailbox)));
-
- message = mn_gmail_mailbox_soup_message_new("https://gmail.google.com/gmail?search=adv&as_subset=unread&view=tl&start=0", SOUP_METHOD_GET);
- soup_message_add_header(message->request_headers, "Cookie", mailbox->priv->cookie);
-
- soup_message_queue(message, mn_gmail_mailbox_check_internal_cb, mailbox);
- /* message will be freed by libsoup after invoking the callback */
-}
-
-static void
-mn_gmail_mailbox_check_internal_cb (SoupMessage *message, gpointer user_data)
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::finalize"
{
- MNGmailMailbox *mailbox = user_data;
-
- if (SOUP_MESSAGE_IS_ERROR(message))
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unable to transfer data: %s"), message->errorphrase);
- else
- {
- int count;
-
- count = mn_gmail_mailbox_get_unread_count(message);
- if (count == -1)
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unable to parse Gmail data"));
- else
- mn_mailbox_set_has_new(MN_MAILBOX(mailbox), count != 0);
+#line 72 "mn-gmail-mailbox.gob"
+
+ mn_soup_unuse();
+ PARENT_HANDLER(object);
+ }}
+#line 243 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 77 "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"
+#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"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 259 "mn-gmail-mailbox.c"
+{
+#line 79 "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;
+ }}
+#line 272 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 90 "mn-gmail-mailbox.gob"
+static void
+___5_mn_gmail_mailbox_impl_check (MNMailbox * mailbox G_GNUC_UNUSED)
+#line 279 "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"
+ g_return_if_fail (mailbox != NULL);
+#line 90 "mn-gmail-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (mailbox));
+#line 289 "mn-gmail-mailbox.c"
+{
+#line 92 "mn-gmail-mailbox.gob"
+
+ Self *self = SELF(mailbox);
+
+ if (selfp->logged_in)
+ self_check_internal(self);
+ else
+ self_login(self);
+ }}
+#line 300 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 101 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_get (MNGmailMailbox * self, const char * uri, SoupCallbackFn callback)
+#line 307 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::get"
+#line 101 "mn-gmail-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 101 "mn-gmail-mailbox.gob"
+ g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
+#line 101 "mn-gmail-mailbox.gob"
+ g_return_if_fail (uri != NULL);
+#line 101 "mn-gmail-mailbox.gob"
+ g_return_if_fail (callback != NULL);
+#line 318 "mn-gmail-mailbox.c"
+{
+#line 105 "mn-gmail-mailbox.gob"
+
+ SoupContext *context;
+ SoupMessage *message;
+ char *cookie;
+
+ context = soup_context_get(uri);
+ message = soup_message_new(context, SOUP_METHOD_GET);
+ soup_context_unref(context);
+
+ soup_message_add_header(message->request_headers, "User-Agent", "Mail Notification");
+ cookie = self_build_cookie(self);
+ if (cookie)
+ {
+ soup_message_add_header(message->request_headers, "Cookie", cookie);
+ g_free(cookie);
+ }
+
+ soup_message_queue(message, callback, self);
+ /* message will be freed by libsoup after invoking the callback */
+ }}
+#line 341 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+/**
+ * mn_gmail_mailbox_get_token:
+ * @str: the string to search
+ * @pre: the start of the token
+ * @post: the end of the token
+ * @include_pre: whether to include @pre in the result or not
+ * @include_post: whether to include @post in the result or not
+ *
+ * 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.
+ **/
+#line 139 "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"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::get_token"
+#line 139 "mn-gmail-mailbox.gob"
+ g_return_val_if_fail (str != NULL, (char * )0);
+#line 139 "mn-gmail-mailbox.gob"
+ g_return_val_if_fail (pre != NULL, (char * )0);
+#line 139 "mn-gmail-mailbox.gob"
+ g_return_val_if_fail (post != NULL, (char * )0);
+#line 369 "mn-gmail-mailbox.c"
+{
+#line 145 "mn-gmail-mailbox.gob"
+
+ char *token = NULL;
+ char *pre_loc;
+
+ pre_loc = strstr(str, pre);
+ if (pre_loc)
+ {
+ char *after_pre_loc;
+ char *post_loc;
+
+ after_pre_loc = pre_loc + strlen(pre);
+ post_loc = strstr(after_pre_loc, post);
+ if (post_loc)
+ {
+ char *start = include_pre ? pre_loc : after_pre_loc;
+ char *end = include_post ? post_loc + strlen(post) : post_loc;
+
+ token = g_strndup(start, end - start);
+ }
+ }
+
+ return token;
+ }}
+#line 395 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 169 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_login (MNGmailMailbox * self)
+#line 401 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login"
+#line 169 "mn-gmail-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 169 "mn-gmail-mailbox.gob"
+ g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
+#line 408 "mn-gmail-mailbox.c"
+{
+#line 171 "mn-gmail-mailbox.gob"
+
+ char *uri;
+
+ g_return_if_fail(selfp->logged_in == FALSE);
+
+ if (selfp->cookies)
+ g_hash_table_destroy(selfp->cookies);
+ selfp->cookies = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+
+ mn_mailbox_notice(MN_MAILBOX(self), _("logging in"));
+
+ uri = g_strdup_printf("https://www.google.com/accounts/ServiceLoginBoxAuth?service=mail&continue=http://gmail.google.com/gmail&Email=%s&Passwd=%s", selfp->username, selfp->password);
+ self_get(self, uri, self_login_cb1);
+ g_free(uri);
+ }}
+#line 426 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 187 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_login_cb1 (SoupMessage * message, gpointer user_data)
+#line 432 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login_cb1"
+#line 187 "mn-gmail-mailbox.gob"
+ g_return_if_fail (message != NULL);
+#line 187 "mn-gmail-mailbox.gob"
+ g_return_if_fail (user_data != NULL);
+#line 439 "mn-gmail-mailbox.c"
+{
+#line 190 "mn-gmail-mailbox.gob"
+
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ char *body;
+ char *next_location;
+
+ self_update_cookies(self, message);
+
+ body = g_strndup(message->response.body, message->response.length);
+ next_location = self_get_token(body, "top.location = \"", "\"", FALSE, FALSE);
+ g_free(body);
+
+ if (next_location)
+ {
+ char *uri;
+
+ uri = g_strdup_printf("https://www.google.com/accounts/%s", next_location);
+ g_free(next_location);
+
+ self_get(self, uri, self_login_cb2);
+ g_free(uri);
+
+ return;
+ }
+
+ mn_mailbox_set_error(MN_MAILBOX(self), _("login failed"));
+ }
+
+ /* if this point is reached, an error occurred */
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }}
+#line 477 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 226 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_login_cb2 (SoupMessage * message, gpointer user_data)
+#line 483 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login_cb2"
+#line 226 "mn-gmail-mailbox.gob"
+ g_return_if_fail (message != NULL);
+#line 226 "mn-gmail-mailbox.gob"
+ g_return_if_fail (user_data != NULL);
+#line 490 "mn-gmail-mailbox.c"
+{
+#line 229 "mn-gmail-mailbox.gob"
+
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ char *body;
+ char *next_location;
+
+ self_update_cookies(self, message);
+
+ body = g_strndup(message->response.body, message->response.length);
+ next_location = self_get_token(body, "location.replace(\"", "\")", FALSE, FALSE);
+ g_free(body);
+
+ if (next_location)
+ {
+ self_get(self, next_location, self_login_cb3);
+ g_free(next_location);
+ return;
+ }
+
+ mn_mailbox_set_error(MN_MAILBOX(self), _("login failed"));
+ }
+
+ /* if this point is reached, an error occurred */
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }}
+#line 522 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 259 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_login_cb3 (SoupMessage * message, gpointer user_data)
+#line 528 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::login_cb3"
+#line 259 "mn-gmail-mailbox.gob"
+ g_return_if_fail (message != NULL);
+#line 259 "mn-gmail-mailbox.gob"
+ g_return_if_fail (user_data != NULL);
+#line 535 "mn-gmail-mailbox.c"
+{
+#line 262 "mn-gmail-mailbox.gob"
+
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ char *body;
+ char *token;
+
+ self_update_cookies(self, message);
+
+ body = g_strndup(message->response.body, message->response.length);
+ token = strstr(body, "frame name=js src=/gmail");
+
+ if (token)
+ {
+ selfp->logged_in = TRUE;
+ mn_mailbox_notice(MN_MAILBOX(self), _("successfully logged in"));
+ self_check_internal(self);
+
+ return;
+ }
+
+ mn_mailbox_set_error(MN_MAILBOX(self), _("login failed"));
+ }
+
+ /* if this point is reached, an error occurred */
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }}
+#line 568 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 293 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_update_cookies (MNGmailMailbox * self, SoupMessage * message)
+#line 574 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::update_cookies"
+#line 293 "mn-gmail-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 293 "mn-gmail-mailbox.gob"
+ g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
+#line 293 "mn-gmail-mailbox.gob"
+ g_return_if_fail (message != NULL);
+#line 583 "mn-gmail-mailbox.c"
+{
+#line 295 "mn-gmail-mailbox.gob"
+
+ const GSList *set_cookie_headers;
+ const GSList *l;
+
+ set_cookie_headers = soup_message_get_header_list(message->response_headers, "Set-Cookie");
+ MN_LIST_FOREACH(l, set_cookie_headers)
+ {
+ const char *value = l->data;
+ char *equal;
+
+ equal = strchr(value, '=');
+ if (equal)
+ {
+ char *end;
+ char *cookie_name;
+ char *cookie_value;
+
+ end = strchr(equal, ';');
+
+ cookie_name = g_strndup(value, equal - value);
+ cookie_value = end
+ ? g_strndup(equal + 1, end - equal - 1)
+ : g_strdup(equal + 1);
+
+ g_hash_table_insert(selfp->cookies, cookie_name, cookie_value);
+ }
+ }
+ }}
+#line 614 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 324 "mn-gmail-mailbox.gob"
+static char *
+mn_gmail_mailbox_build_cookie (MNGmailMailbox * self)
+#line 620 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::build_cookie"
+#line 324 "mn-gmail-mailbox.gob"
+ g_return_val_if_fail (self != NULL, (char * )0);
+#line 324 "mn-gmail-mailbox.gob"
+ g_return_val_if_fail (MN_IS_GMAIL_MAILBOX (self), (char * )0);
+#line 627 "mn-gmail-mailbox.c"
+{
+#line 326 "mn-gmail-mailbox.gob"
+
+ GString *cookie;
+ char *str;
+
+ cookie = g_string_new(NULL);
+ g_hash_table_foreach(selfp->cookies, self_build_cookie_cb, cookie);
+
+ if (*cookie->str)
+ str = g_string_free(cookie, FALSE);
+ else
+ {
+ str = NULL;
+ g_string_free(cookie, TRUE);
+ }
+
+ return str;
+ }}
+#line 647 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 344 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_build_cookie_cb (gpointer key, gpointer value, gpointer user_data)
+#line 653 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::build_cookie_cb"
+{
+#line 346 "mn-gmail-mailbox.gob"
+
+ GString *cookie = user_data;
+
+ if (*cookie->str)
+ g_string_append(cookie, "; ");
+
+ g_string_append_printf(cookie, "%s=%s", (const char *) key, (const char *) value);
+ }}
+#line 666 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 355 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_check_internal (MNGmailMailbox * self)
+#line 672 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::check_internal"
+#line 355 "mn-gmail-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 355 "mn-gmail-mailbox.gob"
+ g_return_if_fail (MN_IS_GMAIL_MAILBOX (self));
+#line 679 "mn-gmail-mailbox.c"
+{
+#line 357 "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 687 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 363 "mn-gmail-mailbox.gob"
+static void
+mn_gmail_mailbox_check_internal_cb (SoupMessage * message, gpointer user_data)
+#line 693 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::check_internal_cb"
+#line 363 "mn-gmail-mailbox.gob"
+ g_return_if_fail (message != NULL);
+#line 698 "mn-gmail-mailbox.c"
+{
+#line 366 "mn-gmail-mailbox.gob"
+
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ int count;
+
+ count = self_get_unread_count(message);
+ if (count == -1)
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to parse Gmail data"));
+ else
+ mn_mailbox_set_has_new(MN_MAILBOX(self), count != 0);
}
- mn_mailbox_end_check(MN_MAILBOX(mailbox));
-}
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }}
+#line 719 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
-static int
-mn_gmail_mailbox_get_unread_count (SoupMessage *message)
+#line 385 "mn-gmail-mailbox.gob"
+static int
+mn_gmail_mailbox_get_unread_count (SoupMessage * message)
+#line 725 "mn-gmail-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Gmail:Mailbox::get_unread_count"
+#line 385 "mn-gmail-mailbox.gob"
+ g_return_val_if_fail (message != NULL, (int )0);
+#line 730 "mn-gmail-mailbox.c"
{
- int count = -1;
- char *body;
- char *results;
+#line 387 "mn-gmail-mailbox.gob"
+
+ int count = -1;
+ char *body;
+ char *results;
- g_return_val_if_fail(message != NULL, -1);
-
- body = g_strndup(message->response.body, message->response.length);
-
- results = strstr(body, "Search results for: is:unread\",\"");
- if (results)
- {
- char *count_str;
-
- count_str = mn_gmail_mailbox_get_token(results + 32, "\",", "]", FALSE, FALSE);
- if (count_str)
- {
- if (mn_str_isnumeric(count_str))
- count = atoi(count_str);
- g_free(count_str);
- }
- }
+ body = g_strndup(message->response.body, message->response.length);
+
+ results = strstr(body, "Search results for: is:unread\",\"");
+ if (results)
+ {
+ char *count_str;
+
+ count_str = self_get_token(results + 32, "\",", "]", FALSE, FALSE);
+ if (count_str)
+ {
+ if (mn_str_isnumeric(count_str))
+ count = atoi(count_str);
+ g_free(count_str);
+ }
+ }
- g_free(body);
-
- return count;
-}
+ g_free(body);
+
+ return count;
+ }}
+#line 758 "mn-gmail-mailbox.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-gmail-mailbox.gob b/src/mn-gmail-mailbox.gob
@@ -0,0 +1,412 @@
+/*
+ * 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 "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <string.h>
+#include <stdlib.h>
+#include <glib/gi18n-lib.h>
+#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"
+%}
+
+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;
+
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->stock_id = MN_STOCK_GMAIL;
+ MN_MAILBOX_CLASS(class)->format = "Gmail";
+ }
+
+ override (G:Object) GObject *
+ 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;
+ }
+
+ override (G:Object) void
+ finalize (GObject *object)
+ {
+ mn_soup_unuse();
+ PARENT_HANDLER(object);
+ }
+
+ override (MN:Mailbox) gboolean
+ impl_is (MNMailbox *dummy, const char *uri (check null))
+ {
+ char *scheme;
+ gboolean is;
+
+ scheme = gnome_vfs_get_uri_scheme(uri);
+ is = scheme && ! strcmp(scheme, "gmail");
+ g_free(scheme);
+
+ return is;
+ }
+
+ override (MN:Mailbox) void
+ impl_check (MN:Mailbox *mailbox (check null type))
+ {
+ Self *self = SELF(mailbox);
+
+ if (selfp->logged_in)
+ self_check_internal(self);
+ else
+ self_login(self);
+ }
+
+ private void
+ get (self,
+ const char *uri (check null),
+ SoupCallbackFn callback (check null))
+ {
+ SoupContext *context;
+ SoupMessage *message;
+ char *cookie;
+
+ context = soup_context_get(uri);
+ message = soup_message_new(context, SOUP_METHOD_GET);
+ soup_context_unref(context);
+
+ soup_message_add_header(message->request_headers, "User-Agent", "Mail Notification");
+ cookie = self_build_cookie(self);
+ if (cookie)
+ {
+ soup_message_add_header(message->request_headers, "Cookie", cookie);
+ g_free(cookie);
+ }
+
+ soup_message_queue(message, callback, self);
+ /* message will be freed by libsoup after invoking the callback */
+ }
+
+ /**
+ * get_token:
+ * @str: the string to search
+ * @pre: the start of the token
+ * @post: the end of the token
+ * @include_pre: whether to include @pre in the result or not
+ * @include_post: whether to include @post in the result or not
+ *
+ * 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.
+ */
+ private char *
+ get_token (const char *str (check null),
+ const char *pre (check null),
+ const char *post (check null),
+ gboolean include_pre,
+ gboolean include_post)
+ {
+ char *token = NULL;
+ char *pre_loc;
+
+ pre_loc = strstr(str, pre);
+ if (pre_loc)
+ {
+ char *after_pre_loc;
+ char *post_loc;
+
+ after_pre_loc = pre_loc + strlen(pre);
+ post_loc = strstr(after_pre_loc, post);
+ if (post_loc)
+ {
+ char *start = include_pre ? pre_loc : after_pre_loc;
+ char *end = include_post ? post_loc + strlen(post) : post_loc;
+
+ token = g_strndup(start, end - start);
+ }
+ }
+
+ return token;
+ }
+
+ private void
+ login (self)
+ {
+ char *uri;
+
+ g_return_if_fail(selfp->logged_in == FALSE);
+
+ if (selfp->cookies)
+ g_hash_table_destroy(selfp->cookies);
+ selfp->cookies = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+
+ mn_mailbox_notice(MN_MAILBOX(self), _("logging in"));
+
+ uri = g_strdup_printf("https://www.google.com/accounts/ServiceLoginBoxAuth?service=mail&continue=http://gmail.google.com/gmail&Email=%s&Passwd=%s", selfp->username, selfp->password);
+ self_get(self, uri, self_login_cb1);
+ g_free(uri);
+ }
+
+ private void
+ login_cb1 (SoupMessage *message (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ char *body;
+ char *next_location;
+
+ self_update_cookies(self, message);
+
+ body = g_strndup(message->response.body, message->response.length);
+ next_location = self_get_token(body, "top.location = \"", "\"", FALSE, FALSE);
+ g_free(body);
+
+ if (next_location)
+ {
+ char *uri;
+
+ uri = g_strdup_printf("https://www.google.com/accounts/%s", next_location);
+ g_free(next_location);
+
+ self_get(self, uri, self_login_cb2);
+ g_free(uri);
+
+ return;
+ }
+
+ mn_mailbox_set_error(MN_MAILBOX(self), _("login failed"));
+ }
+
+ /* if this point is reached, an error occurred */
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }
+
+ private void
+ login_cb2 (SoupMessage *message (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ char *body;
+ char *next_location;
+
+ self_update_cookies(self, message);
+
+ body = g_strndup(message->response.body, message->response.length);
+ next_location = self_get_token(body, "location.replace(\"", "\")", FALSE, FALSE);
+ g_free(body);
+
+ if (next_location)
+ {
+ self_get(self, next_location, self_login_cb3);
+ g_free(next_location);
+ return;
+ }
+
+ mn_mailbox_set_error(MN_MAILBOX(self), _("login failed"));
+ }
+
+ /* if this point is reached, an error occurred */
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }
+
+ private void
+ login_cb3 (SoupMessage *message (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ char *body;
+ char *token;
+
+ self_update_cookies(self, message);
+
+ body = g_strndup(message->response.body, message->response.length);
+ token = strstr(body, "frame name=js src=/gmail");
+
+ if (token)
+ {
+ selfp->logged_in = TRUE;
+ mn_mailbox_notice(MN_MAILBOX(self), _("successfully logged in"));
+ self_check_internal(self);
+
+ return;
+ }
+
+ mn_mailbox_set_error(MN_MAILBOX(self), _("login failed"));
+ }
+
+ /* if this point is reached, an error occurred */
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }
+
+ private void
+ update_cookies (self, SoupMessage *message (check null))
+ {
+ const GSList *set_cookie_headers;
+ const GSList *l;
+
+ set_cookie_headers = soup_message_get_header_list(message->response_headers, "Set-Cookie");
+ MN_LIST_FOREACH(l, set_cookie_headers)
+ {
+ const char *value = l->data;
+ char *equal;
+
+ equal = strchr(value, '=');
+ if (equal)
+ {
+ char *end;
+ char *cookie_name;
+ char *cookie_value;
+
+ end = strchr(equal, ';');
+
+ cookie_name = g_strndup(value, equal - value);
+ cookie_value = end
+ ? g_strndup(equal + 1, end - equal - 1)
+ : g_strdup(equal + 1);
+
+ g_hash_table_insert(selfp->cookies, cookie_name, cookie_value);
+ }
+ }
+ }
+
+ private char *
+ build_cookie (self)
+ {
+ GString *cookie;
+ char *str;
+
+ cookie = g_string_new(NULL);
+ g_hash_table_foreach(selfp->cookies, self_build_cookie_cb, cookie);
+
+ if (*cookie->str)
+ str = g_string_free(cookie, FALSE);
+ else
+ {
+ str = NULL;
+ g_string_free(cookie, TRUE);
+ }
+
+ return str;
+ }
+
+ private void
+ build_cookie_cb (gpointer key, gpointer value, gpointer user_data)
+ {
+ GString *cookie = user_data;
+
+ if (*cookie->str)
+ g_string_append(cookie, "; ");
+
+ g_string_append_printf(cookie, "%s=%s", (const char *) key, (const char *) value);
+ }
+
+ private void
+ check_internal (self)
+ {
+ 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);
+ }
+
+ private void
+ check_internal_cb (SoupMessage *message (check null),
+ gpointer user_data)
+ {
+ Self *self = user_data;
+
+ if (SOUP_MESSAGE_IS_ERROR(message))
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to transfer data: %s"), message->errorphrase);
+ else
+ {
+ int count;
+
+ count = self_get_unread_count(message);
+ if (count == -1)
+ mn_mailbox_set_error(MN_MAILBOX(self), _("unable to parse Gmail data"));
+ else
+ mn_mailbox_set_has_new(MN_MAILBOX(self), count != 0);
+ }
+
+ mn_mailbox_end_check(MN_MAILBOX(self));
+ }
+
+ private int
+ get_unread_count (SoupMessage *message (check null))
+ {
+ int count = -1;
+ char *body;
+ char *results;
+
+ body = g_strndup(message->response.body, message->response.length);
+
+ results = strstr(body, "Search results for: is:unread\",\"");
+ if (results)
+ {
+ char *count_str;
+
+ count_str = self_get_token(results + 32, "\",", "]", FALSE, FALSE);
+ if (count_str)
+ {
+ if (mn_str_isnumeric(count_str))
+ count = atoi(count_str);
+ g_free(count_str);
+ }
+ }
+
+ g_free(body);
+
+ return count;
+ }
+}
diff --git a/src/mn-gmail-mailbox.h b/src/mn-gmail-mailbox.h
@@ -1,48 +1,62 @@
-/*
- * 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.
- */
-
-#ifndef _MN_GMAIL_MAILBOX_H
-#define _MN_GMAIL_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_GMAIL_MAILBOX (mn_gmail_mailbox_get_type())
-#define MN_GMAIL_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_GMAIL_MAILBOX, MNGmailMailbox))
-#define MN_GMAIL_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_GMAIL_MAILBOX, MNGmailMailboxClass))
-#define MN_IS_GMAIL_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_GMAIL_MAILBOX))
-#define MN_IS_GMAIL_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_GMAIL_MAILBOX))
-#define MN_GMAIL_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_GMAIL_MAILBOX, MNGmailMailboxClass))
+#ifndef __MN_GMAIL_MAILBOX_H__
+#define __MN_GMAIL_MAILBOX_H__
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_GMAIL_MAILBOX (mn_gmail_mailbox_get_type())
+#define MN_GMAIL_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_gmail_mailbox_get_type(), MNGmailMailbox)
+#define MN_GMAIL_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_gmail_mailbox_get_type(), MNGmailMailbox const)
+#define MN_GMAIL_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_gmail_mailbox_get_type(), MNGmailMailboxClass)
+#define MN_IS_GMAIL_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_gmail_mailbox_get_type ())
+
+#define MN_GMAIL_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_gmail_mailbox_get_type(), MNGmailMailboxClass)
+
+/* Private structure type */
typedef struct _MNGmailMailboxPrivate MNGmailMailboxPrivate;
-typedef struct
-{
- MNMailbox mailbox;
-
- MNGmailMailboxPrivate *priv;
-} MNGmailMailbox;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_GMAIL_MAILBOX__
+#define __TYPEDEF_MN_GMAIL_MAILBOX__
+typedef struct _MNGmailMailbox MNGmailMailbox;
+#endif
+struct _MNGmailMailbox {
+ MNMailbox __parent__;
+ /*< private >*/
+ MNGmailMailboxPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNGmailMailboxClass MNGmailMailboxClass;
+struct _MNGmailMailboxClass {
+ MNMailboxClass __parent__;
+};
+
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNGmailMailboxClass;
+/*
+ * Public methods
+ */
+GType mn_gmail_mailbox_get_type (void);
-GType mn_gmail_mailbox_get_type (void);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
-#endif /* _MN_GMAIL_MAILBOX_H */
+#endif
diff --git a/src/mn-imap-mailbox-private.h b/src/mn-imap-mailbox-private.h
@@ -0,0 +1,34 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_IMAP_MAILBOX_PRIVATE_H__
+#define __MN_IMAP_MAILBOX_PRIVATE_H__
+
+#include "mn-imap-mailbox.h"
+
+#ifdef __cplusplus
+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
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-imap-mailbox-properties-private.h b/src/mn-imap-mailbox-properties-private.h
@@ -0,0 +1,26 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_IMAP_MAILBOX_PROPERTIES_PRIVATE_H__
+#define __MN_IMAP_MAILBOX_PROPERTIES_PRIVATE_H__
+
+#include "mn-imap-mailbox-properties.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNIMAPMailboxPropertiesPrivate {
+#line 66 "mn-imap-mailbox-properties.gob"
+ GtkWidget * inbox_radio;
+#line 67 "mn-imap-mailbox-properties.gob"
+ GtkWidget * other_radio;
+#line 68 "mn-imap-mailbox-properties.gob"
+ GtkWidget * mailbox_entry;
+#line 20 "mn-imap-mailbox-properties-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-imap-mailbox-properties.c b/src/mn-imap-mailbox-properties.c
@@ -0,0 +1,440 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-imap-mailbox-properties.h"
+
+#include "mn-imap-mailbox-properties-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 22 "mn-imap-mailbox-properties.gob"
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#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"
+/* self casting macros */
+#define SELF(x) MN_IMAP_MAILBOX_PROPERTIES(x)
+#define SELF_CONST(x) MN_IMAP_MAILBOX_PROPERTIES_CONST(x)
+#define IS_SELF(x) MN_IS_IMAP_MAILBOX_PROPERTIES(x)
+#define TYPE_SELF MN_TYPE_IMAP_MAILBOX_PROPERTIES
+#define SELF_CLASS(x) MN_IMAP_MAILBOX_PROPERTIES_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_IMAP_MAILBOX_PROPERTIES_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNIMAPMailboxProperties Self;
+typedef MNIMAPMailboxPropertiesClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void mn_imap_mailbox_properties_init (MNIMAPMailboxProperties * o) G_GNUC_UNUSED;
+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;
+
+enum {
+ PROP_0,
+ PROP_COMPLETE
+};
+
+/* pointer to the class of our parent */
+static MNPIMailboxPropertiesClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_radio_toggled_h mn_imap_mailbox_properties_radio_toggled_h
+#define self_set_uri mn_imap_mailbox_properties_set_uri
+#define self_get_uri mn_imap_mailbox_properties_get_uri
+
+
+static void
+___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
+{
+#line 146 "mn-imap-mailbox-properties.gob"
+ iface->set_uri = self_set_uri;
+#line 189 "mn-imap-mailbox-properties.gob"
+ iface->get_uri = self_get_uri;
+#line 80 "mn-imap-mailbox-properties.c"
+}
+
+GType
+mn_imap_mailbox_properties_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNIMAPMailboxPropertiesClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_imap_mailbox_properties_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNIMAPMailboxProperties),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_imap_mailbox_properties_init,
+ NULL
+ };
+
+ static const GInterfaceInfo MN_Mailbox_Properties_info = {
+ (GInterfaceInitFunc) ___MN_Mailbox_Properties_init,
+ NULL,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_PI_MAILBOX_PROPERTIES, "MNIMAPMailboxProperties", &info, (GTypeFlags)0);
+ g_type_add_interface_static (type,
+ MN_TYPE_MAILBOX_PROPERTIES,
+ &MN_Mailbox_Properties_info);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNIMAPMailboxProperties *)g_object_new(mn_imap_mailbox_properties_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNIMAPMailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNIMAPMailboxProperties *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNIMAPMailboxProperties *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNIMAPMailboxProperties *)g_object_new_valist (mn_imap_mailbox_properties_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___finalize(GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::finalize"
+ MNIMAPMailboxProperties *self G_GNUC_UNUSED = MN_IMAP_MAILBOX_PROPERTIES (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
+
+static void
+mn_imap_mailbox_properties_init (MNIMAPMailboxProperties * o G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::init"
+ o->_priv = g_new0 (MNIMAPMailboxPropertiesPrivate, 1);
+}
+#undef __GOB_FUNCTION__
+#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"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+
+ parent_class = g_type_class_ref (MN_TYPE_PI_MAILBOX_PROPERTIES);
+
+#line 79 "mn-imap-mailbox-properties.gob"
+ g_object_class->constructor = ___2_mn_imap_mailbox_properties_constructor;
+#line 166 "mn-imap-mailbox-properties.c"
+ g_object_class->finalize = ___finalize;
+ g_object_class->get_property = ___object_get_property;
+ {
+ g_object_class_override_property (g_object_class,
+ PROP_COMPLETE,
+ "complete");
+ }
+ {
+#line 71 "mn-imap-mailbox-properties.gob"
+
+ 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);
+
+#line 183 "mn-imap-mailbox-properties.c"
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::get_property"
+{
+ MNIMAPMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_IMAP_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_COMPLETE:
+ {
+#line 37 "mn-imap-mailbox-properties.gob"
+
+ MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
+ gboolean complete;
+ const char *username;
+ const char *password;
+ const char *hostname;
+ gboolean other_active;
+ const char *mailbox;
+
+ mn_pi_mailbox_properties_get_contents(pi,
+ NULL,
+ &username,
+ &password,
+ NULL,
+ &hostname,
+ NULL);
+
+ other_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(selfp->other_radio));
+ mailbox = gtk_entry_get_text(GTK_ENTRY(selfp->mailbox_entry));
+
+ complete = *username && *password && *hostname && (! other_active || *mailbox);
+#ifndef WITH_SSL
+ if (complete)
+ complete = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pi->conn_radio[0]));
+#endif /* WITH_SSL */
+
+ g_value_set_boolean(VAL, complete);
+
+#line 231 "mn-imap-mailbox-properties.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 79 "mn-imap-mailbox-properties.gob"
+static GObject *
+___2_mn_imap_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
+#line 251 "mn-imap-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): \
+ ((GObject * )0))
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::constructor"
+{
+#line 81 "mn-imap-mailbox-properties.gob"
+
+ GObject *object;
+ Self *self;
+ MNPIMailboxProperties *pi;
+ GtkWidget *hbox;
+ GtkWidget *label;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+ pi = MN_PI_MAILBOX_PROPERTIES(object);
+
+ label = gtk_label_new(_("Mailbox:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_size_group_add_widget(pi->details_size_group, label);
+
+ selfp->inbox_radio = gtk_radio_button_new_with_mnemonic(NULL, _("in_box"));
+
+ hbox = gtk_hbox_new(FALSE, 12);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->inbox_radio, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(pi->details_vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(hbox);
+
+ label = gtk_label_new(NULL);
+ gtk_size_group_add_widget(pi->details_size_group, label);
+
+ 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);
+
+ hbox = gtk_hbox_new(FALSE, 12);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->other_radio, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->mailbox_entry, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(pi->details_vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(hbox);
+
+ mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+LOGIN", "IMAP LOGIN");
+
+ mn_tooltips_set_tips(pi->tooltips,
+ pi->hostname_entry, _("The hostname or IP address of the IMAP server"),
+ pi->username_entry, _("Your username on the IMAP server"),
+ pi->password_entry, _("Your password on the IMAP server"),
+ pi->port_spin[0], _("The port number of the IMAP server"),
+ pi->port_spin[1], _("The port number of the IMAP server"),
+ selfp->mailbox_entry, _("The mailbox name"),
+ NULL);
+
+ g_signal_connect(G_OBJECT(selfp->inbox_radio), "toggled", G_CALLBACK(self_radio_toggled_h), self);
+ g_signal_connect(G_OBJECT(selfp->other_radio), "toggled", G_CALLBACK(self_radio_toggled_h), self);
+ g_signal_connect(G_OBJECT(selfp->mailbox_entry), "changed", G_CALLBACK(mn_pi_mailbox_properties_entry_changed_h), self);
+
+ return object;
+ }}
+#line 314 "mn-imap-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 136 "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"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::radio_toggled_h"
+#line 136 "mn-imap-mailbox-properties.gob"
+ g_return_if_fail (togglebutton != NULL);
+#line 136 "mn-imap-mailbox-properties.gob"
+ g_return_if_fail (GTK_IS_TOGGLE_BUTTON (togglebutton));
+#line 136 "mn-imap-mailbox-properties.gob"
+ g_return_if_fail (user_data != NULL);
+#line 330 "mn-imap-mailbox-properties.c"
+{
+#line 139 "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"
+#undef __GOB_FUNCTION__
+
+#line 146 "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"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox:Properties::set_uri"
+#line 146 "mn-imap-mailbox-properties.gob"
+ g_return_val_if_fail (properties != NULL, (gboolean )0);
+#line 146 "mn-imap-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (properties), (gboolean )0);
+#line 146 "mn-imap-mailbox-properties.gob"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 354 "mn-imap-mailbox-properties.c"
+{
+#line 149 "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))
+ {
+ mn_pi_mailbox_properties_set_contents(MN_PI_MAILBOX_PROPERTIES(properties),
+ ssl,
+ username,
+ password,
+ authmech,
+ hostname,
+ port);
+
+ if (! strcmp(mailbox, "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);
+ }
+
+ 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"
+#undef __GOB_FUNCTION__
+
+#line 189 "mn-imap-mailbox-properties.gob"
+static char *
+mn_imap_mailbox_properties_get_uri (MNMailboxProperties * properties)
+#line 402 "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 191 "mn-imap-mailbox-properties.gob"
+
+ Self *self = SELF(properties);
+ gboolean ssl;
+ const char *username;
+ const char *password;
+ char *authmech;
+ const char *hostname;
+ int port;
+ const char *mailbox = NULL;
+ char *uri;
+
+ mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
+ &ssl,
+ &username,
+ &password,
+ &authmech,
+ &hostname,
+ &port);
+
+ mailbox = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(selfp->inbox_radio))
+ ? "INBOX"
+ : gtk_entry_get_text(GTK_ENTRY(selfp->mailbox_entry));
+
+ uri = mn_uri_build_imap(ssl, username, password, authmech, hostname, port, mailbox);
+ g_free(authmech);
+
+ return uri;
+ }}
+#line 440 "mn-imap-mailbox-properties.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-imap-mailbox-properties.gob b/src/mn-imap-mailbox-properties.gob
@@ -0,0 +1,219 @@
+/*
+ * 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 "mn-pi-mailbox-properties.h"
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#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"
+%}
+
+class MN:IMAP:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mailbox:Properties)
+{
+ property BOOLEAN complete (override)
+ get
+ {
+ MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
+ gboolean complete;
+ const char *username;
+ const char *password;
+ const char *hostname;
+ gboolean other_active;
+ const char *mailbox;
+
+ mn_pi_mailbox_properties_get_contents(pi,
+ NULL,
+ &username,
+ &password,
+ NULL,
+ &hostname,
+ NULL);
+
+ other_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(selfp->other_radio));
+ mailbox = gtk_entry_get_text(GTK_ENTRY(selfp->mailbox_entry));
+
+ complete = *username && *password && *hostname && (! other_active || *mailbox);
+#ifndef WITH_SSL
+ if (complete)
+ complete = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pi->conn_radio[0]));
+#endif /* WITH_SSL */
+
+ g_value_set_boolean(VAL, complete);
+ };
+
+ private GtkWidget *inbox_radio;
+ private GtkWidget *other_radio;
+ private GtkWidget *mailbox_entry;
+
+ class_init (class)
+ {
+ 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);
+ }
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ Self *self;
+ MNPIMailboxProperties *pi;
+ GtkWidget *hbox;
+ GtkWidget *label;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+ pi = MN_PI_MAILBOX_PROPERTIES(object);
+
+ label = gtk_label_new(_("Mailbox:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_size_group_add_widget(pi->details_size_group, label);
+
+ selfp->inbox_radio = gtk_radio_button_new_with_mnemonic(NULL, _("in_box"));
+
+ hbox = gtk_hbox_new(FALSE, 12);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->inbox_radio, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(pi->details_vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(hbox);
+
+ label = gtk_label_new(NULL);
+ gtk_size_group_add_widget(pi->details_size_group, label);
+
+ 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);
+
+ hbox = gtk_hbox_new(FALSE, 12);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->other_radio, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), selfp->mailbox_entry, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(pi->details_vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(hbox);
+
+ mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+LOGIN", "IMAP LOGIN");
+
+ mn_tooltips_set_tips(pi->tooltips,
+ pi->hostname_entry, _("The hostname or IP address of the IMAP server"),
+ pi->username_entry, _("Your username on the IMAP server"),
+ pi->password_entry, _("Your password on the IMAP server"),
+ pi->port_spin[0], _("The port number of the IMAP server"),
+ pi->port_spin[1], _("The port number of the IMAP server"),
+ selfp->mailbox_entry, _("The mailbox name"),
+ NULL);
+
+ g_signal_connect(G_OBJECT(selfp->inbox_radio), "toggled", G_CALLBACK(self_radio_toggled_h), self);
+ g_signal_connect(G_OBJECT(selfp->other_radio), "toggled", G_CALLBACK(self_radio_toggled_h), self);
+ g_signal_connect(G_OBJECT(selfp->mailbox_entry), "changed", G_CALLBACK(mn_pi_mailbox_properties_entry_changed_h), self);
+
+ return object;
+ }
+
+ private void
+ radio_toggled_h (Gtk:Toggle:Button *togglebutton (check null type),
+ gpointer user_data (check null))
+ {
+ 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");
+ }
+
+ interface MN:Mailbox:Properties private gboolean
+ set_uri (MN:Mailbox:Properties *properties (check null type),
+ const char *uri (check null))
+ {
+ 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))
+ {
+ mn_pi_mailbox_properties_set_contents(MN_PI_MAILBOX_PROPERTIES(properties),
+ ssl,
+ username,
+ password,
+ authmech,
+ hostname,
+ port);
+
+ if (! strcmp(mailbox, "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);
+ }
+
+ 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 *
+ get_uri (MN:Mailbox:Properties *properties (check null type))
+ {
+ Self *self = SELF(properties);
+ gboolean ssl;
+ const char *username;
+ const char *password;
+ char *authmech;
+ const char *hostname;
+ int port;
+ const char *mailbox = NULL;
+ char *uri;
+
+ mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
+ &ssl,
+ &username,
+ &password,
+ &authmech,
+ &hostname,
+ &port);
+
+ mailbox = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(selfp->inbox_radio))
+ ? "INBOX"
+ : gtk_entry_get_text(GTK_ENTRY(selfp->mailbox_entry));
+
+ uri = mn_uri_build_imap(ssl, username, password, authmech, hostname, port, mailbox);
+ g_free(authmech);
+
+ return uri;
+ }
+}
diff --git a/src/mn-imap-mailbox-properties.h b/src/mn-imap-mailbox-properties.h
@@ -0,0 +1,72 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include "mn-pi-mailbox-properties.h"
+
+#ifndef __MN_IMAP_MAILBOX_PROPERTIES_H__
+#define __MN_IMAP_MAILBOX_PROPERTIES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_IMAP_MAILBOX_PROPERTIES (mn_imap_mailbox_properties_get_type())
+#define MN_IMAP_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_imap_mailbox_properties_get_type(), MNIMAPMailboxProperties)
+#define MN_IMAP_MAILBOX_PROPERTIES_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_imap_mailbox_properties_get_type(), MNIMAPMailboxProperties const)
+#define MN_IMAP_MAILBOX_PROPERTIES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_imap_mailbox_properties_get_type(), MNIMAPMailboxPropertiesClass)
+#define MN_IS_IMAP_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_imap_mailbox_properties_get_type ())
+
+#define MN_IMAP_MAILBOX_PROPERTIES_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_imap_mailbox_properties_get_type(), MNIMAPMailboxPropertiesClass)
+
+/* Private structure type */
+typedef struct _MNIMAPMailboxPropertiesPrivate MNIMAPMailboxPropertiesPrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_IMAP_MAILBOX_PROPERTIES__
+#define __TYPEDEF_MN_IMAP_MAILBOX_PROPERTIES__
+typedef struct _MNIMAPMailboxProperties MNIMAPMailboxProperties;
+#endif
+struct _MNIMAPMailboxProperties {
+ MNPIMailboxProperties __parent__;
+ /*< private >*/
+ MNIMAPMailboxPropertiesPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNIMAPMailboxPropertiesClass MNIMAPMailboxPropertiesClass;
+struct _MNIMAPMailboxPropertiesClass {
+ MNPIMailboxPropertiesClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_imap_mailbox_properties_get_type (void);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_IMAP_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete", __extension__ ({gboolean *z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_IMAP_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete",(gboolean *)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-imap-mailbox.c b/src/mn-imap-mailbox.c
@@ -0,0 +1,1095 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-imap-mailbox.h"
+
+#include "mn-imap-mailbox-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 25 "mn-imap-mailbox.gob"
+
+#include "config.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <glib/gi18n-lib.h>
+#include <libgnomevfs/gnome-vfs-utils.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))
+#define IS(response, token) (! strcmp((response)->response, (token)))
+#define IS_OK(response) IS(response, "OK")
+#define IS_NO(response) IS(response, "NO")
+#define IS_BAD(response) IS(response, "BAD")
+#define IS_BYE(response) IS(response, "BYE")
+
+ enum
+ {
+ STATE_GREETING = MN_CLIENT_SESSION_INITIAL_STATE,
+ STATE_CAPABILITY,
+#ifdef WITH_SASL
+ STATE_AUTHENTICATE,
+#endif
+ STATE_LOGIN,
+ STATE_STATUS,
+ STATE_LOGOUT
+ };
+
+ enum
+ {
+ RESULT_ERROR_LOGOUT = -1, /* server reported an error, logout normally */
+ RESULT_ERROR_END = -2, /* server reported an error, close the connection */
+ RESULT_DEFAULT_HANDLER = -3 /* invoke the default response handler */
+ };
+
+ struct _MNClientSessionPrivate
+ {
+ MNIMAPMailbox *mailbox;
+ MNClientSession *session;
+ int numeric_tag;
+ char *tag;
+ char **capabilities;
+ GSList *auth_mechanisms;
+ gboolean status_received;
+#ifdef WITH_SASL
+ const char *sasl_mechanism;
+#endif
+ };
+
+ struct _MNClientSessionResponse
+ {
+ char *continuation;
+ char *tag;
+ char *response;
+ char *code;
+ char *arguments;
+ };
+
+#line 87 "mn-imap-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_IMAP_MAILBOX(x)
+#define SELF_CONST(x) MN_IMAP_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_IMAP_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_IMAP_MAILBOX
+#define SELF_CLASS(x) MN_IMAP_MAILBOX_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_IMAP_MAILBOX_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNIMAPMailbox Self;
+typedef MNIMAPMailboxClass SelfClass;
+
+/* here are local prototypes */
+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 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_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;
+static int mn_imap_mailbox_handle_login_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_imap_mailbox_enter_status_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+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 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;
+static int mn_imap_mailbox_custom_handler_cb (MNClientSession * session, MNClientSessionResponse * response, int result, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static void mn_imap_mailbox_session_set_error_from_arguments (MNClientSessionPrivate * priv, MNClientSessionResponse * response) G_GNUC_UNUSED;
+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_authenticate (MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_imap_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
+
+/* Short form macros */
+#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_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
+#define self_handle_login_cb mn_imap_mailbox_handle_login_cb
+#define self_enter_status_cb mn_imap_mailbox_enter_status_cb
+#define self_handle_status_cb mn_imap_mailbox_handle_status_cb
+#define self_enter_logout_cb mn_imap_mailbox_enter_logout_cb
+#define self_handle_logout_cb mn_imap_mailbox_handle_logout_cb
+#define self_notice_cb mn_imap_mailbox_notice_cb
+#define self_response_new_cb mn_imap_mailbox_response_new_cb
+#define self_response_free_cb mn_imap_mailbox_response_free_cb
+#define self_custom_handler_cb mn_imap_mailbox_custom_handler_cb
+#define self_session_set_error_from_arguments mn_imap_mailbox_session_set_error_from_arguments
+#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_authenticate mn_imap_mailbox_session_authenticate
+#define self_session_authenticate_fallback mn_imap_mailbox_session_authenticate_fallback
+GType
+mn_imap_mailbox_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNIMAPMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_imap_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNIMAPMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_imap_mailbox_init,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNIMAPMailbox", &info, (GTypeFlags)0);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNIMAPMailbox *)g_object_new(mn_imap_mailbox_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNIMAPMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNIMAPMailbox *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNIMAPMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNIMAPMailbox *)g_object_new_valist (mn_imap_mailbox_get_type (), first, ap);
+ va_end (ap);
+ 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 207 "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 210 "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 213 "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 216 "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 219 "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"
+static void
+mn_imap_mailbox_class_init (MNIMAPMailboxClass * class G_GNUC_UNUSED)
+#line 234 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+ MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
+
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
+
+#line 102 "mn-imap-mailbox.gob"
+ g_object_class->constructor = ___2_mn_imap_mailbox_constructor;
+#line 133 "mn-imap-mailbox.gob"
+ mn_mailbox_class->impl_is = ___3_mn_imap_mailbox_impl_is;
+#line 374 "mn-imap-mailbox.gob"
+ mn_mailbox_class->impl_threaded_check = ___f_mn_imap_mailbox_impl_threaded_check;
+#line 248 "mn-imap-mailbox.c"
+ g_object_class->finalize = ___finalize;
+ {
+#line 98 "mn-imap-mailbox.gob"
+
+ MN_MAILBOX_CLASS(class)->format = "IMAP";
+
+#line 255 "mn-imap-mailbox.c"
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 102 "mn-imap-mailbox.gob"
+static GObject *
+___2_mn_imap_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
+#line 265 "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): \
+ ((GObject * )0))
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::constructor"
+{
+#line 104 "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"));
+#endif /* WITH_SSL */
+ }
+ else
+ mn_mailbox_set_init_error(mailbox, _("unable to parse IMAP URI"));
+
+ return object;
+ }}
+#line 302 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 133 "mn-imap-mailbox.gob"
+static gboolean
+___3_mn_imap_mailbox_impl_is (MNMailbox * dummy G_GNUC_UNUSED, const char * uri)
+#line 309 "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"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 318 "mn-imap-mailbox.c"
+{
+#line 135 "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;
+ }}
+#line 331 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 146 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 338 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_greeting_cb"
+#line 146 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 146 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 146 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 347 "mn-imap-mailbox.c"
+{
+#line 150 "mn-imap-mailbox.gob"
+
+ priv->session = session;
+
+ if (! response->tag && IS_OK(response))
+ {
+ if (response->code)
+ {
+ if (! strcmp(response->code, "CAPABILITY"))
+ self_session_parse_capabilities(priv, NULL);
+ else if (! strncmp(response->code, "CAPABILITY ", 11))
+ self_session_parse_capabilities(priv, response->code + 11);
+ }
+
+ return priv->capabilities
+ ? self_session_authenticate(priv)
+ : STATE_CAPABILITY;
+ }
+ else if (! response->tag && IS(response, "PREAUTH"))
+ return STATE_STATUS;
+ else if (! response->tag && IS_BYE(response))
+ return RESULT_ERROR_END;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }}
+#line 374 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 175 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_enter_capability_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 380 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_capability_cb"
+#line 175 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 175 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 387 "mn-imap-mailbox.c"
+{
+#line 178 "mn-imap-mailbox.gob"
+
+ return self_session_write(priv, "CAPABILITY");
+ }}
+#line 393 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 182 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_handle_capability_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 399 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_capability_cb"
+#line 182 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 182 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 182 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 408 "mn-imap-mailbox.c"
+{
+#line 186 "mn-imap-mailbox.gob"
+
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ return priv->capabilities
+ ? self_session_authenticate(priv)
+ : mn_client_session_error(session, _("server did not send capabilities"));
+ }
+ else if (IS_BAD(response))
+ return RESULT_ERROR_LOGOUT;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+ else if (IS(response, "CAPABILITY"))
+ {
+ self_session_parse_capabilities(priv, response->arguments);
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+ }}
+#line 436 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 212 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_enter_authenticate_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 442 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_authenticate_cb"
+#line 212 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 212 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 449 "mn-imap-mailbox.c"
+{
+#line 215 "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->sasl_mechanism))
+ return self_session_write(priv, "AUTHENTICATE %s", priv->sasl_mechanism);
+ else
+ return self_session_authenticate_fallback(priv);
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }}
+#line 466 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 230 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_handle_authenticate_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 472 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_authenticate_cb"
+#line 230 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 230 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 230 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 481 "mn-imap-mailbox.c"
+{
+#line 234 "mn-imap-mailbox.gob"
+
+#ifdef WITH_SASL
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ return mn_client_session_sasl_authentication_done(session)
+ ? STATE_STATUS
+ : MN_CLIENT_SESSION_RESULT_END;
+ }
+ else if (IS_NO(response) || IS_BAD(response))
+ return self_session_authenticate_fallback(priv);
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+ else if (response->continuation)
+ return mn_client_session_sasl_authentication_step(session, response->continuation);
+
+ return RESULT_DEFAULT_HANDLER;
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }}
+#line 510 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 261 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_enter_login_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 516 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_login_cb"
+#line 261 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 261 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 523 "mn-imap-mailbox.c"
+{
+#line 264 "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;
+ }
+ else
+ return self_session_write(priv, "LOGIN %s %s",
+ priv->mailbox->_priv->username,
+ priv->mailbox->_priv->password);
+ }}
+#line 538 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 277 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_handle_login_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 544 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_login_cb"
+#line 277 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 277 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 277 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 553 "mn-imap-mailbox.c"
+{
+#line 281 "mn-imap-mailbox.gob"
+
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ return STATE_STATUS;
+ else if (IS_NO(response) || IS_BAD(response))
+ return RESULT_ERROR_LOGOUT;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+ }}
+#line 572 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 298 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_enter_status_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 578 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_status_cb"
+#line 298 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 298 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 585 "mn-imap-mailbox.c"
+{
+#line 301 "mn-imap-mailbox.gob"
+
+ return self_session_write(priv, "STATUS \"%s\" (UNSEEN)", priv->mailbox->_priv->mailbox);
+ }}
+#line 591 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 305 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_handle_status_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 597 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_status_cb"
+#line 305 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 305 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 305 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 606 "mn-imap-mailbox.c"
+{
+#line 309 "mn-imap-mailbox.gob"
+
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ if (priv->status_received)
+ return STATE_LOGOUT;
+ else /* compliance error */
+ return mn_client_session_error(session, _("server did not send status"));
+ }
+ else if (IS_NO(response) || IS_BAD(response))
+ return RESULT_ERROR_LOGOUT;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+ else if (IS(response, "STATUS"))
+ {
+ int count;
+
+ if (response->arguments && sscanf(response->arguments, "%*s (UNSEEN %i)", &count) == 1)
+ {
+ priv->status_received = TRUE;
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_has_new(MN_MAILBOX(priv->mailbox), count != 0);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+ }
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+ }}
+#line 648 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 349 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_enter_logout_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 654 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::enter_logout_cb"
+#line 349 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 349 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 661 "mn-imap-mailbox.c"
+{
+#line 352 "mn-imap-mailbox.gob"
+
+ return self_session_write(priv, "LOGOUT");
+ }}
+#line 667 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 356 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_handle_logout_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 673 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::handle_logout_cb"
+#line 356 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 356 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 356 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 682 "mn-imap-mailbox.c"
+{
+#line 360 "mn-imap-mailbox.gob"
+
+ if (response->tag && HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ return MN_CLIENT_SESSION_RESULT_END;
+ else if (IS_BAD(response))
+ return RESULT_ERROR_END;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ else
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+ }}
+#line 698 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 374 "mn-imap-mailbox.gob"
+static void
+___f_mn_imap_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
+#line 704 "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 374 "mn-imap-mailbox.gob"
+ g_return_if_fail (mailbox != NULL);
+#line 374 "mn-imap-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (mailbox));
+#line 714 "mn-imap-mailbox.c"
+{
+#line 376 "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_SASL
+ { STATE_AUTHENTICATE, self_enter_authenticate_cb, self_handle_authenticate_cb },
+#endif
+ { STATE_LOGIN, self_enter_login_cb, self_handle_login_cb },
+ { STATE_STATUS, self_enter_status_cb, self_handle_status_cb },
+ { STATE_LOGOUT, self_enter_logout_cb, self_handle_logout_cb },
+
+ MN_CLIENT_SESSION_STATES_END
+ };
+ MNClientSessionCallbacks callbacks = {
+ self_notice_cb,
+ self_response_new_cb,
+ self_response_free_cb,
+ self_custom_handler_cb
+ };
+ MNClientSessionPrivate priv;
+ GError *err = NULL;
+
+ memset(&priv, 0, sizeof(priv));
+ priv.mailbox = self;
+
+ if (! mn_client_session_run(states,
+ &callbacks,
+#ifdef WITH_SSL
+ selfp->ssl,
+#endif
+ selfp->hostname,
+ selfp->port,
+ selfp->username,
+ selfp->password,
+ &priv,
+ &err))
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(mailbox, "%s", err->message);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ g_error_free(err);
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(mailbox);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ g_free(priv.tag);
+ g_strfreev(priv.capabilities);
+ mn_pointers_free(priv.auth_mechanisms);
+ }}
+#line 771 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 431 "mn-imap-mailbox.gob"
+static void
+mn_imap_mailbox_notice_cb (MNClientSession * session, const char * str, MNClientSessionPrivate * priv)
+#line 778 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::notice_cb"
+#line 431 "mn-imap-mailbox.gob"
+ g_return_if_fail (session != NULL);
+#line 431 "mn-imap-mailbox.gob"
+ g_return_if_fail (str != NULL);
+#line 431 "mn-imap-mailbox.gob"
+ g_return_if_fail (priv != NULL);
+#line 787 "mn-imap-mailbox.c"
+{
+#line 435 "mn-imap-mailbox.gob"
+
+ mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ }}
+#line 793 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 439 "mn-imap-mailbox.gob"
+static MNClientSessionResponse *
+mn_imap_mailbox_response_new_cb (MNClientSession * session, const char * input, MNClientSessionPrivate * priv)
+#line 799 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::response_new_cb"
+#line 439 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (MNClientSessionResponse * )0);
+#line 439 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (input != NULL, (MNClientSessionResponse * )0);
+#line 439 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (MNClientSessionResponse * )0);
+#line 808 "mn-imap-mailbox.c"
+{
+#line 443 "mn-imap-mailbox.gob"
+
+ MNClientSessionResponse *response = NULL;
+
+ if (! strncmp(input, "+ ", 2))
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->continuation = g_strdup(input + 2);
+ }
+ else
+ {
+ char **tokens;
+
+ tokens = g_strsplit(input, " ", 3);
+ if (tokens[0] && tokens[1])
+ {
+ if (tokens[2] && tokens[2][0] == '[')
+ {
+ char *code_start;
+ char *code_end;
+
+ code_start = tokens[2] + 1;
+ code_end = strchr(code_start, ']');
+ if (code_end)
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->code = g_strndup(code_start, code_end - code_start);
+ response->arguments = code_end[1] ? g_strdup(code_end + 2) : NULL;
+ }
+ }
+ else
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->arguments = g_strdup(tokens[2]);
+ }
+
+ if (response)
+ {
+ response->tag = ! strcmp(tokens[0], "*") ? NULL : g_strdup(tokens[0]);
+ response->response = g_strdup(tokens[1]);
+ }
+ }
+ g_strfreev(tokens);
+ }
+
+ return response;
+ }}
+#line 857 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 490 "mn-imap-mailbox.gob"
+static void
+mn_imap_mailbox_response_free_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 863 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::response_free_cb"
+#line 490 "mn-imap-mailbox.gob"
+ g_return_if_fail (session != NULL);
+#line 490 "mn-imap-mailbox.gob"
+ g_return_if_fail (response != NULL);
+#line 490 "mn-imap-mailbox.gob"
+ g_return_if_fail (priv != NULL);
+#line 872 "mn-imap-mailbox.c"
+{
+#line 494 "mn-imap-mailbox.gob"
+
+ g_free(response->tag);
+ g_free(response->continuation);
+ g_free(response->response);
+ g_free(response->code);
+ g_free(response->arguments);
+ g_free(response);
+ }}
+#line 883 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 503 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_custom_handler_cb (MNClientSession * session, MNClientSessionResponse * response, int result, MNClientSessionPrivate * priv)
+#line 889 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::custom_handler_cb"
+#line 503 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 503 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 503 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 898 "mn-imap-mailbox.c"
+{
+#line 508 "mn-imap-mailbox.gob"
+
+ switch (result)
+ {
+ case RESULT_ERROR_LOGOUT:
+ self_session_set_error_from_arguments(priv, response);
+ return STATE_LOGOUT;
+
+ case RESULT_ERROR_END:
+ self_session_set_error_from_arguments(priv, response);
+ return MN_CLIENT_SESSION_RESULT_END;
+
+ case RESULT_DEFAULT_HANDLER:
+ if (! response->tag && IS_BYE(response))
+ return RESULT_ERROR_END;
+ else
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+
+ default:
+ g_return_val_if_reached(0);
+ }
+ }}
+#line 922 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 530 "mn-imap-mailbox.gob"
+static void
+mn_imap_mailbox_session_set_error_from_arguments (MNClientSessionPrivate * priv, MNClientSessionResponse * response)
+#line 928 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_set_error_from_arguments"
+#line 530 "mn-imap-mailbox.gob"
+ g_return_if_fail (priv != NULL);
+#line 530 "mn-imap-mailbox.gob"
+ g_return_if_fail (response != NULL);
+#line 935 "mn-imap-mailbox.c"
+{
+#line 533 "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 944 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 540 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_session_write (MNClientSessionPrivate * priv, const char * format, ...)
+#line 950 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_write"
+#line 540 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 540 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (format != NULL, (int )0);
+#line 957 "mn-imap-mailbox.c"
+{
+#line 544 "mn-imap-mailbox.gob"
+
+ va_list args;
+ char *command;
+
+ va_start(args, format);
+ command = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ if (priv->numeric_tag == 1000)
+ priv->numeric_tag = 0;
+ g_free(priv->tag);
+ priv->tag = g_strdup_printf("a%03i", priv->numeric_tag++);
+
+ return mn_client_session_write(priv->session, "%s %s", priv->tag, command);
+ }}
+#line 975 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 560 "mn-imap-mailbox.gob"
+static void
+mn_imap_mailbox_session_parse_capabilities (MNClientSessionPrivate * priv, const char * capabilities)
+#line 981 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_parse_capabilities"
+#line 560 "mn-imap-mailbox.gob"
+ g_return_if_fail (priv != NULL);
+#line 986 "mn-imap-mailbox.c"
+{
+#line 563 "mn-imap-mailbox.gob"
+
+ if (capabilities)
+ {
+ int i;
+
+ priv->capabilities = g_strsplit(capabilities, " ", 0);
+
+ for (i = 0; priv->capabilities[i]; i++)
+ if (! strncmp(priv->capabilities[i], "AUTH=", 5))
+ priv->auth_mechanisms = g_slist_append(priv->auth_mechanisms, g_strdup(priv->capabilities[i] + 5));
+ }
+ else
+ priv->capabilities = g_new0(char *, 1);
+ }}
+#line 1003 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 578 "mn-imap-mailbox.gob"
+static gboolean
+mn_imap_mailbox_session_has_capability (MNClientSessionPrivate * priv, const char * capability)
+#line 1009 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_has_capability"
+#line 578 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (gboolean )0);
+#line 578 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (capability != NULL, (gboolean )0);
+#line 1016 "mn-imap-mailbox.c"
+{
+#line 581 "mn-imap-mailbox.gob"
+
+ int i;
+
+ g_return_val_if_fail(priv->capabilities != NULL, FALSE);
+
+ for (i = 0; priv->capabilities[i]; i++)
+ if (! strcmp(priv->capabilities[i], capability))
+ return TRUE;
+
+ return FALSE;
+ }}
+#line 1030 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 593 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_session_authenticate (MNClientSessionPrivate * priv)
+#line 1036 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_authenticate"
+#line 593 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 1041 "mn-imap-mailbox.c"
+{
+#line 595 "mn-imap-mailbox.gob"
+
+ if (priv->mailbox->_priv->authmech)
+ {
+ if (*priv->mailbox->_priv->authmech != '+')
+ {
+#ifdef WITH_SASL
+ return STATE_AUTHENTICATE;
+#else
+ return mn_client_session_error(priv->session, _("a SASL authentication mechanism was selected but SASL support has not been compiled in"));
+#endif /* WITH_SASL */
+ }
+ else
+ {
+ if (! strcmp(priv->mailbox->_priv->authmech, "+LOGIN"))
+ return STATE_LOGIN;
+ else
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ }
+ }
+ else
+ {
+#ifdef WITH_SASL
+ if (priv->auth_mechanisms)
+ return STATE_AUTHENTICATE;
+#endif /* WITH_SASL */
+ return STATE_LOGIN;
+ }
+ }}
+#line 1072 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 624 "mn-imap-mailbox.gob"
+static int
+mn_imap_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv)
+#line 1078 "mn-imap-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:IMAP:Mailbox::session_authenticate_fallback"
+#line 624 "mn-imap-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 1083 "mn-imap-mailbox.c"
+{
+#line 626 "mn-imap-mailbox.gob"
+
+ if (! priv->mailbox->_priv->authmech)
+ {
+ mn_client_session_notice(priv->session, _("falling back to IMAP LOGIN authentication"));
+ return STATE_LOGIN;
+ }
+
+ return mn_client_session_error(priv->session, _("authentication failed"));
+ }}
+#line 1095 "mn-imap-mailbox.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-imap-mailbox.gob b/src/mn-imap-mailbox.gob
@@ -0,0 +1,635 @@
+/*
+ * mn-imap-mailbox.gob - IMAP 4rev1 support for Mail Notification
+ * Complies with RFC 3501
+ *
+ * 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 "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <glib/gi18n-lib.h>
+#include <libgnomevfs/gnome-vfs-utils.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))
+#define IS(response, token) (! strcmp((response)->response, (token)))
+#define IS_OK(response) IS(response, "OK")
+#define IS_NO(response) IS(response, "NO")
+#define IS_BAD(response) IS(response, "BAD")
+#define IS_BYE(response) IS(response, "BYE")
+
+ enum
+ {
+ STATE_GREETING = MN_CLIENT_SESSION_INITIAL_STATE,
+ STATE_CAPABILITY,
+#ifdef WITH_SASL
+ STATE_AUTHENTICATE,
+#endif
+ STATE_LOGIN,
+ STATE_STATUS,
+ STATE_LOGOUT
+ };
+
+ enum
+ {
+ RESULT_ERROR_LOGOUT = -1, /* server reported an error, logout normally */
+ RESULT_ERROR_END = -2, /* server reported an error, close the connection */
+ RESULT_DEFAULT_HANDLER = -3 /* invoke the default response handler */
+ };
+
+ struct _MNClientSessionPrivate
+ {
+ MNIMAPMailbox *mailbox;
+ MNClientSession *session;
+ int numeric_tag;
+ char *tag;
+ char **capabilities;
+ GSList *auth_mechanisms;
+ gboolean status_received;
+#ifdef WITH_SASL
+ const char *sasl_mechanism;
+#endif
+ };
+
+ struct _MNClientSessionResponse
+ {
+ char *continuation;
+ char *tag;
+ char *response;
+ char *code;
+ char *arguments;
+ };
+%}
+
+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";
+ }
+
+ override (G:Object) GObject *
+ 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);
+
+ 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"));
+#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))
+ {
+ char *scheme;
+ gboolean is;
+
+ scheme = gnome_vfs_get_uri_scheme(uri);
+ is = scheme && (! strcmp(scheme, "imap") || ! strcmp(scheme, "imaps"));
+ g_free(scheme);
+
+ return is;
+ }
+
+ private int
+ handle_greeting_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ priv->session = session;
+
+ if (! response->tag && IS_OK(response))
+ {
+ if (response->code)
+ {
+ if (! strcmp(response->code, "CAPABILITY"))
+ self_session_parse_capabilities(priv, NULL);
+ else if (! strncmp(response->code, "CAPABILITY ", 11))
+ self_session_parse_capabilities(priv, response->code + 11);
+ }
+
+ return priv->capabilities
+ ? self_session_authenticate(priv)
+ : STATE_CAPABILITY;
+ }
+ else if (! response->tag && IS(response, "PREAUTH"))
+ return STATE_STATUS;
+ else if (! response->tag && IS_BYE(response))
+ return RESULT_ERROR_END;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+
+ private int
+ enter_capability_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return self_session_write(priv, "CAPABILITY");
+ }
+
+ private int
+ handle_capability_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ return priv->capabilities
+ ? self_session_authenticate(priv)
+ : mn_client_session_error(session, _("server did not send capabilities"));
+ }
+ else if (IS_BAD(response))
+ return RESULT_ERROR_LOGOUT;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+ else if (IS(response, "CAPABILITY"))
+ {
+ self_session_parse_capabilities(priv, response->arguments);
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+ }
+
+ private int
+ enter_authenticate_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SASL
+ if (mn_client_session_sasl_authentication_start(priv->session,
+ "imap",
+ priv->auth_mechanisms,
+ priv->mailbox->_priv->authmech,
+ &priv->sasl_mechanism))
+ return self_session_write(priv, "AUTHENTICATE %s", priv->sasl_mechanism);
+ else
+ return self_session_authenticate_fallback(priv);
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }
+
+ private int
+ handle_authenticate_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SASL
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ return mn_client_session_sasl_authentication_done(session)
+ ? STATE_STATUS
+ : MN_CLIENT_SESSION_RESULT_END;
+ }
+ else if (IS_NO(response) || IS_BAD(response))
+ return self_session_authenticate_fallback(priv);
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+ else if (response->continuation)
+ return mn_client_session_sasl_authentication_step(session, response->continuation);
+
+ return RESULT_DEFAULT_HANDLER;
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }
+
+ private int
+ enter_login_cb (MNClientSession *session (check null),
+ 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;
+ }
+ else
+ return self_session_write(priv, "LOGIN %s %s",
+ priv->mailbox->_priv->username,
+ priv->mailbox->_priv->password);
+ }
+
+ private int
+ handle_login_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ return STATE_STATUS;
+ else if (IS_NO(response) || IS_BAD(response))
+ return RESULT_ERROR_LOGOUT;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+ }
+
+ private int
+ enter_status_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return self_session_write(priv, "STATUS \"%s\" (UNSEEN)", priv->mailbox->_priv->mailbox);
+ }
+
+ private int
+ handle_status_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ if (response->tag)
+ {
+ if (HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ {
+ if (priv->status_received)
+ return STATE_LOGOUT;
+ else /* compliance error */
+ return mn_client_session_error(session, _("server did not send status"));
+ }
+ else if (IS_NO(response) || IS_BAD(response))
+ return RESULT_ERROR_LOGOUT;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+ else if (IS(response, "STATUS"))
+ {
+ int count;
+
+ if (response->arguments && sscanf(response->arguments, "%*s (UNSEEN %i)", &count) == 1)
+ {
+ priv->status_received = TRUE;
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_has_new(MN_MAILBOX(priv->mailbox), count != 0);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+ }
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+
+ return RESULT_DEFAULT_HANDLER;
+ }
+
+ private int
+ enter_logout_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return self_session_write(priv, "LOGOUT");
+ }
+
+ private int
+ handle_logout_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ if (response->tag && HAS_CURRENT_TAG(response, priv))
+ {
+ if (IS_OK(response))
+ return MN_CLIENT_SESSION_RESULT_END;
+ else if (IS_BAD(response))
+ return RESULT_ERROR_END;
+ else
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ else
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+ }
+
+ override (MN:Mailbox) void
+ impl_threaded_check (MN:Mailbox *mailbox (check null type))
+ {
+ 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_SASL
+ { STATE_AUTHENTICATE, self_enter_authenticate_cb, self_handle_authenticate_cb },
+#endif
+ { STATE_LOGIN, self_enter_login_cb, self_handle_login_cb },
+ { STATE_STATUS, self_enter_status_cb, self_handle_status_cb },
+ { STATE_LOGOUT, self_enter_logout_cb, self_handle_logout_cb },
+
+ MN_CLIENT_SESSION_STATES_END
+ };
+ MNClientSessionCallbacks callbacks = {
+ self_notice_cb,
+ self_response_new_cb,
+ self_response_free_cb,
+ self_custom_handler_cb
+ };
+ MNClientSessionPrivate priv;
+ GError *err = NULL;
+
+ memset(&priv, 0, sizeof(priv));
+ priv.mailbox = self;
+
+ if (! mn_client_session_run(states,
+ &callbacks,
+#ifdef WITH_SSL
+ selfp->ssl,
+#endif
+ selfp->hostname,
+ selfp->port,
+ selfp->username,
+ selfp->password,
+ &priv,
+ &err))
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(mailbox, "%s", err->message);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ g_error_free(err);
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(mailbox);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ g_free(priv.tag);
+ g_strfreev(priv.capabilities);
+ mn_pointers_free(priv.auth_mechanisms);
+ }
+
+ private void
+ notice_cb (MNClientSession *session (check null),
+ const char *str (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ }
+
+ private MNClientSessionResponse *
+ response_new_cb (MNClientSession *session (check null),
+ const char *input (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ MNClientSessionResponse *response = NULL;
+
+ if (! strncmp(input, "+ ", 2))
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->continuation = g_strdup(input + 2);
+ }
+ else
+ {
+ char **tokens;
+
+ tokens = g_strsplit(input, " ", 3);
+ if (tokens[0] && tokens[1])
+ {
+ if (tokens[2] && tokens[2][0] == '[')
+ {
+ char *code_start;
+ char *code_end;
+
+ code_start = tokens[2] + 1;
+ code_end = strchr(code_start, ']');
+ if (code_end)
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->code = g_strndup(code_start, code_end - code_start);
+ response->arguments = code_end[1] ? g_strdup(code_end + 2) : NULL;
+ }
+ }
+ else
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->arguments = g_strdup(tokens[2]);
+ }
+
+ if (response)
+ {
+ response->tag = ! strcmp(tokens[0], "*") ? NULL : g_strdup(tokens[0]);
+ response->response = g_strdup(tokens[1]);
+ }
+ }
+ g_strfreev(tokens);
+ }
+
+ return response;
+ }
+
+ private void
+ response_free_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ g_free(response->tag);
+ g_free(response->continuation);
+ g_free(response->response);
+ g_free(response->code);
+ g_free(response->arguments);
+ g_free(response);
+ }
+
+ private int
+ custom_handler_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ int result,
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (result)
+ {
+ case RESULT_ERROR_LOGOUT:
+ self_session_set_error_from_arguments(priv, response);
+ return STATE_LOGOUT;
+
+ case RESULT_ERROR_END:
+ self_session_set_error_from_arguments(priv, response);
+ return MN_CLIENT_SESSION_RESULT_END;
+
+ case RESULT_DEFAULT_HANDLER:
+ if (! response->tag && IS_BYE(response))
+ return RESULT_ERROR_END;
+ else
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+
+ default:
+ g_return_val_if_reached(0);
+ }
+ }
+
+ private void
+ session_set_error_from_arguments (MNClientSessionPrivate *priv (check null),
+ MNClientSessionResponse *response (check null))
+ {
+ if (response->arguments)
+ mn_client_session_error(priv->session, "\"%s\"", response->arguments);
+ else
+ mn_client_session_error(priv->session, _("unknown server error"));
+ }
+
+ private int
+ session_write (MNClientSessionPrivate *priv (check null),
+ const char *format (check null),
+ ...)
+ {
+ va_list args;
+ char *command;
+
+ va_start(args, format);
+ command = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ if (priv->numeric_tag == 1000)
+ priv->numeric_tag = 0;
+ g_free(priv->tag);
+ priv->tag = g_strdup_printf("a%03i", priv->numeric_tag++);
+
+ return mn_client_session_write(priv->session, "%s %s", priv->tag, command);
+ }
+
+ private void
+ session_parse_capabilities (MNClientSessionPrivate *priv (check null),
+ const char *capabilities)
+ {
+ if (capabilities)
+ {
+ int i;
+
+ priv->capabilities = g_strsplit(capabilities, " ", 0);
+
+ for (i = 0; priv->capabilities[i]; i++)
+ if (! strncmp(priv->capabilities[i], "AUTH=", 5))
+ priv->auth_mechanisms = g_slist_append(priv->auth_mechanisms, g_strdup(priv->capabilities[i] + 5));
+ }
+ else
+ priv->capabilities = g_new0(char *, 1);
+ }
+
+ private gboolean
+ session_has_capability (MNClientSessionPrivate *priv (check null),
+ const char *capability (check null))
+ {
+ int i;
+
+ g_return_val_if_fail(priv->capabilities != NULL, FALSE);
+
+ for (i = 0; priv->capabilities[i]; i++)
+ if (! strcmp(priv->capabilities[i], capability))
+ return TRUE;
+
+ return FALSE;
+ }
+
+ private int
+ session_authenticate (MNClientSessionPrivate *priv (check null))
+ {
+ if (priv->mailbox->_priv->authmech)
+ {
+ if (*priv->mailbox->_priv->authmech != '+')
+ {
+#ifdef WITH_SASL
+ return STATE_AUTHENTICATE;
+#else
+ return mn_client_session_error(priv->session, _("a SASL authentication mechanism was selected but SASL support has not been compiled in"));
+#endif /* WITH_SASL */
+ }
+ else
+ {
+ if (! strcmp(priv->mailbox->_priv->authmech, "+LOGIN"))
+ return STATE_LOGIN;
+ else
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ }
+ }
+ else
+ {
+#ifdef WITH_SASL
+ if (priv->auth_mechanisms)
+ return STATE_AUTHENTICATE;
+#endif /* WITH_SASL */
+ return STATE_LOGIN;
+ }
+ }
+
+ private int
+ session_authenticate_fallback (MNClientSessionPrivate *priv (check null))
+ {
+ if (! priv->mailbox->_priv->authmech)
+ {
+ mn_client_session_notice(priv->session, _("falling back to IMAP LOGIN authentication"));
+ return STATE_LOGIN;
+ }
+
+ return mn_client_session_error(priv->session, _("authentication failed"));
+ }
+}
diff --git a/src/mn-imap-mailbox.h b/src/mn-imap-mailbox.h
@@ -0,0 +1,62 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include "mn-mailbox.h"
+
+#ifndef __MN_IMAP_MAILBOX_H__
+#define __MN_IMAP_MAILBOX_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_IMAP_MAILBOX (mn_imap_mailbox_get_type())
+#define MN_IMAP_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_imap_mailbox_get_type(), MNIMAPMailbox)
+#define MN_IMAP_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_imap_mailbox_get_type(), MNIMAPMailbox const)
+#define MN_IMAP_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_imap_mailbox_get_type(), MNIMAPMailboxClass)
+#define MN_IS_IMAP_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_imap_mailbox_get_type ())
+
+#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
+ */
+#ifndef __TYPEDEF_MN_IMAP_MAILBOX__
+#define __TYPEDEF_MN_IMAP_MAILBOX__
+typedef struct _MNIMAPMailbox MNIMAPMailbox;
+#endif
+struct _MNIMAPMailbox {
+ MNMailbox __parent__;
+ /*< private >*/
+ MNIMAPMailboxPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNIMAPMailboxClass MNIMAPMailboxClass;
+struct _MNIMAPMailboxClass {
+ MNMailboxClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_imap_mailbox_get_type (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mail-icon-private.h b/src/mn-mail-icon-private.h
@@ -0,0 +1,24 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_MAIL_ICON_PRIVATE_H__
+#define __MN_MAIL_ICON_PRIVATE_H__
+
+#include "mn-mail-icon.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNMailIconPrivate {
+#line 37 "mn-mail-icon.gob"
+ GtkWidget * menu;
+#line 38 "mn-mail-icon.gob"
+ GtkWidget * run_item;
+#line 18 "mn-mail-icon-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mail-icon.c b/src/mn-mail-icon.c
@@ -1,231 +1,683 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 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 <string.h> /* memset() */
-#include "config.h"
-#include <glib/gi18n-lib.h>
-#include <gtk/gtk.h>
#include "mn-mail-icon.h"
+
+#include "mn-mail-icon-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 24 "mn-mail-icon.gob"
+
+#include "config.h"
+#include <gdk/gdkkeysyms.h>
+#include <gnome.h>
#include "mn-stock.h"
#include "mn-util.h"
-/*** types *******************************************************************/
+#line 35 "mn-mail-icon.c"
+/* self casting macros */
+#define SELF(x) MN_MAIL_ICON(x)
+#define SELF_CONST(x) MN_MAIL_ICON_CONST(x)
+#define IS_SELF(x) MN_IS_MAIL_ICON(x)
+#define TYPE_SELF MN_TYPE_MAIL_ICON
+#define SELF_CLASS(x) MN_MAIL_ICON_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_MAIL_ICON_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNMailIcon Self;
+typedef MNMailIconClass SelfClass;
+
+/* here are local prototypes */
+static void mn_mail_icon_activate (MNMailIcon * self) G_GNUC_UNUSED;
+static void mn_mail_icon_activate_run (MNMailIcon * self) G_GNUC_UNUSED;
+static void mn_mail_icon_activate_update (MNMailIcon * self) G_GNUC_UNUSED;
+static void mn_mail_icon_activate_properties (MNMailIcon * self) G_GNUC_UNUSED;
+static void mn_mail_icon_activate_help (MNMailIcon * self) G_GNUC_UNUSED;
+static void mn_mail_icon_activate_about (MNMailIcon * self) G_GNUC_UNUSED;
+static void mn_mail_icon_activate_remove (MNMailIcon * self) G_GNUC_UNUSED;
+static void mn_mail_icon_class_init (MNMailIconClass * class) G_GNUC_UNUSED;
+static void mn_mail_icon_init (MNMailIcon * self) G_GNUC_UNUSED;
+static gboolean mn_mail_icon_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data) G_GNUC_UNUSED;
+static gboolean mn_mail_icon_button_release_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data) G_GNUC_UNUSED;
+static gboolean mn_mail_icon_popup_menu_h (GtkWidget * widget, gpointer user_data) G_GNUC_UNUSED;
+
+/*
+ * Signal connection wrapper macro shortcuts
+ */
+#define self_connect__activate(object,func,data) mn_mail_icon_connect__activate((object),(func),(data))
+#define self_connect_after__activate(object,func,data) mn_mail_icon_connect_after__activate((object),(func),(data))
+#define self_connect_data__activate(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_run(object,func,data) mn_mail_icon_connect__activate_run((object),(func),(data))
+#define self_connect_after__activate_run(object,func,data) mn_mail_icon_connect_after__activate_run((object),(func),(data))
+#define self_connect_data__activate_run(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_run((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_update(object,func,data) mn_mail_icon_connect__activate_update((object),(func),(data))
+#define self_connect_after__activate_update(object,func,data) mn_mail_icon_connect_after__activate_update((object),(func),(data))
+#define self_connect_data__activate_update(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_update((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_properties(object,func,data) mn_mail_icon_connect__activate_properties((object),(func),(data))
+#define self_connect_after__activate_properties(object,func,data) mn_mail_icon_connect_after__activate_properties((object),(func),(data))
+#define self_connect_data__activate_properties(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_properties((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_help(object,func,data) mn_mail_icon_connect__activate_help((object),(func),(data))
+#define self_connect_after__activate_help(object,func,data) mn_mail_icon_connect_after__activate_help((object),(func),(data))
+#define self_connect_data__activate_help(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_help((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_about(object,func,data) mn_mail_icon_connect__activate_about((object),(func),(data))
+#define self_connect_after__activate_about(object,func,data) mn_mail_icon_connect_after__activate_about((object),(func),(data))
+#define self_connect_data__activate_about(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_about((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_remove(object,func,data) mn_mail_icon_connect__activate_remove((object),(func),(data))
+#define self_connect_after__activate_remove(object,func,data) mn_mail_icon_connect_after__activate_remove((object),(func),(data))
+#define self_connect_data__activate_remove(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_remove((object),(func),(data),(destroy_data),(flags))
enum {
- ACTIVATE,
- LAST_SIGNAL
+ ACTIVATE_SIGNAL,
+ ACTIVATE_RUN_SIGNAL,
+ ACTIVATE_UPDATE_SIGNAL,
+ ACTIVATE_PROPERTIES_SIGNAL,
+ ACTIVATE_HELP_SIGNAL,
+ ACTIVATE_ABOUT_SIGNAL,
+ ACTIVATE_REMOVE_SIGNAL,
+ LAST_SIGNAL
};
-struct _MNMailIconPrivate
+static guint object_signals[LAST_SIGNAL] = {0};
+
+/* pointer to the class of our parent */
+static EggTrayIconClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_activate mn_mail_icon_activate
+#define self_activate_run mn_mail_icon_activate_run
+#define self_activate_update mn_mail_icon_activate_update
+#define self_activate_properties mn_mail_icon_activate_properties
+#define self_activate_help mn_mail_icon_activate_help
+#define self_activate_about mn_mail_icon_activate_about
+#define self_activate_remove mn_mail_icon_activate_remove
+#define self_button_press_event_h mn_mail_icon_button_press_event_h
+#define self_button_release_event_h mn_mail_icon_button_release_event_h
+#define self_popup_menu_h mn_mail_icon_popup_menu_h
+#define self_new mn_mail_icon_new
+#define self_set_command mn_mail_icon_set_command
+GType
+mn_mail_icon_get_type (void)
{
- GtkTooltips *tooltips;
- GtkWidget *image;
- GtkMenu *menu;
-};
-
-/*** variables ***************************************************************/
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNMailIconClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_mail_icon_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNMailIcon),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_mail_icon_init,
+ NULL
+ };
+
+ type = g_type_register_static (EGG_TYPE_TRAY_ICON, "MNMailIcon", &info, (GTypeFlags)0);
+ }
+
+ return type;
+}
-static GObjectClass *parent_class = NULL;
-static unsigned int mail_icon_signals[LAST_SIGNAL] = { 0 };
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNMailIcon *)g_object_new(mn_mail_icon_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNMailIcon * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNMailIcon *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNMailIcon *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNMailIcon *)g_object_new_valist (mn_mail_icon_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
-/*** functions ***************************************************************/
-static void mn_mail_icon_class_init (MNMailIconClass *class);
-static void mn_mail_icon_init (MNMailIcon *icon);
-static void mn_mail_icon_finalize (GObject *object);
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::dispose"
+ MNMailIcon *self G_GNUC_UNUSED = MN_MAIL_ICON (obj_self);
+ if (G_OBJECT_CLASS (parent_class)->dispose) \
+ (* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
+#line 34 "mn-mail-icon.gob"
+ if(self->tooltips) { ((*(void (*)(void *))g_object_unref)) (self->tooltips); self->tooltips = NULL; }
+#line 169 "mn-mail-icon.c"
+}
+#undef __GOB_FUNCTION__
-static gboolean mn_mail_icon_press (GtkWidget *widget,
- GdkEventButton *event,
- gpointer data);
-static gboolean mn_mail_icon_release (GtkWidget *widget,
- GdkEventButton *event,
- gpointer data);
-/*** implementation **********************************************************/
+static void
+___finalize(GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::finalize"
+ MNMailIcon *self G_GNUC_UNUSED = MN_MAIL_ICON (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+#line 37 "mn-mail-icon.gob"
+ if(self->_priv->menu) { ((*(void (*)(void *))gtk_widget_destroy)) (self->_priv->menu); self->_priv->menu = NULL; }
+#line 184 "mn-mail-icon.c"
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
-GType
-mn_mail_icon_get_type (void)
+#line 56 "mn-mail-icon.gob"
+static void
+mn_mail_icon_class_init (MNMailIconClass * class G_GNUC_UNUSED)
+#line 192 "mn-mail-icon.c"
{
- static GType mail_icon_type = 0;
+#define __GOB_FUNCTION__ "MN:Mail:Icon::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+
+ parent_class = g_type_class_ref (EGG_TYPE_TRAY_ICON);
+
+ object_signals[ACTIVATE_SIGNAL] =
+ g_signal_new ("activate",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailIconClass, activate),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_RUN_SIGNAL] =
+ g_signal_new ("activate_run",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailIconClass, activate_run),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_UPDATE_SIGNAL] =
+ g_signal_new ("activate_update",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailIconClass, activate_update),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_PROPERTIES_SIGNAL] =
+ g_signal_new ("activate_properties",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailIconClass, activate_properties),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_HELP_SIGNAL] =
+ g_signal_new ("activate_help",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailIconClass, activate_help),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_ABOUT_SIGNAL] =
+ g_signal_new ("activate_about",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailIconClass, activate_about),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_REMOVE_SIGNAL] =
+ g_signal_new ("activate_remove",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailIconClass, activate_remove),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ class->activate = NULL;
+ class->activate_run = NULL;
+ class->activate_update = NULL;
+ class->activate_properties = NULL;
+ class->activate_help = NULL;
+ class->activate_about = NULL;
+ class->activate_remove = NULL;
+ g_object_class->dispose = ___dispose;
+ g_object_class->finalize = ___finalize;
+ {
+#line 57 "mn-mail-icon.gob"
+
+ GtkBindingSet *binding_set;
+
+ binding_set = gtk_binding_set_by_class(class);
+
+ /* HIG 2.0 key bindings */
+
+ gtk_binding_entry_add_signal(binding_set, GDK_space, 0, "activate", 0);
+
+ gtk_binding_entry_add_signal(binding_set, GDK_Return, GDK_MOD1_MASK, "activate-properties", 0);
+ 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);
- if (! mail_icon_type)
- {
- static const GTypeInfo mail_icon_info = {
- sizeof(MNMailIconClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_mail_icon_class_init,
- NULL,
- NULL,
- sizeof(MNMailIcon),
- 0,
- (GInstanceInitFunc) mn_mail_icon_init
- };
-
- mail_icon_type = g_type_register_static(EGG_TYPE_TRAY_ICON,
- "MNMailIcon",
- &mail_icon_info,
- 0);
- }
+#line 280 "mn-mail-icon.c"
+ }
+}
+#undef __GOB_FUNCTION__
+#line 71 "mn-mail-icon.gob"
+static void
+mn_mail_icon_init (MNMailIcon * self G_GNUC_UNUSED)
+#line 287 "mn-mail-icon.c"
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::init"
+ self->_priv = g_new0 (MNMailIconPrivate, 1);
+#line 34 "mn-mail-icon.gob"
+ self->tooltips = mn_tooltips_new();
+#line 293 "mn-mail-icon.c"
+#line 35 "mn-mail-icon.gob"
+ self->image = mn_blinking_image_new_from_stock(MN_STOCK_MAIL, GTK_ICON_SIZE_LARGE_TOOLBAR);
+#line 296 "mn-mail-icon.c"
+#line 37 "mn-mail-icon.gob"
+ self->_priv->menu = gtk_menu_new();
+#line 299 "mn-mail-icon.c"
+ {
+#line 72 "mn-mail-icon.gob"
+
+ GtkMenuShell *shell;
+ GtkWidget *event_box;
+ GtkWidget *properties_item;
+ GtkWidget *help_item;
+ GtkWidget *about_item;
+ GtkWidget *remove_item;
+
+ shell = GTK_MENU_SHELL(selfp->menu);
+ self->update_item = mn_menu_shell_append(shell, GTK_STOCK_REFRESH, _("_Update"));
+ mn_menu_shell_append(shell, NULL, NULL);
+ properties_item = mn_menu_shell_append(shell, GTK_STOCK_PROPERTIES, NULL);
+ help_item = mn_menu_shell_append(shell, GTK_STOCK_HELP, NULL);
+ about_item = mn_menu_shell_append(shell, GNOME_STOCK_ABOUT, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ remove_item = mn_menu_shell_append(shell, GTK_STOCK_REMOVE, _("R_emove From Notification Area"));
+
+ g_signal_connect_swapped(G_OBJECT(self->update_item), "activate", G_CALLBACK(self_activate_update), self);
+ g_signal_connect_swapped(G_OBJECT(properties_item), "activate", G_CALLBACK(self_activate_properties), self);
+ g_signal_connect_swapped(G_OBJECT(help_item), "activate", G_CALLBACK(self_activate_help), self);
+ g_signal_connect_swapped(G_OBJECT(about_item), "activate", G_CALLBACK(self_activate_about), self);
+ g_signal_connect_swapped(G_OBJECT(remove_item), "activate", G_CALLBACK(self_activate_remove), self);
+
+ event_box = gtk_event_box_new();
+ GTK_WIDGET_SET_FLAGS(event_box, GTK_CAN_FOCUS);
+ mn_setup_dnd(event_box);
+
+ gtk_container_add(GTK_CONTAINER(event_box), self->image);
+ gtk_container_add(GTK_CONTAINER(self), event_box);
+
+ g_signal_connect(G_OBJECT(event_box), "button-press-event",
+ G_CALLBACK(self_button_press_event_h), self);
+ g_signal_connect(G_OBJECT(event_box), "button-release-event",
+ G_CALLBACK(self_button_release_event_h), self);
+ g_signal_connect(G_OBJECT(event_box), "popup-menu",
+ G_CALLBACK(self_popup_menu_h), self);
+
+ gtk_widget_show(self->image);
+ gtk_widget_show(event_box);
- return mail_icon_type;
+#line 342 "mn-mail-icon.c"
+ }
}
+#undef __GOB_FUNCTION__
-static void
-mn_mail_icon_class_init (MNMailIconClass *class)
+#line 41 "mn-mail-icon.gob"
+static void
+mn_mail_icon_activate (MNMailIcon * self)
+#line 350 "mn-mail-icon.c"
{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 41 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 41 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 362 "mn-mail-icon.c"
- parent_class = g_type_class_peek_parent(class);
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
- object_class->finalize = mn_mail_icon_finalize;
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
- mail_icon_signals[ACTIVATE] = g_signal_new("activate",
- MN_TYPE_MAIL_ICON,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(MNMailIconClass, activate),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
+ g_value_unset (&___param_values[0]);
}
-static void
-mn_mail_icon_init (MNMailIcon *icon)
+#line 43 "mn-mail-icon.gob"
+static void
+mn_mail_icon_activate_run (MNMailIcon * self)
+#line 379 "mn-mail-icon.c"
{
- GtkWidget *event_box;
-
- icon->priv = g_new0(MNMailIconPrivate, 1);
+ GValue ___param_values[1];
+ GValue ___return_val;
- /* create widgets */
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
- event_box = gtk_event_box_new();
+#line 43 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 43 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 391 "mn-mail-icon.c"
- icon->priv->tooltips = gtk_tooltips_new();
- g_object_ref(icon->priv->tooltips);
- gtk_object_sink(GTK_OBJECT(icon->priv->tooltips));
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
- icon->priv->image = gtk_image_new_from_stock(MN_STOCK_NO_MAIL, GTK_ICON_SIZE_MENU);
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_RUN_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
+}
- /* configure widgets */
+#line 45 "mn-mail-icon.gob"
+static void
+mn_mail_icon_activate_update (MNMailIcon * self)
+#line 408 "mn-mail-icon.c"
+{
+ GValue ___param_values[1];
+ GValue ___return_val;
- mn_setup_dnd(event_box);
- gtk_tooltips_set_tip(icon->priv->tooltips,
- GTK_WIDGET(icon),
- _("You have no new mail"),
- NULL);
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
- /* pack widgets */
+#line 45 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 45 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 420 "mn-mail-icon.c"
- gtk_container_add(GTK_CONTAINER(event_box), icon->priv->image);
- gtk_container_add(GTK_CONTAINER(icon), event_box);
-
- /* bind signals */
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
- g_signal_connect(G_OBJECT(event_box), "button-press-event",
- G_CALLBACK(mn_mail_icon_press), icon);
- g_signal_connect(G_OBJECT(event_box), "button-release-event",
- G_CALLBACK(mn_mail_icon_release), icon);
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_UPDATE_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
- /* show widgets */
-
- gtk_widget_show(icon->priv->image);
- gtk_widget_show(event_box);
+ g_value_unset (&___param_values[0]);
}
-static void
-mn_mail_icon_finalize (GObject *object)
+#line 47 "mn-mail-icon.gob"
+static void
+mn_mail_icon_activate_properties (MNMailIcon * self)
+#line 437 "mn-mail-icon.c"
{
- MNMailIcon *icon = MN_MAIL_ICON(object);
+ GValue ___param_values[1];
+ GValue ___return_val;
- g_object_unref(icon->priv->tooltips);
- if (icon->priv->menu)
- g_object_unref(icon->priv->menu);
- g_free(icon->priv);
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
- G_OBJECT_CLASS(parent_class)->finalize(object);
-}
+#line 47 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 47 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 449 "mn-mail-icon.c"
-static gboolean
-mn_mail_icon_press (GtkWidget *widget, GdkEventButton *event, gpointer data)
-{
- MNMailIcon *icon = data;
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
- if (event->button == 1)
- g_signal_emit(icon, mail_icon_signals[ACTIVATE], 0);
- else if (event->button == 3 && icon->priv->menu)
- {
- gtk_menu_popup(icon->priv->menu, NULL, NULL, NULL, NULL, event->button, event->time);
- return TRUE;
- }
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_PROPERTIES_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
- return FALSE;
+ g_value_unset (&___param_values[0]);
}
-static gboolean
-mn_mail_icon_release (GtkWidget *widget,
- GdkEventButton *event,
- gpointer data)
+#line 49 "mn-mail-icon.gob"
+static void
+mn_mail_icon_activate_help (MNMailIcon * self)
+#line 466 "mn-mail-icon.c"
{
- MNMailIcon *icon = data;
+ GValue ___param_values[1];
+ GValue ___return_val;
- if (event->button == 3 && icon->priv->menu)
- {
- gtk_menu_popdown(icon->priv->menu);
- return TRUE;
- }
-
- return FALSE;
-}
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
-GtkWidget *
-mn_mail_icon_new (void)
-{
- return g_object_new(MN_TYPE_MAIL_ICON, "title", "Mail Notification", NULL);
+#line 49 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 49 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 478 "mn-mail-icon.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_HELP_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
}
-void
-mn_mail_icon_set_popup_menu (MNMailIcon *icon, GtkMenu *menu)
+#line 51 "mn-mail-icon.gob"
+static void
+mn_mail_icon_activate_about (MNMailIcon * self)
+#line 495 "mn-mail-icon.c"
{
- g_return_if_fail(MN_IS_MAIL_ICON(icon));
- g_return_if_fail(GTK_IS_MENU(menu));
- g_return_if_fail(icon->priv->menu == NULL);
-
- g_object_ref(menu);
- gtk_object_sink(GTK_OBJECT(menu));
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
- icon->priv->menu = menu;
+#line 51 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 51 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 507 "mn-mail-icon.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_ABOUT_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
}
-void
-mn_mail_icon_set_from_stock (MNMailIcon *icon, const char *stock_id)
+#line 53 "mn-mail-icon.gob"
+static void
+mn_mail_icon_activate_remove (MNMailIcon * self)
+#line 524 "mn-mail-icon.c"
{
- g_return_if_fail(MN_IS_MAIL_ICON(icon));
- g_return_if_fail(stock_id != NULL);
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
- gtk_image_set_from_stock(GTK_IMAGE(icon->priv->image), stock_id, GTK_ICON_SIZE_MENU);
+#line 53 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 53 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 536 "mn-mail-icon.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_REMOVE_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
}
-void
-mn_mail_icon_set_tooltip (MNMailIcon *icon, const char *tooltip)
+
+
+#line 113 "mn-mail-icon.gob"
+static gboolean
+mn_mail_icon_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
+#line 555 "mn-mail-icon.c"
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::button_press_event_h"
+#line 113 "mn-mail-icon.gob"
+ g_return_val_if_fail (widget != NULL, (gboolean )0);
+#line 113 "mn-mail-icon.gob"
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
+#line 113 "mn-mail-icon.gob"
+ g_return_val_if_fail (event != NULL, (gboolean )0);
+#line 113 "mn-mail-icon.gob"
+ g_return_val_if_fail (user_data != NULL, (gboolean )0);
+#line 566 "mn-mail-icon.c"
+{
+#line 117 "mn-mail-icon.gob"
+
+ Self *self = user_data;
+
+ if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
+ self_activate(self);
+ else if (event->button == 3)
+ {
+ gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, event->button, event->time);
+ return TRUE; /* do not propagate event */
+ }
+
+ return FALSE; /* propagate event */
+ }}
+#line 582 "mn-mail-icon.c"
+#undef __GOB_FUNCTION__
+
+#line 131 "mn-mail-icon.gob"
+static gboolean
+mn_mail_icon_button_release_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
+#line 588 "mn-mail-icon.c"
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::button_release_event_h"
+#line 131 "mn-mail-icon.gob"
+ g_return_val_if_fail (widget != NULL, (gboolean )0);
+#line 131 "mn-mail-icon.gob"
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
+#line 131 "mn-mail-icon.gob"
+ g_return_val_if_fail (event != NULL, (gboolean )0);
+#line 131 "mn-mail-icon.gob"
+ g_return_val_if_fail (user_data != NULL, (gboolean )0);
+#line 599 "mn-mail-icon.c"
+{
+#line 135 "mn-mail-icon.gob"
+
+ Self *self = user_data;
+
+ if (event->button == 3)
+ {
+ gtk_menu_popdown(GTK_MENU(selfp->menu));
+ return TRUE; /* do not propagate event */
+ }
+
+ return FALSE; /* propagate event */
+ }}
+#line 613 "mn-mail-icon.c"
+#undef __GOB_FUNCTION__
+
+#line 147 "mn-mail-icon.gob"
+static gboolean
+mn_mail_icon_popup_menu_h (GtkWidget * widget, gpointer user_data)
+#line 619 "mn-mail-icon.c"
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::popup_menu_h"
+#line 147 "mn-mail-icon.gob"
+ g_return_val_if_fail (widget != NULL, (gboolean )0);
+#line 147 "mn-mail-icon.gob"
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
+#line 147 "mn-mail-icon.gob"
+ g_return_val_if_fail (user_data != NULL, (gboolean )0);
+#line 628 "mn-mail-icon.c"
{
- g_return_if_fail(MN_IS_MAIL_ICON(icon));
- g_return_if_fail(tooltip != NULL);
+#line 150 "mn-mail-icon.gob"
+
+ Self *self = user_data;
+
+ gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time());
+ return TRUE; /* a menu was activated */
+ }}
+#line 637 "mn-mail-icon.c"
+#undef __GOB_FUNCTION__
+
+#line 157 "mn-mail-icon.gob"
+GtkWidget *
+mn_mail_icon_new (void)
+#line 643 "mn-mail-icon.c"
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::new"
+{
+#line 159 "mn-mail-icon.gob"
+
+ return g_object_new(TYPE_SELF, "title", _("Mail Notification"), NULL);
+ }}
+#line 651 "mn-mail-icon.c"
+#undef __GOB_FUNCTION__
+
+#line 163 "mn-mail-icon.gob"
+void
+mn_mail_icon_set_command (MNMailIcon * self, const char * command)
+#line 657 "mn-mail-icon.c"
+{
+#define __GOB_FUNCTION__ "MN:Mail:Icon::set_command"
+#line 163 "mn-mail-icon.gob"
+ g_return_if_fail (self != NULL);
+#line 163 "mn-mail-icon.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (self));
+#line 664 "mn-mail-icon.c"
+{
+#line 165 "mn-mail-icon.gob"
+
+ char *mnemonic;
- gtk_tooltips_set_tip(icon->priv->tooltips, GTK_WIDGET(icon), tooltip, NULL);
-}
+ if (selfp->run_item)
+ gtk_widget_destroy(selfp->run_item);
+
+ mnemonic = command
+ ? g_strdup_printf(_("_Run %s"), command)
+ : g_strdup(_("_Run Default Action"));
+
+ selfp->run_item = mn_menu_shell_prepend(GTK_MENU_SHELL(selfp->menu), GTK_STOCK_EXECUTE, mnemonic);
+ g_free(mnemonic);
+
+ gtk_widget_set_sensitive(selfp->run_item, command != NULL);
+ g_signal_connect_swapped(G_OBJECT(selfp->run_item), "activate", G_CALLBACK(self_activate_run), self);
+ }}
+#line 683 "mn-mail-icon.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-mail-icon.gob b/src/mn-mail-icon.gob
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include <gtk/gtk.h>
+#include "eggtrayicon.h"
+#include "mn-blinking-image.h"
+%}
+%{
+#include "config.h"
+#include <gdk/gdkkeysyms.h>
+#include <gnome.h>
+#include "mn-stock.h"
+#include "mn-util.h"
+%}
+
+class MN:Mail:Icon from Egg:Tray:Icon
+{
+ public GtkTooltips *tooltips = {mn_tooltips_new()} unrefwith g_object_unref;
+ public GtkWidget *image = {mn_blinking_image_new_from_stock(MN_STOCK_MAIL, GTK_ICON_SIZE_LARGE_TOOLBAR)};
+
+ private GtkWidget *menu = {gtk_menu_new()} destroywith gtk_widget_destroy;
+ private GtkWidget *run_item;
+ public GtkWidget *update_item;
+
+ signal (ACTION) private NONE (NONE)
+ void activate (self);
+ signal (ACTION) private NONE (NONE)
+ void activate_run (self);
+ signal (ACTION) private NONE (NONE)
+ void activate_update (self);
+ signal (ACTION) private NONE (NONE)
+ void activate_properties (self);
+ signal (ACTION) private NONE (NONE)
+ void activate_help (self);
+ signal (ACTION) private NONE (NONE)
+ void activate_about (self);
+ signal (ACTION) private NONE (NONE)
+ void activate_remove (self);
+
+ class_init (class)
+ {
+ GtkBindingSet *binding_set;
+
+ binding_set = gtk_binding_set_by_class(class);
+
+ /* HIG 2.0 key bindings */
+
+ gtk_binding_entry_add_signal(binding_set, GDK_space, 0, "activate", 0);
+
+ gtk_binding_entry_add_signal(binding_set, GDK_Return, GDK_MOD1_MASK, "activate-properties", 0);
+ 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);
+ }
+
+ init (self)
+ {
+ GtkMenuShell *shell;
+ GtkWidget *event_box;
+ GtkWidget *properties_item;
+ GtkWidget *help_item;
+ GtkWidget *about_item;
+ GtkWidget *remove_item;
+
+ shell = GTK_MENU_SHELL(selfp->menu);
+ self->update_item = mn_menu_shell_append(shell, GTK_STOCK_REFRESH, _("_Update"));
+ mn_menu_shell_append(shell, NULL, NULL);
+ properties_item = mn_menu_shell_append(shell, GTK_STOCK_PROPERTIES, NULL);
+ help_item = mn_menu_shell_append(shell, GTK_STOCK_HELP, NULL);
+ about_item = mn_menu_shell_append(shell, GNOME_STOCK_ABOUT, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ remove_item = mn_menu_shell_append(shell, GTK_STOCK_REMOVE, _("R_emove From Notification Area"));
+
+ g_signal_connect_swapped(G_OBJECT(self->update_item), "activate", G_CALLBACK(self_activate_update), self);
+ g_signal_connect_swapped(G_OBJECT(properties_item), "activate", G_CALLBACK(self_activate_properties), self);
+ g_signal_connect_swapped(G_OBJECT(help_item), "activate", G_CALLBACK(self_activate_help), self);
+ g_signal_connect_swapped(G_OBJECT(about_item), "activate", G_CALLBACK(self_activate_about), self);
+ g_signal_connect_swapped(G_OBJECT(remove_item), "activate", G_CALLBACK(self_activate_remove), self);
+
+ event_box = gtk_event_box_new();
+ GTK_WIDGET_SET_FLAGS(event_box, GTK_CAN_FOCUS);
+ mn_setup_dnd(event_box);
+
+ gtk_container_add(GTK_CONTAINER(event_box), self->image);
+ gtk_container_add(GTK_CONTAINER(self), event_box);
+
+ g_signal_connect(G_OBJECT(event_box), "button-press-event",
+ G_CALLBACK(self_button_press_event_h), self);
+ g_signal_connect(G_OBJECT(event_box), "button-release-event",
+ G_CALLBACK(self_button_release_event_h), self);
+ g_signal_connect(G_OBJECT(event_box), "popup-menu",
+ G_CALLBACK(self_popup_menu_h), self);
+
+ gtk_widget_show(self->image);
+ gtk_widget_show(event_box);
+ }
+
+ private gboolean
+ button_press_event_h (Gtk:Widget *widget (check null type),
+ GdkEventButton *event (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
+ self_activate(self);
+ else if (event->button == 3)
+ {
+ gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, event->button, event->time);
+ return TRUE; /* do not propagate event */
+ }
+
+ return FALSE; /* propagate event */
+ }
+
+ private gboolean
+ button_release_event_h (Gtk:Widget *widget (check null type),
+ GdkEventButton *event (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ if (event->button == 3)
+ {
+ gtk_menu_popdown(GTK_MENU(selfp->menu));
+ return TRUE; /* do not propagate event */
+ }
+
+ return FALSE; /* propagate event */
+ }
+
+ private gboolean
+ popup_menu_h (Gtk:Widget *widget (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time());
+ return TRUE; /* a menu was activated */
+ }
+
+ public GtkWidget *
+ new (void)
+ {
+ return g_object_new(TYPE_SELF, "title", _("Mail Notification"), NULL);
+ }
+
+ public void
+ set_command (self, const char *command)
+ {
+ char *mnemonic;
+
+ if (selfp->run_item)
+ gtk_widget_destroy(selfp->run_item);
+
+ mnemonic = command
+ ? g_strdup_printf(_("_Run %s"), command)
+ : g_strdup(_("_Run Default Action"));
+
+ selfp->run_item = mn_menu_shell_prepend(GTK_MENU_SHELL(selfp->menu), GTK_STOCK_EXECUTE, mnemonic);
+ g_free(mnemonic);
+
+ gtk_widget_set_sensitive(selfp->run_item, command != NULL);
+ g_signal_connect_swapped(G_OBJECT(selfp->run_item), "activate", G_CALLBACK(self_activate_run), self);
+ }
+}
diff --git a/src/mn-mail-icon.h b/src/mn-mail-icon.h
@@ -1,59 +1,128 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
-#ifndef _MN_MAIL_ICON_H
-#define _MN_MAIL_ICON_H
#include <gtk/gtk.h>
#include "eggtrayicon.h"
+#include "mn-blinking-image.h"
+
+#ifndef __MN_MAIL_ICON_H__
+#define __MN_MAIL_ICON_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_MAIL_ICON (mn_mail_icon_get_type())
+#define MN_MAIL_ICON(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mail_icon_get_type(), MNMailIcon)
+#define MN_MAIL_ICON_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mail_icon_get_type(), MNMailIcon const)
+#define MN_MAIL_ICON_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_mail_icon_get_type(), MNMailIconClass)
+#define MN_IS_MAIL_ICON(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_mail_icon_get_type ())
-#define MN_TYPE_MAIL_ICON (mn_mail_icon_get_type())
-#define MN_MAIL_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_MAIL_ICON, MNMailIcon))
-#define MN_MAIL_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_MAIL_ICON, MNMailIconClass))
-#define MN_IS_MAIL_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_MAIL_ICON))
-#define MN_IS_MAIL_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_MAIL_ICON))
-#define MN_MAIL_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_MAIL_ICON, MNMailIconClass))
+#define MN_MAIL_ICON_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_mail_icon_get_type(), MNMailIconClass)
+/* Private structure type */
typedef struct _MNMailIconPrivate MNMailIconPrivate;
-typedef struct
-{
- EggTrayIcon icon;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_MAIL_ICON__
+#define __TYPEDEF_MN_MAIL_ICON__
+typedef struct _MNMailIcon MNMailIcon;
+#endif
+struct _MNMailIcon {
+ EggTrayIcon __parent__;
+ /*< public >*/
+ GtkTooltips * tooltips;
+ GtkWidget * image;
+ GtkWidget * update_item;
+ /*< private >*/
+ MNMailIconPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNMailIconClass MNMailIconClass;
+struct _MNMailIconClass {
+ EggTrayIconClass __parent__;
+ /*signal*/void (* activate) (MNMailIcon * self);
+ /*signal*/void (* activate_run) (MNMailIcon * self);
+ /*signal*/void (* activate_update) (MNMailIcon * self);
+ /*signal*/void (* activate_properties) (MNMailIcon * self);
+ /*signal*/void (* activate_help) (MNMailIcon * self);
+ /*signal*/void (* activate_about) (MNMailIcon * self);
+ /*signal*/void (* activate_remove) (MNMailIcon * self);
+};
- MNMailIconPrivate *priv;
-} MNMailIcon;
-typedef struct
-{
- EggTrayIconClass icon_class;
+/*
+ * Public methods
+ */
+GType mn_mail_icon_get_type (void);
+GtkWidget * mn_mail_icon_new (void);
+void mn_mail_icon_set_command (MNMailIcon * self,
+ const char * command);
- /* signals */
- void (*activate) (MNMailIcon *icon);
-} MNMailIconClass;
+/*
+ * Signal connection wrapper macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define mn_mail_icon_connect__activate(object,func,data) g_signal_connect(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate",(GCallback) __extension__ ({void (* ___activate) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate; }), (data))
+#define mn_mail_icon_connect_after__activate(object,func,data) g_signal_connect_after(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate",(GCallback) __extension__ ({void (* ___activate) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate; }), (data))
+#define mn_mail_icon_connect_data__activate(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate",(GCallback) __extension__ ({void (* ___activate) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_run(object,func,data) g_signal_connect(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_run",(GCallback) __extension__ ({void (* ___activate_run) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_run; }), (data))
+#define mn_mail_icon_connect_after__activate_run(object,func,data) g_signal_connect_after(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_run",(GCallback) __extension__ ({void (* ___activate_run) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_run; }), (data))
+#define mn_mail_icon_connect_data__activate_run(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_run",(GCallback) __extension__ ({void (* ___activate_run) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_run; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_update(object,func,data) g_signal_connect(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_update",(GCallback) __extension__ ({void (* ___activate_update) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_update; }), (data))
+#define mn_mail_icon_connect_after__activate_update(object,func,data) g_signal_connect_after(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_update",(GCallback) __extension__ ({void (* ___activate_update) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_update; }), (data))
+#define mn_mail_icon_connect_data__activate_update(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_update",(GCallback) __extension__ ({void (* ___activate_update) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_update; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_properties(object,func,data) g_signal_connect(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_properties",(GCallback) __extension__ ({void (* ___activate_properties) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_properties; }), (data))
+#define mn_mail_icon_connect_after__activate_properties(object,func,data) g_signal_connect_after(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_properties",(GCallback) __extension__ ({void (* ___activate_properties) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_properties; }), (data))
+#define mn_mail_icon_connect_data__activate_properties(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_properties",(GCallback) __extension__ ({void (* ___activate_properties) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_properties; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_help(object,func,data) g_signal_connect(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_help",(GCallback) __extension__ ({void (* ___activate_help) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_help; }), (data))
+#define mn_mail_icon_connect_after__activate_help(object,func,data) g_signal_connect_after(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_help",(GCallback) __extension__ ({void (* ___activate_help) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_help; }), (data))
+#define mn_mail_icon_connect_data__activate_help(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_help",(GCallback) __extension__ ({void (* ___activate_help) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_help; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_about(object,func,data) g_signal_connect(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_about",(GCallback) __extension__ ({void (* ___activate_about) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_about; }), (data))
+#define mn_mail_icon_connect_after__activate_about(object,func,data) g_signal_connect_after(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_about",(GCallback) __extension__ ({void (* ___activate_about) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_about; }), (data))
+#define mn_mail_icon_connect_data__activate_about(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_about",(GCallback) __extension__ ({void (* ___activate_about) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_about; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_remove(object,func,data) g_signal_connect(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_remove",(GCallback) __extension__ ({void (* ___activate_remove) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_remove; }), (data))
+#define mn_mail_icon_connect_after__activate_remove(object,func,data) g_signal_connect_after(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_remove",(GCallback) __extension__ ({void (* ___activate_remove) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_remove; }), (data))
+#define mn_mail_icon_connect_data__activate_remove(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(__extension__ ({MNMailIcon *___object = (object); ___object; })),"activate_remove",(GCallback) __extension__ ({void (* ___activate_remove) (MNMailIcon * ___fake___self, gpointer ___data ) = (func); ___activate_remove; }), (data), (destroy_data), (GConnectFlags)(flags))
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define mn_mail_icon_connect__activate(object,func,data) g_signal_connect(MN_MAIL_ICON(object),"activate",(GCallback)(func),(data))
+#define mn_mail_icon_connect_after__activate(object,func,data) g_signal_connect_after(MN_MAIL_ICON(object),"activate",(GCallback)(func),(data))
+#define mn_mail_icon_connect_data__activate(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(object),"activate",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_run(object,func,data) g_signal_connect(MN_MAIL_ICON(object),"activate_run",(GCallback)(func),(data))
+#define mn_mail_icon_connect_after__activate_run(object,func,data) g_signal_connect_after(MN_MAIL_ICON(object),"activate_run",(GCallback)(func),(data))
+#define mn_mail_icon_connect_data__activate_run(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(object),"activate_run",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_update(object,func,data) g_signal_connect(MN_MAIL_ICON(object),"activate_update",(GCallback)(func),(data))
+#define mn_mail_icon_connect_after__activate_update(object,func,data) g_signal_connect_after(MN_MAIL_ICON(object),"activate_update",(GCallback)(func),(data))
+#define mn_mail_icon_connect_data__activate_update(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(object),"activate_update",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_properties(object,func,data) g_signal_connect(MN_MAIL_ICON(object),"activate_properties",(GCallback)(func),(data))
+#define mn_mail_icon_connect_after__activate_properties(object,func,data) g_signal_connect_after(MN_MAIL_ICON(object),"activate_properties",(GCallback)(func),(data))
+#define mn_mail_icon_connect_data__activate_properties(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(object),"activate_properties",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_help(object,func,data) g_signal_connect(MN_MAIL_ICON(object),"activate_help",(GCallback)(func),(data))
+#define mn_mail_icon_connect_after__activate_help(object,func,data) g_signal_connect_after(MN_MAIL_ICON(object),"activate_help",(GCallback)(func),(data))
+#define mn_mail_icon_connect_data__activate_help(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(object),"activate_help",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_about(object,func,data) g_signal_connect(MN_MAIL_ICON(object),"activate_about",(GCallback)(func),(data))
+#define mn_mail_icon_connect_after__activate_about(object,func,data) g_signal_connect_after(MN_MAIL_ICON(object),"activate_about",(GCallback)(func),(data))
+#define mn_mail_icon_connect_data__activate_about(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(object),"activate_about",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mail_icon_connect__activate_remove(object,func,data) g_signal_connect(MN_MAIL_ICON(object),"activate_remove",(GCallback)(func),(data))
+#define mn_mail_icon_connect_after__activate_remove(object,func,data) g_signal_connect_after(MN_MAIL_ICON(object),"activate_remove",(GCallback)(func),(data))
+#define mn_mail_icon_connect_data__activate_remove(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAIL_ICON(object),"activate_remove",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
-GType mn_mail_icon_get_type (void);
-GtkWidget *mn_mail_icon_new (void);
-void mn_mail_icon_set_popup_menu (MNMailIcon *icon,
- GtkMenu *menu);
-void mn_mail_icon_set_from_stock (MNMailIcon *icon,
- const char *stock_id);
-void mn_mail_icon_set_tooltip (MNMailIcon *icon,
- const char *tooltip);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
-#endif /* _MN_MAIL_ICON_H */
+#endif
diff --git a/src/mn-mailbox-private.h b/src/mn-mailbox-private.h
@@ -0,0 +1,61 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_MAILBOX_PRIVATE_H__
+#define __MN_MAILBOX_PRIVATE_H__
+
+#include "mn-mailbox.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#line 23 "mn-mailbox.gob"
+
+#include <libgnomevfs/gnome-vfs.h>
+
+ typedef enum
+ {
+ MN_MAILBOX_MONITOR_EVENT_CHANGED = 1 << GNOME_VFS_MONITOR_EVENT_CHANGED,
+ MN_MAILBOX_MONITOR_EVENT_DELETED = 1 << GNOME_VFS_MONITOR_EVENT_DELETED,
+ MN_MAILBOX_MONITOR_EVENT_STARTEXECUTING = 1 << GNOME_VFS_MONITOR_EVENT_STARTEXECUTING,
+ MN_MAILBOX_MONITOR_EVENT_STOPEXECUTING = 1 << GNOME_VFS_MONITOR_EVENT_STOPEXECUTING,
+ MN_MAILBOX_MONITOR_EVENT_CREATED = 1 << GNOME_VFS_MONITOR_EVENT_CREATED,
+ MN_MAILBOX_MONITOR_EVENT_METADATA_CHANGED = 1 << GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED
+ } MNMailboxMonitorEventType;
+
+#line 28 "mn-mailbox-private.h"
+struct _MNMailboxPrivate {
+#line 87 "mn-mailbox.gob"
+ char * uri;
+#line 97 "mn-mailbox.gob"
+ char * name;
+#line 101 "mn-mailbox.gob"
+ gboolean automatic;
+#line 106 "mn-mailbox.gob"
+ gboolean has_new;
+#line 111 "mn-mailbox.gob"
+ char * error;
+#line 131 "mn-mailbox.gob"
+ GnomeVFSMonitorHandle * monitor_handle;
+#line 132 "mn-mailbox.gob"
+ char * monitor_uri;
+#line 133 "mn-mailbox.gob"
+ MNMailboxMonitorEventType monitor_events;
+#line 135 "mn-mailbox.gob"
+ gboolean checking;
+#line 276 "mn-mailbox.gob"
+ char * init_error;
+#line 50 "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, ...);
+void mn_mailbox_monitor (MNMailbox * self, const char * uri, GnomeVFSMonitorType monitor_type, MNMailboxMonitorEventType events);
+void mn_mailbox_end_check (MNMailbox * self);
+void mn_mailbox_notice (MNMailbox * self, const char * format, ...);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mailbox-properties-dialog.c b/src/mn-mailbox-properties-dialog.c
@@ -19,40 +19,31 @@
#include "config.h"
#include <glib/gi18n-lib.h>
#include "mn-mailbox-properties-dialog.h"
+#include "mn-mailbox-properties.h"
+#include "mn-autodetect-mailbox-properties.h"
+#include "mn-system-mailbox-properties.h"
+#ifdef WITH_POP3
+#include "mn-pop3-mailbox-properties.h"
+#endif
+#ifdef WITH_IMAP
+#include "mn-imap-mailbox-properties.h"
+#endif
+#ifdef WITH_GMAIL
+#include "mn-gmail-mailbox-properties.h"
+#endif
#include "mn-conf.h"
#include "mn-util.h"
#include "mn-uri.h"
+#include "mn-stock.h"
/*** types *******************************************************************/
typedef struct
{
- GtkWidget *type_label;
- GtkWidget *type_combo;
-
- GtkWidget *autodetect_vbox;
- GtkWidget *location_label;
- GtkWidget *location_entry;
- GtkWidget *browse_button;
-
- GtkWidget *pop3_vbox;
- GtkWidget *pop3_hostname_label;
- GtkWidget *pop3_hostname_entry;
- GtkWidget *pop3_port_label;
- GtkWidget *pop3_port_spin;
- GtkWidget *pop3_username_label;
- GtkWidget *pop3_username_entry;
- GtkWidget *pop3_password_label;
- GtkWidget *pop3_password_entry;
-
- GtkWidget *gmail_vbox;
- GtkWidget *gmail_username_label;
- GtkWidget *gmail_username_entry;
- GtkWidget *gmail_password_label;
- GtkWidget *gmail_password_entry;
-
- GtkWidget *unsupported_label;
-
+ GtkWidget *mailbox_type_label;
+ GtkWidget *mailbox_type_combo;
+ GtkWidget *properties_event_box;
+
MNMailboxPropertiesDialogMode mode;
char *uri;
GtkWidget *apply_button;
@@ -60,37 +51,30 @@ typedef struct
GtkListStore *store;
} Private;
-typedef enum {
- TYPE_AUTODETECT,
- TYPE_POP3,
- TYPE_GMAIL
-} Type;
-
enum {
- COLUMN_TYPE,
+ COLUMN_PROPERTIES,
COLUMN_TEXT,
- COLUMN_STYLE,
N_COLUMNS
};
/*** variables ***************************************************************/
-static char *current_folder_uri = NULL;
-static Type selected_type = TYPE_AUTODETECT;
+static GType selected_type = 0;
/*** functions ***************************************************************/
static void mn_mailbox_properties_dialog_private_free (Private *private);
-static gboolean mn_mailbox_properties_dialog_is_complete (MNMailboxPropertiesDialog *dialog);
-static Type mn_mailbox_properties_dialog_get_active_type (MNMailboxPropertiesDialog *dialog);
-static void mn_mailbox_properties_dialog_set_active_type (MNMailboxPropertiesDialog *dialog,
- Type type);
+
+static void mn_mailbox_properties_dialog_add_type (MNMailboxPropertiesDialog *dialog,
+ GType properties_type);
+
+static void mn_mailbox_properties_dialog_select_properties (MNMailboxPropertiesDialog *dialog);
+static void mn_mailbox_properties_dialog_set_active_properties (MNMailboxPropertiesDialog *dialog, MNMailboxProperties *properties);
+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_update_sensitivity (MNMailboxPropertiesDialog *dialog);
-static void mn_mailbox_properties_dialog_set_uri_internal (MNMailboxPropertiesDialog *dialog,
- const char *uri);
-static void mn_mailbox_properties_dialog_fill (MNMailboxPropertiesDialog *dialog);
-static void mn_mailbox_properties_dialog_current_folder_changed_h (GtkFileChooser *chooser,
- gpointer user_data);
/*** implementation **********************************************************/
@@ -100,34 +84,14 @@ mn_mailbox_properties_dialog_new (GtkWindow *parent,
{
MNMailboxPropertiesDialog *dialog;
Private *private;
- GtkSizeGroup *size_group;
- GtkTreeIter iter;
GtkCellRenderer *renderer;
private = g_new0(Private, 1);
mn_create_interface("mailbox-properties",
"dialog", (GtkWidget **) &dialog,
- "type_label", &private->type_label,
- "type_combo", &private->type_combo,
- "autodetect_vbox", &private->autodetect_vbox,
- "location_label", &private->location_label,
- "location_entry", &private->location_entry,
- "browse_button", &private->browse_button,
- "pop3_vbox", &private->pop3_vbox,
- "pop3_hostname_label", &private->pop3_hostname_label,
- "pop3_hostname_entry", &private->pop3_hostname_entry,
- "pop3_port_label", &private->pop3_port_label,
- "pop3_port_spin", &private->pop3_port_spin,
- "pop3_username_label", &private->pop3_username_label,
- "pop3_username_entry", &private->pop3_username_entry,
- "pop3_password_label", &private->pop3_password_label,
- "pop3_password_entry", &private->pop3_password_entry,
- "gmail_vbox", &private->gmail_vbox,
- "gmail_username_label", &private->gmail_username_label,
- "gmail_username_entry", &private->gmail_username_entry,
- "gmail_password_label", &private->gmail_password_label,
- "gmail_password_entry", &private->gmail_password_entry,
- "unsupported_label", &private->unsupported_label,
+ "mailbox_type_label", &private->mailbox_type_label,
+ "mailbox_type_combo", &private->mailbox_type_combo,
+ "properties_event_box", &private->properties_event_box,
NULL);
private->mode = mode;
@@ -136,16 +100,6 @@ mn_mailbox_properties_dialog_new (GtkWindow *parent,
private,
(GDestroyNotify) mn_mailbox_properties_dialog_private_free);
- size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget(size_group, private->type_label);
- gtk_size_group_add_widget(size_group, private->location_label);
- gtk_size_group_add_widget(size_group, private->pop3_hostname_label);
- gtk_size_group_add_widget(size_group, private->pop3_username_label);
- gtk_size_group_add_widget(size_group, private->pop3_password_label);
- gtk_size_group_add_widget(size_group, private->gmail_username_label);
- gtk_size_group_add_widget(size_group, private->gmail_password_label);
- g_object_unref(size_group);
-
if (parent)
gtk_window_set_transient_for(GTK_WINDOW(dialog), parent);
@@ -172,41 +126,40 @@ mn_mailbox_properties_dialog_new (GtkWindow *parent,
/* finish the combo box */
private->store = gtk_list_store_new(N_COLUMNS,
- G_TYPE_INT,
- G_TYPE_STRING,
- PANGO_TYPE_STYLE);
-
- gtk_list_store_append(private->store, &iter);
- gtk_list_store_set(private->store, &iter,
- COLUMN_TYPE, TYPE_AUTODETECT,
- COLUMN_TEXT, _("autodetect"),
- COLUMN_STYLE, PANGO_STYLE_ITALIC,
- -1);
-
- gtk_list_store_append(private->store, &iter);
- gtk_list_store_set(private->store, &iter,
- COLUMN_TYPE, TYPE_POP3,
- COLUMN_TEXT, "POP3",
- -1);
+ GTK_TYPE_WIDGET,
+ G_TYPE_STRING);
- gtk_list_store_append(private->store, &iter);
- gtk_list_store_set(private->store, &iter,
- COLUMN_TYPE, TYPE_GMAIL,
- COLUMN_TEXT, "Gmail",
- -1);
+ mn_mailbox_properties_dialog_add_type(dialog, MN_TYPE_AUTODETECT_MAILBOX_PROPERTIES);
+ mn_mailbox_properties_dialog_add_type(dialog, MN_TYPE_SYSTEM_MAILBOX_PROPERTIES);
+#ifdef WITH_POP3
+ mn_mailbox_properties_dialog_add_type(dialog, MN_TYPE_POP3_MAILBOX_PROPERTIES);
+#endif
+#ifdef WITH_IMAP
+ mn_mailbox_properties_dialog_add_type(dialog, MN_TYPE_IMAP_MAILBOX_PROPERTIES);
+#endif
+#ifdef WITH_GMAIL
+ mn_mailbox_properties_dialog_add_type(dialog, MN_TYPE_GMAIL_MAILBOX_PROPERTIES);
+#endif
renderer = gtk_cell_renderer_text_new();
- gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(private->type_combo), renderer, TRUE);
- gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(private->type_combo), renderer,
- "text", COLUMN_TEXT,
- "style", COLUMN_STYLE,
+ gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(private->mailbox_type_combo), renderer, TRUE);
+ gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(private->mailbox_type_combo), renderer,
+ "markup", COLUMN_TEXT,
NULL);
- gtk_combo_box_set_model(GTK_COMBO_BOX(private->type_combo), GTK_TREE_MODEL(private->store));
+ gtk_combo_box_set_model(GTK_COMBO_BOX(private->mailbox_type_combo), GTK_TREE_MODEL(private->store));
if (mode == MN_MAILBOX_PROPERTIES_DIALOG_MODE_ADD)
- mn_mailbox_properties_dialog_set_active_type(dialog, selected_type);
-
+ {
+ MNMailboxProperties *properties;
+
+ if (! selected_type)
+ selected_type = MN_TYPE_AUTODETECT_MAILBOX_PROPERTIES;
+
+ properties = mn_mailbox_properties_dialog_get_properties_by_type(dialog, selected_type);
+ mn_mailbox_properties_dialog_set_active_properties(dialog, properties);
+ }
+
return GTK_WIDGET(dialog);
}
@@ -220,99 +173,91 @@ mn_mailbox_properties_dialog_private_free (Private *private)
g_free(private);
}
-static gboolean
-mn_mailbox_properties_dialog_is_complete (MNMailboxPropertiesDialog *dialog)
+static void
+mn_mailbox_properties_dialog_add_type (MNMailboxPropertiesDialog *dialog,
+ GType properties_type)
{
Private *private;
- gboolean is_complete = FALSE;
+ GtkSizeGroup *size_group;
+ MNMailboxProperties *properties;
+ char *label;
+ GtkTreeIter iter;
- g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog), FALSE);
+ g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- switch (mn_mailbox_properties_dialog_get_active_type(dialog))
- {
- case TYPE_AUTODETECT:
- {
- const char *location;
-
- location = gtk_entry_get_text(GTK_ENTRY(private->location_entry));
- is_complete = *location != 0;
- }
- break;
-
- case TYPE_POP3:
-#ifdef WITH_POP3
- {
- const char *hostname;
- const char *username;
- const char *password;
-
- hostname = gtk_entry_get_text(GTK_ENTRY(private->pop3_hostname_entry));
- username = gtk_entry_get_text(GTK_ENTRY(private->pop3_username_entry));
- password = gtk_entry_get_text(GTK_ENTRY(private->pop3_password_entry));
+ size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ properties = g_object_new(properties_type, "size-group", size_group, NULL);
+ g_object_unref(size_group);
- is_complete = *hostname != 0 && *username != 0 && *password != 0;
- }
-#endif /* WITH_POP3 */
- break;
+ g_object_ref(properties);
+ gtk_object_sink(GTK_OBJECT(properties));
- case TYPE_GMAIL:
-#ifdef WITH_GMAIL
- {
- const char *username;
- const char *password;
-
- username = gtk_entry_get_text(GTK_ENTRY(private->gmail_username_entry));
- password = gtk_entry_get_text(GTK_ENTRY(private->gmail_password_entry));
-
- is_complete = *username != 0 && *password != 0;
- }
-#endif /* WITH_GMAIL */
- break;
+ gtk_list_store_append(private->store, &iter);
- default:
- g_return_val_if_reached(FALSE);
- }
-
- return is_complete;
+ label = mn_mailbox_properties_get_label(properties);
+ gtk_list_store_set(private->store, &iter,
+ COLUMN_PROPERTIES, properties,
+ COLUMN_TEXT, label,
+ -1);
+ g_free(label);
+
+ gtk_widget_show(GTK_WIDGET(properties));
+ g_signal_connect_swapped(G_OBJECT(properties), "notify::complete", G_CALLBACK(mn_mailbox_properties_dialog_update_sensitivity), dialog);
+
+ g_object_unref(properties); /* now it belongs to the store */
}
-static Type
-mn_mailbox_properties_dialog_get_active_type (MNMailboxPropertiesDialog *dialog)
+static void
+mn_mailbox_properties_dialog_select_properties (MNMailboxPropertiesDialog *dialog)
{
Private *private;
- GtkTreeIter iter;
- Type type = TYPE_AUTODETECT;
+ MNMailboxProperties *properties;
+ GtkSizeGroup *size_group;
- g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog), 0);
+ g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(private->type_combo), &iter))
- gtk_tree_model_get(GTK_TREE_MODEL(private->store), &iter, COLUMN_TYPE, &type, -1);
+ properties = (MNMailboxProperties *) GTK_BIN(private->properties_event_box)->child;
+ if (properties)
+ {
+ size_group = mn_mailbox_properties_get_size_group(properties);
+ gtk_size_group_remove_widget(size_group, private->mailbox_type_label);
+ gtk_container_remove(GTK_CONTAINER(private->properties_event_box), GTK_WIDGET(properties));
+ }
+
+ properties = mn_mailbox_properties_dialog_get_active_properties(dialog);
+ gtk_container_add(GTK_CONTAINER(private->properties_event_box), GTK_WIDGET(properties));
+ size_group = mn_mailbox_properties_get_size_group(properties);
+ gtk_size_group_add_widget(size_group, private->mailbox_type_label);
- return type;
+ /* force the dialog to recalculate its size */
+ gtk_window_resize(GTK_WINDOW(dialog), 1, 1);
}
static void
-mn_mailbox_properties_dialog_set_active_type (MNMailboxPropertiesDialog *dialog,
- Type type)
+mn_mailbox_properties_dialog_set_active_properties (MNMailboxPropertiesDialog *dialog,
+ MNMailboxProperties *properties)
{
Private *private;
gboolean valid;
GtkTreeIter iter;
g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
+ g_return_if_fail(MN_IS_MAILBOX_PROPERTIES(properties));
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(private->store), &iter);
while (valid)
{
- Type this_type;
+ MNMailboxProperties *these_properties;
- gtk_tree_model_get(GTK_TREE_MODEL(private->store), &iter, COLUMN_TYPE, &this_type, -1);
- if (this_type == type)
+ gtk_tree_model_get(GTK_TREE_MODEL(private->store), &iter, COLUMN_PROPERTIES, &these_properties, -1);
+ g_object_unref(these_properties);
+
+ if (these_properties == properties)
{
- gtk_combo_box_set_active_iter(GTK_COMBO_BOX(private->type_combo), &iter);
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(private->mailbox_type_combo), &iter);
break;
}
@@ -320,59 +265,51 @@ mn_mailbox_properties_dialog_set_active_type (MNMailboxPropertiesDialog *dialog,
}
}
-static void
-mn_mailbox_properties_dialog_update_sensitivity (MNMailboxPropertiesDialog *dialog)
+static MNMailboxProperties *
+mn_mailbox_properties_dialog_get_active_properties (MNMailboxPropertiesDialog *dialog)
{
Private *private;
- Type type;
- gboolean is_complete;
+ GtkTreeIter iter;
+ MNMailboxProperties *properties = NULL;
- g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
+ g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog), 0);
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- type = mn_mailbox_properties_dialog_get_active_type(dialog);
-
- switch (mn_mailbox_properties_dialog_get_active_type(dialog))
+ if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(private->mailbox_type_combo), &iter))
{
- case TYPE_AUTODETECT:
- gtk_widget_show(private->autodetect_vbox);
- gtk_widget_hide(private->unsupported_label);
- gtk_widget_hide(private->pop3_vbox);
- gtk_widget_hide(private->gmail_vbox);
- break;
-
- case TYPE_POP3:
-#ifdef WITH_POP3
- gtk_widget_show(private->pop3_vbox);
- gtk_widget_hide(private->unsupported_label);
-#else
- gtk_widget_show(private->unsupported_label);
- gtk_widget_hide(private->pop3_vbox);
-#endif /* WITH_POP3 */
- gtk_widget_hide(private->autodetect_vbox);
- gtk_widget_hide(private->gmail_vbox);
- break;
-
- case TYPE_GMAIL:
-#ifdef WITH_GMAIL
- gtk_widget_show(private->gmail_vbox);
- gtk_widget_hide(private->unsupported_label);
-#else
- gtk_widget_show(private->unsupported_label);
- gtk_widget_hide(private->gmail_vbox);
-#endif /* WITH_GMAIL */
- gtk_widget_hide(private->autodetect_vbox);
- gtk_widget_hide(private->pop3_vbox);
- break;
-
- default:
- g_return_if_reached();
+ gtk_tree_model_get(GTK_TREE_MODEL(private->store), &iter, COLUMN_PROPERTIES, &properties, -1);
+ g_object_unref(properties);
}
-
- is_complete = mn_mailbox_properties_dialog_is_complete(dialog);
- if (private->apply_button)
- gtk_widget_set_sensitive(private->apply_button, is_complete);
- gtk_widget_set_sensitive(private->accept_button, is_complete);
+
+ return properties;
+}
+
+static MNMailboxProperties *
+mn_mailbox_properties_dialog_get_properties_by_type (MNMailboxPropertiesDialog *dialog,
+ GType type)
+{
+ Private *private;
+ gboolean valid;
+ GtkTreeIter iter;
+
+ g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog), NULL);
+ private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
+
+ valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(private->store), &iter);
+ while (valid)
+ {
+ MNMailboxProperties *properties;
+
+ gtk_tree_model_get(GTK_TREE_MODEL(private->store), &iter, COLUMN_PROPERTIES, &properties, -1);
+ g_object_unref(properties);
+
+ if (G_TYPE_CHECK_INSTANCE_TYPE(properties, type))
+ return properties;
+
+ valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(private->store), &iter);
+ }
+
+ return NULL;
}
static void
@@ -398,128 +335,57 @@ mn_mailbox_properties_dialog_set_uri_internal (MNMailboxPropertiesDialog *dialog
g_free(title);
}
-static void
-mn_mailbox_properties_dialog_fill (MNMailboxPropertiesDialog *dialog)
+void
+mn_mailbox_properties_dialog_set_uri (MNMailboxPropertiesDialog *dialog,
+ const char *uri)
{
Private *private;
- Type type;
- char *hostname;
- int port;
- char *username;
- char *password;
+ gboolean valid;
+ GtkTreeIter iter;
+ MNMailboxProperties *properties;
+ gboolean found = FALSE;
g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- g_return_if_fail(private->uri != NULL);
+ g_return_if_fail(private->uri == NULL);
- if (mn_uri_parse_pop(private->uri, &username, &password, &hostname, &port))
- {
- type = TYPE_POP3;
+ mn_mailbox_properties_dialog_set_uri_internal(dialog, uri);
-#ifdef WITH_POP3
- gtk_entry_set_text(GTK_ENTRY(private->pop3_hostname_entry), hostname);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(private->pop3_port_spin), port);
- gtk_entry_set_text(GTK_ENTRY(private->pop3_username_entry), username);
- gtk_entry_set_text(GTK_ENTRY(private->pop3_password_entry), password);
-#endif /* WITH_POP3 */
-
- g_free(hostname);
- g_free(username);
- g_free(password);
- }
- else if (mn_uri_parse_gmail(private->uri, &username, &password))
+ valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(private->store), &iter);
+ while (valid)
{
- type = TYPE_GMAIL;
+ gtk_tree_model_get(GTK_TREE_MODEL(private->store), &iter, COLUMN_PROPERTIES, &properties, -1);
+ g_object_unref(properties);
-#ifdef WITH_GMAIL
- gtk_entry_set_text(GTK_ENTRY(private->gmail_username_entry), username);
- gtk_entry_set_text(GTK_ENTRY(private->gmail_password_entry), password);
-#endif /* WITH_GMAIL */
+ if (! MN_IS_AUTODETECT_MAILBOX_PROPERTIES(properties)
+ && mn_mailbox_properties_set_uri(properties, uri))
+ {
+ found = TRUE;
+ break;
+ }
- g_free(username);
- g_free(password);
+ valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(private->store), &iter);
}
- else
- {
- type = TYPE_AUTODETECT;
- gtk_entry_set_text(GTK_ENTRY(private->location_entry), private->uri);
+ if (! found)
+ {
+ properties = mn_mailbox_properties_dialog_get_properties_by_type(dialog, MN_TYPE_AUTODETECT_MAILBOX_PROPERTIES);
+ mn_mailbox_properties_set_uri(properties, uri);
}
-
- mn_mailbox_properties_dialog_set_active_type(dialog, type);
-}
-
-void
-mn_mailbox_properties_dialog_set_uri (MNMailboxPropertiesDialog *dialog,
- const char *uri)
-{
- Private *private;
-
- g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
- private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- g_return_if_fail(private->uri == NULL);
-
- mn_mailbox_properties_dialog_set_uri_internal(dialog, uri);
- mn_mailbox_properties_dialog_fill(dialog);
+ mn_mailbox_properties_dialog_set_active_properties(dialog, properties);
}
char *
mn_mailbox_properties_dialog_get_uri (MNMailboxPropertiesDialog *dialog)
{
Private *private;
- char *uri;
+ MNMailboxProperties *properties;
g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog), NULL);
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- switch (mn_mailbox_properties_dialog_get_active_type(dialog))
- {
- case TYPE_AUTODETECT:
- {
- const char *location;
-
- location = gtk_entry_get_text(GTK_ENTRY(private->location_entry));
- uri = g_strdup(location);
- }
- break;
-
-#ifdef WITH_POP3
- case TYPE_POP3:
- {
- const char *hostname;
- int port;
- const char *username;
- const char *password;
-
- hostname = gtk_entry_get_text(GTK_ENTRY(private->pop3_hostname_entry));
- port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(private->pop3_port_spin));
- username = gtk_entry_get_text(GTK_ENTRY(private->pop3_username_entry));
- password = gtk_entry_get_text(GTK_ENTRY(private->pop3_password_entry));
-
- uri = mn_uri_build_pop(username, password, hostname, port);
- }
- break;
-#endif /* WITH_POP3 */
-
-#ifdef WITH_GMAIL
- case TYPE_GMAIL:
- {
- const char *username;
- const char *password;
-
- username = gtk_entry_get_text(GTK_ENTRY(private->gmail_username_entry));
- password = gtk_entry_get_text(GTK_ENTRY(private->gmail_password_entry));
-
- uri = mn_uri_build_gmail(username, password);
- }
- break;
-#endif /* TYPE_GMAIL */
-
- default:
- g_return_val_if_reached(NULL);
- }
-
- return uri;
+ properties = mn_mailbox_properties_dialog_get_active_properties(dialog);
+ return mn_mailbox_properties_get_uri(properties);
}
void
@@ -549,7 +415,7 @@ mn_mailbox_properties_dialog_apply (MNMailboxPropertiesDialog *dialog)
}
eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_slist_free(gconf_mailboxes);
+ mn_pointers_free(gconf_mailboxes);
mn_mailbox_properties_dialog_set_uri_internal(dialog, new_uri);
}
@@ -557,95 +423,46 @@ mn_mailbox_properties_dialog_apply (MNMailboxPropertiesDialog *dialog)
}
static void
-mn_mailbox_properties_dialog_current_folder_changed_h (GtkFileChooser *chooser,
- gpointer user_data)
-{
- g_free(current_folder_uri);
- current_folder_uri = gtk_file_chooser_get_current_folder_uri(chooser);
-}
-
-/* libglade callbacks */
-
-void
-mn_mailbox_properties_dialog_browse_clicked_h (gpointer user_data,
- GtkButton *button)
+mn_mailbox_properties_dialog_update_sensitivity (MNMailboxPropertiesDialog *dialog)
{
- MNMailboxPropertiesDialog *dialog = user_data;
Private *private;
- GtkWidget *chooser;
- const char *location;
+ MNMailboxProperties *properties;
+ g_return_if_fail(MN_IS_MAILBOX_PROPERTIES_DIALOG(dialog));
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- chooser = gtk_file_chooser_dialog_new_with_backend(_("Select a File or Folder"),
- GTK_WINDOW(dialog),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- "gnome-vfs",
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, 1,
- NULL);
-
- gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(chooser), FALSE);
- mn_file_chooser_dialog_allow_select_folder(GTK_FILE_CHOOSER_DIALOG(chooser), 1);
-
- if (private->mode == MN_MAILBOX_PROPERTIES_DIALOG_MODE_ADD)
+ properties = mn_mailbox_properties_dialog_get_active_properties(dialog);
+ if (properties)
{
- if (current_folder_uri)
- gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(chooser), current_folder_uri);
- g_signal_connect(G_OBJECT(chooser), "current-folder-changed", G_CALLBACK(mn_mailbox_properties_dialog_current_folder_changed_h), NULL);
- }
+ gboolean complete;
- location = gtk_entry_get_text(GTK_ENTRY(private->location_entry));
- if (*location)
- gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(chooser), location);
+ g_object_get(G_OBJECT(properties), "complete", &complete, NULL);
- if (gtk_dialog_run(GTK_DIALOG(chooser)) == 1)
- {
- char *uri;
-
- uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(chooser));
- gtk_entry_set_text(GTK_ENTRY(private->location_entry), uri);
- g_free(uri);
+ if (private->apply_button)
+ gtk_widget_set_sensitive(private->apply_button, complete);
+ gtk_widget_set_sensitive(private->accept_button, complete);
}
-
- gtk_widget_destroy(chooser);
}
+/* libglade callbacks */
+
void
-mn_mailbox_properties_dialog_type_changed_h (gpointer user_data,
- GtkComboBox *combobox)
+mn_mailbox_properties_dialog_mailbox_type_changed_h (gpointer user_data,
+ GtkComboBox *combobox)
{
MNMailboxPropertiesDialog *dialog = user_data;
Private *private;
private = MN_MAILBOX_PROPERTIES_DIALOG_PRIVATE(dialog);
- if (private->mode == MN_MAILBOX_PROPERTIES_DIALOG_MODE_ADD)
- selected_type = mn_mailbox_properties_dialog_get_active_type(dialog);
-
- mn_mailbox_properties_dialog_update_sensitivity(dialog);
-}
-
-void
-mn_mailbox_properties_dialog_entry_activate_h (gpointer user_data,
- GtkEntry *entry)
-{
- GtkWidget *next = user_data;
- GtkWidget *toplevel;
-
- toplevel = gtk_widget_get_toplevel(GTK_WIDGET(entry));
- if (GTK_WIDGET_TOPLEVEL(toplevel)
- && GTK_WINDOW(toplevel)->default_widget
- && GTK_WIDGET_IS_SENSITIVE(GTK_WINDOW(toplevel)->default_widget))
- gtk_window_activate_default(GTK_WINDOW(toplevel));
- else
- gtk_widget_grab_focus(next);
-}
-void
-mn_mailbox_properties_dialog_entry_changed_h (gpointer user_data,
- GtkEditable *editable)
-{
- MNMailboxPropertiesDialog *dialog = user_data;
+ mn_mailbox_properties_dialog_select_properties(dialog);
+ if (private->mode == MN_MAILBOX_PROPERTIES_DIALOG_MODE_ADD)
+ {
+ MNMailboxProperties *properties;
+
+ properties = mn_mailbox_properties_dialog_get_active_properties(dialog);
+ selected_type = G_TYPE_FROM_INSTANCE(properties);
+ }
mn_mailbox_properties_dialog_update_sensitivity(dialog);
}
diff --git a/src/mn-mailbox-properties-util.c b/src/mn-mailbox-properties-util.c
@@ -0,0 +1,191 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include <stdarg.h>
+#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+#include "mn-mailbox-properties-util.h"
+#include "mn-auth-combo-box.h"
+
+/*** functions ***************************************************************/
+
+#if defined(WITH_POP3) || defined(WITH_IMAP) || defined(WITH_GMAIL)
+static void mn_mailbox_properties_entry_activate_h (GtkEntry *entry, gpointer user_data);
+#endif
+
+/*** implementation **********************************************************/
+
+#if defined(WITH_POP3) || defined(WITH_IMAP) || defined(WITH_GMAIL)
+void
+mn_mailbox_properties_field_new (GtkVBox *vbox,
+ const char *mnemonic,
+ GtkWidget **label,
+ GtkWidget **entry)
+{
+ GtkWidget *hbox;
+
+ g_return_if_fail(GTK_IS_VBOX(vbox));
+ g_return_if_fail(mnemonic != NULL);
+ g_return_if_fail(label != NULL);
+ g_return_if_fail(entry != NULL);
+
+ *label = gtk_label_new_with_mnemonic(mnemonic);
+ gtk_misc_set_alignment(GTK_MISC(*label), 0.0, 0.5);
+
+ *entry = gtk_entry_new();
+ gtk_label_set_mnemonic_widget(GTK_LABEL(*label), *entry);
+
+ hbox = gtk_hbox_new(FALSE, 12);
+ gtk_box_pack_start(GTK_BOX(hbox), *label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), *entry, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(hbox);
+}
+
+void
+mn_mailbox_properties_credentials_new (GtkVBox *vbox,
+ GtkWidget **username_label,
+ GtkWidget **username_entry,
+ GtkWidget **password_label,
+ GtkWidget **password_entry)
+{
+ g_return_if_fail(GTK_IS_VBOX(vbox));
+ g_return_if_fail(username_label != NULL);
+ g_return_if_fail(username_entry != NULL);
+ g_return_if_fail(password_label != NULL);
+ g_return_if_fail(password_entry != NULL);
+
+ mn_mailbox_properties_field_new(vbox,
+ _("_Username:"),
+ username_label,
+ username_entry);
+ mn_mailbox_properties_field_new(vbox,
+ _("_Password:"),
+ password_label,
+ password_entry);
+ gtk_entry_set_visibility(GTK_ENTRY(*password_entry), FALSE);
+}
+
+void
+mn_mailbox_properties_link_entries (GtkEntry *first, ...)
+{
+ va_list args;
+ GtkEntry *entry = first;
+ GtkEntry *next;
+
+ g_return_if_fail(GTK_IS_ENTRY(first));
+
+ va_start(args, first);
+ do
+ {
+ next = va_arg(args, GtkEntry *);
+ if (next)
+ g_return_if_fail(GTK_IS_ENTRY(next));
+
+ g_signal_connect(G_OBJECT(entry),
+ "activate",
+ G_CALLBACK(mn_mailbox_properties_entry_activate_h),
+ next ? next : first);
+ entry = next;
+ }
+ while (next);
+ va_end(args);
+}
+
+static void
+mn_mailbox_properties_entry_activate_h (GtkEntry *entry, gpointer user_data)
+{
+ GtkWidget *next = user_data;
+ GtkWidget *toplevel;
+
+ toplevel = gtk_widget_get_toplevel(GTK_WIDGET(entry));
+ if (GTK_WIDGET_TOPLEVEL(toplevel)
+ && GTK_WINDOW(toplevel)->default_widget
+ && GTK_WIDGET_IS_SENSITIVE(GTK_WINDOW(toplevel)->default_widget))
+ gtk_window_activate_default(GTK_WINDOW(toplevel));
+ else
+ gtk_widget_grab_focus(next);
+}
+#endif /* WITH_POP3 || WITH_IMAP || WITH_GMAIL */
+
+#if defined(WITH_POP3) || defined(WITH_IMAP)
+void
+mn_mailbox_properties_connection_type_new (GtkVBox *vbox,
+ const char *mnemonic,
+ int default_port,
+ GtkRadioButton *radio_group,
+ GtkWidget **label,
+ GtkWidget **radio,
+ GtkWidget **spin)
+{
+ GtkWidget *hbox;
+ GtkWidget *port_label;
+
+ g_return_if_fail(GTK_IS_VBOX(vbox));
+ g_return_if_fail(mnemonic != NULL);
+ g_return_if_fail(label != NULL);
+ g_return_if_fail(radio != NULL);
+ g_return_if_fail(spin != NULL);
+
+ *label = gtk_label_new(radio_group ? NULL : _("Connection type:"));
+ gtk_misc_set_alignment(GTK_MISC(*label), 0.0, 0.5);
+
+ *radio = radio_group
+ ? gtk_radio_button_new_with_mnemonic_from_widget(radio_group, mnemonic)
+ : gtk_radio_button_new_with_mnemonic(NULL, mnemonic);
+
+ port_label = gtk_label_new(_("Port:"));
+
+ *spin = gtk_spin_button_new_with_range(0, 0xFFFF, 1);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(*spin), default_port);
+ gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(*spin), TRUE);
+
+ hbox = gtk_hbox_new(FALSE, 12);
+ gtk_box_pack_start(GTK_BOX(hbox), *label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), *radio, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), port_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), *spin, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(hbox);
+}
+
+void
+mn_mailbox_properties_authentication_new (GtkVBox *vbox,
+ GtkWidget **label,
+ GtkWidget **auth_combo)
+{
+ GtkWidget *hbox;
+
+ g_return_if_fail(GTK_IS_VBOX(vbox));
+ g_return_if_fail(label != NULL);
+ g_return_if_fail(auth_combo != NULL);
+
+ hbox = gtk_hbox_new(FALSE, 12);
+ *label = gtk_label_new_with_mnemonic(_("_Authentication mechanism:"));
+ gtk_misc_set_alignment(GTK_MISC(*label), 0.0, 0.5);
+
+ *auth_combo = mn_auth_combo_box_new();
+ gtk_label_set_mnemonic_widget(GTK_LABEL(*label), *auth_combo);
+
+ gtk_box_pack_start(GTK_BOX(hbox), *label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), *auth_combo, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(hbox);
+}
+#endif /* WITH_POP3 || WITH_IMAP */
diff --git a/src/mn-mailbox-properties-util.h b/src/mn-mailbox-properties-util.h
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+#ifndef _MN_MAILBOX_PROPERTIES_UTIL_H
+#define _MN_MAILBOX_PROPERTIES_UTIL_H
+
+#include "config.h"
+#include <stdarg.h>
+#include <gtk/gtk.h>
+
+#if defined(WITH_POP3) || defined(WITH_IMAP) || defined(WITH_GMAIL)
+void mn_mailbox_properties_field_new (GtkVBox *vbox,
+ const char *mnemonic,
+ GtkWidget **label,
+ GtkWidget **entry);
+void mn_mailbox_properties_credentials_new (GtkVBox *vbox,
+ GtkWidget **username_label,
+ GtkWidget **username_entry,
+ GtkWidget **password_label,
+ GtkWidget **password_entry);
+void mn_mailbox_properties_link_entries (GtkEntry *first, ...);
+#endif /* WITH_POP3 || WITH_IMAP || WITH_GMAIL */
+
+#if defined(WITH_POP3) || defined(WITH_IMAP)
+void mn_mailbox_properties_connection_type_new (GtkVBox *vbox,
+ const char *mnemonic,
+ int default_port,
+ GtkRadioButton *radio_group,
+ GtkWidget **label,
+ GtkWidget **radio,
+ GtkWidget **spin);
+void mn_mailbox_properties_authentication_new (GtkVBox *vbox,
+ GtkWidget **label,
+ GtkWidget **auth_combo);
+#endif /* WITH_POP3 || WITH_IMAP */
+
+#endif /* _MN_MAILBOX_PROPERTIES_UTIL_H */
diff --git a/src/mn-mailbox-properties.c b/src/mn-mailbox-properties.c
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+#include "mn-mailbox-properties.h"
+
+/*** functions ***************************************************************/
+
+static void mn_mailbox_properties_iface_init (MNMailboxPropertiesIface *iface);
+
+/*** implementation **********************************************************/
+
+GType
+mn_mailbox_properties_get_type (void)
+{
+ static GType mailbox_properties_type = 0;
+
+ if (! mailbox_properties_type)
+ {
+ static const GTypeInfo mailbox_properties_info = {
+ sizeof(MNMailboxPropertiesIface),
+ NULL,
+ NULL,
+ (GClassInitFunc) mn_mailbox_properties_iface_init,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL
+ };
+
+ mailbox_properties_type = g_type_register_static(G_TYPE_INTERFACE,
+ "MNMailboxProperties",
+ &mailbox_properties_info,
+ 0);
+ }
+
+ return mailbox_properties_type;
+}
+
+static void
+mn_mailbox_properties_iface_init (MNMailboxPropertiesIface *iface)
+{
+ g_object_interface_install_property(iface,
+ g_param_spec_string("label",
+ _("Label"),
+ _("The marked up text to show in the type combo box"),
+ NULL,
+ G_PARAM_READABLE));
+ g_object_interface_install_property(iface,
+ g_param_spec_object("size-group",
+ _("Size group"),
+ _("A GtkSizeGroup for aligning control labels"),
+ GTK_TYPE_SIZE_GROUP,
+ G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_interface_install_property(iface,
+ g_param_spec_boolean("complete",
+ _("Complete"),
+ _("Whether the properties are completely filled or not"),
+ FALSE,
+ G_PARAM_READABLE));
+}
+
+GtkSizeGroup *
+mn_mailbox_properties_get_size_group (MNMailboxProperties *properties)
+{
+ GtkSizeGroup *size_group;
+
+ g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES(properties), NULL);
+
+ g_object_get(G_OBJECT(properties), "size-group", &size_group, NULL);
+ g_object_unref(size_group);
+
+ return size_group;
+}
+
+char *
+mn_mailbox_properties_get_label (MNMailboxProperties *properties)
+{
+ char *label;
+
+ g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES(properties), NULL);
+
+ g_object_get(G_OBJECT(properties), "label", &label, NULL);
+ return label;
+}
+
+gboolean
+mn_mailbox_properties_set_uri (MNMailboxProperties *properties,
+ const char *uri)
+{
+ g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES(properties), FALSE);
+ g_return_val_if_fail(uri != NULL, FALSE);
+
+ return MN_MAILBOX_PROPERTIES_GET_IFACE(properties)->set_uri(properties, uri);
+}
+
+char *
+mn_mailbox_properties_get_uri (MNMailboxProperties *properties)
+{
+ g_return_val_if_fail(MN_IS_MAILBOX_PROPERTIES(properties), NULL);
+
+ return MN_MAILBOX_PROPERTIES_GET_IFACE(properties)->get_uri(properties);
+}
diff --git a/src/mn-mailbox-properties.h b/src/mn-mailbox-properties.h
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+#ifndef _MN_MAILBOX_PROPERTIES_H
+#define _MN_MAILBOX_PROPERTIES_H
+
+#include <glib-object.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))
+#define MN_IS_MAILBOX_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_MAILBOX_PROPERTIES))
+#define MN_MAILBOX_PROPERTIES_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), MN_TYPE_MAILBOX_PROPERTIES, MNMailboxPropertiesIface))
+
+typedef struct _MNMailboxProperties MNMailboxProperties; /* dummy */
+
+typedef struct
+{
+ GTypeInterface parent;
+
+ gboolean (* set_uri) (MNMailboxProperties *properties,
+ const char *uri);
+ char * (* get_uri) (MNMailboxProperties *properties);
+} MNMailboxPropertiesIface;
+
+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);
+
+#endif /* _MN_MAILBOX_PROPERTIES_H */
diff --git a/src/mn-mailbox-view-private.h b/src/mn-mailbox-view-private.h
@@ -0,0 +1,32 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_MAILBOX_VIEW_PRIVATE_H__
+#define __MN_MAILBOX_VIEW_PRIVATE_H__
+
+#include "mn-mailbox-view.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNMailboxViewPrivate {
+#line 50 "mn-mailbox-view.gob"
+ GtkWidget * menu;
+#line 51 "mn-mailbox-view.gob"
+ GtkWidget * remove_item;
+#line 52 "mn-mailbox-view.gob"
+ GtkWidget * cut_item;
+#line 53 "mn-mailbox-view.gob"
+ GtkWidget * copy_item;
+#line 54 "mn-mailbox-view.gob"
+ GtkWidget * paste_item;
+#line 55 "mn-mailbox-view.gob"
+ GtkWidget * properties_item;
+#line 26 "mn-mailbox-view-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mailbox-view.c b/src/mn-mailbox-view.c
@@ -0,0 +1,1403 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 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 <string.h> /* memset() */
+
+#include "mn-mailbox-view.h"
+
+#include "mn-mailbox-view-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 22 "mn-mailbox-view.gob"
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include <gdk/gdkkeysyms.h>
+#include "mn-util.h"
+#include "mn-shell.h"
+#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"
+
+ enum {
+ COLUMN_URI,
+ COLUMN_MAILBOX_ICON,
+ COLUMN_MAILBOX,
+ COLUMN_FORMAT,
+ N_COLUMNS
+ };
+
+ static GtkClipboard *global_clipboard;
+ static GdkAtom gnome_copied_files_atom;
+
+#line 53 "mn-mailbox-view.c"
+/* self casting macros */
+#define SELF(x) MN_MAILBOX_VIEW(x)
+#define SELF_CONST(x) MN_MAILBOX_VIEW_CONST(x)
+#define IS_SELF(x) MN_IS_MAILBOX_VIEW(x)
+#define TYPE_SELF MN_TYPE_MAILBOX_VIEW
+#define SELF_CLASS(x) MN_MAILBOX_VIEW_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_MAILBOX_VIEW_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNMailboxView Self;
+typedef MNMailboxViewClass SelfClass;
+
+/* here are local prototypes */
+static void ___real_mn_mailbox_view_activate_add (MNMailboxView * self);
+static void ___real_mn_mailbox_view_activate_remove (MNMailboxView * self);
+static void ___real_mn_mailbox_view_activate_cut (MNMailboxView * self);
+static void ___real_mn_mailbox_view_activate_copy (MNMailboxView * self);
+static void ___real_mn_mailbox_view_activate_paste (MNMailboxView * self);
+static void mn_mailbox_view_activate_paste_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data) G_GNUC_UNUSED;
+static void ___real_mn_mailbox_view_activate_properties (MNMailboxView * self);
+static void mn_mailbox_view_activate_properties_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data) G_GNUC_UNUSED;
+static void mn_mailbox_view_class_init (MNMailboxViewClass * class) G_GNUC_UNUSED;
+static void mn_mailbox_view_init (MNMailboxView * self) G_GNUC_UNUSED;
+static void ___b_mn_mailbox_view_finalize (GObject * object) G_GNUC_UNUSED;
+static void mn_mailbox_view_update (MNMailboxView * self) G_GNUC_UNUSED;
+static void mn_mailbox_view_update_iter (MNMailboxView * self, GtkTreeIter * iter, MNMailbox * mailbox) G_GNUC_UNUSED;
+static gboolean mn_mailbox_view_has_mailbox (MNMailboxView * self, MNMailbox * mailbox) G_GNUC_UNUSED;
+static void mn_mailbox_view_update_sensitivity (MNMailboxView * self) G_GNUC_UNUSED;
+static void mn_mailbox_view_remove_mailbox (MNMailboxView * self) G_GNUC_UNUSED;
+static void mn_mailbox_view_remove_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data) G_GNUC_UNUSED;
+static void mn_mailbox_view_copy_mailbox (MNMailboxView * self) G_GNUC_UNUSED;
+static void mn_mailbox_view_copy_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data) G_GNUC_UNUSED;
+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_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;
+static gboolean mn_mailbox_view_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data) G_GNUC_UNUSED;
+static void mn_mailbox_view_row_activated_h (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * column, gpointer user_data) G_GNUC_UNUSED;
+
+/*
+ * Signal connection wrapper macro shortcuts
+ */
+#define self_connect__activate_add(object,func,data) mn_mailbox_view_connect__activate_add((object),(func),(data))
+#define self_connect_after__activate_add(object,func,data) mn_mailbox_view_connect_after__activate_add((object),(func),(data))
+#define self_connect_data__activate_add(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_add((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_remove(object,func,data) mn_mailbox_view_connect__activate_remove((object),(func),(data))
+#define self_connect_after__activate_remove(object,func,data) mn_mailbox_view_connect_after__activate_remove((object),(func),(data))
+#define self_connect_data__activate_remove(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_remove((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_cut(object,func,data) mn_mailbox_view_connect__activate_cut((object),(func),(data))
+#define self_connect_after__activate_cut(object,func,data) mn_mailbox_view_connect_after__activate_cut((object),(func),(data))
+#define self_connect_data__activate_cut(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_cut((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_copy(object,func,data) mn_mailbox_view_connect__activate_copy((object),(func),(data))
+#define self_connect_after__activate_copy(object,func,data) mn_mailbox_view_connect_after__activate_copy((object),(func),(data))
+#define self_connect_data__activate_copy(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_copy((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_paste(object,func,data) mn_mailbox_view_connect__activate_paste((object),(func),(data))
+#define self_connect_after__activate_paste(object,func,data) mn_mailbox_view_connect_after__activate_paste((object),(func),(data))
+#define self_connect_data__activate_paste(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_paste((object),(func),(data),(destroy_data),(flags))
+#define self_connect__activate_properties(object,func,data) mn_mailbox_view_connect__activate_properties((object),(func),(data))
+#define self_connect_after__activate_properties(object,func,data) mn_mailbox_view_connect_after__activate_properties((object),(func),(data))
+#define self_connect_data__activate_properties(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_properties((object),(func),(data),(destroy_data),(flags))
+
+enum {
+ ACTIVATE_ADD_SIGNAL,
+ ACTIVATE_REMOVE_SIGNAL,
+ ACTIVATE_CUT_SIGNAL,
+ ACTIVATE_COPY_SIGNAL,
+ ACTIVATE_PASTE_SIGNAL,
+ ACTIVATE_PROPERTIES_SIGNAL,
+ LAST_SIGNAL
+};
+
+static guint object_signals[LAST_SIGNAL] = {0};
+
+/* pointer to the class of our parent */
+static GtkTreeViewClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_activate_add mn_mailbox_view_activate_add
+#define self_activate_remove mn_mailbox_view_activate_remove
+#define self_activate_cut mn_mailbox_view_activate_cut
+#define self_activate_copy mn_mailbox_view_activate_copy
+#define self_activate_paste mn_mailbox_view_activate_paste
+#define self_activate_paste_receive_cb mn_mailbox_view_activate_paste_receive_cb
+#define self_activate_properties mn_mailbox_view_activate_properties
+#define self_activate_properties_cb mn_mailbox_view_activate_properties_cb
+#define self_update mn_mailbox_view_update
+#define self_update_iter mn_mailbox_view_update_iter
+#define self_has_mailbox mn_mailbox_view_has_mailbox
+#define self_update_sensitivity mn_mailbox_view_update_sensitivity
+#define self_remove_mailbox mn_mailbox_view_remove_mailbox
+#define self_remove_mailbox_cb mn_mailbox_view_remove_mailbox_cb
+#define self_copy_mailbox mn_mailbox_view_copy_mailbox
+#define self_copy_mailbox_cb mn_mailbox_view_copy_mailbox_cb
+#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_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
+#define self_button_press_event_h mn_mailbox_view_button_press_event_h
+#define self_row_activated_h mn_mailbox_view_row_activated_h
+#define self_new mn_mailbox_view_new
+GType
+mn_mailbox_view_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNMailboxViewClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_mailbox_view_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNMailboxView),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_mailbox_view_init,
+ NULL
+ };
+
+ type = g_type_register_static (GTK_TYPE_TREE_VIEW, "MNMailboxView", &info, (GTypeFlags)0);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNMailboxView *)g_object_new(mn_mailbox_view_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNMailboxView * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNMailboxView *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNMailboxView *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNMailboxView *)g_object_new_valist (mn_mailbox_view_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___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"
+ ___b_mn_mailbox_view_finalize(obj_self);
+#line 212 "mn-mailbox-view.c"
+#line 50 "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"
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
+
+#line 214 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_class_init (MNMailboxViewClass * class G_GNUC_UNUSED)
+#line 223 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+
+ parent_class = g_type_class_ref (GTK_TYPE_TREE_VIEW);
+
+ object_signals[ACTIVATE_ADD_SIGNAL] =
+ g_signal_new ("activate_add",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailboxViewClass, activate_add),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_REMOVE_SIGNAL] =
+ g_signal_new ("activate_remove",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailboxViewClass, activate_remove),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_CUT_SIGNAL] =
+ g_signal_new ("activate_cut",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailboxViewClass, activate_cut),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_COPY_SIGNAL] =
+ g_signal_new ("activate_copy",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailboxViewClass, activate_copy),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_PASTE_SIGNAL] =
+ g_signal_new ("activate_paste",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailboxViewClass, activate_paste),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[ACTIVATE_PROPERTIES_SIGNAL] =
+ g_signal_new ("activate_properties",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MNMailboxViewClass, activate_properties),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+#line 57 "mn-mailbox-view.gob"
+ class->activate_add = ___real_mn_mailbox_view_activate_add;
+#line 102 "mn-mailbox-view.gob"
+ class->activate_remove = ___real_mn_mailbox_view_activate_remove;
+#line 108 "mn-mailbox-view.gob"
+ class->activate_cut = ___real_mn_mailbox_view_activate_cut;
+#line 115 "mn-mailbox-view.gob"
+ class->activate_copy = ___real_mn_mailbox_view_activate_copy;
+#line 121 "mn-mailbox-view.gob"
+ class->activate_paste = ___real_mn_mailbox_view_activate_paste;
+#line 179 "mn-mailbox-view.gob"
+ class->activate_properties = ___real_mn_mailbox_view_activate_properties;
+#line 322 "mn-mailbox-view.gob"
+ g_object_class->finalize = ___finalize;
+#line 293 "mn-mailbox-view.c"
+ {
+#line 215 "mn-mailbox-view.gob"
+
+ GtkBindingSet *binding_set;
+
+ global_clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
+ gnome_copied_files_atom = gdk_atom_intern(GNOME_COPIED_FILES, FALSE);
+
+ binding_set = gtk_binding_set_by_class(class);
+
+ /* Delete removes a row */
+ gtk_binding_entry_add_signal(binding_set, GDK_Delete, 0, "activate-remove", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_KP_Delete, 0, "activate-remove", 0);
+
+ /* HIG 2.0 cut/copy/paste shortcuts */
+ gtk_binding_entry_add_signal(binding_set, GDK_x, GDK_CONTROL_MASK, "activate-cut", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_c, GDK_CONTROL_MASK, "activate-copy", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_v, GDK_CONTROL_MASK, "activate-paste", 0);
+
+ /* cut/copy/paste shortcuts taken from gtkentry.c */
+ gtk_binding_entry_add_signal(binding_set, GDK_Delete, GDK_SHIFT_MASK, "activate-cut", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_Insert, GDK_CONTROL_MASK, "activate-copy", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_Insert, GDK_SHIFT_MASK, "activate-paste", 0);
+
+ /* HIG 2.0 properties */
+ gtk_binding_entry_add_signal(binding_set, GDK_Return, GDK_MOD1_MASK, "activate-properties", 0);
+ 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"
+ }
+}
+#undef __GOB_FUNCTION__
+#line 243 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_init (MNMailboxView * self G_GNUC_UNUSED)
+#line 330 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::init"
+ self->_priv = g_new0 (MNMailboxViewPrivate, 1);
+#line 50 "mn-mailbox-view.gob"
+ self->_priv->menu = gtk_menu_new();
+#line 336 "mn-mailbox-view.c"
+ {
+#line 244 "mn-mailbox-view.gob"
+
+ GtkMenuShell *shell;
+ GtkWidget *add_item;
+ GtkWidget *select_all_item;
+ GtkListStore *store;
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer;
+ GtkTreeSelection *selection;
+
+ shell = GTK_MENU_SHELL(selfp->menu);
+
+ add_item = mn_menu_shell_append(shell, GTK_STOCK_ADD, NULL);
+ selfp->remove_item = mn_menu_shell_append(shell, GTK_STOCK_REMOVE, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ selfp->cut_item = mn_menu_shell_append(shell, GTK_STOCK_CUT, NULL);
+ selfp->copy_item = mn_menu_shell_append(shell, GTK_STOCK_COPY, NULL);
+ selfp->paste_item = mn_menu_shell_append(shell, GTK_STOCK_PASTE, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ select_all_item = mn_menu_shell_append(shell, MN_STOCK_SELECT_ALL, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ selfp->properties_item = mn_menu_shell_append(shell, GTK_STOCK_PROPERTIES, NULL);
+
+ g_signal_connect_swapped(G_OBJECT(add_item), "activate", G_CALLBACK(self_activate_add), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->remove_item), "activate", G_CALLBACK(self_activate_remove), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->cut_item), "activate", G_CALLBACK(self_activate_cut), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->copy_item), "activate", G_CALLBACK(self_activate_copy), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->paste_item), "activate", G_CALLBACK(self_activate_paste), self);
+ g_signal_connect_swapped(G_OBJECT(select_all_item), "activate", G_CALLBACK(self_select_all), self);
+ 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,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(self), GTK_TREE_MODEL(store));
+ g_object_unref(store);
+
+ column = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title(column, _("Mailbox"));
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_MAILBOX);
+
+ renderer = gtk_cell_renderer_pixbuf_new();
+ gtk_tree_view_column_pack_start(column, renderer, FALSE);
+ gtk_tree_view_column_add_attribute(column, renderer, "stock-id", COLUMN_MAILBOX_ICON);
+
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(column, renderer, TRUE);
+ gtk_tree_view_column_add_attribute(column, renderer, "text", COLUMN_MAILBOX);
+
+ gtk_tree_view_append_column(GTK_TREE_VIEW(self), column);
+
+ column = gtk_tree_view_column_new_with_attributes(_("Format"),
+ gtk_cell_renderer_text_new(),
+ "text", COLUMN_FORMAT,
+ NULL);
+
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_FORMAT);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(self), column);
+
+ gtk_tree_view_set_search_column(GTK_TREE_VIEW(self), COLUMN_MAILBOX);
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
+ gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+
+ self_update(self);
+ self_update_sensitivity(self);
+
+ g_signal_connect_swapped(G_OBJECT(mn_shell->mailboxes), "list-changed", G_CALLBACK(self_update), self);
+ g_signal_connect_swapped(G_OBJECT(selection), "changed", G_CALLBACK(self_update_sensitivity), self);
+
+ g_signal_connect(G_OBJECT(self), "popup-menu", G_CALLBACK(self_popup_menu_h), NULL);
+ 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"
+ }
+}
+#undef __GOB_FUNCTION__
+
+#line 57 "mn-mailbox-view.gob"
+void
+mn_mailbox_view_activate_add (MNMailboxView * self)
+#line 424 "mn-mailbox-view.c"
+{
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 57 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 57 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 436 "mn-mailbox-view.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_ADD_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
+}
+#line 57 "mn-mailbox-view.gob"
+static void
+___real_mn_mailbox_view_activate_add (MNMailboxView * self G_GNUC_UNUSED)
+#line 452 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_add"
+{
+#line 59 "mn-mailbox-view.gob"
+
+ GtkWidget *toplevel;
+ GtkWidget *dialog;
+
+ 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);
+ }}
+#line 499 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 102 "mn-mailbox-view.gob"
+void
+mn_mailbox_view_activate_remove (MNMailboxView * self)
+#line 505 "mn-mailbox-view.c"
+{
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 102 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 102 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 517 "mn-mailbox-view.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_REMOVE_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
+}
+#line 102 "mn-mailbox-view.gob"
+static void
+___real_mn_mailbox_view_activate_remove (MNMailboxView * self G_GNUC_UNUSED)
+#line 533 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_remove"
+{
+#line 104 "mn-mailbox-view.gob"
+
+ self_remove_mailbox(self);
+ }}
+#line 541 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 108 "mn-mailbox-view.gob"
+void
+mn_mailbox_view_activate_cut (MNMailboxView * self)
+#line 547 "mn-mailbox-view.c"
+{
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 108 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 108 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 559 "mn-mailbox-view.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_CUT_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
+}
+#line 108 "mn-mailbox-view.gob"
+static void
+___real_mn_mailbox_view_activate_cut (MNMailboxView * self G_GNUC_UNUSED)
+#line 575 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_cut"
+{
+#line 110 "mn-mailbox-view.gob"
+
+ self_copy_mailbox(self);
+ self_remove_mailbox(self);
+ }}
+#line 584 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 115 "mn-mailbox-view.gob"
+void
+mn_mailbox_view_activate_copy (MNMailboxView * self)
+#line 590 "mn-mailbox-view.c"
+{
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 115 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 115 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 602 "mn-mailbox-view.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_COPY_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
+}
+#line 115 "mn-mailbox-view.gob"
+static void
+___real_mn_mailbox_view_activate_copy (MNMailboxView * self G_GNUC_UNUSED)
+#line 618 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_copy"
+{
+#line 117 "mn-mailbox-view.gob"
+
+ self_copy_mailbox(self);
+ }}
+#line 626 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 121 "mn-mailbox-view.gob"
+void
+mn_mailbox_view_activate_paste (MNMailboxView * self)
+#line 632 "mn-mailbox-view.c"
+{
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 121 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 121 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 644 "mn-mailbox-view.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_PASTE_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
+}
+#line 121 "mn-mailbox-view.gob"
+static void
+___real_mn_mailbox_view_activate_paste (MNMailboxView * self G_GNUC_UNUSED)
+#line 660 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_paste"
+{
+#line 123 "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"
+#undef __GOB_FUNCTION__
+
+#line 130 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_paste_receive_cb"
+#line 130 "mn-mailbox-view.gob"
+ g_return_if_fail (clipboard != NULL);
+#line 130 "mn-mailbox-view.gob"
+ g_return_if_fail (selection_data != NULL);
+#line 684 "mn-mailbox-view.c"
+{
+#line 134 "mn-mailbox-view.gob"
+
+ if (selection_data->type == gnome_copied_files_atom
+ && selection_data->format == 8
+ && selection_data->length > 0)
+ {
+ char *gnome_copied_files;
+ gboolean status;
+ MNGnomeCopiedFilesType type;
+ GSList *uri_list;
+
+ gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
+ status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
+ g_free(gnome_copied_files);
+
+ if (status)
+ {
+ if (type == MN_GNOME_COPIED_FILES_COPY)
+ {
+ GSList *new_mailboxes = NULL;
+ GSList *l;
+
+ MN_LIST_FOREACH(l, uri_list)
+ {
+ const char *uri = l->data;
+
+ if (! mn_mailboxes_find(mn_shell->mailboxes, uri))
+ new_mailboxes = g_slist_append(new_mailboxes, g_strdup(uri));
+ }
+
+ if (new_mailboxes)
+ {
+ GSList *gconf_mailboxes;
+
+ 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);
+ }
+ }
+
+ mn_pointers_free(uri_list);
+ }
+ }
+ }}
+#line 731 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 179 "mn-mailbox-view.gob"
+void
+mn_mailbox_view_activate_properties (MNMailboxView * self)
+#line 737 "mn-mailbox-view.c"
+{
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 179 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 179 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 749 "mn-mailbox-view.c"
+
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
+
+ g_signal_emitv (___param_values,
+ object_signals[ACTIVATE_PROPERTIES_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
+
+ g_value_unset (&___param_values[0]);
+}
+#line 179 "mn-mailbox-view.gob"
+static void
+___real_mn_mailbox_view_activate_properties (MNMailboxView * self G_GNUC_UNUSED)
+#line 765 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_properties"
+{
+#line 181 "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"
+#undef __GOB_FUNCTION__
+
+#line 188 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_properties_cb"
+#line 188 "mn-mailbox-view.gob"
+ g_return_if_fail (model != NULL);
+#line 188 "mn-mailbox-view.gob"
+ g_return_if_fail (GTK_IS_TREE_MODEL (model));
+#line 188 "mn-mailbox-view.gob"
+ g_return_if_fail (path != NULL);
+#line 188 "mn-mailbox-view.gob"
+ g_return_if_fail (iter != NULL);
+#line 188 "mn-mailbox-view.gob"
+ g_return_if_fail (data != NULL);
+#line 795 "mn-mailbox-view.c"
+{
+#line 193 "mn-mailbox-view.gob"
+
+ Self *self = data;
+ GtkWidget *toplevel;
+ GtkWidget *dialog;
+ char *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_signal_connect(G_OBJECT(dialog),
+ "response",
+ G_CALLBACK(self_properties_response_h),
+ NULL);
+
+ gtk_widget_show(dialog);
+ }}
+#line 818 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+
+
+#line 322 "mn-mailbox-view.gob"
+static void
+___b_mn_mailbox_view_finalize (GObject * object G_GNUC_UNUSED)
+#line 826 "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"
+ g_return_if_fail (object != NULL);
+#line 322 "mn-mailbox-view.gob"
+ g_return_if_fail (G_IS_OBJECT (object));
+#line 836 "mn-mailbox-view.c"
+{
+#line 324 "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"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 329 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_update (MNMailboxView * self)
+#line 850 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::update"
+#line 329 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 329 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 857 "mn-mailbox-view.c"
+{
+#line 331 "mn-mailbox-view.gob"
+
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gboolean valid;
+ MNMailbox *mailbox;
+ GSList *l;
+
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
+
+ /* first step: remove or update old mailboxes */
+
+ valid = gtk_tree_model_get_iter_first(model, &iter);
+ while (valid)
+ {
+ char *uri;
+
+ gtk_tree_model_get(model, &iter, COLUMN_URI, &uri, -1);
+ mailbox = mn_mailboxes_find(mn_shell->mailboxes, uri);
+ g_free(uri);
+
+ if (mailbox)
+ {
+ self_update_iter(self, &iter, mailbox);
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+ else
+ valid = gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+ }
+
+ /* second step: add new mailboxes */
+
+ MN_LIST_FOREACH(l, mn_mailboxes_get(mn_shell->mailboxes))
+ {
+ mailbox = l->data;
+
+ if (! self_has_mailbox(self, mailbox))
+ {
+ gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+ self_update_iter(self, &iter, mailbox);
+ }
+ }
+ }}
+#line 902 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 374 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_update_iter (MNMailboxView * self, GtkTreeIter * iter, MNMailbox * mailbox)
+#line 908 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::update_iter"
+#line 374 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 374 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 374 "mn-mailbox-view.gob"
+ g_return_if_fail (iter != NULL);
+#line 374 "mn-mailbox-view.gob"
+ g_return_if_fail (mailbox != NULL);
+#line 374 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX (mailbox));
+#line 921 "mn-mailbox-view.c"
+{
+#line 378 "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))
+ 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;
+ }
+
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
+ gtk_list_store_set(GTK_LIST_STORE(model), iter,
+ COLUMN_URI, uri,
+ COLUMN_MAILBOX_ICON, stock_id,
+ COLUMN_MAILBOX, mn_mailbox_get_name(mailbox),
+ COLUMN_FORMAT, class->format,
+ -1);
+ }}
+#line 953 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 408 "mn-mailbox-view.gob"
+static gboolean
+mn_mailbox_view_has_mailbox (MNMailboxView * self, MNMailbox * mailbox)
+#line 959 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::has_mailbox"
+#line 408 "mn-mailbox-view.gob"
+ g_return_val_if_fail (self != NULL, (gboolean )0);
+#line 408 "mn-mailbox-view.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_VIEW (self), (gboolean )0);
+#line 408 "mn-mailbox-view.gob"
+ g_return_val_if_fail (mailbox != NULL, (gboolean )0);
+#line 408 "mn-mailbox-view.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX (mailbox), (gboolean )0);
+#line 970 "mn-mailbox-view.c"
+{
+#line 410 "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;
+
+ gtk_tree_model_get(model, &iter, COLUMN_URI, &this_uri, -1);
+ has = ! mn_uri_cmp(this_uri, uri);
+ g_free(this_uri);
+
+ if (has)
+ break;
+
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+
+ return has;
+ }}
+#line 1000 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 438 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_update_sensitivity (MNMailboxView * self)
+#line 1006 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::update_sensitivity"
+#line 438 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 438 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 1013 "mn-mailbox-view.c"
+{
+#line 440 "mn-mailbox-view.gob"
+
+ GtkTreeSelection *selection;
+ gboolean has_selection;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
+ has_selection = gtk_tree_selection_count_selected_rows(selection) > 0;
+
+ gtk_widget_set_sensitive(selfp->remove_item, has_selection);
+ gtk_widget_set_sensitive(selfp->cut_item, has_selection);
+ gtk_widget_set_sensitive(selfp->copy_item, has_selection);
+ gtk_widget_set_sensitive(selfp->properties_item, has_selection);
+ }}
+#line 1028 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 453 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_remove_mailbox (MNMailboxView * self)
+#line 1034 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::remove_mailbox"
+#line 453 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 453 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 1041 "mn-mailbox-view.c"
+{
+#line 455 "mn-mailbox-view.gob"
+
+ GtkTreeSelection *selection;
+ GSList *gconf_mailboxes;
+
+ gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
+
+ 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);
+ }}
+#line 1055 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 467 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::remove_mailbox_cb"
+#line 467 "mn-mailbox-view.gob"
+ g_return_if_fail (model != NULL);
+#line 467 "mn-mailbox-view.gob"
+ g_return_if_fail (GTK_IS_TREE_MODEL (model));
+#line 467 "mn-mailbox-view.gob"
+ g_return_if_fail (path != NULL);
+#line 467 "mn-mailbox-view.gob"
+ g_return_if_fail (iter != NULL);
+#line 467 "mn-mailbox-view.gob"
+ g_return_if_fail (data != NULL);
+#line 1074 "mn-mailbox-view.c"
+{
+#line 472 "mn-mailbox-view.gob"
+
+ GSList **gconf_mailboxes = data;
+ char *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);
+ }
+
+ g_free(uri);
+ }}
+#line 1094 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 490 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_copy_mailbox (MNMailboxView * self)
+#line 1100 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::copy_mailbox"
+#line 490 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 490 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 1107 "mn-mailbox-view.c"
+{
+#line 492 "mn-mailbox-view.gob"
+
+ GtkTreeSelection *selection;
+ GSList *uri_list = NULL;
+ char *gnome_copied_files;
+ const GtkTargetEntry target = { GNOME_COPIED_FILES, 0, 0 };
+ gboolean status;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(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);
+
+ status = gtk_clipboard_set_with_data(global_clipboard,
+ &target,
+ 1,
+ self_get_clipboard_cb,
+ self_clear_clipboard_cb,
+ gnome_copied_files);
+ g_return_if_fail(status == TRUE);
+ }}
+#line 1131 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 514 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::copy_mailbox_cb"
+#line 514 "mn-mailbox-view.gob"
+ g_return_if_fail (model != NULL);
+#line 514 "mn-mailbox-view.gob"
+ g_return_if_fail (GTK_IS_TREE_MODEL (model));
+#line 514 "mn-mailbox-view.gob"
+ g_return_if_fail (path != NULL);
+#line 514 "mn-mailbox-view.gob"
+ g_return_if_fail (iter != NULL);
+#line 514 "mn-mailbox-view.gob"
+ g_return_if_fail (data != NULL);
+#line 1150 "mn-mailbox-view.c"
+{
+#line 519 "mn-mailbox-view.gob"
+
+ GSList **uri_list = data;
+ char *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 */
+ }}
+#line 1161 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 528 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::get_clipboard_cb"
+#line 528 "mn-mailbox-view.gob"
+ g_return_if_fail (clipboard != NULL);
+#line 528 "mn-mailbox-view.gob"
+ g_return_if_fail (selection_data != NULL);
+#line 528 "mn-mailbox-view.gob"
+ g_return_if_fail (user_data_or_owner != NULL);
+#line 1176 "mn-mailbox-view.c"
+{
+#line 533 "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"
+#undef __GOB_FUNCTION__
+
+#line 538 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::clear_clipboard_cb"
+#line 538 "mn-mailbox-view.gob"
+ g_return_if_fail (clipboard != NULL);
+#line 538 "mn-mailbox-view.gob"
+ g_return_if_fail (user_data_or_owner != NULL);
+#line 1196 "mn-mailbox-view.c"
+{
+#line 541 "mn-mailbox-view.gob"
+
+ char *gnome_copied_files = user_data_or_owner;
+ g_free(gnome_copied_files);
+ }}
+#line 1203 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 546 "mn-mailbox-view.gob"
+static void
+mn_mailbox_view_select_all (MNMailboxView * self)
+#line 1209 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::select_all"
+#line 546 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 546 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 1216 "mn-mailbox-view.c"
+{
+#line 548 "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"
+#undef __GOB_FUNCTION__
+
+#line 555 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::properties_response_h"
+#line 555 "mn-mailbox-view.gob"
+ g_return_if_fail (dialog != NULL);
+#line 555 "mn-mailbox-view.gob"
+ g_return_if_fail (GTK_IS_DIALOG (dialog));
+#line 1238 "mn-mailbox-view.c"
+{
+#line 559 "mn-mailbox-view.gob"
+
+ if (response == GTK_RESPONSE_HELP)
+ mn_display_help("mailbox-properties");
+ else
+ {
+ if (response == GTK_RESPONSE_APPLY || response == GTK_RESPONSE_OK)
+ mn_mailbox_properties_dialog_apply(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
+ if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_OK)
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ }
+ }}
+#line 1252 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 571 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu"
+#line 571 "mn-mailbox-view.gob"
+ g_return_if_fail (self != NULL);
+#line 571 "mn-mailbox-view.gob"
+ g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
+#line 1265 "mn-mailbox-view.c"
+{
+#line 573 "mn-mailbox-view.gob"
+
+ gtk_clipboard_request_contents(global_clipboard,
+ gnome_copied_files_atom,
+ self_popup_menu_receive_cb,
+ self);
+ gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, button, activate_time);
+ }}
+#line 1275 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 581 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu_receive_cb"
+#line 581 "mn-mailbox-view.gob"
+ g_return_if_fail (clipboard != NULL);
+#line 581 "mn-mailbox-view.gob"
+ g_return_if_fail (selection_data != NULL);
+#line 581 "mn-mailbox-view.gob"
+ g_return_if_fail (data != NULL);
+#line 1290 "mn-mailbox-view.c"
+{
+#line 585 "mn-mailbox-view.gob"
+
+ Self *self = data;
+ gboolean can_paste = FALSE;
+
+ if (selection_data->type == gnome_copied_files_atom
+ && selection_data->format == 8
+ && selection_data->length > 0)
+ {
+ char *gnome_copied_files;
+ gboolean status;
+ MNGnomeCopiedFilesType type;
+ GSList *uri_list;
+
+ gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
+ status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
+ g_free(gnome_copied_files);
+
+ if (status)
+ {
+ if (type == MN_GNOME_COPIED_FILES_COPY && uri_list)
+ can_paste = TRUE;
+ mn_pointers_free(uri_list);
+ }
+ }
+
+ gtk_widget_set_sensitive(selfp->paste_item, can_paste);
+ }}
+#line 1320 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 613 "mn-mailbox-view.gob"
+static gboolean
+mn_mailbox_view_popup_menu_h (GtkWidget * widget, gpointer user_data)
+#line 1326 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu_h"
+#line 613 "mn-mailbox-view.gob"
+ g_return_val_if_fail (widget != NULL, (gboolean )0);
+#line 613 "mn-mailbox-view.gob"
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
+#line 1333 "mn-mailbox-view.c"
+{
+#line 616 "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"
+#undef __GOB_FUNCTION__
+
+#line 621 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::button_press_event_h"
+#line 621 "mn-mailbox-view.gob"
+ g_return_val_if_fail (widget != NULL, (gboolean )0);
+#line 621 "mn-mailbox-view.gob"
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
+#line 621 "mn-mailbox-view.gob"
+ g_return_val_if_fail (event != NULL, (gboolean )0);
+#line 1355 "mn-mailbox-view.c"
+{
+#line 625 "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"
+#undef __GOB_FUNCTION__
+
+#line 632 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::row_activated_h"
+#line 632 "mn-mailbox-view.gob"
+ g_return_if_fail (treeview != NULL);
+#line 632 "mn-mailbox-view.gob"
+ g_return_if_fail (GTK_IS_TREE_VIEW (treeview));
+#line 632 "mn-mailbox-view.gob"
+ g_return_if_fail (path != NULL);
+#line 632 "mn-mailbox-view.gob"
+ g_return_if_fail (column != NULL);
+#line 632 "mn-mailbox-view.gob"
+ g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
+#line 1383 "mn-mailbox-view.c"
+{
+#line 637 "mn-mailbox-view.gob"
+
+ self_activate_properties(SELF(treeview));
+ }}
+#line 1389 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
+
+#line 641 "mn-mailbox-view.gob"
+GtkWidget *
+mn_mailbox_view_new (void)
+#line 1395 "mn-mailbox-view.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox:View::new"
+{
+#line 643 "mn-mailbox-view.gob"
+
+ return GTK_WIDGET(GET_NEW);
+ }}
+#line 1403 "mn-mailbox-view.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-mailbox-view.gob b/src/mn-mailbox-view.gob
@@ -0,0 +1,646 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include <gtk/gtk.h>
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include <gdk/gdkkeysyms.h>
+#include "mn-util.h"
+#include "mn-shell.h"
+#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"
+
+ enum {
+ COLUMN_URI,
+ COLUMN_MAILBOX_ICON,
+ COLUMN_MAILBOX,
+ COLUMN_FORMAT,
+ N_COLUMNS
+ };
+
+ static GtkClipboard *global_clipboard;
+ static GdkAtom gnome_copied_files_atom;
+%}
+
+class MN:Mailbox:View from Gtk:Tree:View
+{
+ private GtkWidget *menu = {gtk_menu_new()} destroywith gtk_widget_destroy;
+ private GtkWidget *remove_item;
+ private GtkWidget *cut_item;
+ private GtkWidget *copy_item;
+ private GtkWidget *paste_item;
+ private GtkWidget *properties_item;
+
+ signal (ACTION) public NONE (NONE)
+ void activate_add (self)
+ {
+ GtkWidget *toplevel;
+ GtkWidget *dialog;
+
+ 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);
+ }
+
+ signal (ACTION) public NONE (NONE)
+ void activate_remove (self)
+ {
+ self_remove_mailbox(self);
+ }
+
+ signal (ACTION) public NONE (NONE)
+ void activate_cut (self)
+ {
+ self_copy_mailbox(self);
+ self_remove_mailbox(self);
+ }
+
+ signal (ACTION) public NONE (NONE)
+ void activate_copy (self)
+ {
+ self_copy_mailbox(self);
+ }
+
+ signal (ACTION) public NONE (NONE)
+ void activate_paste (self)
+ {
+ gtk_clipboard_request_contents(global_clipboard,
+ gnome_copied_files_atom,
+ self_activate_paste_receive_cb,
+ NULL);
+ }
+
+ private void
+ activate_paste_receive_cb (GtkClipboard *clipboard (check null),
+ GtkSelectionData *selection_data (check null),
+ gpointer data)
+ {
+ if (selection_data->type == gnome_copied_files_atom
+ && selection_data->format == 8
+ && selection_data->length > 0)
+ {
+ char *gnome_copied_files;
+ gboolean status;
+ MNGnomeCopiedFilesType type;
+ GSList *uri_list;
+
+ gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
+ status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
+ g_free(gnome_copied_files);
+
+ if (status)
+ {
+ if (type == MN_GNOME_COPIED_FILES_COPY)
+ {
+ GSList *new_mailboxes = NULL;
+ GSList *l;
+
+ MN_LIST_FOREACH(l, uri_list)
+ {
+ const char *uri = l->data;
+
+ if (! mn_mailboxes_find(mn_shell->mailboxes, uri))
+ new_mailboxes = g_slist_append(new_mailboxes, g_strdup(uri));
+ }
+
+ if (new_mailboxes)
+ {
+ GSList *gconf_mailboxes;
+
+ 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);
+ }
+ }
+
+ mn_pointers_free(uri_list);
+ }
+ }
+ }
+
+ signal (ACTION) public NONE (NONE)
+ void activate_properties (self)
+ {
+ GtkTreeSelection *selection;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
+ gtk_tree_selection_selected_foreach(selection, self_activate_properties_cb, self);
+ }
+
+ private void
+ activate_properties_cb (Gtk:Tree:Model *model (check null type),
+ GtkTreePath *path (check null),
+ GtkTreeIter *iter (check null),
+ gpointer data (check null))
+ {
+ Self *self = data;
+ GtkWidget *toplevel;
+ GtkWidget *dialog;
+ char *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_signal_connect(G_OBJECT(dialog),
+ "response",
+ G_CALLBACK(self_properties_response_h),
+ NULL);
+
+ gtk_widget_show(dialog);
+ }
+
+ class_init (class)
+ {
+ GtkBindingSet *binding_set;
+
+ global_clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
+ gnome_copied_files_atom = gdk_atom_intern(GNOME_COPIED_FILES, FALSE);
+
+ binding_set = gtk_binding_set_by_class(class);
+
+ /* Delete removes a row */
+ gtk_binding_entry_add_signal(binding_set, GDK_Delete, 0, "activate-remove", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_KP_Delete, 0, "activate-remove", 0);
+
+ /* HIG 2.0 cut/copy/paste shortcuts */
+ gtk_binding_entry_add_signal(binding_set, GDK_x, GDK_CONTROL_MASK, "activate-cut", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_c, GDK_CONTROL_MASK, "activate-copy", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_v, GDK_CONTROL_MASK, "activate-paste", 0);
+
+ /* cut/copy/paste shortcuts taken from gtkentry.c */
+ gtk_binding_entry_add_signal(binding_set, GDK_Delete, GDK_SHIFT_MASK, "activate-cut", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_Insert, GDK_CONTROL_MASK, "activate-copy", 0);
+ gtk_binding_entry_add_signal(binding_set, GDK_Insert, GDK_SHIFT_MASK, "activate-paste", 0);
+
+ /* HIG 2.0 properties */
+ gtk_binding_entry_add_signal(binding_set, GDK_Return, GDK_MOD1_MASK, "activate-properties", 0);
+ 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);
+ }
+
+ init (self)
+ {
+ GtkMenuShell *shell;
+ GtkWidget *add_item;
+ GtkWidget *select_all_item;
+ GtkListStore *store;
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer;
+ GtkTreeSelection *selection;
+
+ shell = GTK_MENU_SHELL(selfp->menu);
+
+ add_item = mn_menu_shell_append(shell, GTK_STOCK_ADD, NULL);
+ selfp->remove_item = mn_menu_shell_append(shell, GTK_STOCK_REMOVE, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ selfp->cut_item = mn_menu_shell_append(shell, GTK_STOCK_CUT, NULL);
+ selfp->copy_item = mn_menu_shell_append(shell, GTK_STOCK_COPY, NULL);
+ selfp->paste_item = mn_menu_shell_append(shell, GTK_STOCK_PASTE, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ select_all_item = mn_menu_shell_append(shell, MN_STOCK_SELECT_ALL, NULL);
+ mn_menu_shell_append(shell, NULL, NULL);
+ selfp->properties_item = mn_menu_shell_append(shell, GTK_STOCK_PROPERTIES, NULL);
+
+ g_signal_connect_swapped(G_OBJECT(add_item), "activate", G_CALLBACK(self_activate_add), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->remove_item), "activate", G_CALLBACK(self_activate_remove), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->cut_item), "activate", G_CALLBACK(self_activate_cut), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->copy_item), "activate", G_CALLBACK(self_activate_copy), self);
+ g_signal_connect_swapped(G_OBJECT(selfp->paste_item), "activate", G_CALLBACK(self_activate_paste), self);
+ g_signal_connect_swapped(G_OBJECT(select_all_item), "activate", G_CALLBACK(self_select_all), self);
+ 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,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(self), GTK_TREE_MODEL(store));
+ g_object_unref(store);
+
+ column = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title(column, _("Mailbox"));
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_MAILBOX);
+
+ renderer = gtk_cell_renderer_pixbuf_new();
+ gtk_tree_view_column_pack_start(column, renderer, FALSE);
+ gtk_tree_view_column_add_attribute(column, renderer, "stock-id", COLUMN_MAILBOX_ICON);
+
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(column, renderer, TRUE);
+ gtk_tree_view_column_add_attribute(column, renderer, "text", COLUMN_MAILBOX);
+
+ gtk_tree_view_append_column(GTK_TREE_VIEW(self), column);
+
+ column = gtk_tree_view_column_new_with_attributes(_("Format"),
+ gtk_cell_renderer_text_new(),
+ "text", COLUMN_FORMAT,
+ NULL);
+
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_FORMAT);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(self), column);
+
+ gtk_tree_view_set_search_column(GTK_TREE_VIEW(self), COLUMN_MAILBOX);
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
+ gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+
+ self_update(self);
+ self_update_sensitivity(self);
+
+ g_signal_connect_swapped(G_OBJECT(mn_shell->mailboxes), "list-changed", G_CALLBACK(self_update), self);
+ g_signal_connect_swapped(G_OBJECT(selection), "changed", G_CALLBACK(self_update_sensitivity), self);
+
+ g_signal_connect(G_OBJECT(self), "popup-menu", G_CALLBACK(self_popup_menu_h), NULL);
+ 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);
+ }
+
+ override (G:Object) void
+ finalize (G:Object *object (check null type))
+ {
+ g_signal_handlers_disconnect_by_func(mn_shell->mailboxes, self_update, object);
+ PARENT_HANDLER(object);
+ }
+
+ private void
+ update (self)
+ {
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gboolean valid;
+ MNMailbox *mailbox;
+ GSList *l;
+
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
+
+ /* first step: remove or update old mailboxes */
+
+ valid = gtk_tree_model_get_iter_first(model, &iter);
+ while (valid)
+ {
+ char *uri;
+
+ gtk_tree_model_get(model, &iter, COLUMN_URI, &uri, -1);
+ mailbox = mn_mailboxes_find(mn_shell->mailboxes, uri);
+ g_free(uri);
+
+ if (mailbox)
+ {
+ self_update_iter(self, &iter, mailbox);
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+ else
+ valid = gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+ }
+
+ /* second step: add new mailboxes */
+
+ MN_LIST_FOREACH(l, mn_mailboxes_get(mn_shell->mailboxes))
+ {
+ mailbox = l->data;
+
+ if (! self_has_mailbox(self, mailbox))
+ {
+ gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+ self_update_iter(self, &iter, mailbox);
+ }
+ }
+ }
+
+ private void
+ update_iter (self,
+ GtkTreeIter *iter (check null),
+ 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))
+ 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;
+ }
+
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
+ gtk_list_store_set(GTK_LIST_STORE(model), iter,
+ COLUMN_URI, uri,
+ COLUMN_MAILBOX_ICON, stock_id,
+ COLUMN_MAILBOX, mn_mailbox_get_name(mailbox),
+ COLUMN_FORMAT, class->format,
+ -1);
+ }
+
+ 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;
+
+ gtk_tree_model_get(model, &iter, COLUMN_URI, &this_uri, -1);
+ has = ! mn_uri_cmp(this_uri, uri);
+ g_free(this_uri);
+
+ if (has)
+ break;
+
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+
+ return has;
+ }
+
+ private void
+ update_sensitivity (self)
+ {
+ GtkTreeSelection *selection;
+ gboolean has_selection;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
+ has_selection = gtk_tree_selection_count_selected_rows(selection) > 0;
+
+ gtk_widget_set_sensitive(selfp->remove_item, has_selection);
+ gtk_widget_set_sensitive(selfp->cut_item, has_selection);
+ gtk_widget_set_sensitive(selfp->copy_item, has_selection);
+ gtk_widget_set_sensitive(selfp->properties_item, has_selection);
+ }
+
+ private void
+ remove_mailbox (self)
+ {
+ GtkTreeSelection *selection;
+ GSList *gconf_mailboxes;
+
+ gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
+
+ 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);
+ }
+
+ private void
+ remove_mailbox_cb (Gtk:Tree:Model *model (check null type),
+ GtkTreePath *path (check null),
+ GtkTreeIter *iter (check null),
+ gpointer data (check null))
+ {
+ GSList **gconf_mailboxes = data;
+ char *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);
+ }
+
+ g_free(uri);
+ }
+
+ private void
+ copy_mailbox (self)
+ {
+ GtkTreeSelection *selection;
+ GSList *uri_list = NULL;
+ char *gnome_copied_files;
+ const GtkTargetEntry target = { GNOME_COPIED_FILES, 0, 0 };
+ gboolean status;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(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);
+
+ status = gtk_clipboard_set_with_data(global_clipboard,
+ &target,
+ 1,
+ self_get_clipboard_cb,
+ self_clear_clipboard_cb,
+ gnome_copied_files);
+ g_return_if_fail(status == TRUE);
+ }
+
+ private void
+ copy_mailbox_cb (Gtk:Tree:Model *model (check null type),
+ GtkTreePath *path (check null),
+ GtkTreeIter *iter (check null),
+ gpointer data (check null))
+ {
+ GSList **uri_list = data;
+ char *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 */
+ }
+
+ private void
+ get_clipboard_cb (GtkClipboard *clipboard (check null),
+ GtkSelectionData *selection_data (check null),
+ unsigned int info,
+ gpointer user_data_or_owner (check null))
+ {
+ 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));
+ }
+
+ private void
+ clear_clipboard_cb (GtkClipboard *clipboard (check null),
+ gpointer user_data_or_owner (check null))
+ {
+ char *gnome_copied_files = user_data_or_owner;
+ g_free(gnome_copied_files);
+ }
+
+ private void
+ select_all (self)
+ {
+ GtkTreeSelection *selection;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
+ gtk_tree_selection_select_all(selection);
+ }
+
+ private void
+ properties_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_APPLY || response == GTK_RESPONSE_OK)
+ mn_mailbox_properties_dialog_apply(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
+ if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_OK)
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ }
+ }
+
+ private void
+ popup_menu (self, unsigned int button, guint32 activate_time)
+ {
+ gtk_clipboard_request_contents(global_clipboard,
+ gnome_copied_files_atom,
+ self_popup_menu_receive_cb,
+ self);
+ gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, button, activate_time);
+ }
+
+ private void
+ popup_menu_receive_cb (GtkClipboard *clipboard (check null),
+ GtkSelectionData *selection_data (check null),
+ gpointer data (check null))
+ {
+ Self *self = data;
+ gboolean can_paste = FALSE;
+
+ if (selection_data->type == gnome_copied_files_atom
+ && selection_data->format == 8
+ && selection_data->length > 0)
+ {
+ char *gnome_copied_files;
+ gboolean status;
+ MNGnomeCopiedFilesType type;
+ GSList *uri_list;
+
+ gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
+ status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
+ g_free(gnome_copied_files);
+
+ if (status)
+ {
+ if (type == MN_GNOME_COPIED_FILES_COPY && uri_list)
+ can_paste = TRUE;
+ mn_pointers_free(uri_list);
+ }
+ }
+
+ gtk_widget_set_sensitive(selfp->paste_item, can_paste);
+ }
+
+ private gboolean
+ popup_menu_h (Gtk:Widget *widget (check null type),
+ gpointer user_data)
+ {
+ self_popup_menu(SELF(widget), 0, gtk_get_current_event_time());
+ return TRUE; /* a menu was activated */
+ }
+
+ private gboolean
+ button_press_event_h (Gtk:Widget *widget (check null type),
+ GdkEventButton *event (check null),
+ gpointer user_data)
+ {
+ if (event->button == 3)
+ self_popup_menu(SELF(widget), event->button, event->time);
+
+ return FALSE; /* propagate event */
+ }
+
+ private void
+ row_activated_h (Gtk:Tree:View *treeview (check null type),
+ GtkTreePath *path (check null),
+ Gtk:Tree:View:Column *column (check null type),
+ gpointer user_data)
+ {
+ self_activate_properties(SELF(treeview));
+ }
+
+ public GtkWidget *
+ new (void)
+ {
+ return GTK_WIDGET(GET_NEW);
+ }
+}
diff --git a/src/mn-mailbox-view.h b/src/mn-mailbox-view.h
@@ -0,0 +1,119 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <gtk/gtk.h>
+
+#ifndef __MN_MAILBOX_VIEW_H__
+#define __MN_MAILBOX_VIEW_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_MAILBOX_VIEW (mn_mailbox_view_get_type())
+#define MN_MAILBOX_VIEW(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mailbox_view_get_type(), MNMailboxView)
+#define MN_MAILBOX_VIEW_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mailbox_view_get_type(), MNMailboxView const)
+#define MN_MAILBOX_VIEW_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_mailbox_view_get_type(), MNMailboxViewClass)
+#define MN_IS_MAILBOX_VIEW(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_mailbox_view_get_type ())
+
+#define MN_MAILBOX_VIEW_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_mailbox_view_get_type(), MNMailboxViewClass)
+
+/* Private structure type */
+typedef struct _MNMailboxViewPrivate MNMailboxViewPrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_MAILBOX_VIEW__
+#define __TYPEDEF_MN_MAILBOX_VIEW__
+typedef struct _MNMailboxView MNMailboxView;
+#endif
+struct _MNMailboxView {
+ GtkTreeView __parent__;
+ /*< private >*/
+ MNMailboxViewPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNMailboxViewClass MNMailboxViewClass;
+struct _MNMailboxViewClass {
+ GtkTreeViewClass __parent__;
+ /*signal*/void (* activate_add) (MNMailboxView * self);
+ /*signal*/void (* activate_remove) (MNMailboxView * self);
+ /*signal*/void (* activate_cut) (MNMailboxView * self);
+ /*signal*/void (* activate_copy) (MNMailboxView * self);
+ /*signal*/void (* activate_paste) (MNMailboxView * self);
+ /*signal*/void (* activate_properties) (MNMailboxView * self);
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_mailbox_view_get_type (void);
+void mn_mailbox_view_activate_add (MNMailboxView * self);
+void mn_mailbox_view_activate_remove (MNMailboxView * self);
+void mn_mailbox_view_activate_cut (MNMailboxView * self);
+void mn_mailbox_view_activate_copy (MNMailboxView * self);
+void mn_mailbox_view_activate_paste (MNMailboxView * self);
+void mn_mailbox_view_activate_properties (MNMailboxView * self);
+GtkWidget * mn_mailbox_view_new (void);
+
+/*
+ * Signal connection wrapper macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define mn_mailbox_view_connect__activate_add(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_add",(GCallback) __extension__ ({void (* ___activate_add) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_add; }), (data))
+#define mn_mailbox_view_connect_after__activate_add(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_add",(GCallback) __extension__ ({void (* ___activate_add) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_add; }), (data))
+#define mn_mailbox_view_connect_data__activate_add(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_add",(GCallback) __extension__ ({void (* ___activate_add) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_add; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_remove(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_remove",(GCallback) __extension__ ({void (* ___activate_remove) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_remove; }), (data))
+#define mn_mailbox_view_connect_after__activate_remove(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_remove",(GCallback) __extension__ ({void (* ___activate_remove) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_remove; }), (data))
+#define mn_mailbox_view_connect_data__activate_remove(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_remove",(GCallback) __extension__ ({void (* ___activate_remove) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_remove; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_cut(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_cut",(GCallback) __extension__ ({void (* ___activate_cut) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_cut; }), (data))
+#define mn_mailbox_view_connect_after__activate_cut(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_cut",(GCallback) __extension__ ({void (* ___activate_cut) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_cut; }), (data))
+#define mn_mailbox_view_connect_data__activate_cut(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_cut",(GCallback) __extension__ ({void (* ___activate_cut) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_cut; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_copy(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_copy",(GCallback) __extension__ ({void (* ___activate_copy) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_copy; }), (data))
+#define mn_mailbox_view_connect_after__activate_copy(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_copy",(GCallback) __extension__ ({void (* ___activate_copy) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_copy; }), (data))
+#define mn_mailbox_view_connect_data__activate_copy(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_copy",(GCallback) __extension__ ({void (* ___activate_copy) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_copy; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_paste(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_paste",(GCallback) __extension__ ({void (* ___activate_paste) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_paste; }), (data))
+#define mn_mailbox_view_connect_after__activate_paste(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_paste",(GCallback) __extension__ ({void (* ___activate_paste) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_paste; }), (data))
+#define mn_mailbox_view_connect_data__activate_paste(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_paste",(GCallback) __extension__ ({void (* ___activate_paste) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_paste; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_properties(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_properties",(GCallback) __extension__ ({void (* ___activate_properties) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_properties; }), (data))
+#define mn_mailbox_view_connect_after__activate_properties(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_properties",(GCallback) __extension__ ({void (* ___activate_properties) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_properties; }), (data))
+#define mn_mailbox_view_connect_data__activate_properties(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(__extension__ ({MNMailboxView *___object = (object); ___object; })),"activate_properties",(GCallback) __extension__ ({void (* ___activate_properties) (MNMailboxView * ___fake___self, gpointer ___data ) = (func); ___activate_properties; }), (data), (destroy_data), (GConnectFlags)(flags))
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define mn_mailbox_view_connect__activate_add(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(object),"activate_add",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_after__activate_add(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(object),"activate_add",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_data__activate_add(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(object),"activate_add",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_remove(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(object),"activate_remove",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_after__activate_remove(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(object),"activate_remove",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_data__activate_remove(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(object),"activate_remove",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_cut(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(object),"activate_cut",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_after__activate_cut(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(object),"activate_cut",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_data__activate_cut(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(object),"activate_cut",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_copy(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(object),"activate_copy",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_after__activate_copy(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(object),"activate_copy",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_data__activate_copy(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(object),"activate_copy",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_paste(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(object),"activate_paste",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_after__activate_paste(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(object),"activate_paste",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_data__activate_paste(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(object),"activate_paste",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mailbox_view_connect__activate_properties(object,func,data) g_signal_connect(MN_MAILBOX_VIEW(object),"activate_properties",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_after__activate_properties(object,func,data) g_signal_connect_after(MN_MAILBOX_VIEW(object),"activate_properties",(GCallback)(func),(data))
+#define mn_mailbox_view_connect_data__activate_properties(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOX_VIEW(object),"activate_properties",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mailbox.c b/src/mn-mailbox.c
@@ -1,26 +1,32 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 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 <string.h> /* memset() */
+
+#include "mn-mailbox.h"
+
+#include "mn-mailbox-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 42 "mn-mailbox.gob"
#include "config.h"
-#include <stdarg.h>
#include <glib/gi18n-lib.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include "mn-mailbox.h"
#ifdef WITH_MBOX
#include "mn-mbox-mailbox.h"
#endif
@@ -33,616 +39,929 @@
#ifdef WITH_POP3
#include "mn-pop3-mailbox.h"
#endif
+#ifdef WITH_IMAP
+#include "mn-imap-mailbox.h"
+#endif
#ifdef WITH_SYLPHEED
#include "mn-sylpheed-mailbox.h"
#endif
#ifdef WITH_GMAIL
#include "mn-gmail-mailbox.h"
#endif
-#include "mn-unsupported-mailbox.h"
+#include "mn-vfs.h"
#include "mn-util.h"
-#include "mn-uri.h"
+#include "mn-unsupported-mailbox.h"
#include "mn-conf.h"
#include "mn-dialog.h"
-#include "mn-vfs.h"
-
-/*** types *******************************************************************/
-
-enum {
- PROP_0,
- PROP_URI,
- PROP_NAME,
- PROP_AUTOMATIC,
- PROP_HAS_NEW,
- PROP_ERROR
-};
-
-struct _MNMailboxPrivate
-{
- char *init_error;
- char *uri;
- char *name;
- gboolean automatic;
- gboolean has_new;
- char *error;
-
- GnomeVFSMonitorHandle *monitor_handle;
- char *monitor_uri;
- MNMailboxMonitorEventType monitor_events;
-
- gboolean checking;
-};
+#include "mn-uri.h"
typedef struct
{
- char *uri;
- MNMailbox *mailbox;
- const GType *types;
- int i;
- MNMailboxNewAsyncCallback *callback;
- gpointer user_data;
+ char *uri;
+ void (*callback) (MNMailbox *self,
+ gpointer user_data);
+ gpointer user_data;
} NewInfo;
-/*** variables ***************************************************************/
-
-static GObjectClass *parent_class = NULL;
-
-/*** functions ***************************************************************/
-
-static void mn_mailbox_class_init (MNMailboxClass *class);
-static void mn_mailbox_init (MNMailbox *mailbox);
-static void mn_mailbox_finalize (GObject *object);
-static void mn_mailbox_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void mn_mailbox_get_property (GObject *object,
- unsigned int prop_id,
- GValue *value,
- GParamSpec *pspec);
-
-static void mn_mailbox_monitor_cb (GnomeVFSMonitorHandle *handle,
- const char *monitor_uri,
- const char *info_uri,
- GnomeVFSMonitorEventType event_type,
- gpointer user_data);
-
-static void mn_mailbox_new_async_test_cb (gboolean result, gpointer user_data);
-static void mn_mailbox_new_async_continue (NewInfo *info);
-static void mn_mailbox_new_async_is_cb (gboolean result, gpointer user_data);
-static void mn_mailbox_new_async_unsupported (NewInfo *info, const char *reason);
-static void mn_mailbox_new_async_finish (NewInfo *info);
-
-/*** implementation **********************************************************/
-
-const GType *
-mn_mailbox_get_types (void)
-{
- static GType *types = NULL;
-
- if (! types)
- {
- GType tmp_types[6];
- int n_types = 0;
- int i;
-
-#ifdef WITH_MBOX
- tmp_types[n_types++] = MN_TYPE_MBOX_MAILBOX;
-#endif
-#ifdef WITH_MH
- tmp_types[n_types++] = MN_TYPE_MH_MAILBOX;
-#endif
-#ifdef WITH_MAILDIR
- tmp_types[n_types++] = MN_TYPE_MAILDIR_MAILBOX;
-#endif
-#ifdef WITH_POP3
- tmp_types[n_types++] = MN_TYPE_POP3_MAILBOX;
-#endif
-#ifdef WITH_SYLPHEED
- tmp_types[n_types++] = MN_TYPE_SYLPHEED_MAILBOX;
-#endif
-#ifdef WITH_GMAIL
- tmp_types[n_types++] = MN_TYPE_GMAIL_MAILBOX;
-#endif
+#line 67 "mn-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_MAILBOX(x)
+#define SELF_CONST(x) MN_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_MAILBOX
+#define SELF_CLASS(x) MN_MAILBOX_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_MAILBOX_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNMailbox Self;
+typedef MNMailboxClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+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 void mn_mailbox_impl_check (MNMailbox * self) G_GNUC_UNUSED;
+static void mn_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
- types = g_new(GType, n_types + 1);
- for (i = 0; i < n_types; i++)
- types[i] = tmp_types[i];
- types[n_types] = 0;
- }
+enum {
+ PROP_0,
+ PROP_URI,
+ PROP_NAME,
+ PROP_AUTOMATIC,
+ PROP_HAS_NEW,
+ PROP_ERROR
+};
- return types;
-}
+/* pointer to the class of our parent */
+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
+#define self_get_has_new mn_mailbox_get_has_new
+#define self_set_has_new mn_mailbox_set_has_new
+#define self_set_error mn_mailbox_set_error
+#define self_get_error mn_mailbox_get_error
+#define self_get_types mn_mailbox_get_types
+#define self_new_async mn_mailbox_new_async
+#define self_new_async_thread mn_mailbox_new_async_thread
+#define self_set_init_error mn_mailbox_set_init_error
+#define self_monitor mn_mailbox_monitor
+#define self_monitor_cb mn_mailbox_monitor_cb
+#define self_impl_is mn_mailbox_impl_is
+#define self_impl_check mn_mailbox_impl_check
+#define self_impl_threaded_check mn_mailbox_impl_threaded_check
+#define self_check mn_mailbox_check
+#define self_end_check mn_mailbox_end_check
+#define self_notice mn_mailbox_notice
GType
mn_mailbox_get_type (void)
{
- static GType mailbox_type = 0;
-
- if (! mailbox_type)
- {
- static const GTypeInfo mailbox_info = {
- sizeof(MNMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNMailbox),
- 0,
- (GInstanceInitFunc) mn_mailbox_init,
- };
-
- mailbox_type = g_type_register_static(G_TYPE_OBJECT,
- "MNMailbox",
- &mailbox_info,
- G_TYPE_FLAG_ABSTRACT);
- }
-
- return mailbox_type;
-}
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_mailbox_init,
+ NULL
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "MNMailbox", &info, (GTypeFlags)0);
+ }
-static void
-mn_mailbox_class_init (MNMailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
-
- parent_class = g_type_class_peek_parent(class);
-
- object_class->set_property = mn_mailbox_set_property;
- object_class->get_property = mn_mailbox_get_property;
- object_class->finalize = mn_mailbox_finalize;
-
- g_object_class_install_property(object_class,
- PROP_URI,
- g_param_spec_string("uri",
- _("URI"),
- _("The mailbox URI"),
- NULL,
- G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property(object_class,
- PROP_NAME,
- g_param_spec_string("name",
- _("Name"),
- _("The mailbox human-readable name"),
- NULL,
- G_PARAM_READABLE));
- g_object_class_install_property(object_class,
- PROP_AUTOMATIC,
- g_param_spec_boolean("automatic",
- _("Automatic"),
- _("Whether the mailbox has to be manually checked or not"),
- FALSE,
- G_PARAM_WRITABLE | G_PARAM_READABLE));
- g_object_class_install_property(object_class,
- PROP_HAS_NEW,
- g_param_spec_boolean("has-new",
- _("Has new"),
- _("Whether the mailbox has new mail or not"),
- FALSE,
- G_PARAM_WRITABLE | G_PARAM_READABLE));
- g_object_class_install_property(object_class,
- PROP_ERROR,
- g_param_spec_string("error",
- _("Error"),
- _("The mailbox error if any"),
- NULL,
- G_PARAM_WRITABLE | G_PARAM_READABLE));
+ return type;
}
-static void
-mn_mailbox_init (MNMailbox *mailbox)
-{
- mailbox->priv = g_new0(MNMailboxPrivate, 1);
-}
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNMailbox *)g_object_new(mn_mailbox_get_type(), NULL))
-static void
-mn_mailbox_finalize (GObject *object)
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNMailbox *
+GET_NEW_VARG (const char *first, ...)
{
- MNMailbox *mailbox = MN_MAILBOX(object);
-
- g_free(mailbox->priv->init_error);
- g_free(mailbox->priv->uri);
- g_free(mailbox->priv->name);
- g_free(mailbox->priv->error);
- if (mailbox->priv->monitor_handle)
- {
- GnomeVFSResult result;
-
- result = gnome_vfs_monitor_cancel(mailbox->priv->monitor_handle);
- if (result != GNOME_VFS_OK)
- g_warning(_("unable to cancel monitoring of %s: %s"),
- mailbox->priv->monitor_uri,
- gnome_vfs_result_to_string(result));
- }
- g_free(mailbox->priv->monitor_uri);
- g_free(mailbox->priv);
-
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ MNMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNMailbox *)g_object_new_valist (mn_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
-static void
-mn_mailbox_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- MNMailbox *mailbox = MN_MAILBOX(object);
-
- switch (prop_id)
- {
- case PROP_URI:
- g_return_if_fail(mailbox->priv->uri == NULL);
- mailbox->priv->uri = g_value_dup_string(value);
- mailbox->priv->name = mn_uri_format_for_display(mailbox->priv->uri);
- break;
-
- case PROP_AUTOMATIC:
- mailbox->priv->automatic = g_value_get_boolean(value);
- break;
-
- case PROP_HAS_NEW:
- mailbox->priv->has_new = g_value_get_boolean(value);
- break;
-
- case PROP_ERROR:
- g_free(mailbox->priv->error);
- mailbox->priv->error = g_value_dup_string(value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-}
-void
-mn_mailbox_set_automatic (MNMailbox *mailbox, gboolean automatic)
+static void
+___finalize(GObject *obj_self)
{
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
-
- g_object_set(G_OBJECT(mailbox), "automatic", automatic, NULL);
+#define __GOB_FUNCTION__ "MN:Mailbox::finalize"
+ MNMailbox *self G_GNUC_UNUSED = MN_MAILBOX (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"
+ 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"
+ 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"
+ 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"
+ 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"
+ if(self->_priv->init_error) { ((*(void (*)(void *))g_free)) (self->_priv->init_error); self->_priv->init_error = NULL; }
+#line 193 "mn-mailbox.c"
+ g_free (priv);
}
+#undef __GOB_FUNCTION__
-void
-mn_mailbox_set_has_new (MNMailbox *mailbox, gboolean has_new)
+static void
+mn_mailbox_init (MNMailbox * o G_GNUC_UNUSED)
{
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
-
- g_object_set(G_OBJECT(mailbox), "has-new", has_new, NULL);
+#define __GOB_FUNCTION__ "MN:Mailbox::init"
+ o->_priv = g_new0 (MNMailboxPrivate, 1);
}
-
-void
-mn_mailbox_set_error (MNMailbox *mailbox, const char *format, ...)
+#undef __GOB_FUNCTION__
+static void
+mn_mailbox_class_init (MNMailboxClass * c G_GNUC_UNUSED)
{
- char *error = NULL;
+#define __GOB_FUNCTION__ "MN:Mailbox::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
- if (format)
+ c->impl_is = NULL;
+ c->impl_check = NULL;
+ c->impl_threaded_check = NULL;
+ g_object_class->finalize = ___finalize;
+ g_object_class->get_property = ___object_get_property;
+ g_object_class->set_property = ___object_set_property;
{
- va_list args;
-
- va_start(args, format);
- error = g_strdup_vprintf(format, args);
- va_end(args);
+ GParamSpec *param_spec;
+
+ param_spec = g_param_spec_string
+ ("uri" /* name */,
+ NULL /* nick */,
+ _("The mailbox URI") /* blurb */,
+ NULL /* default_value */,
+ (GParamFlags)(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (g_object_class,
+ PROP_URI,
+ param_spec);
+ param_spec = g_param_spec_string
+ ("name" /* name */,
+ NULL /* nick */,
+ _("The mailbox human-readable name") /* blurb */,
+ NULL /* default_value */,
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (g_object_class,
+ PROP_NAME,
+ param_spec);
+ param_spec = g_param_spec_boolean
+ ("automatic" /* name */,
+ NULL /* nick */,
+ _("Whether the mailbox has to be manually checked or not") /* blurb */,
+ FALSE /* default_value */,
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (g_object_class,
+ PROP_AUTOMATIC,
+ param_spec);
+ param_spec = g_param_spec_boolean
+ ("has_new" /* name */,
+ NULL /* nick */,
+ _("Whether the mailbox has new mail or not") /* blurb */,
+ FALSE /* default_value */,
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (g_object_class,
+ PROP_HAS_NEW,
+ param_spec);
+ param_spec = g_param_spec_string
+ ("error" /* name */,
+ NULL /* nick */,
+ _("The mailbox error, if any") /* blurb */,
+ NULL /* default_value */,
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (g_object_class,
+ PROP_ERROR,
+ param_spec);
}
-
- g_object_set(G_OBJECT(mailbox), "error", error, NULL);
- g_free(error);
}
+#undef __GOB_FUNCTION__
static void
-mn_mailbox_get_property (GObject *object,
- unsigned int prop_id,
- GValue *value,
- GParamSpec *pspec)
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Mailbox::set_property"
{
- MNMailbox *mailbox = MN_MAILBOX(object);
-
- switch (prop_id)
- {
- case PROP_URI:
- g_value_set_string(value, mn_mailbox_get_uri(mailbox));
- break;
-
- case PROP_NAME:
- g_value_set_string(value, mn_mailbox_get_name(mailbox));
- break;
-
- case PROP_AUTOMATIC:
- g_value_set_boolean(value, mn_mailbox_get_automatic(mailbox));
- break;
-
- case PROP_HAS_NEW:
- g_value_set_boolean(value, mn_mailbox_get_has_new(mailbox));
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ MNMailbox *self G_GNUC_UNUSED;
+
+ self = MN_MAILBOX (object);
+
+ switch (property_id) {
+ case PROP_URI:
+ {
+#line 90 "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);
+
+#line 291 "mn-mailbox.c"
+ }
+ break;
+ case PROP_NAME:
+ {
+#line 98 "mn-mailbox.gob"
+{ char *old = self->_priv->name; self->_priv->name = g_value_dup_string (VAL); g_free (old); }
+#line 298 "mn-mailbox.c"
+ }
+ break;
+ case PROP_AUTOMATIC:
+ {
+#line 102 "mn-mailbox.gob"
+self->_priv->automatic = g_value_get_boolean (VAL);
+#line 305 "mn-mailbox.c"
+ }
+ break;
+ case PROP_HAS_NEW:
+ {
+#line 107 "mn-mailbox.gob"
+self->_priv->has_new = g_value_get_boolean (VAL);
+#line 312 "mn-mailbox.c"
+ }
+ break;
+ case PROP_ERROR:
+ {
+#line 112 "mn-mailbox.gob"
+{ char *old = self->_priv->error; self->_priv->error = g_value_dup_string (VAL); g_free (old); }
+#line 319 "mn-mailbox.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
}
+#undef __GOB_FUNCTION__
-const char *
-mn_mailbox_get_uri (MNMailbox *mailbox)
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Mailbox::get_property"
{
- g_return_val_if_fail(MN_IS_MAILBOX(mailbox), NULL);
-
- return mailbox->priv->uri;
+ MNMailbox *self G_GNUC_UNUSED;
+
+ self = MN_MAILBOX (object);
+
+ switch (property_id) {
+ case PROP_NAME:
+ {
+#line 98 "mn-mailbox.gob"
+g_value_set_string (VAL, self->_priv->name);
+#line 350 "mn-mailbox.c"
+ }
+ break;
+ case PROP_AUTOMATIC:
+ {
+#line 102 "mn-mailbox.gob"
+g_value_set_boolean (VAL, self->_priv->automatic);
+#line 357 "mn-mailbox.c"
+ }
+ break;
+ case PROP_HAS_NEW:
+ {
+#line 107 "mn-mailbox.gob"
+g_value_set_boolean (VAL, self->_priv->has_new);
+#line 364 "mn-mailbox.c"
+ }
+ break;
+ case PROP_ERROR:
+ {
+#line 112 "mn-mailbox.gob"
+g_value_set_string (VAL, self->_priv->error);
+#line 371 "mn-mailbox.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
}
+#undef __GOB_FUNCTION__
-const char *
-mn_mailbox_get_name (MNMailbox *mailbox)
-{
- g_return_val_if_fail(MN_IS_MAILBOX(mailbox), NULL);
- return mailbox->priv->name;
-}
-gboolean
-mn_mailbox_get_automatic (MNMailbox *mailbox)
+#line 95 "mn-mailbox.gob"
+const char *
+mn_mailbox_get_uri (MNMailbox * self)
+#line 391 "mn-mailbox.c"
{
- g_return_val_if_fail(MN_IS_MAILBOX(mailbox), FALSE);
-
- return mailbox->priv->automatic;
-}
-
-gboolean
-mn_mailbox_get_has_new (MNMailbox *mailbox)
+#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"
{
- g_return_val_if_fail(MN_IS_MAILBOX(mailbox), FALSE);
-
- return mailbox->priv->has_new;
-}
-
-const char *
-mn_mailbox_get_error (MNMailbox *mailbox)
+#line 95 "mn-mailbox.gob"
+ return selfp->uri; }}
+#line 402 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 99 "mn-mailbox.gob"
+const char *
+mn_mailbox_get_name (MNMailbox * self)
+#line 408 "mn-mailbox.c"
{
- g_return_val_if_fail(MN_IS_MAILBOX(mailbox), NULL);
-
- return mailbox->priv->error;
-}
-
-void
-mn_mailbox_new_async (const char *uri,
- MNMailboxNewAsyncCallback *callback,
- gpointer user_data)
+#define __GOB_FUNCTION__ "MN:Mailbox::get_name"
+#line 99 "mn-mailbox.gob"
+ g_return_val_if_fail (self != NULL, (const char * )0);
+#line 99 "mn-mailbox.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX (self), (const char * )0);
+#line 415 "mn-mailbox.c"
{
- NewInfo *info;
- GnomeVFSURI *vfs_uri;
-
- g_return_if_fail(uri != NULL);
- g_return_if_fail(callback != NULL);
-
- info = g_new(NewInfo, 1);
- info->uri = g_strdup(uri);
- info->types = mn_mailbox_get_types();
- info->i = 0;
- info->callback = callback;
- info->user_data = user_data;
+#line 99 "mn-mailbox.gob"
+ return selfp->name; }}
+#line 419 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 102 "mn-mailbox.gob"
+gboolean
+mn_mailbox_get_automatic (MNMailbox * self)
+#line 425 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::get_automatic"
+{
+#line 102 "mn-mailbox.gob"
+ gboolean val; g_object_get (G_OBJECT (self), "automatic", &val, NULL); return val;
+}}
+#line 432 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 102 "mn-mailbox.gob"
+void
+mn_mailbox_set_automatic (MNMailbox * self, gboolean val)
+#line 438 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::set_automatic"
+{
+#line 102 "mn-mailbox.gob"
+ g_object_set (G_OBJECT (self), "automatic", val, NULL);
+}}
+#line 445 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 107 "mn-mailbox.gob"
+gboolean
+mn_mailbox_get_has_new (MNMailbox * self)
+#line 451 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::get_has_new"
+{
+#line 107 "mn-mailbox.gob"
+ gboolean val; g_object_get (G_OBJECT (self), "has_new", &val, NULL); return val;
+}}
+#line 458 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 107 "mn-mailbox.gob"
+void
+mn_mailbox_set_has_new (MNMailbox * self, gboolean val)
+#line 464 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::set_has_new"
+{
+#line 107 "mn-mailbox.gob"
+ g_object_set (G_OBJECT (self), "has_new", val, NULL);
+}}
+#line 471 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 113 "mn-mailbox.gob"
+void
+mn_mailbox_set_error (MNMailbox * self, const char * format, ...)
+#line 477 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::set_error"
+#line 113 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 113 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 484 "mn-mailbox.c"
+{
+#line 115 "mn-mailbox.gob"
+
+ va_list args;
+ char *error = NULL;
+
+ if (format)
+ {
+ va_start(args, format);
+ error = g_strdup_vprintf(format, args);
+ va_end(args);
+ }
+
+ g_object_set(G_OBJECT(self), MN_MAILBOX_PROP_ERROR(error), NULL);
+ g_free(error);
+ }}
+#line 501 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 129 "mn-mailbox.gob"
+const char *
+mn_mailbox_get_error (MNMailbox * self)
+#line 507 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::get_error"
+#line 129 "mn-mailbox.gob"
+ g_return_val_if_fail (self != NULL, (const char * )0);
+#line 129 "mn-mailbox.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX (self), (const char * )0);
+#line 514 "mn-mailbox.c"
+{
+#line 129 "mn-mailbox.gob"
+ return selfp->error; }}
+#line 518 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
- vfs_uri = gnome_vfs_uri_new(uri);
- if (vfs_uri)
+#line 137 "mn-mailbox.gob"
+const GType *
+mn_mailbox_get_types (void)
+#line 524 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::get_types"
+{
+#line 139 "mn-mailbox.gob"
+
+ static GType *types = NULL;
+ G_LOCK_DEFINE_STATIC(types);
+
+ G_LOCK(types);
+ if (! types)
+ {
+ GType tmp_types[7];
+ int n_types = 0;
+ int i;
+
+#ifdef WITH_MBOX
+ tmp_types[n_types++] = MN_TYPE_MBOX_MAILBOX;
+#endif
+#ifdef WITH_MH
+ tmp_types[n_types++] = MN_TYPE_MH_MAILBOX;
+#endif
+#ifdef WITH_MAILDIR
+ tmp_types[n_types++] = MN_TYPE_MAILDIR_MAILBOX;
+#endif
+#ifdef WITH_POP3
+ tmp_types[n_types++] = MN_TYPE_POP3_MAILBOX;
+#endif
+#ifdef WITH_IMAP
+ tmp_types[n_types++] = MN_TYPE_IMAP_MAILBOX;
+#endif
+#ifdef WITH_SYLPHEED
+ tmp_types[n_types++] = MN_TYPE_SYLPHEED_MAILBOX;
+#endif
+#ifdef WITH_GMAIL
+ tmp_types[n_types++] = MN_TYPE_GMAIL_MAILBOX;
+#endif
+
+ types = g_new(GType, n_types + 1);
+ for (i = 0; i < n_types; i++)
+ types[i] = tmp_types[i];
+ types[n_types] = 0;
+ }
+ G_UNLOCK(types);
+
+ return types;
+ }}
+#line 571 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+/**
+ * mn_mailbox_new_async:
+ * @uri: location of the mailbox
+ * @callback: a function like
+ * "void (callback) (#MNMailbox *self, gpointer user_data)"
+ * @user_data: data to pass to @callback
+ *
+ * Creates a new #MNMailbox asynchronously. The newly created
+ * #MNMailbox will be passed to @callback.
+ **/
+#line 192 "mn-mailbox.gob"
+void
+mn_mailbox_new_async (const char * uri, gpointer callback, gpointer user_data)
+#line 587 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::new_async"
+#line 192 "mn-mailbox.gob"
+ g_return_if_fail (uri != NULL);
+#line 192 "mn-mailbox.gob"
+ g_return_if_fail (callback != NULL);
+#line 594 "mn-mailbox.c"
+{
+#line 196 "mn-mailbox.gob"
+
+ NewInfo *info;
+
+ info = g_new(NewInfo, 1);
+ info->uri = g_strdup(uri);
+ info->callback = callback;
+ info->user_data = user_data;
+
+ mn_thread_create(self_new_async_thread, info);
+ }}
+#line 607 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 207 "mn-mailbox.gob"
+static gpointer
+mn_mailbox_new_async_thread (gpointer data)
+#line 613 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::new_async_thread"
+{
+#line 209 "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 */
{
- mn_vfs_async_test(uri, G_FILE_TEST_EXISTS, mn_mailbox_new_async_test_cb, info);
+ if (! mn_vfs_test(info->uri, G_FILE_TEST_EXISTS))
+ mailbox = mn_unsupported_mailbox_new(info->uri, _("does not exist"));
gnome_vfs_uri_unref(vfs_uri);
}
- else
- mn_mailbox_new_async_continue(info);
-}
-static void
-mn_mailbox_new_async_test_cb (gboolean result, gpointer user_data)
+ if (! mailbox)
+ {
+ const GType *types;
+ int i;
+
+ types = self_get_types();
+ for (i = 0; types[i]; i++)
+ {
+ SelfClass *class;
+ gboolean is;
+
+ class = g_type_class_ref(types[i]);
+ is = class->impl_is(NULL, info->uri);
+ g_type_class_unref(class);
+
+ if (is)
+ {
+ mailbox = g_object_new(types[i], MN_MAILBOX_PROP_URI(info->uri), NULL);
+ if (mailbox->_priv->init_error)
+ {
+ MNMailbox *old_mailbox;
+
+ old_mailbox = mailbox;
+ mailbox = mn_unsupported_mailbox_new(info->uri, old_mailbox->_priv->init_error);
+ g_object_unref(old_mailbox);
+ }
+
+ break;
+ }
+ }
+ }
+
+ if (! mailbox)
+ 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
+ * than our main thread (so we do not call it in idle and timeout
+ * callbacks).
+ */
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ /* mailbox is now owned by the callback, do not unref it */
+
+ g_free(info->uri);
+ g_free(info);
+
+ return NULL;
+ }}
+#line 684 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 277 "mn-mailbox.gob"
+void
+mn_mailbox_set_init_error (MNMailbox * self, const char * format, ...)
+#line 690 "mn-mailbox.c"
{
- NewInfo *info = user_data;
-
- if (result)
- mn_mailbox_new_async_continue(info);
- else
- mn_mailbox_new_async_unsupported(info, _("does not exist"));
-}
-
-static void
-mn_mailbox_new_async_continue (NewInfo *info)
+#define __GOB_FUNCTION__ "MN:Mailbox::set_init_error"
+#line 277 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 277 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 277 "mn-mailbox.gob"
+ g_return_if_fail (format != NULL);
+#line 699 "mn-mailbox.c"
{
- g_return_if_fail(info != NULL);
-
- if (info->types[info->i])
- {
- MNMailboxClass *class;
-
- class = g_type_class_ref(info->types[info->i]);
- class->is(info->uri, mn_mailbox_new_async_is_cb, info);
- g_type_class_unref(class);
- }
- else
- mn_mailbox_new_async_unsupported(info, _("unknown format"));
-}
-
-static void
-mn_mailbox_new_async_is_cb (gboolean result, gpointer user_data)
+#line 279 "mn-mailbox.gob"
+
+ va_list args;
+
+ g_return_if_fail(selfp->init_error == NULL);
+
+ va_start(args, format);
+ selfp->init_error = g_strdup_vprintf(format, args);
+ va_end(args);
+ }}
+#line 711 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 289 "mn-mailbox.gob"
+void
+mn_mailbox_monitor (MNMailbox * self, const char * uri, GnomeVFSMonitorType monitor_type, MNMailboxMonitorEventType events)
+#line 717 "mn-mailbox.c"
{
- NewInfo *info = user_data;
-
- if (result)
- {
- MNMailbox *mailbox;
-
- mailbox = g_object_new(info->types[info->i], "uri", info->uri, NULL);
- if (! mailbox->priv->init_error)
- {
- info->mailbox = mailbox;
- mn_mailbox_new_async_finish(info);
- }
- else
- {
- mn_mailbox_new_async_unsupported(info, mailbox->priv->init_error);
- g_object_unref(mailbox);
- }
- }
- else
- {
- info->i++;
- mn_mailbox_new_async_continue(info);
- }
-}
-
-static void
-mn_mailbox_new_async_unsupported (NewInfo *info, const char *reason)
+#define __GOB_FUNCTION__ "MN:Mailbox::monitor"
+#line 289 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 289 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 289 "mn-mailbox.gob"
+ g_return_if_fail (uri != NULL);
+#line 726 "mn-mailbox.c"
{
- g_return_if_fail(info != NULL);
- g_return_if_fail(reason != NULL);
-
- info->mailbox = mn_unsupported_mailbox_new(info->uri, reason);
- mn_mailbox_new_async_finish(info);
-}
-
-static void
-mn_mailbox_new_async_finish (NewInfo *info)
+#line 294 "mn-mailbox.gob"
+
+ GnomeVFSResult result;
+
+ g_return_if_fail(MN_MAILBOX_CAN_CHECK(self));
+ g_return_if_fail(selfp->monitor_handle == NULL);
+
+ result = gnome_vfs_monitor_add(&selfp->monitor_handle,
+ uri,
+ monitor_type,
+ self_monitor_cb,
+ self);
+
+ if (result == GNOME_VFS_OK)
+ {
+ selfp->monitor_uri = g_strdup(uri);
+ selfp->monitor_events = events;
+ self_set_automatic(self, TRUE);
+ }
+ else
+ {
+ static gboolean first_time = TRUE;
+
+ g_warning(_("unable to monitor %s: %s"), uri, gnome_vfs_result_to_string(result));
+
+ if (first_time)
+ {
+ int minutes;
+ int seconds;
+ char *str;
+
+ first_time = FALSE;
+
+ minutes = eel_gconf_get_integer(MN_CONF_DELAY_MINUTES);
+ seconds = eel_gconf_get_integer(MN_CONF_DELAY_SECONDS);
+
+ if (minutes == 0)
+ str = g_strdup_printf(ngettext("As a fallback, they will be "
+ "checked every %i second (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ "As a fallback, they will be "
+ "checked every %i seconds (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ seconds),
+ seconds);
+ else if (seconds == 0)
+ str = g_strdup_printf(ngettext("As a fallback, they will be "
+ "checked every %i minute (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ "As a fallback, they will be "
+ "checked every %i minutes (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ minutes),
+ minutes);
+ else
+ str = g_strdup_printf(ngettext("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).",
+ minutes),
+ minutes);
+
+ mn_error_dialog("automatic-notification",
+ _("A monitoring error has occurred"),
+ _("Mail Notification was unable to enable automatic "
+ "notification for one or more mailboxes. %s"), str);
+ g_free(str);
+ }
+ }
+ }}
+#line 808 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 374 "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"
{
- info->callback(info->mailbox, info->user_data);
-
- g_free(info->uri);
- /* do not unref info->mailbox, it's now owned by the callback */
- g_free(info);
-}
-
-void
-mn_mailbox_set_init_error (MNMailbox *mailbox, const char *format, ...)
+#define __GOB_FUNCTION__ "MN:Mailbox::monitor_cb"
+#line 374 "mn-mailbox.gob"
+ g_return_if_fail (user_data != NULL);
+#line 819 "mn-mailbox.c"
{
- va_list args;
-
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
- g_return_if_fail(format != NULL);
- g_return_if_fail(mailbox->priv->init_error == NULL);
-
- va_start(args, format);
- mailbox->priv->init_error = g_strdup_vprintf(format, args);
- va_end(args);
-}
-
-void
-mn_mailbox_monitor (MNMailbox *mailbox,
- const char *uri,
- GnomeVFSMonitorType monitor_type,
- MNMailboxMonitorEventType events)
-{
- GnomeVFSResult result;
-
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
- g_return_if_fail(MN_MAILBOX_GET_CLASS(mailbox)->check != NULL);
- g_return_if_fail(mailbox->priv->monitor_handle == NULL);
- g_return_if_fail(uri != NULL);
-
- result = gnome_vfs_monitor_add(&mailbox->priv->monitor_handle,
- uri,
- monitor_type,
- mn_mailbox_monitor_cb,
- mailbox);
- if (result == GNOME_VFS_OK)
- {
- mailbox->priv->monitor_uri = g_strdup(uri);
- mailbox->priv->monitor_events = events;
- mn_mailbox_set_automatic(mailbox, TRUE);
- }
- else
- {
- static gboolean first_time = TRUE;
-
- g_warning(_("unable to monitor %s: %s"), uri, gnome_vfs_result_to_string(result));
-
- if (first_time)
- {
- int minutes;
- int seconds;
- char *str;
-
- first_time = FALSE;
-
- minutes = eel_gconf_get_integer(MN_CONF_DELAY_MINUTES);
- seconds = eel_gconf_get_integer(MN_CONF_DELAY_SECONDS);
-
- if (minutes == 0)
- str = g_strdup_printf(ngettext("As a fallback, they will be "
- "checked every %i second (this "
- "delay is configurable from the "
- "Preferences Dialog).",
- "As a fallback, they will be "
- "checked every %i seconds (this "
- "delay is configurable from the "
- "Preferences Dialog).",
- seconds),
- seconds);
- else if (seconds == 0)
- str = g_strdup_printf(ngettext("As a fallback, they will be "
- "checked every %i minute (this "
- "delay is configurable from the "
- "Preferences Dialog).",
- "As a fallback, they will be "
- "checked every %i minutes (this "
- "delay is configurable from the "
- "Preferences Dialog).",
- minutes),
- minutes);
- else
- str = g_strdup_printf(ngettext("As a fallback, they will be "
- "checked approximately every %i "
- "minute (this delay is "
- "configurable from the "
- "Preferences Dialog).",
- "As a fallback, they will be "
- "checked approximately every %i "
- "minutes (this delay is "
- "configurable from the "
- "Preferences Dialog).",
- minutes),
- minutes);
-
- mn_error_dialog("automatic-notification",
- _("A monitoring error has occurred."),
- _("Mail Notification was unable to enable automatic "
- "notification for one or more mailboxes. %s"), str);
- g_free(str);
- }
- }
+#line 380 "mn-mailbox.gob"
+
+ Self *self = user_data;
+
+ if (selfp->monitor_events & (1 << event_type))
+ self_check(self);
+ }}
+#line 828 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 387 "mn-mailbox.gob"
+static gboolean
+mn_mailbox_impl_is (MNMailbox * self, const char * uri)
+#line 834 "mn-mailbox.c"
+{
+ MNMailboxClass *klass;
+#line 387 "mn-mailbox.gob"
+ g_return_val_if_fail (self != NULL, (gboolean )0);
+#line 387 "mn-mailbox.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX (self), (gboolean )0);
+#line 841 "mn-mailbox.c"
+ klass = MN_MAILBOX_GET_CLASS(self);
+
+ if(klass->impl_is)
+ return (*klass->impl_is)(self,uri);
+ else
+ return (gboolean )(0);
}
-static void
-mn_mailbox_monitor_cb (GnomeVFSMonitorHandle *handle,
- const char *monitor_uri,
- const char *info_uri,
- GnomeVFSMonitorEventType event_type,
- gpointer user_data)
+#line 389 "mn-mailbox.gob"
+static void
+mn_mailbox_impl_check (MNMailbox * self)
+#line 853 "mn-mailbox.c"
{
- MNMailbox *mailbox = user_data;
-
- if (mailbox->priv->monitor_events & (1 << event_type))
- mn_mailbox_check(mailbox);
+ MNMailboxClass *klass;
+#line 389 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 389 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 860 "mn-mailbox.c"
+ klass = MN_MAILBOX_GET_CLASS(self);
+
+ if(klass->impl_check)
+ (*klass->impl_check)(self);
}
-void
-mn_mailbox_check (MNMailbox *mailbox)
+#line 391 "mn-mailbox.gob"
+static void
+mn_mailbox_impl_threaded_check (MNMailbox * self)
+#line 870 "mn-mailbox.c"
{
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
- g_return_if_fail(MN_MAILBOX_GET_CLASS(mailbox)->check != NULL);
-
- if (! mailbox->priv->checking)
- {
- g_object_ref(mailbox);
- mailbox->priv->checking = TRUE;
- mn_mailbox_set_error(mailbox, NULL);
-
- MN_MAILBOX_GET_CLASS(mailbox)->check(mailbox);
- }
+ MNMailboxClass *klass;
+#line 391 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 391 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 877 "mn-mailbox.c"
+ klass = MN_MAILBOX_GET_CLASS(self);
+
+ if(klass->impl_threaded_check)
+ (*klass->impl_threaded_check)(self);
}
-void
-mn_mailbox_end_check (MNMailbox *mailbox)
+#line 394 "mn-mailbox.gob"
+void
+mn_mailbox_check (MNMailbox * self)
+#line 887 "mn-mailbox.c"
{
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
- g_return_if_fail(mailbox->priv->checking == TRUE);
-
- mailbox->priv->checking = FALSE;
- g_object_unref(mailbox);
-}
+#define __GOB_FUNCTION__ "MN:Mailbox::check"
+#line 394 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 394 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 894 "mn-mailbox.c"
+{
+#line 396 "mn-mailbox.gob"
+
+ g_return_if_fail(MN_MAILBOX_CAN_CHECK(self));
+
+ if (! selfp->checking)
+ {
+ g_object_ref(self);
+ selfp->checking = TRUE;
+ self_set_error(self, NULL);
+
+ if (SELF_GET_CLASS(self)->impl_threaded_check)
+ mn_thread_create((GThreadFunc) SELF_GET_CLASS(self)->impl_threaded_check, self);
+ else
+ SELF_GET_CLASS(self)->impl_check(self);
+ }
+ }}
+#line 912 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 412 "mn-mailbox.gob"
+void
+mn_mailbox_end_check (MNMailbox * self)
+#line 918 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::end_check"
+#line 412 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 412 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 925 "mn-mailbox.c"
+{
+#line 414 "mn-mailbox.gob"
+
+ g_return_if_fail(selfp->checking == TRUE);
+
+ selfp->checking = FALSE;
+ g_object_unref(self);
+ }}
+#line 934 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 421 "mn-mailbox.gob"
+void
+mn_mailbox_notice (MNMailbox * self, const char * format, ...)
+#line 940 "mn-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailbox::notice"
+#line 421 "mn-mailbox.gob"
+ g_return_if_fail (self != NULL);
+#line 421 "mn-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 421 "mn-mailbox.gob"
+ g_return_if_fail (format != NULL);
+#line 949 "mn-mailbox.c"
+{
+#line 423 "mn-mailbox.gob"
+
+ va_list args;
+ char *notice;
+ char *prefixed_notice;
+
+ va_start(args, format);
+ notice = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ prefixed_notice = g_strdup_printf("%s: %s", selfp->uri, notice);
+ g_free(notice);
+
+ mn_info("%s", prefixed_notice);
+ g_free(prefixed_notice);
+ }}
+#line 967 "mn-mailbox.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-mailbox.gob b/src/mn-mailbox.gob
@@ -0,0 +1,438 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include <stdarg.h>
+%}
+
+%privateheader{
+#include <libgnomevfs/gnome-vfs.h>
+
+ typedef enum
+ {
+ MN_MAILBOX_MONITOR_EVENT_CHANGED = 1 << GNOME_VFS_MONITOR_EVENT_CHANGED,
+ MN_MAILBOX_MONITOR_EVENT_DELETED = 1 << GNOME_VFS_MONITOR_EVENT_DELETED,
+ MN_MAILBOX_MONITOR_EVENT_STARTEXECUTING = 1 << GNOME_VFS_MONITOR_EVENT_STARTEXECUTING,
+ MN_MAILBOX_MONITOR_EVENT_STOPEXECUTING = 1 << GNOME_VFS_MONITOR_EVENT_STOPEXECUTING,
+ MN_MAILBOX_MONITOR_EVENT_CREATED = 1 << GNOME_VFS_MONITOR_EVENT_CREATED,
+ MN_MAILBOX_MONITOR_EVENT_METADATA_CHANGED = 1 << GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED
+ } MNMailboxMonitorEventType;
+%}
+
+%h{
+#define MN_MAILBOX_CAN_CHECK(self) \
+ (MN_MAILBOX_GET_CLASS((self))->impl_check != NULL || MN_MAILBOX_GET_CLASS((self))->impl_threaded_check != NULL)
+%}
+
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#ifdef WITH_MBOX
+#include "mn-mbox-mailbox.h"
+#endif
+#ifdef WITH_MH
+#include "mn-mh-mailbox.h"
+#endif
+#ifdef WITH_MAILDIR
+#include "mn-maildir-mailbox.h"
+#endif
+#ifdef WITH_POP3
+#include "mn-pop3-mailbox.h"
+#endif
+#ifdef WITH_IMAP
+#include "mn-imap-mailbox.h"
+#endif
+#ifdef WITH_SYLPHEED
+#include "mn-sylpheed-mailbox.h"
+#endif
+#ifdef WITH_GMAIL
+#include "mn-gmail-mailbox.h"
+#endif
+#include "mn-vfs.h"
+#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;
+ void (*callback) (MNMailbox *self,
+ gpointer user_data);
+ gpointer user_data;
+} NewInfo;
+%}
+
+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)
+ set
+ {
+ g_return_if_fail(selfp->uri == NULL);
+ selfp->uri = g_value_dup_string(VAL);
+ selfp->name = mn_uri_format_for_display(selfp->uri);
+ };
+ 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);
+ public const char *get_name (self) { return selfp->name; }
+
+ private gboolean automatic;
+ property BOOLEAN automatic (blurb = _("Whether the mailbox has to be manually checked or not"),
+ link,
+ export);
+
+ private gboolean has_new;
+ property BOOLEAN has_new (blurb = _("Whether the mailbox has new mail or not"),
+ link,
+ export);
+
+ private char *error destroywith g_free;
+ property STRING error (blurb = _("The mailbox error, if any"), link);
+ protected void
+ set_error (self, const char *format, ...)
+ {
+ va_list args;
+ char *error = NULL;
+
+ if (format)
+ {
+ va_start(args, format);
+ error = g_strdup_vprintf(format, args);
+ va_end(args);
+ }
+
+ g_object_set(G_OBJECT(self), MN_MAILBOX_PROP_ERROR(error), NULL);
+ g_free(error);
+ }
+ public const char *get_error (self) { return selfp->error; }
+
+ private GnomeVFSMonitorHandle *monitor_handle destroywith gnome_vfs_monitor_cancel;
+ private char *monitor_uri destroywith g_free;
+ private MNMailboxMonitorEventType monitor_events;
+
+ private gboolean checking;
+
+ public const GType *
+ get_types (void)
+ {
+ static GType *types = NULL;
+ G_LOCK_DEFINE_STATIC(types);
+
+ G_LOCK(types);
+ if (! types)
+ {
+ GType tmp_types[7];
+ int n_types = 0;
+ int i;
+
+#ifdef WITH_MBOX
+ tmp_types[n_types++] = MN_TYPE_MBOX_MAILBOX;
+#endif
+#ifdef WITH_MH
+ tmp_types[n_types++] = MN_TYPE_MH_MAILBOX;
+#endif
+#ifdef WITH_MAILDIR
+ tmp_types[n_types++] = MN_TYPE_MAILDIR_MAILBOX;
+#endif
+#ifdef WITH_POP3
+ tmp_types[n_types++] = MN_TYPE_POP3_MAILBOX;
+#endif
+#ifdef WITH_IMAP
+ tmp_types[n_types++] = MN_TYPE_IMAP_MAILBOX;
+#endif
+#ifdef WITH_SYLPHEED
+ tmp_types[n_types++] = MN_TYPE_SYLPHEED_MAILBOX;
+#endif
+#ifdef WITH_GMAIL
+ tmp_types[n_types++] = MN_TYPE_GMAIL_MAILBOX;
+#endif
+
+ types = g_new(GType, n_types + 1);
+ for (i = 0; i < n_types; i++)
+ types[i] = tmp_types[i];
+ types[n_types] = 0;
+ }
+ G_UNLOCK(types);
+
+ return types;
+ }
+
+ /**
+ * new_async:
+ * @uri: location of the mailbox
+ * @callback: a function like
+ * "void (callback) (#MNMailbox *self, gpointer user_data)"
+ * @user_data: data to pass to @callback
+ *
+ * Creates a new #MNMailbox asynchronously. The newly created
+ * #MNMailbox will be passed to @callback.
+ **/
+ public void
+ new_async (const char *uri (check null),
+ gpointer callback (check null),
+ gpointer user_data)
+ {
+ NewInfo *info;
+
+ info = g_new(NewInfo, 1);
+ info->uri = g_strdup(uri);
+ info->callback = callback;
+ info->user_data = user_data;
+
+ mn_thread_create(self_new_async_thread, info);
+ }
+
+ private gpointer
+ 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 (! mn_vfs_test(info->uri, G_FILE_TEST_EXISTS))
+ mailbox = mn_unsupported_mailbox_new(info->uri, _("does not exist"));
+ gnome_vfs_uri_unref(vfs_uri);
+ }
+
+ if (! mailbox)
+ {
+ const GType *types;
+ int i;
+
+ types = self_get_types();
+ for (i = 0; types[i]; i++)
+ {
+ SelfClass *class;
+ gboolean is;
+
+ class = g_type_class_ref(types[i]);
+ is = class->impl_is(NULL, info->uri);
+ g_type_class_unref(class);
+
+ if (is)
+ {
+ mailbox = g_object_new(types[i], MN_MAILBOX_PROP_URI(info->uri), NULL);
+ if (mailbox->_priv->init_error)
+ {
+ MNMailbox *old_mailbox;
+
+ old_mailbox = mailbox;
+ mailbox = mn_unsupported_mailbox_new(info->uri, old_mailbox->_priv->init_error);
+ g_object_unref(old_mailbox);
+ }
+
+ break;
+ }
+ }
+ }
+
+ if (! mailbox)
+ 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
+ * than our main thread (so we do not call it in idle and timeout
+ * callbacks).
+ */
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ /* mailbox is now owned by the callback, do not unref it */
+
+ g_free(info->uri);
+ g_free(info);
+
+ return NULL;
+ }
+
+ private char *init_error destroywith g_free;
+ protected void
+ set_init_error (self, const char *format (check null), ...)
+ {
+ va_list args;
+
+ g_return_if_fail(selfp->init_error == NULL);
+
+ va_start(args, format);
+ selfp->init_error = g_strdup_vprintf(format, args);
+ va_end(args);
+ }
+
+ protected void
+ monitor (self,
+ const char *uri (check null),
+ GnomeVFSMonitorType monitor_type,
+ MNMailboxMonitorEventType events)
+ {
+ GnomeVFSResult result;
+
+ g_return_if_fail(MN_MAILBOX_CAN_CHECK(self));
+ g_return_if_fail(selfp->monitor_handle == NULL);
+
+ result = gnome_vfs_monitor_add(&selfp->monitor_handle,
+ uri,
+ monitor_type,
+ self_monitor_cb,
+ self);
+
+ if (result == GNOME_VFS_OK)
+ {
+ selfp->monitor_uri = g_strdup(uri);
+ selfp->monitor_events = events;
+ self_set_automatic(self, TRUE);
+ }
+ else
+ {
+ static gboolean first_time = TRUE;
+
+ g_warning(_("unable to monitor %s: %s"), uri, gnome_vfs_result_to_string(result));
+
+ if (first_time)
+ {
+ int minutes;
+ int seconds;
+ char *str;
+
+ first_time = FALSE;
+
+ minutes = eel_gconf_get_integer(MN_CONF_DELAY_MINUTES);
+ seconds = eel_gconf_get_integer(MN_CONF_DELAY_SECONDS);
+
+ if (minutes == 0)
+ str = g_strdup_printf(ngettext("As a fallback, they will be "
+ "checked every %i second (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ "As a fallback, they will be "
+ "checked every %i seconds (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ seconds),
+ seconds);
+ else if (seconds == 0)
+ str = g_strdup_printf(ngettext("As a fallback, they will be "
+ "checked every %i minute (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ "As a fallback, they will be "
+ "checked every %i minutes (this "
+ "delay is configurable from the "
+ "Properties Dialog).",
+ minutes),
+ minutes);
+ else
+ str = g_strdup_printf(ngettext("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).",
+ minutes),
+ minutes);
+
+ mn_error_dialog("automatic-notification",
+ _("A monitoring error has occurred"),
+ _("Mail Notification was unable to enable automatic "
+ "notification for one or more mailboxes. %s"), str);
+ g_free(str);
+ }
+ }
+ }
+
+ private void
+ monitor_cb (GnomeVFSMonitorHandle *handle,
+ const char *monitor_uri,
+ const char *info_uri,
+ GnomeVFSMonitorEventType event_type,
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ if (selfp->monitor_events & (1 << event_type))
+ self_check(self);
+ }
+
+ virtual private gboolean
+ impl_is (self, const char *uri);
+ virtual private void
+ impl_check (self);
+ virtual private void
+ impl_threaded_check (self);
+
+ public void
+ check (self)
+ {
+ g_return_if_fail(MN_MAILBOX_CAN_CHECK(self));
+
+ if (! selfp->checking)
+ {
+ g_object_ref(self);
+ selfp->checking = TRUE;
+ self_set_error(self, NULL);
+
+ if (SELF_GET_CLASS(self)->impl_threaded_check)
+ mn_thread_create((GThreadFunc) SELF_GET_CLASS(self)->impl_threaded_check, self);
+ else
+ SELF_GET_CLASS(self)->impl_check(self);
+ }
+ }
+
+ protected void
+ end_check (self)
+ {
+ g_return_if_fail(selfp->checking == TRUE);
+
+ selfp->checking = FALSE;
+ g_object_unref(self);
+ }
+
+ protected void
+ notice (self, const char *format (check null), ...)
+ {
+ va_list args;
+ char *notice;
+ char *prefixed_notice;
+
+ va_start(args, format);
+ notice = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ prefixed_notice = g_strdup_printf("%s: %s", selfp->uri, notice);
+ g_free(notice);
+
+ mn_info("%s", prefixed_notice);
+ g_free(prefixed_notice);
+ }
+}
diff --git a/src/mn-mailbox.h b/src/mn-mailbox.h
@@ -1,104 +1,112 @@
-/*
- * 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.
- */
-
-#ifndef _MN_MAILBOX_H
-#define _MN_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
-#include <stdarg.h>
+#include <glib.h>
#include <glib-object.h>
-#include <libgnomevfs/gnome-vfs.h>
-
-#define MN_TYPE_MAILBOX (mn_mailbox_get_type())
-#define MN_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_MAILBOX, MNMailbox))
-#define MN_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_MAILBOX, MNMailboxClass))
-#define MN_IS_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_MAILBOX))
-#define MN_IS_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_MAILBOX))
-#define MN_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_MAILBOX, MNMailboxClass))
-
-typedef struct _MNMailboxPrivate MNMailboxPrivate;
-
-typedef struct
-{
- GObject object;
-
- MNMailboxPrivate *priv;
-} MNMailbox;
-
-typedef void (MNMailboxIsCallback) (gboolean is, gpointer user_data);
-typedef struct
-{
- GObjectClass object_class;
- const char *stock_id;
- const char *format;
-
- void (*is) (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data);
- void (*check) (MNMailbox *mailbox);
-} MNMailboxClass;
-
-const GType *mn_mailbox_get_types (void);
-GType mn_mailbox_get_type (void);
+#include <stdarg.h>
-typedef void (MNMailboxNewAsyncCallback) (MNMailbox *mailbox,
- gpointer user_data);
+#ifndef __MN_MAILBOX_H__
+#define __MN_MAILBOX_H__
-void mn_mailbox_new_async (const char *uri,
- MNMailboxNewAsyncCallback *callback,
- gpointer user_data);
-void mn_mailbox_set_init_error (MNMailbox *mailbox,
- const char *format,
- ...);
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
-const char *mn_mailbox_get_uri (MNMailbox *mailbox);
-const char *mn_mailbox_get_name (MNMailbox *mailbox);
-void mn_mailbox_set_automatic (MNMailbox *mailbox,
- gboolean automatic);
-gboolean mn_mailbox_get_automatic (MNMailbox *mailbox);
-void mn_mailbox_set_has_new (MNMailbox *mailbox,
- gboolean has_new);
-gboolean mn_mailbox_get_has_new (MNMailbox *mailbox);
+#define MN_MAILBOX_CAN_CHECK(self) \
+ (MN_MAILBOX_GET_CLASS((self))->impl_check != NULL || MN_MAILBOX_GET_CLASS((self))->impl_threaded_check != NULL)
-void mn_mailbox_set_error (MNMailbox *mailbox,
- const char *format,
- ...);
-const char *mn_mailbox_get_error (MNMailbox *mailbox);
-typedef enum
-{
- MN_MAILBOX_MONITOR_EVENT_CHANGED = 1 << GNOME_VFS_MONITOR_EVENT_CHANGED,
- MN_MAILBOX_MONITOR_EVENT_DELETED = 1 << GNOME_VFS_MONITOR_EVENT_DELETED,
- MN_MAILBOX_MONITOR_EVENT_STARTEXECUTING = 1 << GNOME_VFS_MONITOR_EVENT_STARTEXECUTING,
- MN_MAILBOX_MONITOR_EVENT_STOPEXECUTING = 1 << GNOME_VFS_MONITOR_EVENT_STOPEXECUTING,
- MN_MAILBOX_MONITOR_EVENT_CREATED = 1 << GNOME_VFS_MONITOR_EVENT_CREATED,
- MN_MAILBOX_MONITOR_EVENT_METADATA_CHANGED = 1 << GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED
-} MNMailboxMonitorEventType;
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_MAILBOX (mn_mailbox_get_type())
+#define MN_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mailbox_get_type(), MNMailbox)
+#define MN_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mailbox_get_type(), MNMailbox const)
+#define MN_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_mailbox_get_type(), MNMailboxClass)
+#define MN_IS_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_mailbox_get_type ())
-void mn_mailbox_monitor (MNMailbox *mailbox,
- const char *uri,
- GnomeVFSMonitorType monitor_type,
- MNMailboxMonitorEventType events);
+#define MN_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_mailbox_get_type(), MNMailboxClass)
-void mn_mailbox_check (MNMailbox *mailbox);
-void mn_mailbox_end_check (MNMailbox *mailbox);
+/* Private structure type */
+typedef struct _MNMailboxPrivate MNMailboxPrivate;
-#endif /* _MN_MAILBOX_H */
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_MAILBOX__
+#define __TYPEDEF_MN_MAILBOX__
+typedef struct _MNMailbox MNMailbox;
+#endif
+struct _MNMailbox {
+ GObject __parent__;
+ /*< private >*/
+ MNMailboxPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNMailboxClass MNMailboxClass;
+struct _MNMailboxClass {
+ GObjectClass __parent__;
+ gboolean (* impl_is) (MNMailbox * self, const char * uri);
+ void (* impl_check) (MNMailbox * self);
+ void (* impl_threaded_check) (MNMailbox * self);
+ const char * stock_id;
+ const char * format;
+};
+
+
+/*
+ * 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,
+ gboolean val);
+gboolean mn_mailbox_get_has_new (MNMailbox * self);
+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,
+ gpointer callback,
+ gpointer user_data);
+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_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;})
+#define MN_MAILBOX_GET_PROP_AUTOMATIC(arg) "automatic", __extension__ ({gboolean *z = (arg); z;})
+#define MN_MAILBOX_PROP_HAS_NEW(arg) "has_new", __extension__ ({gboolean z = (arg); z;})
+#define MN_MAILBOX_GET_PROP_HAS_NEW(arg) "has_new", __extension__ ({gboolean *z = (arg); z;})
+#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_NAME(arg) "name",(gchar *)(arg)
+#define MN_MAILBOX_GET_PROP_NAME(arg) "name",(gchar **)(arg)
+#define MN_MAILBOX_PROP_AUTOMATIC(arg) "automatic",(gboolean )(arg)
+#define MN_MAILBOX_GET_PROP_AUTOMATIC(arg) "automatic",(gboolean *)(arg)
+#define MN_MAILBOX_PROP_HAS_NEW(arg) "has_new",(gboolean )(arg)
+#define MN_MAILBOX_GET_PROP_HAS_NEW(arg) "has_new",(gboolean *)(arg)
+#define MN_MAILBOX_PROP_ERROR(arg) "error",(gchar *)(arg)
+#define MN_MAILBOX_GET_PROP_ERROR(arg) "error",(gchar **)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mailboxes-private.h b/src/mn-mailboxes-private.h
@@ -0,0 +1,24 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_MAILBOXES_PRIVATE_H__
+#define __MN_MAILBOXES_PRIVATE_H__
+
+#include "mn-mailboxes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNMailboxesPrivate {
+#line 34 "mn-mailboxes.gob"
+ GSList * list;
+#line 35 "mn-mailboxes.gob"
+ unsigned int timeout_id;
+#line 18 "mn-mailboxes-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mailboxes.c b/src/mn-mailboxes.c
@@ -1,219 +1,622 @@
-/*
- * 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 <string.h>
-#include <glib/gi18n-lib.h>
-#include "mn-conf.h"
-#include "mn-dialog.h"
-#include "mn-mailbox.h"
-#include "mn-util.h"
-#include "mn-ui.h"
-#include "mn-mailboxes.h"
-#include "mn-uri.h"
-#include "mn-preferences.h"
-#include "mn-pending-mailbox.h"
-
-/*** variables ***************************************************************/
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 2004
+ (do not edit directly) */
-static GSList *mailboxes = NULL;
-static unsigned int timeout_id = -1;
+/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
-/*** functions ***************************************************************/
+#define GOB_VERSION_MAJOR 2
+#define GOB_VERSION_MINOR 0
+#define GOB_VERSION_PATCHLEVEL 9
-static void mn_mailboxes_changed (void);
-static void mn_mailboxes_new_cb (MNMailbox *mailbox, gpointer user_data);
-static void mn_mailboxes_notify_h (GObject *object,
- GParamSpec *pspec,
- gpointer user_data);
-static gboolean mn_mailboxes_timeout_cb (gpointer data);
-static int mn_mailboxes_compare_func (gconstpointer a, gconstpointer b);
+#define selfp (self->_priv)
-/*** implementation **********************************************************/
-
-void
-mn_mailboxes_register (void)
-{
- GSList *gconf_mailboxes;
- GSList *l;
+#include "mn-mailboxes.h"
- gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
+#include "mn-mailboxes-private.h"
- /* first step: remove old mailboxes */
+#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 */
- loop:
- MN_LIST_FOREACH(l, mailboxes)
- {
- MNMailbox *mailbox = l->data;
+#line 22 "mn-mailboxes.gob"
- if (! g_slist_find_custom(gconf_mailboxes, mn_mailbox_get_uri(mailbox), (GCompareFunc) mn_uri_cmp))
- {
- g_object_unref(mailbox);
- mailboxes = g_slist_delete_link(mailboxes, l);
- goto loop;
+#include "config.h"
+#include <glib/gi18n-lib.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"
+/* self casting macros */
+#define SELF(x) MN_MAILBOXES(x)
+#define SELF_CONST(x) MN_MAILBOXES_CONST(x)
+#define IS_SELF(x) MN_IS_MAILBOXES(x)
+#define TYPE_SELF MN_TYPE_MAILBOXES
+#define SELF_CLASS(x) MN_MAILBOXES_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_MAILBOXES_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNMailboxes Self;
+typedef MNMailboxesClass SelfClass;
+
+/* here are local prototypes */
+static void mn_mailboxes_class_init (MNMailboxesClass * c) G_GNUC_UNUSED;
+static void mn_mailboxes_list_changed (MNMailboxes * self) G_GNUC_UNUSED;
+static void mn_mailboxes_status_changed (MNMailboxes * self) G_GNUC_UNUSED;
+static void mn_mailboxes_init (MNMailboxes * self) G_GNUC_UNUSED;
+static void mn_mailboxes_notify_delay_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data) G_GNUC_UNUSED;
+static void mn_mailboxes_notify_mailboxes_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data) G_GNUC_UNUSED;
+static void mn_mailboxes_update_from_conf (MNMailboxes * self) G_GNUC_UNUSED;
+static void mn_mailboxes_new_cb (MNMailbox * mailbox, gpointer user_data) G_GNUC_UNUSED;
+static void mn_mailboxes_notify_has_new_h (GObject * object, GParamSpec * pspec, gpointer user_data) G_GNUC_UNUSED;
+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;
+
+/*
+ * Signal connection wrapper macro shortcuts
+ */
+#define self_connect__list_changed(object,func,data) mn_mailboxes_connect__list_changed((object),(func),(data))
+#define self_connect_after__list_changed(object,func,data) mn_mailboxes_connect_after__list_changed((object),(func),(data))
+#define self_connect_data__list_changed(object,func,data,destroy_data,flags) mn_mailboxes_connect_data__list_changed((object),(func),(data),(destroy_data),(flags))
+#define self_connect__status_changed(object,func,data) mn_mailboxes_connect__status_changed((object),(func),(data))
+#define self_connect_after__status_changed(object,func,data) mn_mailboxes_connect_after__status_changed((object),(func),(data))
+#define self_connect_data__status_changed(object,func,data,destroy_data,flags) mn_mailboxes_connect_data__status_changed((object),(func),(data),(destroy_data),(flags))
+
+enum {
+ LIST_CHANGED_SIGNAL,
+ STATUS_CHANGED_SIGNAL,
+ LAST_SIGNAL
+};
+
+static guint object_signals[LAST_SIGNAL] = {0};
+
+/* pointer to the class of our parent */
+static GObjectClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_list_changed mn_mailboxes_list_changed
+#define self_status_changed mn_mailboxes_status_changed
+#define self_notify_delay_cb mn_mailboxes_notify_delay_cb
+#define self_notify_mailboxes_cb mn_mailboxes_notify_mailboxes_cb
+#define self_update_from_conf mn_mailboxes_update_from_conf
+#define self_new_cb mn_mailboxes_new_cb
+#define self_notify_has_new_h mn_mailboxes_notify_has_new_h
+#define self_notify_error_h mn_mailboxes_notify_error_h
+#define self_install_timeout mn_mailboxes_install_timeout
+#define self_timeout_cb mn_mailboxes_timeout_cb
+#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_new mn_mailboxes_new
+GType
+mn_mailboxes_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNMailboxesClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_mailboxes_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNMailboxes),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_mailboxes_init,
+ NULL
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "MNMailboxes", &info, (GTypeFlags)0);
}
- }
-
- /* second step: add new mailboxes */
- MN_LIST_FOREACH(l, gconf_mailboxes)
- {
- const char *uri = l->data;
+ return type;
+}
- if (! mn_mailboxes_find(uri))
- {
- MNMailbox *mailbox;
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNMailboxes *)g_object_new(mn_mailboxes_get_type(), NULL))
- mailbox = mn_pending_mailbox_new(uri);
- mailboxes = g_slist_append(mailboxes, mailbox);
-
- mn_mailbox_new_async(uri, mn_mailboxes_new_cb, NULL);
- }
- }
-
- mn_slist_free(gconf_mailboxes);
- mn_mailboxes_changed();
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNMailboxes * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNMailboxes *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNMailboxes *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNMailboxes *)g_object_new_valist (mn_mailboxes_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
+
static void
-mn_mailboxes_changed (void)
+___finalize(GObject *obj_self)
{
- mn_preferences_update_list();
- mn_ui_update_sensitivity();
- mn_ui_update_icon();
+#define __GOB_FUNCTION__ "MN:Mailboxes::finalize"
+ MNMailboxes *self G_GNUC_UNUSED = MN_MAILBOXES (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+ g_free (priv);
}
+#undef __GOB_FUNCTION__
-static void
-mn_mailboxes_new_cb (MNMailbox *mailbox, gpointer user_data)
+static void
+mn_mailboxes_class_init (MNMailboxesClass * c G_GNUC_UNUSED)
{
- GSList *elem;
-
- elem = g_slist_find_custom(mailboxes, mn_mailbox_get_uri(mailbox), mn_mailboxes_compare_func);
- if (elem)
- {
- g_signal_connect(G_OBJECT(mailbox), "notify", G_CALLBACK(mn_mailboxes_notify_h), NULL);
- if (MN_MAILBOX_GET_CLASS(mailbox)->check)
- mn_mailbox_check(mailbox);
+#define __GOB_FUNCTION__ "MN:Mailboxes::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
+
+ object_signals[LIST_CHANGED_SIGNAL] =
+ g_signal_new ("list_changed",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST),
+ G_STRUCT_OFFSET (MNMailboxesClass, list_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ object_signals[STATUS_CHANGED_SIGNAL] =
+ g_signal_new ("status_changed",
+ G_TYPE_FROM_CLASS (g_object_class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST),
+ G_STRUCT_OFFSET (MNMailboxesClass, status_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ c->list_changed = NULL;
+ c->status_changed = NULL;
+ g_object_class->finalize = ___finalize;
+}
+#undef __GOB_FUNCTION__
+#line 42 "mn-mailboxes.gob"
+static void
+mn_mailboxes_init (MNMailboxes * self G_GNUC_UNUSED)
+#line 189 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::init"
+ self->_priv = g_new0 (MNMailboxesPrivate, 1);
+ {
+#line 43 "mn-mailboxes.gob"
- g_object_unref(elem->data);
- elem->data = mailbox;
+ self_update_from_conf(self);
+ self_install_timeout(self);
- mn_mailboxes_changed();
- }
- else
- g_object_unref(mailbox);
+ 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);
+
+#line 202 "mn-mailboxes.c"
+ }
}
+#undef __GOB_FUNCTION__
-static void
-mn_mailboxes_notify_h (GObject *object, GParamSpec *pspec, gpointer user_data)
+
+#line 37 "mn-mailboxes.gob"
+static void
+mn_mailboxes_list_changed (MNMailboxes * self)
+#line 211 "mn-mailboxes.c"
{
- MNMailbox *mailbox = MN_MAILBOX(object);
- gboolean update = FALSE;
+ GValue ___param_values[1];
+ GValue ___return_val;
- if (! strcmp(g_param_spec_get_name(pspec), "has-new"))
- {
- gboolean has_new;
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
- has_new = mn_mailbox_get_has_new(mailbox);
- mn_info(has_new ? _("%s has new mail") : _("%s has no new mail"), mn_mailbox_get_name(mailbox));
+#line 37 "mn-mailboxes.gob"
+ g_return_if_fail (self != NULL);
+#line 37 "mn-mailboxes.gob"
+ g_return_if_fail (MN_IS_MAILBOXES (self));
+#line 223 "mn-mailboxes.c"
- update = TRUE;
- }
- else if (! strcmp(g_param_spec_get_name(pspec), "error"))
- {
- const char *error;
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
- error = mn_mailbox_get_error(mailbox);
- if (error)
- mn_info(_("%s reported an error: %s"), mn_mailbox_get_name(mailbox), error);
+ g_signal_emitv (___param_values,
+ object_signals[LIST_CHANGED_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
- update = TRUE;
- }
-
- if (update)
- mn_ui_update_icon();
+ g_value_unset (&___param_values[0]);
}
-void
-mn_mailboxes_install_timeout (void)
+#line 39 "mn-mailboxes.gob"
+static void
+mn_mailboxes_status_changed (MNMailboxes * self)
+#line 240 "mn-mailboxes.c"
{
- int minutes;
- int seconds;
+ GValue ___param_values[1];
+ GValue ___return_val;
+
+memset (&___return_val, 0, sizeof (___return_val));
+memset (&___param_values, 0, sizeof (___param_values));
+
+#line 39 "mn-mailboxes.gob"
+ g_return_if_fail (self != NULL);
+#line 39 "mn-mailboxes.gob"
+ g_return_if_fail (MN_IS_MAILBOXES (self));
+#line 252 "mn-mailboxes.c"
- if (timeout_id != -1)
- {
- g_source_remove(timeout_id);
- timeout_id = -1;
- }
+ ___param_values[0].g_type = 0;
+ g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (&___param_values[0], (gpointer) self);
- minutes = eel_gconf_get_integer(MN_CONF_DELAY_MINUTES);
- seconds = eel_gconf_get_integer(MN_CONF_DELAY_SECONDS);
+ g_signal_emitv (___param_values,
+ object_signals[STATUS_CHANGED_SIGNAL],
+ 0 /* detail */,
+ &___return_val);
- if (minutes != 0 || seconds != 0)
- timeout_id = g_timeout_add(((minutes * 60) + seconds) * 1000,
- mn_mailboxes_timeout_cb,
- NULL);
+ g_value_unset (&___param_values[0]);
}
-static gboolean
+
+#line 51 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::notify_delay_cb"
+#line 51 "mn-mailboxes.gob"
+ g_return_if_fail (user_data != NULL);
+#line 275 "mn-mailboxes.c"
+{
+#line 56 "mn-mailboxes.gob"
+
+ Self *self = user_data;
+ self_install_timeout(self);
+ }}
+#line 282 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 61 "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"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::notify_mailboxes_cb"
+#line 61 "mn-mailboxes.gob"
+ g_return_if_fail (user_data != NULL);
+#line 293 "mn-mailboxes.c"
+{
+#line 66 "mn-mailboxes.gob"
+
+ Self *self = user_data;
+ self_update_from_conf(self);
+ }}
+#line 300 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 71 "mn-mailboxes.gob"
+static void
+mn_mailboxes_update_from_conf (MNMailboxes * self)
+#line 306 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::update_from_conf"
+#line 71 "mn-mailboxes.gob"
+ g_return_if_fail (self != NULL);
+#line 71 "mn-mailboxes.gob"
+ g_return_if_fail (MN_IS_MAILBOXES (self));
+#line 313 "mn-mailboxes.c"
+{
+#line 73 "mn-mailboxes.gob"
+
+ GSList *gconf_mailboxes;
+ GSList *l;
+ gboolean changed = FALSE;
+
+ gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
+
+ /* first step: remove old mailboxes */
+
+ loop:
+ MN_LIST_FOREACH(l, selfp->list)
+ {
+ MNMailbox *mailbox = l->data;
+
+ if (! g_slist_find_custom(gconf_mailboxes, mn_mailbox_get_uri(mailbox), (GCompareFunc) mn_uri_cmp))
+ {
+ g_object_unref(mailbox);
+ selfp->list = g_slist_delete_link(selfp->list, l);
+ changed = TRUE;
+ goto loop;
+ }
+ }
+
+ /* second step: add new mailboxes */
+
+ MN_LIST_FOREACH(l, gconf_mailboxes)
+ {
+ const char *uri = l->data;
+
+ if (! self_find(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);
+ }
+ }
+
+ mn_pointers_free(gconf_mailboxes);
+ if (changed)
+ self_list_changed(self);
+ }}
+#line 361 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 119 "mn-mailboxes.gob"
+static void
+mn_mailboxes_new_cb (MNMailbox * mailbox, gpointer user_data)
+#line 367 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::new_cb"
+#line 119 "mn-mailboxes.gob"
+ g_return_if_fail (mailbox != NULL);
+#line 119 "mn-mailboxes.gob"
+ g_return_if_fail (MN_IS_MAILBOX (mailbox));
+#line 119 "mn-mailboxes.gob"
+ g_return_if_fail (user_data != NULL);
+#line 376 "mn-mailboxes.c"
+{
+#line 122 "mn-mailboxes.gob"
+
+ Self *self = user_data;
+ GSList *elem;
+
+ elem = g_slist_find_custom(selfp->list, mn_mailbox_get_uri(mailbox), self_compare_func);
+ if (elem)
+ {
+ if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
+ mn_info(_("%s is unsupported: %s"), mn_mailbox_get_name(mailbox), mn_unsupported_mailbox_get_reason(MN_UNSUPPORTED_MAILBOX(mailbox)));
+
+ g_signal_connect(G_OBJECT(mailbox), "notify::has-new", G_CALLBACK(self_notify_has_new_h), self);
+ g_signal_connect(G_OBJECT(mailbox), "notify::error", G_CALLBACK(self_notify_error_h), self);
+
+ if (MN_MAILBOX_CAN_CHECK(mailbox))
+ mn_mailbox_check(mailbox);
+
+ g_object_unref(elem->data);
+ elem->data = mailbox;
+
+ self_list_changed(self);
+ }
+ else
+ g_object_unref(mailbox);
+ }}
+#line 403 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 147 "mn-mailboxes.gob"
+static void
+mn_mailboxes_notify_has_new_h (GObject * object, GParamSpec * pspec, gpointer user_data)
+#line 409 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::notify_has_new_h"
+#line 147 "mn-mailboxes.gob"
+ g_return_if_fail (object != NULL);
+#line 147 "mn-mailboxes.gob"
+ g_return_if_fail (G_IS_OBJECT (object));
+#line 147 "mn-mailboxes.gob"
+ g_return_if_fail (pspec != NULL);
+#line 147 "mn-mailboxes.gob"
+ g_return_if_fail (user_data != NULL);
+#line 420 "mn-mailboxes.c"
+{
+#line 151 "mn-mailboxes.gob"
+
+ Self *self = user_data;
+ MNMailbox *mailbox = MN_MAILBOX(object);
+ gboolean has_new;
+
+ has_new = mn_mailbox_get_has_new(mailbox);
+ mn_info(has_new ? _("%s has new mail") : _("%s has no new mail"), mn_mailbox_get_name(mailbox));
+
+ self_status_changed(self);
+ }}
+#line 433 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 162 "mn-mailboxes.gob"
+static void
+mn_mailboxes_notify_error_h (GObject * object, GParamSpec * pspec, gpointer user_data)
+#line 439 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::notify_error_h"
+#line 162 "mn-mailboxes.gob"
+ g_return_if_fail (object != NULL);
+#line 162 "mn-mailboxes.gob"
+ g_return_if_fail (G_IS_OBJECT (object));
+#line 162 "mn-mailboxes.gob"
+ g_return_if_fail (pspec != NULL);
+#line 162 "mn-mailboxes.gob"
+ g_return_if_fail (user_data != NULL);
+#line 450 "mn-mailboxes.c"
+{
+#line 166 "mn-mailboxes.gob"
+
+ Self *self = user_data;
+ MNMailbox *mailbox = MN_MAILBOX(object);
+ const char *error;
+
+ error = mn_mailbox_get_error(mailbox);
+ if (error)
+ mn_info(_("%s reported an error: %s"), mn_mailbox_get_name(mailbox), error);
+
+ self_status_changed(self);
+ }}
+#line 464 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 178 "mn-mailboxes.gob"
+static void
+mn_mailboxes_install_timeout (MNMailboxes * self)
+#line 470 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::install_timeout"
+#line 178 "mn-mailboxes.gob"
+ g_return_if_fail (self != NULL);
+#line 178 "mn-mailboxes.gob"
+ g_return_if_fail (MN_IS_MAILBOXES (self));
+#line 477 "mn-mailboxes.c"
+{
+#line 180 "mn-mailboxes.gob"
+
+ int minutes;
+ int seconds;
+
+ if (selfp->timeout_id)
+ {
+ g_source_remove(selfp->timeout_id);
+ selfp->timeout_id = 0;
+ }
+
+ minutes = eel_gconf_get_integer(MN_CONF_DELAY_MINUTES);
+ seconds = eel_gconf_get_integer(MN_CONF_DELAY_SECONDS);
+
+ if (minutes != 0 || seconds != 0)
+ selfp->timeout_id = g_timeout_add(((minutes * 60) + seconds) * 1000,
+ self_timeout_cb,
+ self);
+ }}
+#line 498 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 199 "mn-mailboxes.gob"
+static gboolean
mn_mailboxes_timeout_cb (gpointer data)
+#line 504 "mn-mailboxes.c"
{
- mn_mailboxes_check();
-
- return TRUE; /* continue */
-}
-
-void
-mn_mailboxes_check (void)
+#define __GOB_FUNCTION__ "MN:Mailboxes::timeout_cb"
+#line 199 "mn-mailboxes.gob"
+ g_return_val_if_fail (data != NULL, (gboolean )0);
+#line 509 "mn-mailboxes.c"
{
- GSList *l;
-
- MN_LIST_FOREACH(l, mailboxes)
- {
- MNMailbox *mailbox = l->data;
-
- if (MN_MAILBOX_GET_CLASS(mailbox)->check && ! mn_mailbox_get_automatic(mailbox))
- mn_mailbox_check(mailbox);
- }
-}
-
-GSList *
-mn_mailboxes_get (void)
+#line 201 "mn-mailboxes.gob"
+
+ Self *self = data;
+
+ GDK_THREADS_ENTER();
+ self_check(self);
+ GDK_THREADS_LEAVE();
+
+ return TRUE; /* continue */
+ }}
+#line 521 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 211 "mn-mailboxes.gob"
+void
+mn_mailboxes_check (MNMailboxes * self)
+#line 527 "mn-mailboxes.c"
{
- return mailboxes;
-}
-
-MNMailbox *
-mn_mailboxes_find (const char *uri)
+#define __GOB_FUNCTION__ "MN:Mailboxes::check"
+#line 211 "mn-mailboxes.gob"
+ g_return_if_fail (self != NULL);
+#line 211 "mn-mailboxes.gob"
+ g_return_if_fail (MN_IS_MAILBOXES (self));
+#line 534 "mn-mailboxes.c"
{
- GSList *elem;
-
- g_return_val_if_fail(uri != NULL, NULL);
-
- elem = g_slist_find_custom(mailboxes, uri, mn_mailboxes_compare_func);
- return elem ? elem->data : NULL;
-}
-
-static int
+#line 213 "mn-mailboxes.gob"
+
+ GSList *l;
+
+ MN_LIST_FOREACH(l, selfp->list)
+ {
+ MNMailbox *mailbox = l->data;
+
+ if (MN_MAILBOX_CAN_CHECK(mailbox))
+ mn_mailbox_check(mailbox);
+ }
+ }}
+#line 548 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 225 "mn-mailboxes.gob"
+GSList *
+mn_mailboxes_get (MNMailboxes * self)
+#line 554 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::get"
+#line 225 "mn-mailboxes.gob"
+ g_return_val_if_fail (self != NULL, (GSList * )0);
+#line 225 "mn-mailboxes.gob"
+ g_return_val_if_fail (MN_IS_MAILBOXES (self), (GSList * )0);
+#line 561 "mn-mailboxes.c"
+{
+#line 227 "mn-mailboxes.gob"
+
+ return selfp->list;
+ }}
+#line 567 "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"
+{
+#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"
+
+ GSList *elem;
+
+ elem = g_slist_find_custom(selfp->list, uri, self_compare_func);
+ return elem ? elem->data : NULL;
+ }}
+#line 591 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 240 "mn-mailboxes.gob"
+static int
mn_mailboxes_compare_func (gconstpointer a, gconstpointer b)
+#line 597 "mn-mailboxes.c"
{
- MNMailbox *mailbox = (MNMailbox *) a;
- const char *uri = b;
-
- return mn_uri_cmp(mn_mailbox_get_uri(mailbox), uri);
-}
+#define __GOB_FUNCTION__ "MN:Mailboxes::compare_func"
+{
+#line 242 "mn-mailboxes.gob"
+
+ MNMailbox *mailbox = (MNMailbox *) a;
+ const char *uri = b;
+
+ return mn_uri_cmp(mn_mailbox_get_uri(mailbox), uri);
+ }}
+#line 608 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
+
+#line 249 "mn-mailboxes.gob"
+MNMailboxes *
+mn_mailboxes_new (void)
+#line 614 "mn-mailboxes.c"
+{
+#define __GOB_FUNCTION__ "MN:Mailboxes::new"
+{
+#line 251 "mn-mailboxes.gob"
+
+ return MN_MAILBOXES(GET_NEW);
+ }}
+#line 622 "mn-mailboxes.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-mailboxes.gob b/src/mn-mailboxes.gob
@@ -0,0 +1,254 @@
+/*
+ * 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 "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.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;
+
+ signal private NONE (NONE)
+ void list_changed (self);
+ signal private NONE (NONE)
+ void status_changed (self);
+
+ init (self)
+ {
+ 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);
+ }
+
+ private void
+ notify_delay_cb (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ self_install_timeout(self);
+ }
+
+ private void
+ notify_mailboxes_cb (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ self_update_from_conf(self);
+ }
+
+ private void
+ update_from_conf (self)
+ {
+ GSList *gconf_mailboxes;
+ GSList *l;
+ gboolean changed = FALSE;
+
+ gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
+
+ /* first step: remove old mailboxes */
+
+ loop:
+ MN_LIST_FOREACH(l, selfp->list)
+ {
+ MNMailbox *mailbox = l->data;
+
+ if (! g_slist_find_custom(gconf_mailboxes, mn_mailbox_get_uri(mailbox), (GCompareFunc) mn_uri_cmp))
+ {
+ g_object_unref(mailbox);
+ selfp->list = g_slist_delete_link(selfp->list, l);
+ changed = TRUE;
+ goto loop;
+ }
+ }
+
+ /* second step: add new mailboxes */
+
+ MN_LIST_FOREACH(l, gconf_mailboxes)
+ {
+ const char *uri = l->data;
+
+ if (! self_find(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);
+ }
+ }
+
+ mn_pointers_free(gconf_mailboxes);
+ if (changed)
+ self_list_changed(self);
+ }
+
+ private void
+ new_cb (MN:Mailbox *mailbox (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ GSList *elem;
+
+ elem = g_slist_find_custom(selfp->list, mn_mailbox_get_uri(mailbox), self_compare_func);
+ if (elem)
+ {
+ if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
+ mn_info(_("%s is unsupported: %s"), mn_mailbox_get_name(mailbox), mn_unsupported_mailbox_get_reason(MN_UNSUPPORTED_MAILBOX(mailbox)));
+
+ g_signal_connect(G_OBJECT(mailbox), "notify::has-new", G_CALLBACK(self_notify_has_new_h), self);
+ g_signal_connect(G_OBJECT(mailbox), "notify::error", G_CALLBACK(self_notify_error_h), self);
+
+ if (MN_MAILBOX_CAN_CHECK(mailbox))
+ mn_mailbox_check(mailbox);
+
+ g_object_unref(elem->data);
+ elem->data = mailbox;
+
+ self_list_changed(self);
+ }
+ else
+ g_object_unref(mailbox);
+ }
+
+ private void
+ notify_has_new_h (G:Object *object (check null type),
+ GParamSpec *pspec (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ MNMailbox *mailbox = MN_MAILBOX(object);
+ gboolean has_new;
+
+ has_new = mn_mailbox_get_has_new(mailbox);
+ mn_info(has_new ? _("%s has new mail") : _("%s has no new mail"), mn_mailbox_get_name(mailbox));
+
+ self_status_changed(self);
+ }
+
+ private void
+ notify_error_h (G:Object *object (check null type),
+ GParamSpec *pspec (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ MNMailbox *mailbox = MN_MAILBOX(object);
+ const char *error;
+
+ error = mn_mailbox_get_error(mailbox);
+ if (error)
+ mn_info(_("%s reported an error: %s"), mn_mailbox_get_name(mailbox), error);
+
+ self_status_changed(self);
+ }
+
+ private void
+ install_timeout (self)
+ {
+ int minutes;
+ int seconds;
+
+ if (selfp->timeout_id)
+ {
+ g_source_remove(selfp->timeout_id);
+ selfp->timeout_id = 0;
+ }
+
+ minutes = eel_gconf_get_integer(MN_CONF_DELAY_MINUTES);
+ seconds = eel_gconf_get_integer(MN_CONF_DELAY_SECONDS);
+
+ if (minutes != 0 || seconds != 0)
+ selfp->timeout_id = g_timeout_add(((minutes * 60) + seconds) * 1000,
+ self_timeout_cb,
+ self);
+ }
+
+ private gboolean
+ timeout_cb (gpointer data (check null))
+ {
+ Self *self = data;
+
+ GDK_THREADS_ENTER();
+ self_check(self);
+ GDK_THREADS_LEAVE();
+
+ return TRUE; /* continue */
+ }
+
+ public void
+ check (self)
+ {
+ GSList *l;
+
+ MN_LIST_FOREACH(l, selfp->list)
+ {
+ MNMailbox *mailbox = l->data;
+
+ if (MN_MAILBOX_CAN_CHECK(mailbox))
+ mn_mailbox_check(mailbox);
+ }
+ }
+
+ public GSList *
+ get (self)
+ {
+ return selfp->list;
+ }
+
+ public MNMailbox *
+ find (self, const char *uri (check null))
+ {
+ GSList *elem;
+
+ elem = g_slist_find_custom(selfp->list, uri, self_compare_func);
+ return elem ? elem->data : NULL;
+ }
+
+ private int
+ compare_func (gconstpointer a, gconstpointer b)
+ {
+ MNMailbox *mailbox = (MNMailbox *) a;
+ const char *uri = b;
+
+ return mn_uri_cmp(mn_mailbox_get_uri(mailbox), uri);
+ }
+
+ public MNMailboxes *
+ new (void)
+ {
+ return MN_MAILBOXES(GET_NEW);
+ }
+}
diff --git a/src/mn-mailboxes.h b/src/mn-mailboxes.h
@@ -1,31 +1,89 @@
-/*
- * 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.
- */
-
-#ifndef _MN_MAILBOXES_H
-#define _MN_MAILBOXES_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
#include <glib.h>
+#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-void mn_mailboxes_register (void);
-void mn_mailboxes_install_timeout (void);
-void mn_mailboxes_check (void);
-GSList *mn_mailboxes_get (void);
-MNMailbox *mn_mailboxes_find (const char *uri);
+#ifndef __MN_MAILBOXES_H__
+#define __MN_MAILBOXES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_MAILBOXES (mn_mailboxes_get_type())
+#define MN_MAILBOXES(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mailboxes_get_type(), MNMailboxes)
+#define MN_MAILBOXES_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mailboxes_get_type(), MNMailboxes const)
+#define MN_MAILBOXES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_mailboxes_get_type(), MNMailboxesClass)
+#define MN_IS_MAILBOXES(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_mailboxes_get_type ())
+
+#define MN_MAILBOXES_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_mailboxes_get_type(), MNMailboxesClass)
+
+/* Private structure type */
+typedef struct _MNMailboxesPrivate MNMailboxesPrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_MAILBOXES__
+#define __TYPEDEF_MN_MAILBOXES__
+typedef struct _MNMailboxes MNMailboxes;
+#endif
+struct _MNMailboxes {
+ GObject __parent__;
+ /*< private >*/
+ MNMailboxesPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNMailboxesClass MNMailboxesClass;
+struct _MNMailboxesClass {
+ GObjectClass __parent__;
+ /*signal*/void (* list_changed) (MNMailboxes * self);
+ /*signal*/void (* status_changed) (MNMailboxes * self);
+};
+
+
+/*
+ * Public methods
+ */
+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);
+MNMailboxes * mn_mailboxes_new (void);
+
+/*
+ * Signal connection wrapper macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define mn_mailboxes_connect__list_changed(object,func,data) g_signal_connect(MN_MAILBOXES(__extension__ ({MNMailboxes *___object = (object); ___object; })),"list_changed",(GCallback) __extension__ ({void (* ___list_changed) (MNMailboxes * ___fake___self, gpointer ___data ) = (func); ___list_changed; }), (data))
+#define mn_mailboxes_connect_after__list_changed(object,func,data) g_signal_connect_after(MN_MAILBOXES(__extension__ ({MNMailboxes *___object = (object); ___object; })),"list_changed",(GCallback) __extension__ ({void (* ___list_changed) (MNMailboxes * ___fake___self, gpointer ___data ) = (func); ___list_changed; }), (data))
+#define mn_mailboxes_connect_data__list_changed(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOXES(__extension__ ({MNMailboxes *___object = (object); ___object; })),"list_changed",(GCallback) __extension__ ({void (* ___list_changed) (MNMailboxes * ___fake___self, gpointer ___data ) = (func); ___list_changed; }), (data), (destroy_data), (GConnectFlags)(flags))
+#define mn_mailboxes_connect__status_changed(object,func,data) g_signal_connect(MN_MAILBOXES(__extension__ ({MNMailboxes *___object = (object); ___object; })),"status_changed",(GCallback) __extension__ ({void (* ___status_changed) (MNMailboxes * ___fake___self, gpointer ___data ) = (func); ___status_changed; }), (data))
+#define mn_mailboxes_connect_after__status_changed(object,func,data) g_signal_connect_after(MN_MAILBOXES(__extension__ ({MNMailboxes *___object = (object); ___object; })),"status_changed",(GCallback) __extension__ ({void (* ___status_changed) (MNMailboxes * ___fake___self, gpointer ___data ) = (func); ___status_changed; }), (data))
+#define mn_mailboxes_connect_data__status_changed(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOXES(__extension__ ({MNMailboxes *___object = (object); ___object; })),"status_changed",(GCallback) __extension__ ({void (* ___status_changed) (MNMailboxes * ___fake___self, gpointer ___data ) = (func); ___status_changed; }), (data), (destroy_data), (GConnectFlags)(flags))
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define mn_mailboxes_connect__list_changed(object,func,data) g_signal_connect(MN_MAILBOXES(object),"list_changed",(GCallback)(func),(data))
+#define mn_mailboxes_connect_after__list_changed(object,func,data) g_signal_connect_after(MN_MAILBOXES(object),"list_changed",(GCallback)(func),(data))
+#define mn_mailboxes_connect_data__list_changed(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOXES(object),"list_changed",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#define mn_mailboxes_connect__status_changed(object,func,data) g_signal_connect(MN_MAILBOXES(object),"status_changed",(GCallback)(func),(data))
+#define mn_mailboxes_connect_after__status_changed(object,func,data) g_signal_connect_after(MN_MAILBOXES(object),"status_changed",(GCallback)(func),(data))
+#define mn_mailboxes_connect_data__status_changed(object,func,data,destroy_data,flags) g_signal_connect_data(MN_MAILBOXES(object),"status_changed",(GCallback)(func),(data),(destroy_data),(GConnectFlags)(flags))
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
-#endif /* _MN_MAILBOXES_H */
+#endif
diff --git a/src/mn-maildir-mailbox-private.h b/src/mn-maildir-mailbox-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_MAILDIR_MAILBOX_PRIVATE_H__
+#define __MN_MAILDIR_MAILBOX_PRIVATE_H__
+
+#include "mn-maildir-mailbox.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-maildir-mailbox.c b/src/mn-maildir-mailbox.c
@@ -1,232 +1,270 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 2004
+ (do not edit directly) */
-#include "config.h"
-#include <glib/gi18n-lib.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include "mn-maildir-mailbox.h"
-#include "mn-util.h"
-#include "mn-vfs.h"
+/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
-/*** types *******************************************************************/
+#define GOB_VERSION_MAJOR 2
+#define GOB_VERSION_MINOR 0
+#define GOB_VERSION_PATCHLEVEL 9
-typedef struct
-{
- char *uri;
- int i;
- MNMailboxIsCallback *callback;
- gpointer user_data;
-} IsInfo;
+#define selfp (self->_priv)
-/*** variables ***************************************************************/
+#include "mn-maildir-mailbox.h"
-static GObjectClass *parent_class = NULL;
-static const char *constitutive_dirs[] = { "cur", "new", "tmp" };
+#include "mn-maildir-mailbox-private.h"
-/*** functions ***************************************************************/
+#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 22 "mn-maildir-mailbox.gob"
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include "mn-mailbox-private.h"
+#include "mn-vfs.h"
+#include "mn-util.h"
-static void mn_maildir_mailbox_class_init (MNMaildirMailboxClass *class);
+#line 33 "mn-maildir-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_MAILDIR_MAILBOX(x)
+#define SELF_CONST(x) MN_MAILDIR_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_MAILDIR_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_MAILDIR_MAILBOX
+#define SELF_CLASS(x) MN_MAILDIR_MAILBOX_CLASS(x)
-static GObject *mn_maildir_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params);
+#define SELF_GET_CLASS(x) MN_MAILDIR_MAILBOX_GET_CLASS(x)
-static void mn_maildir_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data);
-static void mn_maildir_mailbox_is_continue (IsInfo *info);
-static void mn_maildir_mailbox_is_cb (gboolean result, gpointer user_data);
+/* self typedefs */
+typedef MNMaildirMailbox Self;
+typedef MNMaildirMailboxClass SelfClass;
-static void mn_maildir_mailbox_check (MNMailbox *mailbox);
-static void mn_maildir_mailbox_check_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- GList *list,
- unsigned int entries_read,
- gpointer user_data);
+/* here are local prototypes */
+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 void ___4_mn_maildir_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
-/*** implementation **********************************************************/
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
GType
mn_maildir_mailbox_get_type (void)
{
- static GType maildir_mailbox_type = 0;
-
- if (! maildir_mailbox_type)
- {
- static const GTypeInfo maildir_mailbox_info = {
- sizeof(MNMaildirMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_maildir_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNMaildirMailbox),
- 0,
- NULL
- };
-
- maildir_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNMaildirMailbox",
- &maildir_mailbox_info,
- 0);
- }
-
- return maildir_mailbox_type;
-}
+ static GType type = 0;
-static void
-mn_maildir_mailbox_class_init (MNMaildirMailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
-
- parent_class = g_type_class_peek_parent(class);
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNMaildirMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_maildir_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNMaildirMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_maildir_mailbox_init,
+ NULL
+ };
- object_class->constructor = mn_maildir_mailbox_constructor;
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNMaildirMailbox", &info, (GTypeFlags)0);
+ }
- mailbox_class->format = "Maildir";
- mailbox_class->is = mn_maildir_mailbox_is;
- mailbox_class->check = mn_maildir_mailbox_check;
+ return type;
}
-static GObject *
-mn_maildir_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNMaildirMailbox *)g_object_new(mn_maildir_mailbox_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNMaildirMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNMaildirMailbox *
+GET_NEW_VARG (const char *first, ...)
{
- GObject *object;
- MNMailbox *mailbox;
- char *new_uri;
-
- object = G_OBJECT_CLASS(parent_class)->constructor(type, n_construct_properties, construct_params);
- mailbox = MN_MAILBOX(object);
-
- new_uri = g_build_path("/", mn_mailbox_get_uri(mailbox), "new", NULL);
- mn_mailbox_monitor(mailbox,
- new_uri,
- GNOME_VFS_MONITOR_DIRECTORY,
- MN_MAILBOX_MONITOR_EVENT_DELETED
- | MN_MAILBOX_MONITOR_EVENT_CREATED);
- g_free(new_uri);
-
- return object;
+ MNMaildirMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNMaildirMailbox *)g_object_new_valist (mn_maildir_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
-static void
-mn_maildir_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data)
+static void
+mn_maildir_mailbox_init (MNMaildirMailbox * o G_GNUC_UNUSED)
{
- IsInfo *info;
-
- info = g_new(IsInfo, 1);
- info->uri = g_strdup(uri);
- info->i = 0;
- info->callback = callback;
- info->user_data = user_data;
-
- mn_maildir_mailbox_is_continue(info);
+#define __GOB_FUNCTION__ "MN:Maildir:Mailbox::init"
}
-
-static void
-mn_maildir_mailbox_is_continue (IsInfo *info)
+#undef __GOB_FUNCTION__
+#line 32 "mn-maildir-mailbox.gob"
+static void
+mn_maildir_mailbox_class_init (MNMaildirMailboxClass * class G_GNUC_UNUSED)
+#line 108 "mn-maildir-mailbox.c"
{
- char *uri;
+#define __GOB_FUNCTION__ "MN:Maildir:Mailbox::class_init"
+ GObjectClass *g_object_class = (GObjectClass *)class;
+ MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
- uri = g_build_path("/", info->uri, constitutive_dirs[info->i], NULL);
- mn_vfs_async_test(uri, G_FILE_TEST_IS_DIR, mn_maildir_mailbox_is_cb, info);
- g_free(uri);
-}
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
-static void
-mn_maildir_mailbox_is_cb (gboolean result, gpointer user_data)
-{
- IsInfo *info = user_data;
- gboolean is = FALSE;
-
- if (result)
- {
- if (++info->i < G_N_ELEMENTS(constitutive_dirs))
- {
- mn_maildir_mailbox_is_continue(info);
- return;
- }
- else
- is = TRUE;
- }
+#line 37 "mn-maildir-mailbox.gob"
+ g_object_class->constructor = ___2_mn_maildir_mailbox_constructor;
+#line 58 "mn-maildir-mailbox.gob"
+ mn_mailbox_class->impl_is = ___3_mn_maildir_mailbox_impl_is;
+#line 80 "mn-maildir-mailbox.gob"
+ mn_mailbox_class->impl_threaded_check = ___4_mn_maildir_mailbox_impl_threaded_check;
+#line 122 "mn-maildir-mailbox.c"
+ {
+#line 33 "mn-maildir-mailbox.gob"
- info->callback(is, info->user_data);
- g_free(info->uri);
- g_free(info);
+ MN_MAILBOX_CLASS(class)->format = "Maildir";
+
+#line 128 "mn-maildir-mailbox.c"
+ }
}
+#undef __GOB_FUNCTION__
+
-static void
-mn_maildir_mailbox_check (MNMailbox *mailbox)
-{
- char *new_uri;
- GnomeVFSAsyncHandle *handle;
-
- new_uri = g_build_path("/", mn_mailbox_get_uri(mailbox), "new", NULL);
- gnome_vfs_async_load_directory(&handle,
- new_uri,
- GNOME_VFS_FILE_INFO_DEFAULT,
- 32,
- GNOME_VFS_PRIORITY_DEFAULT,
- mn_maildir_mailbox_check_cb,
- mailbox);
- g_free(new_uri);
-}
-static void
-mn_maildir_mailbox_check_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- GList *list,
- unsigned int entries_read,
- gpointer user_data)
+#line 37 "mn-maildir-mailbox.gob"
+static GObject *
+___2_mn_maildir_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
+#line 138 "mn-maildir-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): \
+ ((GObject * )0))
{
- MNMaildirMailbox *mailbox = user_data;
- gboolean has_new = FALSE;
- GList *l;
+#define __GOB_FUNCTION__ "MN:Maildir:Mailbox::constructor"
+{
+#line 39 "mn-maildir-mailbox.gob"
+
+ GObject *object;
+ MNMailbox *self;
+ char *new_uri;
+
+ 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);
+ mn_mailbox_monitor(self,
+ new_uri,
+ GNOME_VFS_MONITOR_DIRECTORY,
+ MN_MAILBOX_MONITOR_EVENT_DELETED
+ | MN_MAILBOX_MONITOR_EVENT_CREATED);
+ g_free(new_uri);
- MN_LIST_FOREACH(l, list)
- {
- GnomeVFSFileInfo *file_info = l->data;
+ return object;
+ }}
+#line 165 "mn-maildir-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 58 "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"
+#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"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 181 "mn-maildir-mailbox.c"
+{
+#line 60 "mn-maildir-mailbox.gob"
+
+ gboolean is;
+ int i;
+ const char *constitutive_dirs[] = { "cur", "new", "tmp" };
- if (file_info->name[0] != '.')
- {
- has_new = TRUE;
+ for (i = 0; i < G_N_ELEMENTS(constitutive_dirs); i++)
+ {
+ char *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);
+
+ if (! is)
break;
- }
- }
+ }
- if (has_new)
- {
- gnome_vfs_async_cancel(handle);
- goto end;
- }
+ return is;
+ }}
+#line 203 "mn-maildir-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 80 "mn-maildir-mailbox.gob"
+static void
+___4_mn_maildir_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
+#line 210 "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"
+ g_return_if_fail (self != NULL);
+#line 80 "mn-maildir-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 220 "mn-maildir-mailbox.c"
+{
+#line 82 "mn-maildir-mailbox.gob"
+
+ char *new_uri;
+ GnomeVFSResult 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);
+
+ if (result != GNOME_VFS_OK)
+ {
+ GDK_THREADS_ENTER();
+
+ mn_mailbox_set_error(self, _("unable to open folder \"new\": %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ return;
+ }
- if (result != GNOME_VFS_OK) /* we're done */
- {
- if (result != GNOME_VFS_ERROR_EOF)
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("error while reading folder: %s"), gnome_vfs_result_to_string(result));
-
- end:
- mn_mailbox_set_has_new(MN_MAILBOX(mailbox), has_new);
- mn_mailbox_end_check(MN_MAILBOX(mailbox));
- }
-}
+ file_info = gnome_vfs_file_info_new();
+ while ((result = gnome_vfs_directory_read_next(handle, file_info)) == GNOME_VFS_OK)
+ {
+ if (file_info->name[0] != '.')
+ {
+ has_new = TRUE;
+ break;
+ }
+ }
+ gnome_vfs_file_info_unref(file_info);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(self, has_new);
+ else
+ mn_mailbox_set_error(self, _("error while reading folder \"new\": %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }}
+#line 269 "mn-maildir-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
diff --git a/src/mn-maildir-mailbox.gob b/src/mn-maildir-mailbox.gob
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include "mn-mailbox-private.h"
+#include "mn-vfs.h"
+#include "mn-util.h"
+%}
+
+class MN:Maildir:Mailbox from MN:Mailbox
+{
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->format = "Maildir";
+ }
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ MNMailbox *self;
+ char *new_uri;
+
+ 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);
+ mn_mailbox_monitor(self,
+ new_uri,
+ GNOME_VFS_MONITOR_DIRECTORY,
+ MN_MAILBOX_MONITOR_EVENT_DELETED
+ | MN_MAILBOX_MONITOR_EVENT_CREATED);
+ g_free(new_uri);
+
+ return object;
+ }
+
+ override (MN:Mailbox) gboolean
+ impl_is (MNMailbox *dummy, const char *uri (check null))
+ {
+ gboolean is;
+ int i;
+ const char *constitutive_dirs[] = { "cur", "new", "tmp" };
+
+ for (i = 0; i < G_N_ELEMENTS(constitutive_dirs); i++)
+ {
+ char *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);
+
+ if (! is)
+ break;
+ }
+
+ return is;
+ }
+
+ override (MN:Mailbox) void
+ impl_threaded_check (MN:Mailbox *self (check null type))
+ {
+ char *new_uri;
+ GnomeVFSResult 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);
+
+ if (result != GNOME_VFS_OK)
+ {
+ GDK_THREADS_ENTER();
+
+ mn_mailbox_set_error(self, _("unable to open folder \"new\": %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ return;
+ }
+
+ file_info = gnome_vfs_file_info_new();
+ while ((result = gnome_vfs_directory_read_next(handle, file_info)) == GNOME_VFS_OK)
+ {
+ if (file_info->name[0] != '.')
+ {
+ has_new = TRUE;
+ break;
+ }
+ }
+ gnome_vfs_file_info_unref(file_info);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(self, has_new);
+ else
+ mn_mailbox_set_error(self, _("error while reading folder \"new\": %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+}
diff --git a/src/mn-maildir-mailbox.h b/src/mn-maildir-mailbox.h
@@ -1,48 +1,57 @@
-/*
- * 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.
- */
-
-#ifndef _MN_MAILDIR_MAILBOX_H
-#define _MN_MAILDIR_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_MAILDIR_MAILBOX (mn_maildir_mailbox_get_type())
-#define MN_MAILDIR_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_MAILDIR_MAILBOX, MNMaildirMailbox))
-#define MN_MAILDIR_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_MAILDIR_MAILBOX, MNMaildirMailboxClass))
-#define MN_IS_MAILDIR_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_MAILDIR_MAILBOX))
-#define MN_IS_MAILDIR_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_MAILDIR_MAILBOX))
-#define MN_MAILDIR_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_MAILDIR_MAILBOX, MNMaildirMailboxClass))
+#ifndef __MN_MAILDIR_MAILBOX_H__
+#define __MN_MAILDIR_MAILBOX_H__
-typedef struct _MNMaildirMailboxPrivate MNMaildirMailboxPrivate;
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
-typedef struct
-{
- MNMailbox mailbox;
- MNMaildirMailboxPrivate *priv;
-} MNMaildirMailbox;
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_MAILDIR_MAILBOX (mn_maildir_mailbox_get_type())
+#define MN_MAILDIR_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_maildir_mailbox_get_type(), MNMaildirMailbox)
+#define MN_MAILDIR_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_maildir_mailbox_get_type(), MNMaildirMailbox const)
+#define MN_MAILDIR_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_maildir_mailbox_get_type(), MNMaildirMailboxClass)
+#define MN_IS_MAILDIR_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_maildir_mailbox_get_type ())
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNMaildirMailboxClass;
+#define MN_MAILDIR_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_maildir_mailbox_get_type(), MNMaildirMailboxClass)
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_MAILDIR_MAILBOX__
+#define __TYPEDEF_MN_MAILDIR_MAILBOX__
+typedef struct _MNMaildirMailbox MNMaildirMailbox;
+#endif
+struct _MNMaildirMailbox {
+ MNMailbox __parent__;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNMaildirMailboxClass MNMaildirMailboxClass;
+struct _MNMaildirMailboxClass {
+ MNMailboxClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
GType mn_maildir_mailbox_get_type (void);
-#endif /* _MN_MAILDIR_MAILBOX_H */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-main.c b/src/mn-main.c
@@ -18,13 +18,20 @@
#include "config.h"
#include <stdlib.h>
+#include <signal.h>
#include <gnome.h>
#include <libgnomevfs/gnome-vfs.h>
#include "mn-conf.h"
-#include "mn-mailboxes.h"
-#include "mn-ui.h"
#include "mn-util.h"
#include "mn-stock.h"
+#include "mn-automation.h"
+#include "mn-dialog.h"
+#include "mn-shell.h"
+
+/*** cpp *********************************************************************/
+
+#define AUTOMATION_IID "OAFIID:GNOME_MailNotification_Automation"
+#define AUTOMATION_FACTORY_IID "OAFIID:GNOME_MailNotification_Automation_Factory"
/*** variables ***************************************************************/
@@ -32,7 +39,10 @@ static gboolean arg_enable_info = FALSE;
/*** functions ***************************************************************/
-static void mn_main_list_handlers (void);
+static BonoboObject *mn_main_automation_factory_cb (BonoboGenericFactory *factory,
+ const char *iid,
+ gpointer closure);
+static void mn_main_list_features (void);
static void mn_main_info_log_cb (const char *log_domain,
GLogLevelFlags log_level,
const char *message,
@@ -40,23 +50,59 @@ static void mn_main_info_log_cb (const char *log_domain,
/*** implementation **********************************************************/
+static BonoboObject *
+mn_main_automation_factory_cb (BonoboGenericFactory *factory,
+ const char *iid,
+ gpointer closure)
+{
+ if (! strcmp(iid, AUTOMATION_IID))
+ return BONOBO_OBJECT(mn_automation_new());
+
+ g_return_val_if_reached(NULL);
+}
+
static void
-mn_main_list_handlers (void)
+mn_main_list_features (void)
{
+ GString *backends;
+ GString *features;
const GType *types;
int i;
- g_print(_("Compiled in handlers:\n"));
-
+ backends = g_string_new(NULL);
types = mn_mailbox_get_types();
+
for (i = 0; types[i]; i++)
{
MNMailboxClass *class;
class = g_type_class_ref(types[i]);
- g_print(" %s\n", class->format);
+ if (*backends->str)
+ g_string_append(backends, ", ");
+ g_string_append(backends, class->format);
g_type_class_unref(class);
}
+
+ g_print(_("Compiled-in mailbox backends: %s\n"), backends->str);
+ g_string_free(backends, TRUE);
+
+ features = g_string_new(NULL);
+#ifdef WITH_SSL
+ g_string_append(features, "SSL");
+#endif /* WITH_SSL */
+#ifdef WITH_SASL
+ if (*features->str)
+ g_string_append(features, ", ");
+ g_string_append(features, "SASL");
+#endif /* WITH_SASL */
+#ifdef WITH_IPV6
+ if (*features->str)
+ g_string_append(features, ", ");
+ g_string_append(features, "IPv6");
+#endif /* WITH_IPV6 */
+
+ g_print(_("Compiled-in features: %s\n"), features->str);
+ g_string_free(features, TRUE);
}
static void
@@ -72,11 +118,15 @@ mn_main_info_log_cb (const char *log_domain,
int
main (int argc, char **argv)
{
- gboolean arg_list_handlers = FALSE;
+ gboolean arg_list_features = FALSE;
+ gboolean arg_display_properties = FALSE;
+ gboolean arg_display_about = FALSE;
+ gboolean arg_update = FALSE;
+ gboolean arg_report = FALSE;
const struct poptOption popt_options[] = {
{
"enable-info",
- 0,
+ 'i',
POPT_ARG_NONE,
&arg_enable_info,
0,
@@ -84,16 +134,57 @@ main (int argc, char **argv)
NULL
},
{
- "list-handlers",
+ "list-features",
+ 'l',
+ POPT_ARG_NONE,
+ &arg_list_features,
+ 0,
+ N_("List compiled-in features and exit"),
+ NULL
+ },
+ {
+ "display-properties",
+ 'p',
+ POPT_ARG_NONE,
+ &arg_display_properties,
+ 0,
+ N_("Display the properties dialog"),
+ NULL
+ },
+ {
+ "display-about",
+ 'a',
+ POPT_ARG_NONE,
+ &arg_display_about,
+ 0,
+ N_("Display the about dialog"),
+ NULL
+ },
+ {
+ "update",
+ 'u',
+ POPT_ARG_NONE,
+ &arg_update,
0,
+ N_("Update the mail status"),
+ NULL
+ },
+ {
+ "report",
+ 'r',
POPT_ARG_NONE,
- &arg_list_handlers,
+ &arg_report,
0,
- N_("List compiled-in handlers and exit"),
+ N_("Report the mail status"),
NULL
},
POPT_TABLEEND
};
+ BonoboGenericFactory *automation_factory;
+ GClosure *automation_factory_closure;
+ CORBA_Environment ev;
+ GNOME_MNAutomation automation;
+ Bonobo_RegistrationResult result;
g_log_set_fatal_mask(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL);
g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, mn_main_info_log_cb, NULL);
@@ -104,6 +195,15 @@ main (int argc, char **argv)
textdomain(GETTEXT_PACKAGE);
#endif
+ g_thread_init(NULL);
+ if (! g_thread_supported())
+ /*
+ * We can't use mn_error_dialog() because gtk_init() has not been
+ * called yet.
+ */
+ g_critical(_("multi-threading is not available"));
+ gdk_threads_init();
+
gnome_program_init(PACKAGE,
VERSION,
LIBGNOMEUI_MODULE,
@@ -114,22 +214,92 @@ main (int argc, char **argv)
GNOME_PARAM_POPT_TABLE, popt_options,
NULL);
- if (arg_list_handlers)
+ if (arg_list_features)
{
- mn_main_list_handlers();
+ mn_main_list_features();
exit(0);
}
- if (! gnome_vfs_init())
- g_critical(_("unable to initialize GnomeVFS"));
+ /* mn-client-session uses sockets, we don't want to die on SIGPIPE */
+ signal(SIGPIPE, SIG_IGN);
+
+ GDK_THREADS_ENTER();
- mn_conf_init();
mn_stock_init();
- mn_ui_init();
+ bonobo_activate();
+
+ automation_factory = g_object_new(bonobo_generic_factory_get_type(), NULL);
+ automation_factory_closure = g_cclosure_new(G_CALLBACK(mn_main_automation_factory_cb), NULL, NULL);
+ bonobo_generic_factory_construct_noreg(automation_factory, AUTOMATION_FACTORY_IID, automation_factory_closure);
+
+ CORBA_exception_init(&ev);
+ result = bonobo_activation_register_active_server(AUTOMATION_FACTORY_IID, BONOBO_OBJREF(automation_factory), NULL);
+ switch (result)
+ {
+ case Bonobo_ACTIVATION_REG_ALREADY_ACTIVE:
+ case Bonobo_ACTIVATION_REG_SUCCESS:
+ if (result != Bonobo_ACTIVATION_REG_ALREADY_ACTIVE)
+ {
+ if (! gnome_vfs_init())
+ mn_fatal_error_dialog(_("Unable to initialize the GnomeVFS library."));
+
+ mn_conf_init();
+ mn_shell = mn_shell_new();
+ }
+
+ automation = bonobo_activation_activate_from_id(AUTOMATION_IID, 0, NULL, &ev);
+ if (CORBA_Object_is_nil(automation, &ev))
+ mn_fatal_error_dialog(_("Bonobo could not locate the automation object. Please check your Mail Notification installation."));
+
+ if (arg_display_properties)
+ GNOME_MNAutomation_displayProperties(automation, &ev);
+ if (arg_display_about)
+ GNOME_MNAutomation_displayAbout(automation, &ev);
+
+ if (result == Bonobo_ACTIVATION_REG_ALREADY_ACTIVE)
+ {
+ if (arg_update)
+ {
+ g_message(_("updating the mail status"));
+ GNOME_MNAutomation_update(automation, &ev);
+ }
+ if (arg_report)
+ {
+ CORBA_char *report;
+
+ GNOME_MNAutomation_report(automation, &report, &ev);
+ g_print("%s", report);
+ CORBA_free(report);
+ }
+
+ if (! (arg_display_properties
+ || arg_display_about
+ || arg_update
+ || arg_report))
+ g_message(_("Mail Notification is already running"));
+ }
+
+ bonobo_object_release_unref(automation, &ev);
+ break;
+
+ case Bonobo_ACTIVATION_REG_NOT_LISTED:
+ mn_fatal_error_dialog(_("Bonobo could not locate the GNOME_MailNotification_Automation.server file. Please check your Mail Notification installation."));
+ break;
+
+ case Bonobo_ACTIVATION_REG_ERROR:
+ mn_fatal_error_dialog(_("Bonobo was unable to register the automation server. Please check your Mail Notification installation."));
+ break;
+
+ default:
+ g_return_val_if_reached(1);
+ }
+ CORBA_exception_free(&ev);
+ gdk_notify_startup_complete();
- mn_mailboxes_register();
- mn_mailboxes_install_timeout();
- gtk_main();
+ if (result != Bonobo_ACTIVATION_REG_ALREADY_ACTIVE)
+ gtk_main();
+
+ GDK_THREADS_LEAVE();
return 0;
}
diff --git a/src/mn-mbox-mailbox-private.h b/src/mn-mbox-mailbox-private.h
@@ -0,0 +1,28 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_MBOX_MAILBOX_PRIVATE_H__
+#define __MN_MBOX_MAILBOX_PRIVATE_H__
+
+#include "mn-mbox-mailbox.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#line 22 "mn-mbox-mailbox.gob"
+
+#include <time.h>
+
+#line 18 "mn-mbox-mailbox-private.h"
+struct _MNmboxMailboxPrivate {
+#line 36 "mn-mbox-mailbox.gob"
+ time_t last_mtime;
+#line 22 "mn-mbox-mailbox-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mbox-mailbox.c b/src/mn-mbox-mailbox.c
@@ -1,421 +1,336 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-mbox-mailbox.h"
+
+#include "mn-mbox-mailbox-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 25 "mn-mbox-mailbox.gob"
#include "config.h"
-#include <errno.h>
#include <string.h>
#include <glib/gi18n-lib.h>
-#include "mn-mbox-mailbox.h"
+#include <gdk/gdk.h>
+#include "mn-mailbox-private.h"
#include "mn-vfs.h"
-/*** types *******************************************************************/
+#line 34 "mn-mbox-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_MBOX_MAILBOX(x)
+#define SELF_CONST(x) MN_MBOX_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_MBOX_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_MBOX_MAILBOX
+#define SELF_CLASS(x) MN_MBOX_MAILBOX_CLASS(x)
-struct _MNmboxMailboxPrivate
-{
- time_t last_mtime;
- GnomeVFSFileSize last_size;
-};
+#define SELF_GET_CLASS(x) MN_MBOX_MAILBOX_GET_CLASS(x)
-typedef struct
-{
- gboolean is;
- char *uri;
- char frombuf[5];
- MNMailboxIsCallback *callback;
- gpointer user_data;
-} IsInfo;
-
-typedef struct
-{
- MNmboxMailbox *mailbox;
- gboolean in_header;
- gboolean seen;
-} CheckInfo;
-
-/*** variables ***************************************************************/
-
-static GObjectClass *parent_class = NULL;
-
-/*** functions ***************************************************************/
-
-static void mn_mbox_mailbox_class_init (MNmboxMailboxClass *class);
-static void mn_mbox_mailbox_init (MNmboxMailbox *mailbox);
-static void mn_mbox_mailbox_finalize (GObject *object);
-
-static GObject *mn_mbox_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params);
-
-static void mn_mbox_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data);
-static void mn_mbox_mailbox_is_get_file_info_cb (GnomeVFSAsyncHandle *handle,
- GList *results,
- gpointer user_data);
-static void mn_mbox_mailbox_is_open_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-static void mn_mbox_mailbox_is_read_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer buffer,
- GnomeVFSFileSize bytes_requested,
- GnomeVFSFileSize bytes_read,
- gpointer user_data);
-static void mn_mbox_mailbox_is_close_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-static void mn_mbox_mailbox_is_finish (IsInfo *info, gboolean is);
-
-static void mn_mbox_mailbox_check (MNMailbox *mailbox);
-static void mn_mbox_mailbox_check_open_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-static void mn_mbox_mailbox_check_read_line_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- const char *line,
- gpointer user_data);
-static void mn_mbox_mailbox_check_close_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-
-/*** implementation **********************************************************/
+/* self typedefs */
+typedef MNmboxMailbox Self;
+typedef MNmboxMailboxClass SelfClass;
+
+/* here are local prototypes */
+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 void ___4_mn_mbox_mailbox_impl_threaded_check (MNMailbox * mailbox) G_GNUC_UNUSED;
+
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
GType
mn_mbox_mailbox_get_type (void)
{
- static GType mbox_mailbox_type = 0;
-
- if (! mbox_mailbox_type)
- {
- static const GTypeInfo mbox_mailbox_info = {
- sizeof(MNmboxMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_mbox_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNmboxMailbox),
- 0,
- (GInstanceInitFunc) mn_mbox_mailbox_init
- };
-
- mbox_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNmboxMailbox",
- &mbox_mailbox_info,
- 0);
- }
-
- return mbox_mailbox_type;
-}
-
-static void
-mn_mbox_mailbox_class_init (MNmboxMailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
-
- parent_class = g_type_class_peek_parent(class);
-
- object_class->finalize = mn_mbox_mailbox_finalize;
- object_class->constructor = mn_mbox_mailbox_constructor;
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNmboxMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_mbox_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNmboxMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_mbox_mailbox_init,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNmboxMailbox", &info, (GTypeFlags)0);
+ }
- mailbox_class->format = "mbox";
- mailbox_class->is = mn_mbox_mailbox_is;
- mailbox_class->check = mn_mbox_mailbox_check;
+ return type;
}
-static void
-mn_mbox_mailbox_init (MNmboxMailbox *mailbox)
-{
- mailbox->priv = g_new0(MNmboxMailboxPrivate, 1);
-}
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNmboxMailbox *)g_object_new(mn_mbox_mailbox_get_type(), NULL))
-static void
-mn_mbox_mailbox_finalize (GObject *object)
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNmboxMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNmboxMailbox *
+GET_NEW_VARG (const char *first, ...)
{
- MNmboxMailbox *mailbox = MN_MBOX_MAILBOX(object);
-
- g_free(mailbox->priv);
-
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ MNmboxMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNmboxMailbox *)g_object_new_valist (mn_mbox_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
-static GObject *
-mn_mbox_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
-{
- GObject *object;
- MNMailbox *mailbox;
-
- object = G_OBJECT_CLASS(parent_class)->constructor(type, n_construct_properties, construct_params);
- mailbox = MN_MAILBOX(object);
-
- mn_mailbox_monitor(mailbox,
- mn_mailbox_get_uri(mailbox),
- GNOME_VFS_MONITOR_FILE,
- MN_MAILBOX_MONITOR_EVENT_CHANGED
- | MN_MAILBOX_MONITOR_EVENT_DELETED
- | MN_MAILBOX_MONITOR_EVENT_CREATED);
-
- return object;
-}
static void
-mn_mbox_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data)
+___finalize(GObject *obj_self)
{
- GnomeVFSURI *vfs_uri;
- GList *uri_list = NULL;
- IsInfo *info;
- GnomeVFSAsyncHandle *handle;
-
- vfs_uri = gnome_vfs_uri_new(uri);
- if (! vfs_uri)
- {
- callback(FALSE, user_data);
- return;
- }
-
- uri_list = g_list_append(uri_list, vfs_uri);
-
- info = g_new(IsInfo, 1);
- info->is = FALSE;
- info->uri = g_strdup(uri);
- info->callback = callback;
- info->user_data = user_data;
-
- gnome_vfs_async_get_file_info(&handle,
- uri_list,
- GNOME_VFS_FILE_INFO_FOLLOW_LINKS,
- GNOME_VFS_PRIORITY_DEFAULT,
- mn_mbox_mailbox_is_get_file_info_cb,
- info);
-
- gnome_vfs_uri_unref(vfs_uri);
- g_list_free(uri_list);
+#define __GOB_FUNCTION__ "MN:mbox:Mailbox::finalize"
+ MNmboxMailbox *self G_GNUC_UNUSED = MN_MBOX_MAILBOX (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+ g_free (priv);
}
+#undef __GOB_FUNCTION__
-static void
-mn_mbox_mailbox_is_get_file_info_cb (GnomeVFSAsyncHandle *handle,
- GList *results,
- gpointer user_data)
+static void
+mn_mbox_mailbox_init (MNmboxMailbox * o G_GNUC_UNUSED)
{
- IsInfo *info = user_data;
- GnomeVFSGetFileInfoResult *result;
-
- g_return_if_fail(results->data != NULL);
- result = results->data;
-
- if (result->result == GNOME_VFS_OK)
- {
- if (result->file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE
- && result->file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE
- && result->file_info->type == GNOME_VFS_FILE_TYPE_REGULAR)
- {
- if (result->file_info->size == 0)
- info->is = TRUE;
- else
- {
- GnomeVFSAsyncHandle *handle;
-
- gnome_vfs_async_open(&handle,
- info->uri,
- GNOME_VFS_OPEN_READ,
- GNOME_VFS_PRIORITY_DEFAULT,
- mn_mbox_mailbox_is_open_cb,
- info);
- return;
- }
- }
- }
-
- mn_mbox_mailbox_is_finish(info, info->is);
+#define __GOB_FUNCTION__ "MN:mbox:Mailbox::init"
+ o->_priv = g_new0 (MNmboxMailboxPrivate, 1);
}
-
-static void
-mn_mbox_mailbox_is_open_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
+#undef __GOB_FUNCTION__
+#line 38 "mn-mbox-mailbox.gob"
+static void
+mn_mbox_mailbox_class_init (MNmboxMailboxClass * class G_GNUC_UNUSED)
+#line 123 "mn-mbox-mailbox.c"
{
- IsInfo *info = user_data;
-
- if (result == GNOME_VFS_OK)
- gnome_vfs_async_read(handle,
- info->frombuf,
- sizeof(info->frombuf),
- mn_mbox_mailbox_is_read_cb,
- info);
- else
- mn_mbox_mailbox_is_finish(info, FALSE);
+#define __GOB_FUNCTION__ "MN:mbox:Mailbox::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+ MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
+
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
+
+#line 43 "mn-mbox-mailbox.gob"
+ g_object_class->constructor = ___2_mn_mbox_mailbox_constructor;
+#line 62 "mn-mbox-mailbox.gob"
+ mn_mailbox_class->impl_is = ___3_mn_mbox_mailbox_impl_is;
+#line 99 "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;
+ {
+#line 39 "mn-mbox-mailbox.gob"
+
+ MN_MAILBOX_CLASS(class)->format = "mbox";
+
+#line 144 "mn-mbox-mailbox.c"
+ }
}
+#undef __GOB_FUNCTION__
-static void
-mn_mbox_mailbox_is_read_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer buffer,
- GnomeVFSFileSize bytes_requested,
- GnomeVFSFileSize bytes_read,
- gpointer user_data)
-{
- IsInfo *info = user_data;
-
- if (result == GNOME_VFS_OK && bytes_requested == bytes_read && ! strncmp(info->frombuf, "From ", sizeof(info->frombuf)))
- info->is = TRUE;
- gnome_vfs_async_close(handle, mn_mbox_mailbox_is_close_cb, info);
-}
-static void
-mn_mbox_mailbox_is_close_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
+#line 43 "mn-mbox-mailbox.gob"
+static GObject *
+___2_mn_mbox_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
+#line 154 "mn-mbox-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): \
+ ((GObject * )0))
{
- IsInfo *info = user_data;
-
- mn_mbox_mailbox_is_finish(info, result == GNOME_VFS_OK && info->is);
-}
-
-static void
-mn_mbox_mailbox_is_finish (IsInfo *info, gboolean is)
+#define __GOB_FUNCTION__ "MN:mbox:Mailbox::constructor"
{
- info->callback(is, info->user_data);
- g_free(info->uri);
- g_free(info);
-}
-
-static void
-mn_mbox_mailbox_check (MNMailbox *mailbox)
+#line 45 "mn-mbox-mailbox.gob"
+
+ GObject *object;
+ MNMailbox *self;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = MN_MAILBOX(object);
+
+ mn_mailbox_monitor(self,
+ mn_mailbox_get_uri(self),
+ GNOME_VFS_MONITOR_FILE,
+ MN_MAILBOX_MONITOR_EVENT_CHANGED
+ | MN_MAILBOX_MONITOR_EVENT_DELETED
+ | MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ return object;
+ }}
+#line 179 "mn-mbox-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 62 "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"
+#define PARENT_HANDLER(___dummy,___uri) \
+ ((MN_MAILBOX_CLASS(parent_class)->impl_is)? \
+ (* MN_MAILBOX_CLASS(parent_class)->impl_is)(___dummy,___uri): \
+ ((gboolean )0))
{
- MNmboxMailbox *mbox_mailbox = MN_MBOX_MAILBOX(mailbox);
- const char *uri;
- GnomeVFSFileInfo *file_info;
- GnomeVFSResult result;
- gboolean changed;
-
- uri = mn_mailbox_get_uri(mailbox);
-
- file_info = gnome_vfs_file_info_new();
- result = gnome_vfs_get_file_info(uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
- changed = result == GNOME_VFS_OK && (file_info->mtime != mbox_mailbox->priv->last_mtime || file_info->size != mbox_mailbox->priv->last_size);
- if (changed)
- {
- mbox_mailbox->priv->last_mtime = file_info->mtime;
- mbox_mailbox->priv->last_size = file_info->size;
- }
- gnome_vfs_file_info_unref(file_info);
-
- if (result == GNOME_VFS_OK)
- {
- if (changed)
- {
- MNVFSAsyncHandle *handle;
-
- mn_vfs_async_open(&handle,
- uri,
- GNOME_VFS_OPEN_READ,
- mn_mbox_mailbox_check_open_cb,
- mailbox);
- return;
- }
- }
- else
- mn_mailbox_set_error(mailbox, _("unable to get mailbox information: %s"), gnome_vfs_result_to_string(result));
-
- mn_mailbox_end_check(mailbox);
-}
-
-static void
-mn_mbox_mailbox_check_open_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
+#define __GOB_FUNCTION__ "MN:mbox:Mailbox::impl_is"
+#line 62 "mn-mbox-mailbox.gob"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 195 "mn-mbox-mailbox.c"
{
- MNmboxMailbox *mailbox = user_data;
-
- if (result == GNOME_VFS_OK)
- {
- CheckInfo *info;
-
- info = g_new(CheckInfo, 1);
- info->mailbox = mailbox;
- info->in_header = FALSE;
- info->seen = TRUE; /* so that mailbox with errors or empty mailbox will not be reported as having new mail */
-
- mn_vfs_async_read_line(handle, 0, mn_mbox_mailbox_check_read_line_cb, info);
- }
- else
- {
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unable to open mailbox: %s"), gnome_vfs_result_to_string(result));
- mn_mailbox_end_check(MN_MAILBOX(mailbox));
- }
-}
-
-static void
-mn_mbox_mailbox_check_read_line_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- const char *line,
- gpointer user_data)
+#line 64 "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 (file_info->size == 0) /* can be an empty mbox */
+ is = TRUE;
+ else
+ {
+ GnomeVFSHandle *handle;
+
+ if (gnome_vfs_open(&handle, uri, 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;
+
+ gnome_vfs_close(handle);
+ }
+ }
+ }
+ gnome_vfs_file_info_unref(file_info);
+
+ return is;
+ }}
+#line 232 "mn-mbox-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 99 "mn-mbox-mailbox.gob"
+static void
+___4_mn_mbox_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
+#line 239 "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); }
{
- CheckInfo *info = user_data;
-
- if (line)
- {
- if (! *line) /* end of headers */
- {
- if (! info->seen)
- goto end;
- info->in_header = FALSE;
- }
- else if (! strncmp(line, "From ", 5))
+#define __GOB_FUNCTION__ "MN:mbox:Mailbox::impl_threaded_check"
+#line 99 "mn-mbox-mailbox.gob"
+ g_return_if_fail (mailbox != NULL);
+#line 99 "mn-mbox-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (mailbox));
+#line 249 "mn-mbox-mailbox.c"
+{
+#line 101 "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;
+
+ /* 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)
{
- info->in_header = TRUE;
- info->seen = FALSE;
+ if (file_info->mtime == selfp->last_mtime)
+ check = FALSE;
+ else
+ selfp->last_mtime = file_info->mtime;
}
- else if (info->in_header
- && ! strncmp(line, "Status:", 7)
- && (strchr(line, 'O') || strchr(line, 'R')))
- info->seen = TRUE;
- }
-
- if (result == GNOME_VFS_OK)
- mn_vfs_async_read_line(handle, 0, mn_mbox_mailbox_check_read_line_cb, info);
- else /* we're done */
- {
- if (result != GNOME_VFS_ERROR_EOF)
- mn_mailbox_set_error(MN_MAILBOX(info->mailbox), _("error while reading mailbox: %s"), gnome_vfs_result_to_string(result));
-
- end:
- mn_mailbox_set_has_new(MN_MAILBOX(info->mailbox), ! info->seen);
- mn_vfs_async_close(handle, mn_mbox_mailbox_check_close_cb, info);
- }
-}
-
-static void
-mn_mbox_mailbox_check_close_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
-{
- CheckInfo *info = user_data;
-
- if (result != GNOME_VFS_OK)
- mn_mailbox_set_error(MN_MAILBOX(info->mailbox), _("unable to close mailbox: %s"), gnome_vfs_result_to_string(result));
-
- mn_mailbox_end_check(MN_MAILBOX(info->mailbox));
- g_free(info);
-}
+ gnome_vfs_file_info_unref(file_info);
+ }
+
+ if (check)
+ {
+ GnomeVFSResult result;
+ GnomeVFSHandle *handle;
+
+ result = gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ);
+ if (result == GNOME_VFS_OK)
+ {
+ MNVFSReadLineContext *context = NULL;
+ const char *line;
+ gboolean in_header = FALSE;
+ gboolean seen = TRUE; /* empty mailboxes have no new mail */
+
+ while ((result = mn_vfs_read_line(&context, handle, &line)) == GNOME_VFS_OK)
+ {
+ if (! *line)
+ {
+ if (! seen)
+ break;
+ in_header = FALSE;
+ }
+ else if (! strncmp(line, "From ", 5))
+ {
+ in_header = TRUE;
+ seen = FALSE;
+ }
+ else if (in_header
+ && ! strncmp(line, "Status:", 7)
+ && (strchr(line, 'O') || strchr(line, 'R')))
+ seen = TRUE;
+ }
+
+ mn_vfs_read_line_context_free(context);
+ gnome_vfs_close(handle);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(mailbox, ! seen);
+ else
+ mn_mailbox_set_error(mailbox, _("error while reading mailbox: %s"), gnome_vfs_result_to_string(result));
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+ else
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(mailbox, _("unable to open mailbox: %s"), gnome_vfs_result_to_string(result));
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(mailbox);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }}
+#line 335 "mn-mbox-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
diff --git a/src/mn-mbox-mailbox.gob b/src/mn-mbox-mailbox.gob
@@ -0,0 +1,184 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include "mn-mailbox.h"
+%}
+%privateheader{
+#include <time.h>
+%}
+%{
+#include "config.h"
+#include <string.h>
+#include <glib/gi18n-lib.h>
+#include <gdk/gdk.h>
+#include "mn-mailbox-private.h"
+#include "mn-vfs.h"
+%}
+
+class MN:mbox:Mailbox from MN:Mailbox
+{
+ private time_t last_mtime;
+
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->format = "mbox";
+ }
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ MNMailbox *self;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = MN_MAILBOX(object);
+
+ mn_mailbox_monitor(self,
+ mn_mailbox_get_uri(self),
+ GNOME_VFS_MONITOR_FILE,
+ MN_MAILBOX_MONITOR_EVENT_CHANGED
+ | MN_MAILBOX_MONITOR_EVENT_DELETED
+ | MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ return object;
+ }
+
+ override (MN:Mailbox) gboolean
+ impl_is (MNMailbox *dummy, const char *uri (check null))
+ {
+ 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 (file_info->size == 0) /* can be an empty mbox */
+ is = TRUE;
+ else
+ {
+ GnomeVFSHandle *handle;
+
+ if (gnome_vfs_open(&handle, uri, 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;
+
+ gnome_vfs_close(handle);
+ }
+ }
+ }
+ gnome_vfs_file_info_unref(file_info);
+
+ return is;
+ }
+
+ override (MN:Mailbox) void
+ 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;
+
+ /* 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 (file_info->mtime == selfp->last_mtime)
+ check = FALSE;
+ else
+ selfp->last_mtime = file_info->mtime;
+ }
+ gnome_vfs_file_info_unref(file_info);
+ }
+
+ if (check)
+ {
+ GnomeVFSResult result;
+ GnomeVFSHandle *handle;
+
+ result = gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ);
+ if (result == GNOME_VFS_OK)
+ {
+ MNVFSReadLineContext *context = NULL;
+ const char *line;
+ gboolean in_header = FALSE;
+ gboolean seen = TRUE; /* empty mailboxes have no new mail */
+
+ while ((result = mn_vfs_read_line(&context, handle, &line)) == GNOME_VFS_OK)
+ {
+ if (! *line)
+ {
+ if (! seen)
+ break;
+ in_header = FALSE;
+ }
+ else if (! strncmp(line, "From ", 5))
+ {
+ in_header = TRUE;
+ seen = FALSE;
+ }
+ else if (in_header
+ && ! strncmp(line, "Status:", 7)
+ && (strchr(line, 'O') || strchr(line, 'R')))
+ seen = TRUE;
+ }
+
+ mn_vfs_read_line_context_free(context);
+ gnome_vfs_close(handle);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(mailbox, ! seen);
+ else
+ mn_mailbox_set_error(mailbox, _("error while reading mailbox: %s"), gnome_vfs_result_to_string(result));
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+ else
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(mailbox, _("unable to open mailbox: %s"), gnome_vfs_result_to_string(result));
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(mailbox);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+}
diff --git a/src/mn-mbox-mailbox.h b/src/mn-mbox-mailbox.h
@@ -1,48 +1,62 @@
-/*
- * 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.
- */
-
-#ifndef _MN_MBOX_MAILBOX_H
-#define _MN_MBOX_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_MBOX_MAILBOX (mn_mbox_mailbox_get_type())
-#define MN_MBOX_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_MBOX_MAILBOX, MNmboxMailbox))
-#define MN_MBOX_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_MBOX_MAILBOX, MNmboxMailboxClass))
-#define MN_IS_MBOX_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_MBOX_MAILBOX))
-#define MN_IS_MBOX_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_MBOX_MAILBOX))
-#define MN_MBOX_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_MBOX_MAILBOX, MNmboxMailboxClass))
+#ifndef __MN_MBOX_MAILBOX_H__
+#define __MN_MBOX_MAILBOX_H__
-typedef struct _MNmboxMailboxPrivate MNmboxMailboxPrivate;
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_MBOX_MAILBOX (mn_mbox_mailbox_get_type())
+#define MN_MBOX_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mbox_mailbox_get_type(), MNmboxMailbox)
+#define MN_MBOX_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mbox_mailbox_get_type(), MNmboxMailbox const)
+#define MN_MBOX_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_mbox_mailbox_get_type(), MNmboxMailboxClass)
+#define MN_IS_MBOX_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_mbox_mailbox_get_type ())
-typedef struct
-{
- MNMailbox mailbox;
+#define MN_MBOX_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_mbox_mailbox_get_type(), MNmboxMailboxClass)
- MNmboxMailboxPrivate *priv;
-} MNmboxMailbox;
+/* Private structure type */
+typedef struct _MNmboxMailboxPrivate MNmboxMailboxPrivate;
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNmboxMailboxClass;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_MBOX_MAILBOX__
+#define __TYPEDEF_MN_MBOX_MAILBOX__
+typedef struct _MNmboxMailbox MNmboxMailbox;
+#endif
+struct _MNmboxMailbox {
+ MNMailbox __parent__;
+ /*< private >*/
+ MNmboxMailboxPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNmboxMailboxClass MNmboxMailboxClass;
+struct _MNmboxMailboxClass {
+ MNMailboxClass __parent__;
+};
+
+/*
+ * Public methods
+ */
GType mn_mbox_mailbox_get_type (void);
-#endif /* _MN_MBOX_MAILBOX_H */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-md5.c b/src/mn-md5.c
@@ -0,0 +1,351 @@
+/*
+ * mn-md5.c - RSA Data Security, Inc., MD5 message-digest algorithm
+ *
+ * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ * rights reserved.
+ *
+ * License to copy and use this software is granted provided that it
+ * is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ * Algorithm" in all material mentioning or referencing this software
+ * or this function.
+ *
+ * License is also granted to make and use derivative works provided
+ * that such works are identified as "derived from the RSA Data
+ * Security, Inc. MD5 Message-Digest Algorithm" in all material
+ * mentioning or referencing the derived work.
+ *
+ * RSA Data Security, Inc. makes no representations concerning either
+ * the merchantability of this software or the suitability of this
+ * software for any particular purpose. It is provided "as is"
+ * without express or implied warranty of any kind.
+ *
+ * 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
+ * edited for clarity and style only.
+ */
+
+#include <sys/types.h>
+#include <string.h>
+#include <glib.h>
+#include "mn-md5.h"
+
+/*** cpp *********************************************************************/
+
+#ifdef i386
+#define mn_md5_encode memcpy
+#define mn_md5_decode memcpy
+#else /* 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)
+{
+ unsigned int i, j;
+
+ for (i = 0, j = 0; j < len; i++, j += 4)
+ {
+ output[j] = (unsigned char) (input[i] & 0xff);
+ output[j+1] = (unsigned char) ((input[i] >> 8) & 0xff);
+ output[j+2] = (unsigned char) ((input[i] >> 16) & 0xff);
+ output[j+3] = (unsigned char) ((input[i] >> 24) & 0xff);
+ }
+}
+
+/*
+ * Decodes input (unsigned char) into output (u_int32_t). Assumes len
+ * is a multiple of 4.
+ */
+static void
+mn_md5_decode (u_int32_t *output, const unsigned char *input, unsigned int len)
+{
+ unsigned int i, j;
+
+ for (i = 0, j = 0; j < len; i++, j += 4)
+ 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 */
+
+/* F, G, H and I are basic MD5 functions */
+#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
+#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+#define I(x, y, z) ((y) ^ ((x) | (~z)))
+
+/* ROTATE_LEFT rotates x left n bits */
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
+
+/*
+ * FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+ * Rotation is separate from addition to prevent recomputation.
+ */
+#define FF(a, b, c, d, x, s, ac) { \
+ (a) += F((b), (c), (d)) + (x) + (u_int32_t) (ac); \
+ (a) = ROTATE_LEFT((a), (s)); \
+ (a) += (b); \
+ }
+#define GG(a, b, c, d, x, s, ac) { \
+ (a) += G((b), (c), (d)) + (x) + (u_int32_t) (ac); \
+ (a) = ROTATE_LEFT((a), (s)); \
+ (a) += (b); \
+ }
+#define HH(a, b, c, d, x, s, ac) { \
+ (a) += H((b), (c), (d)) + (x) + (u_int32_t) (ac); \
+ (a) = ROTATE_LEFT((a), (s)); \
+ (a) += (b); \
+ }
+#define II(a, b, c, d, x, s, ac) { \
+ (a) += I((b), (c), (d)) + (x) + (u_int32_t) (ac); \
+ (a) = ROTATE_LEFT((a), (s)); \
+ (a) += (b); \
+ }
+
+#define LENGTH 16
+
+/*** variables ***************************************************************/
+
+static unsigned char PADDING[64] = {
+ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*** functions ***************************************************************/
+
+static void mn_md5_transform (u_int32_t state[4], const unsigned char block[64]);
+
+/*** implementation **********************************************************/
+
+/*
+ * MD5 initialization. Begins an MD5 operation, writing a new context.
+ */
+void
+mn_md5_init (MNMD5Context *context)
+{
+ g_return_if_fail(context != NULL);
+
+ context->count[0] = context->count[1] = 0;
+
+ /* load magic initialization constants */
+ context->state[0] = 0x67452301;
+ context->state[1] = 0xefcdab89;
+ context->state[2] = 0x98badcfe;
+ context->state[3] = 0x10325476;
+}
+
+/*
+ * MD5 block update operation. Continues an MD5 message-digest
+ * operation, processing another message block, and updating the
+ * context.
+ */
+void
+mn_md5_update (MNMD5Context *context,
+ const unsigned char *buf,
+ unsigned int len)
+{
+ unsigned int i;
+ unsigned int index;
+ unsigned int part_len;
+
+ g_return_if_fail(context != NULL);
+ g_return_if_fail(buf != NULL);
+
+ /* compute number of bytes mod 64 */
+ index = (unsigned int) ((context->count[0] >> 3) & 0x3F);
+
+ /* update number of bits */
+ if ((context->count[0] += ((u_int32_t) len << 3)) < ((u_int32_t) len << 3))
+ context->count[1]++;
+ context->count[1] += ((u_int32_t) len >> 29);
+
+ part_len = 64 - index;
+
+ /* transform as many times as possible */
+ if (len >= part_len)
+ {
+ memcpy(&context->buffer[index], buf, part_len);
+ mn_md5_transform(context->state, context->buffer);
+
+ for (i = part_len; i + 63 < len; i += 64)
+ mn_md5_transform(context->state, &buf[i]);
+
+ index = 0;
+ }
+ else
+ i = 0;
+
+ /* buffer remaining input */
+ memcpy(&context->buffer[index], &buf[i], len - i);
+}
+
+/*
+ * MD5 padding. Adds padding followed by original length.
+ */
+void
+mn_md5_pad (MNMD5Context *context)
+{
+ unsigned char bits[8];
+ unsigned int index, pad_len;
+
+ g_return_if_fail(context != NULL);
+
+ /* Save number of bits */
+ mn_md5_encode(bits, context->count, 8);
+
+ /* Pad out to 56 mod 64. */
+ index = (unsigned int) ((context->count[0] >> 3) & 0x3f);
+ pad_len = (index < 56) ? (56 - index) : (120 - index);
+ mn_md5_update(context, PADDING, pad_len);
+
+ /* Append length (before padding) */
+ mn_md5_update(context, bits, 8);
+}
+
+/*
+ * MD5 finalization. Ends an MD5 message-digest operation, writing the
+ * the message digest and zeroizing the context.
+ */
+void
+mn_md5_final (unsigned char digest[16], MNMD5Context *context)
+{
+ g_return_if_fail(context != NULL);
+
+ /* do padding */
+ mn_md5_pad(context);
+
+ /* store state in digest */
+ mn_md5_encode(digest, context->state, 16);
+
+ /* zeroize sensitive information. */
+ memset(context, 0, sizeof(*context));
+}
+
+char *
+mn_md5_end (MNMD5Context *context, char *buf)
+{
+ int i;
+ unsigned char digest[LENGTH];
+ static const char hex[] = "0123456789abcdef";
+
+ if (! buf)
+ buf = g_malloc(2 * LENGTH + 1);
+
+ mn_md5_final(digest, context);
+
+ for (i = 0; i < LENGTH; i++)
+ {
+ buf[i + i] = hex[digest[i] >> 4];
+ buf[i + i +1] = hex[digest[i] & 0x0f];
+ }
+ buf[i + i] = '\0';
+
+ return buf;
+}
+
+static void
+mn_md5_transform (u_int32_t state[4], const unsigned char block[64])
+{
+ u_int32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+
+ mn_md5_decode(x, block, 64);
+
+ /* Round 1 */
+#define S11 7
+#define S12 12
+#define S13 17
+#define S14 22
+ FF(a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+ FF(d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+ FF(c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+ FF(b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+ FF(a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+ FF(d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+ FF(c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+ FF(b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+ FF(a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+ FF(d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+ FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+ FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+ FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+ FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+ FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+ FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+
+ /* Round 2 */
+#define S21 5
+#define S22 9
+#define S23 14
+#define S24 20
+ GG(a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+ GG(d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+ GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+ GG(b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+ GG(a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+ GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */
+ GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+ GG(b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+ GG(a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+ GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+ GG(c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+ GG(b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+ GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+ GG(d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+ GG(c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+ GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+
+ /* Round 3 */
+#define S31 4
+#define S32 11
+#define S33 16
+#define S34 23
+ HH(a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+ HH(d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+ HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+ HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+ HH(a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+ HH(d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+ HH(c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+ HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+ HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+ HH(d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+ HH(c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+ HH(b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
+ HH(a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+ HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+ HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+ HH(b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+
+ /* Round 4 */
+#define S41 6
+#define S42 10
+#define S43 15
+#define S44 21
+ II(a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+ II(d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+ II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+ II(b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+ II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+ II(d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+ II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+ II(b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+ II(a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+ II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+ II(c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+ II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+ II(a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+ II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+ II(c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+ II(b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+
+ /* zeroize sensitive information */
+ memset(x, 0, sizeof(x));
+}
diff --git a/src/mn-md5.h b/src/mn-md5.h
@@ -0,0 +1,49 @@
+/*
+ * mn-md5.h - RSA Data Security, Inc., MD5 message-digest algorithm
+ *
+ * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ * rights reserved.
+ *
+ * License to copy and use this software is granted provided that it
+ * is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ * Algorithm" in all material mentioning or referencing this software
+ * or this function.
+ *
+ * License is also granted to make and use derivative works provided
+ * that such works are identified as "derived from the RSA Data
+ * Security, Inc. MD5 Message-Digest Algorithm" in all material
+ * mentioning or referencing the derived work.
+ *
+ * RSA Data Security, Inc. makes no representations concerning either
+ * the merchantability of this software or the suitability of this
+ * software for any particular purpose. It is provided "as is"
+ * without express or implied warranty of any kind.
+ *
+ * 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
+ * edited for clarity and style only.
+ */
+
+#ifndef _MN_MD5_H
+#define _MN_MD5_H
+
+#include <sys/types.h>
+
+typedef struct
+{
+ u_int32_t state[4]; /* state (ABCD) */
+ u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
+ char buffer[64]; /* input buffer */
+} MNMD5Context;
+
+void mn_md5_init (MNMD5Context *context);
+void mn_md5_update (MNMD5Context *context,
+ const unsigned char *buf,
+ unsigned int len);
+void mn_md5_pad (MNMD5Context *context);
+void mn_md5_final (unsigned char digest[16], MNMD5Context *context);
+char *mn_md5_end (MNMD5Context *context, char *buf);
+
+#endif /* _MN_MD5_H */
diff --git a/src/mn-mh-mailbox-private.h b/src/mn-mh-mailbox-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_MH_MAILBOX_PRIVATE_H__
+#define __MN_MH_MAILBOX_PRIVATE_H__
+
+#include "mn-mh-mailbox.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-mh-mailbox.c b/src/mn-mh-mailbox.c
@@ -1,233 +1,271 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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 "config.h"
-#include <stdio.h>
-#include <string.h>
-#include <glib/gi18n-lib.h>
-#include <libgnomevfs/gnome-vfs.h>
#include "mn-mh-mailbox.h"
-#include "mn-vfs.h"
-/*** types *******************************************************************/
+#include "mn-mh-mailbox-private.h"
-typedef struct
-{
- MNMailboxIsCallback *callback;
- gpointer user_data;
-} IsInfo;
+#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 */
-/*** variables ***************************************************************/
+#line 22 "mn-mh-mailbox.gob"
-static GObjectClass *parent_class = NULL;
+#include "config.h"
+#include <stdio.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+#include <gdk/gdk.h>
+#include "mn-mailbox-private.h"
+#include "mn-vfs.h"
-/*** functions ***************************************************************/
+#line 35 "mn-mh-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_MH_MAILBOX(x)
+#define SELF_CONST(x) MN_MH_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_MH_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_MH_MAILBOX
+#define SELF_CLASS(x) MN_MH_MAILBOX_CLASS(x)
-static void mn_mh_mailbox_class_init (MNMHMailboxClass *class);
+#define SELF_GET_CLASS(x) MN_MH_MAILBOX_GET_CLASS(x)
-static GObject *mn_mh_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params);
+/* self typedefs */
+typedef MNMHMailbox Self;
+typedef MNMHMailboxClass SelfClass;
-static void mn_mh_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data);
-static void mn_mh_mailbox_is_cb (gboolean result, gpointer user_data);
+/* here are local prototypes */
+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 void ___4_mn_mh_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
-static void mn_mh_mailbox_check (MNMailbox *mailbox);
-static void mn_mh_mailbox_check_open_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-static void mn_mh_mailbox_check_read_line_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- const char *line,
- gpointer user_data);
-static void mn_mh_mailbox_check_close_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-
-/*** implementation **********************************************************/
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
GType
mn_mh_mailbox_get_type (void)
{
- static GType mh_mailbox_type = 0;
-
- if (! mh_mailbox_type)
- {
- static const GTypeInfo mh_mailbox_info = {
- sizeof(MNMHMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_mh_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNMHMailbox),
- 0,
- NULL
- };
-
- mh_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNMHMailbox",
- &mh_mailbox_info,
- 0);
- }
-
- return mh_mailbox_type;
-}
-
-static void
-mn_mh_mailbox_class_init (MNMHMailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
-
- parent_class = g_type_class_peek_parent(class);
-
- object_class->constructor = mn_mh_mailbox_constructor;
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNMHMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_mh_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNMHMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_mh_mailbox_init,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNMHMailbox", &info, (GTypeFlags)0);
+ }
- mailbox_class->format = "MH";
- mailbox_class->is = mn_mh_mailbox_is;
- mailbox_class->check = mn_mh_mailbox_check;
+ return type;
}
-static GObject *
-mn_mh_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNMHMailbox *)g_object_new(mn_mh_mailbox_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNMHMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNMHMailbox *
+GET_NEW_VARG (const char *first, ...)
{
- GObject *object;
- MNMailbox *mailbox;
- char *sequences_uri;
-
- object = G_OBJECT_CLASS(parent_class)->constructor(type, n_construct_properties, construct_params);
- mailbox = MN_MAILBOX(object);
-
- sequences_uri = g_build_path("/", mn_mailbox_get_uri(mailbox), ".mh_sequences", NULL);
- mn_mailbox_monitor(mailbox,
- sequences_uri,
- GNOME_VFS_MONITOR_FILE,
- MN_MAILBOX_MONITOR_EVENT_CHANGED
- | MN_MAILBOX_MONITOR_EVENT_DELETED
- | MN_MAILBOX_MONITOR_EVENT_CREATED);
- g_free(sequences_uri);
-
- return object;
+ MNMHMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNMHMailbox *)g_object_new_valist (mn_mh_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
-static void
-mn_mh_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data)
+static void
+mn_mh_mailbox_init (MNMHMailbox * o G_GNUC_UNUSED)
{
- IsInfo *info;
- char *sequences_uri;
-
- info = g_new(IsInfo, 1);
- info->callback = callback;
- info->user_data = user_data;
-
- sequences_uri = g_build_path("/", uri, ".mh_sequences", NULL);
- mn_vfs_async_test(sequences_uri, G_FILE_TEST_IS_REGULAR, mn_mh_mailbox_is_cb, info);
- g_free(sequences_uri);
+#define __GOB_FUNCTION__ "MN:MH:Mailbox::init"
}
-
-static void
-mn_mh_mailbox_is_cb (gboolean result, gpointer user_data)
+#undef __GOB_FUNCTION__
+#line 34 "mn-mh-mailbox.gob"
+static void
+mn_mh_mailbox_class_init (MNMHMailboxClass * class G_GNUC_UNUSED)
+#line 110 "mn-mh-mailbox.c"
{
- IsInfo *info = user_data;
+#define __GOB_FUNCTION__ "MN:MH:Mailbox::class_init"
+ GObjectClass *g_object_class = (GObjectClass *)class;
+ MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
+
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
+
+#line 39 "mn-mh-mailbox.gob"
+ g_object_class->constructor = ___2_mn_mh_mailbox_constructor;
+#line 61 "mn-mh-mailbox.gob"
+ mn_mailbox_class->impl_is = ___3_mn_mh_mailbox_impl_is;
+#line 74 "mn-mh-mailbox.gob"
+ mn_mailbox_class->impl_threaded_check = ___4_mn_mh_mailbox_impl_threaded_check;
+#line 124 "mn-mh-mailbox.c"
+ {
+#line 35 "mn-mh-mailbox.gob"
+
+ MN_MAILBOX_CLASS(class)->format = "MH";
- info->callback(result, info->user_data);
- g_free(info);
+#line 130 "mn-mh-mailbox.c"
+ }
}
+#undef __GOB_FUNCTION__
-static void
-mn_mh_mailbox_check (MNMailbox *mailbox)
-{
- char *sequences_uri;
- MNVFSAsyncHandle *handle;
-
- sequences_uri = g_build_path("/", mn_mailbox_get_uri(mailbox), ".mh_sequences", NULL);
- mn_vfs_async_open(&handle,
- sequences_uri,
- GNOME_VFS_OPEN_READ,
- mn_mh_mailbox_check_open_cb,
- mailbox);
- g_free(sequences_uri);
-}
-static void
-mn_mh_mailbox_check_open_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
-{
- MNMHMailbox *mailbox = user_data;
-
- if (result == GNOME_VFS_OK)
- mn_vfs_async_read_line(handle, 0, mn_mh_mailbox_check_read_line_cb, mailbox);
- else
- {
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unable to open .mh_sequences: %s"), gnome_vfs_result_to_string(result));
- mn_mailbox_end_check(MN_MAILBOX(mailbox));
- }
-}
-static void
-mn_mh_mailbox_check_read_line_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- const char *line,
- gpointer user_data)
+#line 39 "mn-mh-mailbox.gob"
+static GObject *
+___2_mn_mh_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
+#line 140 "mn-mh-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): \
+ ((GObject * )0))
{
- MNMHMailbox *mailbox = user_data;
- gboolean has_new = FALSE;
-
- if (line && ! strncmp(line, "unseen", 6))
- {
- int first;
-
- if (sscanf(line, "unseen: %d", &first) == 1)
- {
- has_new = TRUE;
- goto end;
- }
- }
-
- if (result == GNOME_VFS_OK)
- mn_vfs_async_read_line(handle, 0, mn_mh_mailbox_check_read_line_cb, mailbox);
- else
- {
- if (result != GNOME_VFS_ERROR_EOF)
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("error while reading .mh_sequences: %s"), gnome_vfs_result_to_string(result));
-
- end:
- mn_mailbox_set_has_new(MN_MAILBOX(mailbox), has_new);
- mn_vfs_async_close(handle, mn_mh_mailbox_check_close_cb, mailbox);
- }
-}
-
-static void
-mn_mh_mailbox_check_close_cb (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
+#define __GOB_FUNCTION__ "MN:MH:Mailbox::constructor"
{
- MNMHMailbox *mailbox = user_data;
-
- if (result != GNOME_VFS_OK)
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unable to close .mh_sequences: %s"), gnome_vfs_result_to_string(result));
- mn_mailbox_end_check(MN_MAILBOX(mailbox));
-}
+#line 41 "mn-mh-mailbox.gob"
+
+ GObject *object;
+ MNMailbox *self;
+ char *sequences_uri;
+
+ 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);
+ 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);
+ g_free(sequences_uri);
+
+ return object;
+ }}
+#line 168 "mn-mh-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 61 "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"
+#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"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 184 "mn-mh-mailbox.c"
+{
+#line 63 "mn-mh-mailbox.gob"
+
+ char *sequences_uri;
+ gboolean is;
+
+ sequences_uri = g_build_path("/", uri, ".mh_sequences", NULL);
+ is = mn_vfs_test(sequences_uri, G_FILE_TEST_IS_REGULAR);
+ g_free(sequences_uri);
+
+ return is;
+ }}
+#line 197 "mn-mh-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 74 "mn-mh-mailbox.gob"
+static void
+___4_mn_mh_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
+#line 204 "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"
+ g_return_if_fail (self != NULL);
+#line 74 "mn-mh-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 214 "mn-mh-mailbox.c"
+{
+#line 76 "mn-mh-mailbox.gob"
+
+ char *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);
+
+ if (result == GNOME_VFS_OK)
+ {
+ MNVFSReadLineContext *context = NULL;
+ const char *line;
+ gboolean has_new = FALSE;
+
+ while ((result = mn_vfs_read_line(&context, handle, &line)) == GNOME_VFS_OK)
+ if (! strncmp(line, "unseen", 6))
+ {
+ int first;
+
+ if (sscanf(line, "unseen: %d", &first) == 1)
+ {
+ has_new = TRUE;
+ break;
+ }
+ }
+
+ mn_vfs_read_line_context_free(context);
+ gnome_vfs_close(handle);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(self, has_new);
+ else
+ mn_mailbox_set_error(self, _("error while reading .mh_sequences: %s"), gnome_vfs_result_to_string(result));
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+ else
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(self, _("unable to open .mh_sequences: %s"), gnome_vfs_result_to_string(result));
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(self);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }}
+#line 270 "mn-mh-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
diff --git a/src/mn-mh-mailbox.gob b/src/mn-mh-mailbox.gob
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <stdio.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+#include <gdk/gdk.h>
+#include "mn-mailbox-private.h"
+#include "mn-vfs.h"
+%}
+
+class MN:MH:Mailbox from MN:Mailbox
+{
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->format = "MH";
+ }
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ MNMailbox *self;
+ char *sequences_uri;
+
+ 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);
+ 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);
+ g_free(sequences_uri);
+
+ return object;
+ }
+
+ override (MN:Mailbox) gboolean
+ impl_is (MNMailbox *dummy, const char *uri (check null))
+ {
+ char *sequences_uri;
+ gboolean is;
+
+ sequences_uri = g_build_path("/", uri, ".mh_sequences", NULL);
+ is = mn_vfs_test(sequences_uri, G_FILE_TEST_IS_REGULAR);
+ g_free(sequences_uri);
+
+ return is;
+ }
+
+ override (MN:Mailbox) void
+ impl_threaded_check (MN:Mailbox *self (check null type))
+ {
+ char *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);
+
+ if (result == GNOME_VFS_OK)
+ {
+ MNVFSReadLineContext *context = NULL;
+ const char *line;
+ gboolean has_new = FALSE;
+
+ while ((result = mn_vfs_read_line(&context, handle, &line)) == GNOME_VFS_OK)
+ if (! strncmp(line, "unseen", 6))
+ {
+ int first;
+
+ if (sscanf(line, "unseen: %d", &first) == 1)
+ {
+ has_new = TRUE;
+ break;
+ }
+ }
+
+ mn_vfs_read_line_context_free(context);
+ gnome_vfs_close(handle);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(self, has_new);
+ else
+ mn_mailbox_set_error(self, _("error while reading .mh_sequences: %s"), gnome_vfs_result_to_string(result));
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+ else
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(self, _("unable to open .mh_sequences: %s"), gnome_vfs_result_to_string(result));
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(self);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+}
diff --git a/src/mn-mh-mailbox.h b/src/mn-mh-mailbox.h
@@ -1,48 +1,57 @@
-/*
- * 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.
- */
-
-#ifndef _MN_MH_MAILBOX_H
-#define _MN_MH_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_MH_MAILBOX (mn_mh_mailbox_get_type())
-#define MN_MH_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_MH_MAILBOX, MNMHMailbox))
-#define MN_MH_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_MH_MAILBOX, MNMHMailboxClass))
-#define MN_IS_MH_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_MH_MAILBOX))
-#define MN_IS_MH_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_MH_MAILBOX))
-#define MN_MH_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_MH_MAILBOX, MNMHMailboxClass))
+#ifndef __MN_MH_MAILBOX_H__
+#define __MN_MH_MAILBOX_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
-typedef struct _MNMHMailboxPrivate MNMHMailboxPrivate;
-typedef struct
-{
- MNMailbox mailbox;
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_MH_MAILBOX (mn_mh_mailbox_get_type())
+#define MN_MH_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mh_mailbox_get_type(), MNMHMailbox)
+#define MN_MH_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_mh_mailbox_get_type(), MNMHMailbox const)
+#define MN_MH_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_mh_mailbox_get_type(), MNMHMailboxClass)
+#define MN_IS_MH_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_mh_mailbox_get_type ())
- MNMHMailboxPrivate *priv;
-} MNMHMailbox;
+#define MN_MH_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_mh_mailbox_get_type(), MNMHMailboxClass)
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNMHMailboxClass;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_MH_MAILBOX__
+#define __TYPEDEF_MN_MH_MAILBOX__
+typedef struct _MNMHMailbox MNMHMailbox;
+#endif
+struct _MNMHMailbox {
+ MNMailbox __parent__;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNMHMailboxClass MNMHMailboxClass;
+struct _MNMHMailboxClass {
+ MNMailboxClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_mh_mailbox_get_type (void);
-GType mn_mh_mailbox_get_type (void);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
-#endif /* _MN_MH_MAILBOX_H */
+#endif
diff --git a/src/mn-pending-mailbox-private.h b/src/mn-pending-mailbox-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_PENDING_MAILBOX_PRIVATE_H__
+#define __MN_PENDING_MAILBOX_PRIVATE_H__
+
+#include "mn-pending-mailbox.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-pending-mailbox.c b/src/mn-pending-mailbox.c
@@ -1,75 +1,138 @@
-/*
- * 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 Mon Aug 16 18:13:53 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-pending-mailbox.h"
+
+#include "mn-pending-mailbox-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 22 "mn-pending-mailbox.gob"
#include "config.h"
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
-#include "mn-pending-mailbox.h"
-/*** functions ***************************************************************/
+#line 31 "mn-pending-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_PENDING_MAILBOX(x)
+#define SELF_CONST(x) MN_PENDING_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_PENDING_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_PENDING_MAILBOX
+#define SELF_CLASS(x) MN_PENDING_MAILBOX_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_PENDING_MAILBOX_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNPendingMailbox Self;
+typedef MNPendingMailboxClass SelfClass;
-static void mn_pending_mailbox_class_init (MNPendingMailboxClass *class);
+/* here are local prototypes */
+static void mn_pending_mailbox_init (MNPendingMailbox * o) G_GNUC_UNUSED;
+static void mn_pending_mailbox_class_init (MNPendingMailboxClass * class) G_GNUC_UNUSED;
-/*** implementation **********************************************************/
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
+/* Short form macros */
+#define self_new mn_pending_mailbox_new
GType
mn_pending_mailbox_get_type (void)
{
- static GType pending_mailbox_type = 0;
-
- if (! pending_mailbox_type)
- {
- static const GTypeInfo pending_mailbox_info = {
- sizeof(MNPendingMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_pending_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNPendingMailbox),
- 0,
- NULL
- };
-
- pending_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNPendingMailbox",
- &pending_mailbox_info,
- 0);
- }
-
- return pending_mailbox_type;
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNPendingMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_pending_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNPendingMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_pending_mailbox_init,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNPendingMailbox", &info, (GTypeFlags)0);
+ }
+
+ return type;
}
-static void
-mn_pending_mailbox_class_init (MNPendingMailboxClass *class)
-{
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNPendingMailbox *)g_object_new(mn_pending_mailbox_get_type(), NULL))
- mailbox_class->stock_id = GTK_STOCK_EXECUTE;
- mailbox_class->format = _("detecting...");
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNPendingMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNPendingMailbox *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNPendingMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNPendingMailbox *)g_object_new_valist (mn_pending_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
-MNMailbox *
-mn_pending_mailbox_new (const char *uri)
+static void
+mn_pending_mailbox_init (MNPendingMailbox * o G_GNUC_UNUSED)
{
- g_return_val_if_fail(uri != NULL, NULL);
+#define __GOB_FUNCTION__ "MN:Pending:Mailbox::init"
+}
+#undef __GOB_FUNCTION__
+#line 30 "mn-pending-mailbox.gob"
+static void
+mn_pending_mailbox_class_init (MNPendingMailboxClass * class G_GNUC_UNUSED)
+#line 105 "mn-pending-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:Pending:Mailbox::class_init"
+
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
- return g_object_new(MN_TYPE_PENDING_MAILBOX,
- "uri", uri,
- NULL);
+ {
+#line 31 "mn-pending-mailbox.gob"
+
+ MN_MAILBOX_CLASS(class)->stock_id = GTK_STOCK_EXECUTE;
+ MN_MAILBOX_CLASS(class)->format = _("detecting");
+
+#line 117 "mn-pending-mailbox.c"
+ }
}
+#undef __GOB_FUNCTION__
+
+
+
+#line 36 "mn-pending-mailbox.gob"
+MNMailbox *
+mn_pending_mailbox_new (const char * 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 38 "mn-pending-mailbox.gob"
+
+ return g_object_new(TYPE_SELF, MN_MAILBOX_PROP_URI((char *) uri), NULL);
+ }}
+#line 138 "mn-pending-mailbox.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-pending-mailbox.gob b/src/mn-pending-mailbox.gob
@@ -0,0 +1,41 @@
+/*
+ * 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 "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+%}
+
+class MN:Pending:Mailbox from MN:Mailbox
+{
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->stock_id = GTK_STOCK_EXECUTE;
+ MN_MAILBOX_CLASS(class)->format = _("detecting");
+ }
+
+ public MNMailbox *
+ new (const char *uri (check null))
+ {
+ return g_object_new(TYPE_SELF, MN_MAILBOX_PROP_URI((char *) uri), NULL);
+ }
+}
diff --git a/src/mn-pending-mailbox.h b/src/mn-pending-mailbox.h
@@ -1,45 +1,58 @@
-/*
- * 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.
- */
-
-#ifndef _MN_PENDING_MAILBOX_H
-#define _MN_PENDING_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_PENDING_MAILBOX (mn_pending_mailbox_get_type())
-#define MN_PENDING_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_PENDING_MAILBOX, MNPendingMailbox))
-#define MN_PENDING_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_PENDING_MAILBOX, MNPendingMailboxClass))
-#define MN_IS_PENDING_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_PENDING_MAILBOX))
-#define MN_IS_PENDING_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_PENDING_MAILBOX))
-#define MN_PENDING_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_PENDING_MAILBOX, MNPendingMailboxClass))
+#ifndef __MN_PENDING_MAILBOX_H__
+#define __MN_PENDING_MAILBOX_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_PENDING_MAILBOX (mn_pending_mailbox_get_type())
+#define MN_PENDING_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pending_mailbox_get_type(), MNPendingMailbox)
+#define MN_PENDING_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pending_mailbox_get_type(), MNPendingMailbox const)
+#define MN_PENDING_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_pending_mailbox_get_type(), MNPendingMailboxClass)
+#define MN_IS_PENDING_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_pending_mailbox_get_type ())
+
+#define MN_PENDING_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_pending_mailbox_get_type(), MNPendingMailboxClass)
-typedef struct
-{
- MNMailbox mailbox;
-} MNPendingMailbox;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_PENDING_MAILBOX__
+#define __TYPEDEF_MN_PENDING_MAILBOX__
+typedef struct _MNPendingMailbox MNPendingMailbox;
+#endif
+struct _MNPendingMailbox {
+ MNMailbox __parent__;
+};
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNPendingMailboxClass;
+/*
+ * Class definition
+ */
+typedef struct _MNPendingMailboxClass MNPendingMailboxClass;
+struct _MNPendingMailboxClass {
+ MNMailboxClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_pending_mailbox_get_type (void);
+MNMailbox * mn_pending_mailbox_new (const char * uri);
-GType mn_pending_mailbox_get_type (void);
-MNMailbox *mn_pending_mailbox_new (const char *uri);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
-#endif /* _MN_PENDING_MAILBOX_H */
+#endif
diff --git a/src/mn-pi-mailbox-properties-private.h b/src/mn-pi-mailbox-properties-private.h
@@ -0,0 +1,18 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_PI_MAILBOX_PROPERTIES_PRIVATE_H__
+#define __MN_PI_MAILBOX_PROPERTIES_PRIVATE_H__
+
+#include "mn-pi-mailbox-properties.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+void mn_pi_mailbox_properties_entry_changed_h (GtkEditable * editable, gpointer user_data);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-pi-mailbox-properties.c b/src/mn-pi-mailbox-properties.c
@@ -0,0 +1,516 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-pi-mailbox-properties.h"
+
+#include "mn-pi-mailbox-properties-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 22 "mn-pi-mailbox-properties.gob"
+
+#include "config.h"
+#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"
+/* self casting macros */
+#define SELF(x) MN_PI_MAILBOX_PROPERTIES(x)
+#define SELF_CONST(x) MN_PI_MAILBOX_PROPERTIES_CONST(x)
+#define IS_SELF(x) MN_IS_PI_MAILBOX_PROPERTIES(x)
+#define TYPE_SELF MN_TYPE_PI_MAILBOX_PROPERTIES
+#define SELF_CLASS(x) MN_PI_MAILBOX_PROPERTIES_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_PI_MAILBOX_PROPERTIES_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNPIMailboxProperties Self;
+typedef MNPIMailboxPropertiesClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void mn_pi_mailbox_properties_init (MNPIMailboxProperties * o) G_GNUC_UNUSED;
+static void mn_pi_mailbox_properties_class_init (MNPIMailboxPropertiesClass * c) G_GNUC_UNUSED;
+static GObject * ___1_mn_pi_mailbox_properties_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_params) G_GNUC_UNUSED;
+static void mn_pi_mailbox_properties_notify_expanded_h (GObject * object, GParamSpec * pspec, gpointer user_data) G_GNUC_UNUSED;
+static void mn_pi_mailbox_properties_radio_toggled_h (GtkToggleButton * togglebutton, gpointer user_data) G_GNUC_UNUSED;
+
+enum {
+ PROP_0,
+ PROP_COMPLETE,
+ PROP_LABEL,
+ PROP_SIZE_GROUP
+};
+
+/* pointer to the class of our parent */
+static GtkVBoxClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_notify_expanded_h mn_pi_mailbox_properties_notify_expanded_h
+#define self_entry_changed_h mn_pi_mailbox_properties_entry_changed_h
+#define self_radio_toggled_h mn_pi_mailbox_properties_radio_toggled_h
+#define self_set_contents mn_pi_mailbox_properties_set_contents
+#define self_get_contents mn_pi_mailbox_properties_get_contents
+
+
+static void
+___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
+{
+}
+
+GType
+mn_pi_mailbox_properties_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNPIMailboxPropertiesClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_pi_mailbox_properties_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNPIMailboxProperties),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_pi_mailbox_properties_init,
+ NULL
+ };
+
+ static const GInterfaceInfo MN_Mailbox_Properties_info = {
+ (GInterfaceInitFunc) ___MN_Mailbox_Properties_init,
+ NULL,
+ NULL
+ };
+
+ type = g_type_register_static (GTK_TYPE_VBOX, "MNPIMailboxProperties", &info, (GTypeFlags)0);
+ g_type_add_interface_static (type,
+ MN_TYPE_MAILBOX_PROPERTIES,
+ &MN_Mailbox_Properties_info);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNPIMailboxProperties *)g_object_new(mn_pi_mailbox_properties_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNPIMailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNPIMailboxProperties *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNPIMailboxProperties *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNPIMailboxProperties *)g_object_new_valist (mn_pi_mailbox_properties_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::dispose"
+ 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"
+ 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"
+ if(self->tooltips) { ((*(void (*)(void *))g_object_unref)) (self->tooltips); self->tooltips = NULL; }
+#line 145 "mn-pi-mailbox-properties.c"
+}
+#undef __GOB_FUNCTION__
+
+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"
+ o->tooltips = mn_tooltips_new();
+#line 155 "mn-pi-mailbox-properties.c"
+}
+#undef __GOB_FUNCTION__
+static void
+mn_pi_mailbox_properties_class_init (MNPIMailboxPropertiesClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (GTK_TYPE_VBOX);
+
+#line 56 "mn-pi-mailbox-properties.gob"
+ g_object_class->constructor = ___1_mn_pi_mailbox_properties_constructor;
+#line 168 "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;
+ {
+ g_object_class_override_property (g_object_class,
+ PROP_COMPLETE,
+ "complete");
+ g_object_class_override_property (g_object_class,
+ PROP_LABEL,
+ "label");
+ g_object_class_override_property (g_object_class,
+ PROP_SIZE_GROUP,
+ "size_group");
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::set_property"
+{
+ MNPIMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_PI_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_SIZE_GROUP:
+ {
+#line 44 "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"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::get_property"
+{
+ MNPIMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_PI_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_COMPLETE:
+ {
+#line 38 "mn-pi-mailbox-properties.gob"
+
+#line 233 "mn-pi-mailbox-properties.c"
+ }
+ break;
+ case PROP_LABEL:
+ {
+#line 41 "mn-pi-mailbox-properties.gob"
+ g_value_set_string(VAL, SELF_GET_CLASS(self)->label);
+#line 240 "mn-pi-mailbox-properties.c"
+ }
+ break;
+ case PROP_SIZE_GROUP:
+ {
+#line 44 "mn-pi-mailbox-properties.gob"
+g_value_set_object (VAL, (gpointer)self->size_group);
+#line 247 "mn-pi-mailbox-properties.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 56 "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"
+#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): \
+ ((GObject * )0))
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::constructor"
+{
+#line 58 "mn-pi-mailbox-properties.gob"
+
+ GObject *object;
+ Self *self;
+ GtkWidget *label1;
+ GtkWidget *label2;
+ GtkWidget *expander;
+ GtkSizeGroup *radio_size_group;
+ int i;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+
+ gtk_box_set_spacing(GTK_BOX(self), 6);
+
+ self->details_size_group = gtk_size_group_new(GTK_SIZE_GROUP_NONE);
+
+ mn_mailbox_properties_field_new(GTK_VBOX(self),
+ _("_Hostname:"),
+ &label1,
+ &self->hostname_entry);
+
+ gtk_size_group_add_widget(self->size_group, label1);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+
+ mn_mailbox_properties_credentials_new(GTK_VBOX(self),
+ &label1,
+ &self->username_entry,
+ &label2,
+ &self->password_entry);
+
+ gtk_size_group_add_widget(self->size_group, label1);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ gtk_size_group_add_widget(self->size_group, label2);
+ gtk_size_group_add_widget(self->details_size_group, label2);
+
+ expander = gtk_expander_new_with_mnemonic(_("_Details"));
+ gtk_expander_set_spacing(GTK_EXPANDER(expander), 6);
+
+ self->details_vbox = gtk_vbox_new(FALSE, 6);
+ gtk_container_add(GTK_CONTAINER(expander), self->details_vbox);
+
+ gtk_box_pack_start(GTK_BOX(self), expander, FALSE, FALSE, 0);
+ gtk_widget_show_all(expander);
+
+ radio_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+
+ mn_mailbox_properties_connection_type_new(GTK_VBOX(self->details_vbox),
+ _("sta_ndard"),
+ SELF_GET_CLASS(self)->default_port[0],
+ NULL,
+ &label1,
+ &self->conn_radio[0],
+ &self->port_spin[0]);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ 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],
+ GTK_RADIO_BUTTON(self->conn_radio[0]),
+ &label1,
+ &self->conn_radio[1],
+ &self->port_spin[1]);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ gtk_size_group_add_widget(radio_size_group, self->conn_radio[1]);
+
+ g_object_unref(radio_size_group);
+
+#ifndef WITH_SSL
+ gtk_widget_set_sensitive(self->conn_radio[1], FALSE);
+#endif
+
+ /* by default, standard is enabled */
+ gtk_widget_set_sensitive(self->port_spin[1], FALSE);
+
+ mn_mailbox_properties_authentication_new(GTK_VBOX(self->details_vbox),
+ &label1,
+ &self->auth_combo);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+
+ mn_mailbox_properties_link_entries(GTK_ENTRY(self->hostname_entry),
+ GTK_ENTRY(self->username_entry),
+ GTK_ENTRY(self->password_entry),
+ NULL);
+
+ g_signal_connect(G_OBJECT(expander), "notify::expanded", G_CALLBACK(self_notify_expanded_h), self);
+
+ for (i = 0; i < 2; 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);
+ g_signal_connect(G_OBJECT(self->username_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+ g_signal_connect(G_OBJECT(self->password_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+
+ return object;
+ }}
+#line 372 "mn-pi-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 155 "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"
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::notify_expanded_h"
+#line 155 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (object != NULL);
+#line 155 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (G_IS_OBJECT (object));
+#line 155 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (pspec != NULL);
+#line 155 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (user_data != NULL);
+#line 390 "mn-pi-mailbox-properties.c"
+{
+#line 159 "mn-pi-mailbox-properties.gob"
+
+ Self *self = user_data;
+
+ gtk_size_group_set_mode(self->details_size_group,
+ gtk_expander_get_expanded(GTK_EXPANDER(object))
+ ? GTK_SIZE_GROUP_HORIZONTAL
+ : GTK_SIZE_GROUP_NONE);
+ }}
+#line 401 "mn-pi-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 168 "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"
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::entry_changed_h"
+#line 168 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (editable != NULL);
+#line 168 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (GTK_IS_EDITABLE (editable));
+#line 168 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (user_data != NULL);
+#line 416 "mn-pi-mailbox-properties.c"
+{
+#line 171 "mn-pi-mailbox-properties.gob"
+
+ Self *self = user_data;
+ g_object_notify(G_OBJECT(self), "complete");
+ }}
+#line 423 "mn-pi-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 176 "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"
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::radio_toggled_h"
+#line 176 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (togglebutton != NULL);
+#line 176 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (GTK_IS_TOGGLE_BUTTON (togglebutton));
+#line 176 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (user_data != NULL);
+#line 438 "mn-pi-mailbox-properties.c"
+{
+#line 179 "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])));
+ }}
+#line 448 "mn-pi-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 187 "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"
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::set_contents"
+#line 187 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (self != NULL);
+#line 187 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self));
+#line 187 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (username != NULL);
+#line 187 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (password != NULL);
+#line 187 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (hostname != NULL);
+#line 187 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (port >= 0);
+#line 187 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (port <= 0xFFFF);
+#line 471 "mn-pi-mailbox-properties.c"
+{
+#line 195 "mn-pi-mailbox-properties.gob"
+
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->conn_radio[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);
+ }}
+#line 482 "mn-pi-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 204 "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"
+{
+#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::get_contents"
+#line 204 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (self != NULL);
+#line 204 "mn-pi-mailbox-properties.gob"
+ g_return_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self));
+#line 495 "mn-pi-mailbox-properties.c"
+{
+#line 212 "mn-pi-mailbox-properties.gob"
+
+ gboolean _ssl;
+
+ _ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[1]));
+
+ if (ssl)
+ *ssl = _ssl;
+ if (username)
+ *username = gtk_entry_get_text(GTK_ENTRY(self->username_entry));
+ if (password)
+ *password = gtk_entry_get_text(GTK_ENTRY(self->password_entry));
+ if (authmech)
+ *authmech = mn_auth_combo_box_get_active_mechanism(MN_AUTH_COMBO_BOX(self->auth_combo));
+ 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]));
+ }}
+#line 516 "mn-pi-mailbox-properties.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-pi-mailbox-properties.gob b/src/mn-pi-mailbox-properties.gob
@@ -0,0 +1,230 @@
+/*
+ * 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 <gtk/gtk.h>
+%}
+%{
+#include "config.h"
+#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"
+%}
+
+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 */
+
+ property BOOLEAN complete (override)
+ get {}; /* dummy, implemented by subclasses */
+
+ property STRING label (override)
+ get { g_value_set_string(VAL, SELF_GET_CLASS(self)->label); };
+
+ protected GtkSizeGroup *size_group unrefwith g_object_unref;
+ property OBJECT size_group (override, link);
+
+ protected GtkWidget *hostname_entry;
+ protected GtkWidget *username_entry;
+ protected GtkWidget *password_entry;
+ 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 *auth_combo;
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ Self *self;
+ GtkWidget *label1;
+ GtkWidget *label2;
+ GtkWidget *expander;
+ GtkSizeGroup *radio_size_group;
+ int i;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+
+ gtk_box_set_spacing(GTK_BOX(self), 6);
+
+ self->details_size_group = gtk_size_group_new(GTK_SIZE_GROUP_NONE);
+
+ mn_mailbox_properties_field_new(GTK_VBOX(self),
+ _("_Hostname:"),
+ &label1,
+ &self->hostname_entry);
+
+ gtk_size_group_add_widget(self->size_group, label1);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+
+ mn_mailbox_properties_credentials_new(GTK_VBOX(self),
+ &label1,
+ &self->username_entry,
+ &label2,
+ &self->password_entry);
+
+ gtk_size_group_add_widget(self->size_group, label1);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ gtk_size_group_add_widget(self->size_group, label2);
+ gtk_size_group_add_widget(self->details_size_group, label2);
+
+ expander = gtk_expander_new_with_mnemonic(_("_Details"));
+ gtk_expander_set_spacing(GTK_EXPANDER(expander), 6);
+
+ self->details_vbox = gtk_vbox_new(FALSE, 6);
+ gtk_container_add(GTK_CONTAINER(expander), self->details_vbox);
+
+ gtk_box_pack_start(GTK_BOX(self), expander, FALSE, FALSE, 0);
+ gtk_widget_show_all(expander);
+
+ radio_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+
+ mn_mailbox_properties_connection_type_new(GTK_VBOX(self->details_vbox),
+ _("sta_ndard"),
+ SELF_GET_CLASS(self)->default_port[0],
+ NULL,
+ &label1,
+ &self->conn_radio[0],
+ &self->port_spin[0]);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ 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],
+ GTK_RADIO_BUTTON(self->conn_radio[0]),
+ &label1,
+ &self->conn_radio[1],
+ &self->port_spin[1]);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+ gtk_size_group_add_widget(radio_size_group, self->conn_radio[1]);
+
+ g_object_unref(radio_size_group);
+
+#ifndef WITH_SSL
+ gtk_widget_set_sensitive(self->conn_radio[1], FALSE);
+#endif
+
+ /* by default, standard is enabled */
+ gtk_widget_set_sensitive(self->port_spin[1], FALSE);
+
+ mn_mailbox_properties_authentication_new(GTK_VBOX(self->details_vbox),
+ &label1,
+ &self->auth_combo);
+ gtk_size_group_add_widget(self->details_size_group, label1);
+
+ mn_mailbox_properties_link_entries(GTK_ENTRY(self->hostname_entry),
+ GTK_ENTRY(self->username_entry),
+ GTK_ENTRY(self->password_entry),
+ NULL);
+
+ g_signal_connect(G_OBJECT(expander), "notify::expanded", G_CALLBACK(self_notify_expanded_h), self);
+
+ for (i = 0; i < 2; 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);
+ g_signal_connect(G_OBJECT(self->username_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+ g_signal_connect(G_OBJECT(self->password_entry), "changed", G_CALLBACK(self_entry_changed_h), self);
+
+ return object;
+ }
+
+ private void
+ notify_expanded_h (G:Object *object (check null type),
+ GParamSpec *pspec (check null),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ gtk_size_group_set_mode(self->details_size_group,
+ gtk_expander_get_expanded(GTK_EXPANDER(object))
+ ? GTK_SIZE_GROUP_HORIZONTAL
+ : GTK_SIZE_GROUP_NONE);
+ }
+
+ protected void
+ entry_changed_h (Gtk:Editable *editable (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ g_object_notify(G_OBJECT(self), "complete");
+ }
+
+ private void
+ radio_toggled_h (Gtk:Toggle:Button *togglebutton (check null type),
+ gpointer user_data (check null))
+ {
+ 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])));
+ }
+
+ public void
+ set_contents (self,
+ gboolean 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_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);
+ }
+
+ public void
+ get_contents (self,
+ gboolean *ssl,
+ const char **username,
+ const char **password,
+ char **authmech,
+ const char **hostname,
+ int *port)
+ {
+ gboolean _ssl;
+
+ _ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[1]));
+
+ if (ssl)
+ *ssl = _ssl;
+ if (username)
+ *username = gtk_entry_get_text(GTK_ENTRY(self->username_entry));
+ if (password)
+ *password = gtk_entry_get_text(GTK_ENTRY(self->password_entry));
+ if (authmech)
+ *authmech = mn_auth_combo_box_get_active_mechanism(MN_AUTH_COMBO_BOX(self->auth_combo));
+ 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]));
+ }
+}
diff --git a/src/mn-pi-mailbox-properties.h b/src/mn-pi-mailbox-properties.h
@@ -0,0 +1,100 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <gtk/gtk.h>
+
+#ifndef __MN_PI_MAILBOX_PROPERTIES_H__
+#define __MN_PI_MAILBOX_PROPERTIES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_PI_MAILBOX_PROPERTIES (mn_pi_mailbox_properties_get_type())
+#define MN_PI_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pi_mailbox_properties_get_type(), MNPIMailboxProperties)
+#define MN_PI_MAILBOX_PROPERTIES_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pi_mailbox_properties_get_type(), MNPIMailboxProperties const)
+#define MN_PI_MAILBOX_PROPERTIES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_pi_mailbox_properties_get_type(), MNPIMailboxPropertiesClass)
+#define MN_IS_PI_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_pi_mailbox_properties_get_type ())
+
+#define MN_PI_MAILBOX_PROPERTIES_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_pi_mailbox_properties_get_type(), MNPIMailboxPropertiesClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_PI_MAILBOX_PROPERTIES__
+#define __TYPEDEF_MN_PI_MAILBOX_PROPERTIES__
+typedef struct _MNPIMailboxProperties MNPIMailboxProperties;
+#endif
+struct _MNPIMailboxProperties {
+ GtkVBox __parent__;
+ /*< private >*/
+ GtkSizeGroup * size_group; /* protected */
+ GtkWidget * hostname_entry; /* protected */
+ GtkWidget * username_entry; /* protected */
+ GtkWidget * password_entry; /* protected */
+ GtkTooltips * tooltips; /* protected */
+ GtkWidget * details_vbox; /* protected */
+ GtkSizeGroup * details_size_group; /* protected */
+ GtkWidget * conn_radio[2]; /* protected */
+ GtkWidget * port_spin[2]; /* protected */
+ GtkWidget * auth_combo; /* protected */
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNPIMailboxPropertiesClass MNPIMailboxPropertiesClass;
+struct _MNPIMailboxPropertiesClass {
+ GtkVBoxClass __parent__;
+ const char * label;
+ int default_port[2];
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_pi_mailbox_properties_get_type (void);
+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);
+void mn_pi_mailbox_properties_get_contents (MNPIMailboxProperties * self,
+ gboolean * ssl,
+ const char ** username,
+ const char ** password,
+ char ** authmech,
+ const char ** hostname,
+ int * port);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_PI_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete", __extension__ ({gboolean *z = (arg); z;})
+#define MN_PI_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label", __extension__ ({gchar **z = (arg); z;})
+#define MN_PI_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject *z = (arg); z;})
+#define MN_PI_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject **z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_PI_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete",(gboolean *)(arg)
+#define MN_PI_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label",(gchar **)(arg)
+#define MN_PI_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group",(GObject *)(arg)
+#define MN_PI_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group",(GObject **)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-pop3-mailbox-private.h b/src/mn-pop3-mailbox-private.h
@@ -0,0 +1,36 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_POP3_MAILBOX_PRIVATE_H__
+#define __MN_POP3_MAILBOX_PRIVATE_H__
+
+#include "mn-pop3-mailbox.h"
+
+#ifdef __cplusplus
+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"
+ int login_delay;
+#line 105 "mn-pop3-mailbox.gob"
+ GTimer * authentication_timer;
+#line 30 "mn-pop3-mailbox-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-pop3-mailbox-properties-private.h b/src/mn-pop3-mailbox-properties-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_POP3_MAILBOX_PROPERTIES_PRIVATE_H__
+#define __MN_POP3_MAILBOX_PROPERTIES_PRIVATE_H__
+
+#include "mn-pop3-mailbox-properties.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-pop3-mailbox-properties.c b/src/mn-pop3-mailbox-properties.c
@@ -0,0 +1,344 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-pop3-mailbox-properties.h"
+
+#include "mn-pop3-mailbox-properties-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 22 "mn-pop3-mailbox-properties.gob"
+
+#include "config.h"
+#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"
+/* self casting macros */
+#define SELF(x) MN_POP3_MAILBOX_PROPERTIES(x)
+#define SELF_CONST(x) MN_POP3_MAILBOX_PROPERTIES_CONST(x)
+#define IS_SELF(x) MN_IS_POP3_MAILBOX_PROPERTIES(x)
+#define TYPE_SELF MN_TYPE_POP3_MAILBOX_PROPERTIES
+#define SELF_CLASS(x) MN_POP3_MAILBOX_PROPERTIES_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_POP3_MAILBOX_PROPERTIES_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNPOP3MailboxProperties Self;
+typedef MNPOP3MailboxPropertiesClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+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;
+
+enum {
+ PROP_0,
+ PROP_COMPLETE
+};
+
+/* pointer to the class of our parent */
+static MNPIMailboxPropertiesClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_set_uri mn_pop3_mailbox_properties_set_uri
+#define self_get_uri mn_pop3_mailbox_properties_get_uri
+
+
+static void
+___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"
+ iface->get_uri = self_get_uri;
+#line 77 "mn-pop3-mailbox-properties.c"
+}
+
+GType
+mn_pop3_mailbox_properties_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNPOP3MailboxPropertiesClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_pop3_mailbox_properties_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNPOP3MailboxProperties),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_pop3_mailbox_properties_init,
+ NULL
+ };
+
+ static const GInterfaceInfo MN_Mailbox_Properties_info = {
+ (GInterfaceInitFunc) ___MN_Mailbox_Properties_init,
+ NULL,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_PI_MAILBOX_PROPERTIES, "MNPOP3MailboxProperties", &info, (GTypeFlags)0);
+ g_type_add_interface_static (type,
+ MN_TYPE_MAILBOX_PROPERTIES,
+ &MN_Mailbox_Properties_info);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNPOP3MailboxProperties *)g_object_new(mn_pop3_mailbox_properties_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNPOP3MailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNPOP3MailboxProperties *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNPOP3MailboxProperties *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNPOP3MailboxProperties *)g_object_new_valist (mn_pop3_mailbox_properties_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+static void
+mn_pop3_mailbox_properties_init (MNPOP3MailboxProperties * o G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::init"
+}
+#undef __GOB_FUNCTION__
+#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"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+
+ parent_class = g_type_class_ref (MN_TYPE_PI_MAILBOX_PROPERTIES);
+
+#line 69 "mn-pop3-mailbox-properties.gob"
+ g_object_class->constructor = ___2_mn_pop3_mailbox_properties_constructor;
+#line 149 "mn-pop3-mailbox-properties.c"
+ g_object_class->get_property = ___object_get_property;
+ {
+ g_object_class_override_property (g_object_class,
+ PROP_COMPLETE,
+ "complete");
+ }
+ {
+#line 61 "mn-pop3-mailbox-properties.gob"
+
+ 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);
+
+#line 165 "mn-pop3-mailbox-properties.c"
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::get_property"
+{
+ MNPOP3MailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_POP3_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_COMPLETE:
+ {
+#line 36 "mn-pop3-mailbox-properties.gob"
+
+ MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
+ gboolean complete;
+ const char *username;
+ const char *password;
+ const char *hostname;
+
+ mn_pi_mailbox_properties_get_contents(pi,
+ NULL,
+ &username,
+ &password,
+ NULL,
+ &hostname,
+ NULL);
+
+ complete = *username && *password && *hostname;
+#ifndef WITH_SSL
+ if (complete)
+ complete = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pi->conn_radio[0]));
+#endif /* WITH_SSL */
+
+ g_value_set_boolean(VAL, complete);
+
+#line 208 "mn-pop3-mailbox-properties.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 69 "mn-pop3-mailbox-properties.gob"
+static GObject *
+___2_mn_pop3_mailbox_properties_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
+#line 228 "mn-pop3-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): \
+ ((GObject * )0))
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::constructor"
+{
+#line 71 "mn-pop3-mailbox-properties.gob"
+
+ GObject *object;
+ Self *self;
+ MNPIMailboxProperties *pi;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+ pi = MN_PI_MAILBOX_PROPERTIES(object);
+
+ mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+APOP", "APOP");
+ mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+USERPASS", "USER/PASS");
+
+ mn_tooltips_set_tips(pi->tooltips,
+ pi->hostname_entry, _("The hostname or IP address of the POP3 server"),
+ pi->username_entry, _("Your username on the POP3 server"),
+ pi->password_entry, _("Your password on the POP3 server"),
+ pi->port_spin[0], _("The port number of the POP3 server"),
+ pi->port_spin[1], _("The port number of the POP3 server"),
+ NULL);
+
+ return object;
+ }}
+#line 259 "mn-pop3-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 94 "mn-pop3-mailbox-properties.gob"
+static gboolean
+mn_pop3_mailbox_properties_set_uri (MNMailboxProperties * properties, const char * uri)
+#line 266 "mn-pop3-mailbox-properties.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox:Properties::set_uri"
+#line 94 "mn-pop3-mailbox-properties.gob"
+ g_return_val_if_fail (properties != NULL, (gboolean )0);
+#line 94 "mn-pop3-mailbox-properties.gob"
+ 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 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))
+ {
+ 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);
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }}
+#line 306 "mn-pop3-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 126 "mn-pop3-mailbox-properties.gob"
+static char *
+mn_pop3_mailbox_properties_get_uri (MNMailboxProperties * properties)
+#line 312 "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 128 "mn-pop3-mailbox-properties.gob"
+
+ gboolean ssl;
+ const char *username;
+ const char *password;
+ char *authmech;
+ const char *hostname;
+ int port;
+ char *uri;
+
+ mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
+ &ssl,
+ &username,
+ &password,
+ &authmech,
+ &hostname,
+ &port);
+
+ uri = mn_uri_build_pop(ssl, username, password, authmech, hostname, port);
+ g_free(authmech);
+
+ return uri;
+ }}
+#line 344 "mn-pop3-mailbox-properties.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-pop3-mailbox-properties.gob b/src/mn-pop3-mailbox-properties.gob
@@ -0,0 +1,150 @@
+/*
+ * 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 "mn-pi-mailbox-properties.h"
+%}
+%{
+#include "config.h"
+#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"
+%}
+
+class MN:POP3:Mailbox:Properties from MN:PI:Mailbox:Properties (interface MN:Mailbox:Properties)
+{
+ property BOOLEAN complete (override)
+ get
+ {
+ MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
+ gboolean complete;
+ const char *username;
+ const char *password;
+ const char *hostname;
+
+ mn_pi_mailbox_properties_get_contents(pi,
+ NULL,
+ &username,
+ &password,
+ NULL,
+ &hostname,
+ NULL);
+
+ complete = *username && *password && *hostname;
+#ifndef WITH_SSL
+ if (complete)
+ complete = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pi->conn_radio[0]));
+#endif /* WITH_SSL */
+
+ g_value_set_boolean(VAL, complete);
+ };
+
+ class_init (class)
+ {
+ 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);
+ }
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ Self *self;
+ MNPIMailboxProperties *pi;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = SELF(object);
+ pi = MN_PI_MAILBOX_PROPERTIES(object);
+
+ mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+APOP", "APOP");
+ mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+USERPASS", "USER/PASS");
+
+ mn_tooltips_set_tips(pi->tooltips,
+ pi->hostname_entry, _("The hostname or IP address of the POP3 server"),
+ pi->username_entry, _("Your username on the POP3 server"),
+ pi->password_entry, _("Your password on the POP3 server"),
+ pi->port_spin[0], _("The port number of the POP3 server"),
+ pi->port_spin[1], _("The port number of the POP3 server"),
+ NULL);
+
+ return object;
+ }
+
+ interface MN:Mailbox:Properties private gboolean
+ set_uri (MN:Mailbox:Properties *properties (check null type),
+ const char *uri (check null))
+ {
+ gboolean ssl;
+ char *username;
+ char *password;
+ char *authmech;
+ char *hostname;
+ int port;
+
+ if (mn_uri_parse_pop(uri, &ssl, &username, &password, &authmech, &hostname, &port))
+ {
+ 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);
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+
+ interface MN:Mailbox:Properties private char *
+ get_uri (MN:Mailbox:Properties *properties (check null type))
+ {
+ gboolean ssl;
+ const char *username;
+ const char *password;
+ char *authmech;
+ const char *hostname;
+ int port;
+ char *uri;
+
+ mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(properties),
+ &ssl,
+ &username,
+ &password,
+ &authmech,
+ &hostname,
+ &port);
+
+ uri = mn_uri_build_pop(ssl, username, password, authmech, hostname, port);
+ g_free(authmech);
+
+ return uri;
+ }
+}
diff --git a/src/mn-pop3-mailbox-properties.h b/src/mn-pop3-mailbox-properties.h
@@ -0,0 +1,67 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include "mn-pi-mailbox-properties.h"
+
+#ifndef __MN_POP3_MAILBOX_PROPERTIES_H__
+#define __MN_POP3_MAILBOX_PROPERTIES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_POP3_MAILBOX_PROPERTIES (mn_pop3_mailbox_properties_get_type())
+#define MN_POP3_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pop3_mailbox_properties_get_type(), MNPOP3MailboxProperties)
+#define MN_POP3_MAILBOX_PROPERTIES_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pop3_mailbox_properties_get_type(), MNPOP3MailboxProperties const)
+#define MN_POP3_MAILBOX_PROPERTIES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_pop3_mailbox_properties_get_type(), MNPOP3MailboxPropertiesClass)
+#define MN_IS_POP3_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_pop3_mailbox_properties_get_type ())
+
+#define MN_POP3_MAILBOX_PROPERTIES_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_pop3_mailbox_properties_get_type(), MNPOP3MailboxPropertiesClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_POP3_MAILBOX_PROPERTIES__
+#define __TYPEDEF_MN_POP3_MAILBOX_PROPERTIES__
+typedef struct _MNPOP3MailboxProperties MNPOP3MailboxProperties;
+#endif
+struct _MNPOP3MailboxProperties {
+ MNPIMailboxProperties __parent__;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNPOP3MailboxPropertiesClass MNPOP3MailboxPropertiesClass;
+struct _MNPOP3MailboxPropertiesClass {
+ MNPIMailboxPropertiesClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_pop3_mailbox_properties_get_type (void);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_POP3_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete", __extension__ ({gboolean *z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_POP3_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete",(gboolean *)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-pop3-mailbox.c b/src/mn-pop3-mailbox.c
@@ -1,348 +1,1198 @@
-/*
- * mn-pop3-mailbox.c - POP3 support for Mail Notification
- * Fully complies with RFC 1939
- *
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 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-pop3-mailbox.h"
+
+#include "mn-pop3-mailbox-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 30 "mn-pop3-mailbox.gob"
#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <glib/gi18n-lib.h>
-#include <gnet.h>
#include <libgnomevfs/gnome-vfs-utils.h>
-#include "mn-pop3-mailbox.h"
+#include "mn-mailbox-private.h"
+#include "mn-client-session.h"
#include "mn-util.h"
#include "mn-uri.h"
+#include "mn-md5.h"
-/*** types *******************************************************************/
-
-typedef enum
-{
- STATE_CONNECT,
- STATE_ACK,
- STATE_USER,
- STATE_PASS,
- STATE_STAT,
- STATE_QUIT
-} State;
-
-struct _MNPOP3MailboxPrivate
-{
- char *hostname;
- int port;
- char *username;
- char *password;
+ enum
+ {
+ STATE_GREETING = MN_CLIENT_SESSION_INITIAL_STATE,
+ STATE_CAPA,
+#ifdef WITH_SASL
+ STATE_AUTH,
+#endif /* WITH_SASL */
+ STATE_APOP,
+ STATE_USER,
+ STATE_PASS,
+ STATE_STAT,
+ STATE_QUIT
+ };
- State state;
-};
+ enum
+ {
+ RESULT_ERROR_QUIT = -1, /* server reported an error, quit normally */
+ RESULT_ERROR_END = -2 /* server reported an error, close the connection */
+ };
-/*** variables ***************************************************************/
+ struct _MNClientSessionPrivate
+ {
+ MNPOP3Mailbox *mailbox;
+ MNClientSession *session;
+ gboolean in_list;
+ char *apop_timestamp;
+ GSList *auth_mechanisms;
+#ifdef WITH_SASL
+ const char *sasl_mechanism;
+#endif /* WITH_SASL */
+ gboolean authenticated;
+ gboolean login_delay_user;
+ };
-static GObjectClass *parent_class = NULL;
+ typedef enum
+ {
+ RESPONSE_OK,
+ RESPONSE_ERR,
+ RESPONSE_LIST_ITEM,
+ RESPONSE_LIST_END,
+ RESPONSE_CONTINUATION
+ } ResponseType;
-/*** functions ***************************************************************/
+ struct _MNClientSessionResponse
+ {
+ ResponseType type;
+ char *arguments;
+ };
-static void mn_pop3_mailbox_class_init (MNPOP3MailboxClass *class);
-static void mn_pop3_mailbox_init (MNPOP3Mailbox *mailbox);
-static void mn_pop3_mailbox_finalize (GObject *object);
+#line 90 "mn-pop3-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_POP3_MAILBOX(x)
+#define SELF_CONST(x) MN_POP3_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_POP3_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_POP3_MAILBOX
+#define SELF_CLASS(x) MN_POP3_MAILBOX_CLASS(x)
-static GObject *mn_pop3_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params);
+#define SELF_GET_CLASS(x) MN_POP3_MAILBOX_GET_CLASS(x)
-static void mn_pop3_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data);
-static void mn_pop3_mailbox_check (MNMailbox *mailbox);
+/* self typedefs */
+typedef MNPOP3Mailbox Self;
+typedef MNPOP3MailboxClass SelfClass;
-static void mn_pop3_mailbox_conn_write (GConn *conn, const char *format, ...);
-static void mn_pop3_mailbox_conn_cb (GConn *conn,
- GConnEvent *event,
- gpointer user_data);
+/* here are local prototypes */
+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 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_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;
+static int mn_pop3_mailbox_handle_apop_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_enter_user_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_handle_user_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_enter_pass_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_handle_pass_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_enter_stat_cb (MNClientSession * session, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+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 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;
+static int mn_pop3_mailbox_custom_handler_cb (MNClientSession * session, MNClientSessionResponse * response, int result, MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_session_authenticate (MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv, gboolean tried_apop) G_GNUC_UNUSED;
+static int mn_pop3_mailbox_session_authenticated (MNClientSessionPrivate * priv) G_GNUC_UNUSED;
+static void mn_pop3_mailbox_session_set_error_from_arguments (MNClientSessionPrivate * priv, MNClientSessionResponse * response) G_GNUC_UNUSED;
-/*** implementation **********************************************************/
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
+/* Short form macros */
+#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_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
+#define self_handle_apop_cb mn_pop3_mailbox_handle_apop_cb
+#define self_enter_user_cb mn_pop3_mailbox_enter_user_cb
+#define self_handle_user_cb mn_pop3_mailbox_handle_user_cb
+#define self_enter_pass_cb mn_pop3_mailbox_enter_pass_cb
+#define self_handle_pass_cb mn_pop3_mailbox_handle_pass_cb
+#define self_enter_stat_cb mn_pop3_mailbox_enter_stat_cb
+#define self_handle_stat_cb mn_pop3_mailbox_handle_stat_cb
+#define self_enter_quit_cb mn_pop3_mailbox_enter_quit_cb
+#define self_handle_quit_cb mn_pop3_mailbox_handle_quit_cb
+#define self_notice_cb mn_pop3_mailbox_notice_cb
+#define self_response_new_cb mn_pop3_mailbox_response_new_cb
+#define self_response_free_cb mn_pop3_mailbox_response_free_cb
+#define self_custom_handler_cb mn_pop3_mailbox_custom_handler_cb
+#define self_session_authenticate mn_pop3_mailbox_session_authenticate
+#define self_session_authenticate_fallback mn_pop3_mailbox_session_authenticate_fallback
+#define self_session_authenticated mn_pop3_mailbox_session_authenticated
+#define self_session_set_error_from_arguments mn_pop3_mailbox_session_set_error_from_arguments
GType
mn_pop3_mailbox_get_type (void)
{
- static GType pop3_mailbox_type = 0;
-
- if (! pop3_mailbox_type)
- {
- static const GTypeInfo pop3_mailbox_info = {
- sizeof(MNPOP3MailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_pop3_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNPOP3Mailbox),
- 0,
- (GInstanceInitFunc) mn_pop3_mailbox_init,
- };
-
- pop3_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNPOP3Mailbox",
- &pop3_mailbox_info,
- 0);
- }
-
- return pop3_mailbox_type;
-}
+ static GType type = 0;
-static void
-mn_pop3_mailbox_class_init (MNPOP3MailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNPOP3MailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_pop3_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNPOP3Mailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_pop3_mailbox_init,
+ NULL
+ };
- parent_class = g_type_class_peek_parent(class);
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNPOP3Mailbox", &info, (GTypeFlags)0);
+ }
- object_class->constructor = mn_pop3_mailbox_constructor;
- object_class->finalize = mn_pop3_mailbox_finalize;
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNPOP3Mailbox *)g_object_new(mn_pop3_mailbox_get_type(), NULL))
- mailbox_class->format = "POP3";
- mailbox_class->is = mn_pop3_mailbox_is;
- mailbox_class->check = mn_pop3_mailbox_check;
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNPOP3Mailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNPOP3Mailbox *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNPOP3Mailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNPOP3Mailbox *)g_object_new_valist (mn_pop3_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
+
static void
-mn_pop3_mailbox_init (MNPOP3Mailbox *mailbox)
+___finalize(GObject *obj_self)
{
- mailbox->priv = g_new0(MNPOP3MailboxPrivate, 1);
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::finalize"
+ MNPOP3Mailbox *self G_GNUC_UNUSED = MN_POP3_MAILBOX (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__
-static void
-mn_pop3_mailbox_finalize (GObject *object)
+static void
+mn_pop3_mailbox_init (MNPOP3Mailbox * o G_GNUC_UNUSED)
{
- MNPOP3Mailbox *pop3_mailbox = MN_POP3_MAILBOX(object);
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::init"
+ o->_priv = g_new0 (MNPOP3MailboxPrivate, 1);
+}
+#undef __GOB_FUNCTION__
+#line 107 "mn-pop3-mailbox.gob"
+static void
+mn_pop3_mailbox_class_init (MNPOP3MailboxClass * class G_GNUC_UNUSED)
+#line 238 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
+ MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
- g_free(pop3_mailbox->priv->username);
- g_free(pop3_mailbox->priv->password);
- g_free(pop3_mailbox->priv->hostname);
- g_free(pop3_mailbox->priv);
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
- G_OBJECT_CLASS(parent_class)->finalize(object);
-}
+#line 112 "mn-pop3-mailbox.gob"
+ g_object_class->constructor = ___2_mn_pop3_mailbox_constructor;
+#line 142 "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 252 "mn-pop3-mailbox.c"
+ g_object_class->finalize = ___finalize;
+ {
+#line 108 "mn-pop3-mailbox.gob"
-static GObject *
-mn_pop3_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
-{
- GObject *object;
- MNMailbox *mailbox;
- MNPOP3Mailbox *pop3_mailbox;
-
- object = G_OBJECT_CLASS(parent_class)->constructor(type,
- n_construct_properties,
- construct_params);
- mailbox = MN_MAILBOX(object);
- pop3_mailbox = MN_POP3_MAILBOX(object);
-
- if (! mn_uri_parse_pop(mn_mailbox_get_uri(mailbox),
- &pop3_mailbox->priv->username,
- &pop3_mailbox->priv->password,
- &pop3_mailbox->priv->hostname,
- &pop3_mailbox->priv->port))
- mn_mailbox_set_init_error(mailbox, _("unable to parse POP3 URI"));
+ MN_MAILBOX_CLASS(class)->format = "POP3";
- return object;
+#line 259 "mn-pop3-mailbox.c"
+ }
}
+#undef __GOB_FUNCTION__
-static void
-mn_pop3_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data)
+
+
+#line 112 "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"
+#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): \
+ ((GObject * )0))
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::constructor"
{
- char *scheme;
- gboolean is;
+#line 114 "mn-pop3-mailbox.gob"
+
+ GObject *object;
+ MNMailbox *mailbox;
+ Self *self;
- scheme = gnome_vfs_get_uri_scheme(uri);
- is = scheme && ! strcmp(scheme, "pop");
- g_free(scheme);
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ mailbox = MN_MAILBOX(object);
+ self = SELF(object);
- callback(is, user_data);
-}
+ 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"));
+#endif /* WITH_SSL */
+ }
+ else
+ mn_mailbox_set_init_error(mailbox, _("unable to parse POP3 URI"));
+
+ return object;
+ }}
+#line 305 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
-static void
-mn_pop3_mailbox_check (MNMailbox *mailbox)
+#line 142 "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"
+#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"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 321 "mn-pop3-mailbox.c"
{
- MNPOP3Mailbox *pop3_mailbox = MN_POP3_MAILBOX(mailbox);
- GConn *conn;
+#line 144 "mn-pop3-mailbox.gob"
+
+ char *scheme;
+ gboolean is;
- mn_info(_("connecting to POP3 server %s"), pop3_mailbox->priv->hostname);
+ scheme = gnome_vfs_get_uri_scheme(uri);
+ is = scheme && (! strcmp(scheme, "pop") || ! strcmp(scheme, "pops"));
+ g_free(scheme);
- pop3_mailbox->priv->state = STATE_CONNECT;
- conn = gnet_conn_new(pop3_mailbox->priv->hostname, pop3_mailbox->priv->port, mn_pop3_mailbox_conn_cb, mailbox);
- gnet_conn_connect(conn);
-}
+ return is;
+ }}
+#line 334 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
-static void
-mn_pop3_mailbox_conn_write (GConn *conn, const char *format, ...)
+#line 155 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_greeting_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 341 "mn-pop3-mailbox.c"
{
- va_list args;
- char *command;
- char *full;
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_greeting_cb"
+#line 155 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 155 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 155 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 350 "mn-pop3-mailbox.c"
+{
+#line 159 "mn-pop3-mailbox.gob"
+
+ priv->session = session;
+
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ if (response->arguments)
+ {
+ char *timestamp;
+
+ timestamp = strchr(response->arguments, '<');
+ if (timestamp)
+ {
+ char *timestamp_end;
+
+ timestamp_end = strchr(timestamp, '>');
+ if (timestamp_end)
+ priv->apop_timestamp = g_strndup(timestamp, timestamp_end - timestamp + 1);
+ }
+ }
+ return STATE_CAPA;
+
+ case RESPONSE_ERR: return RESULT_ERROR_END;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }}
+#line 379 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
- g_return_if_fail(conn != NULL);
- g_return_if_fail(format != NULL);
+#line 186 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_capa_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 385 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_capa_cb"
+#line 186 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 186 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 392 "mn-pop3-mailbox.c"
+{
+#line 189 "mn-pop3-mailbox.gob"
+
+ return mn_client_session_write(session, "CAPA");
+ }}
+#line 398 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
- va_start(args, format);
- command = g_strdup_vprintf(format, args);
- va_end(args);
+#line 193 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_capa_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 404 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_capa_cb"
+#line 193 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 193 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 193 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 413 "mn-pop3-mailbox.c"
+{
+#line 197 "mn-pop3-mailbox.gob"
+
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ priv->in_list = TRUE;
+
+ mn_pointers_free(priv->auth_mechanisms);
+ priv->auth_mechanisms = NULL;
+ priv->mailbox->_priv->login_delay = 0;
+ priv->login_delay_user = FALSE;
- mn_info("<%20-s> %s", PACKAGE, command);
- full = g_strconcat(command, "\r\n", NULL);
- g_free(command);
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+
+ case RESPONSE_ERR:
+ case RESPONSE_LIST_END:
+ priv->in_list = FALSE;
+ if (priv->authenticated)
+ return STATE_STAT;
+ else
+ return self_session_authenticate(priv);
+
+ case RESPONSE_LIST_ITEM:
+ {
+ char **tokens;
+ gboolean login_delay_error = FALSE;
+
+ tokens = g_strsplit(response->arguments, " ", 0);
+ if (tokens[0])
+ {
+ if (! strcmp(tokens[0], "SASL"))
+ {
+ int i;
+
+ for (i = 1; tokens[i]; i++)
+ priv->auth_mechanisms = g_slist_append(priv->auth_mechanisms, g_strdup(tokens[i]));
+ }
+ else if (! strcmp(tokens[0], "LOGIN-DELAY"))
+ {
+ if (tokens[1])
+ {
+ 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;
+ }
+ else
+ login_delay_error = TRUE;
+ }
+ }
+ g_strfreev(tokens);
+
+ if (login_delay_error)
+ return mn_client_session_error(session, _("invalid arguments for the LOGIN-DELAY capability"));
+ }
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+
+ default:
+ priv->in_list = FALSE;
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }}
+#line 495 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
- gnet_conn_write(conn, full, strlen(full));
- g_free(full);
-}
+#line 277 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_auth_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 501 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_auth_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 (priv != NULL, (int )0);
+#line 508 "mn-pop3-mailbox.c"
+{
+#line 280 "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->sasl_mechanism))
+ return mn_client_session_write(session, "AUTH %s", priv->sasl_mechanism);
+ else
+ return self_session_authenticate_fallback(priv, FALSE);
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }}
+#line 525 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
-static void
-mn_pop3_mailbox_conn_cb (GConn *conn, GConnEvent *event, gpointer user_data)
+#line 295 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_auth_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 531 "mn-pop3-mailbox.c"
{
- MNPOP3Mailbox *mailbox = user_data;
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_auth_cb"
+#line 295 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 295 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 295 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 540 "mn-pop3-mailbox.c"
+{
+#line 299 "mn-pop3-mailbox.gob"
+
+#ifdef WITH_SASL
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ return mn_client_session_sasl_authentication_done(session)
+ ? self_session_authenticated(priv)
+ : MN_CLIENT_SESSION_RESULT_END;
+
+ case RESPONSE_ERR:
+ return self_session_authenticate_fallback(priv, FALSE);
+
+ case RESPONSE_CONTINUATION:
+ return mn_client_session_sasl_authentication_step(session, response->arguments);
+
+ default:
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }}
+#line 565 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
- switch (event->type)
- {
- case GNET_CONN_CONNECT:
- mn_info(_("successfully connected to %s"), mailbox->priv->hostname);
- mailbox->priv->state = STATE_ACK;
- gnet_conn_readline(conn);
- break;
-
- case GNET_CONN_ERROR:
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unable to connect to server"));
- goto unref;
+#line 322 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_apop_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 571 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_apop_cb"
+#line 322 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 322 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 578 "mn-pop3-mailbox.c"
+{
+#line 325 "mn-pop3-mailbox.gob"
+
+ MNMD5Context context;
+ char buf[33];
+
+ g_return_val_if_fail(priv->apop_timestamp != NULL, 0);
+
+ 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_end(&context, buf);
- case GNET_CONN_CLOSE:
- if (! mn_mailbox_get_error(MN_MAILBOX(mailbox)))
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("connection to server unexpectedly closed"));
- goto unref;
+ return mn_client_session_write(session, "APOP %s %s", priv->mailbox->_priv->username, buf);
+ }}
+#line 594 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
- case GNET_CONN_READ:
+#line 339 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_apop_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 600 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_apop_cb"
+#line 339 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 339 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 339 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 609 "mn-pop3-mailbox.c"
+{
+#line 343 "mn-pop3-mailbox.gob"
+
+ switch (response->type)
{
- mn_info("<%20-s> %s", mailbox->priv->hostname, event->buffer);
+ case RESPONSE_OK:
+ return self_session_authenticated(priv);
+
+ case RESPONSE_ERR:
+ return self_session_authenticate_fallback(priv, TRUE);
- if (! strcmp(event->buffer, "+OK") || ! strncmp(event->buffer, "+OK ", 4))
- switch (mailbox->priv->state)
+ default:
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }}
+#line 625 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 357 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_user_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 631 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_user_cb"
+#line 357 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 357 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 638 "mn-pop3-mailbox.c"
+{
+#line 360 "mn-pop3-mailbox.gob"
+
+ return mn_client_session_write(session, "USER %s", priv->mailbox->_priv->username);
+ }}
+#line 644 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 364 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_user_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 650 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_user_cb"
+#line 364 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 364 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 364 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 659 "mn-pop3-mailbox.c"
+{
+#line 368 "mn-pop3-mailbox.gob"
+
+ switch (response->type)
+ {
+ case RESPONSE_OK: return STATE_PASS;
+ case RESPONSE_ERR: return RESULT_ERROR_QUIT;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }}
+#line 670 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 377 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_pass_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 676 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_pass_cb"
+#line 377 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 377 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 683 "mn-pop3-mailbox.c"
+{
+#line 380 "mn-pop3-mailbox.gob"
+
+ return mn_client_session_write(session, "PASS %s", priv->mailbox->_priv->password);
+ }}
+#line 689 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 384 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_pass_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 695 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_pass_cb"
+#line 384 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 384 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 384 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 704 "mn-pop3-mailbox.c"
+{
+#line 388 "mn-pop3-mailbox.gob"
+
+ switch (response->type)
+ {
+ case RESPONSE_OK: return self_session_authenticated(priv);
+ case RESPONSE_ERR: return RESULT_ERROR_QUIT;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }}
+#line 715 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 397 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_stat_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 721 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_stat_cb"
+#line 397 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 397 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 728 "mn-pop3-mailbox.c"
+{
+#line 400 "mn-pop3-mailbox.gob"
+
+ return mn_client_session_write(session, "STAT");
+ }}
+#line 734 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 404 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_stat_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 740 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_stat_cb"
+#line 404 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 404 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 404 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 749 "mn-pop3-mailbox.c"
+{
+#line 408 "mn-pop3-mailbox.gob"
+
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ {
+ int count;
+ int size;
+
+ if (response->arguments && sscanf(response->arguments, "%d %d", &count, &size) == 2)
{
- case STATE_ACK:
- mailbox->priv->state = STATE_USER;
- mn_pop3_mailbox_conn_write(conn, "USER %s", mailbox->priv->username);
- break;
-
- case STATE_USER:
- mailbox->priv->state = STATE_PASS;
- mn_pop3_mailbox_conn_write(conn, "PASS %s", mailbox->priv->password);
- break;
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_has_new(MN_MAILBOX(priv->mailbox), count != 0);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
- case STATE_PASS:
- mailbox->priv->state = STATE_STAT;
- mn_pop3_mailbox_conn_write(conn, "STAT");
- break;
-
- case STATE_STAT:
+ return STATE_QUIT;
+ }
+ else /* compliance error */
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ break;
+
+ case RESPONSE_ERR: return RESULT_ERROR_QUIT;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }}
+#line 778 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 435 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_enter_quit_cb (MNClientSession * session, MNClientSessionPrivate * priv)
+#line 784 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::enter_quit_cb"
+#line 435 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 435 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 791 "mn-pop3-mailbox.c"
+{
+#line 438 "mn-pop3-mailbox.gob"
+
+ return mn_client_session_write(session, "QUIT");
+ }}
+#line 797 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 442 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_handle_quit_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 803 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::handle_quit_cb"
+#line 442 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 442 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 442 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 812 "mn-pop3-mailbox.c"
+{
+#line 446 "mn-pop3-mailbox.gob"
+
+ switch (response->type)
+ {
+ case RESPONSE_OK: return MN_CLIENT_SESSION_RESULT_END;
+ case RESPONSE_ERR: return RESULT_ERROR_END;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }}
+#line 823 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 455 "mn-pop3-mailbox.gob"
+static void
+___13_mn_pop3_mailbox_impl_threaded_check (MNMailbox * mailbox G_GNUC_UNUSED)
+#line 829 "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"
+ g_return_if_fail (mailbox != NULL);
+#line 455 "mn-pop3-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (mailbox));
+#line 839 "mn-pop3-mailbox.c"
+{
+#line 457 "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_SASL
+ { STATE_AUTH, self_enter_auth_cb, self_handle_auth_cb },
+#endif /* WITH_SASL */
+ { 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 },
+ { STATE_STAT, self_enter_stat_cb, self_handle_stat_cb },
+ { STATE_QUIT, self_enter_quit_cb, self_handle_quit_cb },
+
+ MN_CLIENT_SESSION_STATES_END
+ };
+ MNClientSessionCallbacks callbacks = {
+ self_notice_cb,
+ self_response_new_cb,
+ self_response_free_cb,
+ self_custom_handler_cb
+ };
+ MNClientSessionPrivate priv;
+ GError *err = NULL;
+
+ if (selfp->login_delay && selfp->authentication_timer)
+ {
+ double elapsed;
+
+ g_timer_stop(selfp->authentication_timer);
+ elapsed = g_timer_elapsed(selfp->authentication_timer, NULL);
+
+ if (elapsed < selfp->login_delay)
+ {
+ int sleeptime;
+
+ sleeptime = selfp->login_delay - elapsed;
+ mn_mailbox_notice(mailbox,
+ ngettext("honouring LOGIN-DELAY, sleeping for %i second",
+ "honouring LOGIN-DELAY, sleeping for %i seconds",
+ sleeptime),
+ sleeptime);
+ sleep(sleeptime);
+ }
+ }
+
+ memset(&priv, 0, sizeof(priv));
+ priv.mailbox = self;
+
+ if (! mn_client_session_run(states,
+ &callbacks,
+#ifdef WITH_SSL
+ selfp->ssl,
+#endif
+ selfp->hostname,
+ selfp->port,
+ selfp->username,
+ selfp->password,
+ &priv,
+ &err))
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(mailbox, "%s", err->message);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ g_error_free(err);
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(mailbox);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ g_free(priv.apop_timestamp);
+ mn_pointers_free(priv.auth_mechanisms);
+ }}
+#line 918 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 534 "mn-pop3-mailbox.gob"
+static void
+mn_pop3_mailbox_notice_cb (MNClientSession * session, const char * str, MNClientSessionPrivate * priv)
+#line 925 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::notice_cb"
+#line 534 "mn-pop3-mailbox.gob"
+ g_return_if_fail (session != NULL);
+#line 534 "mn-pop3-mailbox.gob"
+ g_return_if_fail (str != NULL);
+#line 534 "mn-pop3-mailbox.gob"
+ g_return_if_fail (priv != NULL);
+#line 934 "mn-pop3-mailbox.c"
+{
+#line 538 "mn-pop3-mailbox.gob"
+
+ mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ }}
+#line 940 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 542 "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"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::response_new_cb"
+#line 542 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (MNClientSessionResponse * )0);
+#line 542 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (input != NULL, (MNClientSessionResponse * )0);
+#line 542 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (MNClientSessionResponse * )0);
+#line 955 "mn-pop3-mailbox.c"
+{
+#line 546 "mn-pop3-mailbox.gob"
+
+ MNClientSessionResponse *response = NULL;
+
+ if (priv->in_list)
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ if (! strcmp(input, "."))
+ response->type = RESPONSE_LIST_END;
+ else if (! strncmp(input, "..", 2))
+ {
+ response->type = RESPONSE_LIST_ITEM;
+ response->arguments = g_strdup(input + 1); /* skip the initial dot */
+ }
+ else
+ {
+ response->type = RESPONSE_LIST_ITEM;
+ response->arguments = g_strdup(input);
+ }
+ }
+ else
+ {
+ if (! strncmp(input, "+ ", 2))
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->type = RESPONSE_CONTINUATION;
+ response->arguments = g_strdup(input + 2);
+ }
+ else
+ {
+ ResponseType type;
+ int after_status = 0;
+
+ if (! strncmp(input, "+OK", 3))
{
- char ok[4];
- int count;
- int size;
-
- if (sscanf(event->buffer, "%3s %d %d", ok, &count, &size) == 3)
- {
- mn_mailbox_set_has_new(MN_MAILBOX(mailbox), count != 0);
- mailbox->priv->state = STATE_QUIT;
- mn_pop3_mailbox_conn_write(conn, "QUIT");
- }
- else
+ type = RESPONSE_OK;
+ after_status = 3;
+ }
+ else if (! strncmp(input, "-ERR", 4))
+ {
+ type = RESPONSE_ERR;
+ after_status = 4;
+ }
+
+ if (after_status)
+ {
+ if (input[after_status] == 0 || input[after_status] == ' ')
{
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("invalid STAT reply \"%s\""), event->buffer);
- /* the server is uncompliant, we do not send a QUIT */
- goto unref;
+ response = g_new0(MNClientSessionResponse, 1);
+ response->type = type;
+ if (input[after_status] == ' ')
+ response->arguments = g_strdup(input + after_status + 1);
}
}
- break;
-
- case STATE_QUIT:
- goto unref;
- break;
-
- default:
- g_return_if_reached();
- }
- else if (! strcmp(event->buffer, "-ERR") || ! strncmp(event->buffer, "-ERR ", 5))
+ }
+ }
+
+ return response;
+ }}
+#line 1016 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 605 "mn-pop3-mailbox.gob"
+static void
+mn_pop3_mailbox_response_free_cb (MNClientSession * session, MNClientSessionResponse * response, MNClientSessionPrivate * priv)
+#line 1022 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::response_free_cb"
+#line 605 "mn-pop3-mailbox.gob"
+ g_return_if_fail (session != NULL);
+#line 605 "mn-pop3-mailbox.gob"
+ g_return_if_fail (response != NULL);
+#line 605 "mn-pop3-mailbox.gob"
+ g_return_if_fail (priv != NULL);
+#line 1031 "mn-pop3-mailbox.c"
+{
+#line 609 "mn-pop3-mailbox.gob"
+
+ g_free(response->arguments);
+ g_free(response);
+ }}
+#line 1038 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 614 "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"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::custom_handler_cb"
+#line 614 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (session != NULL, (int )0);
+#line 614 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (response != NULL, (int )0);
+#line 614 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 1053 "mn-pop3-mailbox.c"
+{
+#line 619 "mn-pop3-mailbox.gob"
+
+ switch (result)
+ {
+ case RESULT_ERROR_QUIT:
+ self_session_set_error_from_arguments(priv, response);
+ return STATE_QUIT;
+
+ case RESULT_ERROR_END:
+ self_session_set_error_from_arguments(priv, response);
+ return MN_CLIENT_SESSION_RESULT_END;
+
+ default:
+ g_return_val_if_reached(0);
+ }
+ }}
+#line 1071 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 635 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_session_authenticate (MNClientSessionPrivate * priv)
+#line 1077 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_authenticate"
+#line 635 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 1082 "mn-pop3-mailbox.c"
+{
+#line 637 "mn-pop3-mailbox.gob"
+
+ if (priv->mailbox->_priv->authmech)
+ {
+ if (*priv->mailbox->_priv->authmech != '+')
+ {
+#ifdef WITH_SASL
+ return STATE_AUTH;
+#else
+ return mn_client_session_error(priv->session, _("a SASL authentication mechanism was selected but SASL support has not been compiled in"));
+#endif /* WITH_SASL */
+ }
+ else
{
- if (event->buffer[4])
- mn_mailbox_set_error(MN_MAILBOX(mailbox), "\"%s\"", event->buffer + 5);
+ if (! strcmp(priv->mailbox->_priv->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"))
+ return STATE_USER;
else
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("unknown error"));
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ }
+ }
+ else
+ {
+#ifdef WITH_SASL
+ if (priv->auth_mechanisms)
+ return STATE_AUTH;
+#endif /* WITH_SASL */
+ if (priv->apop_timestamp)
+ return STATE_APOP;
+ else
+ return STATE_USER;
+ }
+ }}
+#line 1120 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
- switch (mailbox->priv->state)
- {
- case STATE_ACK:
- case STATE_QUIT:
- goto unref;
-
- case STATE_USER:
- case STATE_PASS:
- case STATE_STAT:
- mailbox->priv->state = STATE_QUIT;
- mn_pop3_mailbox_conn_write(conn, "QUIT");
- break;
-
- default:
- g_return_if_reached();
- }
+#line 673 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_session_authenticate_fallback (MNClientSessionPrivate * priv, gboolean tried_apop)
+#line 1126 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_authenticate_fallback"
+#line 673 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 1131 "mn-pop3-mailbox.c"
+{
+#line 676 "mn-pop3-mailbox.gob"
+
+ if (! priv->mailbox->_priv->authmech)
+ {
+ if (! tried_apop && priv->apop_timestamp)
+ {
+ mn_client_session_notice(priv->session, _("falling back to APOP authentication"));
+ return STATE_APOP;
}
else
{
- mn_mailbox_set_error(MN_MAILBOX(mailbox), _("invalid reply \"%s\""), event->buffer);
- /* the server is uncompliant, we do not send a QUIT */
- goto unref;
+ mn_client_session_notice(priv->session, _("falling back to USER/PASS authentication"));
+ return STATE_USER;
}
}
- break;
- case GNET_CONN_WRITE:
- switch (mailbox->priv->state)
- {
- case STATE_USER:
- case STATE_PASS:
- case STATE_STAT:
- case STATE_QUIT:
- gnet_conn_readline(conn);
- break;
-
- default:
- g_return_if_reached();
- }
- break;
-
- default:
- /* nop */
- break;
- }
- return;
-
- unref:
- gnet_conn_unref(conn);
- mn_mailbox_end_check(MN_MAILBOX(mailbox));
-}
+ return mn_client_session_error(priv->session, _("authentication failed"));
+ }}
+#line 1151 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 694 "mn-pop3-mailbox.gob"
+static int
+mn_pop3_mailbox_session_authenticated (MNClientSessionPrivate * priv)
+#line 1157 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_authenticated"
+#line 694 "mn-pop3-mailbox.gob"
+ g_return_val_if_fail (priv != NULL, (int )0);
+#line 1162 "mn-pop3-mailbox.c"
+{
+#line 696 "mn-pop3-mailbox.gob"
+
+ priv->authenticated = TRUE;
+ if (priv->mailbox->_priv->login_delay)
+ {
+ if (priv->mailbox->_priv->authentication_timer)
+ g_timer_start(priv->mailbox->_priv->authentication_timer);
+ else
+ priv->mailbox->_priv->authentication_timer = g_timer_new();
+ }
+ return priv->login_delay_user ? STATE_CAPA : STATE_STAT;
+ }}
+#line 1176 "mn-pop3-mailbox.c"
+#undef __GOB_FUNCTION__
+
+#line 708 "mn-pop3-mailbox.gob"
+static void
+mn_pop3_mailbox_session_set_error_from_arguments (MNClientSessionPrivate * priv, MNClientSessionResponse * response)
+#line 1182 "mn-pop3-mailbox.c"
+{
+#define __GOB_FUNCTION__ "MN:POP3:Mailbox::session_set_error_from_arguments"
+#line 708 "mn-pop3-mailbox.gob"
+ g_return_if_fail (priv != NULL);
+#line 708 "mn-pop3-mailbox.gob"
+ g_return_if_fail (response != NULL);
+#line 1189 "mn-pop3-mailbox.c"
+{
+#line 711 "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"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-pop3-mailbox.gob b/src/mn-pop3-mailbox.gob
@@ -0,0 +1,717 @@
+/*
+ * mn-pop3-mailbox.gob - POP3 support for Mail Notification
+ *
+ * Compliance:
+ *
+ * - RFC 1939
+ * - RFC 2449
+ * - RFC 1734
+ *
+ * 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.
+ */
+
+%headertop{
+#include "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <glib/gi18n-lib.h>
+#include <libgnomevfs/gnome-vfs-utils.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_SASL
+ STATE_AUTH,
+#endif /* WITH_SASL */
+ STATE_APOP,
+ STATE_USER,
+ STATE_PASS,
+ STATE_STAT,
+ STATE_QUIT
+ };
+
+ enum
+ {
+ RESULT_ERROR_QUIT = -1, /* server reported an error, quit normally */
+ RESULT_ERROR_END = -2 /* server reported an error, close the connection */
+ };
+
+ struct _MNClientSessionPrivate
+ {
+ MNPOP3Mailbox *mailbox;
+ MNClientSession *session;
+ gboolean in_list;
+ char *apop_timestamp;
+ GSList *auth_mechanisms;
+#ifdef WITH_SASL
+ const char *sasl_mechanism;
+#endif /* WITH_SASL */
+ gboolean authenticated;
+ gboolean login_delay_user;
+ };
+
+ typedef enum
+ {
+ RESPONSE_OK,
+ RESPONSE_ERR,
+ RESPONSE_LIST_ITEM,
+ RESPONSE_LIST_END,
+ RESPONSE_CONTINUATION
+ } ResponseType;
+
+ struct _MNClientSessionResponse
+ {
+ ResponseType type;
+ char *arguments;
+ };
+%}
+
+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;
+
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->format = "POP3";
+ }
+
+ override (G:Object) GObject *
+ 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);
+
+ 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"));
+#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))
+ {
+ char *scheme;
+ gboolean is;
+
+ scheme = gnome_vfs_get_uri_scheme(uri);
+ is = scheme && (! strcmp(scheme, "pop") || ! strcmp(scheme, "pops"));
+ g_free(scheme);
+
+ return is;
+ }
+
+ private int
+ handle_greeting_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ priv->session = session;
+
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ if (response->arguments)
+ {
+ char *timestamp;
+
+ timestamp = strchr(response->arguments, '<');
+ if (timestamp)
+ {
+ char *timestamp_end;
+
+ timestamp_end = strchr(timestamp, '>');
+ if (timestamp_end)
+ priv->apop_timestamp = g_strndup(timestamp, timestamp_end - timestamp + 1);
+ }
+ }
+ return STATE_CAPA;
+
+ case RESPONSE_ERR: return RESULT_ERROR_END;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ private int
+ enter_capa_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return mn_client_session_write(session, "CAPA");
+ }
+
+ private int
+ handle_capa_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ priv->in_list = TRUE;
+
+ mn_pointers_free(priv->auth_mechanisms);
+ priv->auth_mechanisms = NULL;
+ priv->mailbox->_priv->login_delay = 0;
+ priv->login_delay_user = FALSE;
+
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+
+ case RESPONSE_ERR:
+ case RESPONSE_LIST_END:
+ priv->in_list = FALSE;
+ if (priv->authenticated)
+ return STATE_STAT;
+ else
+ return self_session_authenticate(priv);
+
+ case RESPONSE_LIST_ITEM:
+ {
+ char **tokens;
+ gboolean login_delay_error = FALSE;
+
+ tokens = g_strsplit(response->arguments, " ", 0);
+ if (tokens[0])
+ {
+ if (! strcmp(tokens[0], "SASL"))
+ {
+ int i;
+
+ for (i = 1; tokens[i]; i++)
+ priv->auth_mechanisms = g_slist_append(priv->auth_mechanisms, g_strdup(tokens[i]));
+ }
+ else if (! strcmp(tokens[0], "LOGIN-DELAY"))
+ {
+ if (tokens[1])
+ {
+ 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;
+ }
+ else
+ login_delay_error = TRUE;
+ }
+ }
+ g_strfreev(tokens);
+
+ if (login_delay_error)
+ return mn_client_session_error(session, _("invalid arguments for the LOGIN-DELAY capability"));
+ }
+ return MN_CLIENT_SESSION_RESULT_CONTINUE;
+
+ default:
+ priv->in_list = FALSE;
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ private int
+ enter_auth_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SASL
+ if (mn_client_session_sasl_authentication_start(priv->session,
+ "pop",
+ priv->auth_mechanisms,
+ priv->mailbox->_priv->authmech,
+ &priv->sasl_mechanism))
+ return mn_client_session_write(session, "AUTH %s", priv->sasl_mechanism);
+ else
+ return self_session_authenticate_fallback(priv, FALSE);
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }
+
+ private int
+ handle_auth_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+#ifdef WITH_SASL
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ return mn_client_session_sasl_authentication_done(session)
+ ? self_session_authenticated(priv)
+ : MN_CLIENT_SESSION_RESULT_END;
+
+ case RESPONSE_ERR:
+ return self_session_authenticate_fallback(priv, FALSE);
+
+ case RESPONSE_CONTINUATION:
+ return mn_client_session_sasl_authentication_step(session, response->arguments);
+
+ default:
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+#else
+ g_return_val_if_reached(0);
+#endif /* WITH_SASL */
+ }
+
+ private int
+ enter_apop_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ MNMD5Context context;
+ char buf[33];
+
+ g_return_val_if_fail(priv->apop_timestamp != NULL, 0);
+
+ 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_end(&context, buf);
+
+ return mn_client_session_write(session, "APOP %s %s", priv->mailbox->_priv->username, buf);
+ }
+
+ private int
+ handle_apop_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ return self_session_authenticated(priv);
+
+ case RESPONSE_ERR:
+ return self_session_authenticate_fallback(priv, TRUE);
+
+ default:
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ private int
+ enter_user_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return mn_client_session_write(session, "USER %s", priv->mailbox->_priv->username);
+ }
+
+ private int
+ handle_user_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (response->type)
+ {
+ case RESPONSE_OK: return STATE_PASS;
+ case RESPONSE_ERR: return RESULT_ERROR_QUIT;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ private int
+ enter_pass_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return mn_client_session_write(session, "PASS %s", priv->mailbox->_priv->password);
+ }
+
+ private int
+ handle_pass_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (response->type)
+ {
+ case RESPONSE_OK: return self_session_authenticated(priv);
+ case RESPONSE_ERR: return RESULT_ERROR_QUIT;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ private int
+ enter_stat_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return mn_client_session_write(session, "STAT");
+ }
+
+ private int
+ handle_stat_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (response->type)
+ {
+ case RESPONSE_OK:
+ {
+ int count;
+ int size;
+
+ 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);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ return STATE_QUIT;
+ }
+ else /* compliance error */
+ return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ break;
+
+ case RESPONSE_ERR: return RESULT_ERROR_QUIT;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ private int
+ enter_quit_cb (MNClientSession *session (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ return mn_client_session_write(session, "QUIT");
+ }
+
+ private int
+ handle_quit_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (response->type)
+ {
+ case RESPONSE_OK: return MN_CLIENT_SESSION_RESULT_END;
+ case RESPONSE_ERR: return RESULT_ERROR_END;
+ default: return MN_CLIENT_SESSION_RESULT_BAD_RESPONSE_FOR_CONTEXT;
+ }
+ }
+
+ override (MN:Mailbox) void
+ impl_threaded_check (MN:Mailbox *mailbox (check null type))
+ {
+ 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_SASL
+ { STATE_AUTH, self_enter_auth_cb, self_handle_auth_cb },
+#endif /* WITH_SASL */
+ { 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 },
+ { STATE_STAT, self_enter_stat_cb, self_handle_stat_cb },
+ { STATE_QUIT, self_enter_quit_cb, self_handle_quit_cb },
+
+ MN_CLIENT_SESSION_STATES_END
+ };
+ MNClientSessionCallbacks callbacks = {
+ self_notice_cb,
+ self_response_new_cb,
+ self_response_free_cb,
+ self_custom_handler_cb
+ };
+ MNClientSessionPrivate priv;
+ GError *err = NULL;
+
+ if (selfp->login_delay && selfp->authentication_timer)
+ {
+ double elapsed;
+
+ g_timer_stop(selfp->authentication_timer);
+ elapsed = g_timer_elapsed(selfp->authentication_timer, NULL);
+
+ if (elapsed < selfp->login_delay)
+ {
+ int sleeptime;
+
+ sleeptime = selfp->login_delay - elapsed;
+ mn_mailbox_notice(mailbox,
+ ngettext("honouring LOGIN-DELAY, sleeping for %i second",
+ "honouring LOGIN-DELAY, sleeping for %i seconds",
+ sleeptime),
+ sleeptime);
+ sleep(sleeptime);
+ }
+ }
+
+ memset(&priv, 0, sizeof(priv));
+ priv.mailbox = self;
+
+ if (! mn_client_session_run(states,
+ &callbacks,
+#ifdef WITH_SSL
+ selfp->ssl,
+#endif
+ selfp->hostname,
+ selfp->port,
+ selfp->username,
+ selfp->password,
+ &priv,
+ &err))
+ {
+ GDK_THREADS_ENTER();
+ mn_mailbox_set_error(mailbox, "%s", err->message);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ g_error_free(err);
+ }
+
+ GDK_THREADS_ENTER();
+ mn_mailbox_end_check(mailbox);
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ g_free(priv.apop_timestamp);
+ mn_pointers_free(priv.auth_mechanisms);
+ }
+
+ private void
+ notice_cb (MNClientSession *session (check null),
+ const char *str (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ mn_mailbox_notice(MN_MAILBOX(priv->mailbox), "%s", str);
+ }
+
+ private MNClientSessionResponse *
+ response_new_cb (MNClientSession *session (check null),
+ const char *input (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ MNClientSessionResponse *response = NULL;
+
+ if (priv->in_list)
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ if (! strcmp(input, "."))
+ response->type = RESPONSE_LIST_END;
+ else if (! strncmp(input, "..", 2))
+ {
+ response->type = RESPONSE_LIST_ITEM;
+ response->arguments = g_strdup(input + 1); /* skip the initial dot */
+ }
+ else
+ {
+ response->type = RESPONSE_LIST_ITEM;
+ response->arguments = g_strdup(input);
+ }
+ }
+ else
+ {
+ if (! strncmp(input, "+ ", 2))
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->type = RESPONSE_CONTINUATION;
+ response->arguments = g_strdup(input + 2);
+ }
+ else
+ {
+ ResponseType type;
+ int after_status = 0;
+
+ if (! strncmp(input, "+OK", 3))
+ {
+ type = RESPONSE_OK;
+ after_status = 3;
+ }
+ else if (! strncmp(input, "-ERR", 4))
+ {
+ type = RESPONSE_ERR;
+ after_status = 4;
+ }
+
+ if (after_status)
+ {
+ if (input[after_status] == 0 || input[after_status] == ' ')
+ {
+ response = g_new0(MNClientSessionResponse, 1);
+ response->type = type;
+ if (input[after_status] == ' ')
+ response->arguments = g_strdup(input + after_status + 1);
+ }
+ }
+ }
+ }
+
+ return response;
+ }
+
+ private void
+ response_free_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ MNClientSessionPrivate *priv (check null))
+ {
+ g_free(response->arguments);
+ g_free(response);
+ }
+
+ private int
+ custom_handler_cb (MNClientSession *session (check null),
+ MNClientSessionResponse *response (check null),
+ int result,
+ MNClientSessionPrivate *priv (check null))
+ {
+ switch (result)
+ {
+ case RESULT_ERROR_QUIT:
+ self_session_set_error_from_arguments(priv, response);
+ return STATE_QUIT;
+
+ case RESULT_ERROR_END:
+ self_session_set_error_from_arguments(priv, response);
+ return MN_CLIENT_SESSION_RESULT_END;
+
+ default:
+ g_return_val_if_reached(0);
+ }
+ }
+
+ private int
+ session_authenticate (MNClientSessionPrivate *priv (check null))
+ {
+ if (priv->mailbox->_priv->authmech)
+ {
+ if (*priv->mailbox->_priv->authmech != '+')
+ {
+#ifdef WITH_SASL
+ return STATE_AUTH;
+#else
+ return mn_client_session_error(priv->session, _("a SASL authentication mechanism was selected but SASL support has not been compiled in"));
+#endif /* WITH_SASL */
+ }
+ else
+ {
+ if (! strcmp(priv->mailbox->_priv->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"))
+ return STATE_USER;
+ else
+ return mn_client_session_error(priv->session, _("unknown authentication mechanism \"%s\""), priv->mailbox->_priv->authmech);
+ }
+ }
+ else
+ {
+#ifdef WITH_SASL
+ if (priv->auth_mechanisms)
+ return STATE_AUTH;
+#endif /* WITH_SASL */
+ if (priv->apop_timestamp)
+ return STATE_APOP;
+ else
+ return STATE_USER;
+ }
+ }
+
+ private int
+ session_authenticate_fallback (MNClientSessionPrivate *priv (check null),
+ gboolean tried_apop)
+ {
+ if (! priv->mailbox->_priv->authmech)
+ {
+ if (! tried_apop && priv->apop_timestamp)
+ {
+ mn_client_session_notice(priv->session, _("falling back to APOP authentication"));
+ return STATE_APOP;
+ }
+ else
+ {
+ mn_client_session_notice(priv->session, _("falling back to USER/PASS authentication"));
+ return STATE_USER;
+ }
+ }
+
+ return mn_client_session_error(priv->session, _("authentication failed"));
+ }
+
+ private int
+ session_authenticated (MNClientSessionPrivate *priv (check null))
+ {
+ priv->authenticated = TRUE;
+ if (priv->mailbox->_priv->login_delay)
+ {
+ if (priv->mailbox->_priv->authentication_timer)
+ g_timer_start(priv->mailbox->_priv->authentication_timer);
+ else
+ priv->mailbox->_priv->authentication_timer = g_timer_new();
+ }
+ return priv->login_delay_user ? STATE_CAPA : STATE_STAT;
+ }
+
+ private void
+ session_set_error_from_arguments (MNClientSessionPrivate *priv (check null),
+ MNClientSessionResponse *response (check null))
+ {
+ if (response->arguments)
+ mn_client_session_error(priv->session, "\"%s\"", response->arguments);
+ else
+ mn_client_session_error(priv->session, _("unknown server error"));
+ }
+}
diff --git a/src/mn-pop3-mailbox.h b/src/mn-pop3-mailbox.h
@@ -1,48 +1,62 @@
-/*
- * 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.
- */
-
-#ifndef _MN_POP3_MAILBOX_H
-#define _MN_POP3_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_POP3_MAILBOX (mn_pop3_mailbox_get_type())
-#define MN_POP3_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_POP3_MAILBOX, MNPOP3Mailbox))
-#define MN_POP3_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_POP3_MAILBOX, MNPOP3MailboxClass))
-#define MN_IS_POP3_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_POP3_MAILBOX))
-#define MN_IS_POP3_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_POP3_MAILBOX))
-#define MN_POP3_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_POP3_MAILBOX, MNPOP3MailboxClass))
+#ifndef __MN_POP3_MAILBOX_H__
+#define __MN_POP3_MAILBOX_H__
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_POP3_MAILBOX (mn_pop3_mailbox_get_type())
+#define MN_POP3_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pop3_mailbox_get_type(), MNPOP3Mailbox)
+#define MN_POP3_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_pop3_mailbox_get_type(), MNPOP3Mailbox const)
+#define MN_POP3_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_pop3_mailbox_get_type(), MNPOP3MailboxClass)
+#define MN_IS_POP3_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_pop3_mailbox_get_type ())
+
+#define MN_POP3_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_pop3_mailbox_get_type(), MNPOP3MailboxClass)
+
+/* Private structure type */
typedef struct _MNPOP3MailboxPrivate MNPOP3MailboxPrivate;
-typedef struct
-{
- MNMailbox mailbox;
-
- MNPOP3MailboxPrivate *priv;
-} MNPOP3Mailbox;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_POP3_MAILBOX__
+#define __TYPEDEF_MN_POP3_MAILBOX__
+typedef struct _MNPOP3Mailbox MNPOP3Mailbox;
+#endif
+struct _MNPOP3Mailbox {
+ MNMailbox __parent__;
+ /*< private >*/
+ MNPOP3MailboxPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNPOP3MailboxClass MNPOP3MailboxClass;
+struct _MNPOP3MailboxClass {
+ MNMailboxClass __parent__;
+};
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNPOP3MailboxClass;
+/*
+ * Public methods
+ */
GType mn_pop3_mailbox_get_type (void);
-#endif /* _MN_POP3_MAILBOX_H */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-preferences.c b/src/mn-preferences.c
@@ -1,824 +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 <glib/gi18n-lib.h>
-#include <gtk/gtk.h>
-#include "mn-conf.h"
-#include "mn-dialog.h"
-#include "mn-mailboxes.h"
-#include "mn-preferences.h"
-#include "mn-util.h"
-#include "mn-stock.h"
-#include "mn-unsupported-mailbox.h"
-#include "mn-pending-mailbox.h"
-#include "mn-mailbox-properties-dialog.h"
-#include "mn-uri.h"
-
-/*** cpp *********************************************************************/
-
-#define GNOME_COPIED_FILES "x-special/gnome-copied-files"
-
-/*** types *******************************************************************/
-
-enum {
- COLUMN_URI,
- COLUMN_MAILBOX_ICON,
- COLUMN_MAILBOX,
- COLUMN_FORMAT,
- N_COLUMNS
-};
-
-typedef struct
-{
- GtkWidget *dialog;
-
- GtkWidget *delay_label;
- GtkWidget *minutes_spin;
- GtkWidget *seconds_spin;
-
- GtkWidget *scrolled;
- GtkWidget *list;
- GtkWidget *selected_label;
- GtkWidget *remove;
- GtkWidget *properties;
-
- GtkWidget *command_new_mail_check;
- GtkWidget *command_new_mail_entry;
- GtkWidget *command_clicked_check;
- GtkWidget *command_clicked_entry;
-
- GtkWidget *mailbox_menu;
- GtkWidget *remove_item;
- GtkWidget *cut_item;
- GtkWidget *copy_item;
- GtkWidget *paste_item;
- GtkWidget *properties_item;
- GtkListStore *store;
-} PreferencesDialog;
-
-/*** variables ***************************************************************/
-
-static GtkClipboard *clipboard = NULL;
-static GdkAtom gnome_copied_files_atom;
-
-static PreferencesDialog preferences = { NULL };
-static GtkWidget *add_mailbox = NULL;
-
-/*** functions ***************************************************************/
-
-static void mn_preferences_update_iter (GtkTreeIter *iter, MNMailbox *mailbox);
-static gboolean mn_preferences_has_mailbox (MNMailbox *mailbox);
-
-static void mn_preferences_update_selected_label (void);
-static void mn_preferences_update_sensitivity (void);
-
-static void mn_preferences_add_mailbox (void);
-
-static void mn_preferences_remove_mailbox (void);
-static void mn_preferences_remove_mailbox_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data);
-
-static void mn_preferences_cut_mailbox (void);
-
-static void mn_preferences_copy_mailbox (void);
-static void mn_preferences_copy_mailbox_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data);
-
-static void mn_preferences_get_clipboard_cb (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- unsigned int info,
- gpointer user_data_or_owner);
-static void mn_preferences_clear_clipboard_cb (GtkClipboard *clipboard,
- gpointer user_data_or_owner);
-
-static void mn_preferences_paste_mailbox (void);
-static void mn_preferences_paste_mailbox_receive_cb (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- gpointer data);
-
-static void mn_preferences_edit_mailbox (void);
-static void mn_preferences_edit_mailbox_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data);
-
-static void mn_preferences_selection_changed_h (GtkTreeSelection *selection,
- gpointer user_data);
-static void mn_preferences_mailbox_properties_response_h (GtkDialog *dialog,
- int response,
- gpointer user_data);
-
-static void mn_preferences_popup_mailbox_menu (unsigned int button,
- guint32 activate_time);
-static void mn_preferences_popup_mailbox_menu_receive_cb (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- gpointer data);
-
-/*** implementation **********************************************************/
-
-void
-mn_preferences_display (void)
-{
- GtkAccelGroup *accel_group;
- GtkSizeGroup *size_group;
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
- GtkTreeSelection *selection;
-
- if (! clipboard)
- {
- clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
- gnome_copied_files_atom = gdk_atom_intern(GNOME_COPIED_FILES, FALSE);
- }
-
- if (preferences.dialog)
- {
- gtk_window_present(GTK_WINDOW(preferences.dialog));
- return;
- }
-
- mn_create_interface("preferences",
- "dialog", &preferences.dialog,
- "delay_label", &preferences.delay_label,
- "minutes_spin", &preferences.minutes_spin,
- "seconds_spin", &preferences.seconds_spin,
- "scrolled", &preferences.scrolled,
- "list", &preferences.list,
- "selected_label", &preferences.selected_label,
- "remove", &preferences.remove,
- "properties", &preferences.properties,
- "command_new_mail_check", &preferences.command_new_mail_check,
- "command_new_mail_entry", &preferences.command_new_mail_entry,
- "command_clicked_check", &preferences.command_clicked_check,
- "command_clicked_entry", &preferences.command_clicked_entry,
- "mailbox_menu", &preferences.mailbox_menu,
- "remove_item", &preferences.remove_item,
- "cut_item", &preferences.cut_item,
- "copy_item", &preferences.copy_item,
- "paste_item", &preferences.paste_item,
- "properties_item", &preferences.properties_item,
- NULL);
-
- accel_group = gtk_menu_get_accel_group(GTK_MENU(preferences.mailbox_menu));
- gtk_window_add_accel_group(GTK_WINDOW(preferences.dialog), accel_group);
-
- /* finish the mailboxes list */
-
- preferences.store = gtk_list_store_new(N_COLUMNS,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING);
- gtk_tree_view_set_model(GTK_TREE_VIEW(preferences.list), GTK_TREE_MODEL(preferences.store));
-
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(column, _("Mailbox"));
- gtk_tree_view_column_set_resizable(column, TRUE);
- gtk_tree_view_column_set_sort_column_id(column, COLUMN_MAILBOX);
-
- renderer = gtk_cell_renderer_pixbuf_new();
- gtk_tree_view_column_pack_start(column, renderer, FALSE);
- gtk_tree_view_column_add_attribute(column, renderer, "stock-id", COLUMN_MAILBOX_ICON);
-
- renderer = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, renderer, TRUE);
- gtk_tree_view_column_add_attribute(column, renderer, "text", COLUMN_MAILBOX);
-
- gtk_tree_view_append_column(GTK_TREE_VIEW(preferences.list), column);
-
- column = gtk_tree_view_column_new_with_attributes(_("Format"),
- gtk_cell_renderer_text_new(),
- "text", COLUMN_FORMAT,
- NULL);
-
- gtk_tree_view_column_set_resizable(column, TRUE);
- gtk_tree_view_column_set_sort_column_id(column, COLUMN_FORMAT);
- gtk_tree_view_append_column(GTK_TREE_VIEW(preferences.list), column);
-
- gtk_tree_view_set_search_column(GTK_TREE_VIEW(preferences.list), COLUMN_MAILBOX);
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(preferences.list));
- gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
- g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(mn_preferences_selection_changed_h), NULL);
-
- mn_setup_dnd(preferences.scrolled);
-
- /* create the GtkSizeGroup */
-
- size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget(size_group, preferences.delay_label);
- gtk_size_group_add_widget(size_group, preferences.command_new_mail_check);
- gtk_size_group_add_widget(size_group, preferences.command_clicked_check);
- g_object_unref(size_group);
-
- mn_conf_link(preferences.dialog, MN_CONF_PREFERENCES_DIALOG,
- preferences.minutes_spin, MN_CONF_DELAY_MINUTES,
- preferences.seconds_spin, MN_CONF_DELAY_SECONDS,
- preferences.command_new_mail_check, MN_CONF_COMMANDS_NEW_MAIL_ENABLED,
- preferences.command_new_mail_entry, MN_CONF_COMMANDS_NEW_MAIL_COMMAND,
- preferences.command_clicked_check, MN_CONF_COMMANDS_CLICKED_ENABLED,
- preferences.command_clicked_entry, MN_CONF_COMMANDS_CLICKED_COMMAND,
- NULL);
-
- mn_preferences_update_list();
- mn_preferences_update_selected_label();
- mn_preferences_update_sensitivity();
-
- gtk_widget_show(preferences.dialog);
-}
-
-void
-mn_preferences_update_list (void)
-{
- if (preferences.dialog)
- {
- GtkTreeIter iter;
- gboolean valid;
- MNMailbox *mailbox;
- GSList *l;
-
- /* first step: remove or update old mailboxes */
-
- valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(preferences.store), &iter);
- while (valid)
- {
- char *uri;
-
- gtk_tree_model_get(GTK_TREE_MODEL(preferences.store), &iter, COLUMN_URI, &uri, -1);
- mailbox = mn_mailboxes_find(uri);
- g_free(uri);
-
- if (mailbox)
- {
- mn_preferences_update_iter(&iter, mailbox);
- valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(preferences.store), &iter);
- }
- else
- valid = gtk_list_store_remove(preferences.store, &iter);
- }
-
- /* second step: add new mailboxes */
-
- MN_LIST_FOREACH(l, mn_mailboxes_get())
- {
- mailbox = l->data;
-
- if (! mn_preferences_has_mailbox(mailbox))
- {
- gtk_list_store_append(preferences.store, &iter);
- mn_preferences_update_iter(&iter, mailbox);
- }
- }
- }
-}
-
-static void
-mn_preferences_update_iter (GtkTreeIter *iter, MNMailbox *mailbox)
-{
- MNMailboxClass *class;
- const char *uri;
- const char *stock_id;
-
- g_return_if_fail(iter != NULL);
- g_return_if_fail(MN_IS_MAILBOX(mailbox));
-
- class = MN_MAILBOX_GET_CLASS(mailbox);
- uri = mn_mailbox_get_uri(mailbox);
-
- if (class->stock_id)
- stock_id = class->stock_id;
- else
- stock_id = mn_uri_is_local(uri) ? MN_STOCK_LOCAL : MN_STOCK_REMOTE;
-
- gtk_list_store_set(preferences.store, iter,
- COLUMN_URI, uri,
- COLUMN_MAILBOX_ICON, stock_id,
- COLUMN_MAILBOX, mn_mailbox_get_name(mailbox),
- COLUMN_FORMAT, class->format,
- -1);
-}
-
-static gboolean
-mn_preferences_has_mailbox (MNMailbox *mailbox)
-{
- const char *uri;
- GtkTreeIter iter;
- gboolean valid;
- gboolean has = FALSE;
-
- g_return_val_if_fail(MN_IS_MAILBOX(mailbox), FALSE);
-
- uri = mn_mailbox_get_uri(mailbox);
-
- valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(preferences.store), &iter);
- while (valid)
- {
- char *this_uri;
-
- gtk_tree_model_get(GTK_TREE_MODEL(preferences.store), &iter, COLUMN_URI, &this_uri, -1);
- has = ! mn_uri_cmp(this_uri, uri);
- g_free(this_uri);
-
- if (has)
- break;
-
- valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(preferences.store), &iter);
- }
-
- return has;
-}
-
-static void
-mn_preferences_update_selected_label (void)
-{
- GtkTreeSelection *selection;
- int n_rows;
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(preferences.list));
- n_rows = gtk_tree_selection_count_selected_rows(selection);
-
- if (n_rows == 0)
- gtk_label_set_text(GTK_LABEL(preferences.selected_label), _("No mailbox selected."));
- else
- {
- char *str;
-
- str = g_strdup_printf(ngettext("%i mailbox selected.",
- "%i mailboxes selected.",
- n_rows), n_rows);
- gtk_label_set_text(GTK_LABEL(preferences.selected_label), str);
- g_free(str);
- }
-}
-
-static void
-mn_preferences_update_sensitivity (void)
-{
- GtkTreeSelection *selection;
- gboolean has_selection;
- gboolean command_new_mail_enabled;
- gboolean command_clicked_enabled;
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(preferences.list));
- has_selection = gtk_tree_selection_count_selected_rows(selection) > 0;
-
- gtk_widget_set_sensitive(preferences.remove, has_selection);
- gtk_widget_set_sensitive(preferences.properties, has_selection);
- gtk_widget_set_sensitive(preferences.remove_item, has_selection);
- gtk_widget_set_sensitive(preferences.cut_item, has_selection);
- gtk_widget_set_sensitive(preferences.copy_item, has_selection);
- gtk_widget_set_sensitive(preferences.properties_item, has_selection);
-
- command_new_mail_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(preferences.command_new_mail_check));
- command_clicked_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(preferences.command_clicked_check));
-
- gtk_widget_set_sensitive(preferences.command_new_mail_entry, command_new_mail_enabled);
- gtk_widget_set_sensitive(preferences.command_clicked_entry, command_clicked_enabled);
-}
-
-static void
-mn_preferences_add_mailbox (void)
-{
- add_mailbox = mn_mailbox_properties_dialog_new(GTK_WINDOW(preferences.dialog), MN_MAILBOX_PROPERTIES_DIALOG_MODE_ADD);
-
- run:
- switch (gtk_dialog_run(GTK_DIALOG(add_mailbox)))
- {
- 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(add_mailbox));
- g_return_if_fail(uri != NULL);
-
- if (! mn_mailboxes_find(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_slist_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(add_mailbox);
-}
-
-static void
-mn_preferences_remove_mailbox (void)
-{
- GtkTreeSelection *selection;
- GSList *gconf_mailboxes;
-
- gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(preferences.list));
- gtk_tree_selection_selected_foreach(selection, mn_preferences_remove_mailbox_cb, &gconf_mailboxes);
- eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
- mn_slist_free(gconf_mailboxes);
-}
-
-static void
-mn_preferences_remove_mailbox_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- GSList **gconf_mailboxes = data;
- char *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);
- }
-
- g_free(uri);
-}
-
-static void
-mn_preferences_cut_mailbox (void)
-{
- mn_preferences_copy_mailbox();
- mn_preferences_remove_mailbox();
-}
-
-static void
-mn_preferences_copy_mailbox (void)
-{
- GtkTreeSelection *selection;
- GSList *uri_list = NULL;
- char *gnome_copied_files;
- const GtkTargetEntry target = { GNOME_COPIED_FILES, 0, 0 };
- gboolean status;
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(preferences.list));
- gtk_tree_selection_selected_foreach(selection, mn_preferences_copy_mailbox_cb, &uri_list);
-
- gnome_copied_files = mn_build_gnome_copied_files(MN_GNOME_COPIED_FILES_COPY, uri_list);
- mn_slist_free(uri_list);
-
- status = gtk_clipboard_set_with_data(clipboard,
- &target,
- 1,
- mn_preferences_get_clipboard_cb,
- mn_preferences_clear_clipboard_cb,
- gnome_copied_files);
- g_return_if_fail(status == TRUE);
-}
-
-static void
-mn_preferences_copy_mailbox_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- GSList **uri_list = data;
- char *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 */
-}
-
-static void
-mn_preferences_get_clipboard_cb (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- unsigned int info,
- gpointer user_data_or_owner)
-{
- 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));
-}
-
-static void
-mn_preferences_clear_clipboard_cb (GtkClipboard *clipboard,
- gpointer user_data_or_owner)
-{
- char *gnome_copied_files = user_data_or_owner;
- g_free(gnome_copied_files);
-}
-
-static void
-mn_preferences_paste_mailbox (void)
-{
- gtk_clipboard_request_contents(clipboard,
- gnome_copied_files_atom,
- mn_preferences_paste_mailbox_receive_cb,
- NULL);
-}
-
-static void
-mn_preferences_paste_mailbox_receive_cb (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- gpointer data)
-{
- if (selection_data->type == gnome_copied_files_atom
- && selection_data->format == 8
- && selection_data->length > 0)
- {
- char *gnome_copied_files;
- gboolean status;
- MNGnomeCopiedFilesType type;
- GSList *uri_list;
-
- gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
- status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
- g_free(gnome_copied_files);
-
- if (status)
- {
- if (type == MN_GNOME_COPIED_FILES_COPY)
- {
- GSList *new_mailboxes = NULL;
- GSList *l;
-
- MN_LIST_FOREACH(l, uri_list)
- {
- const char *uri = l->data;
-
- if (! mn_mailboxes_find(uri))
- new_mailboxes = g_slist_append(new_mailboxes, g_strdup(uri));
- }
-
- if (new_mailboxes)
- {
- GSList *gconf_mailboxes;
-
- 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_slist_free(gconf_mailboxes);
- }
- }
-
- mn_slist_free(uri_list);
- }
- }
-}
-
-static void
-mn_preferences_edit_mailbox (void)
-{
- GtkTreeSelection *selection;
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(preferences.list));
- gtk_tree_selection_selected_foreach(selection, mn_preferences_edit_mailbox_cb, NULL);
-}
-
-static void
-mn_preferences_edit_mailbox_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- GtkWidget *dialog;
- char *uri;
-
- dialog = mn_mailbox_properties_dialog_new(GTK_WINDOW(preferences.dialog), 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_signal_connect(G_OBJECT(dialog),
- "response",
- G_CALLBACK(mn_preferences_mailbox_properties_response_h),
- NULL);
-
- gtk_widget_show(dialog);
-}
-
-static void
-mn_preferences_selection_changed_h (GtkTreeSelection *selection,
- gpointer user_data)
-{
- mn_preferences_update_selected_label();
- mn_preferences_update_sensitivity();
-}
-
-static void
-mn_preferences_mailbox_properties_response_h (GtkDialog *dialog,
- int response,
- gpointer user_data)
-{
- if (response == GTK_RESPONSE_HELP)
- mn_display_help("mailbox-properties");
- else
- {
- if (response == GTK_RESPONSE_APPLY || response == GTK_RESPONSE_OK)
- mn_mailbox_properties_dialog_apply(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
- if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_OK)
- gtk_widget_destroy(GTK_WIDGET(dialog));
- }
-}
-
-static void
-mn_preferences_popup_mailbox_menu (unsigned int button, guint32 activate_time)
-{
- gtk_clipboard_request_contents(clipboard,
- gnome_copied_files_atom,
- mn_preferences_popup_mailbox_menu_receive_cb,
- NULL);
- gtk_menu_popup(GTK_MENU(preferences.mailbox_menu), NULL, NULL, NULL, NULL, button, activate_time);
-}
-
-static void
-mn_preferences_popup_mailbox_menu_receive_cb (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- gpointer data)
-{
- gboolean can_paste = FALSE;
-
- if (selection_data->type == gnome_copied_files_atom
- && selection_data->format == 8
- && selection_data->length > 0)
- {
- char *gnome_copied_files;
- gboolean status;
- MNGnomeCopiedFilesType type;
- GSList *uri_list;
-
- gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
- status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
- g_free(gnome_copied_files);
-
- if (status)
- {
- if (type == MN_GNOME_COPIED_FILES_COPY && uri_list)
- can_paste = TRUE;
- mn_slist_free(uri_list);
- }
- }
-
- gtk_widget_set_sensitive(preferences.paste_item, can_paste);
-}
-
-/* libglade callbacks */
-
-void
-mn_preferences_toggled_h (GtkToggleButton *togglebutton, gpointer user_data)
-{
- mn_preferences_update_sensitivity();
-}
-
-void
-mn_preferences_add_clicked_h (GtkButton *button, gpointer user_data)
-{
- mn_preferences_add_mailbox();
-}
-
-void
-mn_preferences_remove_clicked_h (GtkButton *button, gpointer user_data)
-{
- mn_preferences_remove_mailbox();
-}
-
-void
-mn_preferences_properties_clicked_h (GtkButton *button, gpointer user_data)
-{
- mn_preferences_edit_mailbox();
-}
-
-void
-mn_preferences_add_item_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- mn_preferences_add_mailbox();
-}
-
-void
-mn_preferences_remove_item_activate_h (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- mn_preferences_remove_mailbox();
-}
-
-void
-mn_preferences_cut_item_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- mn_preferences_cut_mailbox();
-}
-
-void
-mn_preferences_copy_item_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- mn_preferences_copy_mailbox();
-}
-
-void
-mn_preferences_paste_item_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- mn_preferences_paste_mailbox();
-}
-
-void
-mn_preferences_properties_item_activate_h (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- mn_preferences_edit_mailbox();
-}
-
-gboolean
-mn_preferences_list_popup_menu_h (GtkWidget *widget, gpointer user_data)
-{
- mn_preferences_popup_mailbox_menu(0, gtk_get_current_event_time());
-
- return TRUE; /* a menu was activated */
-}
-
-gboolean
-mn_preferences_list_button_press_event_h (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
-{
- if (event->button == 3)
- mn_preferences_popup_mailbox_menu(event->button, event->time);
-
- return FALSE; /* propagate event */
-}
-
-void
-mn_preferences_list_row_activated_h (GtkTreeView *treeview,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- gpointer user_data)
-{
- mn_preferences_edit_mailbox();
-}
-
-gboolean
-mn_preferences_scrolled_drag_motion_h (GtkWidget *widget,
- GdkDragContext *drag_context,
- int x,
- int y,
- unsigned int time,
- gpointer user_data)
-{
- GtkAdjustment *adjustment;
-
- adjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(preferences.scrolled));
- gtk_adjustment_set_value(adjustment, (double) y / (widget->allocation.height - 2) * (adjustment->upper - adjustment->page_size));
-
- return TRUE;
-}
-
-void
-mn_preferences_response_h (GtkDialog *dialog, int response, gpointer user_data)
-{
- switch (response)
- {
- case GTK_RESPONSE_HELP:
- mn_display_help("preferences");
- break;
-
- case GTK_RESPONSE_CLOSE:
- gtk_widget_destroy(preferences.dialog);
- break;
- }
-}
-
-void
-mn_preferences_destroy_h (GtkObject *object, gpointer user_data)
-{
- gtk_widget_destroy(preferences.mailbox_menu);
- g_object_unref(preferences.store);
- preferences.dialog = NULL;
-}
diff --git a/src/mn-preferences.h b/src/mn-preferences.h
@@ -1,25 +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_PREFERENCES_H
-#define _MN_PREFERENCES_H
-
-void mn_preferences_display (void);
-void mn_preferences_update_list (void);
-
-#endif /* _MN_PREFERENCES_H */
diff --git a/src/mn-properties.c b/src/mn-properties.c
@@ -0,0 +1,229 @@
+/*
+ * 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 <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+#include "mn-conf.h"
+#include "mn-properties.h"
+#include "mn-util.h"
+#include "mn-mailbox-view.h"
+
+/*** types *******************************************************************/
+
+typedef struct
+{
+ GtkWidget *dialog;
+
+ GtkWidget *delay_label;
+ GtkWidget *minutes_spin;
+ GtkWidget *seconds_spin;
+
+ GtkWidget *scrolled;
+ GtkWidget *list;
+ GtkWidget *selected_label;
+ GtkWidget *remove;
+ GtkWidget *properties;
+
+ GtkWidget *command_new_mail_check;
+ GtkWidget *command_new_mail_entry;
+ GtkWidget *command_double_clicked_check;
+ GtkWidget *command_double_clicked_entry;
+} PropertiesDialog;
+
+/*** variables ***************************************************************/
+
+static PropertiesDialog properties = { NULL };
+
+/*** functions ***************************************************************/
+
+static void mn_properties_update_selected_label (void);
+static void mn_properties_update_sensitivity (void);
+
+static void mn_properties_selection_changed_h (GtkTreeSelection *selection,
+ gpointer user_data);
+
+/*** implementation **********************************************************/
+
+void
+mn_properties_display (void)
+{
+ GtkSizeGroup *size_group;
+ GtkTreeSelection *selection;
+
+ if (properties.dialog)
+ {
+ gtk_window_present(GTK_WINDOW(properties.dialog));
+ return;
+ }
+
+ mn_create_interface("properties",
+ "dialog", &properties.dialog,
+ "delay_label", &properties.delay_label,
+ "minutes_spin", &properties.minutes_spin,
+ "seconds_spin", &properties.seconds_spin,
+ "scrolled", &properties.scrolled,
+ "selected_label", &properties.selected_label,
+ "remove", &properties.remove,
+ "properties", &properties.properties,
+ "command_new_mail_check", &properties.command_new_mail_check,
+ "command_new_mail_entry", &properties.command_new_mail_entry,
+ "command_double_clicked_check", &properties.command_double_clicked_check,
+ "command_double_clicked_entry", &properties.command_double_clicked_entry,
+ NULL);
+
+ g_object_add_weak_pointer(G_OBJECT(properties.dialog), (gpointer *) &properties.dialog);
+
+ properties.list = mn_mailbox_view_new();
+ gtk_container_add(GTK_CONTAINER(properties.scrolled), properties.list);
+ gtk_widget_show(properties.list);
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(properties.list));
+ g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(mn_properties_selection_changed_h), NULL);
+
+ mn_setup_dnd(properties.scrolled);
+
+ size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ gtk_size_group_add_widget(size_group, properties.delay_label);
+ gtk_size_group_add_widget(size_group, properties.command_new_mail_check);
+ gtk_size_group_add_widget(size_group, properties.command_double_clicked_check);
+ g_object_unref(size_group);
+
+ mn_conf_link(properties.dialog, MN_CONF_PROPERTIES_DIALOG,
+ properties.minutes_spin, MN_CONF_DELAY_MINUTES,
+ properties.seconds_spin, MN_CONF_DELAY_SECONDS,
+ 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,
+ properties.command_double_clicked_entry, MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND,
+ NULL);
+
+ mn_properties_update_selected_label();
+ mn_properties_update_sensitivity();
+
+ gtk_widget_show(properties.dialog);
+}
+
+static void
+mn_properties_update_selected_label (void)
+{
+ GtkTreeSelection *selection;
+ int n_rows;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(properties.list));
+ n_rows = gtk_tree_selection_count_selected_rows(selection);
+
+ if (n_rows == 0)
+ gtk_label_set_text(GTK_LABEL(properties.selected_label), _("No mailbox selected."));
+ else
+ {
+ char *str;
+
+ str = g_strdup_printf(ngettext("%i mailbox selected.",
+ "%i mailboxes selected.",
+ n_rows), n_rows);
+ gtk_label_set_text(GTK_LABEL(properties.selected_label), str);
+ g_free(str);
+ }
+}
+
+static void
+mn_properties_update_sensitivity (void)
+{
+ GtkTreeSelection *selection;
+ gboolean has_selection;
+ gboolean command_new_mail_enabled;
+ gboolean command_double_clicked_enabled;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(properties.list));
+ has_selection = gtk_tree_selection_count_selected_rows(selection) > 0;
+
+ gtk_widget_set_sensitive(properties.remove, has_selection);
+ gtk_widget_set_sensitive(properties.properties, has_selection);
+
+ command_new_mail_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(properties.command_new_mail_check));
+ command_double_clicked_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(properties.command_double_clicked_check));
+
+ gtk_widget_set_sensitive(properties.command_new_mail_entry, command_new_mail_enabled);
+ gtk_widget_set_sensitive(properties.command_double_clicked_entry, command_double_clicked_enabled);
+}
+
+static void
+mn_properties_selection_changed_h (GtkTreeSelection *selection,
+ gpointer user_data)
+{
+ mn_properties_update_selected_label();
+ mn_properties_update_sensitivity();
+}
+
+/* libglade callbacks */
+
+void
+mn_properties_toggled_h (GtkToggleButton *togglebutton, gpointer user_data)
+{
+ mn_properties_update_sensitivity();
+}
+
+void
+mn_properties_add_clicked_h (GtkButton *button, gpointer user_data)
+{
+ mn_mailbox_view_activate_add(MN_MAILBOX_VIEW(properties.list));
+}
+
+void
+mn_properties_remove_clicked_h (GtkButton *button, gpointer user_data)
+{
+ mn_mailbox_view_activate_remove(MN_MAILBOX_VIEW(properties.list));
+}
+
+void
+mn_properties_properties_clicked_h (GtkButton *button, gpointer user_data)
+{
+ mn_mailbox_view_activate_properties(MN_MAILBOX_VIEW(properties.list));
+}
+
+gboolean
+mn_properties_scrolled_drag_motion_h (GtkWidget *widget,
+ GdkDragContext *drag_context,
+ int x,
+ int y,
+ unsigned int time,
+ gpointer user_data)
+{
+ GtkAdjustment *adjustment;
+
+ adjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(properties.scrolled));
+ gtk_adjustment_set_value(adjustment, (double) y / (widget->allocation.height - 2) * (adjustment->upper - adjustment->page_size));
+
+ return TRUE;
+}
+
+void
+mn_properties_response_h (GtkDialog *dialog, int response, gpointer user_data)
+{
+ switch (response)
+ {
+ case GTK_RESPONSE_HELP:
+ mn_display_help("properties");
+ break;
+
+ case GTK_RESPONSE_CLOSE:
+ gtk_widget_destroy(properties.dialog);
+ break;
+ }
+}
diff --git a/src/mn-properties.h b/src/mn-properties.h
@@ -0,0 +1,24 @@
+/*
+ * 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_PROPERTIES_H
+#define _MN_PROPERTIES_H
+
+void mn_properties_display (void);
+
+#endif /* _MN_PROPERTIES_H */
diff --git a/src/mn-sasl.c b/src/mn-sasl.c
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+#include <sasl/sasl.h>
+
+/*** variables ***************************************************************/
+
+static int use_count = 0;
+G_LOCK_DEFINE_STATIC(use_count);
+
+/*** implementation **********************************************************/
+
+gboolean
+mn_sasl_use (GError **err)
+{
+ gboolean success = TRUE;
+
+ G_LOCK(use_count);
+ if (++use_count == 1)
+ {
+ int status;
+
+ status = sasl_client_init(NULL);
+ if (status != SASL_OK)
+ {
+ use_count--;
+ g_set_error(err, 0, 0, "%s", sasl_errstring(status, NULL, NULL));
+ success = FALSE;
+ }
+ }
+ G_UNLOCK(use_count);
+
+ return success;
+}
+
+void
+mn_sasl_unuse (void)
+{
+ G_LOCK(use_count);
+ g_return_if_fail(use_count > 0);
+ if (--use_count == 0)
+ sasl_done();
+ G_UNLOCK(use_count);
+}
diff --git a/src/mn-sasl.h b/src/mn-sasl.h
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+#ifndef _MN_SASL_H
+#define _MN_SASL_H
+
+#include <glib.h>
+
+gboolean mn_sasl_use (GError **err);
+void mn_sasl_unuse (void);
+
+#endif /* _MN_SASL_H */
diff --git a/src/mn-shell-private.h b/src/mn-shell-private.h
@@ -0,0 +1,30 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_SHELL_PRIVATE_H__
+#define __MN_SHELL_PRIVATE_H__
+
+#include "mn-shell.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#line 22 "mn-shell.gob"
+
+#include "mn-mail-icon.h"
+
+#line 18 "mn-shell-private.h"
+struct _MNShellPrivate {
+#line 42 "mn-shell.gob"
+ MNMailIcon * icon;
+#line 43 "mn-shell.gob"
+ GtkWidget * about;
+#line 24 "mn-shell-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-shell.c b/src/mn-shell.c
@@ -0,0 +1,825 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 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-shell.h"
+
+#include "mn-shell-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 25 "mn-shell.gob"
+
+#include "config.h"
+#include <gnome.h>
+#include "mn-properties.h"
+#include "mn-dialog.h"
+#include "mn-util.h"
+#include "mn-conf.h"
+#include "mn-mailboxes.h"
+#include "mn-unsupported-mailbox.h"
+#include "mn-about-dialog.h"
+
+ MNShell *mn_shell = NULL;
+
+#line 39 "mn-shell.c"
+/* self casting macros */
+#define SELF(x) MN_SHELL(x)
+#define SELF_CONST(x) MN_SHELL_CONST(x)
+#define IS_SELF(x) MN_IS_SHELL(x)
+#define TYPE_SELF MN_TYPE_SHELL
+#define SELF_CLASS(x) MN_SHELL_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_SHELL_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNShell Self;
+typedef MNShellClass SelfClass;
+
+/* here are local prototypes */
+static void mn_shell_class_init (MNShellClass * c) G_GNUC_UNUSED;
+static void mn_shell_init (MNShell * self) G_GNUC_UNUSED;
+static void ___2_mn_shell_finalize (GObject * object) G_GNUC_UNUSED;
+static void mn_shell_mailboxes_list_changed_h (MNMailboxes * mailboxes, gpointer user_data) G_GNUC_UNUSED;
+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_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;
+static void mn_shell_icon_activate_properties_h (MNMailIcon * icon, gpointer user_data) G_GNUC_UNUSED;
+static void mn_shell_icon_activate_help_h (MNMailIcon * icon, gpointer user_data) G_GNUC_UNUSED;
+static void mn_shell_icon_activate_about_h (MNMailIcon * icon, gpointer user_data) G_GNUC_UNUSED;
+static void mn_shell_icon_activate_remove_h (MNMailIcon * icon, gpointer user_data) G_GNUC_UNUSED;
+static void mn_shell_icon_destroy_h (GtkObject * object, gpointer user_data) G_GNUC_UNUSED;
+static void mn_shell_run_double_clicked_command (MNShell * self) G_GNUC_UNUSED;
+static void mn_shell_update_command (MNShell * self) G_GNUC_UNUSED;
+static void mn_shell_update_sensitivity (MNShell * self) G_GNUC_UNUSED;
+static void mn_shell_update_icon (MNShell * self) G_GNUC_UNUSED;
+
+/* pointer to the class of our parent */
+static GObjectClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_mailboxes_list_changed_h mn_shell_mailboxes_list_changed_h
+#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_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
+#define self_icon_activate_properties_h mn_shell_icon_activate_properties_h
+#define self_icon_activate_help_h mn_shell_icon_activate_help_h
+#define self_icon_activate_about_h mn_shell_icon_activate_about_h
+#define self_icon_activate_remove_h mn_shell_icon_activate_remove_h
+#define self_icon_destroy_h mn_shell_icon_destroy_h
+#define self_run_double_clicked_command mn_shell_run_double_clicked_command
+#define self_update_command mn_shell_update_command
+#define self_update_sensitivity mn_shell_update_sensitivity
+#define self_update_icon mn_shell_update_icon
+#define self_new mn_shell_new
+#define self_display_about mn_shell_display_about
+#define self_report mn_shell_report
+GType
+mn_shell_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNShellClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_shell_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNShell),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_shell_init,
+ NULL
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "MNShell", &info, (GTypeFlags)0);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNShell *)g_object_new(mn_shell_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNShell * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNShell *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNShell *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNShell *)g_object_new_valist (mn_shell_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:Shell::dispose"
+ MNShell *self G_GNUC_UNUSED = MN_SHELL (obj_self);
+ if (G_OBJECT_CLASS (parent_class)->dispose) \
+ (* 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 149 "mn-shell.c"
+}
+#undef __GOB_FUNCTION__
+
+
+static void
+___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"
+ ___2_mn_shell_finalize(obj_self);
+#line 162 "mn-shell.c"
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
+
+static void
+mn_shell_class_init (MNShellClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:Shell::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
+
+#line 57 "mn-shell.gob"
+ g_object_class->finalize = ___finalize;
+#line 177 "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 184 "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 190 "mn-shell.c"
+ {
+#line 46 "mn-shell.gob"
+
+ g_return_if_fail(mn_shell == NULL);
+ g_object_add_weak_pointer(G_OBJECT(self), (gpointer *) &mn_shell);
+
+ self_init_icon(self);
+ eel_gconf_notification_add(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND, self_notify_double_clicked_command_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 203 "mn-shell.c"
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 57 "mn-shell.gob"
+static void
+___2_mn_shell_finalize (GObject * object G_GNUC_UNUSED)
+#line 213 "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"
+
+ gtk_main_quit();
+ PARENT_HANDLER(object);
+ }}
+#line 225 "mn-shell.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 64 "mn-shell.gob"
+static void
+mn_shell_mailboxes_list_changed_h (MNMailboxes * mailboxes, gpointer user_data)
+#line 232 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::mailboxes_list_changed_h"
+#line 64 "mn-shell.gob"
+ g_return_if_fail (mailboxes != NULL);
+#line 64 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAILBOXES (mailboxes));
+#line 64 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 241 "mn-shell.c"
+{
+#line 67 "mn-shell.gob"
+
+ Self *self = user_data;
+
+ self_update_sensitivity(self);
+ self_update_icon(self);
+ }}
+#line 250 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 74 "mn-shell.gob"
+static void
+mn_shell_mailboxes_status_changed_h (MNMailboxes * mailboxes, gpointer user_data)
+#line 256 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::mailboxes_status_changed_h"
+#line 74 "mn-shell.gob"
+ g_return_if_fail (mailboxes != NULL);
+#line 74 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAILBOXES (mailboxes));
+#line 74 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 265 "mn-shell.c"
+{
+#line 77 "mn-shell.gob"
+
+ Self *self = user_data;
+
+ self_update_icon(self);
+ }}
+#line 273 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 83 "mn-shell.gob"
+static void
+mn_shell_init_icon (MNShell * self)
+#line 279 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::init_icon"
+#line 83 "mn-shell.gob"
+ g_return_if_fail (self != NULL);
+#line 83 "mn-shell.gob"
+ g_return_if_fail (MN_IS_SHELL (self));
+#line 286 "mn-shell.c"
+{
+#line 85 "mn-shell.gob"
+
+ selfp->icon = MN_MAIL_ICON(mn_mail_icon_new());
+
+ g_signal_connect(G_OBJECT(selfp->icon), "activate", G_CALLBACK(self_icon_activate_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-run", G_CALLBACK(self_icon_activate_run_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-update", G_CALLBACK(self_icon_activate_update_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-properties", G_CALLBACK(self_icon_activate_properties_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-help", G_CALLBACK(self_icon_activate_help_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-about", G_CALLBACK(self_icon_activate_about_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-remove", G_CALLBACK(self_icon_activate_remove_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "destroy", G_CALLBACK(self_icon_destroy_h), self);
+
+ self_update_command(self);
+ self_update_sensitivity(self);
+ self_update_icon(self);
+ }}
+#line 305 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 102 "mn-shell.gob"
+static void
+mn_shell_notify_double_clicked_command_cb (GConfClient * client, guint cnxn_id, GConfEntry * entry, gpointer user_data)
+#line 311 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::notify_double_clicked_command_cb"
+#line 102 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 316 "mn-shell.c"
+{
+#line 107 "mn-shell.gob"
+
+ Self *self = user_data;
+
+ self_update_command(self);
+ }}
+#line 324 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 113 "mn-shell.gob"
+static void
+mn_shell_icon_activate_h (MNMailIcon * icon, gpointer user_data)
+#line 330 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_activate_h"
+#line 113 "mn-shell.gob"
+ g_return_if_fail (icon != NULL);
+#line 113 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (icon));
+#line 113 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 339 "mn-shell.c"
+{
+#line 116 "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 347 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 122 "mn-shell.gob"
+static void
+mn_shell_icon_activate_run_h (MNMailIcon * icon, gpointer user_data)
+#line 353 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_activate_run_h"
+#line 122 "mn-shell.gob"
+ g_return_if_fail (icon != NULL);
+#line 122 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (icon));
+#line 122 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 362 "mn-shell.c"
+{
+#line 125 "mn-shell.gob"
+
+ Self *self = user_data;
+ self_run_double_clicked_command(self);
+ }}
+#line 369 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 130 "mn-shell.gob"
+static void
+mn_shell_icon_activate_update_h (MNMailIcon * icon, gpointer user_data)
+#line 375 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_activate_update_h"
+#line 130 "mn-shell.gob"
+ g_return_if_fail (icon != NULL);
+#line 130 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (icon));
+#line 130 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 384 "mn-shell.c"
+{
+#line 133 "mn-shell.gob"
+
+ Self *self = user_data;
+ mn_mailboxes_check(self->mailboxes);
+ }}
+#line 391 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 138 "mn-shell.gob"
+static void
+mn_shell_icon_activate_properties_h (MNMailIcon * icon, gpointer user_data)
+#line 397 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_activate_properties_h"
+#line 138 "mn-shell.gob"
+ g_return_if_fail (icon != NULL);
+#line 138 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (icon));
+#line 138 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 406 "mn-shell.c"
+{
+#line 141 "mn-shell.gob"
+
+ mn_properties_display();
+ }}
+#line 412 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 145 "mn-shell.gob"
+static void
+mn_shell_icon_activate_help_h (MNMailIcon * icon, gpointer user_data)
+#line 418 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_activate_help_h"
+#line 145 "mn-shell.gob"
+ g_return_if_fail (icon != NULL);
+#line 145 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (icon));
+#line 145 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 427 "mn-shell.c"
+{
+#line 148 "mn-shell.gob"
+
+ mn_display_help(NULL);
+ }}
+#line 433 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 152 "mn-shell.gob"
+static void
+mn_shell_icon_activate_about_h (MNMailIcon * icon, gpointer user_data)
+#line 439 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_activate_about_h"
+#line 152 "mn-shell.gob"
+ g_return_if_fail (icon != NULL);
+#line 152 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (icon));
+#line 152 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 448 "mn-shell.c"
+{
+#line 155 "mn-shell.gob"
+
+ Self *self = user_data;
+ self_display_about(self);
+ }}
+#line 455 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 160 "mn-shell.gob"
+static void
+mn_shell_icon_activate_remove_h (MNMailIcon * icon, gpointer user_data)
+#line 461 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_activate_remove_h"
+#line 160 "mn-shell.gob"
+ g_return_if_fail (icon != NULL);
+#line 160 "mn-shell.gob"
+ g_return_if_fail (MN_IS_MAIL_ICON (icon));
+#line 160 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 470 "mn-shell.c"
+{
+#line 163 "mn-shell.gob"
+
+ Self *self = user_data;
+ g_object_unref(self);
+ }}
+#line 477 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 168 "mn-shell.gob"
+static void
+mn_shell_icon_destroy_h (GtkObject * object, gpointer user_data)
+#line 483 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::icon_destroy_h"
+#line 168 "mn-shell.gob"
+ g_return_if_fail (object != NULL);
+#line 168 "mn-shell.gob"
+ g_return_if_fail (GTK_IS_OBJECT (object));
+#line 168 "mn-shell.gob"
+ g_return_if_fail (user_data != NULL);
+#line 492 "mn-shell.c"
+{
+#line 171 "mn-shell.gob"
+
+ Self *self = user_data;
+
+ /* The Notification Area applet has been terminated. Recreate the icon. */
+ self_init_icon(self);
+ }}
+#line 501 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 178 "mn-shell.gob"
+static void
+mn_shell_run_double_clicked_command (MNShell * self)
+#line 507 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::run_double_clicked_command"
+#line 178 "mn-shell.gob"
+ g_return_if_fail (self != NULL);
+#line 178 "mn-shell.gob"
+ g_return_if_fail (MN_IS_SHELL (self));
+#line 514 "mn-shell.c"
+{
+#line 180 "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);
+ }
+
+ g_free(command);
+ }
+ }}
+#line 537 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 201 "mn-shell.gob"
+static void
+mn_shell_update_command (MNShell * self)
+#line 543 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::update_command"
+#line 201 "mn-shell.gob"
+ g_return_if_fail (self != NULL);
+#line 201 "mn-shell.gob"
+ g_return_if_fail (MN_IS_SHELL (self));
+#line 550 "mn-shell.c"
+{
+#line 203 "mn-shell.gob"
+
+ char *command;
+
+ command = eel_gconf_get_string(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND);
+ mn_mail_icon_set_command(selfp->icon, command);
+ g_free(command);
+ }}
+#line 560 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 211 "mn-shell.gob"
+static void
+mn_shell_update_sensitivity (MNShell * self)
+#line 566 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::update_sensitivity"
+#line 211 "mn-shell.gob"
+ g_return_if_fail (self != NULL);
+#line 211 "mn-shell.gob"
+ g_return_if_fail (MN_IS_SHELL (self));
+#line 573 "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;
+
+ 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);
+ }}
+#line 593 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 231 "mn-shell.gob"
+static void
+mn_shell_update_icon (MNShell * self)
+#line 599 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::update_icon"
+#line 231 "mn-shell.gob"
+ g_return_if_fail (self != NULL);
+#line 231 "mn-shell.gob"
+ g_return_if_fail (MN_IS_SHELL (self));
+#line 606 "mn-shell.c"
+{
+#line 233 "mn-shell.gob"
+
+ GSList *mailboxes;
+ gboolean show = FALSE;
+ gboolean blink = FALSE;
+ GString *tooltip = NULL;
+
+ mailboxes = mn_mailboxes_get(self->mailboxes);
+ if (mailboxes)
+ {
+ GSList *l;
+ static int old_n_new = 0;
+ int n_new = 0;
+ int n_error = 0;
+ int n_unsupported = 0;
+ GString *new_string;
+ GString *error_string;
+ GString *unsupported_string;
+
+ new_string = g_string_new(NULL);
+ error_string = g_string_new(NULL);
+ unsupported_string = g_string_new(NULL);
+
+ MN_LIST_FOREACH(l, mailboxes)
+ {
+ MNMailbox *mailbox = l->data;
+ const char *name;
+ const char *error;
+
+ name = mn_mailbox_get_name(mailbox);
+ error = mn_mailbox_get_error(mailbox);
+
+ if (mn_mailbox_get_has_new(mailbox))
+ {
+ n_new++;
+ if (*new_string->str)
+ g_string_append_c(new_string, '\n');
+ g_string_append_printf(new_string, " %s", name);
+ }
+
+ if (error)
+ {
+ n_error++;
+ if (*error_string->str)
+ g_string_append_c(error_string, '\n');
+ g_string_append_printf(error_string, " %s (%s)", name, error);
+ }
+
+ if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
+ {
+ n_unsupported++;
+ if (*unsupported_string->str)
+ g_string_append_c(unsupported_string, '\n');
+ g_string_append_printf(unsupported_string, " %s (%s)", name, mn_unsupported_mailbox_get_reason(MN_UNSUPPORTED_MAILBOX(mailbox)));
+ }
+ }
+
+ 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)
+ g_string_prepend(new_string, ngettext("The following mailbox has new mail:\n",
+ "The following mailboxes have new mail:\n",
+ n_new));
+ else
+ g_string_prepend(new_string, _("You have no new mail."));
+
+ if (n_error > 0)
+ g_string_prepend(error_string, ngettext("The following mailbox reported an error:\n",
+ "The following mailboxes reported an error:\n",
+ n_error));
+
+ if (n_unsupported > 0)
+ g_string_prepend(unsupported_string, ngettext("The following mailbox is unsupported:\n",
+ "The following mailboxes are unsupported:\n",
+ n_unsupported));
+
+ tooltip = g_string_new(new_string->str);
+ if (n_error > 0)
+ g_string_append_printf(tooltip, "\n\n%s", error_string->str);
+ if (n_unsupported > 0)
+ g_string_append_printf(tooltip, "\n\n%s", unsupported_string->str);
+
+ g_string_free(new_string, TRUE);
+ g_string_free(error_string, TRUE);
+ g_string_free(unsupported_string, TRUE);
+
+ if (old_n_new == 0 && n_new > 0)
+ {
+ gnome_triggers_do(_("You have new mail."), NULL, "mail-notification", "new-mail", NULL);
+ if (eel_gconf_get_boolean(MN_CONF_COMMANDS_NEW_MAIL_ENABLED))
+ {
+ char *command;
+
+ 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);
+ }
+
+ g_free(command);
+ }
+ }
+ }
+ old_n_new = n_new;
+ }
+
+ if (show)
+ {
+ 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);
+ gtk_widget_show(GTK_WIDGET(selfp->icon));
+ }
+ else
+ gtk_widget_hide(GTK_WIDGET(selfp->icon));
+
+ if (tooltip)
+ g_string_free(tooltip, TRUE);
+ }}
+#line 739 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 364 "mn-shell.gob"
+MNShell *
+mn_shell_new (void)
+#line 745 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::new"
+{
+#line 366 "mn-shell.gob"
+
+ return MN_SHELL(GET_NEW);
+ }}
+#line 753 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 370 "mn-shell.gob"
+void
+mn_shell_display_about (MNShell * self)
+#line 759 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::display_about"
+#line 370 "mn-shell.gob"
+ g_return_if_fail (self != NULL);
+#line 370 "mn-shell.gob"
+ g_return_if_fail (MN_IS_SHELL (self));
+#line 766 "mn-shell.c"
+{
+#line 372 "mn-shell.gob"
+
+ if (selfp->about)
+ {
+ gtk_window_present(GTK_WINDOW(selfp->about));
+ return;
+ }
+
+ selfp->about = mn_about_dialog_new();
+ g_object_add_weak_pointer(G_OBJECT(selfp->about), (gpointer *) &selfp->about);
+ gtk_widget_show(GTK_WIDGET(selfp->about));
+ }}
+#line 780 "mn-shell.c"
+#undef __GOB_FUNCTION__
+
+#line 384 "mn-shell.gob"
+void
+mn_shell_report (MNShell * self, char ** report)
+#line 786 "mn-shell.c"
+{
+#define __GOB_FUNCTION__ "MN:Shell::report"
+#line 384 "mn-shell.gob"
+ g_return_if_fail (self != NULL);
+#line 384 "mn-shell.gob"
+ g_return_if_fail (MN_IS_SHELL (self));
+#line 384 "mn-shell.gob"
+ g_return_if_fail (report != NULL);
+#line 795 "mn-shell.c"
+{
+#line 386 "mn-shell.gob"
+
+ GString *string;
+ GSList *l;
+
+ string = g_string_new(NULL);
+ 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);
+
+ if (mn_mailbox_get_has_new(mailbox))
+ g_string_append(string, " has-new\n");
+ if (error)
+ g_string_append_printf(string, " error %s\n", error);
+ if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
+ g_string_append_printf(string, " unsupported %s\n", mn_unsupported_mailbox_get_reason(MN_UNSUPPORTED_MAILBOX(mailbox)));
+ }
+
+ *report = string->str;
+ g_string_free(string, FALSE);
+ }}
+#line 825 "mn-shell.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-shell.gob b/src/mn-shell.gob
@@ -0,0 +1,417 @@
+/*
+ * 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 "mn-mailboxes.h"
+%}
+%privateheader{
+#include "mn-mail-icon.h"
+%}
+%{
+#include "config.h"
+#include <gnome.h>
+#include "mn-properties.h"
+#include "mn-dialog.h"
+#include "mn-util.h"
+#include "mn-conf.h"
+#include "mn-mailboxes.h"
+#include "mn-unsupported-mailbox.h"
+#include "mn-about-dialog.h"
+
+ MNShell *mn_shell = NULL;
+%}
+
+class MN:Shell from G:Object
+{
+ public MNMailboxes *mailboxes = {mn_mailboxes_new()} unrefwith g_object_unref;
+ private MNMailIcon *icon;
+ private GtkWidget *about;
+
+ init (self)
+ {
+ g_return_if_fail(mn_shell == NULL);
+ g_object_add_weak_pointer(G_OBJECT(self), (gpointer *) &mn_shell);
+
+ self_init_icon(self);
+ eel_gconf_notification_add(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND, self_notify_double_clicked_command_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);
+ }
+
+ override (G:Object) void
+ finalize (GObject *object)
+ {
+ gtk_main_quit();
+ PARENT_HANDLER(object);
+ }
+
+ private void
+ mailboxes_list_changed_h (MN:Mailboxes *mailboxes (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ self_update_sensitivity(self);
+ self_update_icon(self);
+ }
+
+ private void
+ mailboxes_status_changed_h (MN:Mailboxes *mailboxes (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ self_update_icon(self);
+ }
+
+ private void
+ init_icon (self)
+ {
+ selfp->icon = MN_MAIL_ICON(mn_mail_icon_new());
+
+ g_signal_connect(G_OBJECT(selfp->icon), "activate", G_CALLBACK(self_icon_activate_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-run", G_CALLBACK(self_icon_activate_run_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-update", G_CALLBACK(self_icon_activate_update_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-properties", G_CALLBACK(self_icon_activate_properties_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-help", G_CALLBACK(self_icon_activate_help_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-about", G_CALLBACK(self_icon_activate_about_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "activate-remove", G_CALLBACK(self_icon_activate_remove_h), self);
+ g_signal_connect(G_OBJECT(selfp->icon), "destroy", G_CALLBACK(self_icon_destroy_h), self);
+
+ self_update_command(self);
+ self_update_sensitivity(self);
+ self_update_icon(self);
+ }
+
+ private void
+ notify_double_clicked_command_cb (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ self_update_command(self);
+ }
+
+ private void
+ icon_activate_h (MN:Mail:Icon *icon (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ if (eel_gconf_get_boolean(MN_CONF_COMMANDS_DOUBLE_CLICKED_ENABLED))
+ self_run_double_clicked_command(self);
+ }
+
+ private void
+ icon_activate_run_h (MN:Mail:Icon *icon (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ self_run_double_clicked_command(self);
+ }
+
+ private void
+ icon_activate_update_h (MN:Mail:Icon *icon (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ mn_mailboxes_check(self->mailboxes);
+ }
+
+ private void
+ icon_activate_properties_h (MN:Mail:Icon *icon (check null type),
+ gpointer user_data (check null))
+ {
+ mn_properties_display();
+ }
+
+ private void
+ icon_activate_help_h (MN:Mail:Icon *icon (check null type),
+ gpointer user_data (check null))
+ {
+ mn_display_help(NULL);
+ }
+
+ private void
+ icon_activate_about_h (MN:Mail:Icon *icon (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ self_display_about(self);
+ }
+
+ private void
+ icon_activate_remove_h (MN:Mail:Icon *icon (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+ g_object_unref(self);
+ }
+
+ private void
+ icon_destroy_h (Gtk:Object *object (check null type),
+ gpointer user_data (check null))
+ {
+ Self *self = user_data;
+
+ /* The Notification Area applet has been terminated. Recreate the icon. */
+ self_init_icon(self);
+ }
+
+ private void
+ run_double_clicked_command (self)
+ {
+ 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);
+ }
+
+ g_free(command);
+ }
+ }
+
+ private void
+ update_command (self)
+ {
+ char *command;
+
+ command = eel_gconf_get_string(MN_CONF_COMMANDS_DOUBLE_CLICKED_COMMAND);
+ mn_mail_icon_set_command(selfp->icon, command);
+ g_free(command);
+ }
+
+ 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);
+ }
+
+ private void
+ update_icon (self)
+ {
+ GSList *mailboxes;
+ gboolean show = FALSE;
+ gboolean blink = FALSE;
+ GString *tooltip = NULL;
+
+ mailboxes = mn_mailboxes_get(self->mailboxes);
+ if (mailboxes)
+ {
+ GSList *l;
+ static int old_n_new = 0;
+ int n_new = 0;
+ int n_error = 0;
+ int n_unsupported = 0;
+ GString *new_string;
+ GString *error_string;
+ GString *unsupported_string;
+
+ new_string = g_string_new(NULL);
+ error_string = g_string_new(NULL);
+ unsupported_string = g_string_new(NULL);
+
+ MN_LIST_FOREACH(l, mailboxes)
+ {
+ MNMailbox *mailbox = l->data;
+ const char *name;
+ const char *error;
+
+ name = mn_mailbox_get_name(mailbox);
+ error = mn_mailbox_get_error(mailbox);
+
+ if (mn_mailbox_get_has_new(mailbox))
+ {
+ n_new++;
+ if (*new_string->str)
+ g_string_append_c(new_string, '\n');
+ g_string_append_printf(new_string, " %s", name);
+ }
+
+ if (error)
+ {
+ n_error++;
+ if (*error_string->str)
+ g_string_append_c(error_string, '\n');
+ g_string_append_printf(error_string, " %s (%s)", name, error);
+ }
+
+ if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
+ {
+ n_unsupported++;
+ if (*unsupported_string->str)
+ g_string_append_c(unsupported_string, '\n');
+ g_string_append_printf(unsupported_string, " %s (%s)", name, mn_unsupported_mailbox_get_reason(MN_UNSUPPORTED_MAILBOX(mailbox)));
+ }
+ }
+
+ 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)
+ g_string_prepend(new_string, ngettext("The following mailbox has new mail:\n",
+ "The following mailboxes have new mail:\n",
+ n_new));
+ else
+ g_string_prepend(new_string, _("You have no new mail."));
+
+ if (n_error > 0)
+ g_string_prepend(error_string, ngettext("The following mailbox reported an error:\n",
+ "The following mailboxes reported an error:\n",
+ n_error));
+
+ if (n_unsupported > 0)
+ g_string_prepend(unsupported_string, ngettext("The following mailbox is unsupported:\n",
+ "The following mailboxes are unsupported:\n",
+ n_unsupported));
+
+ tooltip = g_string_new(new_string->str);
+ if (n_error > 0)
+ g_string_append_printf(tooltip, "\n\n%s", error_string->str);
+ if (n_unsupported > 0)
+ g_string_append_printf(tooltip, "\n\n%s", unsupported_string->str);
+
+ g_string_free(new_string, TRUE);
+ g_string_free(error_string, TRUE);
+ g_string_free(unsupported_string, TRUE);
+
+ if (old_n_new == 0 && n_new > 0)
+ {
+ gnome_triggers_do(_("You have new mail."), NULL, "mail-notification", "new-mail", NULL);
+ if (eel_gconf_get_boolean(MN_CONF_COMMANDS_NEW_MAIL_ENABLED))
+ {
+ char *command;
+
+ 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);
+ }
+
+ g_free(command);
+ }
+ }
+ }
+ old_n_new = n_new;
+ }
+
+ if (show)
+ {
+ 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);
+ gtk_widget_show(GTK_WIDGET(selfp->icon));
+ }
+ else
+ gtk_widget_hide(GTK_WIDGET(selfp->icon));
+
+ if (tooltip)
+ g_string_free(tooltip, TRUE);
+ }
+
+ public MNShell *
+ new (void)
+ {
+ return MN_SHELL(GET_NEW);
+ }
+
+ public void
+ display_about (self)
+ {
+ if (selfp->about)
+ {
+ gtk_window_present(GTK_WINDOW(selfp->about));
+ return;
+ }
+
+ selfp->about = mn_about_dialog_new();
+ g_object_add_weak_pointer(G_OBJECT(selfp->about), (gpointer *) &selfp->about);
+ gtk_widget_show(GTK_WIDGET(selfp->about));
+ }
+
+ public void
+ report (self, char **report (check null))
+ {
+ GString *string;
+ GSList *l;
+
+ string = g_string_new(NULL);
+ 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);
+
+ if (mn_mailbox_get_has_new(mailbox))
+ g_string_append(string, " has-new\n");
+ if (error)
+ g_string_append_printf(string, " error %s\n", error);
+ if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
+ g_string_append_printf(string, " unsupported %s\n", mn_unsupported_mailbox_get_reason(MN_UNSUPPORTED_MAILBOX(mailbox)));
+ }
+
+ *report = string->str;
+ g_string_free(string, FALSE);
+ }
+}
+
+%h{
+ extern MNShell *mn_shell;
+%}
diff --git a/src/mn-shell.h b/src/mn-shell.h
@@ -0,0 +1,72 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include "mn-mailboxes.h"
+
+#ifndef __MN_SHELL_H__
+#define __MN_SHELL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_SHELL (mn_shell_get_type())
+#define MN_SHELL(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_shell_get_type(), MNShell)
+#define MN_SHELL_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_shell_get_type(), MNShell const)
+#define MN_SHELL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_shell_get_type(), MNShellClass)
+#define MN_IS_SHELL(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_shell_get_type ())
+
+#define MN_SHELL_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_shell_get_type(), MNShellClass)
+
+/* Private structure type */
+typedef struct _MNShellPrivate MNShellPrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_SHELL__
+#define __TYPEDEF_MN_SHELL__
+typedef struct _MNShell MNShell;
+#endif
+struct _MNShell {
+ GObject __parent__;
+ /*< public >*/
+ MNMailboxes * mailboxes;
+ /*< private >*/
+ MNShellPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNShellClass MNShellClass;
+struct _MNShellClass {
+ GObjectClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_shell_get_type (void);
+MNShell * mn_shell_new (void);
+void mn_shell_display_about (MNShell * self);
+void mn_shell_report (MNShell * self,
+ char ** report);
+
+
+ extern MNShell *mn_shell;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-soup.c b/src/mn-soup.c
@@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <signal.h>
#include <eel/eel.h>
#include <libsoup/soup.h>
@@ -36,8 +37,10 @@
/*** variables ***************************************************************/
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 ***************************************************************/
@@ -52,8 +55,17 @@ static void mn_soup_update_proxy (void);
void
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);
@@ -62,13 +74,14 @@ mn_soup_use (void)
http_proxy_notification_id = eel_gconf_notification_add(CONF_HTTP_PROXY_NAMESPACE, mn_soup_notify_proxy_cb, NULL);
proxy_notification_id = eel_gconf_notification_add(CONF_PROXY_NAMESPACE, mn_soup_notify_proxy_cb, NULL);
}
+ G_UNLOCK(use_count);
}
void
mn_soup_unuse (void)
{
+ G_LOCK(use_count);
g_return_if_fail(use_count > 0);
-
if (--use_count == 0)
{
eel_gconf_notification_remove(http_proxy_notification_id);
@@ -77,7 +90,11 @@ 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);
}
static void
diff --git a/src/mn-ssl.c b/src/mn-ssl.c
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+#include <glib.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+
+/*** variables ***************************************************************/
+
+static gboolean initialized = FALSE;
+G_LOCK_DEFINE_STATIC(initialized);
+
+static SSL_CTX *global_ctx;
+static char *init_error;
+
+/*** implementation **********************************************************/
+
+SSL_CTX *
+mn_ssl_init (GError **err)
+{
+ SSL_CTX *ctx;
+
+ /*
+ * SSL_CTX_new() will fail the second time it is called, so we just
+ * keep the same context for the whole application lifetime.
+ */
+
+ G_LOCK(initialized);
+ if (! initialized)
+ {
+ SSL_library_init();
+ 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()));
+
+ initialized = TRUE;
+ }
+
+ ctx = global_ctx;
+ if (! ctx)
+ {
+ g_return_val_if_fail(init_error != NULL, NULL);
+ g_set_error(err, 0, 0, "%s", init_error);
+ }
+ G_UNLOCK(initialized);
+
+ return ctx;
+}
diff --git a/src/mn-ssl.h b/src/mn-ssl.h
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+#ifndef _MN_SSL_H
+#define _MN_SSL_H
+
+#include <glib.h>
+#include <openssl/ssl.h>
+
+SSL_CTX *mn_ssl_init (GError **err);
+
+#endif /* _MN_SSL_H */
diff --git a/src/mn-stock.c b/src/mn-stock.c
@@ -17,10 +17,17 @@
*/
#include "config.h"
+#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include "mn-stock.h"
#include "mn-util.h"
+/*** constants ***************************************************************/
+
+static const GtkStockItem items[] = {
+ { MN_STOCK_SELECT_ALL, N_("Select _All"), 0, 0, NULL },
+};
+
/*** implementation **********************************************************/
void
@@ -32,16 +39,15 @@ mn_stock_init (void)
const char *filename;
const char *icon_name;
} icons[] = {
- { MN_STOCK_MAIL, "mail.png", NULL },
- { MN_STOCK_MAIL_ERROR, "mail-error.png", NULL },
- { MN_STOCK_NO_MAIL, "no-mail.png", NULL },
- { MN_STOCK_NO_MAIL_ERROR, "no-mail-error.png", NULL },
+ { MN_STOCK_MAIL, NULL, "stock_mail" },
{ MN_STOCK_LOCAL, NULL, "stock_folder" },
{ MN_STOCK_REMOTE, NULL, "stock_internet" },
{ MN_STOCK_UNSUPPORTED, "unsupported.png", NULL },
#ifdef WITH_GMAIL
{ MN_STOCK_GMAIL, "gmail.png", NULL },
#endif
+ { MN_STOCK_SYSTEM_MAILBOX, NULL, "gnome-system" },
+ { MN_STOCK_SELECT_ALL, NULL, "stock_select-all" }
};
GtkIconFactory *factory;
GtkIconTheme *icon_theme;
@@ -81,4 +87,6 @@ mn_stock_init (void)
}
g_object_unref(factory);
+
+ gtk_stock_add_static(items, G_N_ELEMENTS(items));
}
diff --git a/src/mn-stock.h b/src/mn-stock.h
@@ -19,14 +19,17 @@
#ifndef _MN_STOCK_H
#define _MN_STOCK_H
+#include "config.h"
+
#define MN_STOCK_MAIL "mail-notification-mail"
-#define MN_STOCK_MAIL_ERROR "mail-notification-mail-error"
-#define MN_STOCK_NO_MAIL "mail-notification-no-mail"
-#define MN_STOCK_NO_MAIL_ERROR "mail-notification-no-mail-error"
#define MN_STOCK_LOCAL "mail-notification-local"
#define MN_STOCK_REMOTE "mail-notification-remote"
#define MN_STOCK_UNSUPPORTED "mail-notification-unsupported"
+#ifdef WITH_GMAIL
#define MN_STOCK_GMAIL "mail-notification-gmail"
+#endif
+#define MN_STOCK_SYSTEM_MAILBOX "mail-notification-system-mailbox"
+#define MN_STOCK_SELECT_ALL "mail-notification-select-all"
void mn_stock_init (void);
diff --git a/src/mn-sylpheed-mailbox-private.h b/src/mn-sylpheed-mailbox-private.h
@@ -0,0 +1,17 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_SYLPHEED_MAILBOX_PRIVATE_H__
+#define __MN_SYLPHEED_MAILBOX_PRIVATE_H__
+
+#include "mn-sylpheed-mailbox.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-sylpheed-mailbox.c b/src/mn-sylpheed-mailbox.c
@@ -1,216 +1,262 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:52 2004
+ (do not edit directly) */
-#include "config.h"
-#include <string.h>
-#include <glib/gi18n-lib.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include "mn-sylpheed-mailbox.h"
-#include "mn-util.h"
-#include "mn-vfs.h"
+/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
-/*** types *******************************************************************/
+#define GOB_VERSION_MAJOR 2
+#define GOB_VERSION_MINOR 0
+#define GOB_VERSION_PATCHLEVEL 9
-typedef struct
-{
- MNMailboxIsCallback *callback;
- gpointer user_data;
-} IsInfo;
+#define selfp (self->_priv)
-typedef struct
-{
- MNSylpheedMailbox *mailbox;
- unsigned int total_count;
- unsigned int mark_count;
-} CheckInfo;
+#include "mn-sylpheed-mailbox.h"
-/*** variables ***************************************************************/
+#include "mn-sylpheed-mailbox-private.h"
-static GObjectClass *parent_class = NULL;
+#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 */
-/*** functions ***************************************************************/
+#line 22 "mn-sylpheed-mailbox.gob"
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include "mn-mailbox-private.h"
+#include "mn-vfs.h"
+#include "mn-util.h"
-static void mn_sylpheed_mailbox_class_init (MNSylpheedMailboxClass *class);
+#line 33 "mn-sylpheed-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_SYLPHEED_MAILBOX(x)
+#define SELF_CONST(x) MN_SYLPHEED_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_SYLPHEED_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_SYLPHEED_MAILBOX
+#define SELF_CLASS(x) MN_SYLPHEED_MAILBOX_CLASS(x)
-static GObject *mn_sylpheed_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params);
+#define SELF_GET_CLASS(x) MN_SYLPHEED_MAILBOX_GET_CLASS(x)
-static void mn_sylpheed_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data);
-static void mn_sylpheed_mailbox_is_cb (gboolean result, gpointer user_data);
+/* self typedefs */
+typedef MNSylpheedMailbox Self;
+typedef MNSylpheedMailboxClass SelfClass;
-static void mn_sylpheed_mailbox_check (MNMailbox *mailbox);
-static void mn_sylpheed_mailbox_check_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- GList *list,
- unsigned int entries_read,
- gpointer user_data);
+/* here are local prototypes */
+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 void ___4_mn_sylpheed_mailbox_impl_threaded_check (MNMailbox * self) G_GNUC_UNUSED;
-/*** implementation **********************************************************/
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
GType
mn_sylpheed_mailbox_get_type (void)
{
- static GType sylpheed_mailbox_type = 0;
-
- if (! sylpheed_mailbox_type)
- {
- static const GTypeInfo sylpheed_mailbox_info = {
- sizeof(MNSylpheedMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_sylpheed_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNSylpheedMailbox),
- 0,
- NULL
- };
-
- sylpheed_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNSylpheedMailbox",
- &sylpheed_mailbox_info,
- 0);
- }
-
- return sylpheed_mailbox_type;
-}
-
-static void
-mn_sylpheed_mailbox_class_init (MNSylpheedMailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
-
- parent_class = g_type_class_peek_parent(class);
-
- object_class->constructor = mn_sylpheed_mailbox_constructor;
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNSylpheedMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_sylpheed_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNSylpheedMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_sylpheed_mailbox_init,
+ NULL
+ };
+
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNSylpheedMailbox", &info, (GTypeFlags)0);
+ }
- mailbox_class->format = "Sylpheed";
- mailbox_class->is = mn_sylpheed_mailbox_is;
- mailbox_class->check = mn_sylpheed_mailbox_check;
+ return type;
}
-static GObject *
-mn_sylpheed_mailbox_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
-{
- GObject *object;
- MNMailbox *mailbox;
-
- object = G_OBJECT_CLASS(parent_class)->constructor(type, n_construct_properties, construct_params);
- mailbox = MN_MAILBOX(object);
-
- mn_mailbox_monitor(mailbox,
- mn_mailbox_get_uri(mailbox),
- GNOME_VFS_MONITOR_DIRECTORY,
- MN_MAILBOX_MONITOR_EVENT_CHANGED
- | MN_MAILBOX_MONITOR_EVENT_DELETED
- | MN_MAILBOX_MONITOR_EVENT_CREATED);
-
- return object;
-}
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNSylpheedMailbox *)g_object_new(mn_sylpheed_mailbox_get_type(), NULL))
-static void
-mn_sylpheed_mailbox_is (const char *uri,
- MNMailboxIsCallback *callback,
- gpointer user_data)
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNSylpheedMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNSylpheedMailbox *
+GET_NEW_VARG (const char *first, ...)
{
- IsInfo *info;
- char *markfile_uri;
-
- info = g_new(IsInfo, 1);
- info->callback = callback;
- info->user_data = user_data;
-
- markfile_uri = g_build_path("/", uri, ".sylpheed_mark", NULL);
- mn_vfs_async_test(markfile_uri, G_FILE_TEST_IS_REGULAR, mn_sylpheed_mailbox_is_cb, info);
- g_free(markfile_uri);
+ MNSylpheedMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNSylpheedMailbox *)g_object_new_valist (mn_sylpheed_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
-static void
-mn_sylpheed_mailbox_is_cb (gboolean result, gpointer user_data)
+static void
+mn_sylpheed_mailbox_init (MNSylpheedMailbox * o G_GNUC_UNUSED)
{
- IsInfo *info = user_data;
-
- info->callback(result, info->user_data);
- g_free(info);
+#define __GOB_FUNCTION__ "MN:Sylpheed:Mailbox::init"
}
-
-static void
-mn_sylpheed_mailbox_check (MNMailbox *mailbox)
+#undef __GOB_FUNCTION__
+#line 32 "mn-sylpheed-mailbox.gob"
+static void
+mn_sylpheed_mailbox_class_init (MNSylpheedMailboxClass * class G_GNUC_UNUSED)
+#line 108 "mn-sylpheed-mailbox.c"
{
- MNSylpheedMailbox *sylpheed_mailbox = MN_SYLPHEED_MAILBOX(mailbox);
- CheckInfo *info;
- GnomeVFSAsyncHandle *handle;
-
- info = g_new(CheckInfo, 1);
- info->mailbox = sylpheed_mailbox;
- info->total_count = 0;
- info->mark_count = 0;
+#define __GOB_FUNCTION__ "MN:Sylpheed:Mailbox::class_init"
+ GObjectClass *g_object_class = (GObjectClass *)class;
+ MNMailboxClass *mn_mailbox_class = (MNMailboxClass *)class;
+
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
+
+#line 37 "mn-sylpheed-mailbox.gob"
+ g_object_class->constructor = ___2_mn_sylpheed_mailbox_constructor;
+#line 56 "mn-sylpheed-mailbox.gob"
+ mn_mailbox_class->impl_is = ___3_mn_sylpheed_mailbox_impl_is;
+#line 69 "mn-sylpheed-mailbox.gob"
+ mn_mailbox_class->impl_threaded_check = ___4_mn_sylpheed_mailbox_impl_threaded_check;
+#line 122 "mn-sylpheed-mailbox.c"
+ {
+#line 33 "mn-sylpheed-mailbox.gob"
+
+ MN_MAILBOX_CLASS(class)->format = "Sylpheed";
- gnome_vfs_async_load_directory(&handle,
- mn_mailbox_get_uri(mailbox),
- GNOME_VFS_FILE_INFO_DEFAULT,
- 32,
- GNOME_VFS_PRIORITY_DEFAULT,
- mn_sylpheed_mailbox_check_cb,
- info);
+#line 128 "mn-sylpheed-mailbox.c"
+ }
}
+#undef __GOB_FUNCTION__
-static void
-mn_sylpheed_mailbox_check_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- GList *list,
- unsigned int entries_read,
- gpointer user_data)
+
+
+#line 37 "mn-sylpheed-mailbox.gob"
+static GObject *
+___2_mn_sylpheed_mailbox_constructor (GType type G_GNUC_UNUSED, guint n_construct_properties, GObjectConstructParam * construct_params)
+#line 138 "mn-sylpheed-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): \
+ ((GObject * )0))
{
- CheckInfo *info = user_data;
- GList *l;
-
- MN_LIST_FOREACH(l, list)
- {
- GnomeVFSFileInfo *file_info = l->data;
-
- if (file_info->name[0] != '.')
- {
- if (mn_str_isnumeric(file_info->name))
- info->total_count++;
- }
- else if (! strcmp(file_info->name, ".sylpheed_mark") && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE)
- /*
- * Format of a Sylpheed markfile:
- * int version, int num, int flags, int num, int flags, ...
- */
- info->mark_count = (file_info->size - sizeof(int)) / (sizeof(int) * 2);
- }
-
- if (result != GNOME_VFS_OK) /* we're done */
- {
- if (result != GNOME_VFS_ERROR_EOF)
- mn_mailbox_set_error(MN_MAILBOX(info->mailbox), _("error while reading folder: %s"), gnome_vfs_result_to_string(result));
-
- mn_mailbox_set_has_new(MN_MAILBOX(info->mailbox), info->total_count != info->mark_count);
- mn_mailbox_end_check(MN_MAILBOX(info->mailbox));
-
- g_free(info);
- }
-}
+#define __GOB_FUNCTION__ "MN:Sylpheed:Mailbox::constructor"
+{
+#line 39 "mn-sylpheed-mailbox.gob"
+
+ GObject *object;
+ MNMailbox *self;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = MN_MAILBOX(object);
+
+ mn_mailbox_monitor(self,
+ mn_mailbox_get_uri(self),
+ GNOME_VFS_MONITOR_DIRECTORY,
+ MN_MAILBOX_MONITOR_EVENT_CHANGED
+ | MN_MAILBOX_MONITOR_EVENT_DELETED
+ | MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ return object;
+ }}
+#line 163 "mn-sylpheed-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 56 "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"
+#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"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 179 "mn-sylpheed-mailbox.c"
+{
+#line 58 "mn-sylpheed-mailbox.gob"
+
+ char *markfile_uri;
+ gboolean is;
+
+ markfile_uri = g_build_path("/", uri, ".sylpheed_mark", NULL);
+ is = mn_vfs_test(markfile_uri, G_FILE_TEST_IS_REGULAR);
+ g_free(markfile_uri);
+
+ return is;
+ }}
+#line 192 "mn-sylpheed-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
+
+#line 69 "mn-sylpheed-mailbox.gob"
+static void
+___4_mn_sylpheed_mailbox_impl_threaded_check (MNMailbox * self G_GNUC_UNUSED)
+#line 199 "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"
+ g_return_if_fail (self != NULL);
+#line 69 "mn-sylpheed-mailbox.gob"
+ g_return_if_fail (MN_IS_MAILBOX (self));
+#line 209 "mn-sylpheed-mailbox.c"
+{
+#line 71 "mn-sylpheed-mailbox.gob"
+
+ GnomeVFSResult result;
+ GnomeVFSDirectoryHandle *handle;
+ GnomeVFSFileInfo *file_info;
+ 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);
+ if (result != GNOME_VFS_OK)
+ {
+ GDK_THREADS_ENTER();
+
+ mn_mailbox_set_error(self, _("unable to open folder: %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ return;
+ }
+
+ file_info = gnome_vfs_file_info_new();
+ while ((result = gnome_vfs_directory_read_next(handle, file_info)) == GNOME_VFS_OK)
+ {
+ if (file_info->name[0] != '.')
+ {
+ if (mn_str_isnumeric(file_info->name))
+ total_count++;
+ }
+ else if (! strcmp(file_info->name, ".sylpheed_mark") && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE)
+ /*
+ * Format of a Sylpheed markfile:
+ * int version, int num, int flags, int num, int flags, ...
+ */
+ mark_count = (file_info->size - sizeof(int)) / (sizeof(int) * 2);
+ }
+ gnome_vfs_file_info_unref(file_info);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(self, total_count != mark_count);
+ else
+ mn_mailbox_set_error(self, _("error while reading folder: %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }}
+#line 261 "mn-sylpheed-mailbox.c"
+#undef __GOB_FUNCTION__
+#undef PARENT_HANDLER
diff --git a/src/mn-sylpheed-mailbox.gob b/src/mn-sylpheed-mailbox.gob
@@ -0,0 +1,120 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include "mn-mailbox-private.h"
+#include "mn-vfs.h"
+#include "mn-util.h"
+%}
+
+class MN:Sylpheed:Mailbox from MN:Mailbox
+{
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->format = "Sylpheed";
+ }
+
+ override (G:Object) GObject *
+ constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params)
+ {
+ GObject *object;
+ MNMailbox *self;
+
+ object = PARENT_HANDLER(type, n_construct_properties, construct_params);
+ self = MN_MAILBOX(object);
+
+ mn_mailbox_monitor(self,
+ mn_mailbox_get_uri(self),
+ GNOME_VFS_MONITOR_DIRECTORY,
+ MN_MAILBOX_MONITOR_EVENT_CHANGED
+ | MN_MAILBOX_MONITOR_EVENT_DELETED
+ | MN_MAILBOX_MONITOR_EVENT_CREATED);
+
+ return object;
+ }
+
+ override (MN:Mailbox) gboolean
+ impl_is (MNMailbox *dummy, const char *uri (check null))
+ {
+ char *markfile_uri;
+ gboolean is;
+
+ markfile_uri = g_build_path("/", uri, ".sylpheed_mark", NULL);
+ is = mn_vfs_test(markfile_uri, G_FILE_TEST_IS_REGULAR);
+ g_free(markfile_uri);
+
+ return is;
+ }
+
+ override (MN:Mailbox) void
+ impl_threaded_check (MN:Mailbox *self (check null type))
+ {
+ GnomeVFSResult result;
+ GnomeVFSDirectoryHandle *handle;
+ GnomeVFSFileInfo *file_info;
+ 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);
+ if (result != GNOME_VFS_OK)
+ {
+ GDK_THREADS_ENTER();
+
+ mn_mailbox_set_error(self, _("unable to open folder: %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+
+ return;
+ }
+
+ file_info = gnome_vfs_file_info_new();
+ while ((result = gnome_vfs_directory_read_next(handle, file_info)) == GNOME_VFS_OK)
+ {
+ if (file_info->name[0] != '.')
+ {
+ if (mn_str_isnumeric(file_info->name))
+ total_count++;
+ }
+ else if (! strcmp(file_info->name, ".sylpheed_mark") && file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE)
+ /*
+ * Format of a Sylpheed markfile:
+ * int version, int num, int flags, int num, int flags, ...
+ */
+ mark_count = (file_info->size - sizeof(int)) / (sizeof(int) * 2);
+ }
+ gnome_vfs_file_info_unref(file_info);
+
+ GDK_THREADS_ENTER();
+
+ if (result == GNOME_VFS_ERROR_EOF)
+ mn_mailbox_set_has_new(self, total_count != mark_count);
+ else
+ mn_mailbox_set_error(self, _("error while reading folder: %s"), gnome_vfs_result_to_string(result));
+ mn_mailbox_end_check(self);
+
+ gdk_flush();
+ GDK_THREADS_LEAVE();
+ }
+}
diff --git a/src/mn-sylpheed-mailbox.h b/src/mn-sylpheed-mailbox.h
@@ -1,44 +1,57 @@
-/*
- * 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.
- */
-
-#ifndef _MN_SYLPHEED_MAILBOX_H
-#define _MN_SYLPHEED_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_SYLPHEED_MAILBOX (mn_sylpheed_mailbox_get_type())
-#define MN_SYLPHEED_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_SYLPHEED_MAILBOX, MNSylpheedMailbox))
-#define MN_SYLPHEED_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_SYLPHEED_MAILBOX, MNSylpheedMailboxClass))
-#define MN_IS_SYLPHEED_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_SYLPHEED_MAILBOX))
-#define MN_IS_SYLPHEED_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_SYLPHEED_MAILBOX))
-#define MN_SYLPHEED_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_SYLPHEED_MAILBOX, MNSylpheedMailboxClass))
+#ifndef __MN_SYLPHEED_MAILBOX_H__
+#define __MN_SYLPHEED_MAILBOX_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_SYLPHEED_MAILBOX (mn_sylpheed_mailbox_get_type())
+#define MN_SYLPHEED_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_sylpheed_mailbox_get_type(), MNSylpheedMailbox)
+#define MN_SYLPHEED_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_sylpheed_mailbox_get_type(), MNSylpheedMailbox const)
+#define MN_SYLPHEED_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_sylpheed_mailbox_get_type(), MNSylpheedMailboxClass)
+#define MN_IS_SYLPHEED_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_sylpheed_mailbox_get_type ())
+
+#define MN_SYLPHEED_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_sylpheed_mailbox_get_type(), MNSylpheedMailboxClass)
-typedef struct
-{
- MNMailbox mailbox;
-} MNSylpheedMailbox;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_SYLPHEED_MAILBOX__
+#define __TYPEDEF_MN_SYLPHEED_MAILBOX__
+typedef struct _MNSylpheedMailbox MNSylpheedMailbox;
+#endif
+struct _MNSylpheedMailbox {
+ MNMailbox __parent__;
+};
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNSylpheedMailboxClass;
+/*
+ * Class definition
+ */
+typedef struct _MNSylpheedMailboxClass MNSylpheedMailboxClass;
+struct _MNSylpheedMailboxClass {
+ MNMailboxClass __parent__;
+};
+
+/*
+ * Public methods
+ */
GType mn_sylpheed_mailbox_get_type (void);
-#endif /* _MN_SYLPHEED_MAILBOX_H */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-system-mailbox-properties-private.h b/src/mn-system-mailbox-properties-private.h
@@ -0,0 +1,24 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_SYSTEM_MAILBOX_PROPERTIES_PRIVATE_H__
+#define __MN_SYSTEM_MAILBOX_PROPERTIES_PRIVATE_H__
+
+#include "mn-system-mailbox-properties.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNSystemMailboxPropertiesPrivate {
+#line 35 "mn-system-mailbox-properties.gob"
+ GtkSizeGroup * size_group;
+#line 41 "mn-system-mailbox-properties.gob"
+ const char * system_uri;
+#line 18 "mn-system-mailbox-properties-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-system-mailbox-properties.c b/src/mn-system-mailbox-properties.c
@@ -0,0 +1,334 @@
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 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-system-mailbox-properties.h"
+
+#include "mn-system-mailbox-properties-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 22 "mn-system-mailbox-properties.gob"
+
+#include "config.h"
+#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"
+/* self casting macros */
+#define SELF(x) MN_SYSTEM_MAILBOX_PROPERTIES(x)
+#define SELF_CONST(x) MN_SYSTEM_MAILBOX_PROPERTIES_CONST(x)
+#define IS_SELF(x) MN_IS_SYSTEM_MAILBOX_PROPERTIES(x)
+#define TYPE_SELF MN_TYPE_SYSTEM_MAILBOX_PROPERTIES
+#define SELF_CLASS(x) MN_SYSTEM_MAILBOX_PROPERTIES_CLASS(x)
+
+#define SELF_GET_CLASS(x) MN_SYSTEM_MAILBOX_PROPERTIES_GET_CLASS(x)
+
+/* self typedefs */
+typedef MNSystemMailboxProperties Self;
+typedef MNSystemMailboxPropertiesClass SelfClass;
+
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+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;
+
+enum {
+ PROP_0,
+ PROP_LABEL,
+ PROP_SIZE_GROUP,
+ PROP_COMPLETE
+};
+
+/* pointer to the class of our parent */
+static GtkLabelClass *parent_class = NULL;
+
+/* Short form macros */
+#define self_set_uri mn_system_mailbox_properties_set_uri
+#define self_get_uri mn_system_mailbox_properties_get_uri
+
+
+static void
+___MN_Mailbox_Properties_init (MNMailboxPropertiesIface *iface)
+{
+#line 66 "mn-system-mailbox-properties.gob"
+ iface->set_uri = self_set_uri;
+#line 74 "mn-system-mailbox-properties.gob"
+ iface->get_uri = self_get_uri;
+#line 77 "mn-system-mailbox-properties.c"
+}
+
+GType
+mn_system_mailbox_properties_get_type (void)
+{
+ static GType type = 0;
+
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNSystemMailboxPropertiesClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_system_mailbox_properties_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNSystemMailboxProperties),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_system_mailbox_properties_init,
+ NULL
+ };
+
+ static const GInterfaceInfo MN_Mailbox_Properties_info = {
+ (GInterfaceInitFunc) ___MN_Mailbox_Properties_init,
+ NULL,
+ NULL
+ };
+
+ type = g_type_register_static (GTK_TYPE_LABEL, "MNSystemMailboxProperties", &info, (GTypeFlags)0);
+ g_type_add_interface_static (type,
+ MN_TYPE_MAILBOX_PROPERTIES,
+ &MN_Mailbox_Properties_info);
+ }
+
+ return type;
+}
+
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNSystemMailboxProperties *)g_object_new(mn_system_mailbox_properties_get_type(), NULL))
+
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNSystemMailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNSystemMailboxProperties *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNSystemMailboxProperties *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNSystemMailboxProperties *)g_object_new_valist (mn_system_mailbox_properties_get_type (), first, ap);
+ va_end (ap);
+ return ret;
+}
+
+
+static void
+___dispose (GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::dispose"
+ 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"
+ 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"
+}
+#undef __GOB_FUNCTION__
+
+
+static void
+___finalize(GObject *obj_self)
+{
+#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::finalize"
+ MNSystemMailboxProperties *self G_GNUC_UNUSED = MN_SYSTEM_MAILBOX_PROPERTIES (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+ g_free (priv);
+}
+#undef __GOB_FUNCTION__
+
+static void
+mn_system_mailbox_properties_class_init (MNSystemMailboxPropertiesClass * c G_GNUC_UNUSED)
+{
+#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+
+ parent_class = g_type_class_ref (GTK_TYPE_LABEL);
+
+ 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;
+ {
+ g_object_class_override_property (g_object_class,
+ PROP_LABEL,
+ "label");
+ g_object_class_override_property (g_object_class,
+ PROP_SIZE_GROUP,
+ "size_group");
+ g_object_class_override_property (g_object_class,
+ PROP_COMPLETE,
+ "complete");
+ }
+}
+#undef __GOB_FUNCTION__
+#line 43 "mn-system-mailbox-properties.gob"
+static void
+mn_system_mailbox_properties_init (MNSystemMailboxProperties * self G_GNUC_UNUSED)
+#line 186 "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"
+
+ gtk_label_set_line_wrap(GTK_LABEL(self), TRUE);
+ gtk_misc_set_alignment(GTK_MISC(self), 0.0, 0.5);
+
+ selfp->system_uri = mn_uri_get_system_mailbox();
+ if (selfp->system_uri)
+ {
+ char *path;
+ char *markup;
+
+ path = gnome_vfs_get_local_path_from_uri(selfp->system_uri);
+
+ markup = g_markup_printf_escaped(_("Your system mailbox (<span weight=\"bold\">%s</span>) will be used."), path ? path : selfp->system_uri);
+ gtk_label_set_markup(GTK_LABEL(self), markup);
+ g_free(markup);
+
+ g_free(path);
+ }
+ 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"
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::set_property"
+{
+ MNSystemMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_SYSTEM_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_SIZE_GROUP:
+ {
+#line 36 "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"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::get_property"
+{
+ MNSystemMailboxProperties *self G_GNUC_UNUSED;
+
+ self = MN_SYSTEM_MAILBOX_PROPERTIES (object);
+
+ switch (property_id) {
+ case PROP_LABEL:
+ {
+#line 33 "mn-system-mailbox-properties.gob"
+ g_value_set_string(VAL, _("System Mailbox"));
+#line 265 "mn-system-mailbox-properties.c"
+ }
+ break;
+ case PROP_SIZE_GROUP:
+ {
+#line 36 "mn-system-mailbox-properties.gob"
+g_value_set_object (VAL, (gpointer)self->_priv->size_group);
+#line 272 "mn-system-mailbox-properties.c"
+ }
+ break;
+ case PROP_COMPLETE:
+ {
+#line 39 "mn-system-mailbox-properties.gob"
+ g_value_set_boolean(VAL, selfp->system_uri != NULL);
+#line 279 "mn-system-mailbox-properties.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+#undef __GOB_FUNCTION__
+
+
+
+#line 66 "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"
+{
+#define __GOB_FUNCTION__ "MN:System:Mailbox:Properties::set_uri"
+#line 66 "mn-system-mailbox-properties.gob"
+ g_return_val_if_fail (self != NULL, (gboolean )0);
+#line 66 "mn-system-mailbox-properties.gob"
+ g_return_val_if_fail (MN_IS_MAILBOX_PROPERTIES (self), (gboolean )0);
+#line 66 "mn-system-mailbox-properties.gob"
+ g_return_val_if_fail (uri != NULL, (gboolean )0);
+#line 308 "mn-system-mailbox-properties.c"
+{
+#line 69 "mn-system-mailbox-properties.gob"
+
+ return SELF(self)->_priv->system_uri
+ && ! mn_uri_cmp(uri, SELF(self)->_priv->system_uri);
+ }}
+#line 315 "mn-system-mailbox-properties.c"
+#undef __GOB_FUNCTION__
+
+#line 74 "mn-system-mailbox-properties.gob"
+static char *
+mn_system_mailbox_properties_get_uri (MNMailboxProperties * self)
+#line 321 "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 76 "mn-system-mailbox-properties.gob"
+
+ return g_strdup(SELF(self)->_priv->system_uri);
+ }}
+#line 334 "mn-system-mailbox-properties.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-system-mailbox-properties.gob b/src/mn-system-mailbox-properties.gob
@@ -0,0 +1,79 @@
+/*
+ * 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 <gtk/gtk.h>
+%}
+%{
+#include "config.h"
+#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)
+{
+ property STRING label (override)
+ get { g_value_set_string(VAL, _("System Mailbox")); };
+
+ private GtkSizeGroup *size_group unrefwith g_object_unref;
+ property OBJECT size_group (override, link);
+
+ property BOOLEAN complete (override)
+ get { g_value_set_boolean(VAL, selfp->system_uri != NULL); };
+
+ private const char *system_uri;
+
+ init (self)
+ {
+ gtk_label_set_line_wrap(GTK_LABEL(self), TRUE);
+ gtk_misc_set_alignment(GTK_MISC(self), 0.0, 0.5);
+
+ selfp->system_uri = mn_uri_get_system_mailbox();
+ if (selfp->system_uri)
+ {
+ char *path;
+ char *markup;
+
+ path = gnome_vfs_get_local_path_from_uri(selfp->system_uri);
+
+ markup = g_markup_printf_escaped(_("Your system mailbox (<span weight=\"bold\">%s</span>) will be used."), path ? path : selfp->system_uri);
+ gtk_label_set_markup(GTK_LABEL(self), markup);
+ g_free(markup);
+
+ g_free(path);
+ }
+ else
+ gtk_label_set_text(GTK_LABEL(self), _("The location of your system mailbox could not be detected. Please set the MAIL environment variable."));
+ }
+
+ interface MN:Mailbox:Properties private gboolean
+ set_uri (MN:Mailbox:Properties *self (check null type),
+ const char *uri (check null))
+ {
+ return SELF(self)->_priv->system_uri
+ && ! mn_uri_cmp(uri, SELF(self)->_priv->system_uri);
+ }
+
+ interface MN:Mailbox:Properties private char *
+ get_uri (MN:Mailbox:Properties *self (check null type))
+ {
+ return g_strdup(SELF(self)->_priv->system_uri);
+ }
+}
diff --git a/src/mn-system-mailbox-properties.h b/src/mn-system-mailbox-properties.h
@@ -0,0 +1,78 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#include <glib.h>
+#include <glib-object.h>
+
+
+#include <gtk/gtk.h>
+
+#ifndef __MN_SYSTEM_MAILBOX_PROPERTIES_H__
+#define __MN_SYSTEM_MAILBOX_PROPERTIES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_SYSTEM_MAILBOX_PROPERTIES (mn_system_mailbox_properties_get_type())
+#define MN_SYSTEM_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_system_mailbox_properties_get_type(), MNSystemMailboxProperties)
+#define MN_SYSTEM_MAILBOX_PROPERTIES_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_system_mailbox_properties_get_type(), MNSystemMailboxProperties const)
+#define MN_SYSTEM_MAILBOX_PROPERTIES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_system_mailbox_properties_get_type(), MNSystemMailboxPropertiesClass)
+#define MN_IS_SYSTEM_MAILBOX_PROPERTIES(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_system_mailbox_properties_get_type ())
+
+#define MN_SYSTEM_MAILBOX_PROPERTIES_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_system_mailbox_properties_get_type(), MNSystemMailboxPropertiesClass)
+
+/* Private structure type */
+typedef struct _MNSystemMailboxPropertiesPrivate MNSystemMailboxPropertiesPrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_SYSTEM_MAILBOX_PROPERTIES__
+#define __TYPEDEF_MN_SYSTEM_MAILBOX_PROPERTIES__
+typedef struct _MNSystemMailboxProperties MNSystemMailboxProperties;
+#endif
+struct _MNSystemMailboxProperties {
+ GtkLabel __parent__;
+ /*< private >*/
+ MNSystemMailboxPropertiesPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNSystemMailboxPropertiesClass MNSystemMailboxPropertiesClass;
+struct _MNSystemMailboxPropertiesClass {
+ GtkLabelClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType mn_system_mailbox_properties_get_type (void);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_SYSTEM_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label", __extension__ ({gchar **z = (arg); z;})
+#define MN_SYSTEM_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject *z = (arg); z;})
+#define MN_SYSTEM_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group", __extension__ ({GObject **z = (arg); z;})
+#define MN_SYSTEM_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete", __extension__ ({gboolean *z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_SYSTEM_MAILBOX_PROPERTIES_GET_PROP_LABEL(arg) "label",(gchar **)(arg)
+#define MN_SYSTEM_MAILBOX_PROPERTIES_PROP_SIZE_GROUP(arg) "size_group",(GObject *)(arg)
+#define MN_SYSTEM_MAILBOX_PROPERTIES_GET_PROP_SIZE_GROUP(arg) "size_group",(GObject **)(arg)
+#define MN_SYSTEM_MAILBOX_PROPERTIES_GET_PROP_COMPLETE(arg) "complete",(gboolean *)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-ui.c b/src/mn-ui.c
@@ -1,284 +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 <gnome.h>
-#include "mn-mail-icon.h"
-#include "mn-preferences.h"
-#include "mn-dialog.h"
-#include "mn-util.h"
-#include "mn-conf.h"
-#include "mn-mailboxes.h"
-#include "mn-stock.h"
-#include "mn-unsupported-mailbox.h"
-
-/*** variables ***************************************************************/
-
-static MNMailIcon *mail_icon;
-static GtkWidget *update_item;
-
-/*** functions ***************************************************************/
-
-static void mn_ui_icon_init (void);
-static void mn_ui_icon_activate_h (MNMailIcon *icon,
- gpointer user_data);
-static void mn_ui_icon_destroy_h (GtkObject *object,
- gpointer user_data);
-
-/*** implementation **********************************************************/
-
-void
-mn_ui_init (void)
-{
- mn_ui_icon_init();
-}
-
-static void
-mn_ui_icon_init (void)
-{
- GtkWidget *menu;
-
- mail_icon = MN_MAIL_ICON(mn_mail_icon_new());
-
- mn_create_interface("menu",
- "menu", &menu,
- "update", &update_item,
- NULL);
- mn_mail_icon_set_popup_menu(mail_icon, GTK_MENU(menu));
-
- g_signal_connect(G_OBJECT(mail_icon), "activate",
- G_CALLBACK(mn_ui_icon_activate_h), NULL);
- g_signal_connect(G_OBJECT(mail_icon), "destroy",
- G_CALLBACK(mn_ui_icon_destroy_h), NULL);
-
- gtk_widget_show(GTK_WIDGET(mail_icon));
-}
-
-static void
-mn_ui_icon_activate_h (MNMailIcon *icon, gpointer user_data)
-{
- if (eel_gconf_get_boolean(MN_CONF_COMMANDS_CLICKED_ENABLED))
- {
- char *command;
-
- command = eel_gconf_get_string(MN_CONF_COMMANDS_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 clicked command: %s."),
- err->message);
- g_error_free(err);
- }
-
- g_free(command);
- }
- }
-}
-
-static void
-mn_ui_icon_destroy_h (GtkObject *object, gpointer user_data)
-{
- /* The Notification Area applet has been terminated. Recreate the icon. */
- mn_ui_icon_init();
-}
-
-void
-mn_ui_update_sensitivity (void)
-{
- gboolean has_manual = FALSE;
- GSList *l;
-
- MN_LIST_FOREACH(l, mn_mailboxes_get())
- {
- MNMailbox *mailbox = l->data;
-
- if (MN_MAILBOX_GET_CLASS(mailbox)->check && ! mn_mailbox_get_automatic(mailbox))
- {
- has_manual = TRUE;
- break;
- }
- }
-
- gtk_widget_set_sensitive(update_item, has_manual);
-}
-
-void
-mn_ui_update_icon (void)
-{
- GSList *mailboxes;
- const char *stock_id;
- GString *tooltip;
-
- mailboxes = mn_mailboxes_get();
- if (mailboxes)
- {
- GSList *l;
- int n_new = 0;
- int n_error = 0;
- int n_unsupported = 0;
- GString *new_string;
- GString *error_string;
- GString *unsupported_string;
-
- new_string = g_string_new(NULL);
- error_string = g_string_new(NULL);
- unsupported_string = g_string_new(NULL);
-
- MN_LIST_FOREACH(l, mn_mailboxes_get())
- {
- MNMailbox *mailbox = l->data;
- const char *name;
- const char *error;
-
- name = mn_mailbox_get_name(mailbox);
- error = mn_mailbox_get_error(mailbox);
-
- if (mn_mailbox_get_has_new(mailbox))
- {
- n_new++;
- if (*new_string->str)
- g_string_append_c(new_string, '\n');
- g_string_append_printf(new_string, " %s", name);
- }
-
- if (error)
- {
- n_error++;
- if (*error_string->str)
- g_string_append_c(error_string, '\n');
- g_string_append_printf(error_string, " %s (%s)", name, error);
- }
-
- if (MN_IS_UNSUPPORTED_MAILBOX(mailbox))
- {
- n_unsupported++;
- if (*unsupported_string->str)
- g_string_append_c(unsupported_string, '\n');
- g_string_append_printf(unsupported_string, " %s (%s)", name, mn_unsupported_mailbox_get_reason(MN_UNSUPPORTED_MAILBOX(mailbox)));
- }
- }
-
- if (n_new > 0)
- {
- stock_id = n_error > 0 ? MN_STOCK_MAIL_ERROR : MN_STOCK_MAIL;
- g_string_prepend(new_string, ngettext("The following mailbox has new mail:\n",
- "The following mailboxes have new mail:\n",
- n_new));
- }
- else
- {
- stock_id = n_error > 0 ? MN_STOCK_NO_MAIL_ERROR : MN_STOCK_NO_MAIL;
- g_string_prepend(new_string, _("You have no new mail."));
- }
-
- if (n_error > 0)
- g_string_prepend(error_string, ngettext("The following mailbox reported an error:\n",
- "The following mailboxes reported an error:\n",
- n_error));
-
- if (n_unsupported > 0)
- g_string_prepend(unsupported_string, ngettext("The following mailbox is unsupported:\n",
- "The following mailboxes are unsupported:\n",
- n_unsupported));
-
- tooltip = g_string_new(new_string->str);
- if (n_error > 0)
- g_string_append_printf(tooltip, "\n\n%s", error_string->str);
- if (n_unsupported > 0)
- g_string_append_printf(tooltip, "\n\n%s", unsupported_string->str);
-
- g_string_free(new_string, TRUE);
- g_string_free(error_string, TRUE);
- g_string_free(unsupported_string, TRUE);
- }
- else
- {
- stock_id = MN_STOCK_NO_MAIL;
- tooltip = g_string_new(_("No mailboxes are being monitored."));
- }
-
- mn_mail_icon_set_from_stock(mail_icon, stock_id);
- mn_mail_icon_set_tooltip(mail_icon, tooltip->str);
-
- g_string_free(tooltip, TRUE);
-}
-
-/* libglade callbacks */
-
-void
-mn_ui_update_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- mn_mailboxes_check();
-}
-
-void
-mn_ui_preferences_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- mn_preferences_display();
-}
-
-void
-mn_ui_help_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- mn_display_help(NULL);
-}
-
-void
-mn_ui_about_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- static const char *authors[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
- static const char *documenters[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
- GdkPixbuf *logo;
- GdkPixbuf *icon;
- static GtkWidget *about = NULL;
-
- if (about)
- {
- gtk_window_present(GTK_WINDOW(about));
- return;
- }
-
- logo = mn_pixbuf_new("logo.png");
- about = gnome_about_new(_("Mail Notification"),
- VERSION,
- "Copyright \302\251 2003, 2004 Jean-Yves Lefort",
- _("A Mail Notification Icon"),
- authors,
- documenters,
- _("Jean-Yves Lefort <jylefort@brutele.be>"),
- logo);
- g_object_unref(logo);
-
- icon = mn_pixbuf_new("about-icon.png");
- gtk_window_set_icon(GTK_WINDOW(about), icon);
- g_object_unref(icon);
-
- g_object_add_weak_pointer(G_OBJECT(about), (gpointer *) &about);
- gtk_widget_show(GTK_WIDGET(about));
-}
-
-void
-mn_ui_quit_activate_h (GtkMenuItem *menuitem, gpointer user_data)
-{
- gtk_main_quit();
-}
diff --git a/src/mn-ui.h b/src/mn-ui.h
@@ -1,28 +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.
- */
-
-#ifndef _MN_UI_H
-#define _MN_UI_H
-
-#include <glib.h>
-
-void mn_ui_init (void);
-void mn_ui_update_sensitivity (void);
-void mn_ui_update_icon (void);
-
-#endif /* _MN_UI_H */
diff --git a/src/mn-unsupported-mailbox-private.h b/src/mn-unsupported-mailbox-private.h
@@ -0,0 +1,22 @@
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+
+#ifndef __MN_UNSUPPORTED_MAILBOX_PRIVATE_H__
+#define __MN_UNSUPPORTED_MAILBOX_PRIVATE_H__
+
+#include "mn-unsupported-mailbox.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct _MNUnsupportedMailboxPrivate {
+#line 30 "mn-unsupported-mailbox.gob"
+ char * reason;
+#line 16 "mn-unsupported-mailbox-private.h"
+};
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/src/mn-unsupported-mailbox.c b/src/mn-unsupported-mailbox.c
@@ -1,185 +1,266 @@
-/*
- * 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.
- */
+/* Generated by GOB (v2.0.9) on Mon Aug 16 18:13:53 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 <string.h> /* memset() */
-#include "config.h"
-#include <glib/gi18n-lib.h>
#include "mn-unsupported-mailbox.h"
-#include "mn-stock.h"
-/*** types *******************************************************************/
+#include "mn-unsupported-mailbox-private.h"
-enum {
- PROP_0,
- PROP_REASON
-};
+#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 */
-struct _MNUnsupportedMailboxPrivate
-{
- char *reason;
-};
+#line 22 "mn-unsupported-mailbox.gob"
-/*** variables ***************************************************************/
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include "mn-stock.h"
+
+#line 33 "mn-unsupported-mailbox.c"
+/* self casting macros */
+#define SELF(x) MN_UNSUPPORTED_MAILBOX(x)
+#define SELF_CONST(x) MN_UNSUPPORTED_MAILBOX_CONST(x)
+#define IS_SELF(x) MN_IS_UNSUPPORTED_MAILBOX(x)
+#define TYPE_SELF MN_TYPE_UNSUPPORTED_MAILBOX
+#define SELF_CLASS(x) MN_UNSUPPORTED_MAILBOX_CLASS(x)
-static GObjectClass *parent_class = NULL;
+#define SELF_GET_CLASS(x) MN_UNSUPPORTED_MAILBOX_GET_CLASS(x)
-/*** functions ***************************************************************/
+/* self typedefs */
+typedef MNUnsupportedMailbox Self;
+typedef MNUnsupportedMailboxClass SelfClass;
-static void mn_unsupported_mailbox_class_init (MNUnsupportedMailboxClass *class);
-static void mn_unsupported_mailbox_init (MNUnsupportedMailbox *mailbox);
-static void mn_unsupported_mailbox_finalize (GObject *object);
+/* here are local prototypes */
+static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
+static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
+static void mn_unsupported_mailbox_init (MNUnsupportedMailbox * o) G_GNUC_UNUSED;
+static void mn_unsupported_mailbox_class_init (MNUnsupportedMailboxClass * class) G_GNUC_UNUSED;
-static void mn_unsupported_mailbox_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void mn_unsupported_mailbox_get_property (GObject *object,
- unsigned int prop_id,
- GValue *value,
- GParamSpec *pspec);
+enum {
+ PROP_0,
+ PROP_REASON
+};
-/*** implementation **********************************************************/
+/* pointer to the class of our parent */
+static MNMailboxClass *parent_class = NULL;
+/* Short form macros */
+#define self_get_reason mn_unsupported_mailbox_get_reason
+#define self_new mn_unsupported_mailbox_new
GType
mn_unsupported_mailbox_get_type (void)
{
- static GType unsupported_mailbox_type = 0;
-
- if (! unsupported_mailbox_type)
- {
- static const GTypeInfo unsupported_mailbox_info = {
- sizeof(MNUnsupportedMailboxClass),
- NULL,
- NULL,
- (GClassInitFunc) mn_unsupported_mailbox_class_init,
- NULL,
- NULL,
- sizeof(MNUnsupportedMailbox),
- 0,
- (GInstanceInitFunc) mn_unsupported_mailbox_init
- };
-
- unsupported_mailbox_type = g_type_register_static(MN_TYPE_MAILBOX,
- "MNUnsupportedMailbox",
- &unsupported_mailbox_info,
- 0);
- }
-
- return unsupported_mailbox_type;
-}
+ static GType type = 0;
-static void
-mn_unsupported_mailbox_class_init (MNUnsupportedMailboxClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- MNMailboxClass *mailbox_class = MN_MAILBOX_CLASS(class);
+ if ___GOB_UNLIKELY(type == 0) {
+ static const GTypeInfo info = {
+ sizeof (MNUnsupportedMailboxClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mn_unsupported_mailbox_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL /* class_data */,
+ sizeof (MNUnsupportedMailbox),
+ 0 /* n_preallocs */,
+ (GInstanceInitFunc) mn_unsupported_mailbox_init,
+ NULL
+ };
- parent_class = g_type_class_peek_parent(class);
+ type = g_type_register_static (MN_TYPE_MAILBOX, "MNUnsupportedMailbox", &info, (GTypeFlags)0);
+ }
- object_class->set_property = mn_unsupported_mailbox_set_property;
- object_class->get_property = mn_unsupported_mailbox_get_property;
- object_class->finalize = mn_unsupported_mailbox_finalize;
+ return type;
+}
- mailbox_class->stock_id = MN_STOCK_UNSUPPORTED;
- mailbox_class->format = _("unsupported");
+/* a macro for creating a new object of our type */
+#define GET_NEW ((MNUnsupportedMailbox *)g_object_new(mn_unsupported_mailbox_get_type(), NULL))
- g_object_class_install_property(object_class,
- PROP_REASON,
- g_param_spec_string("reason",
- _("Reason"),
- _("The reason why the mailbox is unsupported"),
- NULL,
- G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY));
+/* a function for creating a new object of our type */
+#include <stdarg.h>
+static MNUnsupportedMailbox * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
+static MNUnsupportedMailbox *
+GET_NEW_VARG (const char *first, ...)
+{
+ MNUnsupportedMailbox *ret;
+ va_list ap;
+ va_start (ap, first);
+ ret = (MNUnsupportedMailbox *)g_object_new_valist (mn_unsupported_mailbox_get_type (), first, ap);
+ va_end (ap);
+ return ret;
}
+
static void
-mn_unsupported_mailbox_init (MNUnsupportedMailbox *mailbox)
+___finalize(GObject *obj_self)
{
- mailbox->priv = g_new0(MNUnsupportedMailboxPrivate, 1);
+#define __GOB_FUNCTION__ "MN:Unsupported:Mailbox::finalize"
+ MNUnsupportedMailbox *self G_GNUC_UNUSED = MN_UNSUPPORTED_MAILBOX (obj_self);
+ gpointer priv = self->_priv;
+ if(G_OBJECT_CLASS(parent_class)->finalize) \
+ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+#line 30 "mn-unsupported-mailbox.gob"
+ if(self->_priv->reason) { ((*(void (*)(void *))g_free)) (self->_priv->reason); self->_priv->reason = NULL; }
+#line 117 "mn-unsupported-mailbox.c"
+ g_free (priv);
}
+#undef __GOB_FUNCTION__
-static void
-mn_unsupported_mailbox_finalize (GObject *object)
+static void
+mn_unsupported_mailbox_init (MNUnsupportedMailbox * o G_GNUC_UNUSED)
{
- MNUnsupportedMailbox *mailbox = MN_UNSUPPORTED_MAILBOX(object);
-
- g_free(mailbox->priv->reason);
- g_free(mailbox->priv);
-
- G_OBJECT_CLASS(parent_class)->finalize(object);
+#define __GOB_FUNCTION__ "MN:Unsupported:Mailbox::init"
+ o->_priv = g_new0 (MNUnsupportedMailboxPrivate, 1);
}
-
-static void
-mn_unsupported_mailbox_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+#undef __GOB_FUNCTION__
+#line 35 "mn-unsupported-mailbox.gob"
+static void
+mn_unsupported_mailbox_class_init (MNUnsupportedMailboxClass * class G_GNUC_UNUSED)
+#line 132 "mn-unsupported-mailbox.c"
{
- MNUnsupportedMailbox *mailbox = MN_UNSUPPORTED_MAILBOX(object);
+#define __GOB_FUNCTION__ "MN:Unsupported:Mailbox::class_init"
+ GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
- switch (prop_id)
+ parent_class = g_type_class_ref (MN_TYPE_MAILBOX);
+
+ g_object_class->finalize = ___finalize;
+ g_object_class->get_property = ___object_get_property;
+ g_object_class->set_property = ___object_set_property;
{
- case PROP_REASON:
- g_return_if_fail(mailbox->priv->reason == NULL);
- mailbox->priv->reason = g_value_dup_string(value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
+ GParamSpec *param_spec;
+
+ param_spec = g_param_spec_string
+ ("reason" /* name */,
+ NULL /* nick */,
+ _("The reason why the mailbox is unsupported") /* blurb */,
+ NULL /* default_value */,
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (g_object_class,
+ PROP_REASON,
+ param_spec);
}
+ {
+#line 36 "mn-unsupported-mailbox.gob"
+
+ MN_MAILBOX_CLASS(class)->stock_id = MN_STOCK_UNSUPPORTED;
+ MN_MAILBOX_CLASS(class)->format = _("unsupported");
+
+#line 161 "mn-unsupported-mailbox.c"
+ }
}
+#undef __GOB_FUNCTION__
static void
-mn_unsupported_mailbox_get_property (GObject *object,
- unsigned int prop_id,
- GValue *value,
- GParamSpec *pspec)
+___object_set_property (GObject *object,
+ guint property_id,
+ const GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Unsupported:Mailbox::set_property"
{
- MNUnsupportedMailbox *mailbox = MN_UNSUPPORTED_MAILBOX(object);
+ MNUnsupportedMailbox *self G_GNUC_UNUSED;
- switch (prop_id)
- {
- case PROP_REASON:
- g_value_set_string(value, mn_unsupported_mailbox_get_reason(mailbox));
- break;
+ self = MN_UNSUPPORTED_MAILBOX (object);
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
+ switch (property_id) {
+ case PROP_REASON:
+ {
+#line 31 "mn-unsupported-mailbox.gob"
+{ char *old = self->_priv->reason; self->_priv->reason = g_value_dup_string (VAL); g_free (old); }
+#line 182 "mn-unsupported-mailbox.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
}
+#undef __GOB_FUNCTION__
-const char *
-mn_unsupported_mailbox_get_reason (MNUnsupportedMailbox *mailbox)
+static void
+___object_get_property (GObject *object,
+ guint property_id,
+ GValue *VAL G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED)
+#define __GOB_FUNCTION__ "MN:Unsupported:Mailbox::get_property"
{
- g_return_val_if_fail(MN_IS_UNSUPPORTED_MAILBOX(mailbox), NULL);
+ MNUnsupportedMailbox *self G_GNUC_UNUSED;
+
+ self = MN_UNSUPPORTED_MAILBOX (object);
- return mailbox->priv->reason;
+ switch (property_id) {
+ case PROP_REASON:
+ {
+#line 31 "mn-unsupported-mailbox.gob"
+g_value_set_string (VAL, self->_priv->reason);
+#line 213 "mn-unsupported-mailbox.c"
+ }
+ break;
+ default:
+/* Apparently in g++ this is needed, glib is b0rk */
+#ifndef __PRETTY_FUNCTION__
+# undef G_STRLOC
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
}
+#undef __GOB_FUNCTION__
+
-MNMailbox *
-mn_unsupported_mailbox_new (const char *uri, const char *reason)
+#line 33 "mn-unsupported-mailbox.gob"
+const char *
+mn_unsupported_mailbox_get_reason (MNUnsupportedMailbox * self)
+#line 232 "mn-unsupported-mailbox.c"
{
- g_return_val_if_fail(uri != NULL, NULL);
- g_return_val_if_fail(reason != NULL, NULL);
+#define __GOB_FUNCTION__ "MN:Unsupported:Mailbox::get_reason"
+#line 33 "mn-unsupported-mailbox.gob"
+ g_return_val_if_fail (self != NULL, (const char * )0);
+#line 33 "mn-unsupported-mailbox.gob"
+ g_return_val_if_fail (MN_IS_UNSUPPORTED_MAILBOX (self), (const char * )0);
+#line 239 "mn-unsupported-mailbox.c"
+{
+#line 33 "mn-unsupported-mailbox.gob"
+ return selfp->reason; }}
+#line 243 "mn-unsupported-mailbox.c"
+#undef __GOB_FUNCTION__
- return g_object_new(MN_TYPE_UNSUPPORTED_MAILBOX,
- "uri", uri,
- "reason", reason,
- NULL);
-}
+
+#line 41 "mn-unsupported-mailbox.gob"
+MNMailbox *
+mn_unsupported_mailbox_new (const char * 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 (reason != NULL, (MNMailbox * )0);
+#line 257 "mn-unsupported-mailbox.c"
+{
+#line 44 "mn-unsupported-mailbox.gob"
+
+ return g_object_new(TYPE_SELF,
+ MN_MAILBOX_PROP_URI((char *) uri),
+ MN_UNSUPPORTED_MAILBOX_PROP_REASON((char *) reason),
+ NULL);
+ }}
+#line 266 "mn-unsupported-mailbox.c"
+#undef __GOB_FUNCTION__
diff --git a/src/mn-unsupported-mailbox.gob b/src/mn-unsupported-mailbox.gob
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+%headertop{
+#include "mn-mailbox.h"
+%}
+%{
+#include "config.h"
+#include <glib/gi18n-lib.h>
+#include "mn-stock.h"
+%}
+
+class MN:Unsupported:Mailbox from MN:Mailbox
+{
+ private char *reason destroywith g_free;
+ property STRING reason (blurb = _("The reason why the mailbox is unsupported"),
+ link);
+ public const char *get_reason (self) { return selfp->reason; }
+
+ class_init (class)
+ {
+ MN_MAILBOX_CLASS(class)->stock_id = MN_STOCK_UNSUPPORTED;
+ MN_MAILBOX_CLASS(class)->format = _("unsupported");
+ }
+
+ public MNMailbox *
+ new (const char *uri (check null),
+ const char *reason (check null))
+ {
+ return g_object_new(TYPE_SELF,
+ MN_MAILBOX_PROP_URI((char *) uri),
+ MN_UNSUPPORTED_MAILBOX_PROP_REASON((char *) reason),
+ NULL);
+ }
+}
diff --git a/src/mn-unsupported-mailbox.h b/src/mn-unsupported-mailbox.h
@@ -1,51 +1,77 @@
-/*
- * 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.
- */
-
-#ifndef _MN_UNSUPPORTED_MAILBOX_H
-#define _MN_UNSUPPORTED_MAILBOX_H
+/* Generated by GOB (v2.0.9) (do not edit directly) */
+#include <glib.h>
#include <glib-object.h>
+
+
#include "mn-mailbox.h"
-#define MN_TYPE_UNSUPPORTED_MAILBOX (mn_unsupported_mailbox_get_type())
-#define MN_UNSUPPORTED_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MN_TYPE_UNSUPPORTED_MAILBOX, MNUnsupportedMailbox))
-#define MN_UNSUPPORTED_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MN_TYPE_UNSUPPORTED_MAILBOX, MNUnsupportedMailboxClass))
-#define MN_IS_UNSUPPORTED_MAILBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MN_TYPE_UNSUPPORTED_MAILBOX))
-#define MN_IS_UNSUPPORTED_MAILBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MN_TYPE_UNSUPPORTED_MAILBOX))
-#define MN_UNSUPPORTED_MAILBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MN_TYPE_UNSUPPORTED_MAILBOX, MNUnsupportedMailboxClass))
+#ifndef __MN_UNSUPPORTED_MAILBOX_H__
+#define __MN_UNSUPPORTED_MAILBOX_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/*
+ * Type checking and casting macros
+ */
+#define MN_TYPE_UNSUPPORTED_MAILBOX (mn_unsupported_mailbox_get_type())
+#define MN_UNSUPPORTED_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_unsupported_mailbox_get_type(), MNUnsupportedMailbox)
+#define MN_UNSUPPORTED_MAILBOX_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), mn_unsupported_mailbox_get_type(), MNUnsupportedMailbox const)
+#define MN_UNSUPPORTED_MAILBOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), mn_unsupported_mailbox_get_type(), MNUnsupportedMailboxClass)
+#define MN_IS_UNSUPPORTED_MAILBOX(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_unsupported_mailbox_get_type ())
+#define MN_UNSUPPORTED_MAILBOX_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), mn_unsupported_mailbox_get_type(), MNUnsupportedMailboxClass)
+
+/* Private structure type */
typedef struct _MNUnsupportedMailboxPrivate MNUnsupportedMailboxPrivate;
-typedef struct
-{
- MNMailbox mailbox;
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_MN_UNSUPPORTED_MAILBOX__
+#define __TYPEDEF_MN_UNSUPPORTED_MAILBOX__
+typedef struct _MNUnsupportedMailbox MNUnsupportedMailbox;
+#endif
+struct _MNUnsupportedMailbox {
+ MNMailbox __parent__;
+ /*< private >*/
+ MNUnsupportedMailboxPrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _MNUnsupportedMailboxClass MNUnsupportedMailboxClass;
+struct _MNUnsupportedMailboxClass {
+ MNMailboxClass __parent__;
+};
- MNUnsupportedMailboxPrivate *priv;
-} MNUnsupportedMailbox;
-typedef struct
-{
- MNMailboxClass mailbox_class;
-} MNUnsupportedMailboxClass;
+/*
+ * Public methods
+ */
+GType mn_unsupported_mailbox_get_type (void);
+const char * mn_unsupported_mailbox_get_reason (MNUnsupportedMailbox * self);
+MNMailbox * mn_unsupported_mailbox_new (const char * uri,
+ const char * reason);
+
+/*
+ * Argument wrapping macros
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define MN_UNSUPPORTED_MAILBOX_PROP_REASON(arg) "reason", __extension__ ({gchar *z = (arg); z;})
+#define MN_UNSUPPORTED_MAILBOX_GET_PROP_REASON(arg) "reason", __extension__ ({gchar **z = (arg); z;})
+#else /* __GNUC__ && !__STRICT_ANSI__ */
+#define MN_UNSUPPORTED_MAILBOX_PROP_REASON(arg) "reason",(gchar *)(arg)
+#define MN_UNSUPPORTED_MAILBOX_GET_PROP_REASON(arg) "reason",(gchar **)(arg)
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
-GType mn_unsupported_mailbox_get_type (void);
-MNMailbox *mn_unsupported_mailbox_new (const char *uri, const char *reason);
-const char *mn_unsupported_mailbox_get_reason (MNUnsupportedMailbox *mailbox);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
-#endif /* _MN_UNSUPPORTED_MAILBOX_H */
+#endif
diff --git a/src/mn-uri.c b/src/mn-uri.c
@@ -17,7 +17,8 @@
*/
#include "config.h"
-#include <stdlib.h>
+#include <stdio.h> /* required by stdlib.h on Darwin */
+#include <stdlib.h> /* required by sys/socket.h on Darwin */
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -32,6 +33,22 @@
static gboolean mn_uri_is_ipv6_address (const char *hostname);
+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);
+
/*** implementation **********************************************************/
static gboolean
@@ -44,9 +61,184 @@ mn_uri_is_ipv6_address (const char *hostname)
return inet_pton(AF_INET6, hostname, dummy) == 1;
}
+/**
+ * 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;
+
+ g_return_val_if_fail(scheme != NULL, NULL);
+
+ uri = g_string_new(scheme);
+ g_string_append(uri, "://");
+
+ if (username)
+ g_string_append(uri, username);
+ if (password)
+ g_string_append_printf(uri, ":%s", password);
+ if (authmech)
+ g_string_append_printf(uri, ";auth=%s", authmech);
+ if (hostname)
+ g_string_append_printf(uri, mn_uri_is_ipv6_address(hostname) ? "@[%s]" : "@%s", hostname);
+ if (port >= 0)
+ {
+ g_return_val_if_fail(hostname != NULL, NULL);
+ g_string_append_printf(uri, ":%i", port);
+ }
+ if (path)
+ g_string_append_printf(uri, "/%s", path);
+
+ return g_string_free(uri, FALSE);
+}
+
+/**
+ * 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, 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 n1;
+ char scheme_buf[513];
+ char auth_buf[513];
+ char host_buf[513];
+
+ g_return_val_if_fail(uri != NULL, FALSE);
+
+ n1 = sscanf(uri, "%512[^:]://%512[^@]@%512s", scheme_buf, auth_buf, host_buf);
+ if (n1 > 0)
+ {
+ char username_buf[513];
+ char password_buf[513];
+ char authmech_buf[513];
+ char hostname_buf[513];
+ int _port;
+ char path_buf[513];
+ gboolean has_username = FALSE;
+ gboolean has_password = FALSE;
+ gboolean has_authmech = FALSE;
+ gboolean has_hostname = FALSE;
+ gboolean has_port = FALSE;
+ gboolean has_path = FALSE;
+
+ if (n1 > 1)
+ {
+ int n2;
+
+ n2 = sscanf(auth_buf, "%512[^:]:%512[^;];auth=%512s", username_buf, password_buf, authmech_buf);
+ has_username = n2 > 0;
+ has_password = n2 > 1;
+ has_authmech = n2 > 2;
+
+ if (n1 > 2)
+ {
+ int n3;
+ char hostport_buf[513];
+
+ n3 = sscanf(host_buf, "%512[^/]/%512s", hostport_buf, path_buf);
+ has_path = n3 > 1;
+
+ if (n3 > 0)
+ {
+ int n4;
+
+ n4 = sscanf(hostport_buf, "[%512[^]]]:%i", hostname_buf, &_port);
+ if (n4 == 0)
+ n4 = sscanf(hostport_buf, "%512[^:]:%i", hostname_buf, &_port);
+
+ has_hostname = n4 > 0;
+ has_port = n4 > 1;
+ }
+ }
+ }
+
+ if (scheme)
+ *scheme = g_strdup(scheme_buf);
+ if (username)
+ *username = has_username ? g_strdup(username_buf) : NULL;
+ if (password)
+ *password = has_password ? g_strdup(password_buf) : NULL;
+ if (authmech)
+ *authmech = has_authmech ? g_strdup(authmech_buf) : NULL;
+ if (hostname)
+ *hostname = has_hostname ? g_strdup(hostname_buf) : NULL;
+ if (port)
+ *port = has_port ? _port : -1;
+ if (path)
+ *path = has_path ? g_strdup(path_buf) : NULL;
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+/**
+ * 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 (const char *username,
+mn_uri_build_pop (gboolean ssl,
+ const char *username,
const char *password,
+ const char *authmech,
const char *hostname,
int port)
{
@@ -54,171 +246,340 @@ mn_uri_build_pop (const char *username,
g_return_val_if_fail(password != NULL, NULL);
g_return_val_if_fail(hostname != NULL, NULL);
- if (mn_uri_is_ipv6_address(hostname))
- return port == 110
- ? g_strdup_printf("pop://%s:%s@[%s]", username, password, hostname)
- : g_strdup_printf("pop://%s:%s@[%s]:%i", username, password, hostname, port);
- else
- return port == 110
- ? g_strdup_printf("pop://%s:%s@%s", username, password, hostname)
- : g_strdup_printf("pop://%s:%s@%s:%i", username, password, hostname, port);
+ return mn_uri_build_generic(ssl ? "pops" : "pop",
+ username,
+ password,
+ authmech,
+ hostname,
+ port == MN_URI_POP3_PORT(ssl) ? -1 : port,
+ NULL);
}
-/*
- * Parse a POP URI.
+/**
+ * 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
*
- * About compliance:
+ * Parses a RFC 1738 pop or pops URI.
*
- * We comply with RFC 1738, but for obvious reasons we require <user>
- * and <password>. We do not comply with RFC 2384 because it forbids
- * <password>.
+ * WARNING: the parsing is very lax, this function is NOT intended to
+ * be used on untrusted URIs.
*
- * For IPv6 addresses, we comply with RFC 2732.
- */
+ * 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 *username_start;
- char *username_end;
- char *password_start;
- char *password_end;
- char *hostname_start;
- char *hostname_end;
- char *port_start = NULL;
+ 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 (strncmp(uri, "pop://", 6))
- return FALSE;
-
- username_start = (char *) uri + 6;
- username_end = strchr(username_start, ':');
- if (! username_end)
- return FALSE;
-
- password_start = username_end + 1;
- password_end = strchr(password_start, '@');
- if (! password_end)
- return FALSE;
-
- hostname_start = password_end + 1;
- if (*hostname_start == '[')
+ if (mn_uri_parse_generic(uri,
+ &scheme,
+ &_username,
+ &_password,
+ &_authmech,
+ &_hostname,
+ &_port,
+ NULL))
{
- hostname_end = strchr(++hostname_start, ']');
- if (hostname_end)
+ gboolean _ssl;
+
+ if (_hostname)
{
- if (hostname_end[1])
+ if (! strcmp(scheme, "pop"))
+ {
+ is_pop = TRUE;
+ _ssl = FALSE;
+ }
+ else if (! strcmp(scheme, "pops"))
{
- if (hostname_end[1] != ':')
- return FALSE;
- port_start = hostname_end + 2;
+ is_pop = TRUE;
+ _ssl = TRUE;
}
}
- else
- return FALSE;
+
+ if (is_pop)
+ {
+ 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);
+ }
+
+ g_free(scheme);
+ g_free(_username);
+ g_free(_password);
+ g_free(_authmech);
+ g_free(_hostname);
}
- else
+
+ return is_pop;
+}
+
+/**
+ * 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);
+}
+
+/**
+ * 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))
{
- hostname_end = strchr(hostname_start, ':');
- if (hostname_end)
- port_start = hostname_end + 1;
- else
+ gboolean _ssl;
+
+ if (_hostname)
{
- hostname_end = strchr(hostname_start, 0);
- g_return_val_if_fail(hostname_end != NULL, FALSE);
+ if (! strcmp(scheme, "imap"))
+ {
+ is_imap = TRUE;
+ _ssl = FALSE;
+ }
+ else if (! strcmp(scheme, "imaps"))
+ {
+ is_imap = TRUE;
+ _ssl = TRUE;
+ }
}
- }
- if ((username_end - username_start <= 0)
- || (password_end - password_start <= 0)
- || (hostname_end - hostname_start <= 0)
- || (port_start && ! mn_str_isnumeric(port_start)))
- return FALSE;
+ 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 (username)
- *username = g_strndup(username_start, username_end - username_start);
- if (password)
- *password = g_strndup(password_start, password_end - password_start);
- if (hostname)
- *hostname = g_strndup(hostname_start, hostname_end - hostname_start);
- if (port)
- *port = port_start ? atoi(port_start) : 110;
+ g_free(scheme);
+ g_free(_username);
+ g_free(_password);
+ g_free(_authmech);
+ g_free(_hostname);
+ g_free(_mailbox);
+ }
- return TRUE;
+ return is_imap;
}
+/**
+ * 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 g_strdup_printf("gmail://%s:%s", username, password);
+ return mn_uri_build_generic("gmail",
+ username,
+ password,
+ NULL,
+ NULL,
+ -1,
+ NULL);
}
+/**
+ * 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 *username_start;
- char *username_end;
- char *password_start;
+ char *scheme;
+ char *_username;
+ char *_password;
+ gboolean is_gmail = FALSE;
g_return_val_if_fail(uri != NULL, FALSE);
- if (strncmp(uri, "gmail://", 8))
- return FALSE;
-
- username_start = (char *) uri + 8;
- username_end = strchr(username_start, ':');
- if (! username_end)
- return FALSE;
-
- password_start = username_end + 1;
- if (! password_start[0])
- return FALSE;
+ if (mn_uri_parse_generic(uri,
+ &scheme,
+ &_username,
+ &_password,
+ NULL,
+ NULL,
+ NULL,
+ NULL))
+ {
+ is_gmail = ! strcmp(scheme, "gmail") && _password;
- if (username_end - username_start <= 0)
- return FALSE;
+ if (is_gmail)
+ {
+ if (username)
+ *username = g_strdup(_username);
+ if (password)
+ *password = g_strdup(_password);
+ }
- if (username)
- *username = g_strndup(username_start, username_end - username_start);
- if (password)
- *password = g_strdup(password_start);
+ g_free(scheme);
+ g_free(_username);
+ g_free(_password);
+ }
- return TRUE;
+ return is_gmail;
}
char *
mn_uri_canonicalize (const char *uri)
{
char *canonical_uri;
- char *username;
- char *password;
- char *hostname;
+ 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, &username, &password, &hostname, &port))
- {
- canonical_uri = mn_uri_build_pop(username, password, hostname, port);
- g_free(username);
- g_free(password);
- g_free(hostname);
- }
+ 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);
- g_free(username);
- g_free(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;
}
@@ -246,16 +607,25 @@ mn_uri_cmp (const char *uri1, const char *uri2)
char *
mn_uri_format_for_display (const char *uri)
{
+ const char *system_uri;
char *name = NULL;
- char *path;
g_return_val_if_fail(uri != NULL, NULL);
- path = gnome_vfs_get_local_path_from_uri(uri);
- if (path)
+ system_uri = mn_uri_get_system_mailbox();
+ if (system_uri && ! mn_uri_cmp(uri, system_uri))
+ name = g_strdup(_("System Mailbox"));
+
+ if (! name)
{
- name = g_filename_to_utf8(path, -1, NULL, NULL, NULL);
- g_free(path);
+ 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)
{
@@ -273,7 +643,7 @@ mn_uri_format_for_display (const char *uri)
char *username;
char *hostname;
- if (mn_uri_parse_pop(uri, &username, NULL, &hostname, NULL))
+ if (mn_uri_parse_pop(uri, NULL, &username, NULL, NULL, &hostname, NULL))
{
name = g_strdup_printf("%s@%s", username, hostname);
g_free(username);
@@ -283,6 +653,22 @@ mn_uri_format_for_display (const char *uri)
if (! name)
{
char *username;
+ char *hostname;
+ char *mailbox;
+
+ 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;
if (mn_uri_parse_gmail(uri, &username, NULL))
{
@@ -313,3 +699,23 @@ mn_uri_is_local (const char *uri)
return is_local;
}
+
+const char *
+mn_uri_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;
+}
diff --git a/src/mn-uri.h b/src/mn-uri.h
@@ -21,16 +21,39 @@
#include <glib.h>
-char *mn_uri_build_pop (const char *username,
+#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,
@@ -39,10 +62,9 @@ gboolean mn_uri_parse_gmail (const char *uri,
char *mn_uri_canonicalize (const char *uri);
int mn_uri_cmp (const char *uri1, const char *uri2);
-const char *mn_uri_get_unix_mailbox (void);
-
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 */
diff --git a/src/mn-util.c b/src/mn-util.c
@@ -25,6 +25,7 @@
#include "mn-conf.h"
#include "mn-mailboxes.h"
#include "mn-dialog.h"
+#include "mn-shell.h"
/*** types *******************************************************************/
@@ -50,6 +51,8 @@ static void mn_drag_data_received_h (GtkWidget *widget,
unsigned int time,
gpointer user_data);
+static GtkWidget *mn_menu_item_new (const char *stock_id, const char *mnemonic);
+
/*** implementation **********************************************************/
void
@@ -68,7 +71,7 @@ mn_info (const char *format, ...)
* Free a singly linked list of heap pointers.
*/
void
-mn_slist_free (GSList *list)
+mn_pointers_free (GSList *list)
{
GSList *l;
@@ -264,7 +267,7 @@ mn_drag_data_received_h (GtkWidget *widget,
g_free(str);
for (i = 0; uriv[i]; i++)
- if (*uriv[i] && *uriv[i] != '#' && ! mn_mailboxes_find(uriv[i]))
+ if (*uriv[i] && *uriv[i] != '#' && ! mn_mailboxes_find(mn_shell->mailboxes, uriv[i]))
new_mailboxes = g_slist_append(new_mailboxes, g_strdup(uriv[i]));
g_strfreev(uriv);
@@ -276,7 +279,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_slist_free(gconf_mailboxes);
+ mn_pointers_free(gconf_mailboxes);
}
}
break;
@@ -302,14 +305,14 @@ 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]);
- if (! mn_mailboxes_find(url->str))
+ if (! mn_mailboxes_find(mn_shell->mailboxes, url->str))
{
GSList *gconf_mailboxes;
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_slist_free(gconf_mailboxes);
+ mn_pointers_free(gconf_mailboxes);
}
g_string_free(url, TRUE);
@@ -383,7 +386,136 @@ mn_display_help (const char *link_id)
if (! gnome_help_display("mail-notification.xml", link_id, &err))
{
- mn_error_dialog(NULL, _("Unable to display help."), "%s", err->message);
+ mn_error_dialog(NULL, _("Unable to display help"), "%s", err->message);
+ g_error_free(err);
+ }
+}
+
+void
+mn_thread_create (GThreadFunc func, gpointer data)
+{
+ GError *err = NULL;
+
+ g_return_if_fail(func != NULL);
+
+ if (! g_thread_create(func, data, FALSE, &err))
+ {
+ mn_fatal_error_dialog(_("Unable to create a thread: %s."), err->message);
g_error_free(err);
}
}
+
+GtkTooltips *
+mn_tooltips_new (void)
+{
+ GtkTooltips *tooltips;
+
+ tooltips = gtk_tooltips_new();
+ g_object_ref(tooltips);
+ gtk_object_sink(GTK_OBJECT(tooltips));
+
+ return tooltips;
+}
+
+void
+mn_tooltips_set_tips (GtkTooltips *tooltips, ...)
+{
+ va_list args;
+ GtkWidget *widget;
+
+ g_return_if_fail(GTK_IS_TOOLTIPS(tooltips));
+
+ va_start(args, tooltips);
+ while ((widget = va_arg(args, GtkWidget *)))
+ {
+ const char *tip;
+
+ g_return_if_fail(GTK_IS_WIDGET(widget));
+
+ tip = va_arg(args, const char *);
+ g_return_if_fail(tip != NULL);
+
+ mn_tooltips_set_tip(tooltips, widget, tip);
+ }
+ va_end(args);
+}
+
+/**
+ * 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
+ *
+ * Creates a new menu item, shows it and appends it to @shell.
+ *
+ * If both @stock_id and @mnemonic are provided, a #GtkImageMenuItem
+ * will be created using the text of @mnemonic and the icon of
+ * @stock_id.
+ *
+ * If only @stock_id is provided, a #GtkImageMenuitem will be created
+ * using the text and icon of @stock_id.
+ *
+ * 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
+ * will be created.
+ *
+ * Return value: the new menu item
+ */
+GtkWidget *
+mn_menu_shell_append (GtkMenuShell *shell,
+ const char *stock_id,
+ const char *mnemonic)
+{
+ GtkWidget *item;
+
+ g_return_val_if_fail(GTK_IS_MENU_SHELL(shell), NULL);
+
+ item = mn_menu_item_new(stock_id, mnemonic);
+ gtk_menu_shell_append(shell, item);
+ gtk_widget_show(item);
+
+ return item;
+}
+
+GtkWidget *
+mn_menu_shell_prepend (GtkMenuShell *shell,
+ const char *stock_id,
+ const char *mnemonic)
+{
+ GtkWidget *item;
+
+ g_return_val_if_fail(GTK_IS_MENU_SHELL(shell), NULL);
+
+ item = mn_menu_item_new(stock_id, mnemonic);
+ gtk_menu_shell_prepend(shell, item);
+ gtk_widget_show(item);
+
+ return item;
+}
+
+static GtkWidget *
+mn_menu_item_new (const char *stock_id, const char *mnemonic)
+{
+ GtkWidget *item;
+
+ if (stock_id && mnemonic)
+ {
+ GtkWidget *image;
+
+ item = gtk_image_menu_item_new_with_mnemonic(mnemonic);
+
+ image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
+ gtk_widget_show(image);
+ }
+ else if (stock_id)
+ item = gtk_image_menu_item_new_from_stock(stock_id, NULL);
+ else if (mnemonic)
+ item = gtk_menu_item_new_with_mnemonic(mnemonic);
+ else
+ item = gtk_separator_menu_item_new();
+
+ return item;
+}
diff --git a/src/mn-util.h b/src/mn-util.h
@@ -30,7 +30,7 @@ for ((var) = (head); \
void mn_info (const char *format,
...);
-void mn_slist_free (GSList *list);
+void mn_pointers_free (GSList *list);
gboolean mn_str_isnumeric (const char *str);
@@ -56,5 +56,21 @@ gboolean mn_parse_gnome_copied_files (const char *gnome_copied_files,
GSList **uri_list);
void mn_display_help (const char *link_id);
+void mn_thread_create (GThreadFunc func,
+ gpointer data);
+
+GtkTooltips *mn_tooltips_new (void);
+void mn_tooltips_set_tips (GtkTooltips *tooltips,
+ ...);
+
+#define mn_tooltips_set_tip(tooltips, widget, tip) \
+ gtk_tooltips_set_tip((tooltips), (widget), (tip), NULL)
+
+GtkWidget *mn_menu_shell_append (GtkMenuShell *shell,
+ const char *stock_id,
+ const char *mnemonic);
+GtkWidget *mn_menu_shell_prepend (GtkMenuShell *shell,
+ const char *stock_id,
+ const char *mnemonic);
#endif /* _MN_UTIL_H */
diff --git a/src/mn-vfs.c b/src/mn-vfs.c
@@ -17,311 +17,142 @@
*/
#include "config.h"
+#include <string.h>
#include "mn-vfs.h"
/*** cpp *********************************************************************/
-#define VFS_BLOCK_SIZE 16384
+#ifndef MN_REGRESSION_TEST
+#define READ_LINE_BLOCK_SIZE 16384
+#endif
/*** types *******************************************************************/
-struct _MNVFSAsyncHandle
+struct _MNVFSReadLineContext
{
- GnomeVFSAsyncHandle *handle;
- GnomeVFSOpenMode open_mode;
-
- MNVFSAsyncOpenCallback *open_callback;
- gpointer open_user_data;
-
- MNVFSAsyncCloseCallback *close_callback;
- gpointer close_user_data;
-
- MNVFSAsyncReadLineCallback *read_line_callback;
- gpointer read_line_user_data;
-
- unsigned int flags;
- char *buffer;
- GString *string;
- GnomeVFSResult last_result;
- GnomeVFSFileSize start;
- GnomeVFSFileSize pos;
- GnomeVFSFileSize len;
+ GnomeVFSHandle *handle;
+ GString *buf;
+ char *terminator;
+ GnomeVFSResult last_result;
+ gboolean eof;
};
-typedef struct
-{
- GFileTest test;
- MNVFSAsyncTestCallback *callback;
- gpointer user_data;
-} TestInfo;
-
-/*** functions ***************************************************************/
-
-static void mn_vfs_async_open_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-static void mn_vfs_async_close_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
-static void mn_vfs_async_free (MNVFSAsyncHandle *handle);
-
-static gboolean mn_vfs_async_read_line_idle_cb (gpointer data);
-static void mn_vfs_async_read_line_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer buffer,
- GnomeVFSFileSize bytes_requested,
- GnomeVFSFileSize bytes_read,
- gpointer user_data);
-
-static gboolean mn_vfs_async_read_line_flush (MNVFSAsyncHandle *handle);
-
-static void mn_vfs_async_test_cb (GnomeVFSAsyncHandle *handle,
- GList *results,
- gpointer user_data);
-
/*** implementation **********************************************************/
-void
-mn_vfs_async_open (MNVFSAsyncHandle **handle,
- const char *text_uri,
- GnomeVFSOpenMode open_mode,
- MNVFSAsyncOpenCallback *callback,
- gpointer user_data)
-{
- g_return_if_fail(handle != NULL);
- g_return_if_fail(text_uri != NULL);
- g_return_if_fail(callback != NULL);
-
- *handle = g_new0(MNVFSAsyncHandle, 1);
- (*handle)->open_mode = open_mode;
- (*handle)->open_callback = callback;
- (*handle)->open_user_data = user_data;
- (*handle)->buffer = g_new(char, VFS_BLOCK_SIZE);
- (*handle)->string = g_string_new(NULL);
- (*handle)->last_result = GNOME_VFS_OK;
-
- gnome_vfs_async_open(&(*handle)->handle,
- text_uri,
- open_mode,
- GNOME_VFS_PRIORITY_DEFAULT,
- mn_vfs_async_open_cb,
- *handle);
-}
-
-static void
-mn_vfs_async_open_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
-{
- MNVFSAsyncHandle *mhandle = user_data;
-
- mhandle->open_callback(mhandle, result, mhandle->open_user_data);
- if (result != GNOME_VFS_OK)
- mn_vfs_async_free(mhandle);
-}
-
-void
-mn_vfs_async_close (MNVFSAsyncHandle *handle,
- MNVFSAsyncCloseCallback *callback,
- gpointer user_data)
+/* FIXME: must also handle \r and \r\n terminators */
+GnomeVFSResult
+mn_vfs_read_line (MNVFSReadLineContext **context,
+ GnomeVFSHandle *handle,
+ const char **line)
{
- g_return_if_fail(handle != NULL);
- g_return_if_fail(callback != NULL);
+ GnomeVFSResult result;
+ gboolean first_pass = TRUE;
- handle->close_callback = callback;
- handle->close_user_data = user_data;
-
- gnome_vfs_async_close(handle->handle, mn_vfs_async_close_cb, handle);
-}
+ g_return_val_if_fail(context != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
+ g_return_val_if_fail(handle != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
+ g_return_val_if_fail(line != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
-static void
-mn_vfs_async_close_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data)
-{
- MNVFSAsyncHandle *mhandle = user_data;
+ if (*context)
+ {
+ g_return_val_if_fail((*context)->handle == handle, GNOME_VFS_ERROR_BAD_PARAMETERS);
+ if ((*context)->terminator)
+ {
+ g_string_erase((*context)->buf, 0, (*context)->terminator - (*context)->buf->str + 1);
+ (*context)->terminator = NULL;
+ }
+ else if ((*context)->eof)
+ return GNOME_VFS_ERROR_EOF; /* we're done */
+ }
+ else
+ {
+ *context = g_new0(MNVFSReadLineContext, 1);
+ (*context)->handle = handle;
+ (*context)->buf = g_string_new(NULL);
+ }
- mhandle->close_callback(mhandle, result, mhandle->close_user_data);
- mn_vfs_async_free(mhandle);
-}
+ while (TRUE)
+ {
+ if (! (*context)->buf->str[0] || ! first_pass)
+ {
+ char buf[READ_LINE_BLOCK_SIZE];
+ GnomeVFSFileSize bytes_read;
+
+ result = (*context)->last_result = gnome_vfs_read(handle, buf, sizeof(buf), &bytes_read);
+ if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF)
+ g_string_append_len((*context)->buf, buf, bytes_read);
+ else
+ break; /* error */
+ }
+
+ (*context)->terminator = strchr((*context)->buf->str, '\n');
+ if ((*context)->terminator || (*context)->last_result == GNOME_VFS_ERROR_EOF)
+ {
+ result = (*context)->last_result;
+ if ((*context)->terminator || (*context)->buf->str[0])
+ {
+ *line = (*context)->buf->str;
+ if (result == GNOME_VFS_ERROR_EOF)
+ result = GNOME_VFS_OK;
+ }
+ if ((*context)->terminator)
+ (*context)->terminator[0] = 0;
+ else if ((*context)->last_result == GNOME_VFS_ERROR_EOF)
+ (*context)->eof = TRUE;
+
+ break; /* line found, or last line */
+ }
-static void
-mn_vfs_async_free (MNVFSAsyncHandle *handle)
-{
- g_return_if_fail(handle != NULL);
+ first_pass = FALSE;
+ }
- g_free(handle->buffer);
- g_string_free(handle->string, TRUE);
- g_free(handle);
+ return result;
}
-/*
- * Read a UNIX line from HANDLE.
- */
void
-mn_vfs_async_read_line (MNVFSAsyncHandle *handle,
- unsigned int flags,
- MNVFSAsyncReadLineCallback *callback,
- gpointer user_data)
-{
- g_return_if_fail(handle != NULL);
- g_return_if_fail((handle->open_mode & GNOME_VFS_OPEN_READ) != 0);
- g_return_if_fail(callback != NULL);
-
- handle->flags = flags;
- handle->read_line_callback = callback;
- handle->read_line_user_data = user_data;
-
- g_idle_add(mn_vfs_async_read_line_idle_cb, handle);
-}
-
-static gboolean
-mn_vfs_async_read_line_idle_cb (gpointer data)
+mn_vfs_read_line_context_free (MNVFSReadLineContext *context)
{
- MNVFSAsyncHandle *handle = data;
-
- if (! mn_vfs_async_read_line_flush(handle))
- gnome_vfs_async_read(handle->handle,
- handle->buffer,
- VFS_BLOCK_SIZE,
- mn_vfs_async_read_line_cb,
- handle);
-
- return FALSE; /* remove source */
-}
-
-static void
-mn_vfs_async_read_line_cb (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer buffer,
- GnomeVFSFileSize bytes_requested,
- GnomeVFSFileSize bytes_read,
- gpointer user_data)
-{
- MNVFSAsyncHandle *mhandle = user_data;
-
- mhandle->start = 0;
- mhandle->pos = 0;
- mhandle->len = bytes_read;
- mhandle->last_result = result;
-
- if (! mn_vfs_async_read_line_flush(mhandle))
- gnome_vfs_async_read(mhandle->handle,
- mhandle->buffer,
- VFS_BLOCK_SIZE,
- mn_vfs_async_read_line_cb,
- mhandle);
-}
-
-static gboolean
-mn_vfs_async_read_line_flush (MNVFSAsyncHandle *handle)
-{
- g_return_val_if_fail(handle != NULL, FALSE);
-
- for (; handle->pos < handle->len; handle->pos++)
- if (handle->buffer[handle->pos] == '\n')
- {
- g_string_append_len(handle->string, &handle->buffer[handle->start], handle->pos - handle->start);
- if (handle->flags & MN_VFS_PASS_NEWLINE)
- g_string_append_c(handle->string, handle->buffer[handle->pos]);
-
- handle->read_line_callback(handle, handle->last_result, handle->string->str, handle->read_line_user_data);
- g_string_truncate(handle->string, 0);
-
- handle->start = ++handle->pos;
- return TRUE;
- }
+ g_return_if_fail(context != NULL);
- if (handle->start < handle->len)
- g_string_append_len(handle->string, &handle->buffer[handle->start], handle->len - handle->start);
-
- if (handle->last_result != GNOME_VFS_OK)
- {
- handle->read_line_callback(handle, handle->last_result, *handle->string->str ? handle->string->str : NULL, handle->read_line_user_data);
- return TRUE;
- }
-
- return FALSE;
+ g_string_free(context->buf, TRUE);
+ g_free(context);
}
-void
-mn_vfs_async_test (const char *uri,
- GFileTest test,
- MNVFSAsyncTestCallback *callback,
- gpointer user_data)
+gboolean
+mn_vfs_test (const char *uri, GFileTest test)
{
- GnomeVFSURI *vfs_uri;
- GList *uri_list = NULL;
GnomeVFSFileInfoOptions options;
- GnomeVFSAsyncHandle *handle;
- TestInfo *info;
-
- g_return_if_fail(uri != NULL);
- g_return_if_fail(callback != NULL);
-
- vfs_uri = gnome_vfs_uri_new(uri);
- if (! vfs_uri)
- {
- callback(FALSE, user_data);
- return;
- }
+ GnomeVFSFileInfo *file_info;
+ gboolean status = FALSE;
- uri_list = g_list_append(uri_list, vfs_uri);
+ g_return_val_if_fail(uri != NULL, FALSE);
options = GNOME_VFS_FILE_INFO_DEFAULT;
if (! (test & G_FILE_TEST_IS_SYMLINK))
options |= GNOME_VFS_FILE_INFO_FOLLOW_LINKS;
if (test & G_FILE_TEST_IS_EXECUTABLE)
options |= GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS;
-
- info = g_new(TestInfo, 1);
- info->test = test;
- info->callback = callback;
- info->user_data = user_data;
-
- gnome_vfs_async_get_file_info(&handle,
- uri_list,
- options,
- GNOME_VFS_PRIORITY_DEFAULT,
- mn_vfs_async_test_cb,
- info);
-
- gnome_vfs_uri_unref(vfs_uri);
- g_list_free(uri_list);
-}
-
-static void
-mn_vfs_async_test_cb (GnomeVFSAsyncHandle *handle,
- GList *results,
- gpointer user_data)
-{
- TestInfo *info = user_data;
- GnomeVFSGetFileInfoResult *result;
- gboolean status = FALSE;
-
- g_return_if_fail(results->data != NULL);
- result = results->data;
-
- if (result->result == GNOME_VFS_OK)
+
+ file_info = gnome_vfs_file_info_new();
+ if (gnome_vfs_get_file_info(uri, file_info, options) == GNOME_VFS_OK)
{
- if (result->file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE)
+ if (file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE)
{
- if (info->test & G_FILE_TEST_IS_REGULAR)
- status = result->file_info->type == GNOME_VFS_FILE_TYPE_REGULAR;
- if (! status && info->test & G_FILE_TEST_IS_SYMLINK)
- status = result->file_info->type == GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK;
- if (! status && info->test & G_FILE_TEST_IS_DIR)
- status = result->file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY;
+ if (test & G_FILE_TEST_IS_REGULAR)
+ status = file_info->type == GNOME_VFS_FILE_TYPE_REGULAR;
+ if (! status && test & G_FILE_TEST_IS_SYMLINK)
+ status = file_info->type == GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK;
+ if (! status && test & G_FILE_TEST_IS_DIR)
+ status = file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY;
}
- if (result->file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS)
+ if (file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS)
{
- if (! status && info->test & G_FILE_TEST_IS_EXECUTABLE)
- status = result->file_info->permissions & GNOME_VFS_PERM_ACCESS_EXECUTABLE;
+ if (! status && test & G_FILE_TEST_IS_EXECUTABLE)
+ status = file_info->permissions & GNOME_VFS_PERM_ACCESS_EXECUTABLE;
}
- if (! status && info->test & G_FILE_TEST_EXISTS)
+ if (! status && test & G_FILE_TEST_EXISTS)
status = TRUE; /* gnome_vfs_get_file_info() succeeded, so the file exists */
}
+ gnome_vfs_file_info_unref(file_info);
- info->callback(status, info->user_data);
- g_free(info);
+ return status;
}
diff --git a/src/mn-vfs.h b/src/mn-vfs.h
@@ -23,40 +23,13 @@
#include <glib.h>
#include <libgnomevfs/gnome-vfs.h>
-typedef struct _MNVFSAsyncHandle MNVFSAsyncHandle;
+typedef struct _MNVFSReadLineContext MNVFSReadLineContext;
-typedef void (MNVFSAsyncCallback) (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer user_data);
+GnomeVFSResult mn_vfs_read_line (MNVFSReadLineContext **context,
+ GnomeVFSHandle *handle,
+ const char **line);
+void mn_vfs_read_line_context_free (MNVFSReadLineContext *context);
-typedef MNVFSAsyncCallback MNVFSAsyncOpenCallback;
-typedef MNVFSAsyncCallback MNVFSAsyncCloseCallback;
-
-typedef void (MNVFSAsyncReadLineCallback) (MNVFSAsyncHandle *handle,
- GnomeVFSResult result,
- const char *line,
- gpointer user_data);
-
-typedef void (MNVFSAsyncTestCallback) (gboolean result, gpointer user_data);
-
-#define MN_VFS_PASS_NEWLINE (1 << 0)
-
-void mn_vfs_async_open (MNVFSAsyncHandle **handle,
- const char *text_uri,
- GnomeVFSOpenMode open_mode,
- MNVFSAsyncOpenCallback *callback,
- gpointer user_data);
-void mn_vfs_async_close (MNVFSAsyncHandle *handle,
- MNVFSAsyncCloseCallback *callback,
- gpointer user_data);
-void mn_vfs_async_read_line (MNVFSAsyncHandle *handle,
- unsigned int flags,
- MNVFSAsyncReadLineCallback *callback,
- gpointer user_data);
-
-void mn_vfs_async_test (const char *uri,
- GFileTest test,
- MNVFSAsyncTestCallback *callback,
- gpointer user_data);
+gboolean mn_vfs_test (const char *uri, GFileTest test);
#endif /* _MN_VFS_H */
diff --git a/tests/Makefile.am b/tests/Makefile.am
@@ -0,0 +1,64 @@
+tests = \
+ test-uri.output \
+ test-vfs-read-line1-smallblock.output \
+ test-vfs-read-line1-largeblock.output \
+ test-vfs-read-line2-smallblock.output \
+ test-vfs-read-line2-largeblock.output
+
+noinst_PROGRAMS = \
+ test-uri \
+ test-vfs-read-line-smallblock \
+ test-vfs-read-line-largeblock
+noinst_DATA = $(tests)
+
+test_uri_SOURCES = \
+ $(top_srcdir)/src/mn-uri.c \
+ test-uri.c
+
+test_vfs_read_line_sources = \
+ $(top_srcdir)/src/mn-vfs.c \
+ $(top_srcdir)/src/mn-vfs.h \
+ test-vfs-read-line.c
+
+test_vfs_read_line_smallblock_SOURCES = $(test_vfs_read_line_sources)
+test_vfs_read_line_smallblock_CPPFLAGS = $(AM_CPPFLAGS) \
+ -DREAD_LINE_BLOCK_SIZE=4
+
+test_vfs_read_line_largeblock_SOURCES = $(test_vfs_read_line_sources)
+test_vfs_read_line_largeblock_CPPFLAGS = $(AM_CPPFLAGS) \
+ -DREAD_LINE_BLOCK_SIZE=16384
+
+AM_LDFLAGS = $(GNOME_LIBS)
+AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) \
+ -I$(top_srcdir) \
+ -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-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
+ @if cmp test-vfs-read-line1-smallblock.output test-vfs-read-line1.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 1-SMALLBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 1-SMALLBLOCK FAILED"; exit 1; fi
+
+test-vfs-read-line1-largeblock.output: test-vfs-read-line-largeblock test-vfs-read-line1.input test-vfs-read-line1.expected
+ ./test-vfs-read-line-largeblock file://`pwd`/test-vfs-read-line1.input > test-vfs-read-line1-largeblock.output
+ @if cmp test-vfs-read-line1-largeblock.output test-vfs-read-line1.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 1-LARGEBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 1-LARGEBLOCK FAILED"; exit 1; fi
+
+test-vfs-read-line2-smallblock.output: test-vfs-read-line-smallblock test-vfs-read-line2.input test-vfs-read-line2.expected
+ ./test-vfs-read-line-smallblock file://`pwd`/test-vfs-read-line2.input > test-vfs-read-line2-smallblock.output
+ @if cmp test-vfs-read-line2-smallblock.output test-vfs-read-line2.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 2-SMALLBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 2-SMALLBLOCK FAILED"; exit 1; fi
+
+test-vfs-read-line2-largeblock.output: test-vfs-read-line-largeblock test-vfs-read-line2.input test-vfs-read-line2.expected
+ ./test-vfs-read-line-largeblock file://`pwd`/test-vfs-read-line2.input > test-vfs-read-line2-largeblock.output
+ @if cmp test-vfs-read-line2-largeblock.output test-vfs-read-line2.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 2-LARGEBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 2-LARGEBLOCK FAILED"; exit 1; fi
+
+MOSTLYCLEANFILES = $(tests)
+
+EXTRA_DIST = \
+ test-uri.expected \
+ test-vfs-read-line1.input \
+ test-vfs-read-line1.expected \
+ test-vfs-read-line2.input \
+ test-vfs-read-line2.expected
diff --git a/tests/Makefile.in b/tests/Makefile.in
@@ -0,0 +1,626 @@
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+SOURCES = $(test_uri_SOURCES) $(test_vfs_read_line_largeblock_SOURCES) $(test_vfs_read_line_smallblock_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+noinst_PROGRAMS = test-uri$(EXEEXT) \
+ test-vfs-read-line-smallblock$(EXEEXT) \
+ test-vfs-read-line-largeblock$(EXEEXT)
+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
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_test_uri_OBJECTS = mn-uri.$(OBJEXT) test-uri.$(OBJEXT)
+test_uri_OBJECTS = $(am_test_uri_OBJECTS)
+test_uri_LDADD = $(LDADD)
+am__objects_1 = test_vfs_read_line_largeblock-mn-vfs.$(OBJEXT) \
+ test_vfs_read_line_largeblock-test-vfs-read-line.$(OBJEXT)
+am_test_vfs_read_line_largeblock_OBJECTS = $(am__objects_1)
+test_vfs_read_line_largeblock_OBJECTS = \
+ $(am_test_vfs_read_line_largeblock_OBJECTS)
+test_vfs_read_line_largeblock_LDADD = $(LDADD)
+am__objects_2 = test_vfs_read_line_smallblock-mn-vfs.$(OBJEXT) \
+ test_vfs_read_line_smallblock-test-vfs-read-line.$(OBJEXT)
+am_test_vfs_read_line_smallblock_OBJECTS = $(am__objects_2)
+test_vfs_read_line_smallblock_OBJECTS = \
+ $(am_test_vfs_read_line_smallblock_OBJECTS)
+test_vfs_read_line_smallblock_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/mn-uri.Po ./$(DEPDIR)/test-uri.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(test_uri_SOURCES) $(test_vfs_read_line_largeblock_SOURCES) \
+ $(test_vfs_read_line_smallblock_SOURCES)
+DIST_SOURCES = $(test_uri_SOURCES) \
+ $(test_vfs_read_line_largeblock_SOURCES) \
+ $(test_vfs_read_line_smallblock_SOURCES)
+DATA = $(noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCONFTOOL = @GCONFTOOL@
+GCONF_SCHEMAS_INSTALL_FALSE = @GCONF_SCHEMAS_INSTALL_FALSE@
+GCONF_SCHEMAS_INSTALL_TRUE = @GCONF_SCHEMAS_INSTALL_TRUE@
+GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@
+GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GNOME_CFLAGS = @GNOME_CFLAGS@
+GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+G_ASSERTIONS = @G_ASSERTIONS@
+HAVE_SOUP_FALSE = @HAVE_SOUP_FALSE@
+HAVE_SOUP_TRUE = @HAVE_SOUP_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
+INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
+INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
+INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
+INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
+INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
+INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
+INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
+INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
+INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
+INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
+LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOUP_CFLAGS = @SOUP_CFLAGS@
+SOUP_LIBS = @SOUP_LIBS@
+STRIP = @STRIP@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
+WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
+WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
+WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
+WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
+WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
+WITH_MH_FALSE = @WITH_MH_FALSE@
+WITH_MH_TRUE = @WITH_MH_TRUE@
+WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
+WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
+WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
+WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+tests = \
+ test-uri.output \
+ test-vfs-read-line1-smallblock.output \
+ test-vfs-read-line1-largeblock.output \
+ test-vfs-read-line2-smallblock.output \
+ test-vfs-read-line2-largeblock.output
+
+noinst_DATA = $(tests)
+test_uri_SOURCES = \
+ $(top_srcdir)/src/mn-uri.c \
+ test-uri.c
+
+test_vfs_read_line_sources = \
+ $(top_srcdir)/src/mn-vfs.c \
+ $(top_srcdir)/src/mn-vfs.h \
+ test-vfs-read-line.c
+
+test_vfs_read_line_smallblock_SOURCES = $(test_vfs_read_line_sources)
+test_vfs_read_line_smallblock_CPPFLAGS = $(AM_CPPFLAGS) \
+ -DREAD_LINE_BLOCK_SIZE=4
+
+test_vfs_read_line_largeblock_SOURCES = $(test_vfs_read_line_sources)
+test_vfs_read_line_largeblock_CPPFLAGS = $(AM_CPPFLAGS) \
+ -DREAD_LINE_BLOCK_SIZE=16384
+
+AM_LDFLAGS = $(GNOME_LIBS)
+AM_CPPFLAGS = $(WARN_CFLAGS) $(G_ASSERTIONS) $(GNOME_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/src \
+ -DMN_REGRESSION_TEST
+
+MOSTLYCLEANFILES = $(tests)
+EXTRA_DIST = \
+ test-uri.expected \
+ test-vfs-read-line1.input \
+ test-vfs-read-line1.expected \
+ test-vfs-read-line2.input \
+ test-vfs-read-line2.expected
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+test-uri$(EXEEXT): $(test_uri_OBJECTS) $(test_uri_DEPENDENCIES)
+ @rm -f test-uri$(EXEEXT)
+ $(LINK) $(test_uri_LDFLAGS) $(test_uri_OBJECTS) $(test_uri_LDADD) $(LIBS)
+test-vfs-read-line-largeblock$(EXEEXT): $(test_vfs_read_line_largeblock_OBJECTS) $(test_vfs_read_line_largeblock_DEPENDENCIES)
+ @rm -f test-vfs-read-line-largeblock$(EXEEXT)
+ $(LINK) $(test_vfs_read_line_largeblock_LDFLAGS) $(test_vfs_read_line_largeblock_OBJECTS) $(test_vfs_read_line_largeblock_LDADD) $(LIBS)
+test-vfs-read-line-smallblock$(EXEEXT): $(test_vfs_read_line_smallblock_OBJECTS) $(test_vfs_read_line_smallblock_DEPENDENCIES)
+ @rm -f test-vfs-read-line-smallblock$(EXEEXT)
+ $(LINK) $(test_vfs_read_line_smallblock_LDFLAGS) $(test_vfs_read_line_smallblock_OBJECTS) $(test_vfs_read_line_smallblock_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mn-uri.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uri.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+mn-uri.o: $(top_srcdir)/src/mn-uri.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mn-uri.o -MD -MP -MF "$(DEPDIR)/mn-uri.Tpo" -c -o mn-uri.o `test -f '$(top_srcdir)/src/mn-uri.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mn-uri.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mn-uri.Tpo" "$(DEPDIR)/mn-uri.Po"; else rm -f "$(DEPDIR)/mn-uri.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/mn-uri.c' object='mn-uri.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mn-uri.Po' tmpdepfile='$(DEPDIR)/mn-uri.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mn-uri.o `test -f '$(top_srcdir)/src/mn-uri.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mn-uri.c
+
+mn-uri.obj: $(top_srcdir)/src/mn-uri.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mn-uri.obj -MD -MP -MF "$(DEPDIR)/mn-uri.Tpo" -c -o mn-uri.obj `if test -f '$(top_srcdir)/src/mn-uri.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mn-uri.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mn-uri.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mn-uri.Tpo" "$(DEPDIR)/mn-uri.Po"; else rm -f "$(DEPDIR)/mn-uri.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/mn-uri.c' object='mn-uri.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mn-uri.Po' tmpdepfile='$(DEPDIR)/mn-uri.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mn-uri.obj `if test -f '$(top_srcdir)/src/mn-uri.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mn-uri.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mn-uri.c'; fi`
+
+test_vfs_read_line_largeblock-mn-vfs.o: $(top_srcdir)/src/mn-vfs.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_largeblock-mn-vfs.o -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Tpo" -c -o test_vfs_read_line_largeblock-mn-vfs.o `test -f '$(top_srcdir)/src/mn-vfs.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mn-vfs.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Tpo" "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/mn-vfs.c' object='test_vfs_read_line_largeblock-mn-vfs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_largeblock-mn-vfs.o `test -f '$(top_srcdir)/src/mn-vfs.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mn-vfs.c
+
+test_vfs_read_line_largeblock-mn-vfs.obj: $(top_srcdir)/src/mn-vfs.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_largeblock-mn-vfs.obj -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Tpo" -c -o test_vfs_read_line_largeblock-mn-vfs.obj `if test -f '$(top_srcdir)/src/mn-vfs.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mn-vfs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mn-vfs.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Tpo" "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/mn-vfs.c' object='test_vfs_read_line_largeblock-mn-vfs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_largeblock-mn-vfs.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_largeblock-mn-vfs.obj `if test -f '$(top_srcdir)/src/mn-vfs.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mn-vfs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mn-vfs.c'; fi`
+
+test_vfs_read_line_largeblock-test-vfs-read-line.o: test-vfs-read-line.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_largeblock-test-vfs-read-line.o -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Tpo" -c -o test_vfs_read_line_largeblock-test-vfs-read-line.o `test -f 'test-vfs-read-line.c' || echo '$(srcdir)/'`test-vfs-read-line.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Tpo" "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vfs-read-line.c' object='test_vfs_read_line_largeblock-test-vfs-read-line.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_largeblock-test-vfs-read-line.o `test -f 'test-vfs-read-line.c' || echo '$(srcdir)/'`test-vfs-read-line.c
+
+test_vfs_read_line_largeblock-test-vfs-read-line.obj: test-vfs-read-line.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_largeblock-test-vfs-read-line.obj -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Tpo" -c -o test_vfs_read_line_largeblock-test-vfs-read-line.obj `if test -f 'test-vfs-read-line.c'; then $(CYGPATH_W) 'test-vfs-read-line.c'; else $(CYGPATH_W) '$(srcdir)/test-vfs-read-line.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Tpo" "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vfs-read-line.c' object='test_vfs_read_line_largeblock-test-vfs-read-line.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_largeblock-test-vfs-read-line.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_largeblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_largeblock-test-vfs-read-line.obj `if test -f 'test-vfs-read-line.c'; then $(CYGPATH_W) 'test-vfs-read-line.c'; else $(CYGPATH_W) '$(srcdir)/test-vfs-read-line.c'; fi`
+
+test_vfs_read_line_smallblock-mn-vfs.o: $(top_srcdir)/src/mn-vfs.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_smallblock-mn-vfs.o -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Tpo" -c -o test_vfs_read_line_smallblock-mn-vfs.o `test -f '$(top_srcdir)/src/mn-vfs.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mn-vfs.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Tpo" "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/mn-vfs.c' object='test_vfs_read_line_smallblock-mn-vfs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_smallblock-mn-vfs.o `test -f '$(top_srcdir)/src/mn-vfs.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mn-vfs.c
+
+test_vfs_read_line_smallblock-mn-vfs.obj: $(top_srcdir)/src/mn-vfs.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_smallblock-mn-vfs.obj -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Tpo" -c -o test_vfs_read_line_smallblock-mn-vfs.obj `if test -f '$(top_srcdir)/src/mn-vfs.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mn-vfs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mn-vfs.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Tpo" "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/mn-vfs.c' object='test_vfs_read_line_smallblock-mn-vfs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_smallblock-mn-vfs.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_smallblock-mn-vfs.obj `if test -f '$(top_srcdir)/src/mn-vfs.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mn-vfs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mn-vfs.c'; fi`
+
+test_vfs_read_line_smallblock-test-vfs-read-line.o: test-vfs-read-line.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_smallblock-test-vfs-read-line.o -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Tpo" -c -o test_vfs_read_line_smallblock-test-vfs-read-line.o `test -f 'test-vfs-read-line.c' || echo '$(srcdir)/'`test-vfs-read-line.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Tpo" "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vfs-read-line.c' object='test_vfs_read_line_smallblock-test-vfs-read-line.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_smallblock-test-vfs-read-line.o `test -f 'test-vfs-read-line.c' || echo '$(srcdir)/'`test-vfs-read-line.c
+
+test_vfs_read_line_smallblock-test-vfs-read-line.obj: test-vfs-read-line.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_vfs_read_line_smallblock-test-vfs-read-line.obj -MD -MP -MF "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Tpo" -c -o test_vfs_read_line_smallblock-test-vfs-read-line.obj `if test -f 'test-vfs-read-line.c'; then $(CYGPATH_W) 'test-vfs-read-line.c'; else $(CYGPATH_W) '$(srcdir)/test-vfs-read-line.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Tpo" "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Po"; else rm -f "$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vfs-read-line.c' object='test_vfs_read_line_smallblock-test-vfs-read-line.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.Po' tmpdepfile='$(DEPDIR)/test_vfs_read_line_smallblock-test-vfs-read-line.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vfs_read_line_smallblock_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_vfs_read_line_smallblock-test-vfs-read-line.obj `if test -f 'test-vfs-read-line.c'; then $(CYGPATH_W) 'test-vfs-read-line.c'; else $(CYGPATH_W) '$(srcdir)/test-vfs-read-line.c'; fi`
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+
+distclean-generic:
+ -rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-noinstPROGRAMS ctags distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ 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-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
+ @if cmp test-vfs-read-line1-smallblock.output test-vfs-read-line1.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 1-SMALLBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 1-SMALLBLOCK FAILED"; exit 1; fi
+
+test-vfs-read-line1-largeblock.output: test-vfs-read-line-largeblock test-vfs-read-line1.input test-vfs-read-line1.expected
+ ./test-vfs-read-line-largeblock file://`pwd`/test-vfs-read-line1.input > test-vfs-read-line1-largeblock.output
+ @if cmp test-vfs-read-line1-largeblock.output test-vfs-read-line1.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 1-LARGEBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 1-LARGEBLOCK FAILED"; exit 1; fi
+
+test-vfs-read-line2-smallblock.output: test-vfs-read-line-smallblock test-vfs-read-line2.input test-vfs-read-line2.expected
+ ./test-vfs-read-line-smallblock file://`pwd`/test-vfs-read-line2.input > test-vfs-read-line2-smallblock.output
+ @if cmp test-vfs-read-line2-smallblock.output test-vfs-read-line2.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 2-SMALLBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 2-SMALLBLOCK FAILED"; exit 1; fi
+
+test-vfs-read-line2-largeblock.output: test-vfs-read-line-largeblock test-vfs-read-line2.input test-vfs-read-line2.expected
+ ./test-vfs-read-line-largeblock file://`pwd`/test-vfs-read-line2.input > test-vfs-read-line2-largeblock.output
+ @if cmp test-vfs-read-line2-largeblock.output test-vfs-read-line2.expected > /dev/null; then echo "+++ VFS-READ-LINE TEST 2-LARGEBLOCK PASSED"; else echo "--- VFS-READ-LINE TEST 2-LARGEBLOCK FAILED"; exit 1; fi
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/test-uri.c b/tests/test-uri.c
@@ -0,0 +1,253 @@
+/*
+ * 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.
+ */
+
+#include "mn-uri.h"
+
+int
+main (int argc, char **argv)
+{
+ /*
+ * 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://username:password@hostname",
+ "pop://username:password@hostname:110",
+ "pop://username:password@hostname:555",
+
+ "pop://username:password@[::1]",
+ "pop://username:password@[::1]:110",
+ "pop://username:password@[::1]:555",
+
+ "pop://username:password;auth=MECH@hostname",
+ "pop://username:password;auth=MECH@hostname:110",
+ "pop://username:password;auth=MECH@hostname:555",
+
+ "pop://username:password;auth=MECH@[::1]",
+ "pop://username:password;auth=MECH@[::1]:110",
+ "pop://username:password;auth=MECH@[::1]:555",
+
+ "pops://invalid",
+
+ "pops://username:password@hostname",
+ "pops://username:password@hostname:995",
+ "pops://username:password@hostname:555",
+
+ "pops://username:password@[::1]",
+ "pops://username:password@[::1]:995",
+ "pops://username:password@[::1]:555",
+
+ "pops://username:password;auth=MECH@hostname",
+ "pops://username:password;auth=MECH@hostname:995",
+ "pops://username:password;auth=MECH@hostname:555",
+
+ "pops://username:password;auth=MECH@[::1]",
+ "pops://username:password;auth=MECH@[::1]:995",
+ "pops://username:password;auth=MECH@[::1]:555",
+ };
+ const char *imap_uri_list[] = {
+ "imap://invalid",
+
+ "imap://username:password@hostname",
+ "imap://username:password@hostname/mailbox",
+ "imap://username:password@hostname:143",
+ "imap://username:password@hostname:143/mailbox",
+ "imap://username:password@hostname:555",
+ "imap://username:password@hostname:555/mailbox",
+
+ "imap://username:password@[::1]",
+ "imap://username:password@[::1]/mailbox",
+ "imap://username:password@[::1]:143",
+ "imap://username:password@[::1]:143/mailbox",
+ "imap://username:password@[::1]:555",
+ "imap://username:password@[::1]:555/mailbox",
+
+ "imap://username:password;auth=MECH@hostname",
+ "imap://username:password;auth=MECH@hostname/mailbox",
+ "imap://username:password;auth=MECH@hostname:143",
+ "imap://username:password;auth=MECH@hostname:143/mailbox",
+ "imap://username:password;auth=MECH@hostname:555",
+ "imap://username:password;auth=MECH@hostname:555/mailbox",
+
+ "imap://username:password;auth=MECH@[::1]",
+ "imap://username:password;auth=MECH@[::1]/mailbox",
+ "imap://username:password;auth=MECH@[::1]:143",
+ "imap://username:password;auth=MECH@[::1]:143/mailbox",
+ "imap://username:password;auth=MECH@[::1]:555",
+ "imap://username:password;auth=MECH@[::1]:555/mailbox",
+
+ "imaps://invalid",
+
+ "imaps://username:password@hostname",
+ "imaps://username:password@hostname/mailbox",
+ "imaps://username:password@hostname:993",
+ "imaps://username:password@hostname:993/mailbox",
+ "imaps://username:password@hostname:555",
+ "imaps://username:password@hostname:555/mailbox",
+
+ "imaps://username:password@[::1]",
+ "imaps://username:password@[::1]/mailbox",
+ "imaps://username:password@[::1]:993",
+ "imaps://username:password@[::1]:993/mailbox",
+ "imaps://username:password@[::1]:555",
+ "imaps://username:password@[::1]:555/mailbox",
+
+ "imaps://username:password;auth=MECH@hostname",
+ "imaps://username:password;auth=MECH@hostname/mailbox",
+ "imaps://username:password;auth=MECH@hostname:993",
+ "imaps://username:password;auth=MECH@hostname:993/mailbox",
+ "imaps://username:password;auth=MECH@hostname:555",
+ "imaps://username:password;auth=MECH@hostname:555/mailbox",
+
+ "imaps://username:password;auth=MECH@[::1]",
+ "imaps://username:password;auth=MECH@[::1]/mailbox",
+ "imaps://username:password;auth=MECH@[::1]:993",
+ "imaps://username:password;auth=MECH@[::1]:993/mailbox",
+ "imaps://username:password;auth=MECH@[::1]:555",
+ "imaps://username:password;auth=MECH@[::1]:555/mailbox",
+ };
+ const char *gmail_uri_list[] = {
+ "gmail://invalid",
+
+ "gmail://username:password"
+ };
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS(pop_uri_list); i++)
+ {
+ 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");
+ }
+ }
+
+ for (i = 0; i < G_N_ELEMENTS(imap_uri_list); i++)
+ {
+ 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");
+ }
+ }
+
+ for (i = 0; i < G_N_ELEMENTS(gmail_uri_list); i++)
+ {
+ 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");
+ }
+ }
+
+ return 0;
+}
diff --git a/tests/test-uri.expected b/tests/test-uri.expected
@@ -0,0 +1,78 @@
+pop 0: invalid
+pop 1: pop://username:password@hostname
+pop 2: pop://username:password@hostname
+pop 3: pop://username:password@hostname:555
+pop 4: pop://username:password@[::1]
+pop 5: pop://username:password@[::1]
+pop 6: pop://username:password@[::1]:555
+pop 7: pop://username:password;auth=MECH@hostname
+pop 8: pop://username:password;auth=MECH@hostname
+pop 9: pop://username:password;auth=MECH@hostname:555
+pop 10: pop://username:password;auth=MECH@[::1]
+pop 11: pop://username:password;auth=MECH@[::1]
+pop 12: pop://username:password;auth=MECH@[::1]:555
+pop 13: invalid
+pop 14: pops://username:password@hostname
+pop 15: pops://username:password@hostname
+pop 16: pops://username:password@hostname:555
+pop 17: pops://username:password@[::1]
+pop 18: pops://username:password@[::1]
+pop 19: pops://username:password@[::1]:555
+pop 20: pops://username:password;auth=MECH@hostname
+pop 21: pops://username:password;auth=MECH@hostname
+pop 22: pops://username:password;auth=MECH@hostname:555
+pop 23: pops://username:password;auth=MECH@[::1]
+pop 24: pops://username:password;auth=MECH@[::1]
+pop 25: pops://username:password;auth=MECH@[::1]:555
+imap 0: invalid
+imap 1: imap://username:password@hostname
+imap 2: imap://username:password@hostname/mailbox
+imap 3: imap://username:password@hostname
+imap 4: imap://username:password@hostname/mailbox
+imap 5: imap://username:password@hostname:555
+imap 6: imap://username:password@hostname:555/mailbox
+imap 7: imap://username:password@[::1]
+imap 8: imap://username:password@[::1]/mailbox
+imap 9: imap://username:password@[::1]
+imap 10: imap://username:password@[::1]/mailbox
+imap 11: imap://username:password@[::1]:555
+imap 12: imap://username:password@[::1]:555/mailbox
+imap 13: imap://username:password;auth=MECH@hostname
+imap 14: imap://username:password;auth=MECH@hostname/mailbox
+imap 15: imap://username:password;auth=MECH@hostname
+imap 16: imap://username:password;auth=MECH@hostname/mailbox
+imap 17: imap://username:password;auth=MECH@hostname:555
+imap 18: imap://username:password;auth=MECH@hostname:555/mailbox
+imap 19: imap://username:password;auth=MECH@[::1]
+imap 20: imap://username:password;auth=MECH@[::1]/mailbox
+imap 21: imap://username:password;auth=MECH@[::1]
+imap 22: imap://username:password;auth=MECH@[::1]/mailbox
+imap 23: imap://username:password;auth=MECH@[::1]:555
+imap 24: imap://username:password;auth=MECH@[::1]:555/mailbox
+imap 25: invalid
+imap 26: imaps://username:password@hostname
+imap 27: imaps://username:password@hostname/mailbox
+imap 28: imaps://username:password@hostname
+imap 29: imaps://username:password@hostname/mailbox
+imap 30: imaps://username:password@hostname:555
+imap 31: imaps://username:password@hostname:555/mailbox
+imap 32: imaps://username:password@[::1]
+imap 33: imaps://username:password@[::1]/mailbox
+imap 34: imaps://username:password@[::1]
+imap 35: imaps://username:password@[::1]/mailbox
+imap 36: imaps://username:password@[::1]:555
+imap 37: imaps://username:password@[::1]:555/mailbox
+imap 38: imaps://username:password;auth=MECH@hostname
+imap 39: imaps://username:password;auth=MECH@hostname/mailbox
+imap 40: imaps://username:password;auth=MECH@hostname
+imap 41: imaps://username:password;auth=MECH@hostname/mailbox
+imap 42: imaps://username:password;auth=MECH@hostname:555
+imap 43: imaps://username:password;auth=MECH@hostname:555/mailbox
+imap 44: imaps://username:password;auth=MECH@[::1]
+imap 45: imaps://username:password;auth=MECH@[::1]/mailbox
+imap 46: imaps://username:password;auth=MECH@[::1]
+imap 47: imaps://username:password;auth=MECH@[::1]/mailbox
+imap 48: imaps://username:password;auth=MECH@[::1]:555
+imap 49: imaps://username:password;auth=MECH@[::1]:555/mailbox
+gmail 0: invalid
+gmail 1: gmail://username:password
diff --git a/tests/test-vfs-read-line.c b/tests/test-vfs-read-line.c
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+#include "mn-vfs.h"
+
+int
+main (int argc, char **argv)
+{
+ GnomeVFSResult result;
+ GnomeVFSHandle *handle;
+ MNVFSReadLineContext *context = NULL;
+ const char *line;
+
+ g_log_set_fatal_mask(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL);
+
+ if (argc != 2)
+ g_critical("wrong number of arguments");
+
+ if (! gnome_vfs_init())
+ g_critical("unable to initialize GnomeVFS");
+
+ result = gnome_vfs_open(&handle, argv[1], GNOME_VFS_OPEN_READ);
+ if (result != GNOME_VFS_OK)
+ g_critical("unable to open %s: %s", argv[1], gnome_vfs_result_to_string(result));
+
+ while ((result = mn_vfs_read_line(&context, handle, &line)) == GNOME_VFS_OK)
+ g_print("line: %s\n", line);
+
+ if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF)
+ g_critical("error while reading %s: %s", argv[1], gnome_vfs_result_to_string(result));
+
+ mn_vfs_read_line_context_free(context);
+ gnome_vfs_close(handle);
+
+ return 0;
+}
diff --git a/tests/test-vfs-read-line1.expected b/tests/test-vfs-read-line1.expected
@@ -0,0 +1,3 @@
+line: first line
+line: second line
+line: third line (unterminated)
diff --git a/tests/test-vfs-read-line1.input b/tests/test-vfs-read-line1.input
@@ -0,0 +1,3 @@
+first line
+second line
+third line (unterminated)
+\ No newline at end of file
diff --git a/tests/test-vfs-read-line2.expected b/tests/test-vfs-read-line2.expected
@@ -0,0 +1,3 @@
+line: first line
+line: second line
+line: third line (terminated)
diff --git a/tests/test-vfs-read-line2.input b/tests/test-vfs-read-line2.input
@@ -0,0 +1,3 @@
+first line
+second line
+third line (terminated)
diff --git a/ui/Makefile.am b/ui/Makefile.am
@@ -3,14 +3,12 @@ uidir = $(pkgdatadir)/ui
interfaces = \
dialog.glade \
mailbox-properties.glade \
- menu.glade \
- preferences.glade
+ properties.glade
projects = \
dialog.gladep \
mailbox-properties.gladep \
- menu.gladep \
- preferences.gladep
+ properties.gladep
dist_ui_DATA = $(interfaces)
diff --git a/ui/Makefile.in b/ui/Makefile.in
@@ -38,7 +38,8 @@ subdir = ui
DIST_COMMON = $(dist_ui_DATA) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.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
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -59,6 +60,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -83,10 +85,9 @@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
-GNET_CFLAGS = @GNET_CFLAGS@
-GNET_LIBS = @GNET_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
+GOB2 = @GOB2@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
G_ASSERTIONS = @G_ASSERTIONS@
@@ -119,6 +120,7 @@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
+LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
@@ -129,6 +131,9 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -141,6 +146,8 @@ POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+SASL_CFLAGS = @SASL_CFLAGS@
+SASL_LIBS = @SASL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOUP_CFLAGS = @SOUP_CFLAGS@
@@ -151,6 +158,8 @@ VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WITH_GMAIL_FALSE = @WITH_GMAIL_FALSE@
WITH_GMAIL_TRUE = @WITH_GMAIL_TRUE@
+WITH_IMAP_FALSE = @WITH_IMAP_FALSE@
+WITH_IMAP_TRUE = @WITH_IMAP_TRUE@
WITH_MAILDIR_FALSE = @WITH_MAILDIR_FALSE@
WITH_MAILDIR_TRUE = @WITH_MAILDIR_TRUE@
WITH_MBOX_FALSE = @WITH_MBOX_FALSE@
@@ -158,7 +167,15 @@ WITH_MBOX_TRUE = @WITH_MBOX_TRUE@
WITH_MH_FALSE = @WITH_MH_FALSE@
WITH_MH_TRUE = @WITH_MH_TRUE@
WITH_POP3_FALSE = @WITH_POP3_FALSE@
+WITH_POP3_OR_IMAP_FALSE = @WITH_POP3_OR_IMAP_FALSE@
+WITH_POP3_OR_IMAP_TRUE = @WITH_POP3_OR_IMAP_TRUE@
WITH_POP3_TRUE = @WITH_POP3_TRUE@
+WITH_REGRESSION_TESTS_FALSE = @WITH_REGRESSION_TESTS_FALSE@
+WITH_REGRESSION_TESTS_TRUE = @WITH_REGRESSION_TESTS_TRUE@
+WITH_SASL_FALSE = @WITH_SASL_FALSE@
+WITH_SASL_TRUE = @WITH_SASL_TRUE@
+WITH_SSL_FALSE = @WITH_SSL_FALSE@
+WITH_SSL_TRUE = @WITH_SSL_TRUE@
WITH_SYLPHEED_FALSE = @WITH_SYLPHEED_FALSE@
WITH_SYLPHEED_TRUE = @WITH_SYLPHEED_TRUE@
XGETTEXT = @XGETTEXT@
@@ -193,14 +210,12 @@ uidir = $(pkgdatadir)/ui
interfaces = \
dialog.glade \
mailbox-properties.glade \
- menu.glade \
- preferences.glade
+ properties.glade
projects = \
dialog.gladep \
mailbox-properties.gladep \
- menu.gladep \
- preferences.gladep
+ properties.gladep
dist_ui_DATA = $(interfaces)
EXTRA_DIST = $(projects)
diff --git a/ui/mailbox-properties.glade b/ui/mailbox-properties.glade
@@ -10,7 +10,7 @@
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
- <property name="resizable">True</property>
+ <property name="resizable">False</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
@@ -52,9 +52,9 @@
<property name="spacing">12</property>
<child>
- <widget class="GtkLabel" id="type_label">
+ <widget class="GtkLabel" id="mailbox_type_label">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Type:</property>
+ <property name="label" translatable="yes">_Mailbox type:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -64,7 +64,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="mnemonic_widget">type_combo</property>
+ <property name="mnemonic_widget">mailbox_type_combo</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -74,9 +74,9 @@
</child>
<child>
- <widget class="GtkComboBox" id="type_combo">
+ <widget class="GtkComboBox" id="mailbox_type_combo">
<property name="visible">True</property>
- <signal name="changed" handler="mn_mailbox_properties_dialog_type_changed_h" object="dialog" last_modification_time="Tue, 20 Jul 2004 21:55:29 GMT"/>
+ <signal name="changed" handler="mn_mailbox_properties_dialog_mailbox_type_changed_h" object="dialog" last_modification_time="Wed, 11 Aug 2004 16:33:22 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
@@ -93,449 +93,13 @@
</child>
<child>
- <widget class="GtkVBox" id="autodetect_vbox">
+ <widget class="GtkEventBox" id="properties_event_box">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox17">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="location_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Location:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">location_entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox18">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="location_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The URI of the mailbox</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">True</property>
- <signal name="changed" handler="mn_mailbox_properties_dialog_entry_changed_h" object="dialog" last_modification_time="Mon, 07 Jun 2004 16:44:58 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="browse_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Browse...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="mn_mailbox_properties_dialog_browse_clicked_h" object="dialog" last_modification_time="Mon, 07 Jun 2004 13:05:17 GMT"/>
- </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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="pop3_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox19">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="pop3_hostname_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Hostname:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">pop3_hostname_entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="pop3_hostname_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The hostname or IP address of the POP3 server</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- <signal name="activate" handler="mn_mailbox_properties_dialog_entry_activate_h" object="pop3_port_spin" last_modification_time="Fri, 16 Jul 2004 22:55:26 GMT"/>
- <signal name="changed" handler="mn_mailbox_properties_dialog_entry_changed_h" object="dialog" last_modification_time="Mon, 07 Jun 2004 13:26:45 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="pop3_port_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">P_ort:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">pop3_port_spin</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="pop3_port_spin">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The port number of the POP3 server</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">110 0 65535 1 10 10</property>
- <signal name="activate" handler="mn_mailbox_properties_dialog_entry_activate_h" object="pop3_username_entry" last_modification_time="Fri, 16 Jul 2004 22:55:40 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox20">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="pop3_username_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Username:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">pop3_username_entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="pop3_username_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Your username on the POP3 server</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- <signal name="activate" handler="mn_mailbox_properties_dialog_entry_activate_h" object="pop3_password_entry" last_modification_time="Fri, 16 Jul 2004 22:55:46 GMT"/>
- <signal name="changed" handler="mn_mailbox_properties_dialog_entry_changed_h" object="dialog" last_modification_time="Mon, 07 Jun 2004 13:29:30 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <property name="visible_window">False</property>
+ <property name="above_child">False</property>
<child>
- <widget class="GtkHBox" id="hbox22">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="pop3_password_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Password:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">pop3_password_entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="pop3_password_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Your password on the POP3 server</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">False</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- <signal name="activate" handler="mn_mailbox_properties_dialog_entry_activate_h" object="pop3_hostname_entry" last_modification_time="Fri, 16 Jul 2004 22:55:55 GMT"/>
- <signal name="changed" handler="mn_mailbox_properties_dialog_entry_changed_h" object="dialog" last_modification_time="Mon, 07 Jun 2004 13:29:45 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="gmail_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox21">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="gmail_username_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Username:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">gmail_username_entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="gmail_username_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Your Gmail username</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- <signal name="activate" handler="mn_mailbox_properties_dialog_entry_activate_h" object="gmail_password_entry" last_modification_time="Fri, 16 Jul 2004 22:56:20 GMT"/>
- <signal name="changed" handler="mn_mailbox_properties_dialog_entry_changed_h" object="dialog" last_modification_time="Fri, 16 Jul 2004 23:00:28 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox23">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="gmail_password_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Password:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">gmail_password_entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="gmail_password_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Your Gmail password</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">False</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- <signal name="activate" handler="mn_mailbox_properties_dialog_entry_activate_h" object="gmail_username_entry" last_modification_time="Fri, 16 Jul 2004 22:57:42 GMT"/>
- <signal name="changed" handler="mn_mailbox_properties_dialog_entry_changed_h" object="dialog" last_modification_time="Fri, 16 Jul 2004 22:57:55 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <placeholder/>
</child>
</widget>
<packing>
@@ -544,27 +108,6 @@
<property name="fill">True</property>
</packing>
</child>
-
- <child>
- <widget class="GtkLabel" id="unsupported_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This mailbox type has not been compiled in and is therefore unsupported.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</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>
diff --git a/ui/menu.glade b/ui/menu.glade
@@ -1,90 +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="GtkMenu" id="menu">
-
- <child>
- <widget class="GtkImageMenuItem" id="update">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Update the icon</property>
- <property name="label" translatable="yes">_Update</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mn_ui_update_activate_h" last_modification_time="Thu, 27 May 2004 18:00:02 GMT"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="stock">gtk-refresh</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="menuitem1">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="imagemenuitem2">
- <property name="visible">True</property>
- <property name="stock_item">GNOMEUIINFO_MENU_PREFERENCES_ITEM</property>
- <signal name="activate" handler="mn_ui_preferences_activate_h" last_modification_time="Sun, 27 Jul 2003 07:10:19 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="help1">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Show help</property>
- <property name="label" translatable="yes">_Help</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mn_ui_help_activate_h" last_modification_time="Mon, 28 Jun 2004 23:30:33 GMT"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image3">
- <property name="visible">True</property>
- <property name="stock">gtk-help</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="imagemenuitem3">
- <property name="visible">True</property>
- <property name="stock_item">GNOMEUIINFO_MENU_ABOUT_ITEM</property>
- <signal name="activate" handler="mn_ui_about_activate_h" last_modification_time="Sun, 27 Jul 2003 07:10:19 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="menuitem2">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="imagemenuitem4">
- <property name="visible">True</property>
- <property name="stock_item">GNOMEUIINFO_MENU_EXIT_ITEM</property>
- <signal name="activate" handler="mn_ui_quit_activate_h" last_modification_time="Sun, 27 Jul 2003 07:10:19 GMT"/>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/ui/menu.gladep b/ui/menu.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 Menu</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>menu-strings.c</translatable_strings_file>
-</glade-project>
diff --git a/ui/preferences.glade b/ui/preferences.glade
@@ -1,773 +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">Mail Notification Preferences</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">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="icon">preferences-icon.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>
- <signal name="destroy" handler="mn_preferences_destroy_h" last_modification_time="Sat, 06 Dec 2003 11:43:50 GMT"/>
- <signal name="response" handler="mn_preferences_response_h" last_modification_time="Sat, 06 Dec 2003 12:33:33 GMT"/>
-
- <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>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-help</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-11</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-7</property>
- </widget>
- </child>
- </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="GtkVBox" id="vbox2">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><span weight="bold">General</span></property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox11">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="delay_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Delay between mail checks:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">minutes_spin</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox12">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkSpinButton" id="minutes_spin">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The amount of time to wait between mail checks</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 1440 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minutes</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkSpinButton" id="seconds_spin">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The amount of time to wait between mail checks</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 59 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">seconds</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><span weight="bold">Mailboxes</span></property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolled">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
- <signal name="drag_motion" handler="mn_preferences_scrolled_drag_motion_h" last_modification_time="Tue, 15 Jun 2004 14:16:09 GMT"/>
-
- <child>
- <widget class="GtkTreeView" id="list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <signal name="popup_menu" handler="mn_preferences_list_popup_menu_h" last_modification_time="Wed, 26 May 2004 23:37:04 GMT"/>
- <signal name="button_press_event" handler="mn_preferences_list_button_press_event_h" last_modification_time="Wed, 26 May 2004 23:37:29 GMT"/>
- <signal name="row_activated" handler="mn_preferences_list_row_activated_h" last_modification_time="Sat, 05 Jun 2004 21:45:43 GMT"/>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="selected_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkHBox" id="hbox5">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="mn_preferences_add_clicked_h" last_modification_time="Thu, 27 May 2004 20:34:29 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="remove">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="mn_preferences_remove_clicked_h" last_modification_time="Sat, 06 Dec 2003 14:00:02 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="properties">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-properties</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="mn_preferences_properties_clicked_h" last_modification_time="Sat, 05 Jun 2004 20:07:54 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox7">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><span weight="bold">Commands</span></property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</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>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="command_new_mail_check">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Whether to run a command when new mail arrives or not</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">When _new mail arrives:</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_preferences_toggled_h" last_modification_time="Sun, 27 Jul 2003 08:45:08 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="command_new_mail_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The command to run when new mail arrives</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="command_clicked_check">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Whether to run a command when the icon is clicked or not</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">When click_ed:</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_preferences_toggled_h" last_modification_time="Sun, 27 Jul 2003 08:45:01 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="command_clicked_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The command to run when the icon is clicked</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </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>
-
-<widget class="GtkMenu" id="mailbox_menu">
-
- <child>
- <widget class="GtkImageMenuItem" id="add_item">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mn_preferences_add_item_activate_h" last_modification_time="Thu, 27 May 2004 20:35:19 GMT"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image10">
- <property name="visible">True</property>
- <property name="stock">gtk-add</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="remove_item">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Remove</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="mn_preferences_remove_item_activate_h" last_modification_time="Wed, 26 May 2004 23:31:31 GMT"/>
-
- <child internal-child="image">
- <widget class="GtkImage" id="image11">
- <property name="visible">True</property>
- <property name="stock">gtk-remove</property>
- <property name="icon_size">1</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator1">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="cut_item">
- <property name="visible">True</property>
- <property name="stock_item">GNOMEUIINFO_MENU_CUT_ITEM</property>
- <signal name="activate" handler="mn_preferences_cut_item_activate_h" last_modification_time="Sat, 12 Jun 2004 19:00:48 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="copy_item">
- <property name="visible">True</property>
- <property name="stock_item">GNOMEUIINFO_MENU_COPY_ITEM</property>
- <signal name="activate" handler="mn_preferences_copy_item_activate_h" last_modification_time="Sat, 12 Jun 2004 19:00:48 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="paste_item">
- <property name="visible">True</property>
- <property name="stock_item">GNOMEUIINFO_MENU_PASTE_ITEM</property>
- <signal name="activate" handler="mn_preferences_paste_item_activate_h" last_modification_time="Sat, 12 Jun 2004 19:00:48 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator2">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="properties_item">
- <property name="visible">True</property>
- <property name="stock_item">GNOMEUIINFO_MENU_PROPERTIES_ITEM</property>
- <signal name="activate" handler="mn_preferences_properties_item_activate_h" last_modification_time="Sat, 05 Jun 2004 20:10:49 GMT"/>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/ui/preferences.gladep b/ui/preferences.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 Preferences</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>preferences-strings.c</translatable_strings_file>
-</glade-project>
diff --git a/ui/properties.glade b/ui/properties.glade
@@ -0,0 +1,672 @@
+<?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">Mail Notification Properties</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">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="icon">properties-icon.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>
+ <signal name="response" handler="mn_properties_response_h" last_modification_time="Sat, 06 Dec 2003 12:33:33 GMT"/>
+
+ <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>
+
+ <child>
+ <widget class="GtkButton" id="button3">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-11</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button4">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-7</property>
+ </widget>
+ </child>
+ </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="GtkVBox" id="vbox2">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">18</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><span weight="bold">General</span></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkVBox" id="vbox9">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox11">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="delay_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Delay between mail checks:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">minutes_spin</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox12">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkSpinButton" id="minutes_spin">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">The amount of time to wait between mail checks</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">True</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">1 0 1440 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">minutes</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkSpinButton" id="seconds_spin">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">The amount of time to wait between mail checks</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">True</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">1 0 59 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">seconds</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</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>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><span weight="bold">Mailboxes</span></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkVBox" id="vbox6">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolled">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="selected_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">True</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkButton" id="button2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="mn_properties_add_clicked_h" last_modification_time="Thu, 27 May 2004 20:34:29 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="remove">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="mn_properties_remove_clicked_h" last_modification_time="Sat, 06 Dec 2003 14:00:02 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="properties">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-properties</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="mn_properties_properties_clicked_h" last_modification_time="Sat, 05 Jun 2004 20:07:54 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </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>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox7">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><span weight="bold">Commands</span></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</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>
+
+ <child>
+ <widget class="GtkVBox" id="vbox8">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="command_new_mail_check">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Whether to run a command when new mail arrives or not</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">When _new mail arrives:</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_toggled_h" last_modification_time="Sun, 27 Jul 2003 08:45:08 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="command_new_mail_entry">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">The command to run when new mail arrives</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox10">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="command_double_clicked_check">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Whether to run a command when the icon is double-clicked or not</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">When double-click_ed:</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_toggled_h" last_modification_time="Sun, 27 Jul 2003 08:45:01 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="command_double_clicked_entry">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">The command to run when the icon is double-clicked</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </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/properties.gladep b/ui/properties.gladep
@@ -0,0 +1,14 @@
+<?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 Properties</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>properties-strings.c</translatable_strings_file>
+</glade-project>