Skip to content

Commit

Permalink
Added help menu item.
Browse files Browse the repository at this point in the history
  • Loading branch information
FBergeron committed Sep 9, 2009
1 parent 77626b4 commit 8bce3c5
Show file tree
Hide file tree
Showing 10 changed files with 543 additions and 5 deletions.
12 changes: 12 additions & 0 deletions i18n/de/toMOTko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@
<source>NR: %1 day(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Help...</source>
<translation>Hilfe...</translation>
</message>
<message>
<source>NoTermsMarkedForStudy</source>
<translation type="unfinished">Keine Wörter in den gewählten Sprachen zum Lernen gewählt. Das Quiz kann nicht beginnen. Benutzen Sie die Glossarverwaltung um Wörter zu wählen.</translation>
</message>
<message>
<source>NoTermsScheduledForStudy</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PreferencesDialog</name>
Expand Down
18 changes: 18 additions & 0 deletions i18n/en/toMOTko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ Do you want to resume this quiz?</translation>
<source>NR: %1 day(s)</source>
<translation>NR: %1 day(s)</translation>
</message>
<message>
<source>Help...</source>
<translation>Help...</translation>
</message>
<message>
<source>NoTermsMarkedForStudy</source>
<translation type="unfinished">No terms have been marked for study
for the specified languages.
The quiz cannot start.
Use the Glossary Manager to select
the terms you want to study.</translation>
</message>
<message>
<source>NoTermsScheduledForStudy</source>
<translation type="unfinished">No terms are scheduled today
for study for the selected
languages.</translation>
</message>
</context>
<context>
<name>PreferencesDialog</name>
Expand Down
16 changes: 16 additions & 0 deletions i18n/es/toMOTko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,22 @@ continuar este quiz?</translation>
<source>NR: %1 day(s)</source>
<translation>PR: %1 dia(s)</translation>
</message>
<message>
<source>Help...</source>
<translation>Ayuda...</translation>
</message>
<message>
<source>NoTermsMarkedForStudy</source>
<translation type="unfinished">No hay palabras selectionadas.
El testo no puede empezar.
Usa el Administrador de glosarios
para seleccionar palabras a estudiar.</translation>
</message>
<message>
<source>NoTermsScheduledForStudy</source>
<translation type="unfinished">No hay palabras hoy para memorizar
por los idiomas selectionados.</translation>
</message>
</context>
<context>
<name>PreferencesDialog</name>
Expand Down
18 changes: 18 additions & 0 deletions i18n/fr/toMOTko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ Voulez-vous continuer ce quiz?</translation>
<source>NR: %1 day(s)</source>
<translation>PR: %1 jour(s)</translation>
</message>
<message>
<source>Help...</source>
<translation>Aide...</translation>
</message>
<message>
<source>NoTermsMarkedForStudy</source>
<translation type="unfinished">Le Quiz ne peut débuter car
vous n&apos;avez spécifié aucun
mot à étudier. Utilisez
le Gestionnaire de glossaires
et cochez les mots désirés.</translation>
</message>
<message>
<source>NoTermsScheduledForStudy</source>
<translation type="unfinished">L&apos;horaire ne prévoit aucun mot à
étudier aujourd&apos;hui pour les
langues sélectionnées.</translation>
</message>
</context>
<context>
<name>PreferencesDialog</name>
Expand Down
12 changes: 12 additions & 0 deletions i18n/ja/toMOTko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@
<source>NR: %1 day(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Help...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>NoTermsMarkedForStudy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>NoTermsScheduledForStudy</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PreferencesDialog</name>
Expand Down
12 changes: 12 additions & 0 deletions i18n/zh/toMOTko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@
<source>NR: %1 day(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Help...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>NoTermsMarkedForStudy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>NoTermsScheduledForStudy</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PreferencesDialog</name>
Expand Down
17 changes: 14 additions & 3 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "MainWindow.h"
#include "icons/about.xpm"
#include "icons/help.xpm"
#include "icons/startQuiz.xpm"
#include "icons/glossaryManager.xpm"
#include "icons/import.xpm"
Expand Down Expand Up @@ -194,8 +195,8 @@ MainWindow::MainWindow( Controller* controller )

helpMenu = new QPopupMenu( this );
menuBar->insertItem( tr( "?" ), helpMenu );
helpMenu->insertItem( ZPIXMAP( about_xpm ), tr( "About..." ), this, SLOT( about() ) );
helpMenu->insertSeparator( 1 );
helpMenuItemId = helpMenu->insertItem( ZPIXMAP( help_xpm ), tr( "Help..." ), this, SLOT( help() ) );
helpMenu->insertSeparator();

languageActionGroup = new QActionGroup( this );

Expand Down Expand Up @@ -243,6 +244,9 @@ MainWindow::MainWindow( Controller* controller )
langAction->setOn( true );
}

helpMenu->insertSeparator();
aboutMenuItemId = helpMenu->insertItem( ZPIXMAP( about_xpm ), tr( "About..." ), this, SLOT( about() ) );

connect( quizFrame, SIGNAL( quizShown() ), quizStatusPanel, SLOT( show() ) );
connect( quizFrame, SIGNAL( quizShown() ), languageSelectorPanel, SLOT( hide() ) );
connect( quizFrame, SIGNAL( quizHidden() ), quizStatusPanel, SLOT( hide() ) );
Expand Down Expand Up @@ -389,7 +393,8 @@ void MainWindow::retranslateUi() {
pasteAction->setText( QObject::tr( "Paste" ) );
pasteAction->setMenuText( QObject::tr( "Paste" ) );

helpMenu->changeItem( helpMenu->idAt( 0 ), tr( "About..." ) );
helpMenu->changeItem( helpMenuItemId, tr( "Help..." ) );
helpMenu->changeItem( aboutMenuItemId, tr( "About..." ) );

updateEasinessFactor( control->getQuizCurrentTermEasinessFactor() );
updateNextRepetition( control->getQuizCurrentTermNextRepetition() );
Expand Down Expand Up @@ -458,6 +463,12 @@ void MainWindow::about() {
QMessageBox::about( this, tr( "AboutToMOTko..." ), tr( "AboutMessage" ) );
}

void MainWindow::help() {
QString helpFile = (((QPEApplication*)qApp)->qpeDir()+ "help/en/html/toMOTko.html" );
QCopEnvelope helpEnv( "QPE/Application/helpbrowser", "showFile(QString)" );
helpEnv << helpFile;
}

void MainWindow::startQuiz() {
if( mainPanel->visibleWidget() == quizFrame )
quizFrame->restartQuiz();
Expand Down
4 changes: 4 additions & 0 deletions src/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <qmessagebox.h>
#include <qpe/fileselector.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpixmap.h>
Expand Down Expand Up @@ -75,6 +76,7 @@ public slots:
private slots:

void about();
void help();
void startQuiz();
void showQuiz();
void invokeVocabularyManager();
Expand All @@ -100,6 +102,8 @@ private slots:

QMap<QString,QString> availableLanguages;

int helpMenuItemId;
int aboutMenuItemId;
int editionMenuId;
int viewMenuId;
int showAllVocabSeparatorId;
Expand Down
Loading

0 comments on commit 8bce3c5

Please sign in to comment.