AlbumShaper  1.0a3
annotating.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 "annotating.h"
20 #include "helpWindow.h"
21 #include "../../config.h"
22 
23 //==============================================
25 {
26  return QString("%1/annotating.html").arg(TEMP_DIR);
27 }
28 //==============================================
29 void Annotating::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("Annotating Albums") << "</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("Labeling Photos:") <<"</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  stream << HelpWindow::tr("Labeling photos is easy in Album Shaper! Hover over a picture and click the little info button that appears in the lower right corner. The photo will expand to give you a better view and provide space for writing the caption. When you're done, click elsewhere in the collection, or just hit Escape. Alternatively, you can just use the keyboard. The arrow keys will move the current selection. Enter expands the currently selected photo to edit its caption. Escape applies the photo caption and returns to organizing.");
59 
60  stream << "</td><td valign='middle'>\n";
61  stream << " <img src='" << IMAGE_PATH << "helpImages/settingPhotoDescription.png'>\n";
62  stream << "</td></tr></table>\n";
63 
64  stream << " <p align='justify'>\n";
65  stream << HelpWindow::tr("Album Shaper provides a number of tools that operate on multiple photos at once. If you want to remove a number of photos descriptions at once, select which photos you intend to affect, and select <font color='red'>Photos &rarr; Remove Description</font>.");
66 
67  //------------------------------------------------------------------
68  stream << "</td></tr><tr><td>\n";
69  //------------------------------------------------------------------
70 
71  stream << " <table width='100%' cellpadding='4' cellspacing='0'><tr><td bgcolor='lightgray'>\n";
72  stream << " <font size='+1'><b>" << HelpWindow::tr("Album and Collection Information:") << "</b></font>\n";
73 
74  stream << " </td></tr></table>\n";
75  stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
76  stream << " <img src='" << IMAGE_PATH << "helpImages/albumInfo.png'>\n";
77  stream << "</td><td valign='middle'>\n";
78  stream << " <p align='justify'>\n";
79 
80  stream << HelpWindow::tr("At the top left your album's name, description, and author can be specified.");
81 
82  stream << "</td></tr></table>\n";
83 
84  //------------------------------------------------------------------
85  stream << "</td></tr><tr><td>\n";
86  //------------------------------------------------------------------
87 
88  stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
89  stream << " <p align='justify'>\n";
90  stream << HelpWindow::tr("To modify a collection's information, first select the collection within the collections listing on the left, then fill in its name and description at the top right.");
91  stream << "</td><td valign='middle'>\n";
92  stream << " <img src='" << IMAGE_PATH << "helpImages/collectionInfo.png'>\n";
93  stream << "</td></tr></table>\n";
94 
95  //------------------------------------------------------------------
96  stream << "</td></tr><tr><td>\n";
97  //------------------------------------------------------------------
98  stream << " <table width='100%' cellpadding='4' cellspacing='0'><tr><td bgcolor='lightgray'>\n";
99  stream << " <font size='+1'><b>" << HelpWindow::tr("Cover Images:") << "</b></font>\n";
100  stream << " </td></tr></table>\n";
101 
102  stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
103  stream << " <img src='" << IMAGE_PATH << "helpImages/setRepImage.png'>\n";
104  stream << "</td><td valign='middle'>\n";
105  stream << " <p align='justify'>\n";
106 
107  stream << HelpWindow::tr("It is easier to distinguish between albums and collections using images rather than text, and Album Shaper allows you to do that by setting album and collection cover images.");
108 
109  stream << "<p align='justify'>\n";
110 
111  stream << HelpWindow::tr("To use a photo to represent your album, drag and drop it to the left of the album name, description, and author fields. A small version of the photo should slide in from the left, and will be used when creating web galleries in the future.");
112 
113  stream << "<p align='justify'>\n";
114 
115  stream << HelpWindow::tr("A collection's cover image can be set in a similar fashion by dragging and dropping a photo to the left of the collection name and description fields. One can accomplish either of these tasks by right clicking on a photo.");
116 
117  stream << "</td></tr></table>\n";
118  //------------------------------------------------------------------
119  stream << "</td></tr><tr><td>\n";
120  //------------------------------------------------------------------
121  stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
122  stream << " <p align='justify'>\n";
123  stream << HelpWindow::tr("You can replace cover images in the future by dropping a new photo on top of the original cover image. A cover image can be removed by hovering over and clicking the red button that appears.") << "\n";
124  stream << "</td><td valign='middle'>\n";
125  stream << " <img src='" << IMAGE_PATH << "helpImages/removeCollectionImage.png'>\n";
126  stream << "</td></tr>\n";
127  //-----------------------
128  stream << "</table></font>\n";
129  stream << "</body></html>\n";
130  file.close();
131  }
132 }
133 //==============================================
QString TEMP_DIR
Definition: config.cpp:23
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition: annotating.cpp:29
QString IMAGE_PATH
Definition: config.cpp:18
static QString filename()
returns the html filename
Definition: annotating.cpp:24