AlbumShaper 1.0a3
loadSave.cpp
Go to the documentation of this file.
1//==============================================
2// copyright : (C) 2003-2005 by Will Stokes
3//==============================================
4// This program is free software; you can redistribute it
5// and/or modify it under the terms of the GNU General
6// Public License as published by the Free Software
7// Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//==============================================
10
11//Systemwide includes
12#include <qfile.h>
13#include <q3textstream.h>
14#include <qstringlist.h>
15#include <qnamespace.h>
16#include <qkeysequence.h>
17
18//Projectwide includes
19#include "loadSave.h"
20#include "helpWindow.h"
21#include "../../config.h"
22
23//==============================================
25{
26 return QString("%1/saveLoad.html").arg(TEMP_DIR);
27}
28//==============================================
29void LoadSave::generateHTML(Q3TextStream::Encoding type, QString charSet)
30{
31 //create/open html file
32 QFile file( filename() );
33 if(file.open(QIODevice::WriteOnly))
34 {
35 //-----
36 Q3TextStream stream;
37 stream.setEncoding( type );
38 stream.setDevice( &file );
39 //-----
40 stream << "<html><head>\n";
41 stream << "<meta http-equiv='Content-Type' content='text/html; charset=" << charSet << "'>\n";
42 stream << "</head><body>\n";
43 stream << "<table cellpadding='4'><tr>\n";
44 stream << "<td><img src='" << IMAGE_PATH << "helpImages/asHelpLogoSmall.png'></td>\n";
45 stream << "<td valign='middle'><font face='Arial, sans-serif' size='+3'>";
46 stream << HelpWindow::tr("Saving & Loading") << "</font></td>\n";
47 stream << "</tr></table>\n";
48
49 stream << "<font face='Arial, sans-serif'>\n";
50 stream << "<table cellspacing='10' cellpadding='0'><tr><td>\n";
51
52 stream << "<table width='100%' cellpadding='4' cellspacing='0'><tr><td bgcolor='lightgray'>\n";
53 stream << "<font size='+1'><b>" << HelpWindow::tr("Saving Albums:") << "</b></font>\n";
54 stream << "</td></tr></table>\n";
55
56 stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
57 stream << "<p align='justify'>\n";
58
59 stream << HelpWindow::tr("To save an album, choose <font color='red'>File &rarr; Save</font>. The first time an album is saved, or whenever using the <font color='red'>Save As</font> command, you will be presented with the dialog pictured at the right. First, choose a theme to use when saving your album on the left. Preview images and additional details of the selected theme are shown to the right. Themes determine the look and feel of the generated web album. At the bottom you can choose the location you wish to save to.") << "\n";
60
61 stream << "<p align='justify'>\n";
62 stream << HelpWindow::tr("If you wish to switch themes in the future, use the <font color='red'>Save As</font> command, pick the new theme, and save over the top of the old album.") << "\n";
63
64 stream << "</td><td valign='middle'>\n";
65 stream << "<img src='" << IMAGE_PATH << "helpImages/saveAs.png'>\n";
66 stream << "</td></tr></table>\n";
67
68 stream << "</td></tr><tr><td>\n";
69
70 stream << "<table width='100%' cellpadding='4' cellspacing='0'><tr><td bgcolor='lightgray'>\n";
71 stream << "<font size='+1'><b>" << HelpWindow::tr("Loading Albums:") << "</b></font>\n";
72 stream << "</td></tr></table>\n";
73
74 stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
75 stream << "<img src='" << IMAGE_PATH << "helpImages/recentAlbums.png'>\n";
76 stream << "</td><td valign='middle'>\n";
77 stream << "<p align='justify'>\n";
78 stream << HelpWindow::tr("Album Shaper makes loading albums easy. Use the <font color='red'>File &rarr; Open Recent</font> menu. If you have a lot of albums, or if you are opening an album created on a different machine, select <font color='red'>File &rarr; Open</font>, browse to the album's location, and open the <font color='red'>Album.xml</font> file within this directory.") << "\n";
79
80 stream << "<p align='justify'>\n";
81 stream << HelpWindow::tr("If you want to restore an album to its last saved state, you can either load it again, or use <font color='red'>File &rarr; Revert to Saved</font>.") << "\n";
82
83 stream << "</td></tr></table>\n";
84
85 stream << "</td></tr><tr><td>\n";
86
87 stream << "<table width='100%' cellpadding='4' cellspacing='0'><tr><td bgcolor='lightgray'>\n";
88 stream << "<font size='+1'><b>" << HelpWindow::tr("Exporting:") << "</b></font>\n";
89 stream << "</td></tr></table>\n";
90
91 stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
92 stream << "<p align='justify'>\n";
93
94 stream << HelpWindow::tr("In addition to producing web galleries, Album Shaper can export your photos in a number of other formats.") << "\n";
95
96 stream << "<p align='justify'><ul>\n";
97 stream << "<li>" << HelpWindow::tr("To use a photo as your desktop wallpaper, select the photo and click the <font color='red'>Desktop</font> button at the bottom of the organize view.") << "\n";
98
99 stream << "<p align='justify'>\n";
100 stream << "<li>" << HelpWindow::tr("To export a small web gallery that does not include full-size images, select <font color='red'>File &rarr; Export &rarr; Small Web Gallery</font>.") << "\n";
101
102 stream << "<p align='justify'>\n";
103 stream << "<li>" << HelpWindow::tr("To export an entire album's contents for printing, select <font color='red'>File &rarr; Export &rarr; Images for Printing</font>. Only the full-size images will be exported to a directory along side your album on disk.") << "\n";
104
105 stream << "</ul>\n";
106
107 stream << "</td></tr></table>\n";
108 stream << "</td></tr>\n";
109 stream << "</font>\n";
110 stream << "</body></html>\n";
111 file.close();
112 }
113}
114//==============================================
static QString filename()
returns the html filename
Definition loadSave.cpp:24
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition loadSave.cpp:29
QString IMAGE_PATH
Definition config.cpp:18
QString TEMP_DIR
Definition config.cpp:23