From: Dirk-Jan C. Binnema Date: Wed, 10 May 2006 10:46:37 +0000 (+0000) Subject: * initial code dump into SVN; needs some work X-Git-Tag: git_migration_finished~4821 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=434ec10090daec7d9d80c1f419b9113d15d58fd4;p=modest * initial code dump into SVN; needs some work pmo-trunk-r24 --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..997a6ec --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Dirk-Jan C. Binnema diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/COPYING @@ -0,0 +1 @@ + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..54caf7c --- /dev/null +++ b/INSTALL @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..4a37992 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,11 @@ +# +# Makefile.am for modest +# Time-stamp: <2006-04-22 16:29:00 (djcb)> +# + +SUBDIRS=\ + src\ + docs + +EXTRA_DIST=\ + autogen.sh diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..b7cf89b --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +No news diff --git a/README b/README new file mode 100644 index 0000000..4388450 --- /dev/null +++ b/README @@ -0,0 +1,15 @@ +modest +------ + +"modest" is a modest e-mail program, based on Philip van Hoofs *tinymail*. +tinymail is an effort to ease the writing of email programs, in particular +for small devices. + +And while tinymail can support just about anything, we are using it's +*libcamel* backend for mail protocol implementation. + +More about camel: http://go-evolution.org/Camel (* currently down *) +More about tinymail: https://svn.cronos.be/svn/tinymail/trunk/ + + + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..a795a83 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. +REQUIRED_AUTOMAKE_VERSION=1.7 +PKG_NAME=modest + +(test -f $srcdir/configure.ac \ + && test -f $srcdir/src/modest-main.c) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +which gnome-autogen.sh || { + echo "You need to install gnome-common from GNOME CVS" + exit 1 +} +USE_GNOME2_MACROS=1 . gnome-autogen.sh + +gtkdocize || { + echo -n "**Error**: gtkdoc not found. Please install" + exit 1 +} + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..2e8ee1c --- /dev/null +++ b/configure.ac @@ -0,0 +1,86 @@ +dnl configure.ac for modest +dnl Time-stamp: <2006-05-01 19:11:26 (djcb)> +dnl written by Dirk-Jan C. Binnema +AC_INIT([modest],[0.0.9],[http://maemo.org]) +AC_CONFIG_SRCDIR(src/modest-main.c) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION) + +AC_CONFIG_HEADERS([config.h]) + +if test x$prefix=xNONE; then + prefix=/usr/local +fi +AC_SUBST(prefix) + +AC_PROG_CC +AM_PROG_CC_C_O +AM_PROG_CC_STDC +AC_HEADER_STDC +AC_PROG_LIBTOOL + +# check for perl +AC_CHECK_PROG([perl]) +GTK_DOC_CHECK([1.0]) + +dnl # GLib/Gobject => mandatory +PKG_CHECK_MODULES(MODEST_GSTUFF,glib-2.0 >= 2.6 gobject-2.0) +AC_SUBST(MODEST_GSTUFF_CFLAGS) +AC_SUBST(MODEST_GSTUFF_LIBS) + +dnl # tinymail => mandatory +PKG_CHECK_MODULES(MODEST_TINYMAIL, libtinymail-1.0 libtinymail-camel-1.0 libtinymailui-1.0 libtinymailui-gtk-1.0) +AC_SUBST(MODEST_TINYMAIL_CFLAGS) +AC_SUBST(MODEST_TINYMAIL_LIBS) + +dnl # GConf => mandatory +PKG_CHECK_MODULES(MODEST_GCONF,gconf-2.0) +AC_SUBST(MODEST_GCONF_CFLAGS) +AC_SUBST(MODEST_GCONF_LIBS) + +dnl # Gtk+ => mandatory +PKG_CHECK_MODULES(MODEST_GTK,gtk+-2.0 >= 2.6) +AC_SUBST(MODEST_GTK_CFLAGS) +AC_SUBST(MODEST_GTK_LIBS) + +dnl # Glade +PKG_CHECK_MODULES(MODEST_GLADE,libglade-2.0,glade_support=yes,echo "no";glade_support=no) +AC_SUBST(MODEST_GLADE_CFLAGS) +AC_SUBST(MODEST_GLADE_LIBS) + +dnl dnl build the Hildon UI? +PKG_CHECK_MODULES(MODEST_HILDON,hildon libglade-2.0 libtinymailui-gtk-1.0,hildon_support=yes,echo "no";hildon_support=no) +AC_SUBST(MODEST_HILDON_CFLAGS) +AC_SUBST(MODEST_HILDON_LIBS) + +dnl now, determine what to build +AC_MSG_NOTICE([Determining what UI to build]) +modest_ui="none" +if test "x$hildon_support" = "xyes"; then + AC_SUBST(MODEST_UI_DIR,"hildon") + AC_DEFINE([MODEST_ENABLE_HILDON_UI],1,[Enable Hildon UI]) + modest_ui="hildon" +elif test "x$glade_support" = "xyes"; then + AC_SUBST(MODEST_UI_DIR,"gtk-glade") + AC_DEFINE([MODEST_ENABLE_GTK_GLADE_UI],1,[Enable Gtk-Glade UI]) + modest_ui="gtk-glade" +else + AC_SUBST(MODEST_UI_DIR,"gtk") + AC_DEFINE([MODEST_ENABLE_GTK_UI],1,[Enable Plain Gtk+ UI]) + modest_ui="gtk" +fi + +AC_OUTPUT([ +Makefile +src/Makefile +src/gtk/Makefile +src/gtk-glade/Makefile +src/hildon/Makefile +docs/Makefile +docs/reference/Makefile +]) + +echo +echo "modest configure results" +echo "-----------------------------------" +echo "User-interface : $modest_ui" +echo "" diff --git a/gtk-doc.make b/gtk-doc.make new file mode 100644 index 0000000..d50629a --- /dev/null +++ b/gtk-doc.make @@ -0,0 +1,153 @@ +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) +else +GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +EXTRA_DIST = \ + $(content_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ + $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS) + +if ENABLE_GTK_DOC +all-local: html-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo 'gtk-doc: Scanning header files' + @-chmod -R u+w $(srcdir) + if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ + else \ + cd $(srcdir) ; \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo 'gtk-doc: Rebuilding template files' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo 'gtk-doc: Building XML' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building HTML' + @-chmod -R u+w $(srcdir) + rm -rf $(srcdir)/html + mkdir $(srcdir)/html + cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @echo 'gtk-doc: Fixing cross-references' + cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + touch html-build.stamp +else +all-local: +endif + +############## + +clean-local: + rm -f *~ *.bak + rm -rf .libs + +maintainer-clean-local: clean + cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +install-data-local: + installfiles=`echo $(srcdir)/html/*`; \ + if test "$$installfiles" = '$(srcdir)/html/*'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(srcdir)/html/index.sgml' ; \ + $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ + fi + +uninstall-local: + rm -f $(DESTDIR)$(TARGET_DIR)/* + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/tmpl + mkdir $(distdir)/xml + mkdir $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + -cp $(srcdir)/xml/*.xml $(distdir)/xml + -cp $(srcdir)/html/* $(distdir)/html + if test -f $(srcdir)/$(DOC_MODULE).types; then \ + cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \ + fi + +.PHONY : dist-hook-local diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..897028f --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,43 @@ +# +# Makefile.am +# Time-stamp: <2006-05-08 21:11:31 (djcb)> +SUBDIRS=gtk gtk-glade hildon + +INCLUDES=\ + $(MODEST_GSTUFF_CFLAGS)\ + $(MODEST_GCONF_CFLAGS)\ + $(MODEST_GTK_CFLAGS)\ + $(MODEST_TINYMAIL_CFLAGS) + +bin_PROGRAMS=\ + modest + +modest_SOURCES=\ + modest-main.c\ + modest-conf-keys.h\ + modest-conf.h \ + modest-conf-gconf.c\ + modest-account-keys.h\ + modest-account-mgr.h\ + modest-account-mgr.c\ + modest-window-mgr.h\ + modest-window-mgr.c\ + modest-tny-account-store.h\ + modest-tny-account-store.c\ + modest-tny-folder-tree-view.h\ + modest-tny-folder-tree-view.c\ + modest-tny-header-tree-view.h\ + modest-tny-header-tree-view.c\ + modest-tny-msg-view.h\ + modest-tny-msg-view.c\ + modest-proto.h\ + modest-proto.c\ + modest-ui.h + +modest_LDADD = \ + $(MODEST_GSTUFF_LIBS) \ + $(MODEST_GCONF_LIBS) \ + $(MODEST_GTK_LIBS)\ + $(MODEST_GLADE_LIBS) \ + $(MODEST_TINYMAIL_LIBS)\ + $(MODEST_UI_DIR)/libmodest-ui.la diff --git a/src/gtk-glade/Makefile.am b/src/gtk-glade/Makefile.am new file mode 100644 index 0000000..47af953 --- /dev/null +++ b/src/gtk-glade/Makefile.am @@ -0,0 +1,37 @@ +# +# Makefile.am +# Time-stamp: <2006-04-30 13:49:49 (djcb)> +# +# +# use Automake 'trick' ==> convenience static libraries, which +# won't be installed, just for linking +# +INCLUDES=\ + $(MODEST_GSTUFF_CFLAGS) \ + $(MODEST_GTK_CFLAGS) \ + $(MODEST_GLADE_CFLAGS) \ + $(MODEST_TINYMAIL_CFLAGS) + +noinst_LTLIBRARIES=\ + libmodest-ui.la + +GLADE_SOURCE=\ + modest.glade.h + +GLADE_FILES=\ + modest.glade + +libmodest_ui_la_SOURCES=\ + modest-ui.c\ + $(GLADE_SOURCE) + +LDADD = \ + $(MODEST_GSTUFF_LIBS) \ + $(MODEST_GTK_LIBS) \ + $(MODEST_GLADE_LIBS) \ + $(MODEST_TINYMAIL_LIBS) + +EXTRA_DIST=pixmaps/*.png modest.glade modest.gladep + +$(GLADE_SOURCE): $(GLADE_FILES) + $(top_srcdir)/scripts/txt2doth $< > $@ diff --git a/src/gtk-glade/modest-ui.c b/src/gtk-glade/modest-ui.c new file mode 100644 index 0000000..ef24b15 --- /dev/null +++ b/src/gtk-glade/modest-ui.c @@ -0,0 +1,458 @@ +/* modest-ui.c */ + +/* insert (c)/licensing information) */ + +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif /*HAVE_CONFIG_H*/ + +#include "../modest-ui.h" +#include "../modest-window-mgr.h" +#include "../modest-account-mgr.h" + +#include "../modest-tny-account-store.h" +#include "../modest-tny-folder-tree-view.h" +#include "../modest-tny-header-tree-view.h" +#include "../modest-tny-msg-view.h" + +//#include "modest.glade.h" + +#define MODEST_GLADE "modest.glade" +#define MODEST_GLADE_MAIN_WIN "main" +#define MODEST_GLADE_EDIT_WIN "new_mail" + + +/* 'private'/'protected' functions */ +static void modest_ui_class_init (ModestUIClass *klass); +static void modest_ui_init (ModestUI *obj); +static void modest_ui_finalize (GObject *obj); + +static void modest_ui_window_destroy (GtkWidget *win, gpointer data); +static void modest_ui_last_window_closed (GObject *obj, gpointer data); + +static GtkWidget* modest_main_window_toolbar (void); +static GtkWidget* modest_main_window_folder_tree (ModestAccountMgr *modest_acc_mgr); +static GtkWidget* modest_main_window_header_tree (TnyMsgFolderIface *folder); + +static void on_folder_clicked (ModestTnyFolderTreeView *folder_tree, + TnyMsgFolderIface *folder, + gpointer data); +static void on_message_clicked (ModestTnyFolderTreeView *folder_tree, + TnyMsgIface *message, + gpointer data); + + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + + +typedef struct _ModestUIPrivate ModestUIPrivate; +struct _ModestUIPrivate { + + ModestConf *modest_conf; + ModestAccountMgr *modest_acc_mgr; + ModestWindowMgr *modest_window_mgr; + + GtkWindow *main_window; + GSList* *edit_window_list; + + GladeXML *glade_xml; + + +}; +#define MODEST_UI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_UI, \ + ModestUIPrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_ui_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestUIClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_ui_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestUI), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_ui_init, + }; + my_type = g_type_register_static (G_TYPE_OBJECT, + "ModestUI", + &my_info, 0); + } + return my_type; +} + +static void +modest_ui_class_init (ModestUIClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_ui_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestUIPrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + +static void +modest_ui_init (ModestUI *obj) +{ + ModestUIPrivate *priv = MODEST_UI_GET_PRIVATE(obj); + + priv->modest_acc_mgr = NULL; + priv->modest_conf = NULL; + priv->modest_window_mgr = NULL; + priv->glade_xml = NULL; + +} + +static void +modest_ui_finalize (GObject *obj) +{ + ModestUIPrivate *priv = MODEST_UI_GET_PRIVATE(obj); + + if (priv->modest_acc_mgr) + g_object_unref (priv->modest_acc_mgr); + priv->modest_acc_mgr = NULL; + + if (priv->modest_conf) + g_object_unref (priv->modest_conf); + priv->modest_conf = NULL; + + if (priv->modest_window_mgr) + g_object_unref (priv->modest_window_mgr); + priv->modest_window_mgr = NULL; +} + +GObject* +modest_ui_new (ModestConf *modest_conf) +{ + GObject *obj; + ModestUIPrivate *priv; + ModestAccountMgr *modest_acc_mgr; + + g_return_val_if_fail (modest_conf, NULL); + + obj = g_object_new(MODEST_TYPE_UI, NULL); + priv = MODEST_UI_GET_PRIVATE(obj); + + modest_acc_mgr = + MODEST_ACCOUNT_MGR(modest_account_mgr_new (modest_conf)); + if (!modest_acc_mgr) { + g_warning ("could not create ModestAccountMgr instance"); + g_object_unref (obj); + return NULL; + } + + glade_init (); + priv->glade_xml = glade_xml_new (MODEST_GLADE, + MODEST_GLADE_MAIN_WIN, + NULL); + if (!priv->glade_xml) { + g_warning ("failed to do glade stuff"); + g_object_unref (obj); + return NULL; + } + + priv->modest_acc_mgr = modest_acc_mgr; + g_object_ref (priv->modest_conf = modest_conf); + + priv->modest_window_mgr = MODEST_WINDOW_MGR(modest_window_mgr_new()); + g_signal_connect (priv->modest_window_mgr, "last_window_closed", + G_CALLBACK(modest_ui_last_window_closed), + NULL); + return obj; +} + + +gboolean +modest_ui_show_main_window (ModestUI *modest_ui) +{ + GtkWidget *win; + int height, width; + ModestUIPrivate *priv; + GtkWidget *folder_view, *header_view; + GtkWidget *message_view; + + GtkWidget *folder_view_holder, + *header_view_holder, + *message_view_holder; + + priv = MODEST_UI_GET_PRIVATE(modest_ui); + + height = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_MAIN_WINDOW_HEIGHT,NULL); + width = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_MAIN_WINDOW_WIDTH,NULL); + + win = glade_xml_get_widget (priv->glade_xml, "main"); + if (!win) { + g_warning ("could not create main window"); + return FALSE; + } + + folder_view = + GTK_WIDGET(modest_main_window_folder_tree(priv->modest_acc_mgr)); + folder_view_holder = glade_xml_get_widget (priv->glade_xml, "folders"); + if (!folder_view||!folder_view_holder) { + g_warning ("failed to create folder tree"); + return FALSE; + } + gtk_container_add (GTK_CONTAINER(folder_view_holder), folder_view); + + header_view = GTK_WIDGET(modest_main_window_header_tree (NULL)); + header_view_holder = glade_xml_get_widget (priv->glade_xml, "mail_list"); + if (!header_view) { + g_warning ("failed to create header tree"); + return FALSE; + } + gtk_container_add (GTK_CONTAINER(header_view_holder), header_view); + + g_signal_connect (G_OBJECT(folder_view), "folder_selected", + G_CALLBACK(on_folder_clicked), modest_ui); + + message_view = GTK_WIDGET(modest_tny_msg_view_new (NULL)); + message_view_holder = glade_xml_get_widget (priv->glade_xml, "mail_view"); + if (!message_view) { + g_warning ("failed to create message view"); + return FALSE; + } + gtk_container_add (GTK_CONTAINER(message_view_holder), message_view); + + g_signal_connect (header_view, "message_selected", + G_CALLBACK(on_message_clicked), + modest_ui); + + modest_window_mgr_register (priv->modest_window_mgr, + G_OBJECT(win), MODEST_MAIN_WINDOW, 0); + g_signal_connect (win, "destroy", G_CALLBACK(modest_ui_window_destroy), + modest_ui); + gtk_widget_set_usize (GTK_WIDGET(win), height, width); + gtk_window_set_title (GTK_WINDOW(win), PACKAGE_STRING); + + gtk_widget_show_all (win); + return TRUE; +} + + +gboolean +modest_ui_show_edit_window (ModestUI *modest_ui, const gchar* to, + const gchar* cc, const gchar* bcc, + const gchar* subject, const gchar *body, + const GSList* att) +{ + GtkWidget *win; + ModestUIPrivate *priv; + + priv = MODEST_UI_GET_PRIVATE(modest_ui); + int height = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_EDIT_WINDOW_HEIGHT,NULL); + int width = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_EDIT_WINDOW_WIDTH,NULL); + + win = glade_xml_get_widget (priv->glade_xml, "new_mail"); + if (!win) { + g_warning ("could not create edit window"); + return FALSE; + } + + modest_window_mgr_register (priv->modest_window_mgr, + G_OBJECT(win), MODEST_EDIT_WINDOW, 0); + + g_signal_connect (win, "destroy", G_CALLBACK(modest_ui_window_destroy), + modest_ui); + + gtk_widget_set_usize (GTK_WIDGET(win), height, width); + gtk_window_set_title (GTK_WINDOW(win), + subject ? subject : "Untitled"); + + gtk_widget_show_all (win); + + return TRUE; +} + + +static void +modest_ui_window_destroy (GtkWidget *win, gpointer data) +{ + ModestUIPrivate *priv; + + g_return_if_fail (data); + + priv = MODEST_UI_GET_PRIVATE((ModestUI*)data); + if (!modest_window_mgr_unregister (priv->modest_window_mgr, G_OBJECT(win))) + g_warning ("modest window mgr: failed to unregister %p", + G_OBJECT(win)); +} + + +static void +modest_ui_last_window_closed (GObject *obj, gpointer data) +{ + gtk_main_quit (); +} + + + + +static void on_folder_clicked (ModestTnyFolderTreeView *folder_tree, + TnyMsgFolderIface *folder, + gpointer data) +{ + GtkWidget *win; + ModestTnyHeaderTreeView *tree_view; + ModestUIPrivate *priv; + GtkWidget *scrollview; + + g_return_if_fail (folder); + g_return_if_fail (data); + + priv = MODEST_UI_GET_PRIVATE(data); + scrollview = glade_xml_get_widget (priv->glade_xml,"mail_list"); + + tree_view = MODEST_TNY_HEADER_TREE_VIEW( + gtk_bin_get_child(GTK_BIN(scrollview))); + win = glade_xml_get_widget (priv->glade_xml, "main"); + gtk_window_set_title (GTK_WINDOW(win), + tny_msg_folder_iface_get_name(folder)); + + modest_tny_header_tree_view_set_folder (tree_view, + folder); +} + + + +static void on_message_clicked (ModestTnyFolderTreeView *folder_tree, + TnyMsgIface *message, + gpointer data) +{ + GtkWidget *scrollview; + ModestTnyMsgView *msg_view; + ModestUIPrivate *priv; + + g_return_if_fail (message); + g_return_if_fail (data); + + priv = MODEST_UI_GET_PRIVATE(data); + scrollview = glade_xml_get_widget (priv->glade_xml,"mail_view"); + + msg_view = MODEST_TNY_MSG_VIEW( + gtk_bin_get_child(GTK_BIN(scrollview))); + + modest_tny_msg_view_set_message (msg_view, + message); +} + + + +static GtkWidget* +modest_main_window_header_tree (TnyMsgFolderIface *folder) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + GtkWidget *header_tree; + + header_tree = GTK_WIDGET(modest_tny_header_tree_view_new(folder)); + if (!header_tree) { + g_warning ("could not create header tree"); + return NULL; + } + + column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer, + "text", + TNY_MSG_HEADER_LIST_MODEL_DATE_RECEIVED_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(header_tree), column); + + + + column = gtk_tree_view_column_new_with_attributes(_("From"), renderer, + "text", + TNY_MSG_HEADER_LIST_MODEL_FROM_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(header_tree), column); + + + column = gtk_tree_view_column_new_with_attributes(_("Subject"), renderer, + "text", + TNY_MSG_HEADER_LIST_MODEL_SUBJECT_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(header_tree), column); + + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(header_tree), TRUE); + gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW(header_tree), TRUE); + + return GTK_WIDGET(header_tree); +} + + + + +static GtkWidget* +modest_main_window_folder_tree (ModestAccountMgr *modest_acc_mgr) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + GtkWidget *folder_tree; + TnyAccountStoreIface *account_store_iface = + TNY_ACCOUNT_STORE_IFACE(modest_tny_account_store_new (modest_acc_mgr)); + if (!account_store_iface) { + g_warning ("could not initialze ModestTnyAccountStore"); + return NULL; + } + + folder_tree = modest_tny_folder_tree_view_new (account_store_iface); + if (!folder_tree) { + g_warning ("could not create folder list"); + return NULL; + } + + column = gtk_tree_view_column_new_with_attributes(_("All Mail Folders"), + renderer,"text", + TNY_ACCOUNT_TREE_MODEL_NAME_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(folder_tree), column); + + column = gtk_tree_view_column_new_with_attributes(_("Unread"), + renderer, "text", + TNY_ACCOUNT_TREE_MODEL_UNREAD_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(folder_tree), column); + + + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(folder_tree), TRUE); + gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW(folder_tree), TRUE); + + return folder_tree; +} diff --git a/src/gtk-glade/modest.glade b/src/gtk-glade/modest.glade new file mode 100644 index 0000000..32ea10c --- /dev/null +++ b/src/gtk-glade/modest.glade @@ -0,0 +1,4753 @@ + + + + + + + Modest + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 800 + 600 + True + False + qgn_toolb_messagin.png + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR + + + + True + _Message + True + + + + + + + True + New e-mail + True + + + + + + + + True + Open + True + + + + + + + + True + + + + + + True + Reply + True + + + + + + + True + Reply to all + True + + + + + + + True + Forward + True + + + + + + + True + + + + + + True + Delete + True + + + + + + + True + + + + + + True + Details + True + + + + + + + + + + + True + _Edit + True + + + + + + + True + Undo + True + + + + + + + True + + + + + + True + Cut + True + + + + + + + True + Copy + True + + + + + + + True + Paste + True + + + + + + + True + _Select + True + + + + + + + True + Mark all + True + + + + + + + True + Unmark all + True + + + + + + + + + + + True + + + + + + True + Move to... + True + + + + + + + + + + + True + _Folders + True + + + + + + + True + New folder... + True + + + + + + + True + Manage folders + True + + + + + + + True + + + + + + True + Details + True + + + + + + + True + Folder settings... + True + + + + + + + True + + + + + + True + Inbox + True + True + + + + + + + True + Outbox + True + True + inbox1 + + + + + + + True + Drafts + True + True + inbox1 + + + + + + + True + Sent + True + True + inbox1 + + + + + + + True + Archive + True + True + inbox1 + + + + + + + + + + + True + _View + True + + + + + + + True + Sort... + True + + + + + + + True + + + + + + True + _Show toolbar + True + + + + + + + + True + Normal screen + True + True + + + + + + + True + Full screen + True + True + + + + + + + + + + + True + Folders + True + True + + + + + + + True + Full screen + True + False + + + + + + + + + + + True + E-m_ail + True + + + + + + + + True + Send & receive + True + + + + + + + True + Retrieve e-mail contents + True + + + + + + + True + Purge attacments + True + + + + + + + + + + + True + _Tools + True + + + + + + + + True + Open contacts... + True + + + + + + + True + + + + + + True + New account... + True + + + + + + + True + Account settings... + True + + + + + + + True + Options + True + + + + + + + True + + + + + + True + Search e-mails... + True + + + + + + + True + + + + + + True + Help + True + + + + + + + + + + + True + _Close + True + + + + + + + True + Close window + True + + + + + + + True + Close all windows + True + + + + + + + + + + 0 + False + False + + + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + True + True + + + + True + Compose new e-mail message + New e-mail + True + qgn_toolb_messagin_new.png + True + True + False + + + False + True + + + + + + True + Reply + Reply + True + qgn_toolb_messagin_reply.png + True + True + False + + + False + True + + + + + + True + Reply all + Reply all + True + qgn_toolb_messagin_replytoall.png + True + True + False + + + False + True + + + + + + True + Forward + Forward + True + qgn_toolb_messagin_forward.png + True + True + False + + + False + True + + + + + + True + Move message to other location + Move to... + True + qgn_toolb_messagin_moveto.png + True + True + False + + + False + True + + + + + + True + Delete message + Delete + True + qgn_toolb_messagin_delete.png + True + True + False + + + False + True + + + + + + True + Send and receive + Send & receive + True + qgn_toolb_messagin_sendreceive.png + True + True + False + + + False + True + + + + + 0 + False + False + + + + + + True + True + 170 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + + + + True + False + + + + + + True + True + 150 + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + + + + True + False + + + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + + + + True + True + + + + + True + True + + + + + 0 + True + True + + + + + + + + Modest - New message + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 800 + 600 + True + False + qgn_toolb_messagin.png + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR + + + + True + _Message + True + + + + + + + True + Send + True + + + + + + + True + + + + + + True + New e-mail + True + + + + + + + + True + + + + + + True + Delete message + True + + + + + + + True + + + + + + True + Select recipients... + True + + + + + + + True + Check names + True + + + + + + + + + + + True + _Edit + True + + + + + + + True + Undo + True + + + + + + + True + + + + + + True + Cut + True + + + + + + + True + Copy + True + + + + + + + True + Paste + True + + + + + + + True + Select all + True + + + + + + + + + + True + _Attachments + True + + + + + + + True + Attach file... + True + + + + + + + True + Insert inline image + True + + + + + + + True + + + + + + True + Remove attachment + True + + + + + + + + + + + True + _View + True + + + + + + + True + _Zoom + True + + + + + + + + True + 50% + True + True + + + + + + + True + 100% + True + True + 50%1 + + + + + + + True + 150% + True + True + 50%1 + + + + + + + True + 200% + True + True + 50%1 + + + + + + + + + + + True + Show toolbar + True + + + + + + + + True + Normal screen + True + True + + + + + + + True + Full screen + True + True + + + + + + + + + + + True + Full screen + True + False + + + + + + + True + + + + + + True + Show Cc + True + False + + + + + + + True + Show Bcc + True + False + + + + + + + + + + + True + _Format + True + + + + + + + + True + Font... + True + + + + + + + True + Bullets + True + + + + + + + True + Numbers + True + + + + + + + True + Alignment + True + + + + + + + True + Left + True + True + + + + + + + True + Center + True + True + left1 + + + + + + + True + Right + True + True + left1 + + + + + + + + + + + True + Background colour + True + + + + + + + + + + + True + _Tools + True + + + + + + + + True + Sending options... + True + + + + + + + True + + + + + + True + Find on page... + True + + + + + + + True + Search e-mails... + True + + + + + + + True + + + + + + True + Help + True + + + + + + + + + + + True + _Security + True + + + + + + + + True + None + True + True + + + + + + + True + Encrypt + True + True + none1 + + + + + + + True + Digitally sign + True + True + none1 + + + + + + + True + Digitally sign and encrypt + True + True + none1 + + + + + + + + + + + True + _Close + True + + + + + + + True + Close window + True + + + + + + + True + Close all windows + True + + + + + + + + + + 0 + False + False + + + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + True + True + + + + True + Send message + Send + True + qgn_toolb_messagin_send.png + True + True + False + + + False + True + + + + + + True + Add attachment + Attach + True + qgn_list_gene_attacpap.png + True + True + False + + + False + True + + + + + + True + Add reipients + Recipients + True + qgn_list_gene_contacts.png + True + True + False + + + False + True + + + + + 0 + False + False + + + + + + True + True + 65 + + + + 10 + True + 2 + 2 + False + 10 + 10 + + + + True + To: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Subject: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + True + False + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + True + True + + + + + 0 + True + True + + + + + + + + Modest - Message viewer + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 800 + 600 + True + False + qgn_toolb_messagin.png + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR + + + + True + _Message + True + + + + + + + True + Reply + True + + + + + + + True + Reply to all + True + + + + + + + True + Forward + True + + + + + + + True + + + + + + True + New e-mail + True + + + + + + + + True + + + + + + True + Delete + True + + + + + + + + + + + True + _Edit + True + + + + + + + True + Cut + True + + + + + + + True + Copy + True + + + + + + + True + Paste + True + + + + + + + True + Select all + True + + + + + + + + + + True + _Attachments + True + + + + + + + True + View + True + + + + + + + True + Save attachments... + True + + + + + + + True + Purge attachments + True + + + + + + + + + + + True + _View + True + + + + + + + True + Zoom + True + + + + + + + + True + 50% + True + True + + + + + + + True + 100% + True + True + + + + + + + True + 150% + True + True + + + + + + + True + 200% + True + True + + + + + + + + + + + True + Show toolbar + True + + + + + + + + True + Normal screen + True + True + + + + + + + True + Full screen + True + True + + + + + + + + + + + True + Full screen + True + False + + + + + + + True + + + + + + True + Next message + True + False + + + + + + + True + Previous message + True + False + + + + + + + + + + + True + _Tools + True + + + + + + + + True + Add contact... + True + + + + + + + True + + + + + + True + Font settings... + True + + + + + + + True + + + + + + True + Find on page... + True + + + + + + + True + Search e-mails... + True + + + + + + + True + + + + + + True + Help + True + + + + + + + + + + + True + _Security + True + + + + + + + + True + Details + True + + + + + + + + + + + True + _Close + True + + + + + + + True + Close window + True + + + + + + + True + Close all windows + True + + + + + + + + + + 0 + False + False + + + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + True + True + + + + True + Reply + Reply + True + qgn_toolb_messagin_reply.png + True + True + False + + + False + True + + + + + + True + Reply all + Reply all + True + qgn_toolb_messagin_replytoall.png + True + True + False + + + False + True + + + + + + True + Forward + Forward + True + qgn_toolb_messagin_forward.png + True + True + False + + + False + True + + + + + + True + Save attached files + Save Attacments... + True + qgn_toolb_messagin_saveattachment.png + True + True + False + + + False + True + + + + + + True + Move message to other location + Move to... + True + qgn_toolb_messagin_moveto.png + True + True + False + + + False + True + + + + + + True + View previous message + Previous + True + qgn_toolb_messagin_previous.png + True + True + False + + + False + True + + + + + + True + View next message + Next + True + qgn_toolb_messagin_next.png + True + True + False + + + False + True + + + + + 0 + False + False + + + + + + True + True + 100 + + + + 10 + True + 4 + 2 + False + 10 + 10 + + + + True + From: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Subject: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Date: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + fill + + + + + + + True + To: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + True + False + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + True + True + + + + + 0 + True + True + + + + + + + + 10 + 400 + 350 + True + Mailbox setup 1/4 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + Finish + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Back + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Next + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Cancel + True + GTK_RELIEF_NORMAL + True + 0 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 10 + + + + True + False + 0 + + + + True + Mailbox setup wizard allows you to define mailboxes for use on your device. + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 10 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + + + 0 + False + True + + + + + + True + 2 + 2 + False + 10 + 10 + + + + True + Mailbox name: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Mailbox type: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + False + True + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + ! Note: You cannot edit mailbox type once setup is complete + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 10 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + 10 + 400 + 350 + True + Mailbox setup 2/4 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + Finish + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Back + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Next + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Cancel + True + GTK_RELIEF_NORMAL + True + 0 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + 4 + 2 + False + 10 + 0 + + + + True + Name: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + User name: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + False + True + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + Password: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + E-mail address: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + True + True + False + 0 + + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 3 + 4 + + + + + + 0 + True + True + + + + + + + + 10 + 400 + 350 + True + Advanced E-mail settings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + Ok + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Cancel + True + GTK_RELIEF_NORMAL + True + 0 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + 10 + True + 4 + 2 + False + 10 + 10 + + + + True + Retrieve: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Password authentication + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + No of e-mails to retrieve + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + E-mail size limit: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + True + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + True + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + True + False + True + + + 1 + 2 + 3 + 4 + fill + fill + + + + + + True + False + 10 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + + + + + + False + True + + + + + + True + Retrieval + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 10 + True + False + 10 + + + + 10 + True + 2 + 2 + False + 10 + 10 + + + + True + Default e-mail format: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Sending e-mail: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + True + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + False + True + + + + + + True + True + Include original in reply + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Request read report + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + False + True + + + + + + True + Sending + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 10 + True + 3 + 2 + False + 10 + 10 + + + + True + False + True + + + 1 + 2 + 0 + 1 + fill + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + + True + Password: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + + + + + + + + True + Username: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + + + + + + + + True + SMTP authentication: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + False + False + + + + + + True + SMTP server + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 10 + True + False + 10 + + + + True + False + 10 + + + + True + Security: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 10 + + + + True + Incoming e-mail port: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 2 0 100 1 10 10 + + + 0 + False + True + + + + + 0 + False + False + + + + + + True + False + 10 + + + + True + Security: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 10 + + + + True + Outgoing e-mail port: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + 0 + False + True + + + + + 0 + False + False + + + + + + True + + + 0 + False + True + + + + + + True + True + Use specific connection + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 10 + + + + True + Connection: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + + + 0 + False + True + + + + + + True + True + Set as default mailbox + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + False + False + + + + + + True + Other + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 10 + True + False + 10 + + + + True + These security settings will be applied to %s + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + + 0 + False + False + + + + + + True + True + Encrypt mails by default + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Digitally sign e-mails by default + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + + + 0 + False + False + + + + + + True + False + 0 + + + + True + Display security indication for: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + True + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + True + All encrypted and digitally signed messages + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + All untrusted digital IDs + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + All expired or invalid digital IDs + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + False + True + + + + + + True + Security + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + + + 10 + 400 + 350 + True + Mailbox setup 3/4 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + Finish + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Back + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Next + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Cancel + True + GTK_RELIEF_NORMAL + True + 0 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + 2 + 2 + False + 10 + 10 + + + + True + Outgoing server: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Incoming server: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + False + True + True + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + True + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + True + True + + + + + + + + 10 + 400 + 350 + True + Mailbox setup 4/4 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + Finish + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Back + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Advanced + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + Cancel + True + GTK_RELIEF_NORMAL + True + 0 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + Mailbox setup is complete. + +Tap 'Finnish' to save or 'Cancel' to discard the settings. +Tap 'Advanced' to edit the advanced e-mail settings. + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + + diff --git a/src/gtk-glade/modest.glade.h b/src/gtk-glade/modest.glade.h new file mode 100644 index 0000000..17fec41 --- /dev/null +++ b/src/gtk-glade/modest.glade.h @@ -0,0 +1,4759 @@ +/* auto-generated from modest.glade */ +#ifndef __MODEST_GLADE_INCLUDED__ +#define __MODEST_GLADE_INCLUDED__ +static const char* MODEST_GLADE = +" \r\n" +"\r\n" +"\r\n" +"\r\n" +"\r\n" +"\r\n" +" Modest\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 800\r\n" +" 600\r\n" +" True\r\n" +" False\r\n" +" qgn_toolb_messagin.png\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_NORMAL\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_PACK_DIRECTION_LTR\r\n" +" GTK_PACK_DIRECTION_LTR\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Message\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" New e-mail\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Open\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply to all\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Forward\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Delete\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Details\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Edit\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Undo\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Cut\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Copy\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Paste\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Select\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Mark all\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Unmark all\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Move to...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Folders\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" New folder...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Manage folders\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Details\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Folder settings...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Inbox\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Outbox\r\n" +" True\r\n" +" True\r\n" +" inbox1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Drafts\r\n" +" True\r\n" +" True\r\n" +" inbox1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Sent\r\n" +" True\r\n" +" True\r\n" +" inbox1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Archive\r\n" +" True\r\n" +" True\r\n" +" inbox1\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _View\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Sort...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Show toolbar\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Normal screen\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Full screen\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Folders\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Full screen\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" E-m_ail\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Send & receive\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Retrieve e-mail contents\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Purge attacments\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Tools\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Open contacts...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" New account...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Account settings...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Options\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Search e-mails...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Help\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Close\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Close window\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Close all windows\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_ORIENTATION_HORIZONTAL\r\n" +" GTK_TOOLBAR_BOTH\r\n" +" True\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Compose new e-mail message\r\n" +" New e-mail\r\n" +" True\r\n" +" qgn_toolb_messagin_new.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply\r\n" +" Reply\r\n" +" True\r\n" +" qgn_toolb_messagin_reply.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply all\r\n" +" Reply all\r\n" +" True\r\n" +" qgn_toolb_messagin_replytoall.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Forward\r\n" +" Forward\r\n" +" True\r\n" +" qgn_toolb_messagin_forward.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Move message to other location\r\n" +" Move to...\r\n" +" True\r\n" +" qgn_toolb_messagin_moveto.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Delete message\r\n" +" Delete\r\n" +" True\r\n" +" qgn_toolb_messagin_delete.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Send and receive\r\n" +" Send & receive\r\n" +" True\r\n" +" qgn_toolb_messagin_sendreceive.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" 170\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_SHADOW_NONE\r\n" +" GTK_CORNER_TOP_LEFT\r\n" +"\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" 150\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" GTK_POLICY_NEVER\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_SHADOW_NONE\r\n" +" GTK_CORNER_TOP_LEFT\r\n" +"\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" GTK_POLICY_NEVER\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_SHADOW_NONE\r\n" +" GTK_CORNER_TOP_LEFT\r\n" +"\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +" Modest - New message\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 800\r\n" +" 600\r\n" +" True\r\n" +" False\r\n" +" qgn_toolb_messagin.png\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_NORMAL\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_PACK_DIRECTION_LTR\r\n" +" GTK_PACK_DIRECTION_LTR\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Message\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Send\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" New e-mail\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Delete message\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Select recipients...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Check names\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Edit\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Undo\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Cut\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Copy\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Paste\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Select all\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Attachments\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Attach file...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Insert inline image\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Remove attachment\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _View\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Zoom\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 50%\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 100%\r\n" +" True\r\n" +" True\r\n" +" 50%1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 150%\r\n" +" True\r\n" +" True\r\n" +" 50%1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 200%\r\n" +" True\r\n" +" True\r\n" +" 50%1\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Show toolbar\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Normal screen\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Full screen\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Full screen\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Show Cc\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Show Bcc\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Format\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Font...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Bullets\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Numbers\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Alignment\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Left\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Center\r\n" +" True\r\n" +" True\r\n" +" left1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Right\r\n" +" True\r\n" +" True\r\n" +" left1\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Background colour\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Tools\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Sending options...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Find on page...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Search e-mails...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Help\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Security\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" None\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Encrypt\r\n" +" True\r\n" +" True\r\n" +" none1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Digitally sign\r\n" +" True\r\n" +" True\r\n" +" none1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Digitally sign and encrypt\r\n" +" True\r\n" +" True\r\n" +" none1\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Close\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Close window\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Close all windows\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_ORIENTATION_HORIZONTAL\r\n" +" GTK_TOOLBAR_BOTH\r\n" +" True\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Send message\r\n" +" Send\r\n" +" True\r\n" +" qgn_toolb_messagin_send.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Add attachment\r\n" +" Attach\r\n" +" True\r\n" +" qgn_list_gene_attacpap.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Add reipients\r\n" +" Recipients\r\n" +" True\r\n" +" qgn_list_gene_contacts.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" 65\r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" 2\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" To:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_RIGHT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Subject:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_RIGHT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_SHADOW_IN\r\n" +" GTK_CORNER_TOP_LEFT\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" GTK_WRAP_NONE\r\n" +" True\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +" Modest - Message viewer\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 800\r\n" +" 600\r\n" +" True\r\n" +" False\r\n" +" qgn_toolb_messagin.png\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_NORMAL\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_PACK_DIRECTION_LTR\r\n" +" GTK_PACK_DIRECTION_LTR\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Message\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply to all\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Forward\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" New e-mail\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Delete\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Edit\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Cut\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Copy\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Paste\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Select all\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Attachments\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" View\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Save attachments...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Purge attachments\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _View\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Zoom\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 50%\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 100%\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 150%\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 200%\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Show toolbar\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Normal screen\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Full screen\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Full screen\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Next message\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Previous message\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Tools\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Add contact...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Font settings...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Find on page...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Search e-mails...\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Help\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Security\r\n" +" True\r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Details\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" _Close\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Close window\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Close all windows\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_ORIENTATION_HORIZONTAL\r\n" +" GTK_TOOLBAR_BOTH\r\n" +" True\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply\r\n" +" Reply\r\n" +" True\r\n" +" qgn_toolb_messagin_reply.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Reply all\r\n" +" Reply all\r\n" +" True\r\n" +" qgn_toolb_messagin_replytoall.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Forward\r\n" +" Forward\r\n" +" True\r\n" +" qgn_toolb_messagin_forward.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Save attached files\r\n" +" Save Attacments...\r\n" +" True\r\n" +" qgn_toolb_messagin_saveattachment.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Move message to other location\r\n" +" Move to...\r\n" +" True\r\n" +" qgn_toolb_messagin_moveto.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" View previous message\r\n" +" Previous\r\n" +" True\r\n" +" qgn_toolb_messagin_previous.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" View next message\r\n" +" Next\r\n" +" True\r\n" +" qgn_toolb_messagin_next.png\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" 100\r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" 4\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" From:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_RIGHT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Subject:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_RIGHT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 2\r\n" +" 3\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Date:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_RIGHT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 3\r\n" +" 4\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 2\r\n" +" 3\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 3\r\n" +" 4\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" To:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_RIGHT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_POLICY_AUTOMATIC\r\n" +" GTK_SHADOW_IN\r\n" +" GTK_CORNER_TOP_LEFT\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" GTK_WRAP_NONE\r\n" +" True\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +" 10\r\n" +" 400\r\n" +" 350\r\n" +" True\r\n" +" Mailbox setup 1/4\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 500\r\n" +" 400\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_DIALOG\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_BUTTONBOX_END\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Finish\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Back\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Next\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Cancel\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" GTK_PACK_END\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Mailbox setup wizard allows you to define mailboxes for use on your device.\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 10\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 2\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Mailbox name:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Mailbox type:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" ! Note: You cannot edit mailbox type once setup is complete\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 10\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +" 10\r\n" +" 400\r\n" +" 350\r\n" +" True\r\n" +" Mailbox setup 2/4\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 500\r\n" +" 400\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_DIALOG\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_BUTTONBOX_END\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Finish\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Back\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Next\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Cancel\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" GTK_PACK_END\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 4\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Name:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" User name:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" fill\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Password:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 2\r\n" +" 3\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" E-mail address:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 3\r\n" +" 4\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 2\r\n" +" 3\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 3\r\n" +" 4\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +" 10\r\n" +" 400\r\n" +" 350\r\n" +" True\r\n" +" Advanced E-mail settings\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 500\r\n" +" 400\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_DIALOG\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_BUTTONBOX_END\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Ok\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Cancel\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" GTK_PACK_END\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" GTK_POS_TOP\r\n" +" False\r\n" +" False\r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" 4\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Retrieve:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Password authentication\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 3\r\n" +" 4\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" No of e-mails to retrieve\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 2\r\n" +" 3\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" E-mail size limit:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 2\r\n" +" 3\r\n" +" fill\r\n" +" fill\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 3\r\n" +" 4\r\n" +" fill\r\n" +" fill\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" 1\r\n" +" 0\r\n" +" False\r\n" +" GTK_UPDATE_ALWAYS\r\n" +" False\r\n" +" False\r\n" +" 1 0 100 1 10 10\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Retrieval\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" tab\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" 2\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Default e-mail format:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Sending e-mail:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" Include original in reply\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" Request read report\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Sending\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" tab\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" 3\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 2\r\n" +" 3\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Password:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 2\r\n" +" 3\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Username:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" SMTP authentication:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" SMTP server\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" tab\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Security:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Incoming e-mail port:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" 1\r\n" +" 0\r\n" +" False\r\n" +" GTK_UPDATE_ALWAYS\r\n" +" False\r\n" +" False\r\n" +" 2 0 100 1 10 10\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Security:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Outgoing e-mail port:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" 1\r\n" +" 0\r\n" +" False\r\n" +" GTK_UPDATE_ALWAYS\r\n" +" False\r\n" +" False\r\n" +" 1 0 100 1 10 10\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" Use specific connection\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Connection:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" True\r\n" +" *\r\n" +" False\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" Set as default mailbox\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Other\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" tab\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" 10\r\n" +" True\r\n" +" False\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" These security settings will be applied to %s\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" Encrypt mails by default\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" Digitally sign e-mails by default\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Display security indication for:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" All encrypted and digitally signed messages\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" All untrusted digital IDs\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" All expired or invalid digital IDs\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" False\r\n" +" True\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Security\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" tab\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +" 10\r\n" +" 400\r\n" +" 350\r\n" +" True\r\n" +" Mailbox setup 3/4\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 500\r\n" +" 400\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_DIALOG\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_BUTTONBOX_END\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Finish\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Back\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Next\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Cancel\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" GTK_PACK_END\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" 2\r\n" +" 2\r\n" +" False\r\n" +" 10\r\n" +" 10\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Outgoing server:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Incoming server:\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" 1\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 0\r\n" +" 1\r\n" +" fill\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" 1\r\n" +" 2\r\n" +" 1\r\n" +" 2\r\n" +" fill\r\n" +" fill\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" True\r\n" +" True\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +" 10\r\n" +" 400\r\n" +" 350\r\n" +" True\r\n" +" Mailbox setup 4/4\r\n" +" GTK_WINDOW_TOPLEVEL\r\n" +" GTK_WIN_POS_NONE\r\n" +" False\r\n" +" 500\r\n" +" 400\r\n" +" False\r\n" +" False\r\n" +" True\r\n" +" False\r\n" +" False\r\n" +" GDK_WINDOW_TYPE_HINT_DIALOG\r\n" +" GDK_GRAVITY_NORTH_WEST\r\n" +" True\r\n" +" False\r\n" +" True\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" GTK_BUTTONBOX_END\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Finish\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Back\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Advanced\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" True\r\n" +" True\r\n" +" Cancel\r\n" +" True\r\n" +" GTK_RELIEF_NORMAL\r\n" +" True\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" True\r\n" +" GTK_PACK_END\r\n" +" \r\n" +" \r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" False\r\n" +" 0\r\n" +"\r\n" +" \r\n" +" \r\n" +" True\r\n" +" Mailbox setup is complete.\r\n" +"\r\n" +"Tap 'Finnish' to save or 'Cancel' to discard the settings.\r\n" +"Tap 'Advanced' to edit the advanced e-mail settings.\r\n" +" False\r\n" +" False\r\n" +" GTK_JUSTIFY_LEFT\r\n" +" False\r\n" +" False\r\n" +" 0.5\r\n" +" 0.5\r\n" +" 0\r\n" +" 0\r\n" +" PANGO_ELLIPSIZE_NONE\r\n" +" -1\r\n" +" False\r\n" +" 0\r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +" 0\r\n" +" False\r\n" +" False\r\n" +" \r\n" +" \r\n" +" \r\n" +" \r\n" +"\r\n" +"\r\n" +"\r\n" +; +#endif /*__MODEST_GLADE_INCLUDED__*/ diff --git a/src/gtk-glade/modest.gladep b/src/gtk-glade/modest.gladep new file mode 100644 index 0000000..4d1a57d --- /dev/null +++ b/src/gtk-glade/modest.gladep @@ -0,0 +1,8 @@ + + + + + Modest + Modest + FALSE + diff --git a/src/gtk-glade/pixmaps/qgn_list_gene_attacpap.png b/src/gtk-glade/pixmaps/qgn_list_gene_attacpap.png new file mode 100644 index 0000000..0448a7d Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_list_gene_attacpap.png differ diff --git a/src/gtk-glade/pixmaps/qgn_list_gene_bold.png b/src/gtk-glade/pixmaps/qgn_list_gene_bold.png new file mode 100644 index 0000000..5d10d3f Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_list_gene_bold.png differ diff --git a/src/gtk-glade/pixmaps/qgn_list_gene_contacts.png b/src/gtk-glade/pixmaps/qgn_list_gene_contacts.png new file mode 100644 index 0000000..350271d Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_list_gene_contacts.png differ diff --git a/src/gtk-glade/pixmaps/qgn_list_gene_italic.png b/src/gtk-glade/pixmaps/qgn_list_gene_italic.png new file mode 100644 index 0000000..638fa90 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_list_gene_italic.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin.png new file mode 100644 index 0000000..4c4899b Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_bullets.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_bullets.png new file mode 100644 index 0000000..aee5a70 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_bullets.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_delete.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_delete.png new file mode 100644 index 0000000..0f31b07 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_delete.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_fontcolor.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_fontcolor.png new file mode 100644 index 0000000..49304cd Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_fontcolor.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_forward.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_forward.png new file mode 100644 index 0000000..b286238 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_forward.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_moveto.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_moveto.png new file mode 100644 index 0000000..3497a2a Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_moveto.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_new.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_new.png new file mode 100644 index 0000000..b93921e Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_new.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_next.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_next.png new file mode 100644 index 0000000..6d70431 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_next.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_previous.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_previous.png new file mode 100644 index 0000000..184e319 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_previous.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_reply.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_reply.png new file mode 100644 index 0000000..5cdd7c2 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_reply.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_replytoall.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_replytoall.png new file mode 100644 index 0000000..78cde69 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_replytoall.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_saveattachment.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_saveattachment.png new file mode 100644 index 0000000..02d7eb1 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_saveattachment.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_send.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_send.png new file mode 100644 index 0000000..84a3420 Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_send.png differ diff --git a/src/gtk-glade/pixmaps/qgn_toolb_messagin_sendreceive.png b/src/gtk-glade/pixmaps/qgn_toolb_messagin_sendreceive.png new file mode 100644 index 0000000..0b794cd Binary files /dev/null and b/src/gtk-glade/pixmaps/qgn_toolb_messagin_sendreceive.png differ diff --git a/src/gtk/Makefile.am b/src/gtk/Makefile.am new file mode 100644 index 0000000..e6866cf --- /dev/null +++ b/src/gtk/Makefile.am @@ -0,0 +1,27 @@ +# +# Makefile.am +# Time-stamp: <2006-04-24 00:08:56 (djcb)> +# +# +# use Automake 'trick' ==> convenience static libraries, which +# won't be installed, just for linking +# +INCLUDES=\ + $(MODEST_GSTUFF_CFLAGS) \ + $(MODEST_GTK_CFLAGS) \ + $(MODEST_TINYMAIL_CFLAGS) + +noinst_LTLIBRARIES=\ + libmodest-ui.la + +libmodest_ui_la_SOURCES=\ + modest-ui.c\ + modest-main-window.h\ + modest-main-window.c\ + modest-edit-window.h\ + modest-edit-window.c + +LDADD = \ + $(MODEST_GSTUFF_LIBS) \ + $(MODEST_GTK_LIBS) \ + $(MODEST_TINYMAIL_LIBS) diff --git a/src/gtk/modest-edit-window.c b/src/gtk/modest-edit-window.c new file mode 100644 index 0000000..42538f1 --- /dev/null +++ b/src/gtk/modest-edit-window.c @@ -0,0 +1,309 @@ +/* modest-edit-window.c */ + +/* insert (c)/licensing information) */ + +#include +#include +#include "modest-edit-window.h" + + +#ifdef HAVE_CONFIG_H +#include +#endif /*HAVE_CONFIG_H*/ + +#include + +/* include other impl specific header files */ + +/* 'private'/'protected' functions */ +static void modest_edit_window_class_init (ModestEditWindowClass *klass); +static void modest_edit_window_init (ModestEditWindow *obj); +static void modest_edit_window_finalize (GObject *obj); + + +static GtkWidget* modest_edit_window_toolbar (void); + +static void on_send_clicked (GtkToolButton *button, gpointer data); +static void on_cut_clicked (GtkToolButton *button, gpointer data); +static void on_copy_clicked (GtkToolButton *button, gpointer data); +static void on_paste_clicked (GtkToolButton *button, gpointer data); +static void on_quit_clicked (GtkToolButton *button, gpointer data); +static void on_save_clicked (GtkToolButton *button, gpointer data); + + + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + +typedef struct _ModestEditWindowPrivate ModestEditWindowPrivate; +struct _ModestEditWindowPrivate { + + GtkEntry *to_entry; + GtkEntry *cc_entry; + GtkEntry *bcc_entry; + GtkEntry *subject_entry; + + GtkTextView *body_text; + GtkStatusbar *status_bar; + +}; +#define MODEST_EDIT_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_EDIT_WINDOW, \ + ModestEditWindowPrivate)) +/* globals */ +static GtkWindowClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_edit_window_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestEditWindowClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_edit_window_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestEditWindow), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_edit_window_init, + }; + my_type = g_type_register_static (GTK_TYPE_WINDOW, + "ModestEditWindow", + &my_info, 0); + } + return my_type; +} + +static void +modest_edit_window_class_init (ModestEditWindowClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_edit_window_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestEditWindowPrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + +static void +modest_edit_window_init (ModestEditWindow *self) +{ + ModestEditWindowPrivate *priv; + GtkWidget *vbox; + GtkWidget *to_button, *cc_button, *bcc_button; + GtkWidget *subject_label; + GtkWidget *table; + GtkWidget *scrolled_win; + GtkWidget *toolbar; + + priv = MODEST_EDIT_WINDOW_GET_PRIVATE(self); + + priv->to_entry = GTK_ENTRY(gtk_entry_new_with_max_length (255)); + priv->cc_entry = GTK_ENTRY(gtk_entry_new_with_max_length (255)); + priv->bcc_entry = GTK_ENTRY(gtk_entry_new_with_max_length (255)); + priv->subject_entry = GTK_ENTRY(gtk_entry_new_with_max_length (255)); + priv->status_bar = GTK_STATUSBAR(gtk_statusbar_new ()); + + toolbar = modest_edit_window_toolbar (); + + to_button = gtk_button_new_with_label (_("To...")); + cc_button = gtk_button_new_with_label (_("Cc...")); + bcc_button = gtk_button_new_with_label (_("Bcc..")); + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(scrolled_win), + GTK_SHADOW_IN); + + subject_label = gtk_label_new ("Subject:"); + + table = gtk_table_new (4, 2, FALSE); + + gtk_table_attach (GTK_TABLE(table), to_button, + 0, 1, 0, 1, 0, 0, 0, 0); + gtk_table_attach (GTK_TABLE(table), GTK_WIDGET(priv->to_entry), + 1, 2, 0, 1, GTK_EXPAND|GTK_FILL, 0, 0, 0); + + gtk_table_attach (GTK_TABLE(table), cc_button, + 0, 1, 1, 2, 0, 0, 0, 0); + gtk_table_attach (GTK_TABLE(table), GTK_WIDGET(priv->cc_entry), + 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, 0, 0, 0); + + gtk_table_attach (GTK_TABLE(table), bcc_button, + 0, 1, 2, 3, 0, 0, 0, 0); + gtk_table_attach (GTK_TABLE(table), GTK_WIDGET(priv->bcc_entry), + 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, 0, 0, 0); + + gtk_table_attach (GTK_TABLE(table), subject_label, + 0, 1, 3, 4, 0, 0, 0, 0); + gtk_table_attach (GTK_TABLE(table), GTK_WIDGET(priv->subject_entry), + 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, 0, 0, 0); + + priv->body_text = GTK_TEXT_VIEW(gtk_text_view_new ()); + + gtk_container_add (GTK_CONTAINER(scrolled_win), GTK_WIDGET(priv->body_text)); + + vbox = gtk_vbox_new (FALSE, 5); + + gtk_box_pack_start (GTK_BOX(vbox), toolbar, FALSE, TRUE,2); + gtk_box_pack_start (GTK_BOX(vbox), table, FALSE, TRUE,2); + gtk_box_pack_start (GTK_BOX(vbox), scrolled_win, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX(vbox), GTK_WIDGET(priv->status_bar), + FALSE, TRUE, 2); + + /* make everything but the top level container visible, + * so gtk_widget_show will work */ + gtk_widget_show_all (vbox); + gtk_container_add (GTK_CONTAINER(self), vbox); + +} + +static void +modest_edit_window_finalize (GObject *obj) +{ +/* free/unref instance resources here */ +} + + +GtkWidget* +modest_edit_window_new (const gchar *to, const gchar *cc, + const gchar *bcc, const gchar *subject, + const gchar *body, const GSList *attachments) +{ + + ModestEditWindowPrivate *priv; + GObject *obj = g_object_new(MODEST_TYPE_EDIT_WINDOW, NULL); + + priv = MODEST_EDIT_WINDOW_GET_PRIVATE(obj); + + /* FIXME: valid utf-8 */ + + if (to) + gtk_entry_set_text (priv->to_entry, to); + if (cc) + gtk_entry_set_text (priv->cc_entry, cc); + if (bcc) + gtk_entry_set_text (priv->bcc_entry,bcc); + + if (subject) + gtk_entry_set_text (priv->subject_entry, subject); + + if (body) + gtk_text_buffer_insert (gtk_text_view_get_buffer(priv->body_text), + NULL, body, strlen(body)); + + /* FIXME: attachments */ + + return GTK_WIDGET(obj); +} + + + + +static GtkWidget* +modest_edit_window_toolbar (void) +{ + GtkWidget *toolbar; + GtkToolItem *send, *save, *cut, *copy, *paste, *quit; + + toolbar = gtk_toolbar_new (); + + /* FIXME: get a better icon */ + send = gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_PLAY); + + save = gtk_tool_button_new_from_stock (GTK_STOCK_SAVE); + cut = gtk_tool_button_new_from_stock (GTK_STOCK_CUT); + copy = gtk_tool_button_new_from_stock (GTK_STOCK_COPY); + paste = gtk_tool_button_new_from_stock (GTK_STOCK_PASTE); + quit = gtk_tool_button_new_from_stock (GTK_STOCK_QUIT); + + g_signal_connect (send, "clicked", G_CALLBACK(on_send_clicked), + "send"); + g_signal_connect (save, "clicked", G_CALLBACK(on_save_clicked), + "save"); + g_signal_connect (cut, "clicked", G_CALLBACK(on_cut_clicked), + "cut"); + g_signal_connect (copy, "clicked", G_CALLBACK(on_copy_clicked), + "copy"); + g_signal_connect (paste, "clicked", G_CALLBACK(on_paste_clicked), + "send"); + g_signal_connect (quit, "clicked", G_CALLBACK(on_quit_clicked), + "quit"); + + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(send), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM(gtk_separator_tool_item_new()), + -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(save), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM(gtk_separator_tool_item_new()), + -1); + + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(cut), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(copy), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(paste), -1); + + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM(gtk_separator_tool_item_new()), + -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(quit), -1); + + return toolbar; +} + + +static void +on_send_clicked (GtkToolButton *button, gpointer data) +{ + g_warning ("clicked: %s", (gchar *)data); +} + +static void +on_cut_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} +static void +on_copy_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} +static void +on_paste_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} + +static void +on_save_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} + + + +static void +on_quit_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} + + diff --git a/src/gtk/modest-edit-window.h b/src/gtk/modest-edit-window.h new file mode 100644 index 0000000..c048d09 --- /dev/null +++ b/src/gtk/modest-edit-window.h @@ -0,0 +1,51 @@ +/* modest-edit-window.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_EDIT_WINDOW_H__ +#define __MODEST_EDIT_WINDOW_H__ + +#include +/* other include files */ + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_EDIT_WINDOW (modest_edit_window_get_type()) +#define MODEST_EDIT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_EDIT_WINDOW,ModestEditWindow)) +#define MODEST_EDIT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_EDIT_WINDOW,GtkWindow)) +#define MODEST_IS_EDIT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_EDIT_WINDOW)) +#define MODEST_IS_EDIT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_EDIT_WINDOW)) +#define MODEST_EDIT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_EDIT_WINDOW,ModestEditWindowClass)) + +typedef struct _ModestEditWindow ModestEditWindow; +typedef struct _ModestEditWindowClass ModestEditWindowClass; + +struct _ModestEditWindow { + GtkWindow parent; +}; + +struct _ModestEditWindowClass { + GtkWindowClass parent_class; + /* insert signal callback declarations, eg. */ + /* void (* my_event) (ModestEditWindow* obj); */ +}; + +/* member functions */ +GType modest_edit_window_get_type (void) G_GNUC_CONST; + + +GtkWidget* modest_edit_window_new (const gchar *to, + const gchar *cc, + const gchar *bcc, + const gchar *subject, + const gchar *body, + const GSList *attachments); +/* fill in other public functions, eg.: */ +/* void modest_edit_window_do_something (ModestEditWindow *self, const gchar* param); */ +/* gboolean modest_edit_window_has_foo (ModestEditWindow *self, gint value); */ + + +G_END_DECLS + +#endif /* __MODEST_EDIT_WINDOW_H__ */ + diff --git a/src/gtk/modest-main-window.c b/src/gtk/modest-main-window.c new file mode 100644 index 0000000..de23147 --- /dev/null +++ b/src/gtk/modest-main-window.c @@ -0,0 +1,545 @@ +/* modest-main-window.c */ + +/* insert (c)/licensing information) */ +#include +#include + + +#ifdef HAVE_CONFIG_H +#include +#endif /*HAVE_CONFIG_H*/ + +#include +#include "modest-main-window.h" + + + +#include "../modest-tny-account-store.h" +#include "../modest-tny-folder-tree-view.h" +#include "../modest-tny-header-tree-view.h" +#include "../modest-tny-msg-view.h" + + + +/* 'private'/'protected' functions */ +static void modest_main_window_class_init (ModestMainWindowClass *klass); +static void modest_main_window_init (ModestMainWindow *obj, + ModestConf *conf, + ModestAccountMgr *modest_acc_mgr); +static void modest_main_window_finalize (GObject *obj); + + +static GtkWidget* modest_main_window_folder_tree (ModestAccountMgr *modest_acc_mgr); +static GtkWidget* modest_main_window_header_tree (TnyMsgFolderIface *folder); + +static GtkWidget* modest_main_window_toolbar (void); +static GtkWidget* modest_main_window_favorite_folder_list (void); +static GtkWidget* modest_main_window_message_preview (void); +static GtkWidget * modest_main_window_get_ui (ModestTnyFolderTreeView *folder_view, + ModestTnyHeaderTreeView *header_view, + ModestTnyMsgView *message_view); +static void on_newmail_clicked (GtkToolButton *button, gpointer data); +static void on_refresh_clicked (GtkToolButton *button, gpointer data); +static void on_reply_clicked (GtkToolButton *button, gpointer data); +static void on_forward_clicked (GtkToolButton *button, gpointer data); +static void on_delmail_clicked (GtkToolButton *button, gpointer data); +static void on_cut_clicked (GtkToolButton *button, gpointer data); +static void on_copy_clicked (GtkToolButton *button, gpointer data); +static void on_paste_clicked (GtkToolButton *button, gpointer data); +static void on_quit_clicked (GtkToolButton *button, gpointer data); + +static void on_folder_clicked (ModestTnyFolderTreeView *self, + TnyMsgFolderIface *folder, + gpointer data); +static void on_message_clicked (ModestTnyFolderTreeView *folder_tree, + TnyMsgIface *message, + gpointer data); + + + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + +typedef struct _ModestMainWindowPrivate ModestMainWindowPrivate; +struct _ModestMainWindowPrivate { + + ModestConf *modest_conf; + ModestAccountMgr *modest_acc_mgr; + + ModestTnyFolderTreeView *folder_view; + ModestTnyHeaderTreeView *header_view; + ModestTnyMsgView *message_view; +}; +#define MODEST_MAIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_MAIN_WINDOW, \ + ModestMainWindowPrivate)) +/* globals */ +static GtkWidgetClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_main_window_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestMainWindowClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_main_window_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestMainWindow), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_main_window_init, + }; + my_type = g_type_register_static (GTK_TYPE_WINDOW, + "ModestMainWindow", + &my_info, 0); + } + return my_type; +} + +static void +modest_main_window_class_init (ModestMainWindowClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_main_window_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestMainWindowPrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + +static GtkWidget* +wrapped_in_scrolled_win (GtkWidget *child) +{ + GtkWidget *scrolled_win; + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(scrolled_win), + GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER(scrolled_win), child); + return scrolled_win; +} + + + +static void +modest_main_window_init (ModestMainWindow *obj, ModestConf *modest_conf, + ModestAccountMgr *modest_acc_mgr) +{ +} + + + + + +static void +modest_main_window_finalize (GObject *obj) +{ + ModestMainWindowPrivate *priv = MODEST_MAIN_WINDOW_GET_PRIVATE (obj); + + priv->modest_conf = NULL; + priv->modest_acc_mgr = NULL; +} + + + +GtkWidget* +modest_main_window_new (ModestConf *modest_conf, ModestAccountMgr *modest_acc_mgr) +{ + + GtkWidget *ui; + ModestMainWindow *self = + MODEST_MAIN_WINDOW(g_object_new(MODEST_TYPE_MAIN_WINDOW, NULL)); + ModestMainWindowPrivate *priv = MODEST_MAIN_WINDOW_GET_PRIVATE (self); + + priv->modest_conf = modest_conf; + priv->modest_acc_mgr = modest_acc_mgr; + + priv->header_view = MODEST_TNY_HEADER_TREE_VIEW(modest_main_window_header_tree (NULL)); + g_signal_connect (priv->header_view, "message_selected", + G_CALLBACK(on_message_clicked), + self); + + priv->folder_view = MODEST_TNY_FOLDER_TREE_VIEW(modest_main_window_folder_tree + (modest_acc_mgr)); + g_signal_connect (priv->folder_view, "folder_selected", + G_CALLBACK(on_folder_clicked), + self); + + priv->message_view = MODEST_TNY_MSG_VIEW (modest_main_window_message_preview()); + + ui = modest_main_window_get_ui(priv->folder_view, + priv->header_view, + priv->message_view); + gtk_container_add (GTK_CONTAINER(self), ui); + + return GTK_WIDGET(self); +} + + + + +static GtkWidget * +modest_main_window_get_ui (ModestTnyFolderTreeView *folder_view, + ModestTnyHeaderTreeView *header_view, + ModestTnyMsgView *message_view) + +{ + GtkWidget *vbox; + GtkWidget *msg_vpaned,*folder_vpaned, *folder_msg_hpaned; + GtkWidget *toolbar, *fav_folder_list; + GtkWidget *status_bar; + GtkWidget *swin_msg_list,*swin_folder_list, *swin_favfolder_list; + GtkWidget *folder_label, *message_label; + GtkWidget *folder_vbox, *message_vbox; + + toolbar = modest_main_window_toolbar (); + fav_folder_list = modest_main_window_favorite_folder_list (); + vbox = gtk_vbox_new (FALSE,2); + + folder_vbox = gtk_vbox_new (FALSE,2); + message_vbox = gtk_vbox_new (FALSE,2); + + msg_vpaned = gtk_vpaned_new (); + folder_vpaned = gtk_vpaned_new (); + folder_msg_hpaned = gtk_hpaned_new (); + + swin_msg_list = wrapped_in_scrolled_win (GTK_WIDGET(header_view)); + swin_folder_list = wrapped_in_scrolled_win (GTK_WIDGET(folder_view)); + swin_favfolder_list = wrapped_in_scrolled_win (fav_folder_list); + + folder_label = gtk_label_new (_("Folders")); + gtk_label_set_justify (GTK_LABEL(folder_label), GTK_JUSTIFY_LEFT); + + gtk_paned_add1 (GTK_PANED(folder_vpaned), swin_favfolder_list); + gtk_paned_add2 (GTK_PANED(folder_vpaned), swin_folder_list); + gtk_box_pack_start (GTK_BOX(folder_vbox), folder_label, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX(folder_vbox), folder_vpaned, TRUE, TRUE, 0); + + message_label= gtk_label_new (_("Inbox")); + gtk_label_set_justify (GTK_LABEL(message_label), GTK_JUSTIFY_LEFT); + gtk_paned_add1 (GTK_PANED(msg_vpaned), swin_msg_list); + gtk_paned_add2 (GTK_PANED(msg_vpaned), GTK_WIDGET(message_view)); + gtk_box_pack_start (GTK_BOX(message_vbox), message_label, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX(message_vbox), msg_vpaned, TRUE, TRUE, 0); + + + gtk_paned_add1 (GTK_PANED(folder_msg_hpaned), folder_vbox); + gtk_paned_add2 (GTK_PANED(folder_msg_hpaned), message_vbox); + + gtk_box_pack_start (GTK_BOX(vbox), toolbar, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX(vbox), folder_msg_hpaned, TRUE, TRUE, 0); + + status_bar = gtk_statusbar_new (); + gtk_box_pack_start (GTK_BOX(vbox), status_bar, FALSE, FALSE, 0); + + gtk_widget_show_all (GTK_WIDGET(vbox)); + return vbox; +} + + + +static GtkWidget* +modest_main_window_header_tree (TnyMsgFolderIface *folder) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + GtkWidget *header_tree; + + header_tree = GTK_WIDGET(modest_tny_header_tree_view_new(folder)); + if (!header_tree) { + g_warning ("could not create header tree"); + return NULL; + } + + column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer, + "text", + TNY_MSG_HEADER_LIST_MODEL_DATE_RECEIVED_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(header_tree), column); + + + + column = gtk_tree_view_column_new_with_attributes(_("From"), renderer, + "text", + TNY_MSG_HEADER_LIST_MODEL_FROM_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(header_tree), column); + + + column = gtk_tree_view_column_new_with_attributes(_("Subject"), renderer, + "text", + TNY_MSG_HEADER_LIST_MODEL_SUBJECT_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(header_tree), column); + + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(header_tree), TRUE); + gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW(header_tree), TRUE); + + return GTK_WIDGET(header_tree); +} + + + +static GtkWidget* +modest_main_window_folder_tree (ModestAccountMgr *modest_acc_mgr) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + GtkWidget *folder_tree; + TnyAccountStoreIface *account_store_iface = + TNY_ACCOUNT_STORE_IFACE(modest_tny_account_store_new (modest_acc_mgr)); + if (!account_store_iface) { + g_warning ("could not initialze ModestTnyAccountStore"); + return NULL; + } + + folder_tree = modest_tny_folder_tree_view_new (account_store_iface); + if (!folder_tree) { + g_warning ("could not create folder list"); + return NULL; + } + + column = gtk_tree_view_column_new_with_attributes(_("All Mail Folders"), + renderer,"text", + TNY_ACCOUNT_TREE_MODEL_NAME_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(folder_tree), column); + + column = gtk_tree_view_column_new_with_attributes(_("Unread"), + renderer, "text", + TNY_ACCOUNT_TREE_MODEL_UNREAD_COLUMN, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW(folder_tree), column); + + + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(folder_tree), TRUE); + gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW(folder_tree), TRUE); + + return folder_tree; +} + + +static GtkWidget* +modest_main_window_favorite_folder_list (void) +{ + GtkWidget *folder_list; + GtkListStore *folder_store; + GtkTreeIter iter; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + + folder_store = gtk_list_store_new (1, G_TYPE_STRING); + folder_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL(folder_store)); + + renderer = gtk_cell_renderer_text_new(); + + gtk_tree_view_insert_column (GTK_TREE_VIEW(folder_list), + gtk_tree_view_column_new_with_attributes(_("Favorite Folders"), + renderer, + "text", 0, + NULL), + 0); + gtk_list_store_insert_with_values (GTK_LIST_STORE(folder_store), + &iter, -1, 0, _("Stuff"), -1); + return folder_list; +} + + +static GtkWidget* +modest_main_window_toolbar (void) +{ + GtkWidget *toolbar; + GtkToolItem *newmail, *refresh, *reply, *forward, + *cut, *copy, *paste, *delmail, *quit; + + gpointer modest_ui = NULL; /* FIXME */ + + toolbar = gtk_toolbar_new (); + + newmail = gtk_tool_button_new_from_stock (GTK_STOCK_NEW); + delmail = gtk_tool_button_new_from_stock (GTK_STOCK_DELETE); + + reply = gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_PLAY); + forward = gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_FORWARD); + + refresh = gtk_tool_button_new_from_stock (GTK_STOCK_REFRESH); + + cut = gtk_tool_button_new_from_stock (GTK_STOCK_CUT); + copy = gtk_tool_button_new_from_stock (GTK_STOCK_COPY); + paste = gtk_tool_button_new_from_stock (GTK_STOCK_PASTE); + + quit = gtk_tool_button_new_from_stock (GTK_STOCK_QUIT); + + g_signal_connect (newmail, "clicked", G_CALLBACK(on_newmail_clicked), + modest_ui); + g_signal_connect (refresh, "clicked", G_CALLBACK(on_refresh_clicked), + modest_ui); + g_signal_connect (reply, "clicked", G_CALLBACK(on_reply_clicked), + modest_ui); + g_signal_connect (forward, "clicked", G_CALLBACK(on_forward_clicked), + modest_ui); + g_signal_connect (cut, "clicked", G_CALLBACK(on_cut_clicked), + modest_ui); + g_signal_connect (copy, "clicked", G_CALLBACK(on_copy_clicked), + modest_ui); + g_signal_connect (paste, "clicked", G_CALLBACK(on_paste_clicked), + modest_ui); + g_signal_connect (delmail, "clicked", G_CALLBACK(on_delmail_clicked), + modest_ui); + g_signal_connect (quit, "clicked", G_CALLBACK(on_quit_clicked), + modest_ui); + + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(newmail), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM(gtk_separator_tool_item_new()), + -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(refresh), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM(gtk_separator_tool_item_new()), + -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(reply), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(forward), -1); + + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM(gtk_separator_tool_item_new()), + -1); + + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(cut), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(copy), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(paste), -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(delmail), -1); + + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM(gtk_separator_tool_item_new()), + -1); + gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(quit), -1); + + return toolbar; +} + + +static GtkWidget* +modest_main_window_message_preview () +{ + ModestTnyMsgView *msg_view; + + msg_view = MODEST_TNY_MSG_VIEW(modest_tny_msg_view_new (NULL)); + + return GTK_WIDGET(msg_view); +} + + +static void +on_newmail_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} + +static void +on_refresh_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} +static void +on_reply_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} +static void +on_forward_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} +static void +on_delmail_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} + +static void +on_cut_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); + +} +static void +on_copy_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); + +} +static void +on_paste_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} + + +static void +on_quit_clicked (GtkToolButton *button, gpointer data) +{ + g_warning (__FUNCTION__); +} + + + +static void on_folder_clicked (ModestTnyFolderTreeView *folder_tree, + TnyMsgFolderIface *folder, + gpointer data) +{ + ModestMainWindow *self; + ModestMainWindowPrivate *priv; + + g_return_if_fail (folder); + g_return_if_fail (data); + + self = MODEST_MAIN_WINDOW(data); + priv = MODEST_MAIN_WINDOW_GET_PRIVATE (self); + + modest_tny_header_tree_view_set_folder (priv->header_view, + folder); +} + + + +static void on_message_clicked (ModestTnyFolderTreeView *folder_tree, + TnyMsgIface *message, + gpointer data) +{ + ModestMainWindow *self; + ModestMainWindowPrivate *priv; + + g_return_if_fail (message); + g_return_if_fail (data); + + self = MODEST_MAIN_WINDOW(data); + priv = MODEST_MAIN_WINDOW_GET_PRIVATE (self); + + modest_tny_msg_view_set_message (priv->message_view, + message); +} + diff --git a/src/gtk/modest-main-window.h b/src/gtk/modest-main-window.h new file mode 100644 index 0000000..e8ce12a --- /dev/null +++ b/src/gtk/modest-main-window.h @@ -0,0 +1,58 @@ +/* modest-main-window.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_MAIN_WINDOW_H__ +#define __MODEST_MAIN_WINDOW_H__ + + +#include +#include "../modest-conf.h" +#include "../modest-account-mgr.h" + +/* other include files */ + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_MAIN_WINDOW (modest_main_window_get_type()) +#define MODEST_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_MAIN_WINDOW,ModestMainWindow)) +#define MODEST_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_MAIN_WINDOW,GtkWidget)) +#define MODEST_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_MAIN_WINDOW)) +#define MODEST_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_MAIN_WINDOW)) +#define MODEST_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_MAIN_WINDOW,ModestMainWindowClass)) + +typedef struct _ModestMainWindow ModestMainWindow; +typedef struct _ModestMainWindowClass ModestMainWindowClass; + + +struct _ModestMainWindow { + GtkWindow parent; + /* insert public members, if any */ +}; + +struct _ModestMainWindowClass { + GtkWindowClass parent_class; + /* insert signal callback declarations, eg. */ + /* void (* my_event) (ModestMainWindow* obj); */ +}; + + + +/* member functions */ +GType modest_main_window_get_type (void) G_GNUC_CONST; + +/* typical parameter-less _new function */ +/* if this is a kind of GtkWidget, it should probably return at GtkWidget*, */ +/* otherwise probably a GObject*. */ +GtkWidget* modest_main_window_new (ModestConf *modest_conf, + ModestAccountMgr *modest_acc_mgr); + +/* fill in other public functions, eg.: */ +/* void modest_main_window_do_something (ModestMainWindow *self, const gchar* param); */ +/* gboolean modest_main_window_has_foo (ModestMainWindow *self, gint value); */ + + +G_END_DECLS + +#endif /* __MODEST_MAIN_WINDOW_H__ */ + diff --git a/src/gtk/modest-ui.c b/src/gtk/modest-ui.c new file mode 100644 index 0000000..4146aa6 --- /dev/null +++ b/src/gtk/modest-ui.c @@ -0,0 +1,250 @@ +/* modest-ui.c */ + +/* insert (c)/licensing information) */ + +#include + +#ifdef HAVE_CONFIG_H +#include +#endif /*HAVE_CONFIG_H*/ + +#include "modest-main-window.h" +#include "modest-edit-window.h" + +#include "../modest-ui.h" +#include "../modest-window-mgr.h" +#include "../modest-account-mgr.h" + + +/* include other impl specific header files */ + +/* 'private'/'protected' functions */ +static void modest_ui_class_init (ModestUIClass *klass); +static void modest_ui_init (ModestUI *obj); +static void modest_ui_finalize (GObject *obj); + +static void modest_ui_window_destroy (GtkWidget *win, gpointer data); +static void modest_ui_last_window_closed (GObject *obj, gpointer data); + + + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + + +typedef struct _ModestUIPrivate ModestUIPrivate; +struct _ModestUIPrivate { + + ModestConf *modest_conf; + ModestAccountMgr *modest_acc_mgr; + ModestWindowMgr *modest_window_mgr; + + GtkWindow *main_window; + GSList* *edit_window_list; + +}; +#define MODEST_UI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_UI, \ + ModestUIPrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_ui_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestUIClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_ui_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestUI), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_ui_init, + }; + my_type = g_type_register_static (G_TYPE_OBJECT, + "ModestUI", + &my_info, 0); + } + return my_type; +} + +static void +modest_ui_class_init (ModestUIClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_ui_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestUIPrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + +static void +modest_ui_init (ModestUI *obj) +{ + ModestUIPrivate *priv = MODEST_UI_GET_PRIVATE(obj); + + priv->modest_acc_mgr = NULL; + priv->modest_conf = NULL; + priv->modest_window_mgr = NULL; + +} + +static void +modest_ui_finalize (GObject *obj) +{ + ModestUIPrivate *priv = MODEST_UI_GET_PRIVATE(obj); + + if (priv->modest_acc_mgr) + g_object_unref (priv->modest_acc_mgr); + priv->modest_acc_mgr = NULL; + + if (priv->modest_conf) + g_object_unref (priv->modest_conf); + priv->modest_conf = NULL; + + if (priv->modest_window_mgr) + g_object_unref (priv->modest_window_mgr); + priv->modest_window_mgr = NULL; +} + +GObject* +modest_ui_new (ModestConf *modest_conf) +{ + GObject *obj; + ModestUIPrivate *priv; + ModestAccountMgr *modest_acc_mgr; + + g_return_val_if_fail (modest_conf, NULL); + + obj = g_object_new(MODEST_TYPE_UI, NULL); + priv = MODEST_UI_GET_PRIVATE(obj); + + modest_acc_mgr = MODEST_ACCOUNT_MGR(modest_account_mgr_new (modest_conf)); + if (!modest_acc_mgr) { + g_warning ("could not create ModestAccountMgr instance"); + g_object_unref (obj); + return NULL; + } + + priv->modest_acc_mgr = modest_acc_mgr; + g_object_ref (priv->modest_conf = modest_conf); + + priv->modest_window_mgr = MODEST_WINDOW_MGR(modest_window_mgr_new()); + g_signal_connect (priv->modest_window_mgr, "last_window_closed", + G_CALLBACK(modest_ui_last_window_closed), + NULL); + return obj; +} + + +gboolean +modest_ui_show_main_window (ModestUI *modest_ui) +{ + GtkWidget *win; + int height, width; + ModestUIPrivate *priv; + + priv = MODEST_UI_GET_PRIVATE(modest_ui); + + height = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_MAIN_WINDOW_HEIGHT,NULL); + width = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_MAIN_WINDOW_WIDTH,NULL); + + win = modest_main_window_new (priv->modest_conf, + priv->modest_acc_mgr); + if (!win) { + g_warning ("could not create main window"); + return FALSE; + } + + modest_window_mgr_register (priv->modest_window_mgr, + G_OBJECT(win), MODEST_MAIN_WINDOW, 0); + + g_signal_connect (win, "destroy", G_CALLBACK(modest_ui_window_destroy), + modest_ui); + + gtk_widget_set_usize (GTK_WIDGET(win), height, width); + gtk_window_set_title (GTK_WINDOW(win), PACKAGE_STRING); + + gtk_widget_show (win); + return TRUE; +} + + +gboolean +modest_ui_show_edit_window (ModestUI *modest_ui, const gchar* to, + const gchar* cc, const gchar* bcc, + const gchar* subject, const gchar *body, + const GSList* att) +{ + GtkWidget *win; + ModestUIPrivate *priv; + + priv = MODEST_UI_GET_PRIVATE(modest_ui); + int height = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_EDIT_WINDOW_HEIGHT,NULL); + int width = modest_conf_get_int (priv->modest_conf, + MODEST_CONF_EDIT_WINDOW_WIDTH,NULL); + + win = modest_edit_window_new (to, cc, bcc, subject, body, att); + if (!win) { + g_warning ("could not create edit window"); + return FALSE; + } + + modest_window_mgr_register (priv->modest_window_mgr, + G_OBJECT(win), MODEST_EDIT_WINDOW, 0); + + g_signal_connect (win, "destroy", G_CALLBACK(modest_ui_window_destroy), + modest_ui); + + gtk_widget_set_usize (GTK_WIDGET(win), height, width); + gtk_window_set_title (GTK_WINDOW(win), + subject ? subject : "Untitled"); + + gtk_widget_show (win); + + return TRUE; +} + + +static void +modest_ui_window_destroy (GtkWidget *win, gpointer data) +{ + ModestUIPrivate *priv; + + g_return_if_fail (data); + + priv = MODEST_UI_GET_PRIVATE((ModestUI*)data); + if (!modest_window_mgr_unregister (priv->modest_window_mgr, G_OBJECT(win))) + g_warning ("modest window mgr: failed to unregister %p", + G_OBJECT(win)); +} + + +static void +modest_ui_last_window_closed (GObject *obj, gpointer data) +{ + gtk_main_quit (); +} diff --git a/src/hildon/Makefile.am b/src/hildon/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/src/modest-account-keys.h b/src/modest-account-keys.h new file mode 100644 index 0000000..ae56675 --- /dev/null +++ b/src/modest-account-keys.h @@ -0,0 +1,29 @@ +#ifndef __MODEST_ACCOUNT_KEYS_H__ +#define __MODEST_ACCOUNT_KEYS_H__ + +#include "modest-conf-keys.h" + +#define MODEST_CONF_DEFAULT_ACCOUNT "/default_account" + + +#define MODEST_SERVER_ACCOUNT_NAMESPACE MODEST_CONF_NAMESPACE "/" "server_accounts" + +/* configuration key definitions for modest */ +#define MODEST_ACCOUNT_NAMESPACE MODEST_CONF_NAMESPACE "/" "accounts" + +/* per-account data */ +#define MODEST_ACCOUNT_DISPLAY_NAME "display_name" /* string */ +#define MODEST_ACCOUNT_STORE_ACCOUNT "store_account" /* string */ +#define MODEST_ACCOUNT_TRANSPORT_ACCOUNT "transport_account" /* string */ + +/* server account keys */ +#define MODEST_ACCOUNT_PASSWORD "password" /* string */ +#define MODEST_ACCOUNT_HOSTNAME "hostname" /* string */ +#define MODEST_ACCOUNT_USERNAME "username" /* string */ +#define MODEST_ACCOUNT_PROTO "proto" /* string */ + + +#define MODEST_ACCOUNT_LEAVE_ON_SERVER "leave_on_server" /* boolean */ \ +#define MODEST_ACCOUNT_PREFERRED_CNX "preferred_cnx" /* string */ + +#endif /*__MODEST_CONF_KEYS_H__*/ diff --git a/src/modest-account-mgr.c b/src/modest-account-mgr.c new file mode 100644 index 0000000..d77633c --- /dev/null +++ b/src/modest-account-mgr.c @@ -0,0 +1,522 @@ +/* modest-account-mgr.c */ + +/* insert (c)/licensing information) */ + +#include +#include "modest-account-mgr.h" + +/* 'private'/'protected' functions */ +static void modest_account_mgr_class_init (ModestAccountMgrClass *klass); +static void modest_account_mgr_init (ModestAccountMgr *obj); +static void modest_account_mgr_finalize (GObject *obj); + +static gchar* get_account_keyname (const gchar *accname, const gchar *name); + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + +typedef struct _ModestAccountMgrPrivate ModestAccountMgrPrivate; +struct _ModestAccountMgrPrivate { + ModestConf *modest_conf; +}; +#define MODEST_ACCOUNT_MGR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_ACCOUNT_MGR, \ + ModestAccountMgrPrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_account_mgr_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestAccountMgrClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_account_mgr_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestAccountMgr), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_account_mgr_init, + }; + + my_type = g_type_register_static (G_TYPE_OBJECT, + "ModestAccountMgr", + &my_info, 0); + } + return my_type; +} + +static void +modest_account_mgr_class_init (ModestAccountMgrClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_account_mgr_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestAccountMgrPrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + + +static void +modest_account_mgr_init (ModestAccountMgr *obj) +{ + ModestAccountMgrPrivate *priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(obj); + priv->modest_conf = NULL; +} + +static void +modest_account_mgr_finalize (GObject *obj) +{ + ModestAccountMgr *self = MODEST_ACCOUNT_MGR(obj); + ModestAccountMgrPrivate *priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + + g_object_unref (G_OBJECT(priv->modest_conf)); + priv->modest_conf = NULL; +} + +GObject* +modest_account_mgr_new (ModestConf *conf) +{ + GObject *obj; + ModestAccountMgrPrivate *priv; + + g_return_val_if_fail (conf, NULL); + + obj = G_OBJECT(g_object_new(MODEST_TYPE_ACCOUNT_MGR, NULL)); + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(obj); + + /* + * increase the ref count on the modest_conf. Normally, the + * ModestConf should outlive the ModestAccountMgr though + */ + g_object_ref(G_OBJECT(priv->modest_conf = conf)); + return obj; +} + + + +gboolean +modest_account_mgr_add_account (ModestAccountMgr *self, const gchar* name, + const gchar *store_account, + const gchar *transport_account, + GError **err) +{ + ModestAccountMgrPrivate *priv; + gchar *key; + gboolean retval; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + + if (modest_account_mgr_account_exists (self, name, err)) { + g_warning ("account already exists"); + //return FALSE; + } + /* + * we create the account by adding an account 'dir', with the name , + * and in that the 'display_name' string key + */ + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + + key = get_account_keyname (name, MODEST_ACCOUNT_DISPLAY_NAME); + modest_conf_set_string (priv->modest_conf, key, name, err); + g_free (key); + + if (store_account) { + key = get_account_keyname (name, MODEST_ACCOUNT_STORE_ACCOUNT); + modest_conf_set_string (priv->modest_conf, key, store_account, err); + g_free (key); + } + + if (transport_account) { + key = get_account_keyname (name, MODEST_ACCOUNT_TRANSPORT_ACCOUNT); + modest_conf_set_string (priv->modest_conf, key, transport_account, err); + g_free (key); + } + + return TRUE; /* TODO: error handling */ +} + + +gboolean +modest_account_mgr_remove_account (ModestAccountMgr *self, const gchar* name, + GError **err) +{ + ModestAccountMgrPrivate *priv; + gchar *key; + gboolean retval; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + + if (!modest_account_mgr_account_exists (self, name, err)) { + g_warning ("account doest not exist"); + return FALSE; + } + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + key = get_account_keyname (name, NULL); + + retval = modest_conf_remove_key (priv->modest_conf, key, NULL); + + g_free (key); + return retval; +} + + +static const gchar* +null_means_empty(const gchar* str) +{ + return str ? str : ""; +} + + +gboolean +modest_account_mgr_add_server_account (ModestAccountMgr *self, + const gchar *name, + const gchar *hostname, + const gchar *username, + const gchar *password, + const gchar *proto) +{ + ModestAccountMgrPrivate *priv; + gchar *acckey, *key; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + + /* TODO: check already exists */ + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + acckey = g_strconcat (MODEST_SERVER_ACCOUNT_NAMESPACE, "/", + name, NULL); + + if (modest_conf_key_exists(priv->modest_conf, acckey, NULL)) { + g_warning ("server account %s already exists", name); + g_free (acckey); + return FALSE; + } + + /* hostname */ + key = g_strconcat (acckey, "/", MODEST_ACCOUNT_HOSTNAME, NULL); + modest_conf_set_string (priv->modest_conf, key, + null_means_empty(hostname), NULL); + g_free (key); + + /* username */ + key = g_strconcat (acckey, "/", MODEST_ACCOUNT_USERNAME, NULL); + modest_conf_set_string (priv->modest_conf, key, + null_means_empty(username), NULL); + g_free (key); + + /* password */ + key = g_strconcat (acckey, "/", MODEST_ACCOUNT_PASSWORD, NULL); + modest_conf_set_string (priv->modest_conf, key, + null_means_empty(password), NULL); + g_free (key); + + /* proto */ + key = g_strconcat (acckey, "/", MODEST_ACCOUNT_PROTO, NULL); + modest_conf_set_string (priv->modest_conf, key, + null_means_empty(proto), + NULL); + g_free (key); + + return TRUE; /* FIXME: better error checking */ +} + +gboolean +modest_account_mgr_remove_server_account (ModestAccountMgr *self, + const gchar *name, + GError **err) +{ + ModestAccountMgrPrivate *priv; + gchar *acckey, *key; + gboolean retval; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + + acckey = g_strconcat (MODEST_SERVER_ACCOUNT_NAMESPACE, "/", + name, NULL); + + if (!modest_conf_key_exists(priv->modest_conf, acckey, NULL)) { + g_warning ("server account %s does not exist exist", name); + g_free (acckey); + return FALSE; + } + + retval = modest_conf_remove_key (priv->modest_conf, acckey, NULL); + g_free (acckey); + + return retval; +} + + + + +GSList* +modest_account_mgr_server_account_names (ModestAccountMgr *self, + const gchar* account_name, + ModestProtoType type, + const gchar* proto, + gboolean only_enabled) +{ + GSList *accounts; + GSList *cursor; + ModestAccountMgrPrivate *priv; + + g_return_val_if_fail (self, NULL); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + accounts = modest_conf_list_subkeys (priv->modest_conf, + MODEST_SERVER_ACCOUNT_NAMESPACE, + NULL); + + /* no restrictions, return everything */ + if (type == MODEST_PROTO_TYPE_ANY && !proto) + return accounts; + + /* otherwise, filter out the none-matching ones */ + cursor = accounts; + while (cursor) { + gchar *keyspace, *proto_key, *acc_proto; + + keyspace = (gchar*) cursor->data; + proto_key = g_strconcat (keyspace, "/", MODEST_ACCOUNT_PROTO, NULL); + acc_proto = modest_conf_get_string (priv->modest_conf, proto_key, + NULL); + g_free (proto_key); + + if ((!acc_proto) || /* proto not defined? */ + (type != MODEST_PROTO_TYPE_ANY && /* proto type ... */ + modest_proto_type (acc_proto) != type) || /* ... matches? */ + (proto && strcmp(proto,acc_proto) != 0)) { /* proto matches? */ + /* no match: remove from the list */ + GSList *nxt = cursor->next; + g_free (acc_proto); + accounts = g_slist_delete_link (accounts, cursor); + cursor = nxt; + } else + cursor = cursor->next; + } + + return accounts; +} + + + +GSList* +modest_account_mgr_account_names (ModestAccountMgr *self, GError **err) +{ + GSList *accounts, *cursor; + ModestAccountMgrPrivate *priv; + + g_return_val_if_fail (self, NULL); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + + return modest_conf_list_subkeys (priv->modest_conf, + MODEST_ACCOUNT_NAMESPACE, + err); +} + + +gchar* +modest_account_mgr_get_account_string (ModestAccountMgr *self, const gchar *name, + const gchar *key, GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + gchar *retval; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (name, NULL); + g_return_val_if_fail (key, NULL); + + keyname = get_account_keyname (name, key); + + g_warning ("===> %s", keyname); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + + retval = modest_conf_get_string (priv->modest_conf, + keyname, err); + + g_free (keyname); + return retval; +} + + + +gint +modest_account_mgr_get_account_int (ModestAccountMgr *self, const gchar *name, + const gchar *key, GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + gint retval; + + g_return_val_if_fail (self, -1); + g_return_val_if_fail (name, -1); + g_return_val_if_fail (key, -1); + + keyname = get_account_keyname (name, key); + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + retval = modest_conf_get_int (priv->modest_conf,keyname,err); + + g_free (keyname); + return retval; +} + + +gboolean modest_account_mgr_get_account_bool (ModestAccountMgr *self, const gchar *name, + const gchar *key, GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + gboolean retval; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + g_return_val_if_fail (key, FALSE); + + keyname = get_account_keyname (name, key); + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + retval = modest_conf_get_bool (priv->modest_conf,keyname,err); + + g_free (keyname); + return retval; +} + + + +gboolean +modest_account_mgr_set_account_string (ModestAccountMgr *self, const gchar *name, + const gchar *key, const gchar* val, + GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + gboolean retval; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + g_return_val_if_fail (key, FALSE); + + keyname = get_account_keyname (name, key); + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + retval = modest_conf_set_string (priv->modest_conf,keyname,val,err); + + g_free (keyname); + return retval; +} + + + +gboolean +modest_account_mgr_set_account_int (ModestAccountMgr *self, const gchar *name, + const gchar *key, gint val, GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + gboolean retval; + + g_return_val_if_fail (self, -1); + g_return_val_if_fail (name, -1); + g_return_val_if_fail (key, -1); + + keyname = get_account_keyname (name, key); + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + retval = modest_conf_set_int (priv->modest_conf,keyname,val,err); + + g_free (keyname); + return retval; +} + + + + +gboolean +modest_account_mgr_set_account_bool (ModestAccountMgr *self, const gchar *name, + const gchar *key, gboolean val, GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + gboolean retval; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + g_return_val_if_fail (key, FALSE); + + keyname = get_account_keyname (name, key); + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + retval = modest_conf_set_bool (priv->modest_conf,keyname,val,err); + + g_free (keyname); + return retval; +} + + +gboolean +modest_account_mgr_account_exists (ModestAccountMgr *self, const gchar *name, + GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + gboolean retval; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (name, FALSE); + + keyname = get_account_keyname (name, NULL); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE(self); + retval = modest_conf_key_exists (priv->modest_conf,keyname,err); + + g_free (keyname); + return retval; +} + + + +/* must be freed by caller */ +static gchar* +get_account_keyname (const gchar *accname, const gchar *name) +{ + if (name) + return g_strconcat + (accname, "/", name, NULL); + else + return g_strconcat + (accname, NULL); +} + diff --git a/src/modest-account-mgr.h b/src/modest-account-mgr.h new file mode 100644 index 0000000..f050635 --- /dev/null +++ b/src/modest-account-mgr.h @@ -0,0 +1,289 @@ +/* modest-account-mgr.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_ACCOUNT_MGR_H__ +#define __MODEST_ACCOUNT_MGR_H__ + +#include +#include "modest-conf.h" +#include "modest-account-keys.h" +#include "modest-proto.h" + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_ACCOUNT_MGR (modest_account_mgr_get_type()) +#define MODEST_ACCOUNT_MGR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_ACCOUNT_MGR,ModestAccountMgr)) +#define MODEST_ACCOUNT_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_ACCOUNT_MGR,GObject)) +#define MODEST_IS_ACCOUNT_MGR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_ACCOUNT_MGR)) +#define MODEST_IS_ACCOUNT_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_ACCOUNT_MGR)) +#define MODEST_ACCOUNT_MGR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_ACCOUNT_MGR,ModestAccountMgrClass)) + +typedef struct _ModestAccountMgr ModestAccountMgr; +typedef struct _ModestAccountMgrClass ModestAccountMgrClass; + + + +struct _ModestAccountMgr { + GObject parent; + /* insert public members, if any */ +}; + +struct _ModestAccountMgrClass { + GObjectClass parent_class; + /* insert signal callback declarations, eg. */ + /* void (* my_event) (ModestAccountMgr* obj); */ +}; + + +/** + * modest_ui_get_type: + * + * get the GType for ModestAccountMgr + * + * Returns: the GType + */ +GType modest_account_mgr_get_type (void) G_GNUC_CONST; + + +/** + * modest_account_mgr_new: + * @modest_conf: a ModestConf instance + * + * Returns: a new ModestAccountMgr, or NULL in case of error + */ +GObject* modest_account_mgr_new (ModestConf *modest_conf); + + + +/** + * modest_account_mgr_add_account: + * @self: a ModestAccountMgr instance + * @name: the name of the account to create + * @store: the store account (ie. POP/IMAP) + * @transport: the transport account (ie. sendmail/SMTP) + * @err: a GError ptr, or NULL to ignore. + * + * create a new account. the account with @name should not already exist + * + * Returns: TRUE if the creation succeeded, FALSE otherwise, + * @err gives details in case of error + */ +gboolean modest_account_mgr_add_account (ModestAccountMgr *self, + const gchar* name, + const gchar* store_name, + const gchar* transport_name, + GError **err); +/** + * modest_account_mgr_remove_account: + * @self: a ModestAccountMgr instance + * @name: the name of the account to remove + * @err: a GError ptr, or NULL to ignore. + * + * remove an existing account. the account with @name should already exist + * + * Returns: TRUE if the creation succeeded, FALSE otherwise, + * @err gives details in case of error + */ +gboolean modest_account_mgr_remove_account (ModestAccountMgr *self, const gchar* name, + GError **err); + + + +/** + * modest_account_mgr_add_server_account: + * @self: a ModestAccountMgr instance + * @hostname: the hostname + * @username: the username + * @password: the password + * @proto: the prototype + * @err: a GError ptr, or NULL to ignore. + * + * add a server account to the configuration + * the server account with @name should not already exist + * + * Returns: TRUE if succeeded, FALSE otherwise, + * @err gives details in case of error + */ +gboolean modest_account_mgr_add_server_account (ModestAccountMgr *self, + const gchar *name, + const gchar *hostname, + const gchar *username, + const gchar *password, + const gchar *proto); + +/** + * modest_account_mgr_remove_server_account: + * @self: a ModestAccountMgr instance + * @name: the name for the server account + * @err: a GError ptr, or NULL to ignore. + * + * remove a server account from the configuration + * the server account with @name should exist + * + * Returns: TRUE if the removal succeeded, FALSE otherwise, + * @err gives details in case of error + */ +gboolean modest_account_mgr_remove_server_account (ModestAccountMgr *self, + const gchar *name, + GError **err); + + +/** + * modest_account_mgr_account_names: + * @self: a ModestAccountMgr instance + * @err: a GError ptr, or NULL to ignore. + * + * list all account names + * + * Returns: a newly allocated list of account names, or NULL in case of error or + * if there are no accounts. The caller must free the returned GSList + * @err gives details in case of error + */ +GSList* modest_account_mgr_account_names (ModestAccountMgr *self, GError **err); + + +/** + * modest_account_mgr_server_account_names: + * @self: a ModestAccountMgr instance + * @account_name: get only server accounts for @account_name, or NULL for any + * @type: get only server accounts from protocol type @type, or MODEST_PROTO_TYPE_ANY + * @proto: get only server account with protocol @proto, or NULL for any + * @only_enable: get only enable server account if TRUE + * + * list all the server account names + * + * Returns: a newly allocated list of server account names, or NULL in case of + * error or if there are no server accounts. The caller must free the returned GSList + */ +GSList* modest_account_mgr_server_account_names (ModestAccountMgr *self, + const gchar* account_name, + ModestProtoType type, + const gchar* proto, + gboolean only_enabled); + +/** + * modest_account_mgr_account_exists: + * @self: a ModestAccountMgr instance + * @err: a GError ptr, or NULL to ignore. + * + * check whether account @name exists + * + * Returns: TRUE if the account exists, FALSE otherwise (or in case of error) + * @err gives details in case of error + */ +gboolean modest_account_mgr_account_exists (ModestAccountMgr *self, + const gchar *name, + GError **err); + +/* account specific functions */ + + + +/** + * modest_account_mgr_get_account_string: + * @self: self a ModestAccountMgr instance + * @name: the name of the account + * @key: the key of the value to retrieve + * @err: a GError ptr, or NULL to ignore. + * + * get a config string from some account + * + * Returns: a newly allocated string with the value for the key, + * or NULL in case of error. @err gives details in case of error + */ +gchar* modest_account_mgr_get_account_string (ModestAccountMgr *self, + const gchar *name, + const gchar *key, GError **err); +/** + * modest_account_mgr_get_account_int: + * @self: self a ModestAccountMgr instance + * @name: the name of the account + * @key: the key of the value to retrieve + * @err: a GError ptr, or NULL to ignore. + * + * get a config int from some account + * + * Returns: an integer with the value for the key, or -1 in case of + * error (but of course -1 does not necessarily imply an error) + * @err gives details in case of error + */ +gint modest_account_mgr_get_account_int (ModestAccountMgr *self, + const gchar *name, + const gchar *key, GError **err); + + +/** + * modest_account_mgr_get_account_bool: + * @self: self a ModestAccountMgr instance + * @name: the name of the account + * @key: the key of the value to retrieve + * @err: a GError ptr, or NULL to ignore. + * + * get a config boolean from some account + * + * Returns: an boolean with the value for the key, or FALSE in case of + * error (but of course FALSE does not necessarily imply an error) + * @err gives details in case of error + */ +gboolean modest_account_mgr_get_account_bool (ModestAccountMgr *self, + const gchar *name, + const gchar *key, GError **err); + + +/** + * modest_account_mgr_set_account_string: + * @self: self a ModestAccountMgr instance + * @name: the name of the account + * @key: the key of the value to set + * @val: the value to set + * @err: a GError ptr, or NULL to ignore. + * + * set a config string for some account + * + * Returns: TRUE if setting the value succeeded, or FALSE in case of error. + * @err gives details in case of error + */ +gboolean modest_account_mgr_set_account_string (ModestAccountMgr *self, + const gchar *name, + const gchar *key, const gchar* val, + GError **err); +/** + * modest_account_mgr_set_account_int: + * @self: self a ModestAccountMgr instance + * @name: the name of the account + * @key: the key of the value to set + * @val: the value to set + * @err: a GError ptr, or NULL to ignore. + * + * set a config int for some account + * + * Returns: TRUE if setting the value succeeded, or FALSE in case of error. + * @err gives details in case of error + */ +gboolean modest_account_mgr_set_account_int (ModestAccountMgr *self, + const gchar *name, + const gchar *key, gint val, + GError **err); + +/** + * modest_account_mgr_set_account_bool: + * @self: self a ModestAccountMgr instance + * @name: the name of the account + * @key: the key of the value to set + * @val: the value to set + * @err: a GError ptr, or NULL to ignore. + * + * set a config bool for some account + * + * Returns: TRUE if setting the value succeeded, or FALSE in case of error. + * @err gives details in case of error + */ +gboolean modest_account_mgr_set_account_bool (ModestAccountMgr *self, + const gchar *name, + const gchar *key, gboolean val, + GError **err); +G_END_DECLS + +#endif /* __MODEST_ACCOUNT_MGR_H__ */ + diff --git a/src/modest-conf-gconf.c b/src/modest-conf-gconf.c new file mode 100644 index 0000000..20d4385 --- /dev/null +++ b/src/modest-conf-gconf.c @@ -0,0 +1,316 @@ +/* modest-conf-gconf.c */ +/* GConf implementation of ModestConf */ + +/* insert (c)/licensing information) */ + +#include "modest-conf.h" +#include + + +/* 'private'/'protected' functions */ +static void modest_conf_class_init (ModestConfClass *klass); +static void modest_conf_init (ModestConf *obj); +static void modest_conf_finalize (GObject *obj); + +static void modest_conf_on_change (GConfClient *client, guint conn_id, + GConfEntry *entry, gpointer data); +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + +typedef struct _ModestConfPrivate ModestConfPrivate; +struct _ModestConfPrivate { + GConfClient *gconf_client; +}; +#define MODEST_CONF_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_CONF, \ + ModestConfPrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_conf_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestConfClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_conf_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestConf), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_conf_init, + }; + my_type = g_type_register_static (G_TYPE_OBJECT, + "ModestConf", + &my_info, 0); + } + return my_type; +} + +static void +modest_conf_class_init (ModestConfClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_conf_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestConfPrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + +static void +modest_conf_init (ModestConf *obj) +{ + GConfClient *conf = NULL; + ModestConfPrivate *priv = MODEST_CONF_GET_PRIVATE(obj); + GError *err = NULL; + + priv->gconf_client = NULL; + + conf = gconf_client_get_default (); + if (!conf) { + g_warning ("could not get gconf client"); + return; + } + + /* FIXME: is PRELOAD_NONE the most efficient? */ + gconf_client_add_dir (conf,MODEST_CONF_NAMESPACE, + GCONF_CLIENT_PRELOAD_NONE,&err); + if (err) { + g_warning ("error with gconf_client_add_dir: %d:%s", + err->code, err->message); + g_object_unref (conf); + g_error_free (err); + return; + } + + gconf_client_notify_add (conf, MODEST_CONF_NAMESPACE, + modest_conf_on_change, + obj, NULL, &err); + if (err) { + g_warning ("error with gconf_client_notify_add: %d:%s", + err->code, err->message); + g_object_unref (conf); + g_error_free (err); + return; + } + + /* all went well! */ + priv->gconf_client = conf; + return; +} + +static void +modest_conf_finalize (GObject *obj) +{ + ModestConfPrivate *priv = MODEST_CONF_GET_PRIVATE(obj); + if (priv->gconf_client) { + gconf_client_suggest_sync (priv->gconf_client, NULL); + g_object_unref (priv->gconf_client); + } +} + +GObject* +modest_conf_new (void) +{ + ModestConf *conf = MODEST_CONF(g_object_new(MODEST_TYPE_CONF, NULL)); + if (!conf) { + g_warning ("failed to init ModestConf (GConf)"); + return NULL; + } + + ModestConfPrivate *priv = MODEST_CONF_GET_PRIVATE(conf); + if (!priv->gconf_client) { + g_warning ("failed to init gconf"); + g_object_unref (conf); + return NULL; + } + + return G_OBJECT(conf); +} + + +gchar* +modest_conf_get_string (ModestConf* self, const gchar* key, GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (key, NULL); + + priv = MODEST_CONF_GET_PRIVATE(self); + return gconf_client_get_string (priv->gconf_client, key, err); +} + + +gint +modest_conf_get_int (ModestConf* self, const gchar* key, GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self, -1); + g_return_val_if_fail (key, -1); + + priv = MODEST_CONF_GET_PRIVATE(self); + + return gconf_client_get_int (priv->gconf_client, key, err); +} + + +gboolean +modest_conf_get_bool (ModestConf* self, const gchar* key, GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (key, FALSE); + + priv = MODEST_CONF_GET_PRIVATE(self); + + return gconf_client_get_bool (priv->gconf_client, key, err); +} + + +gboolean +modest_conf_set_string (ModestConf* self, const gchar* key, const gchar* val, + GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self,FALSE); + g_return_val_if_fail (key, FALSE); + + priv = MODEST_CONF_GET_PRIVATE(self); + + if (!gconf_client_key_is_writable(priv->gconf_client,key,err)) { + g_warning ("'%s' is not writable", key); + return FALSE; + } + + return gconf_client_set_string (priv->gconf_client, key, val, err); +} + + +gboolean +modest_conf_set_int (ModestConf* self, const gchar* key, gint val, + GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self,FALSE); + g_return_val_if_fail (key, FALSE); + + priv = MODEST_CONF_GET_PRIVATE(self); + + if (!gconf_client_key_is_writable(priv->gconf_client,key,err)) { + g_warning ("'%s' is not writable", key); + return FALSE; + } + + return gconf_client_set_int (priv->gconf_client, key, val, err); +} + + +gboolean +modest_conf_set_bool (ModestConf* self, const gchar* key, gboolean val, + GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self,FALSE); + g_return_val_if_fail (key, FALSE); + + priv = MODEST_CONF_GET_PRIVATE(self); + + if (!gconf_client_key_is_writable(priv->gconf_client,key, err)) { + g_warning ("'%s' is not writable", key); + return FALSE; + } + + return gconf_client_set_bool (priv->gconf_client,key,val, err); +} + + + + +GSList* +modest_conf_list_subkeys (ModestConf* self, const gchar* key, GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self,FALSE); + g_return_val_if_fail (key, FALSE); + + priv = MODEST_CONF_GET_PRIVATE(self); + + return gconf_client_all_dirs (priv->gconf_client,key,err); +} + + +gboolean +modest_conf_remove_key (ModestConf* self, const gchar* key, GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self,FALSE); + g_return_val_if_fail (key, FALSE); + + priv = MODEST_CONF_GET_PRIVATE(self); + + return gconf_client_recursive_unset (priv->gconf_client,key,0,err); +} + + + + +gboolean +modest_conf_key_exists (ModestConf* self, const gchar* key, GError **err) +{ + ModestConfPrivate *priv; + + g_return_val_if_fail (self,FALSE); + g_return_val_if_fail (key, FALSE); + + priv = MODEST_CONF_GET_PRIVATE(self); + + return gconf_client_dir_exists (priv->gconf_client,key,err); +} + + + + + +static void +modest_conf_on_change (GConfClient *client, guint conn_id, GConfEntry *entry, + gpointer data) +{ + /* FIXME: emit a signal here */ + + if (!entry->value) + g_print ("modest: key '%s' unset\n", + gconf_entry_get_key (entry)); + else { + gchar *val = gconf_value_to_string (gconf_entry_get_value(entry)); + g_print ("modest: key '%s' set to '%s'\n", + gconf_entry_get_key (entry), val); + g_free (val); + } +} diff --git a/src/modest-conf-keys.h b/src/modest-conf-keys.h new file mode 100644 index 0000000..0c71662 --- /dev/null +++ b/src/modest-conf-keys.h @@ -0,0 +1,26 @@ +#ifndef __MODEST_CONF_KEYS_H__ +#define __MODEST_CONF_KEYS_H__ + +/* configuration key definitions for modest */ +#define MODEST_CONF_NAMESPACE "/apps/modest" + +#define MODEST_CONF_USE_EXT_EDITOR MODEST_CONF_NAMESPACE "/use_ext_editor" /* boolean */ +#define MODEST_CONF_EXT_EDITOR MODEST_CONF_NAMESPACE "/ext_editor" /* string */ + +#define MODEST_CONF_MAIN_WINDOW_HEIGHT MODEST_CONF_NAMESPACE "/main_window_height" /* int */ +#define MODEST_CONF_MAIN_WINDOW_HEIGHT_DEFAULT 800 /* int */ + +#define MODEST_CONF_MAIN_WINDOW_WIDTH MODEST_CONF_NAMESPACE "/main_window_width" /* int */ +#define MODEST_CONF_MAIN_WINDOW_WIDTH_DEFAULT 480 + +#define MODEST_CONF_EDIT_WINDOW_HEIGHT MODEST_CONF_NAMESPACE "/edit_window_height" /* int */ +#define MODEST_CONF_EDIT_WINDOW_HEIGHT_DEFAULT 800 /* int */ + +#define MODEST_CONF_EDIT_WINDOW_WIDTH MODEST_CONF_NAMESPACE "/edit_window_width" /* int */ +#define MODEST_CONF_EDIT_WINDOW_WIDTH_DEFAULT 480 + + + + + +#endif /*__MODEST_CONF_KEYS_H__*/ diff --git a/src/modest-conf.h b/src/modest-conf.h new file mode 100644 index 0000000..16cf275 --- /dev/null +++ b/src/modest-conf.h @@ -0,0 +1,193 @@ +/* + * modest-conf.h + */ + +#ifndef __MODEST_CONF_H__ +#define __MODEST_CONF_H__ + +#include +#include "modest-conf-keys.h" + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_CONF (modest_conf_get_type()) +#define MODEST_CONF(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_CONF,ModestConf)) +#define MODEST_CONF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_CONF,GObject)) +#define MODEST_IS_CONF(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_CONF)) +#define MODEST_IS_CONF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_CONF)) +#define MODEST_CONF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_CONF,ModestConfClass)) + +typedef struct _ModestConf ModestConf; +typedef struct _ModestConfClass ModestConfClass; + +struct _ModestConf { + GObject parent; +}; + +struct _ModestConfClass { + GObjectClass parent_class; + /* insert signal callback declarations, eg. */ + /* void (* my_event) (ModestConf* obj); */ +}; + + +/** + * modest_conf_get_type: + * + * get the GType for ModestConf + * + * Returns: the GType + */ +GType modest_conf_get_type (void) G_GNUC_CONST; + + +/** + * modest_conf_new: + * + * create a new modest ModestConf object. + * + * Returns: a new ModestConf instance, or NULL in case + * of any error + */ +GObject* modest_conf_new (void); + + +/** + * modest_conf_get_string: + * @self: self a ModestConf instance + * @key: the key of the value to retrieve + * @err: a GError ptr, or NULL to ignore. + * + * get a string from the configuration system + * + * Returns: a newly allocated string with the value for the key, + * or NULL in case of error. @err gives details in case of error + */ +gchar* modest_conf_get_string (ModestConf* self, const gchar* key, GError **err); + + +/** + * modest_conf_get_int: + * @self: self a ModestConf instance + * @key: the key of the value to retrieve + * @err: a GError ptr, or NULL to ignore. + * + * get an integer from the configuration system + * + * Returns: an integer with the value for the key, or -1 in case of error + * (of course, -1 can also be returned in non-error cases). + * @err gives details in case of error + */ +int modest_conf_get_int (ModestConf* self, const gchar* key, GError **err); + + +/** + * modest_conf_get_bool: + * @self: self a ModestConf instance + * @key: the key of the value to retrieve + * @err: a GError ptr, or NULL to ignore. + * + * get a boolean value from the configuration system + * + * Returns: a boolean value with the value for the key, or -1 in case of error + * (of course, -1 can also be returned in non-error cases). + * @err gives details in case of error + */ +gboolean modest_conf_get_bool (ModestConf* self, const gchar* key, GError **err); + + +/** + * modest_conf_set_string: + * @self: a ModestConf instance + * @key: the key of the value to set + * @val: the value to set + * @err: a GError ptr, or NULL if not interested. + * + * store a string value in the configuration system + * + * Returns: TRUE if succeeded or FALSE in case of error. + * @err gives details in case of error + */ +gboolean modest_conf_set_string (ModestConf* self, const gchar* key, const gchar *val, + GError **err); + +/** + * modest_conf_set_int: + * @self: a ModestConf instance + * @key: the key of the value to set + * @val: the value to set + * @err: a GError ptr, or NULL if not interested. + * + * store an integer value in the configuration system + * + * Returns: TRUE if succeeded or FALSE in case of error. + * @err gives details in case of error + */ +gboolean modest_conf_set_int (ModestConf* self, const gchar* key, int val, + GError **err); + +/** + * modest_conf_set_bool: + * @self: a ModestConf instance + * @key: the key of the value to set + * @val: the value to set + * @err: a GError ptr, or NULL if not interested. + * + * store a boolean value in the configuration system + * + * Returns: TRUE if succeeded or FALSE in case of error. + * @err gives details in case of error + */ +gboolean modest_conf_set_bool (ModestConf* self, const gchar* key, gboolean val, + GError **err); + + +/** + * modest_conf_list_subkeys: + * @self: a ModestConf instance + * @key: the key whose subkeys will be listed + * @err: a GError ptr, or NULL if not interested. + * + * list all the subkeys for a given key + * + * Returns: a newly allocated list or NULL in case of error + * the returned GSList must be freed by the caller + * @err gives details in case of error + */ +GSList* modest_conf_list_subkeys (ModestConf* self, const gchar* key, + GError **err); + + +/** + * modest_conf_remove_key: + * @self: a ModestConf instance + * @key: the key to remove + * @err: a GError ptr, or NULL if not interested. + * + * attempts to remove @key and all its subkeys + * + * Returns: TRUE if succeeded or FALSE in case of error. + * @err gives details in case of error + */ +gboolean modest_conf_remove_key (ModestConf* self, const gchar* key, GError **err); + + +/** + * modest_conf_key_exists: + * @self: a ModestConf instance + * @key: the key to remove + * @err: a GError ptr, or NULL if not interested. + * + * checks if the given key exists in the configuration system + * + * Returns: TRUE if exists, FALSE otherwise. + * @err gives details in case of error + */ +gboolean modest_conf_key_exists (ModestConf* self, const gchar* key, GError **err); + + +G_END_DECLS + +#endif /* __MODEST_CONF_H__ */ + diff --git a/src/modest-main.c b/src/modest-main.c new file mode 100644 index 0000000..d1cb46e --- /dev/null +++ b/src/modest-main.c @@ -0,0 +1,171 @@ +/* modest-main.c -- part of modest */ +#include + +#include "modest-conf.h" +#include "modest-account-mgr.h" +#include "modest-ui.h" + +#ifdef HAVE_CONFIG_H +#include +#endif /*HAVE_CONFIG_H*/ +#include + +static void install_basic_conf_settings (ModestConf *conf); +static void install_test_account (ModestConf *conf); + + +int +main (int argc, char *argv[]) +{ + GOptionContext *context = NULL; + ModestConf *modest_conf = NULL; + ModestUI *modest_ui = NULL; + + GError *err = NULL; + int retval = 0; + + static gboolean update, debug, reinstall; + static gchar *mailto, *subject, *bcc, *cc, *body; + + static GOptionEntry options[] = { + { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, + "Run in debug mode" }, + { "update", 'u', 0, G_OPTION_ARG_NONE, &update, + "Send/receive all accounts and exit"}, + { "mailto", 'm', 0, G_OPTION_ARG_STRING, &mailto, + "Start writing a new email to "}, + { "subject", 's', 0, G_OPTION_ARG_STRING, &subject, + "Subject for a new mail"}, + { "body", 'b', 0, G_OPTION_ARG_STRING, &body, + "Body for a new email"}, + { "cc", 0, 0, G_OPTION_ARG_STRING, &cc, + "CC-addresses for a new mail (comma-separated)"}, + { "bcc", 0, 0, G_OPTION_ARG_STRING, &bcc, + "BCC-adresses for a new mail (comma-separated)"}, + { "reinstall-factory-settings", 0, 0, G_OPTION_ARG_NONE, &reinstall, + "Delete all settings and start over (*DESTRUCTIVE*)" + }, + { NULL } + }; + + g_type_init (); + + context = g_option_context_new (NULL); + g_option_context_add_main_entries (context, options, NULL); + + if (!g_option_context_parse (context, &argc, &argv, &err)) { + g_printerr ("modest: error in command line parameter(s): %s\n", + err ? err->message : ""); + retval = 1; + goto cleanup; + } + + modest_conf = MODEST_CONF(modest_conf_new()); + if (!modest_conf) { + g_warning ("failed to initialize config system"); + goto cleanup; + } + + if (reinstall) { + modest_conf_remove_key (modest_conf, MODEST_CONF_NAMESPACE, NULL); + install_basic_conf_settings (modest_conf); + install_test_account (modest_conf); + goto cleanup; + } + + gtk_init (&argc, &argv); + modest_ui = MODEST_UI(modest_ui_new (modest_conf)); + if (!modest_ui) { + g_warning ("failed to initialize ui"); + goto cleanup; + } + + { + gboolean ok; + gtk_init (&argc, &argv); + + if (mailto||cc||bcc||subject||body) + ok = modest_ui_show_edit_window (modest_ui, + mailto, /* to */ + cc, /* cc */ + bcc, /* bcc */ + subject, /* subject */ + body, /* body */ + NULL); /* attachments */ + else + ok = modest_ui_show_main_window (modest_ui); + + if (!ok) + g_warning ("showing window failed"); + else + gtk_main(); + } + + +cleanup: + if (err) + g_error_free (err); + + if (context) + g_option_context_free (context); + + if (modest_ui) + g_object_unref (modest_ui); + + if (modest_conf) + g_object_unref (modest_conf); + + return retval; +} + + + +static void +install_basic_conf_settings (ModestConf *conf) +{ + g_return_if_fail (conf); + + /* main window size */ + modest_conf_set_int (conf, MODEST_CONF_MAIN_WINDOW_WIDTH, + MODEST_CONF_MAIN_WINDOW_WIDTH_DEFAULT, NULL); + modest_conf_set_int (conf, MODEST_CONF_MAIN_WINDOW_HEIGHT, + MODEST_CONF_MAIN_WINDOW_HEIGHT_DEFAULT, NULL); + + /* edit window size */ + modest_conf_set_int (conf, MODEST_CONF_EDIT_WINDOW_WIDTH, + MODEST_CONF_EDIT_WINDOW_WIDTH_DEFAULT, NULL); + modest_conf_set_int (conf, MODEST_CONF_EDIT_WINDOW_HEIGHT, + MODEST_CONF_EDIT_WINDOW_HEIGHT_DEFAULT, NULL); + + g_print ("modest: returned to factory settings\n"); +} + + +static void +install_test_account (ModestConf *conf) +{ + ModestAccountMgr *acc_mgr; + const gchar *acc_name = "test"; + g_return_if_fail (conf); + + acc_mgr = MODEST_ACCOUNT_MGR(modest_account_mgr_new (conf)); + if (!acc_mgr) { + g_warning ("failed to instantiate account mgr"); + return; + } + + if (modest_account_mgr_account_exists (acc_mgr, acc_name, NULL)) { + if (!modest_account_mgr_remove_account(acc_mgr, acc_name, NULL)) { + g_warning ("could not delete existing account"); + } + } + + if (!modest_account_mgr_add_account (acc_mgr, acc_name, "mystore", "mytransport", NULL)) + g_warning ("failed to add test account"); + + modest_account_mgr_add_server_account (acc_mgr, "mystore", "localhost", "djcb", + NULL, "pop"); + modest_account_mgr_add_server_account (acc_mgr, "mytransport", "localhost", NULL, + NULL, "smtp"); + g_object_unref (G_OBJECT(acc_mgr)); +} diff --git a/src/modest-proto.c b/src/modest-proto.c new file mode 100644 index 0000000..d0d7702 --- /dev/null +++ b/src/modest-proto.c @@ -0,0 +1,46 @@ +#include +#include "modest-proto.h" + + +gboolean +modest_proto_is_valid (const gchar *proto) +{ + int i; + static const gchar* protos[] = { + MODEST_PROTO_SENDMAIL, + MODEST_PROTO_SMTP, + MODEST_PROTO_POP, + MODEST_PROTO_IMAP, + NULL + }; + + if (!proto) + return FALSE; + + for (i = 0; protos[i]; ++i) { + if (strcmp(protos[i], proto) == 0) + return TRUE; + } + + return FALSE; +} + + + +ModestProtoType +modest_proto_type (const gchar *proto) +{ + if (!modest_proto_is_valid(proto)) { + g_warning ("invalid protocol %s", proto); + return -1; + } + + /* trick */ + if (proto[0] == 's') + return MODEST_PROTO_TYPE_TRANSPORT; + else + return MODEST_PROTO_TYPE_STORE; +} + + + diff --git a/src/modest-proto.h b/src/modest-proto.h new file mode 100644 index 0000000..70cc8b5 --- /dev/null +++ b/src/modest-proto.h @@ -0,0 +1,24 @@ +/* modest-proto.h */ + +#ifndef __MODEST_PROTO_H__ +#define __MODEST_PROTO_H__ + +#include + +#define MODEST_PROTO_SENDMAIL "sendmail" +#define MODEST_PROTO_SMTP "smtp" +#define MODEST_PROTO_POP "pop" +#define MODEST_PROTO_IMAP "imap" + +enum { + MODEST_PROTO_TYPE_ANY = 0, + MODEST_PROTO_TYPE_TRANSPORT = 1, + MODEST_PROTO_TYPE_STORE = 2, +}; +typedef gint ModestProtoType; + +gboolean modest_proto_is_valid (const gchar *proto); +ModestProtoType modest_proto_type (const gchar *proto); + +#endif /*__MODEST_SERVER_PROTO_H__*/ + diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c new file mode 100644 index 0000000..7a55bee --- /dev/null +++ b/src/modest-tny-account-store.c @@ -0,0 +1,392 @@ +/* modest-tny-account-store.c */ + +/* insert (c)/licensing information) */ + +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "modest-account-mgr.h" +#include "modest-tny-account-store.h" + +/* 'private'/'protected' functions */ +static void modest_tny_account_store_class_init (ModestTnyAccountStoreClass *klass); +static void modest_tny_account_store_init (ModestTnyAccountStore *obj); +static void modest_tny_account_store_finalize (GObject *obj); + +/* implementations for tny-account-store-iface */ +static void modest_tny_account_store_iface_init (gpointer g_iface, gpointer iface_data); + +static void modest_tny_account_store_add_store_account (TnyAccountStoreIface *self, + TnyStoreAccountIface *account); +static void modest_tny_account_store_add_transport_account (TnyAccountStoreIface *self, + TnyTransportAccountIface *account); +static const GList* modest_tny_account_store_get_store_accounts (TnyAccountStoreIface *iface); +static const GList* modest_tny_account_store_get_transport_accounts (TnyAccountStoreIface *iface); + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + +typedef struct _ModestTnyAccountStorePrivate ModestTnyAccountStorePrivate; +struct _ModestTnyAccountStorePrivate { + ModestAccountMgr *modest_acc_mgr; +}; +#define MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_TNY_ACCOUNT_STORE, \ + ModestTnyAccountStorePrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_tny_account_store_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestTnyAccountStoreClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_tny_account_store_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestTnyAccountStore), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_tny_account_store_init, + }; + + static const GInterfaceInfo iface_info = { + (GInterfaceInitFunc) modest_tny_account_store_iface_init, + NULL, /* interface_finalize */ + NULL /* interface_data */ + }; + + my_type = g_type_register_static (G_TYPE_OBJECT, + "ModestTnyAccountStore", &my_info, 0); + + g_type_add_interface_static (my_type, TNY_TYPE_ACCOUNT_STORE_IFACE, + &iface_info); + + } + return my_type; +} + +static void +modest_tny_account_store_class_init (ModestTnyAccountStoreClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_tny_account_store_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestTnyAccountStorePrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + +static void +modest_tny_account_store_init (ModestTnyAccountStore *obj) +{ + ModestTnyAccountStorePrivate *priv = + MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(obj); + + priv->modest_acc_mgr = NULL; +} + +static void +modest_tny_account_store_finalize (GObject *obj) +{ + ModestTnyAccountStore *self = MODEST_TNY_ACCOUNT_STORE(obj); + ModestTnyAccountStorePrivate *priv = + MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self); + + if (priv->modest_acc_mgr) { + g_object_unref (G_OBJECT(priv->modest_acc_mgr)); + priv->modest_acc_mgr = NULL; + } +} + +GObject* +modest_tny_account_store_new (ModestAccountMgr *modest_acc_mgr) +{ + GObject *obj; + ModestTnyAccountStorePrivate *priv; + + g_return_val_if_fail (modest_acc_mgr, NULL); + + obj = G_OBJECT(g_object_new(MODEST_TYPE_TNY_ACCOUNT_STORE, NULL)); + + priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(obj); + g_object_ref(G_OBJECT(priv->modest_acc_mgr = modest_acc_mgr)); + + return obj; +} + + + +/* FIXME: tinymail needs to change here */ +/* a gpointer arg to get_password should be enough */ +static gchar* +get_password (TnyAccountIface *account, const gchar *prompt) +{ + g_warning ("%s: %s", __FUNCTION__, prompt); + return g_strdup("djcb123"); +} + + +static void +forget_password (TnyAccountIface *account) +{ + g_warning (__FUNCTION__); +} + + + +static gboolean +add_account (TnyAccountStoreIface *self, TnyAccountIface *account) +{ + TnyAccountIface *account_iface; + ModestTnyAccountStore *account_store; + ModestTnyAccountStorePrivate *priv; + + const gchar* account_name; + const gchar *hostname, *username, *proto; + + g_warning (__FUNCTION__); + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (account, FALSE); + + account_iface = TNY_ACCOUNT_IFACE(account); + account_store = MODEST_TNY_ACCOUNT_STORE(self); + priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self); + + account_name = tny_account_iface_get_id(account_iface); + if (!account_name) { + g_warning ("failed to retrieve account name"); + return FALSE; + } + + hostname = tny_account_iface_get_hostname(account_iface); + username = tny_account_iface_get_user(account_iface); + proto = tny_account_iface_get_proto(account_iface); + + return modest_account_mgr_add_server_account (priv->modest_acc_mgr, + account_name, + hostname, username, NULL, + proto); +} + + + +static void +modest_tny_account_store_add_store_account (TnyAccountStoreIface *self, + TnyStoreAccountIface *account) +{ + if (!add_account (self, TNY_ACCOUNT_IFACE(account))) + g_warning ("failed to add store account"); +} + + + +static void +modest_tny_account_store_add_transport_account (TnyAccountStoreIface *self, + TnyTransportAccountIface *account) +{ + if (!add_account (self, TNY_ACCOUNT_IFACE(account))) + g_warning ("failed to add transport account"); +} + + + + +static TnyAccountIface* +tny_account_from_key (ModestTnyAccountStore *self, const gchar *key, + gboolean is_store) +{ + TnyAccountIface *tny_account; + ModestTnyAccountStorePrivate *priv; + gchar *val; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (key, NULL); + + priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self); + + /* is it a store or a transport? */ + if (is_store) + tny_account = TNY_ACCOUNT_IFACE(tny_store_account_new ()); + else + tny_account = TNY_ACCOUNT_IFACE(tny_transport_account_new ()); + + tny_account_iface_set_account_store (tny_account, + TNY_ACCOUNT_STORE_IFACE(self)); + /* id */ + tny_account_iface_set_id (tny_account, key); + + /* hostname */ + val = modest_account_mgr_get_account_string (priv->modest_acc_mgr, key, + MODEST_ACCOUNT_HOSTNAME, NULL); + g_warning (val); + tny_account_iface_set_hostname (tny_account, val); + g_free (val); + + /* username */ + val = modest_account_mgr_get_account_string (priv->modest_acc_mgr, key, + MODEST_ACCOUNT_USERNAME, NULL); + g_warning (val); + tny_account_iface_set_user (tny_account, val); + g_free (val); + + /* proto */ + val = modest_account_mgr_get_account_string (priv->modest_acc_mgr, key, + MODEST_ACCOUNT_PROTO, NULL); + g_warning (val); + tny_account_iface_set_proto (tny_account, val); + g_free (val); + + g_warning ("set_pass"); + tny_account_iface_set_pass_func (tny_account, get_password); + tny_account_iface_set_forget_pass_func (tny_account, forget_password); + + return tny_account; +} + + +static GList* +tny_accounts_from_server_accounts (ModestTnyAccountStore *self, GSList *accounts, + gboolean is_store) +{ + GSList *cursor = accounts; + GList *tny_accounts = NULL; + + g_return_val_if_fail (self, NULL); + + while (cursor) { + TnyAccountIface *tny_account; + tny_account = tny_account_from_key (self, (gchar*)cursor->data, is_store); + if (!tny_account) { + g_warning ("could not create tnyaccount for %s", + (gchar*)cursor->data); + } else { + g_warning ("added %s",(gchar*)cursor->data); + tny_accounts = + g_list_append (tny_accounts, tny_account); + } + cursor = cursor->next; + } + + return tny_accounts; +} + + + + +static const GList* +modest_tny_account_store_get_store_accounts (TnyAccountStoreIface *iface) +{ + ModestTnyAccountStore *self; + ModestTnyAccountStorePrivate *priv; + GSList *accounts, *cursor; + GList *tny_accounts; + + g_return_val_if_fail (iface, NULL); + + g_warning ("i'm being called: %s", __FUNCTION__); + + self = MODEST_TNY_ACCOUNT_STORE(iface); + priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self); + + accounts = + modest_account_mgr_server_account_names (priv->modest_acc_mgr, + NULL, + MODEST_PROTO_TYPE_STORE, + NULL, FALSE); + + g_warning ("accounts: %d", g_slist_length (accounts)); + tny_accounts = tny_accounts_from_server_accounts (self, accounts, TRUE); + g_slist_free (accounts); + g_warning ("store accounts: %d", g_list_length (tny_accounts)); + + return tny_accounts; /* FIXME: who will free this? */ +} + + + +static const GList* +modest_tny_account_store_get_transport_accounts (TnyAccountStoreIface *iface) +{ + ModestTnyAccountStore *self; + ModestTnyAccountStorePrivate *priv; + GSList *accounts, *cursor; + GList *tny_accounts; + + g_return_val_if_fail (iface, NULL); + + self = MODEST_TNY_ACCOUNT_STORE(iface); + priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self); + + accounts = + modest_account_mgr_server_account_names (priv->modest_acc_mgr, + NULL, + MODEST_PROTO_TYPE_TRANSPORT, + NULL, FALSE); + tny_accounts = tny_accounts_from_server_accounts (self, accounts, FALSE); + g_warning ("transport accounts: %d", g_list_length (tny_accounts)); + + g_slist_free (accounts); + + return tny_accounts; /* FIXME: who will free this? */ +} + + +static const gchar* +modest_tny_account_store_get_cache_dir (TnyAccountStoreIface *self) +{ + return g_strdup("/home/djcb/.modest/cache/"); /* FIXME */ +} + + + +static void +modest_tny_account_store_iface_init (gpointer g_iface, gpointer iface_data) +{ + TnyAccountStoreIfaceClass *klass; + + g_return_if_fail (g_iface); + + klass = (TnyAccountStoreIfaceClass *)g_iface; + + klass->add_store_account_func = + modest_tny_account_store_add_store_account; + klass->get_store_accounts_func = + modest_tny_account_store_get_store_accounts; + klass->add_transport_account_func = + modest_tny_account_store_add_transport_account; + klass->get_transport_accounts_func = + modest_tny_account_store_get_transport_accounts; + klass->get_cache_dir_func = + modest_tny_account_store_get_cache_dir; +} + diff --git a/src/modest-tny-account-store.h b/src/modest-tny-account-store.h new file mode 100644 index 0000000..e8f96a6 --- /dev/null +++ b/src/modest-tny-account-store.h @@ -0,0 +1,50 @@ +/* modest-tny-account-store.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_TNY_ACCOUNT_STORE_H__ +#define __MODEST_TNY_ACCOUNT_STORE_H__ + +#include +/* other include files */ + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_TNY_ACCOUNT_STORE (modest_tny_account_store_get_type()) +#define MODEST_TNY_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_ACCOUNT_STORE,ModestTnyAccountStore)) +#define MODEST_TNY_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_ACCOUNT_STORE,GObject)) +#define MODEST_IS_TNY_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_ACCOUNT_STORE)) +#define MODEST_IS_TNY_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_ACCOUNT_STORE)) +#define MODEST_TNY_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_ACCOUNT_STORE,ModestTnyAccountStoreClass)) + +typedef struct _ModestTnyAccountStore ModestTnyAccountStore; +typedef struct _ModestTnyAccountStoreClass ModestTnyAccountStoreClass; + +struct _ModestTnyAccountStore { + GObject parent; + /* insert public members, if any */ +}; + +struct _ModestTnyAccountStoreClass { + GObjectClass parent_class; + /* insert signal callback declarations, eg. */ + /* void (* my_event) (ModestTnyAccountStore* obj); */ +}; + +/* member functions */ +GType modest_tny_account_store_get_type (void) G_GNUC_CONST; + +/* typical parameter-less _new function */ +/* if this is a kind of GtkWidget, it should probably return at GtkWidget*, */ +/* otherwise probably a GObject*. */ +GObject* modest_tny_account_store_new (ModestAccountMgr *modest_acc_mgr); + +/* fill in other public functions, eg.: */ +/* void modest_tny_account_store_do_something (ModestTnyAccountStore *self, const gchar* param); */ +/* gboolean modest_tny_account_store_has_foo (ModestTnyAccountStore *self, gint value); */ + + +G_END_DECLS + +#endif /* __MODEST_TNY_ACCOUNT_STORE_H__ */ + diff --git a/src/modest-tny-folder-tree-view.c b/src/modest-tny-folder-tree-view.c new file mode 100644 index 0000000..0929059 --- /dev/null +++ b/src/modest-tny-folder-tree-view.c @@ -0,0 +1,298 @@ +/* modest-tny-folder-tree-view.c */ + +/* insert (c)/licensing information) */ +#include + +#include +#include +#include +#include + +#include "modest-tny-folder-tree-view.h" +/* include other impl specific header files */ + +/* 'private'/'protected' functions */ +static void modest_tny_folder_tree_view_class_init (ModestTnyFolderTreeViewClass *klass); +static void modest_tny_folder_tree_view_init (ModestTnyFolderTreeView *obj); +static void modest_tny_folder_tree_view_finalize (GObject *obj); + +static void modest_tny_folder_tree_view_iface_init (gpointer iface, gpointer data); +static void modest_tny_folder_tree_view_set_account_store (TnySummaryWindowIface *self, + TnyAccountStoreIface *account_store); +static gboolean update_model (ModestTnyFolderTreeView *self,TnyAccountStoreIface *iface); +static gboolean update_model_empty (ModestTnyFolderTreeView *self); + +static void selection_changed (GtkTreeSelection *sel, gpointer data); + +/* list my signals */ +enum { + FOLDER_SELECTED_SIGNAL, + LAST_SIGNAL +}; + +typedef struct _ModestTnyFolderTreeViewPrivate ModestTnyFolderTreeViewPrivate; +struct _ModestTnyFolderTreeViewPrivate { + TnyAccountStoreIface *tny_account_store; + gboolean view_is_empty; + +}; +#define MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_TNY_FOLDER_TREE_VIEW, \ + ModestTnyFolderTreeViewPrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +static guint signals[LAST_SIGNAL] = {0}; + +GType +modest_tny_folder_tree_view_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestTnyFolderTreeViewClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_tny_folder_tree_view_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestTnyFolderTreeView), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_tny_folder_tree_view_init, + }; + + static const GInterfaceInfo iface_info = { + (GInterfaceInitFunc) modest_tny_folder_tree_view_iface_init, + NULL, /* finalize */ + NULL /* data */ + }; + + my_type = g_type_register_static (GTK_TYPE_TREE_VIEW, + "ModestTnyFolderTreeView", + &my_info, 0); + g_type_add_interface_static (my_type, TNY_TYPE_SUMMARY_WINDOW_IFACE, + &iface_info); + + } + return my_type; +} + +static void +modest_tny_folder_tree_view_class_init (ModestTnyFolderTreeViewClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_tny_folder_tree_view_finalize; + + g_type_class_add_private (gobject_class, + sizeof(ModestTnyFolderTreeViewPrivate)); + + signals[FOLDER_SELECTED_SIGNAL] = + g_signal_new ("folder_selected", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ModestTnyFolderTreeViewClass,folder_selected), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); +} + +static void +modest_tny_folder_tree_view_init (ModestTnyFolderTreeView *obj) +{ + ModestTnyFolderTreeViewPrivate *priv; + priv = MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(obj); + + priv->view_is_empty = TRUE; + priv->tny_account_store = NULL; +} + + +static void +modest_tny_folder_tree_view_iface_init (gpointer iface, gpointer data) +{ + TnySummaryWindowIfaceClass *klass; + + g_return_if_fail (iface); + + klass = (TnySummaryWindowIfaceClass*) iface; + + klass->set_account_store_func = + modest_tny_folder_tree_view_set_account_store; +} + + + + +static void +modest_tny_folder_tree_view_finalize (GObject *obj) +{ + ModestTnyFolderTreeViewPrivate *priv; + + g_return_if_fail (obj); + + priv = MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(obj); + if (priv->tny_account_store) { + g_object_unref (G_OBJECT(priv->tny_account_store)); + priv->tny_account_store = NULL; + } + + (*parent_class->finalize)(obj); +} + + +static void +modest_tny_folder_tree_view_set_account_store (TnySummaryWindowIface *self, + TnyAccountStoreIface *account_store) +{ + ModestTnyFolderTreeViewPrivate *priv; + + g_return_if_fail (self); + g_return_if_fail (account_store); + + priv = MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(self); + if (priv->tny_account_store) { + g_object_unref (priv->tny_account_store); + priv->tny_account_store = NULL; + } + + g_object_ref (G_OBJECT(priv->tny_account_store = account_store)); +} + + + +GtkWidget* +modest_tny_folder_tree_view_new (TnyAccountStoreIface *iface) +{ + GObject *self; + ModestTnyFolderTreeViewPrivate *priv; + GtkTreeSelection *sel; + + self = G_OBJECT(g_object_new(MODEST_TYPE_TNY_FOLDER_TREE_VIEW, NULL)); + priv = MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(self); + + g_return_val_if_fail (iface, NULL); + + if (!update_model (MODEST_TNY_FOLDER_TREE_VIEW(self), iface)) + g_warning ("failed or update model"); + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(self)); + g_signal_connect (sel, "changed", + G_CALLBACK(selection_changed), self); + + return GTK_WIDGET(self); +} + + + + +static gboolean +update_model_empty (ModestTnyFolderTreeView *self) +{ + GtkTreeIter iter; + GtkTreeStore *store; + ModestTnyFolderTreeViewPrivate *priv; + + g_return_val_if_fail (self, FALSE); + + store = gtk_tree_store_new (1, G_TYPE_STRING); + gtk_tree_store_append (store, &iter, NULL); + + gtk_tree_store_set (store, &iter, 0, + _("(empty)"), -1); + + gtk_tree_view_set_model (GTK_TREE_VIEW(self), + GTK_TREE_MODEL(store)); + g_object_unref (store); + + priv = MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(self); + priv->view_is_empty = TRUE; + + return TRUE; +} + + +static gboolean +update_model (ModestTnyFolderTreeView *self,TnyAccountStoreIface *iface) +{ + const GList *accounts; + TnyAccountTreeModel *folder_model; + ModestTnyFolderTreeViewPrivate *priv; + + g_return_val_if_fail (iface, FALSE); + + priv = MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(self); + priv->view_is_empty = TRUE; + + accounts = tny_account_store_iface_get_store_accounts (iface); + if (!accounts) { + g_warning ("no accounts have been defined yet"); + return update_model_empty (self); + } + + folder_model = tny_account_tree_model_new (); + if (!folder_model) { + g_warning ("failed to get account tree model"); + return update_model_empty (self); + } + + while (accounts) { + TnyStoreAccountIface *account = + TNY_STORE_ACCOUNT_IFACE(accounts->data); + if (!account) { + g_warning ("invalid account"); + g_object_unref (folder_model); + return update_model_empty (self); + } + tny_account_tree_model_add (TNY_ACCOUNT_TREE_MODEL (folder_model), + account); + accounts = accounts->next; + } + + gtk_tree_view_set_model (GTK_TREE_VIEW(self), + GTK_TREE_MODEL(folder_model)); + g_object_unref (G_OBJECT(folder_model)); + + priv->view_is_empty = FALSE; /* were not empty anymore! */ + return TRUE; +} + + +void +selection_changed (GtkTreeSelection *sel, gpointer user_data) +{ + GtkTreeModel *model; + TnyMsgFolderIface *folder; + GtkTreeIter iter; + ModestTnyFolderTreeView *tree_view; + ModestTnyFolderTreeViewPrivate *priv; + + g_warning ("selection changed"); + + g_return_if_fail (sel); + g_return_if_fail (user_data); + + priv = MODEST_TNY_FOLDER_TREE_VIEW_GET_PRIVATE(user_data); + + /* is_empty means that there is only the 'empty' item */ + if (priv->view_is_empty) + return; + + if (!gtk_tree_selection_get_selected (sel, &model, &iter)) + return; /* folder was _un_selected */ + + tree_view = MODEST_TNY_FOLDER_TREE_VIEW (user_data); + + gtk_tree_model_get (model, &iter, + TNY_ACCOUNT_TREE_MODEL_INSTANCE_COLUMN, + &folder, -1); + + g_signal_emit (G_OBJECT(tree_view), signals[FOLDER_SELECTED_SIGNAL], 0, + folder); +} + + + + diff --git a/src/modest-tny-folder-tree-view.h b/src/modest-tny-folder-tree-view.h new file mode 100644 index 0000000..5b27bb0 --- /dev/null +++ b/src/modest-tny-folder-tree-view.h @@ -0,0 +1,76 @@ +/* modest-tny-folder-tree-view.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_TNY_FOLDER_TREE_VIEW_H__ +#define __MODEST_TNY_FOLDER_TREE_VIEW_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_TNY_FOLDER_TREE_VIEW (modest_tny_folder_tree_view_get_type()) +#define MODEST_TNY_FOLDER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_FOLDER_TREE_VIEW,ModestTnyFolderTreeView)) +#define MODEST_TNY_FOLDER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_FOLDER_TREE_VIEW,GObject)) +#define MODEST_IS_TNY_FOLDER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_FOLDER_TREE_VIEW)) +#define MODEST_IS_TNY_FOLDER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_FOLDER_TREE_VIEW)) +#define MODEST_TNY_FOLDER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_FOLDER_TREE_VIEW,ModestTnyFolderTreeViewClass)) + +typedef struct _ModestTnyFolderTreeView ModestTnyFolderTreeView; +typedef struct _ModestTnyFolderTreeViewClass ModestTnyFolderTreeViewClass; + +struct _ModestTnyFolderTreeView { + GtkTreeView parent; + /* insert public members, if any */ +}; + +struct _ModestTnyFolderTreeViewClass { + GtkTreeViewClass parent_class; + + /* emitted when a folder is clicked */ + void (*folder_selected) (ModestTnyFolderTreeView* self, + TnyMsgFolderIface *folder, + gpointer user_data); +}; + + +/** + * modest_tny_folder_tree_view_get_type: + * + * get the GType for ModestTnyFolderTreeView + * + * Returns: the GType + */ +GType modest_tny_folder_tree_view_get_type (void) G_GNUC_CONST; + + +/** + * modest_tny_folder_tree_view_new: + * @iface: a TnyAccountStoreIface object + * + * create a new ModestTnyFolderTreeView instance, based on an account store + * + * Returns: a new GtkWidget (a GtkTreeView-subclass) + */ + +GtkWidget* modest_tny_folder_tree_view_new (TnyAccountStoreIface *iface); + + +/** + * modest_tny_folder_tree_view_is_empty: + * @self: a ModestTnyFolderTreeView instance + * + * check to see of the view is empty. Note that when it is empty, + * there will still be one item, telling "(empty)" or similar + * + * Returns: TRUE if the tree view is empty, FALSE otherwise + */ +gboolean modest_tny_folder_tree_view_is_empty (ModestTnyFolderTreeView *self); + + +G_END_DECLS + +#endif /* __MODEST_TNY_FOLDER_TREE_VIEW_H__ */ + diff --git a/src/modest-tny-header-tree-view.c b/src/modest-tny-header-tree-view.c new file mode 100644 index 0000000..8e85986 --- /dev/null +++ b/src/modest-tny-header-tree-view.c @@ -0,0 +1,209 @@ +/* modest-tny-header-tree-view.c */ + +/* insert (c)/licensing information) */ + +#include "modest-tny-header-tree-view.h" + +/* 'private'/'protected' functions */ +static void modest_tny_header_tree_view_class_init (ModestTnyHeaderTreeViewClass *klass); +static void modest_tny_header_tree_view_init (ModestTnyHeaderTreeView *obj); +static void modest_tny_header_tree_view_finalize (GObject *obj); + +static void selection_changed (GtkTreeSelection *sel, gpointer user_data); + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + MESSAGE_SELECTED_SIGNAL, + LAST_SIGNAL +}; + +typedef struct _ModestTnyHeaderTreeViewPrivate ModestTnyHeaderTreeViewPrivate; +struct _ModestTnyHeaderTreeViewPrivate { + TnyMsgFolderIface *tny_msg_folder; + GtkTreeModel *header_tree_model; +}; +#define MODEST_TNY_HEADER_TREE_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_TNY_HEADER_TREE_VIEW, \ + ModestTnyHeaderTreeViewPrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +static guint signals[LAST_SIGNAL] = {0}; + +GType +modest_tny_header_tree_view_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestTnyHeaderTreeViewClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_tny_header_tree_view_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestTnyHeaderTreeView), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_tny_header_tree_view_init, + }; + my_type = g_type_register_static (GTK_TYPE_TREE_VIEW, + "ModestTnyHeaderTreeView", + &my_info, 0); + } + return my_type; +} + +static void +modest_tny_header_tree_view_class_init (ModestTnyHeaderTreeViewClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_tny_header_tree_view_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestTnyHeaderTreeViewPrivate)); + + signals[MESSAGE_SELECTED_SIGNAL] = + g_signal_new ("message_selected", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ModestTnyHeaderTreeViewClass,message_selected), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); +} + +static void +modest_tny_header_tree_view_init (ModestTnyHeaderTreeView *obj) +{ + ModestTnyHeaderTreeViewPrivate *priv; + priv = MODEST_TNY_HEADER_TREE_VIEW_GET_PRIVATE(obj); + + priv->tny_msg_folder = NULL; + priv->header_tree_model = NULL; +} + +static void +modest_tny_header_tree_view_finalize (GObject *obj) +{ + ModestTnyHeaderTreeView *self; + ModestTnyHeaderTreeViewPrivate *priv; + + self = MODEST_TNY_HEADER_TREE_VIEW(obj); + priv = MODEST_TNY_HEADER_TREE_VIEW_GET_PRIVATE(self); + + if (priv->header_tree_model) + g_object_unref (G_OBJECT(priv->header_tree_model)); + + priv->header_tree_model = NULL; + priv->tny_msg_folder = NULL; +} + +GtkWidget* +modest_tny_header_tree_view_new (TnyMsgFolderIface *folder) +{ + GObject *obj; + GtkTreeSelection *sel; + ModestTnyHeaderTreeView *self; + + obj = G_OBJECT(g_object_new(MODEST_TYPE_TNY_HEADER_TREE_VIEW, NULL)); + self = MODEST_TNY_HEADER_TREE_VIEW(obj); + + if (!modest_tny_header_tree_view_set_folder (self, NULL)) { + g_warning ("could not set the folder"); + g_object_unref (obj); + return NULL; + } + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(self)); + g_signal_connect (sel, "changed", + G_CALLBACK(selection_changed), self); + + return GTK_WIDGET(self); +} + + +gboolean +modest_tny_header_tree_view_set_folder (ModestTnyHeaderTreeView *self, + TnyMsgFolderIface *folder) +{ + GtkTreeModel *sortable; + ModestTnyHeaderTreeViewPrivate *priv; + + g_return_val_if_fail (self, FALSE); + + priv = MODEST_TNY_HEADER_TREE_VIEW_GET_PRIVATE(self); + + /* clean up old stuff */ + if (priv->header_tree_model) + g_object_unref (G_OBJECT(priv->header_tree_model)); + priv->header_tree_model = NULL; + priv->header_tree_model = GTK_TREE_MODEL (tny_msg_header_list_model_new()); + + if (folder) { + tny_msg_header_list_model_set_folder ( + TNY_MSG_HEADER_LIST_MODEL(priv->header_tree_model), + folder, FALSE); /* FIXME: refresh?*/ + + sortable = gtk_tree_model_sort_new_with_model (priv->header_tree_model); + + } else { + static GtkTreeModel *empty_model = NULL; + if (!empty_model) + empty_model = GTK_TREE_MODEL(gtk_list_store_new(1,G_TYPE_STRING)); + + sortable = empty_model; + } + + gtk_tree_view_set_model (GTK_TREE_VIEW (self), sortable); + + if (sortable) + g_object_unref (G_OBJECT(sortable)); + + return TRUE; +} + + +void +selection_changed (GtkTreeSelection *sel, gpointer user_data) +{ + GtkTreeModel *model; + TnyMsgHeaderIface *header; + GtkTreeIter iter; + ModestTnyHeaderTreeView *tree_view; + + g_return_if_fail (sel); + g_return_if_fail (user_data); + + if (!gtk_tree_selection_get_selected (sel, &model, &iter)) + return; /* msg was _un_selected */ + + tree_view = MODEST_TNY_HEADER_TREE_VIEW (user_data); + + gtk_tree_model_get (model, &iter, + TNY_MSG_HEADER_LIST_MODEL_INSTANCE_COLUMN, + &header, -1); + + if (header) { + const TnyMsgIface *msg; + const TnyMsgFolderIface *folder; + + folder = tny_msg_header_iface_get_folder (TNY_MSG_HEADER_IFACE(header)); + if (!folder) { + g_warning ("cannot find folder"); + return; + } + + msg = tny_msg_folder_iface_get_message (TNY_MSG_FOLDER_IFACE(folder), header); + if (!msg) { + g_warning ("cannot find msg"); + return; + } + + g_signal_emit (G_OBJECT(tree_view), signals[MESSAGE_SELECTED_SIGNAL], 0, + msg); + } +} diff --git a/src/modest-tny-header-tree-view.h b/src/modest-tny-header-tree-view.h new file mode 100644 index 0000000..3d4c7b5 --- /dev/null +++ b/src/modest-tny-header-tree-view.h @@ -0,0 +1,77 @@ +/* modest-tny-header-tree-view.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_TNY_HEADER_TREE_VIEW_H__ +#define __MODEST_TNY_HEADER_TREE_VIEW_H__ + +#include +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_TNY_HEADER_TREE_VIEW (modest_tny_header_tree_view_get_type()) +#define MODEST_TNY_HEADER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeView)) +#define MODEST_TNY_HEADER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_HEADER_TREE_VIEW,GObject)) +#define MODEST_IS_TNY_HEADER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW)) +#define MODEST_IS_TNY_HEADER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_HEADER_TREE_VIEW)) +#define MODEST_TNY_HEADER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeViewClass)) + +typedef struct _ModestTnyHeaderTreeView ModestTnyHeaderTreeView; +typedef struct _ModestTnyHeaderTreeViewClass ModestTnyHeaderTreeViewClass; + +struct _ModestTnyHeaderTreeView { + GtkTreeView parent; + /* insert public members, if any */ +}; + +struct _ModestTnyHeaderTreeViewClass { + GtkTreeViewClass parent_class; + + void (*message_selected) (ModestTnyHeaderTreeView* self, + TnyMsgIface *msg, + gpointer user_data); +}; + + +/** + * modest_tny_header_tree_view_get_type: + * + * get the GType for ModestTnyHeaderTreeView + * + * Returns: the GType + */ +GType modest_tny_header_tree_view_get_type (void) G_GNUC_CONST; + + +/** + * modest_tny_header_tree_view_new: + * @folder: a TnyMsgFolderIface object + * + * create a new ModestTnyHeaderTreeView instance, based on a folder iface + * + * Returns: a new GtkWidget (a GtkTreeView-subclass) + */ +GtkWidget* modest_tny_header_tree_view_new (TnyMsgFolderIface *folder); + + +/** + * modest_tny_header_tree_view_set_folder: + * @self: a ModestTnyHeaderTreeView instance + * @folder: a TnyMsgFolderIface object + * + * set the folder for this ModestTnyHeaderTreeView + * + * Returns: TRUE if it succeeded, FALSE otherwise + */ +gboolean modest_tny_header_tree_view_set_folder (ModestTnyHeaderTreeView *self, + TnyMsgFolderIface *folder); + +G_END_DECLS + +#endif /* __MODEST_TNY_HEADER_TREE_VIEW_H__ */ + diff --git a/src/modest-tny-msg-view.c b/src/modest-tny-msg-view.c new file mode 100644 index 0000000..00dbe5b --- /dev/null +++ b/src/modest-tny-msg-view.c @@ -0,0 +1,151 @@ +/* modest-tny-msg-view.c */ + +/* insert (c)/licensing information) */ + +#include "modest-tny-msg-view.h" +/* include other impl specific header files */ + +/* 'private'/'protected' functions */ +static void modest_tny_msg_view_class_init (ModestTnyMsgViewClass *klass); +static void modest_tny_msg_view_init (ModestTnyMsgView *obj); +static void modest_tny_msg_view_finalize (GObject *obj); + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_SIGNAL +}; + +typedef struct _ModestTnyMsgViewPrivate ModestTnyMsgViewPrivate; +struct _ModestTnyMsgViewPrivate { + GtkWidget *text_view; +}; +#define MODEST_TNY_MSG_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_TNY_MSG_VIEW, \ + ModestTnyMsgViewPrivate)) +/* globals */ +static GtkContainerClass *parent_class = NULL; + +/* uncomment the following if you have defined any signals */ +/* static guint signals[LAST_SIGNAL] = {0}; */ + +GType +modest_tny_msg_view_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestTnyMsgViewClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_tny_msg_view_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestTnyMsgView), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_tny_msg_view_init, + }; + my_type = g_type_register_static (GTK_TYPE_FRAME, + "ModestTnyMsgView", + &my_info, 0); + } + return my_type; +} + +static void +modest_tny_msg_view_class_init (ModestTnyMsgViewClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_tny_msg_view_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestTnyMsgViewPrivate)); + + /* signal definitions go here, e.g.: */ +/* signals[MY_SIGNAL_1] = */ +/* g_signal_new ("my_signal_1",....); */ +/* signals[MY_SIGNAL_2] = */ +/* g_signal_new ("my_signal_2",....); */ +/* etc. */ +} + +static void +modest_tny_msg_view_init (ModestTnyMsgView *obj) +{ + ModestTnyMsgViewPrivate *priv; + + priv = MODEST_TNY_MSG_VIEW_GET_PRIVATE(obj); + + priv->text_view = NULL; +} + +static void +modest_tny_msg_view_finalize (GObject *obj) +{ + /* no need to unref the text_view */ +} + +GtkWidget* +modest_tny_msg_view_new (TnyMsgIface *msg) +{ + GObject *obj; + ModestTnyMsgView* self; + ModestTnyMsgViewPrivate *priv; + + obj = G_OBJECT(g_object_new(MODEST_TYPE_TNY_MSG_VIEW, NULL)); + self = MODEST_TNY_MSG_VIEW(obj); + priv = MODEST_TNY_MSG_VIEW_GET_PRIVATE(self); + + priv->text_view = gtk_text_view_new (); + gtk_text_view_set_editable (GTK_TEXT_VIEW(priv->text_view), FALSE); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW(priv->text_view), FALSE); + + gtk_container_add (GTK_CONTAINER(self), priv->text_view); + + if (msg) + modest_tny_msg_view_set_message (self, msg); + + return GTK_WIDGET(self); +} + + + +void +modest_tny_msg_view_set_message (ModestTnyMsgView *self, TnyMsgIface *msg) +{ + ModestTnyMsgViewPrivate *priv; + GtkTextBuffer *buf; + GList *parts; + TnyStreamIface *stream; + + g_return_if_fail (self); + + priv = MODEST_TNY_MSG_VIEW_GET_PRIVATE(self); + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW(priv->text_view)); + + /* if msg is NULL, just delete the stuff */ + if (!msg) { + gtk_text_buffer_set_text (buf, NULL, 0); + return; + } + + /* otherwise... find the body part */ + stream = TNY_STREAM_IFACE(tny_text_buffer_stream_new(buf)); + parts = (GList*) tny_msg_iface_get_parts (msg); + while (parts) { + TnyMsgMimePartIface *part = + TNY_MSG_MIME_PART_IFACE(parts->data); + + if (tny_msg_mime_part_iface_content_type_is (part, "text/plain")) { + tny_stream_iface_reset (stream); + tny_msg_mime_part_iface_write_to_stream (part, stream); + tny_stream_iface_reset (stream); + break; + } + + parts = parts->next; + } +} diff --git a/src/modest-tny-msg-view.h b/src/modest-tny-msg-view.h new file mode 100644 index 0000000..661728c --- /dev/null +++ b/src/modest-tny-msg-view.h @@ -0,0 +1,50 @@ +/* modest-tny-msg-view.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_TNY_MSG_VIEW_H__ +#define __MODEST_TNY_MSG_VIEW_H__ + + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_TNY_MSG_VIEW (modest_tny_msg_view_get_type()) +#define MODEST_TNY_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_MSG_VIEW,ModestTnyMsgView)) +#define MODEST_TNY_MSG_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_MSG_VIEW,GObject)) +#define MODEST_IS_TNY_MSG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_MSG_VIEW)) +#define MODEST_IS_TNY_MSG_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_MSG_VIEW)) +#define MODEST_TNY_MSG_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_MSG_VIEW,ModestTnyMsgViewClass)) + +typedef struct _ModestTnyMsgView ModestTnyMsgView; +typedef struct _ModestTnyMsgViewClass ModestTnyMsgViewClass; + +struct _ModestTnyMsgView { + GtkFrame parent; + /* insert public members, if any */ +}; + +struct _ModestTnyMsgViewClass { + GtkFrameClass parent_class; + /* insert signal callback declarations, eg. */ + /* void (* my_event) (ModestTnyMsgView* obj); */ +}; + +/* member functions */ +GType modest_tny_msg_view_get_type (void) G_GNUC_CONST; + + + +GtkWidget* modest_tny_msg_view_new (TnyMsgIface *tny_msg); +void modest_tny_msg_view_set_message (ModestTnyMsgView *self, + TnyMsgIface *tny_msg); + + +G_END_DECLS + +#endif /* __MODEST_TNY_MSG_VIEW_H__ */ + diff --git a/src/modest-ui.h b/src/modest-ui.h new file mode 100644 index 0000000..55fa6a1 --- /dev/null +++ b/src/modest-ui.h @@ -0,0 +1,88 @@ +/* modest-ui.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_UI_H__ +#define __MODEST_UI_H__ + +#include +#include "modest-conf.h" + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_UI (modest_ui_get_type()) +#define MODEST_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_UI,ModestUI)) +#define MODEST_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_UI,GObject)) +#define MODEST_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_UI)) +#define MODEST_IS_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_UI)) +#define MODEST_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_UI,ModestUIClass)) + +typedef struct _ModestUI ModestUI; +typedef struct _ModestUIClass ModestUIClass; + +struct _ModestUI { + GObject parent; + /* insert public members, if any */ +}; + +struct _ModestUIClass { + GObjectClass parent_class; + /* insert signal callback declarations, eg. */ + /* void (* my_event) (ModestUI* obj); */ +}; + + +/** + * modest_ui_get_type: + * + * get the GType for ModestUI + * + * Returns: the GType + */ +GType modest_ui_get_type (void) G_GNUC_CONST; + + + +/** + * modest_ui_new: + * @modest_conf: a ModestConf instance + * + * Returns: a new ModestUI, or NULL in case of error + */ +GObject* modest_ui_new (ModestConf *modest_conf); + + +/** + * modest_ui_show_main_window: + * @ui: a ModestUI instance + * + * Returns: TRUE if succeeded, FALSE otherwise + * + */ +gboolean modest_ui_show_main_window (ModestUI *ui); + + +/** + * modest_ui_show_new_edit_window: + * @ui: a ModestUI instance + * @to: people to send this to, ';' separated + * @cc: people send carbon-copies (cc), ';' separated + * @bcc people send blind-carbon-copies (bcc),';' separated + * @subject: the subject of the message + * @body: the body text of the message + * @att: a list with the filepaths for attachments + * + * Returns: TRUE if succeeded, FALSE otherwise + */ +gboolean modest_ui_show_edit_window (ModestUI *ui, + const gchar* to, + const gchar* cc, + const gchar* bcc, + const gchar* subject, + const gchar* body, + const GSList* att); + +G_END_DECLS + +#endif /* __MODEST_UI_H__ */ + diff --git a/src/modest-window-mgr.c b/src/modest-window-mgr.c new file mode 100644 index 0000000..f06d081 --- /dev/null +++ b/src/modest-window-mgr.c @@ -0,0 +1,200 @@ +/* modest-window-mgr.c */ + +/* insert (c)/licensing information) */ + +#include "modest-window-mgr.h" +/* include other impl specific header files */ + +/* 'private'/'protected' functions */ +static void modest_window_mgr_class_init (ModestWindowMgrClass *klass); +static void modest_window_mgr_init (ModestWindowMgr *obj); +static void modest_window_mgr_finalize (GObject *obj); + +/* list my signals */ +enum { + /* MY_SIGNAL_1, */ + /* MY_SIGNAL_2, */ + LAST_WINDOW_CLOSED_SIGNAL, + LAST_SIGNAL +}; + +typedef struct _ModestWindowMgrPrivate ModestWindowMgrPrivate; +struct _ModestWindowMgrPrivate { + GSList *open_windows; + +}; +#define MODEST_WINDOW_MGR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ + MODEST_TYPE_WINDOW_MGR, \ + ModestWindowMgrPrivate)) +/* globals */ +static GObjectClass *parent_class = NULL; + +static guint signals[LAST_SIGNAL] = {0}; + +GType +modest_window_mgr_get_type (void) +{ + static GType my_type = 0; + if (!my_type) { + static const GTypeInfo my_info = { + sizeof(ModestWindowMgrClass), + NULL, /* base init */ + NULL, /* base finalize */ + (GClassInitFunc) modest_window_mgr_class_init, + NULL, /* class finalize */ + NULL, /* class data */ + sizeof(ModestWindowMgr), + 1, /* n_preallocs */ + (GInstanceInitFunc) modest_window_mgr_init, + }; + my_type = g_type_register_static (G_TYPE_OBJECT, + "ModestWindowMgr", + &my_info, 0); + } + return my_type; +} + +static void +modest_window_mgr_class_init (ModestWindowMgrClass *klass) +{ + GObjectClass *gobject_class; + gobject_class = (GObjectClass*) klass; + + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = modest_window_mgr_finalize; + + g_type_class_add_private (gobject_class, sizeof(ModestWindowMgrPrivate)); + + signals[LAST_WINDOW_CLOSED_SIGNAL] = + g_signal_new ("last_window_closed", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(ModestWindowMgrClass, last_window_closed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +modest_window_mgr_init (ModestWindowMgr *obj) +{ + ModestWindowMgrPrivate *priv = MODEST_WINDOW_MGR_GET_PRIVATE(obj); + priv->open_windows = NULL; +} + +static void +modest_window_mgr_finalize (GObject *obj) +{ + ModestWindowMgrPrivate *priv = MODEST_WINDOW_MGR_GET_PRIVATE(obj); + g_slist_free (priv->open_windows); + priv->open_windows = NULL; +} + +GObject* +modest_window_mgr_new (void) +{ + return G_OBJECT(g_object_new(MODEST_TYPE_WINDOW_MGR, NULL)); +} + +/* insert many other interesting function implementations */ +/* such as modest_window_mgr_do_something, or modest_window_mgr_has_foo */ + +gboolean +modest_window_mgr_register (ModestWindowMgr *self, GObject *win, + ModestWindowType type, + guint window_id) +{ + ModestOpenWindow *openwin = NULL; + ModestWindowMgrPrivate *priv; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (type==MODEST_MAIN_WINDOW||type==MODEST_EDIT_WINDOW, + FALSE); + + priv = MODEST_WINDOW_MGR_GET_PRIVATE(self); + + openwin = g_new (ModestOpenWindow, 1); + openwin->win = win; + openwin->type = type; + openwin->id = window_id; + + priv->open_windows = g_slist_prepend (priv->open_windows, openwin); + + return TRUE; +} + + + +gboolean +modest_window_mgr_unregister (ModestWindowMgr *self, GObject *win) +{ + ModestWindowMgrPrivate *priv; + GSList *cursor; + gboolean found = FALSE; + + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (win, FALSE); + + priv = MODEST_WINDOW_MGR_GET_PRIVATE(self); + + cursor = priv->open_windows; + while (cursor) { + if (((ModestOpenWindow*)cursor->data)->win == win) { + priv->open_windows = g_slist_delete_link (priv->open_windows, + cursor); + found = TRUE; + break; + } + cursor = cursor->next; + } + if (found) { + guint win_num = g_slist_length (priv->open_windows); + if (win_num == 0) + g_signal_emit (self, signals[LAST_WINDOW_CLOSED_SIGNAL], + 0); + } + + return found; +} + + +GObject * +modest_window_mgr_find_by_type (ModestWindowMgr *self, ModestWindowType type) +{ + ModestWindowMgrPrivate *priv; + GSList *cursor; + + g_return_val_if_fail (self, NULL); + + priv = MODEST_WINDOW_MGR_GET_PRIVATE(self); + cursor = priv->open_windows; + while (cursor) { + ModestOpenWindow *openwin = (ModestOpenWindow*)cursor->data; + if (openwin->type == type) + return openwin->win; + cursor = cursor->next; + } + + return NULL; +} + + +GObject * +modest_window_mgr_find_by_id (ModestWindowMgr *self, gint window_id) +{ + ModestWindowMgrPrivate *priv; + GSList *cursor; + + g_return_val_if_fail (self, NULL); + + priv = MODEST_WINDOW_MGR_GET_PRIVATE(self); + cursor = priv->open_windows; + while (cursor) { + ModestOpenWindow *openwin = (ModestOpenWindow*)cursor->data; + if (openwin->id == window_id) + return openwin->win; + cursor = cursor->next; + } + return NULL; +} + diff --git a/src/modest-window-mgr.h b/src/modest-window-mgr.h new file mode 100644 index 0000000..2223651 --- /dev/null +++ b/src/modest-window-mgr.h @@ -0,0 +1,67 @@ +/* modest-window-mgr.h */ +/* insert (c)/licensing information) */ + +#ifndef __MODEST_WINDOW_MGR_H__ +#define __MODEST_WINDOW_MGR_H__ + +#include +/* other include files */ + +G_BEGIN_DECLS + +/* convenience macros */ +#define MODEST_TYPE_WINDOW_MGR (modest_window_mgr_get_type()) +#define MODEST_WINDOW_MGR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_WINDOW_MGR,ModestWindowMgr)) +#define MODEST_WINDOW_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_WINDOW_MGR,GObject)) +#define MODEST_IS_WINDOW_MGR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_WINDOW_MGR)) +#define MODEST_IS_WINDOW_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_WINDOW_MGR)) +#define MODEST_WINDOW_MGR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_WINDOW_MGR,ModestWindowMgrClass)) + +enum { + MODEST_MAIN_WINDOW, /* the main window */ + MODEST_EDIT_WINDOW, /* a window to edit a mail */ + MODEST_ACCOUNT_WINDOW, /* a window to edit account information */ + MODEST_VIEW_WINDOW /* a window to view mails */ +}; +typedef guint ModestWindowType; + + +typedef struct _ModestOpenWindow ModestOpenWindow; +struct _ModestOpenWindow { + GObject *win; + ModestWindowType type; + guint id; +}; + + +typedef struct _ModestWindowMgr ModestWindowMgr; +typedef struct _ModestWindowMgrClass ModestWindowMgrClass; + +struct _ModestWindowMgr { + GObject parent; +}; + +struct _ModestWindowMgrClass { + GObjectClass parent_class; + + void (* last_window_closed) (ModestWindowMgr* obj); +}; + +/* member functions */ +GType modest_window_mgr_get_type (void) G_GNUC_CONST; + +/* typical parameter-less _new function */ +/* if this is a kind of GtkWidget, it should probably return at GtkWidget*, */ +/* otherwise probably a GObject*. */ +GObject* modest_window_mgr_new (void); + +gboolean modest_window_mgr_register (ModestWindowMgr *self, GObject *win, + ModestWindowType type, guint window_id); +gboolean modest_window_mgr_unregister (ModestWindowMgr *self, GObject *win); +GObject* modest_window_mgr_find_by_type (ModestWindowMgr *self, ModestWindowType type); +GObject* modest_window_mgr_find_by_id (ModestWindowMgr *self, gint window_id); + +G_END_DECLS + +#endif /* __MODEST_WINDOW_MGR_H__ */ +