AlbumShaper  1.0a3
proTools.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 "proTools.h"
20 #include "helpWindow.h"
21 #include "../../config.h"
22 
23 //==============================================
25 {
26  return QString("%1/proTools.html").arg(TEMP_DIR);
27 }
28 //==============================================
29 void ProTools::generateHTML(Q3TextStream::Encoding type, QString charSet)
30 {
31  QString ctrlKey;
32 #if defined(Q_OS_MACX)
33  ctrlKey = "Command";
34 #else
35  ctrlKey = "Ctrl";
36 #endif
37 
38  //create/open html file
39  QFile file( filename() );
40  if(file.open(QIODevice::WriteOnly))
41  {
42  //-----
43  Q3TextStream stream;
44  stream.setEncoding( type );
45  stream.setDevice( &file );
46  //-----
47  stream << "<html><head>\n";
48  stream << "<meta http-equiv='Content-Type' content='text/html; charset=" << charSet << "'>\n";
49  stream << "</head><body>\n";
50  stream << "<table cellpadding='4'><tr>\n";
51  stream << "<td><img src='" << IMAGE_PATH << "helpImages/asHelpLogoSmall.png'></td>\n";
52  stream << "<td valign='middle'><font face='Arial, sans-serif' size='+3'>";
53  stream << HelpWindow::tr("Pro Tools") << "</font></td>\n";
54  stream << "</tr></table>\n";
55  stream << "<font face='Arial, sans-serif'>\n";
56 
57  stream << "<table cellspacing='10' cellpadding='0'><tr><td>\n";
58 
59  stream << "<table width='100%' cellpadding='4' cellspacing='0'><tr><td bgcolor='lightgray'>\n";
60  stream << "<font size='+1'><b>" << HelpWindow::tr("Histogram Editing, Brightness, and Contrast:") << "</b></font>\n";
61  stream << "</td></tr></table>\n";
62 
63  stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
64  stream << "<p align='justify'>\n";
65  stream << HelpWindow::tr("Sometimes the quick-fix techniques just don't work. Noisy or grainy images are often the culprits.") << "\n";
66  stream << "<p align='justify'>\n";
67  stream << HelpWindow::tr("Album Shaper provides an advanced levels editor for fixing the color and luminosity ranges, in addition to changing overall photo brightness and contrast. Red, green, blue, and luminosity ranges can be adjusted by dragging their boundaries or selecting a new range. Brightness and contrast changes can be undone independently by clicking the respective icons below each slider.") << "\n";
68  stream << "<p align='justify'>\n";
69  stream << HelpWindow::tr("Album Shaper's novel split-view interface lets you compare the modified image to the original side by side in real time. You can even drag this split back and forth.") << "\n";
70  stream << "<p align='justify'>\n";
71  stream << QString(HelpWindow::tr("If you prefer to look at just the adjusted or original image form, change the view mode with the drop down menu below the image. You can also switch between the two versions of the image instantly by pressing and holding the %1 key.")).arg(ctrlKey) << "\n";
72  stream << "</td><td valign='middle'>\n";
73  stream << "<img src='" << IMAGE_PATH << "helpImages/levelsEditor.png'>\n";
74  stream << "</td></tr></table>\n";
75 
76  stream << "</td></tr><tr><td>\n";
77 
78  stream << "<table width='100%' cellpadding='4' cellspacing='0'><tr><td bgcolor='lightgray'>\n";
79  stream << "<font size='+1'><b>" << HelpWindow::tr("Grain Enhancement:") << "</b></font>\n";
80  stream << "</td></tr></table>\n";
81 
82  stream << "<table cellpadding='4' cellspacing='0'><tr><td valign='middle'>\n";
83  stream << "<img src='" << IMAGE_PATH << "helpImages/grainEditor.png'>\n";
84  stream << "</td><td valign='middle'>\n";
85  stream << "<p align='justify'>\n";
86  stream << HelpWindow::tr("Album Shaper provides a grain editor that can blur and sharpen images without magnifying image noise. Drag the slider up to sharpen or down to blur. You can change which portion of the image is being shown up close by dragging around the view control area at the right.") << "\n";
87  stream << "</td></tr></table>\n";
88 
89  stream << "</font>\n";
90  stream << "</body></html>\n";
91  file.close();
92  }
93 }
94 //==============================================
QString TEMP_DIR
Definition: config.cpp:23
QString IMAGE_PATH
Definition: config.cpp:18
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition: proTools.cpp:29
static QString filename()
returns the html filename
Definition: proTools.cpp:24