X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fhelp.cpp;h=da2900954189995673e5b7a7e8089417b62b7ae6;hb=80871c4045dd1aa9b60e03b9cc92e7d2835a2387;hp=8bafe985bfccf48dcd60b5134b831f59729aec93;hpb=ee44841002db3b2475ce02619d141aee6631242b;p=virtualjaguar diff --git a/src/gui/help.cpp b/src/gui/help.cpp index 8bafe98..da29009 100644 --- a/src/gui/help.cpp +++ b/src/gui/help.cpp @@ -9,6 +9,7 @@ // Who When What // --- ---------- ------------------------------------------------------------- // JLH 08/01/2011 Created this file +// JLH 10/08/2011 Added Esc & Return as exit keys // // STILL TO DO: @@ -16,58 +17,25 @@ #include "help.h" + HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog) { setWindowTitle(tr("Virtual Jaguar Help")); // Need to set the size as well... -// resize(560, 480); resize(560, 480); layout = new QVBoxLayout(); // layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); -// image = new QLabel(); -// image->setAlignment(Qt::AlignRight); -// image->setPixmap(QPixmap(":/res/vj_title_small.png")); -// layout->addWidget(image); - -// QString s = QString(tr("SVN %1
")).arg(__DATE__); - QString s;// = QString(""); - s.append(tr( - "

Virtual Jaguar Documentation

" - "
" - "Coming soon!" - )); text = new QTextBrowser; - text->setHtml(s); + text->setSource(QUrl("qrc:/res/help.html")); layout->addWidget(text); } - -#if 0 -#include "htmlviewer.moc" -HtmlViewerWindow *htmlViewerWindow; - -HtmlViewerWindow::HtmlViewerWindow() { - setObjectName("html-window"); - resize(560, 480); - setGeometryString(&config().geometry.htmlViewerWindow); - application.windowList.add(this); - - layout = new QVBoxLayout; - layout->setMargin(Style::WindowMargin); - layout->setSpacing(0); - setLayout(layout); - - document = new QTextBrowser; - layout->addWidget(document); -} - -void HtmlViewerWindow::show(const char *title, const char *htmlData) { - document->setHtml(string() << htmlData); - setWindowTitle(title); - Window::show(); +void HelpWindow::keyPressEvent(QKeyEvent * e) +{ + if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) + hide(); } -#endif