2004-08-24 [colin] 0.9.12cvs80.2
authorColin Leroy <colin@colino.net>
Tue, 24 Aug 2004 22:46:53 +0000 (22:46 +0000)
committerColin Leroy <colin@colino.net>
Tue, 24 Aug 2004 22:46:53 +0000 (22:46 +0000)
* src/Makefile.am
* src/main.c
* src/setup.c
* src/setup.h
* src/stock_pixmap.c
* src/stock_pixmap.h
* src/wizard.c ** ADDED **
* src/wizard.h ** ADDED **
* src/pixmaps/sylpheed_icon.xpm ** ADDED **
Add a setup wizard

12 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/Makefile.am
src/main.c
src/pixmaps/sylpheed_icon.xpm [new file with mode: 0644]
src/setup.c
src/setup.h
src/stock_pixmap.c
src/stock_pixmap.h
src/wizard.c [new file with mode: 0644]
src/wizard.h [new file with mode: 0644]

index e9594534fc8486bc309329664e962cca5da869da..d3d6271038ba9600d7df9f1b15ebf5cf29590c09 100644 (file)
@@ -1,3 +1,16 @@
+2004-08-24 [colin]     0.9.12cvs80.2
+
+       * src/Makefile.am
+       * src/main.c
+       * src/setup.c
+       * src/setup.h
+       * src/stock_pixmap.c
+       * src/stock_pixmap.h
+       * src/wizard.c ** ADDED **
+       * src/wizard.h ** ADDED ** 
+       * src/pixmaps/sylpheed_icon.xpm ** ADDED **
+               Add a setup wizard 
+
 2004-08-24 [colin]     0.9.12cvs80.1
 
        * src/folder.c
index a4abe9d5aa0183c8b73809d70bfcc37cb2859b56..2b7e8727a2176b4a9f2b8ce552ce874a03f7710c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.45 -r 1.382.2.46 src/compose.c; ) > 0.9.12cvs79.2.patchset
 ( cvs diff -u -r 1.16.2.1 -r 1.16.2.2 src/matcher_parser_lex.l; ) > 0.9.12cvs79.3.patchset
 ( cvs diff -u -r 1.213.2.13 -r 1.213.2.14 src/folder.c; ) > 0.9.12cvs80.1.patchset
+( cvs diff -u -r 1.155.2.10 -r 1.155.2.11 src/Makefile.am; cvs diff -u -r 1.115.2.15 -r 1.115.2.16 src/main.c; cvs diff -u -r 1.5.2.1 -r 1.5.2.2 src/setup.c; cvs diff -u -r 1.1.1.1 -r 1.1.1.2 src/setup.h; cvs diff -u -r 1.25.2.5 -r 1.25.2.6 src/stock_pixmap.c; cvs diff -u -r 1.18.2.3 -r 1.18.2.4 src/stock_pixmap.h; cvs diff -u -r 0 -r 1 src/wizard.c; cvs diff -u -r 0 -r 1 src/wizard.h; cvs diff -u -r 0 -r 1 src/pixmaps/sylpheed_icon.xpm; ) > 0.9.12cvs80.2.patchset
index a667788d3233377a4063507a05f7accd73472717..5628053ea32cf9a11e8f1a8eda553905009e28a0 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=80
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.1
+EXTRA_GTK2_VERSION=.2
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index 6b9c713ef6e06ff6b00cb181c74fe0afab42680d..53754d21012a52d2aabd6397c2afad70c582723e 100644 (file)
@@ -124,7 +124,8 @@ sylpheed_SOURCES = \
        toolbar.c \
        undo.c \
        unmime.c \
-       vcard.c
+       vcard.c \
+       wizard.c
 
 sylpheedincludedir = $(pkgincludedir)
 sylpheedinclude_HEADERS = \
@@ -252,7 +253,8 @@ sylpheedinclude_HEADERS = \
        toolbar.h \
        undo.h \
        unmime.h \
-       vcard.h
+       vcard.h \
+       wizard.h
 
 BUILT_SOURCES = \
        matcher_parser_parse.h \
@@ -342,6 +344,7 @@ EXTRA_DIST = \
        pixmaps/regular.xpm \
        pixmaps/replied.xpm \
        pixmaps/search.xpm \
+       pixmaps/sylpheed_icon.xpm \
        pixmaps/sylpheed_logo.xpm \
        pixmaps/sylpheed.xpm \
        pixmaps/trash_hrm.xpm \
index a9cb8555b84e14a655d752a67c1e98aa26db8800..e6648c2c6f87f9940f75405588779098910cd21f 100644 (file)
@@ -36,7 +36,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <signal.h>
-
+#include "wizard.h"
 #ifdef HAVE_STARTUP_NOTIFICATION
 # define SN_API_NOT_YET_FROZEN
 # include <libsn/sn-launchee.h>
@@ -351,15 +351,18 @@ int main(int argc, char *argv[])
                                        lock_socket_input_cb,
                                        mainwin);
 
-       account_read_config_all();
-
        if (folder_read_list() < 0) {
-               setup(mainwin);
+               run_wizard(mainwin, TRUE);
                folder_write_list();
        }
+       
+       account_read_config_all();
+       
        if (!account_get_list()) {
-               account_edit_open();
-               account_add();
+               run_wizard(mainwin, FALSE);
+               account_read_config_all();
+               if(!account_get_list())
+                       exit_sylpheed(mainwin);
        }
 
        account_set_missing_folder();
diff --git a/src/pixmaps/sylpheed_icon.xpm b/src/pixmaps/sylpheed_icon.xpm
new file mode 100644 (file)
index 0000000..19a223a
--- /dev/null
@@ -0,0 +1,896 @@
+/* XPM */
+static char * sylpheed_icon_xpm[] = {
+"64 64 829 2",
+"      c None",
+".     c #FBFBFB",
+"+     c #FEFEFE",
+"@     c #FAFAFA",
+"#     c #F5F5F5",
+"$     c #F2F2F2",
+"%     c #F1F1F1",
+"&     c #F0F0F0",
+"*     c #F9F9F9",
+"=     c #FFFFFF",
+"-     c #FDFDFD",
+";     c #F4F4F4",
+">     c #F3F3F3",
+",     c #EFEFEF",
+"'     c #F5F5F4",
+")     c #FCFCFB",
+"!     c #F8F8F7",
+"~     c #F7F7F6",
+"{     c #F6F7F5",
+"]     c #EAE7F6",
+"^     c #EBE8F5",
+"/     c #EFEFEE",
+"(     c #F1F0F1",
+"_     c #FEFEFD",
+":     c #FBFBFA",
+"<     c #FAFAF9",
+"[     c #F9F9F8",
+"}     c #F5F4F8",
+"|     c #E8E4F8",
+"1     c #E5E0F8",
+"2     c #D9D2FA",
+"3     c #E5E1F7",
+"4     c #D2C8FB",
+"5     c #D4CCFA",
+"6     c #EFEEF3",
+"7     c #F3F3F2",
+"8     c #F1F0F0",
+"9     c #EEEDEF",
+"0     c #EBEBF0",
+"a     c #E8E6F0",
+"b     c #E1DCF2",
+"c     c #DDD9F2",
+"d     c #D9D3F4",
+"e     c #FDFDFC",
+"f     c #FCFDFB",
+"g     c #EFECFB",
+"h     c #E8E4FB",
+"i     c #E2DDFB",
+"j     c #E6E1FA",
+"k     c #E8E5F9",
+"l     c #DAD4FA",
+"m     c #ECE9F7",
+"n     c #DFD8F9",
+"o     c #DAD4F9",
+"p     c #D9D1F9",
+"q     c #ECEBF5",
+"r     c #F0EEF4",
+"s     c #DBD6F7",
+"t     c #E7E4F4",
+"u     c #E6E4F4",
+"v     c #DAD5F6",
+"w     c #CAC0FA",
+"x     c #E7E5F1",
+"y     c #C9BEFA",
+"z     c #DBD6F3",
+"A     c #D3CBF6",
+"B     c #DED8F1",
+"C     c #DFDBF0",
+"D     c #E4E0FA",
+"E     c #5D5D5D",
+"F     c #616161",
+"G     c #4A4A4A",
+"H     c #FBFAFE",
+"I     c #EDEAFD",
+"J     c #F9F8FC",
+"K     c #F4F1FC",
+"L     c #E0DAFC",
+"M     c #E7E3FC",
+"N     c #E8E5FB",
+"O     c #D1C8FC",
+"P     c #D6CEFC",
+"Q     c #E6E1F9",
+"R     c #E9E5F8",
+"S     c #E2DDF8",
+"T     c #F7F8F5",
+"U     c #F3F2F5",
+"V     c #E8E5F6",
+"W     c #D1C9FA",
+"X     c #DDD7F7",
+"Y     c #F4F4F2",
+"Z     c #D4CBF9",
+"`     c #D9D3F6",
+" .    c #E1DEF4",
+"..    c #E4E0F2",
+"+.    c #D9D3F5",
+"@.    c #E5E4F0",
+"#.    c #E9E8EE",
+"$.    c #EDEDEC",
+"%.    c #ECEDEB",
+"&.    c #5A5A5A",
+"*.    c #6D6D6D",
+"=.    c #A7A7A7",
+"-.    c #C4C4C4",
+";.    c #5E5E5E",
+">.    c #EBE7FC",
+",.    c #CEC3FE",
+"'.    c #F5F3FB",
+").    c #DBD2FC",
+"!.    c #E7E2FB",
+"~.    c #F3F2F9",
+"{.    c #E7E3F9",
+"].    c #DFD9FA",
+"^.    c #D4CBFB",
+"/.    c #CEC4FB",
+"(.    c #D2C8FA",
+"_.    c #CDC3FC",
+":.    c #E5E1F6",
+"<.    c #D6CDF8",
+"[.    c #E4E0F5",
+"}.    c #E7E4F3",
+"|.    c #EAE9F2",
+"1.    c #ECEBF0",
+"2.    c #EEEEEF",
+"3.    c #EEEEED",
+"4.    c #EEEEEE",
+"5.    c #EDEDED",
+"6.    c #B8B8B8",
+"7.    c #8D8D8D",
+"8.    c #636363",
+"9.    c #9A9A9A",
+"0.    c #D2D2D2",
+"a.    c #919191",
+"b.    c #8B8B8B",
+"c.    c #2F2F2F",
+"d.    c #EAE6FC",
+"e.    c #F4F3FB",
+"f.    c #E2DCFC",
+"g.    c #E4DFFB",
+"h.    c #ECE8F9",
+"i.    c #E2DDFA",
+"j.    c #DED7FA",
+"k.    c #E9E6F8",
+"l.    c #DBD4F9",
+"m.    c #E0DBF8",
+"n.    c #E9E5F6",
+"o.    c #E9E7F4",
+"p.    c #F1F1F2",
+"q.    c #F2F2F1",
+"r.    c #F0F1F0",
+"s.    c #EFF0EF",
+"t.    c #EBE8F2",
+"u.    c #D1CFDB",
+"v.    c #A4A4A5",
+"w.    c #6B6B6E",
+"x.    c #898989",
+"y.    c #C7C7C7",
+"z.    c #F8F8F8",
+"A.    c #FCFCFC",
+"B.    c #F7F7F7",
+"C.    c #DADADA",
+"D.    c #757575",
+"E.    c #505050",
+"F.    c #E5DFFC",
+"G.    c #D6CDFC",
+"H.    c #DDD5FB",
+"I.    c #DCD5FB",
+"J.    c #E7E2F9",
+"K.    c #EBE8F8",
+"L.    c #EEECF7",
+"M.    c #F6F6F5",
+"N.    c #F4F4F3",
+"O.    c #F2F3F2",
+"P.    c #E9E8F0",
+"Q.    c #EDEDF0",
+"R.    c #DDD7F8",
+"S.    c #CAC5E0",
+"T.    c #9B98AA",
+"U.    c #69686E",
+"V.    c #5A5A5B",
+"W.    c #7B7B7B",
+"X.    c #BCBCBC",
+"Y.    c #F5F4F4",
+"Z.    c #F6F6F6",
+"`.    c #8F8F8F",
+" +    c #B2B2B2",
+".+    c #A3A3A3",
+"++    c #F2F0F9",
+"@+    c #F3F2F8",
+"#+    c #F5F5F8",
+"$+    c #F4F5F4",
+"%+    c #F1F1F0",
+"&+    c #EAE9F1",
+"*+    c #E1DEF2",
+"=+    c #E2DEF3",
+"-+    c #E3DFF4",
+";+    c #E6E3F4",
+">+    c #D7D1F7",
+",+    c #B2AFBD",
+"'+    c #817E92",
+")+    c #5C5C5D",
+"!+    c #717172",
+"~+    c #AFAFAF",
+"{+    c #EBECEB",
+"]+    c #D1D2ED",
+"^+    c #FFFFFD",
+"/+    c #D9D9D9",
+"(+    c #747474",
+"_+    c #E6E6E6",
+":+    c #EBEBEB",
+"<+    c #3C3C3C",
+"[+    c #F3F2F4",
+"}+    c #E6E1F6",
+"|+    c #EDEBF3",
+"1+    c #DBD3F7",
+"2+    c #E3E0F4",
+"3+    c #D9D2F6",
+"4+    c #D4CBF8",
+"5+    c #D9D2F8",
+"6+    c #DBD5F9",
+"7+    c #EBEAF1",
+"8+    c #ADA7C0",
+"9+    c #5C5D5D",
+"0+    c #696968",
+"a+    c #9F9F9F",
+"b+    c #DFDFDF",
+"c+    c #5158BD",
+"d+    c #B1B1B1",
+"e+    c #EAEAEA",
+"f+    c #878787",
+"g+    c #303030",
+"h+    c #F4F4F6",
+"i+    c #E6E2F8",
+"j+    c #F0EFF6",
+"k+    c #E4E0F7",
+"l+    c #DDD6F8",
+"m+    c #F1F1F3",
+"n+    c #CFC6FA",
+"o+    c #DCD5F6",
+"p+    c #DCD5F7",
+"q+    c #E4E1F4",
+"r+    c #E3DFF6",
+"s+    c #E3DCF8",
+"t+    c #D8D7DD",
+"u+    c #5D5D5E",
+"v+    c #606061",
+"w+    c #929292",
+"x+    c #D8D8D7",
+"y+    c #6267C3",
+"z+    c #D8D8D8",
+"A+    c #E5E5E5",
+"B+    c #E9E9E9",
+"C+    c #D1C7FA",
+"D+    c #D7D1F8",
+"E+    c #D7D0F8",
+"F+    c #E9E7F3",
+"G+    c #EEEEF3",
+"H+    c #E3DFF7",
+"I+    c #E0DAFA",
+"J+    c #D2CFE0",
+"K+    c #A09EAA",
+"L+    c #666470",
+"M+    c #5A5B5B",
+"N+    c #848484",
+"O+    c #C5C5C5",
+"P+    c #7175C9",
+"Q+    c #EBECF7",
+"R+    c #464CB8",
+"S+    c #888CD1",
+"T+    c #E7E7E7",
+"U+    c #6C6C6C",
+"V+    c #F2F1F4",
+"W+    c #F1F0F3",
+"X+    c #E5E0F5",
+"Y+    c #E0DBF7",
+"Z+    c #E4DFF8",
+"`+    c #CFCAE2",
+" @    c #A19FAA",
+".@    c #6A6970",
+"+@    c #5B5B5B",
+"@@    c #767677",
+"#@    c #B5B5B4",
+"$@    c #F0F1FA",
+"%@    c #464DB9",
+"&@    c #EEEFF9",
+"*@    c #545ABD",
+"=@    c #B5B7E2",
+"-@    c #5056BD",
+";@    c #898ED3",
+">@    c #989BD8",
+",@    c #CCCEED",
+"'@    c #D6D6D6",
+")@    c #737373",
+"!@    c #E3E3E3",
+"~@    c #E4E4E4",
+"{@    c #C1C1C1",
+"]@    c #2E2E2E",
+"^@    c #D8D2F9",
+"/@    c #D2C9FE",
+"(@    c #E3DEF8",
+"_@    c #ACA8C1",
+":@    c #8D8D90",
+"<@    c #5D5C5D",
+"[@    c #6F6F6E",
+"}@    c #F6F7FC",
+"|@    c #F6F7FB",
+"1@    c #9DA0DA",
+"2@    c #9295D5",
+"3@    c #CFD0EC",
+"4@    c #3C43B4",
+"5@    c #7E82CE",
+"6@    c #787CCC",
+"7@    c #E5E6F6",
+"8@    c #4349B7",
+"9@    c #878CD2",
+"0@    c #373DB3",
+"a@    c #ADAFDF",
+"b@    c #8C8C8C",
+"c@    c #AEAEAE",
+"d@    c #ECECEC",
+"e@    c #E2E2E2",
+"f@    c #E0E0E0",
+"g@    c #585858",
+"h@    c #FFFFFE",
+"i@    c #BAB9BD",
+"j@    c #909190",
+"k@    c #5E5F5D",
+"l@    c #9A9A99",
+"m@    c #494FB9",
+"n@    c #FAFAFC",
+"o@    c #BEC0E6",
+"p@    c #BABCE4",
+"q@    c #585DBF",
+"r@    c #999CD8",
+"s@    c #7074C9",
+"t@    c #6368C4",
+"u@    c #979BD7",
+"v@    c #6C71C7",
+"w@    c #9497D6",
+"x@    c #8A8ED2",
+"y@    c #AFB1E1",
+"z@    c #CBCDEB",
+"A@    c #E2E3F5",
+"B@    c #D7D7D6",
+"C@    c #E8E8E8",
+"D@    c #A6A6A6",
+"E@    c #6D6D6F",
+"F@    c #5D5E5D",
+"G@    c #C9C9C9",
+"H@    c #F4F5FB",
+"I@    c #5459BD",
+"J@    c #FDFEFE",
+"K@    c #6369C4",
+"L@    c #B8BAE3",
+"M@    c #5B61C0",
+"N@    c #6D71C7",
+"O@    c #AEAFE0",
+"P@    c #3036B1",
+"Q@    c #999DD8",
+"R@    c #585EBF",
+"S@    c #D9DAF0",
+"T@    c #F2F4F8",
+"U@    c #F9FAFA",
+"V@    c #E1E1E1",
+"W@    c #DDDDDD",
+"X@    c #DCDCDC",
+"Y@    c #434343",
+"Z@    c #818181",
+"`@    c #FEFEFF",
+" #    c #7C80CD",
+".#    c #0C14A2",
+"+#    c #5D62C2",
+"@#    c #BDBFE7",
+"##    c #5B5FC0",
+"$#    c #888CD2",
+"%#    c #C2C4E8",
+"&#    c #363CB2",
+"*#    c #8286CF",
+"=#    c #2C32AE",
+"-#    c #DFE0F3",
+";#    c #9195D6",
+">#    c #E9EBF5",
+",#    c #E8EBF5",
+"'#    c #A3AFD8",
+")#    c #95A1CF",
+"!#    c #CCD0E2",
+"~#    c #D4D4D4",
+"{#    c #727272",
+"]#    c #DBDBDB",
+"^#    c #5C5C5C",
+"/#    c #5F5F5F",
+"(#    c #B0B0B0",
+"_#    c #1C24A8",
+":#    c #454AB8",
+"<#    c #979BD8",
+"[#    c #787CCB",
+"}#    c #C9CBEA",
+"|#    c #5E63C2",
+"1#    c #868AD1",
+"2#    c #ACAEE0",
+"3#    c #7F82CE",
+"4#    c #7579CA",
+"5#    c #898DD2",
+"6#    c #B8BAE4",
+"7#    c #F8F7FB",
+"8#    c #E0E4F0",
+"9#    c #9DA9D7",
+"0#    c #909ED0",
+"a#    c #B1B9DB",
+"b#    c #D7DAE7",
+"c#    c #D7D7D7",
+"d#    c #CFCFCF",
+"e#    c #353535",
+"f#    c #6B6B6B",
+"g#    c #9598D7",
+"h#    c #7A7ECC",
+"i#    c #E5E5F5",
+"j#    c #4E53BB",
+"k#    c #474DB9",
+"l#    c #8084CE",
+"m#    c #565CBF",
+"n#    c #9A9DD9",
+"o#    c #5056BC",
+"p#    c #8589D1",
+"q#    c #F0F1F9",
+"r#    c #C2C8E5",
+"s#    c #697BC4",
+"t#    c #8C98CD",
+"u#    c #D5D9E8",
+"v#    c #EFF0F1",
+"w#    c #F3F2F1",
+"x#    c #D5D5D5",
+"y#    c #313131",
+"z#    c #606060",
+"A#    c #BFC1E7",
+"B#    c #4449B7",
+"C#    c #5E63C1",
+"D#    c #6B70C7",
+"E#    c #9C9FDA",
+"F#    c #CCCDEC",
+"G#    c #3B41B3",
+"H#    c #A3A6DC",
+"I#    c #8D91D4",
+"J#    c #C4C6E8",
+"K#    c #F8F9FA",
+"L#    c #B5BEDF",
+"M#    c #475DB5",
+"N#    c #BAC2DF",
+"O#    c #EFF0F2",
+"P#    c #ADADAD",
+"Q#    c #D3D3D3",
+"R#    c #BFBFBF",
+"S#    c #444444",
+"T#    c #767676",
+"U#    c #B9B9B9",
+"V#    c #E2E3F4",
+"W#    c #3037B0",
+"X#    c #A4A8DC",
+"Y#    c #595EC0",
+"Z#    c #C3C5E8",
+"`#    c #F0EFF9",
+" $    c #A4A6DD",
+".$    c #F7F8F9",
+"+$    c #919ED2",
+"@$    c #AEB7DB",
+"#$    c #E7E9F0",
+"$$    c #F6F6F4",
+"%$    c #D1D1D1",
+"&$    c #D0D0D0",
+"*$    c #797979",
+"=$    c #CECECE",
+"-$    c #959595",
+";$    c #6A6A6A",
+">$    c #9E9E9E",
+",$    c #EBECF8",
+"'$    c #CBCDEC",
+")$    c #676BC5",
+"!$    c #00079D",
+"~$    c #AEB0E1",
+"{$    c #3E44B6",
+"]$    c #F4F5F9",
+"^$    c #687AC3",
+"/$    c #B3BDDE",
+"($    c #F2F2F4",
+"_$    c #AAAAAA",
+":$    c #A5A5A5",
+"<$    c #404040",
+"[$    c #6E6E6E",
+"}$    c #838383",
+"|$    c #CACACA",
+"1$    c #6166C3",
+"2$    c #00019B",
+"3$    c #595FBF",
+"4$    c #E1E2F4",
+"5$    c #C9CAEB",
+"6$    c #E6EAF3",
+"7$    c #7686C7",
+"8$    c #8E9CD0",
+"9$    c #CCCCCC",
+"0$    c #494949",
+"a$    c #2D2D2D",
+"b$    c #BBBBBB",
+"c$    c #787878",
+"d$    c #F8F9F9",
+"e$    c #9EA9D6",
+"f$    c #9CA8D6",
+"g$    c #F4F3F5",
+"h$    c #CBCBCB",
+"i$    c #969696",
+"j$    c #686868",
+"k$    c #939393",
+"l$    c #FDFCFC",
+"m$    c #FBFCFB",
+"n$    c #BEC5E2",
+"o$    c #9CA7D6",
+"p$    c #F1F2F4",
+"q$    c #F2F3F3",
+"r$    c #F1F4F4",
+"s$    c #F1F5F5",
+"t$    c #EFF3F3",
+"u$    c #ECEFEF",
+"v$    c #E9EBEB",
+"w$    c #DEDEDE",
+"x$    c #CDCDCD",
+"y$    c #555555",
+"z$    c #B5B5B5",
+"A$    c #DADEED",
+"B$    c #6C7EC3",
+"C$    c #E4E6EF",
+"D$    c #F2F4F4",
+"E$    c #D4BDBD",
+"F$    c #954A4C",
+"G$    c #771416",
+"H$    c #761215",
+"I$    c #93484A",
+"J$    c #CDB6B7",
+"K$    c #C6C6C6",
+"L$    c #2C2C2C",
+"M$    c #707070",
+"N$    c #D7DBEC",
+"O$    c #CFD5E8",
+"P$    c #F7F6F5",
+"Q$    c #F3F4F4",
+"R$    c #CAACAC",
+"S$    c #771618",
+"T$    c #660D0F",
+"U$    c #894C4E",
+"V$    c #905657",
+"W$    c #893E3F",
+"X$    c #771519",
+"Y$    c #AF9191",
+"Z$    c #737575",
+"`$    c #D9DADA",
+" %    c #C2C2C2",
+".%    c #B7B7B7",
+"+%    c #333333",
+"@%    c #8C8C8B",
+"#%    c #CCCCCB",
+"$%    c #F8F7F7",
+"%%    c #741114",
+"&%    c #732A2C",
+"*%    c #733335",
+"=%    c #8F5B5D",
+"-%    c #B18D8D",
+";%    c #98686A",
+">%    c #722A2C",
+",%    c #680507",
+"'%    c #A18A8B",
+")%    c #E2E3E3",
+"!%    c #626262",
+"~%    c #B6B6B6",
+"{%    c #EAECEC",
+"]%    c #984D4F",
+"^%    c #6C1216",
+"/%    c #925E5F",
+"(%    c #B08C8D",
+"_%    c #C8AEAF",
+":%    c #B99799",
+"<%    c #B69596",
+"[%    c #8E4648",
+"}%    c #8E4345",
+"|%    c #DFE2E2",
+"1%    c #C8C8C8",
+"2%    c #BDBDBD",
+"3%    c #BEBEBE",
+"4%    c #323232",
+"5%    c #C0C0C0",
+"6%    c #6C6F6F",
+"7%    c #6C090B",
+"8%    c #6B1E21",
+"9%    c #7D4143",
+"0%    c #B89798",
+"a%    c #DECFCF",
+"b%    c #E0D0D0",
+"c%    c #C3A7A8",
+"d%    c #9C7070",
+"e%    c #905A5B",
+"f%    c #751113",
+"g%    c #DFE3E3",
+"h%    c #C3C3C3",
+"i%    c #BABABA",
+"j%    c #4F4F4F",
+"k%    c #D0D4D4",
+"l%    c #6F0A0E",
+"m%    c #9E696A",
+"n%    c #C1A4A5",
+"o%    c #DED0D0",
+"p%    c #E9DEDE",
+"q%    c #F3EEEE",
+"r%    c #CBB2B3",
+"s%    c #A98283",
+"t%    c #996C6C",
+"u%    c #DDE1E1",
+"v%    c #8E8E8E",
+"w%    c #7D7D7D",
+"x%    c #EEF1F1",
+"y%    c #7D1D1F",
+"z%    c #A86E70",
+"A%    c #C1A5A4",
+"B%    c #A98082",
+"C%    c #D5C1C1",
+"D%    c #D3BEBF",
+"E%    c #C3A8A8",
+"F%    c #CEB9B9",
+"G%    c #9F6C6F",
+"H%    c #751013",
+"I%    c #DADEDE",
+"J%    c #3F3F3F",
+"K%    c #3D3D3D",
+"L%    c #C3A3A3",
+"M%    c #710C10",
+"N%    c #702D2F",
+"O%    c #C9B0B1",
+"P%    c #BA999A",
+"Q%    c #B89697",
+"R%    c #AA8384",
+"S%    c #BC9E9F",
+"T%    c #7C282A",
+"U%    c #914C4D",
+"V%    c #D7DADA",
+"W%    c #B3B3B3",
+"X%    c #E7E9E9",
+"Y%    c #975153",
+"Z%    c #78191C",
+"`%    c #B18889",
+" &    c #B79799",
+".&    c #AA8485",
+"+&    c #843638",
+"@&    c #90484B",
+"#&    c #D2CDCD",
+"$&    c #D5D6D6",
+"%&    c #373737",
+"&&    c #E4E5E5",
+"*&    c #DCD8D8",
+"=&    c #AC7C7E",
+"-&    c #79181B",
+";&    c #731013",
+">&    c #721013",
+",&    c #6D0508",
+"'&    c #934D4F",
+")&    c #D1CDCC",
+"!&    c #535353",
+"~&    c #515151",
+"{&    c #E0E2E2",
+"]&    c #D7D2D2",
+"^&    c #B69293",
+"/&    c #B18A8B",
+"(&    c #C1AAAB",
+"_&    c #D8D9D9",
+":&    c #B4B4B4",
+"<&    c #909090",
+"[&    c #DFE0E0",
+"}&    c #DCDDDD",
+"|&    c #CDC6C7",
+"1&    c #AD9293",
+"2&    c #D8DADA",
+"3&    c #D4D5D5",
+"4&    c #9D9D9D",
+"5&    c #696969",
+"6&    c #A9A9A9",
+"7&    c #E0E2E1",
+"8&    c #DDDEDD",
+"9&    c #AC9191",
+"0&    c #8D5F60",
+"a&    c #956C6E",
+"b&    c #A28383",
+"c&    c #D6D8D8",
+"d&    c #ABABAB",
+"e&    c #454545",
+"f&    c #646464",
+"g&    c #E5E6E6",
+"h&    c #E3E2E2",
+"i&    c #DAD6D6",
+"j&    c #C4B5B5",
+"k&    c #845051",
+"l&    c #A68889",
+"m&    c #A18081",
+"n&    c #A48586",
+"o&    c #A88C8D",
+"p&    c #977172",
+"q&    c #BAABAC",
+"r&    c #D2D3D3",
+"s&    c #858585",
+"t&    c #E8E9E9",
+"u&    c #E7E8E8",
+"v&    c #E7E9E8",
+"w&    c #A88788",
+"x&    c #BDA8A8",
+"y&    c #7D4547",
+"z&    c #713436",
+"A&    c #A17F80",
+"B&    c #C0B2B2",
+"C&    c #D0CACA",
+"D&    c #AF9899",
+"E&    c #88595B",
+"F&    c #A08182",
+"G&    c #9E7E7F",
+"H&    c #D0D1D1",
+"I&    c #EAEBEB",
+"J&    c #D1C6C7",
+"K&    c #A88687",
+"L&    c #B39899",
+"M&    c #B09495",
+"N&    c #CAC0C0",
+"O&    c #BDAAAA",
+"P&    c #D1CBCB",
+"Q&    c #C7BCBD",
+"R&    c #A28182",
+"S&    c #956B6D",
+"T&    c #A38586",
+"U&    c #977273",
+"V&    c #C0B6B6",
+"W&    c #CCCBCB",
+"X&    c #A0A0A0",
+"Y&    c #676767",
+"Z&    c #393939",
+"`&    c #F0F1F1",
+" *    c #EFF0F0",
+".*    c #EEEFEF",
+"+*    c #EEF0F0",
+"@*    c #D8CFCF",
+"#*    c #C2ACAD",
+"$*    c #B09394",
+"%*    c #814C4C",
+"&*    c #C3B3B3",
+"**    c #C2B1B1",
+"=*    c #CEC4C5",
+"-*    c #BFACAC",
+";*    c #C1B1B1",
+">*    c #A38383",
+",*    c #AC9293",
+"'*    c #CCC7C7",
+")*    c #D6D7D7",
+"!*    c #D3D4D4",
+"~*    c #777777",
+"{*    c #414141",
+"]*    c #EAE7E9",
+"^*    c #CAB7B9",
+"/*    c #BDA4A5",
+"(*    c #956768",
+"_*    c #8E5E61",
+":*    c #9E7777",
+"<*    c #B29696",
+"[*    c #DEDCDC",
+"}*    c #BCA5A6",
+"|*    c #BAA5A5",
+"1*    c #824E4F",
+"2*    c #7F484A",
+"3*    c #C1B3B4",
+"4*    c #4C4C4C",
+"5*    c #E6E4E4",
+"6*    c #A17B7B",
+"7*    c #A48081",
+"8*    c #A0797A",
+"9*    c #D2C7C7",
+"0*    c #D8D2D2",
+"a*    c #B8A1A2",
+"b*    c #834F50",
+"c*    c #A78888",
+"d*    c #8A5B5D",
+"e*    c #CDC4C5",
+"f*    c #DDDFDF",
+"g*    c #DADBDB",
+"h*    c #949494",
+"i*    c #595959",
+"j*    c #EDEEEE",
+"k*    c #D4C8C8",
+"l*    c #D7CECF",
+"m*    c #C1ADAD",
+"n*    c #BEA9AA",
+"o*    c #9A7374",
+"p*    c #9C7374",
+"q*    c #A78788",
+"r*    c #D1CACA",
+"s*    c #B19798",
+"t*    c #343434",
+"u*    c #4B4B4B",
+"v*    c #B59B9C",
+"w*    c #7D4344",
+"x*    c #865355",
+"y*    c #CBBEBF",
+"z*    c #CDC2C2",
+"A*    c #D5CECE",
+"B*    c #A88889",
+"C*    c #9C7777",
+"D*    c #A38485",
+"E*    c #B8A5A5",
+"F*    c #E9EAEA",
+"G*    c #DDD8D8",
+"H*    c #BFAAAB",
+"I*    c #C7B9B9",
+"J*    c #B69E9F",
+"K*    c #80494A",
+"L*    c #9A7476",
+"M*    c #9F7E7E",
+"N*    c #C8BFC0",
+"O*    c #474747",
+"P*    c #999999",
+"Q*    c #E6E7E7",
+"R*    c #793E3F",
+"S*    c #845152",
+"T*    c #D1C9C9",
+"U*    c #C5B7B8",
+"V*    c #D8D5D5",
+"W*    c #D5D1D1",
+"X*    c #DDDEDE",
+"Y*    c #D1C7C7",
+"Z*    c #D4CCCC",
+"`*    c #E0E1E1",
+" =    c #383838",
+"                                                                                                                                ",
+"                                                                                                                                ",
+"                                                                                                                                ",
+"                                                                                                                                ",
+"                                                                                                                                ",
+"                                                                                                                                ",
+"                                                                                                                                ",
+"                                                                            .                                                   ",
+"                                                                + + @ # $ % & *                                                 ",
+"                                                      = - * ; ; > $ $ % & & , '                                                 ",
+"                                          = = = ) ! ~ ~ { ] ^ > $ % % & , , / (                                                 ",
+"                              = = = _ : < [ } ! | 1 2 3 4 5 6 7 % 8 9 0 a b c d                                                 ",
+"                    = = = _ e ) f g h i j k l m n o p q r s t u v w x y z A B C D         E F G                                 ",
+"                    H I J K L M N O P P Q R S T U V W X Y Z `  ...+.@.#.$.%.$./ /   &.E *.=.-.;.                                ",
+"                    = >.,.'.).!.~.j {.].^./.(._.:.<.[.}.|.1.2./ / 3.$.3.4.5.6.7.;.8.9.0.@ . a.b.c.                              ",
+"                    = d.e.f.g.h.i.j.k.4 l.m.n.o.p.q.r.& , 4./ 3.3.s.t.u.v.w.;.x.y.z.A.z.B.C.D.4.E.                              ",
+"                    = F.G.H.I.J.K.L.M.' ' N.O.$ % & , , P.P.Q.R.S.T.U.V.W.X.Y.= - * Z.# B.`. +; .+c.                            ",
+"                    = ++@+#+~ ~ M.$+$+N.7 p.q.%+&+*+=+-+;+>+,+'+)+!+~+{+= = = ]+^+Z.# # /+(+_+4.:+<+                            ",
+"                      B.! ~ M.M.' [+}+|+1+2+3+4+5+6+7+8+7.9+0+a+b+= = = - . = c+= # > # 7.d+, e+5.f+g+                          ",
+"                      h+i+j+6+k+l+m+n+o+p+q+r+s+t+a.u+v+w+x+= = = = = - . ^+= y+= > > z+(+A+:+B+B+C.g+                          ",
+"                      [ 3 C+D+E+[.F+G+H+I+J+K+L+M+N+O+A.= = P+H = = = = = Q+R+S+= ~ > 7.~+4.B+T+A+B+U+                          ",
+"                      . V+W+X+Y+6+Z+`+ @.@+@@@#@> = = = = $@%@= = &@= *@=@-@;@>@,@= '@)@!@e+T+A+~@~@{@]@                        ",
+"                      _ ^@l./@(@_@:@<@[@=._+= = }@|@= = = 1@2@= 3@4@5@6@7@8@9@0@a@: b@c@d@T+A+~@e@f@~@g@                        ",
+"                      h@V+i@j@k@8.l@/+= = = = = m@n@o@p@= q@r@s@t@u@v@w@x@y@z@A@^+B@)@e@C@A+~@e@f@b+f@D@c.                      ",
+"                      x.E@F@7.G@= = = = = = = H@I@J@K@2@L@M@N@O@P@Q@x@R@S@T@U@M.& b@c@B+_+~@e@V@b+W@X@W@Y@                      ",
+"                  +@;.Z@X.z.= = `@ #.#+#= = = @#S+= ##$#%#&#*#=#-#;#>#,#'#)#!#4.~#{#f@T+~@e@V@b+W@]#C.]#b@g+                    ",
+"            ^#/#D.(#, = = = = H@_#:#<#-#= [#}#|#1#2#3#4#5#6#= 7#8#9#0#a#b#s.3., b@c@B+~@e@V@b+W@]#C.z+c#d#e#                    ",
+"        /#f#.+f@= = = = = = = g#h#= = = i#j#k#l#m#n#o#p#q#h@r#s#t#u#v#w#, 3.5.0.)@b+A+e@V@b+W@]#C.z+'@x#c#D.y#                  ",
+"      z#=.= = = = = = = = = = A#B#C#D#E#F#m@G#H#I#J#h#= K#L#M#N#O#N.%+4.5.:+d@b.P#T+e@V@b+W@X@C.z+'@x#Q#Q#R#]@                  ",
+"      S#f#T#U#B.= = = = = = = = = = V#W#= X#Y#Z#= `# $.$+$@$#$$$7 & 4.5.:+:+%$)@W@~@V@b+W@X@C.z+c#x#Q#%$&$0.;.                  ",
+"        *$=$-$;$>$!@= = = = = ,$'$)$!$~$= = {$= = = ]$^$/$($N.$ & 4.5.:+B+e+b._$_+V@b+W@X@C.z+c#x#Q#%$&$=$=$:$c.                ",
+"        <$= = W@-$[$}$|$= = = 1$2$3$4$= = = 5$+ _ 6$7$8${ N.$ & 4.5.:+B+C@&$)@X@e@b+W@X@C.z+c#x#Q#%$&$=$9$9$=$0$                ",
+"        a$c#= = = z.b$c$D.P#N.= = = = = = = h@_ d$e$f$g$; $ & 4.5.:+B+T+B+b._$!@b+W@X@C.z+c#x#Q#%$&$=$9$h$G@G@7.g+              ",
+"        g+i$= = = = = = W@-$j$k$C.= = = = + l$m$n$o$p$N.q$q$r$s$t$u$v$C@=$)@C.f@w$X@C./+c#x#Q#0.&$=$x$h$G@y.y.O+<+              ",
+"          y$= = = = = = = = w$z$T#W.R#- = + . A$B$C$Y.> D$E$F$G$H$I$J$v$b._$V@w$X@C./+c#x#Q#0.&$=$x$h$G@y.K$-.O+c$y#            ",
+"          L$, = = = = = = = = = B.b$c$M$:$_++ N$O$P$> Q$R$S$T$U$V$W$X$Y$Z$`$b+X@C./+c#x#Q#0.&$=$x$h$G@y.K$-. % %.%+%            ",
+"          c.c@= = = = = = = = = = = = ]#k$*.@%#%$%# Q$E$%%&%*%=%-%;%>%,%'%)%X@C./+c#x#Q#0.&$=$x$h$G@y.K$-. %{@R#{@!%            ",
+"            j$= = = = = = = = = = + + - - & ~%(+{#d+{%]%^%*%/%(%_%:%<%[%}%|%C./+c#x#Q#0.&$=$x$h$G@1%K$-. %{@R#2%3%.+c.          ",
+"            4%+ = = = = = = = = + - . * B.B.B.d@5%`.6%7%8%9%0%a%b%c%d%e%f%g%/+c#x#~#0.&$d#x$h$G@1%K$-.h%{@R#2%X.i%X.j%          ",
+"            ]@ %= = = = = = = = - . * z.Z.; > $ % & k%l%m%n%o%p%q%r%s%t%f%u%c#x#~#0.&$d#x$h$G@1%K$-.h%{@R#2%X.i%6.U#v%g+        ",
+"              w%= = = = = = = - . * z.Z.; > % , 5.d@x%y%z%A%B%C%D%E%F%G%H%I%x#~#0.&$d#x$h$G@1%K$-.h%{@R#2%X.i%6..%~%z$J%        ",
+"              K%= = = = = = - . * z.Z.; > % , 5.d@e+{%L%M%N%O%P%Q%R%S%T%U%V%~#0.&$d#x$h$G@1%K$-.h%{@R#2%X.i%6..%z$W%z$*$y#      ",
+"              a$Q#= = = = - . * z.Z.; > % , 5.d@e+C@C@X%Y%Z%`% &.&9%+&@&#&$&0.&$d#x$h$|$1%K$O+h%{@R#3%X.i%U#.%z$W% +d+_$%&      ",
+"              g+i$= = = - . @ z.Z.; > % , 4.d@e+B+T+A+&&*&=&-&;&>&,&'&)&$&0.%$d#x$h$|$1%K$O+h%{@R#3%X.i%U#.%z$W% +d+d+(#!&      ",
+"                ~&= = - . @ z.Z.# > % , 4.d@e+B+T+A+!@e@V@{&]&^&/&(&_&$&0.%$d#x$h$|$1%K$O+h%{@R#3%X.i%U#.%z$:&z$ +<&E e#y#      ",
+"                L$:+= . @ z.Z.# > % , 4.d@e+B+T+A+!@e@f@b+[&}&|&1&2&3&0.%$d#x$h$|$1%K$O+h%{@R#3%X.i%U#6..%.%4&5&<+g+            ",
+"                c.6&+ @ z.Z.# > % , 4.d@e+B+T+A+!@!@)%7&8&9&0&a&b&c&0.%$d#x$h$|$1%K$O+h%{@5%3%X.b$b$b$d&T#e&c.4%                ",
+"                  f&= z.Z.# > % , 4.d@e+B+T+_+g&h&i&j&k&l&m&n&o&p&q&r&d#x$9$|$1%y.O+h%{@5%R#3%R#z$s&~&c.y#                      ",
+"                  y#Z.z.# > % & 4.d@:+B+t&u&v&w&x&y&z&A&B&C&D&E&F&G&H&x$9$|$1%y.O+h% % % %2%w+E 4%g+                            ",
+"                  ]@~%z.> % & 4.d@d@I&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&=$9$|$1%y.O+-.-.O+X&Y&Z&g+                                  ",
+"                    T#z.% `& *.*+*@*#*$*%*&***=*-*;*>*,*m&'*)*!*H&x$9$|$1%1%1%1%~+~*{*c.                                        ",
+"                    <+# % ]*^*/*(*_*:*<*[*}*|*1*2*o&3*2&'@~#%$d#=$9$h$|$9$X.s&4*c.y#                                            ",
+"                    ]@y.& 5*6*7*8*9*0*a*b*c*d*e*f*g*c#$&Q#%$d#d#=$=$y.h*i*g+g+                                                  ",
+"                    y#x.% j*k*l*m*n*o*p*q*r*s*f*/+'@x#Q#0.%$0.d#:$Y&t*g+                                                        ",
+"                      u*% :+v*w*x*y*z*A*B*C*D*E*)*x#~#~#x# +D.K%c.                                                              ",
+"                      a$~#F*G*H*~@I*J*K*L*M*N*_&z+z+ %N+O*c.4%                                                                  ",
+"                      g+P*e+Q*R*S*T*U*V*W*X*X@=$-$y$]@y#                                                                        ",
+"                        ;.B+g&Y*Z*`*b+b+/+=.8.4%g+                                                                              ",
+"                        c.w$!@V@V@e@W%{# =c.                                                                                    ",
+"                        c.D@_+-.s&<$]@                                                                                          ",
+"                          E i*]@y#                                                                                              ",
+"                                                                                                                                ",
+"                                                                                                                                ",
+"                                                                                                                                "};
index 6b3c973a366eb1ee4395c346e99a461a7807126e..1109619ffd980c1bf419c1deb518e613a549e56f 100644 (file)
@@ -31,7 +31,7 @@
 #include "mainwindow.h"
 #include "gtkutils.h"
 #include "mh.h"
-
+#include "wizard.h"
 #define SETUP_DIALOG_WIDTH     540
 
 static void scan_tree_func(Folder *folder, FolderItem *item, gpointer data);
@@ -39,8 +39,7 @@ static void scan_tree_func(Folder *folder, FolderItem *item, gpointer data);
 void setup(MainWindow *mainwin)
 {
        gchar *path;
-       Folder *folder;
-
+       
        path = input_dialog
                (_("Mailbox setting"),
                 _("First, you have to set the location of mailbox.\n"
@@ -48,27 +47,34 @@ void setup(MainWindow *mainwin)
                   "if you have the one.\n"
                   "If you're not sure, just select OK."),
                 "Mail");
-       if (!path) return;
+       setup_write_mailbox_path(mainwin, path);
+       g_free(path);
+}
+
+gboolean setup_write_mailbox_path(MainWindow *mainwin, const gchar *path)
+{
+       Folder *folder;
+
+       if (!path) return FALSE;
        if (folder_find_from_path(path)) {
                g_warning("The mailbox already exists.\n");
-               g_free(path);
-               return;
+               return FALSE;
        }
 
        folder = folder_new(mh_get_class(), !strcmp(path, "Mail") ? _("Mailbox") : g_basename(path), path);
-       g_free(path);
 
        if (folder->klass->create_tree(folder) < 0) {
                alertpanel_error(_("Creation of the mailbox failed.\n"
                                   "Maybe some files already exist, or you don't have the permission to write there."));
                folder_destroy(folder);
-               return;
+               return FALSE;
        }
 
        folder_add(folder);
        folder_set_ui_func(folder, scan_tree_func, mainwin);
        folder_scan_tree(folder);
        folder_set_ui_func(folder, NULL, NULL);
+       return TRUE;
 }
 
 static void scan_tree_func(Folder *folder, FolderItem *item, gpointer data)
index 5b889d33d143ef2e221da631979cbdc39ddb6f23..6a6536065871eb15bce1f8f125632bb9cd9f9edc 100644 (file)
@@ -25,5 +25,6 @@
 #include "mainwindow.h"
 
 void setup(MainWindow *mainwin);
+gboolean setup_write_mailbox_path(MainWindow *mainwin, const gchar *path);
 
 #endif /* __SETUP_H__ */
index 1303ff91805a47cd778f9d35a0ec9dbfd62082f2..de0013f62a0496d49814275d8138a3d98a556087 100644 (file)
@@ -78,6 +78,7 @@
 #include "pixmaps/paste.xpm"
 #include "pixmaps/preferences.xpm"
 #include "pixmaps/properties.xpm"
+#include "pixmaps/sylpheed_icon.xpm"
 #include "pixmaps/sylpheed_logo.xpm"
 #include "pixmaps/address_book.xpm"
 #include "pixmaps/trash.xpm"
@@ -247,6 +248,7 @@ static StockPixmapData pixmaps[] =
        {privacy_emblem_failed_xpm              , NULL, NULL, "privacy_emblem_failed", NULL},   
        {privacy_emblem_warn_xpm                , NULL, NULL, "privacy_emblem_warn", NULL},
        {mime_message_xpm                       , NULL, NULL, "mime_message", NULL},
+       {sylpheed_icon_xpm                      , NULL, NULL, "sylpheed_icon", NULL},
        {sylpheed_logo_xpm                      , NULL, NULL, "sylpheed_logo", NULL},
 };
 
index 712a343fa65c1fe1aaf4ddd4932c84c109bea138..e31eda085af917b42f702b366574c9278e3507e2 100644 (file)
@@ -124,6 +124,7 @@ typedef enum
        STOCK_PIXMAP_PRIVACY_EMBLEM_FAILED,
        STOCK_PIXMAP_PRIVACY_EMBLEM_WARN,
        STOCK_PIXMAP_MIME_MESSAGE,
+       STOCK_PIXMAP_SYLPHEED_ICON,
        
        STOCK_PIXMAP_SYLPHEED_LOGO,             /* last entry */
        
diff --git a/src/wizard.c b/src/wizard.c
new file mode 100644 (file)
index 0000000..943eff1
--- /dev/null
@@ -0,0 +1,474 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * This file (C) 2004 Colin Leroy
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+#include "defs.h"
+
+#include <glib.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkvbox.h>
+#include <gtk/gtkbox.h>
+#include <gtk/gtktable.h>
+#include <gtk/gtkentry.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtknotebook.h>
+#include <gtk/gtk.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "intl.h"
+#include "utils.h"
+#include "gtk/menu.h"
+#include "prefs_account.h"
+#include "mainwindow.h"
+#include "stock_pixmap.h"
+#include "setup.h"
+
+typedef enum
+{
+       GO_BACK,
+       GO_FORWARD,
+       CANCEL,
+       FINISHED
+} PageNavigation;
+
+typedef struct
+{
+       GtkWidget *window;
+       GSList    *pages;
+       GtkWidget *notebook;
+
+       MainWindow *mainwin;
+       
+       GtkWidget *email;
+       GtkWidget *full_name;
+       GtkWidget *organization;
+
+       GtkWidget *mailbox_name;
+       
+       GtkWidget *smtp_server;
+       GtkWidget *smtp_port;
+       
+       GtkWidget *recv_type;
+       GtkWidget *recv_server;
+       GtkWidget *recv_port;
+       GtkWidget *recv_username;
+       GtkWidget *recv_password;
+       
+       gboolean create_mailbox;
+       gboolean finished;
+} WizardWindow;
+
+static void wizard_write_config(WizardWindow *wizard)
+{
+       gboolean mailbox_ok = FALSE;
+       PrefsAccount *prefs_account = prefs_account_new();
+       GList *account_list = NULL;
+       
+       if (wizard->create_mailbox) {
+               mailbox_ok = setup_write_mailbox_path(wizard->mainwin, 
+                               gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
+       }
+
+       prefs_account->account_name = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)));
+       prefs_account->name = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->full_name)));
+       prefs_account->address = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->email)));
+       prefs_account->organization = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->organization)));
+       prefs_account->smtp_server = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->smtp_server)));
+       prefs_account->recv_server = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->recv_server)));
+       prefs_account->userid = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->recv_username)));
+       prefs_account->passwd = g_strdup(
+                               gtk_entry_get_text(GTK_ENTRY(wizard->recv_password)));
+       prefs_account->protocol = GPOINTER_TO_INT
+                       (g_object_get_data(G_OBJECT(wizard->recv_type), 
+                                          MENU_VAL_ID));
+       
+       account_list = g_list_append(account_list, prefs_account);
+       prefs_account_write_config_all(account_list);
+       prefs_account_free(prefs_account);
+}
+
+static GtkWidget* create_page (WizardWindow *wizard, const char * title)
+{
+       GtkWidget *w;
+       GtkWidget *vbox;
+       GtkWidget *hbox;
+       GtkWidget *image;
+       char *title_string;
+
+       vbox = gtk_vbox_new (FALSE, 6);
+       gtk_container_set_border_width  (GTK_CONTAINER(vbox), 10);
+
+       /* create the titlebar */
+       hbox = gtk_hbox_new (FALSE, 12);
+       image = stock_pixmap_widget(wizard->window, 
+                               STOCK_PIXMAP_SYLPHEED_ICON);
+       gtk_box_pack_start (GTK_BOX(hbox), image, FALSE, FALSE, 0);
+       title_string = g_strconcat ("<span size=\"xx-large\" weight=\"ultrabold\">", title ? title : "", "</span>", NULL);
+       w = gtk_label_new (title_string);
+       gtk_label_set_use_markup (GTK_LABEL(w), TRUE);
+       g_free (title_string);
+       gtk_box_pack_start (GTK_BOX(hbox), w, FALSE, FALSE, 0);
+
+       /* pack the titlebar */
+       gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+       /* pack the separator */
+       gtk_box_pack_start (GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 0);
+
+       /* pack space */
+       w = gtk_alignment_new (0, 0, 0, 0);
+       gtk_widget_set_usize (w, 0, 6);
+       gtk_box_pack_start (GTK_BOX(vbox), w, FALSE, FALSE, 0);
+
+       return vbox;
+}
+
+static GtkWidget*
+create_page_with_text (WizardWindow *wizard, const char * title, 
+                       const char * text)
+{
+       GtkWidget *label;
+       GtkWidget *page;
+       
+       page = create_page (wizard, title);
+       label = gtk_label_new (text);
+       gtk_box_pack_start (GTK_BOX(page), label, TRUE, TRUE, 0);
+
+       return page;
+}
+
+#define GTK_TABLE_ADD_ROW_AT(table,text,entry,i) {                           \
+       GtkWidget *label = gtk_label_new(text);                               \
+       gtk_table_attach(GTK_TABLE(table), label,                             \
+                        0,1,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);            \
+       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);                      \
+       gtk_table_attach(GTK_TABLE(table), entry,                             \
+                        1,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);            \
+}
+
+static gchar *get_default_email_addr(void)
+{
+       gchar *domain_name = g_strdup(get_domain_name());
+       gchar *result;
+       if (strchr(domain_name, '.') != strrchr(domain_name, '.')
+       && strlen(strchr(domain_name, '.')) > 6) {
+               gchar *tmp = g_strdup(strchr(domain_name, '.')+1);
+               g_free(domain_name);
+               domain_name = tmp;
+       }
+       result = g_strdup_printf("%s@%s",
+                               g_get_user_name(),
+                               domain_name);
+       g_free(domain_name);
+       return result;
+}
+
+static GtkWidget* user_page (WizardWindow * wizard)
+{
+       GtkWidget *table = gtk_table_new(3,2, FALSE);
+       gchar *text;
+       gint i = 0;
+       
+       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+
+       wizard->full_name = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(wizard->full_name), g_get_real_name());
+       GTK_TABLE_ADD_ROW_AT(table, _("Your name:"), 
+                            wizard->full_name, i); i++;
+       
+       wizard->email = gtk_entry_new();
+       text = get_default_email_addr();
+       gtk_entry_set_text(GTK_ENTRY(wizard->email), text);
+       g_free(text);
+       GTK_TABLE_ADD_ROW_AT(table, _("Your email address:"), 
+                            wizard->email, i); i++;
+       
+       wizard->organization = gtk_entry_new();
+       GTK_TABLE_ADD_ROW_AT(table, _("Your organization:"), 
+                            wizard->organization, i); i++;
+       
+       return table;
+}
+
+static GtkWidget* mailbox_page (WizardWindow * wizard)
+{
+       GtkWidget *table = gtk_table_new(1,2, FALSE);
+       gchar *text;
+       gint i = 0;
+       
+       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+
+       wizard->full_name = gtk_entry_new();
+       wizard->mailbox_name = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), "Mail");
+       GTK_TABLE_ADD_ROW_AT(table, _("Mailbox name:"), 
+                            wizard->mailbox_name, i); i++;
+       
+       return table;
+}
+
+static gchar *get_default_server(const gchar *type)
+{
+       gchar *domain_name = g_strdup(get_domain_name());
+       gchar *result;
+       if (strchr(domain_name, '.') != strrchr(domain_name, '.')
+       && strlen(strchr(domain_name, '.')) > 6) {
+               gchar *tmp = g_strdup(strchr(domain_name, '.')+1);
+               g_free(domain_name);
+               domain_name = tmp;
+       }
+       result = g_strdup_printf("%s.%s",
+                               type, domain_name);
+       g_free(domain_name);
+       return result;
+}
+
+static GtkWidget* smtp_page (WizardWindow * wizard)
+{
+       GtkWidget *table = gtk_table_new(2,2, FALSE);
+       gchar *text;
+       gint i = 0;
+       
+       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+
+       wizard->full_name = gtk_entry_new();
+       wizard->smtp_server = gtk_entry_new();
+       text = get_default_server("smtp");
+       gtk_entry_set_text(GTK_ENTRY(wizard->smtp_server), text);
+       g_free(text);
+       GTK_TABLE_ADD_ROW_AT(table, _("SMTP server address:"), 
+                            wizard->smtp_server, i); i++;
+       
+       wizard->smtp_port = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(wizard->smtp_port), "25");
+       GTK_TABLE_ADD_ROW_AT(table, _("SMTP port:"), 
+                            wizard->smtp_port, i); i++;
+       
+       return table;
+}
+
+static GtkWidget* recv_page (WizardWindow * wizard)
+{
+       GtkWidget *table = gtk_table_new(5,2, FALSE);
+       GtkWidget *menu = gtk_menu_new();
+       GtkWidget *menuitem;
+       gchar *text;
+       gint i = 0;
+       
+       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+
+       wizard->full_name = gtk_entry_new();
+       wizard->recv_type = gtk_option_menu_new();
+       
+       MENUITEM_ADD (menu, menuitem, _("POP3"), A_POP3);
+       MENUITEM_ADD (menu, menuitem, _("IMAP"), A_IMAP4);
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (wizard->recv_type), menu);
+       GTK_TABLE_ADD_ROW_AT(table, _("Server type:"), 
+                            wizard->recv_type, i); i++;
+
+       wizard->recv_server = gtk_entry_new();
+       text = get_default_server("pop");
+       gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), text);
+       g_free(text);
+       GTK_TABLE_ADD_ROW_AT(table, _("Server address:"), 
+                            wizard->recv_server, i); i++;
+       
+       wizard->recv_port = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(wizard->recv_port), "110");
+       GTK_TABLE_ADD_ROW_AT(table, _("Port:"), 
+                            wizard->recv_port, i); i++;
+       
+       wizard->recv_username = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(wizard->recv_username), g_get_user_name());
+       GTK_TABLE_ADD_ROW_AT(table, _("Username:"), 
+                            wizard->recv_username, i); i++;
+       
+       wizard->recv_password = gtk_entry_new();
+       gtk_entry_set_visibility(GTK_ENTRY(wizard->recv_password), FALSE);
+       GTK_TABLE_ADD_ROW_AT(table, _("Password:"), 
+                            wizard->recv_password, i); i++;
+       
+       return table;
+}
+
+static void
+wizard_response_cb (GtkDialog * dialog, int response, gpointer data)
+{
+       WizardWindow * wizard = (WizardWindow *)data;
+       int current_page, num_pages;
+       
+       num_pages = g_slist_length(wizard->pages);
+       current_page = gtk_notebook_get_current_page (
+                               GTK_NOTEBOOK(wizard->notebook));
+       if (response == CANCEL)
+       {
+               wizard->finished = TRUE;
+               gtk_widget_destroy (GTK_WIDGET(dialog));
+       }
+       else if (response == FINISHED)
+       {
+               wizard_write_config(wizard);
+               wizard->finished = TRUE;
+               gtk_widget_destroy (GTK_WIDGET(dialog));
+       }
+       else
+       {
+               if (response == GO_BACK)
+               {
+                       if (current_page > 0)
+                               gtk_notebook_set_current_page (
+                                       GTK_NOTEBOOK(wizard->notebook), 
+                                       --current_page);
+               }
+               else if (response == GO_FORWARD)
+               {
+                       if (current_page < (num_pages-1))
+                               gtk_notebook_set_current_page (
+                                       GTK_NOTEBOOK(wizard->notebook), 
+                                       ++current_page);
+               }
+
+               gtk_dialog_set_response_sensitive (dialog, GO_BACK, 
+                               current_page > 0);
+               gtk_dialog_set_response_sensitive (dialog, GO_FORWARD, 
+                               current_page < (num_pages - 1));
+               gtk_dialog_set_response_sensitive (dialog, FINISHED, 
+                               current_page == (num_pages - 1));
+       }
+}
+
+
+gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
+       WizardWindow *wizard = g_new0(WizardWindow, 1);
+       GtkWidget *page;
+       GtkWidget *widget;
+       gchar     *text;
+       GSList     *cur;
+       
+       wizard->mainwin = mainwin;
+       wizard->create_mailbox = create_mailbox;
+       
+       gtk_widget_hide(mainwin->window);
+       
+       wizard->window = gtk_dialog_new_with_buttons (_("New User"),
+                       NULL, 0, 
+                       GTK_STOCK_GO_BACK, GO_BACK,
+                       GTK_STOCK_GO_FORWARD, GO_FORWARD,
+                       GTK_STOCK_SAVE, FINISHED,
+                       GTK_STOCK_QUIT, CANCEL,
+                       NULL);
+
+       g_signal_connect(wizard->window, "response", 
+                         G_CALLBACK(wizard_response_cb), wizard);
+       gtk_widget_realize(wizard->window);
+       gtk_dialog_set_default_response(GTK_DIALOG(wizard->window), 
+                       GO_FORWARD);
+       gtk_dialog_set_response_sensitive(GTK_DIALOG(wizard->window), 
+                       GO_BACK, FALSE);
+       gtk_dialog_set_response_sensitive(GTK_DIALOG(wizard->window), 
+                       GO_FORWARD, TRUE);
+       gtk_dialog_set_response_sensitive(GTK_DIALOG(wizard->window), 
+                       FINISHED, FALSE);
+       gtk_dialog_set_response_sensitive(GTK_DIALOG(wizard->window), 
+                       CANCEL, TRUE);
+       
+       wizard->notebook = gtk_notebook_new();
+       gtk_notebook_set_show_tabs(GTK_NOTEBOOK(wizard->notebook), FALSE);
+       gtk_notebook_set_show_border(GTK_NOTEBOOK(wizard->notebook), FALSE);
+       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(wizard->window)->vbox), 
+                           wizard->notebook, TRUE, TRUE, 0);
+       
+       wizard->pages = NULL;
+       
+/*welcome page */
+       page = create_page(wizard, _("Welcome to Sylpheed-Claws."));
+       
+       wizard->pages = g_slist_append(wizard->pages, page);
+       widget = stock_pixmap_widget(wizard->window, 
+                               STOCK_PIXMAP_SYLPHEED_LOGO);
+
+       gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
+       
+       text = g_strdup(_("Welcome to Sylpheed-Claws.\n\n"
+                         "It looks like it's the first time you use \n"
+                         "Sylpheed-Claws. So, we'll now define some basic\n"
+                         "information about yourself and your most common\n"
+                         "mail parameters; so that you can begin to use\n"
+                         "Sylpheed-Claws in less than five minutes."));
+       widget = gtk_label_new(text);
+       gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
+       g_free(text);
+
+/* user page */
+       widget = create_page (wizard, _("About You"));
+       gtk_box_pack_start (GTK_BOX(widget), user_page(wizard), FALSE, FALSE, 0);
+       wizard->pages = g_slist_append(wizard->pages, widget);
+
+/* mailbox page */
+       if (create_mailbox) {
+               widget = create_page (wizard, _("Saving mail on disk"));
+               gtk_box_pack_start (GTK_BOX(widget), mailbox_page(wizard), FALSE, FALSE, 0);
+               wizard->pages = g_slist_append(wizard->pages, widget);
+       }
+/*smtp page */
+       widget = create_page (wizard, _("Sending mail"));
+       gtk_box_pack_start (GTK_BOX(widget), smtp_page(wizard), FALSE, FALSE, 0);
+       wizard->pages = g_slist_append(wizard->pages, widget);
+
+/* recv+auth page */
+       widget = create_page (wizard, _("Receiving mail"));
+       gtk_box_pack_start (GTK_BOX(widget), recv_page(wizard), FALSE, FALSE, 0);
+       wizard->pages = g_slist_append(wizard->pages, widget);
+
+       for (cur = wizard->pages; cur && cur->data; cur = cur->next) {
+               gtk_notebook_append_page (GTK_NOTEBOOK(wizard->notebook), 
+                                         GTK_WIDGET(cur->data), NULL);
+       }
+       
+       gtk_widget_show_all (wizard->window);
+
+       while (!wizard->finished)
+               gtk_main_iteration();
+
+       GTK_EVENTS_FLUSH();
+
+       gtk_widget_show(mainwin->window);
+       g_free(wizard);
+
+       return TRUE;
+}
diff --git a/src/wizard.h b/src/wizard.h
new file mode 100644 (file)
index 0000000..0d2c8c2
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * This file (C) 2004 Colin Leroy
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __WIZARD_H__
+#define __WIZARD_H__
+
+#include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtkwidget.h>
+
+#include "mainwindow.h"
+
+gboolean wizard_run(MainWindow *, gboolean create_mailbox);
+
+#endif