1 #include "helpwindow.h"
2 #include "ui_helpwindow.h"
9 HelpWindow::HelpWindow(QWidget *parent) :
11 ui(new Ui::HelpWindow)
13 //this is a stacked window on Maemo 5
14 #if defined(Q_WS_MAEMO_5)
15 //setAttribute(Qt::WA_Maemo5StackedWindow);
23 HelpWindow::~HelpWindow()
30 * Assigns the help text to the QTextEdit
32 void HelpWindow::setHelpText()
34 //get the current locale name for lacalized help messages
35 QString locale = QLocale::system().name();
38 QFile help( ":/txt/help_" + locale );
41 if ( !help.exists() || !help.open( QIODevice::ReadOnly ) ) {
42 //try to open the file in english language instead
43 help.setFileName(":/txt/help_en");
44 if ( !help.exists() || !help.open( QIODevice::ReadOnly ) ) {
45 QMessageBox::critical(this, tr("QCPUFreq"), tr("Cannot open help file!"));
51 QTextStream in( &help );
56 } while ( !in.atEnd() );
58 ui->textEdit->setText( txt );