AlbumShaper 1.0a3
HelpWindow Class Reference

Help window widget. More...

#include <helpWindow.h>

Inheritance diagram for HelpWindow:
Collaboration diagram for HelpWindow:

Signals

void closed ()
 

Public Member Functions

 HelpWindow (QWidget *parent=0, const char *name=0)
 
 ~HelpWindow ()
 

Private Slots

void setPage (HELP_PAGE page)
 
void showFirstSelection ()
 
void showCurrentPage ()
 
void reject ()
 

Private Member Functions

void closeEvent (QCloseEvent *e)
 

Private Attributes

ALabelbillboard
 
Q3TextBrowsercontent
 
HELP_PAGE currentPage
 
Q3MimeSourceFactory * loadingMimeSource
 

Detailed Description

Help window widget.

Definition at line 28 of file helpWindow.h.

Constructor & Destructor Documentation

◆ HelpWindow()

HelpWindow::HelpWindow ( QWidget * parent = 0,
const char * name = 0 )

Definition at line 44 of file helpWindow.cpp.

44 : QDialog(parent,name)
45{
46 //determine necessary encoding for reading and writing to html files
47 Q3TextStream::Encoding fileEncoding;
48 QString savingCharSet;
49 QString loadingCharSet;
50
51 //Mac OSX -> Use UTF16
52 #if defined(Q_OS_MACX)
53 fileEncoding = Q3TextStream::Unicode;
54 savingCharSet = "utf16";
55 loadingCharSet = "UTF-16";
56
57 //Other UNIX or Windows with Unicode support -> Use UTF8
58 #elif !defined(Q_WS_WIN) || (defined(Q_WS_WIN) && defined(UNICODE))
59 fileEncoding = Q3TextStream::UnicodeUTF8;
60 savingCharSet = "utf8";
61 loadingCharSet = "UTF-8";
62
63 //Windows without Unicode support (Win95/98/ME) -> Use Latin-1
64 #else
65 fileEncoding = Q3TextStream::Latin1;
66 savingCharSet = "latin-1";
67 loadingCharSet = "latin-1";
68 #endif
69 //-------------------------------------------------------------
70 //generate html pages
71 WhatsNew::generateHTML (fileEncoding, savingCharSet);
72 Importing::generateHTML (fileEncoding, savingCharSet);
73 Annotating::generateHTML (fileEncoding, savingCharSet);
74 Framing::generateHTML (fileEncoding, savingCharSet);
75 Enhancing::generateHTML (fileEncoding, savingCharSet);
76 ProTools::generateHTML (fileEncoding, savingCharSet);
77 Manipulating::generateHTML(fileEncoding, savingCharSet);
78 LoadSave::generateHTML (fileEncoding, savingCharSet);
79 Shortcuts::generateHTML (fileEncoding, savingCharSet);
80
81 resize( 800, 400 );
82 setPaletteBackgroundColor( QColor(255,255,255) );
83
84 //set window title
85 setCaption( tr("Album Shaper Help"));
86 //--
87 //create billboard widget
88 billboard = new ALabel( this, "helpBillboard", NULL,
90 billboard->setPixmap( QPixmap( QString(IMAGE_PATH)+"helpImages/helpBillboard.png") );
92 connect( billboard, SIGNAL(pixmapRemoved()),
93 this, SLOT(showFirstSelection()) );
94
95 //construct special mime source factory for loading html files for the contents and content frames
96 loadingMimeSource = new Q3MimeSourceFactory();
97 loadingMimeSource->setExtensionType("html",QString("text/html;charset=%1").arg(loadingCharSet) );
98
99 //create contents widget
100 Contents* contents = new Contents(fileEncoding, savingCharSet, loadingMimeSource, this);
101 connect( contents, SIGNAL(setPage(HELP_PAGE)),
102 this, SLOT(setPage(HELP_PAGE)) );
103
104 //create widget for holding content
105 content = new Q3TextBrowser( this );
106 content->setHScrollBarMode( Q3ScrollView::Auto );
107 content->setVScrollBarMode( Q3ScrollView::Auto );
108 content->setFrameStyle( Q3Frame::NoFrame );
109 content->setMimeSourceFactory( loadingMimeSource );
110
111 //PLATFORM_SPECIFIC_CODE
112 //mac os x puts in a size grip that can interfere with the updates icon, in order
113 //to avoid this we manually place the size grip ourselves
114 //windows users expect a grip too, but qt doesn't put one in by default. we'll add
115 //it for them too. :-)
116#if defined(Q_OS_MACX) || defined(Q_OS_WIN)
117 content->setCornerWidget( new QSizeGrip(this) );
118#endif
119
120 content->hide();
121 //--
122 //place items in grid layout
123 Q3GridLayout* grid = new Q3GridLayout( this, 4, 3, 0);
124 grid->addMultiCellWidget( billboard, 0,2, 0,0, Qt::AlignHCenter | Qt::AlignTop );
125 grid->addWidget( contents, 1,1 );
126 grid->addMultiCellWidget( content, 0,2, 2,2 );
127
128 grid->setRowSpacing( 0, QMAX(billboard->sizeHint().height() -
129 contents->minimumSizeHint().height(), 0)/2 );
130 grid->setColSpacing( 1, contents->minimumSizeHint().width() );
131 grid->setRowStretch( 1, 1 );
132 grid->setColStretch( 2, 1 );
133 //--
134 //PLATFORM_SPECIFIC_CODE - Close Button
135#if (!defined(Q_OS_WIN) && !defined(Q_OS_MACX))
136 QPushButton* closeButton = new QPushButton( tr("Close"), this );
137 closeButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
138 closeButton->setDefault(true);
139 connect( closeButton, SIGNAL(clicked()), SLOT(close()) );
140 grid->addMultiCellWidget( closeButton, 3,3, 0,2, Qt::AlignCenter );
141#endif
142 //--
143}
#define SLIDE_OUT_LEFT
Definition ALabel.h:21
#define APPEAR_IMMEDIATELY
Definition ALabel.h:18
void setPixmap(const QPixmap &p)
animates setting an image
Definition ALabel.cpp:81
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
QSize minimumSizeHint() const
Definition contents.cpp:61
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition enhancing.cpp:29
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition framing.cpp:29
void setPage(HELP_PAGE page)
Q3TextBrowser * content
Definition helpWindow.h:49
ALabel * billboard
Definition helpWindow.h:48
HELP_PAGE currentPage
Definition helpWindow.h:51
Q3MimeSourceFactory * loadingMimeSource
Definition helpWindow.h:53
void showFirstSelection()
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition importing.cpp:29
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition loadSave.cpp:29
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition proTools.cpp:29
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the shortcuts html file
static void generateHTML(Q3TextStream::Encoding type, QString charSet)
generates the html file
Definition whatsNew.cpp:29
QString IMAGE_PATH
Definition config.cpp:18
HELP_PAGE
Contents window widget.
Definition contents.h:25
@ BILLBOARD
Definition contents.h:26

References APPEAR_IMMEDIATELY, BILLBOARD, billboard, content, currentPage, Annotating::generateHTML(), Enhancing::generateHTML(), Framing::generateHTML(), Importing::generateHTML(), LoadSave::generateHTML(), Manipulating::generateHTML(), ProTools::generateHTML(), Shortcuts::generateHTML(), WhatsNew::generateHTML(), IMAGE_PATH, loadingMimeSource, Contents::minimumSizeHint(), setPage(), ALabel::setPixmap(), showFirstSelection(), and SLIDE_OUT_LEFT.

◆ ~HelpWindow()

HelpWindow::~HelpWindow ( )

Definition at line 145 of file helpWindow.cpp.

146{
147 delete loadingMimeSource;
148 loadingMimeSource = NULL;
149}

References loadingMimeSource.

Member Function Documentation

◆ closed

void HelpWindow::closed ( )
signal

Referenced by closeEvent(), and reject().

◆ closeEvent()

void HelpWindow::closeEvent ( QCloseEvent * e)
private

Definition at line 151 of file helpWindow.cpp.

152{
153 QWidget::closeEvent( e );
154 emit closed();
155}
void closed()

References closed().

◆ reject

void HelpWindow::reject ( )
privateslot

Definition at line 157 of file helpWindow.cpp.

158{
159 QDialog::reject();
160 emit closed();
161}

References closed().

◆ setPage

void HelpWindow::setPage ( HELP_PAGE page)
privateslot

Definition at line 163 of file helpWindow.cpp.

164{
165 //if billboard stillshown first remove it.
166 if( currentPage == BILLBOARD )
167 {
169 currentPage = page;
170
171 //show page only once billboard has finished sliding away to the left
172 }
173 else
174 {
175 currentPage = page;
177 }
178}
void removePixmap(bool forceImmediate=false)
animates removing an image
Definition ALabel.cpp:136
void showCurrentPage()

References BILLBOARD, billboard, currentPage, ALabel::removePixmap(), and showCurrentPage().

Referenced by HelpWindow().

◆ showCurrentPage

void HelpWindow::showCurrentPage ( )
privateslot

Definition at line 186 of file helpWindow.cpp.

187{
189 content->setSource( Shortcuts::filename() );
190 else if( currentPage == WHATS_NEW )
191 content->setSource( WhatsNew::filename() );
192
194 content->setSource( Importing::filename() );
195 else if( currentPage == ANNOTATING_ALBUMS )
196 content->setSource( Annotating::filename() );
197 else if( currentPage == FRAMING )
198 content->setSource( Framing::filename() );
199 else if( currentPage == ENHANCING )
200 content->setSource( Enhancing::filename() );
201 else if( currentPage == PRO_TOOLS )
202 content->setSource( ProTools::filename() );
203 else if( currentPage == MANIPULATING )
204 content->setSource( Manipulating::filename() );
205 else if( currentPage == SAVING_AND_LOADING )
206 content->setSource( LoadSave::filename() );
207 else
208 content->setText("");
209
210 content->setFocus();
211}
static QString filename()
returns the html filename
static QString filename()
returns the html filename
Definition enhancing.cpp:24
static QString filename()
returns the html filename
Definition framing.cpp:24
static QString filename()
returns the html filename
Definition importing.cpp:24
static QString filename()
returns the html filename
Definition loadSave.cpp:24
static QString filename()
returns the html filename
static QString filename()
returns the html filename
Definition proTools.cpp:24
static QString filename()
returns the shortcuts html filename
static QString filename()
returns the html filename
Definition whatsNew.cpp:24
@ WHATS_NEW
Definition contents.h:27
@ MANIPULATING
Definition contents.h:33
@ FRAMING
Definition contents.h:30
@ IMPORTING_AND_ORGANIZING
Definition contents.h:28
@ PRO_TOOLS
Definition contents.h:32
@ SAVING_AND_LOADING
Definition contents.h:34
@ ANNOTATING_ALBUMS
Definition contents.h:29
@ KEYBOARD_SHORTCUTS
Definition contents.h:35
@ ENHANCING
Definition contents.h:31

References ANNOTATING_ALBUMS, content, currentPage, ENHANCING, Annotating::filename(), Enhancing::filename(), Framing::filename(), Importing::filename(), LoadSave::filename(), Manipulating::filename(), ProTools::filename(), Shortcuts::filename(), WhatsNew::filename(), FRAMING, IMPORTING_AND_ORGANIZING, KEYBOARD_SHORTCUTS, MANIPULATING, PRO_TOOLS, SAVING_AND_LOADING, and WHATS_NEW.

Referenced by setPage(), and showFirstSelection().

◆ showFirstSelection

void HelpWindow::showFirstSelection ( )
privateslot

Definition at line 180 of file helpWindow.cpp.

181{
182 content->show();
184}

References content, and showCurrentPage().

Referenced by HelpWindow().

Member Data Documentation

◆ billboard

ALabel* HelpWindow::billboard
private

Definition at line 48 of file helpWindow.h.

Referenced by HelpWindow(), and setPage().

◆ content

Q3TextBrowser* HelpWindow::content
private

Definition at line 49 of file helpWindow.h.

Referenced by HelpWindow(), showCurrentPage(), and showFirstSelection().

◆ currentPage

HELP_PAGE HelpWindow::currentPage
private

Definition at line 51 of file helpWindow.h.

Referenced by HelpWindow(), setPage(), and showCurrentPage().

◆ loadingMimeSource

Q3MimeSourceFactory* HelpWindow::loadingMimeSource
private

Definition at line 53 of file helpWindow.h.

Referenced by HelpWindow(), and ~HelpWindow().


The documentation for this class was generated from the following files: