void KMahjongg::showHighscores() { KScoreDialog ksdialog(KScoreDialog::Name | KScoreDialog::Time, this); const QString layoutName = m_boardLayout->authorProperty("Name"); ksdialog.setConfigGroup(qMakePair(QByteArray(layoutName.toUtf8()), layoutName)); ksdialog.exec(); }
void MainWindow::highscores() { #ifndef Q_OS_QNX KScoreDialog ksdialog(KScoreDialog::Name | KScoreDialog::Time, this); ksdialog.addLocalizedConfigGroupNames(KGameDifficulty::localizedLevelStrings()); //Add all the translations of the group names ksdialog.setConfigGroupWeights(KGameDifficulty::levelWeights()); ksdialog.setConfigGroup(KGameDifficulty::localizedLevelString()); ksdialog.exec(); #endif }
void KBlocksWin::onIsHighscore(int index, int points, int level) { if (index == 0) // TODO : game id?? multi game display?? { KScoreDialog ksdialog( KScoreDialog::Name | KScoreDialog::Level | KScoreDialog::Score, this ); ksdialog.initFromDifficulty(Kg::difficulty()); KScoreDialog::FieldInfo info; info[KScoreDialog::Score].setNum( points ); info[KScoreDialog::Level].setNum( level ); if ( ksdialog.addScore( info ) ) { ksdialog.exec(); } } }
void MainWindow::gameOver(int time) { #ifndef Q_OS_QNX stateChanged("playing", KXMLGUIClient::StateReverse); KScoreDialog ksdialog(KScoreDialog::Name, this); ksdialog.addLocalizedConfigGroupNames(KGameDifficulty::localizedLevelStrings()); //Add all the translations of the group names ksdialog.setConfigGroupWeights(KGameDifficulty::levelWeights()); ksdialog.setConfigGroup(m_lastUsedDifficulty); KScoreDialog::FieldInfo scoreInfo; scoreInfo[KScoreDialog::Score].setNum(time); if (ksdialog.addScore(scoreInfo, KScoreDialog::AskName)) { ksdialog.exec(); } #else Q_UNUSED(time) #endif }
void MainWindow::gameEndSlot() { KScoreDialog ksdialog( KScoreDialog::Name, this ); ksdialog.addScore( scoreNumber->value() ); ksdialog.exec(); centralTable->closeGame(); nextShapeTable->gameWasClosed(); removedLinesNumber->display( 0 ); setEnabledMoveActions( false ); closeGameAction->setEnabled( false ); pauseAction->setEnabled( false ); }
void KBlocksWin::showHighscore() { KScoreDialog ksdialog(KScoreDialog::Name | KScoreDialog::Level | KScoreDialog::Score, this); ksdialog.initFromDifficulty(Kg::difficulty()); ksdialog.exec(); }
//Show the highscores void MainWindow::showHighscoresSlot() { KScoreDialog ksdialog( KScoreDialog::Name, this ); ksdialog.exec(); }