From kde-commits Fri Aug 31 21:20:12 2007 From: =?utf-8?q?Ga=C3=ABl=20de=20Chalendar?= Date: Fri, 31 Aug 2007 21:20:12 +0000 To: kde-commits Subject: playground/games/ksirk/ksirk Message-Id: <1188595212.652656.31573.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=118859522527521 SVN commit 707051 by kleag: EBN fixes M +1 -1 Dialogs/kplayersetupdialog.cpp M +2 -0 GameLogic/aiColsonPlayer.cpp M +2 -2 GameLogic/gameautomaton.cpp M +3 -3 GameLogic/goal.cpp M +1 -1 GameLogic/onu.cpp M +4 -4 Sprites/animsprite.cpp M +19 -20 gestionSprites.cpp M +12 -12 kgamewin.cpp --- trunk/playground/games/ksirk/ksirk/Dialogs/kplayersetupdialog.cpp #707050:707051 @@ -100,7 +100,7 @@ // Name is not unique KMessageBox::error(this, "
" + i18n("Error") + "
" + - i18n("Player %1, you have to choose another name!
%2 is not unique.",number,LineEdit2->text()) + + i18n("Player %1, you have to choose another name!
%2 is not unique.",number,LineEdit2->text()) + "
", i18n("Error")); } else { --- trunk/playground/games/ksirk/ksirk/GameLogic/aiColsonPlayer.cpp #707050:707051 @@ -478,7 +478,9 @@ { std::vector::iterator contIt(m_world->getContinents().begin()); std::vector::iterator contIt_end(m_world->getContinents().end()); +#ifdef __GNUC__ #warning continent can not be 0 in this code path - everything in this for loop is dead code +#endif for (;(contIt!=contIt_end) && (continent==0);contIt++) { const Continent* cont = *contIt; --- trunk/playground/games/ksirk/ksirk/GameLogic/gameautomaton.cpp #707050:707051 @@ -1024,7 +1024,7 @@ if (nations.size() < 2) { QString mes = ""; - mes = i18n("Error - 2 nations minimum. Got %.1",nations.size()); + mes = i18nc("@info Report the wrong number of nations given", "Error - 2 nations minimum. Got %1.",nations.size()); KMessageBox::error(m_game, mes, i18n("Fatal Error!")); exit(1); } @@ -1439,7 +1439,7 @@ { mes = i18n("Error - Player %1, you have to choose a name.", 1); KMessageBox::sorry(m_game, mes, i18n("Error")); - nomEntre = i18n("Player%1", 1); + nomEntre = i18nc("@info Forged player name", "Player%1", 1); } else { --- trunk/playground/games/ksirk/ksirk/GameLogic/goal.cpp #707050:707051 @@ -267,17 +267,17 @@ QString joint; if (it_next==it_end) { - joint = " and "; + joint = i18n(" and "); } else { - joint = ", "; + joint = i18n(", "); } if (*it != 0) { Continent* continent = const_cast(m_automaton->game()->theWorld()->continentWithId(*it)); int nb = continent->getMembers().size() - continent->countriesOwnedBy(m_player).size(); - mes += joint + i18n("%1 in %2",nb,continent->name()); + mes += joint + i18nc("@info An element of the enumeration of the number of countries in the given continent", "%1 in %2",nb,continent->name()); } it++; } --- trunk/playground/games/ksirk/ksirk/GameLogic/onu.cpp #707050:707051 @@ -386,7 +386,7 @@ */ Country* ONU::countryNamed(const QString& name) { - if (name == "") + if (name.isEmpty()) { return 0; } --- trunk/playground/games/ksirk/ksirk/Sprites/animsprite.cpp #707050:707051 @@ -27,11 +27,11 @@ #include "GameLogic/gameautomaton.h" #include "GameLogic/onu.h" -#include -#include +#include #include #include +#include #include #include #include @@ -479,7 +479,7 @@ return backGnd-> pixmap().width(); else { - QMessageBox::critical(0, I18N_NOOP("Error !"), I18N_NOOP("Cannot find Max X for sprite: no background !")); + KMessageBox::error(0, i18n("Cannot find Max X for sprite: no background !"), i18n("Error !")); exit(2); } } @@ -494,7 +494,7 @@ return backGnd-> pixmap().height(); else { - QMessageBox::critical(0, I18N_NOOP("Error !"), I18N_NOOP("Cannot find Max Y for sprite: no background !")); + KMessageBox::error(0, i18n("Cannot find Max Y for sprite: no background !"), i18n("Error !")); exit(2); } } --- trunk/playground/games/ksirk/ksirk/gestionSprites.cpp #707050:707051 @@ -22,12 +22,23 @@ * KGameWindow methods for sprites handling function of the state */ +// application specific includes +#include "kgamewin.h" +#include "Sprites/backgnd.h" +#include "ksirksettings.h" +#include "Sprites/animspritesgroup.h" +#include "Sprites/cannonsprite.h" +#include "Sprites/cavalrysprite.h" +#include "Sprites/infantrysprite.h" +#include "Sprites/skinSpritesData.h" +#include "GameLogic/KMessageParts.h" +#include "GameLogic/onu.h" + // include files for QT #include #include #include #include -#include #include #include #include // pour pouvoir utiliser qDebug() @@ -44,18 +55,6 @@ #include #include -// application specific includes -#include "kgamewin.h" -#include "Sprites/backgnd.h" -#include "ksirksettings.h" -#include "Sprites/animspritesgroup.h" -#include "Sprites/cannonsprite.h" -#include "Sprites/cavalrysprite.h" -#include "Sprites/infantrysprite.h" -#include "Sprites/skinSpritesData.h" -#include "GameLogic/KMessageParts.h" -#include "GameLogic/onu.h" - namespace Ksirk { using namespace GameLogic; @@ -233,7 +232,7 @@ QString sndRoulePath = m_dirs-> findResource("appdata", m_automaton->skin() + "/Sounds/roule.wav"); if (sndRoulePath.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Sound roule not found - Verify your installation\nProgram cannot continue")); + KMessageBox::error(0, i18n("Sound roule not found - Verify your installation
Program cannot continue"), i18n("Error !")); exit(2); } m_audioPlayer->setCurrentSource(sndRoulePath); @@ -257,7 +256,7 @@ sndRoulePath = m_dirs-> findResource("appdata", m_automaton->skin() + "/Sounds/roule.wav"); if (sndRoulePath.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Sound roule not found - Verify your installation\nProgram cannot continue")); + KMessageBox::error(0, i18n("Sound roule not found - Verify your installation
Program cannot continue"), i18n("Error !")); exit(2); } m_audioPlayer->setCurrentSource(sndRoulePath); @@ -301,8 +300,8 @@ QString sndCanonPath = m_dirs-> findResource("appdata", m_automaton->skin() + "/Sounds/canon.wav"); if (sndCanonPath.isNull()) { - QMessageBox::critical(0, i18n("Error !"), - i18n("Sound canon not found - Verify your installation\nProgram cannot continue")); + KMessageBox::error(0, + i18n("Sound canon not found - Verify your installation
Program cannot continue"), i18n("Error !")); exit(2); } if (KsirkSettings::soundEnabled()) @@ -444,7 +443,7 @@ QString sndRoulePath = m_dirs-> findResource("appdata", m_automaton->skin() + "/Sounds/roule.wav"); if (sndRoulePath.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Sound roule not found - Verify your installation\nProgram cannot continue")); + KMessageBox::error(0, i18n("Sound roule not found - Verify your installation
Program cannot continue"), i18n("Error !")); exit(2); } m_audioPlayer->setCurrentSource(sndRoulePath); @@ -479,7 +478,7 @@ QString sndRoulePath = m_dirs-> findResource("appdata", m_automaton->skin() + "/Sounds/roule.wav"); if (sndRoulePath.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Sound roule not found - Verify your installation\nProgram cannot continue")); + KMessageBox::error(0, i18n("Sound roule not found - Verify your installation
Program cannot continue"), i18n("Error !")); exit(2); } m_audioPlayer->setCurrentSource(sndRoulePath); @@ -490,7 +489,7 @@ } //Attaquant ET Defenseur detruits else // error { - QMessageBox::critical(0, i18n("Error !"), i18n("who should be 0, 1 or 2.")); + kError() << k_funcinfo << __FILE__ << __LINE__ << i18n("Bug: who should be 0, 1 or 2."); exit(1); } } --- trunk/playground/games/ksirk/ksirk/kgamewin.cpp #707050:707051 @@ -110,7 +110,7 @@ QString iconFileName = m_dirs-> findResource("appdata", m_automaton->skin() + "/Images/SoldatAGenoux1.png"); if (iconFileName.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Cannot load icon\nProgram cannot continue")); + KMessageBox::error(0, i18n("Cannot load icon
Program cannot continue"), i18n("Error !")); exit(2); } QPixmap icon(iconFileName); @@ -201,7 +201,7 @@ // kDebug() << "Trying to load button image file: " << imageFileName << endl; if (imageFileName.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Cannot load button image\nProgram cannot continue")); + KMessageBox::error(0, i18n("Cannot load button image
Program cannot continue"), i18n("Error !")); exit(2); } QAction* joinAction = new QAction(QIcon(QPixmap(imageFileName)), @@ -350,8 +350,8 @@ } if (onuDefinitionFileName.isEmpty()) { - QMessageBox::critical(0, i18n("Error !"), - i18n("UNO definition XML file not found - Verify your installation\nProgram cannot continue")); + KMessageBox::error(0, + i18n("UNO definition XML file not found - Verify your installation
Program cannot continue"), i18n("Error !")); exit(2); } kDebug() << "Got ONU definition file name: " << onuDefinitionFileName << endl; @@ -386,7 +386,7 @@ QString iconFileName = m_dirs-> findResource("appdata", m_automaton->skin() + "/Images/SoldatAGenoux1.png"); if (iconFileName.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Cannot load icon\nProgram cannot continue")); + KMessageBox::error(0, i18n("Cannot load icon
Program cannot continue"), i18n("Error !")); exit(2); } // to port : still necessary ? @@ -926,7 +926,7 @@ // kDebug() << "Trying to load button image file: " << imageFileName << endl; if (imageFileName.isNull()) { - QMessageBox::critical(0, i18n("Error !"), i18n("Cannot load button image\nProgram cannot continue")); + KMessageBox::error(0, i18n("Cannot load button image
Program cannot continue"), i18n("Error !")); exit(2); } KToolBar* toolBar; @@ -1103,8 +1103,8 @@ if (nomEntre.isEmpty()) { mes = i18n("Error - Player %1, you have to choose a name.", 1); - QMessageBox::warning(this, i18n("Error"), mes); - nomEntre = i18n("Player%1", 1); + KMessageBox::sorry(this, mes, i18n("Error")); + nomEntre = i18nc("@info Forged player name", "Player%1", 1); } else { @@ -1961,7 +1961,7 @@ kDebug() << "nextPlayerRecycling" << endl; if ( currentPlayer() && currentPlayer()-> getNbAvailArmies() > 0 ) { - QMessageBox::information(0, "KsirK", i18n("You must distribute\nall your armies")); + KMessageBox::sorry(0, i18n("You must distribute\nall your armies"), i18n("KsirK")); return false; } else @@ -2430,7 +2430,7 @@ // QString newGameImageFileName = m_dirs-> findResource("appdata", m_automaton->skin() + '/' + CM_NEWGAME); // if (newGameImageFileName.isNull()) // { -// QMessageBox::critical(0, i18n("Error !"), i18n("Cannot load button image\nProgram cannot continue")); +// KMessageBox::errot(0, i18n("Cannot load button image\nProgram cannot continue"), i18n("Error !")); // exit(2); // } // QPixmap newGameButtonPix(newGameImageFileName); @@ -2441,7 +2441,7 @@ // QString joinGameImageFileName = m_dirs-> findResource("appdata", m_automaton->skin() + '/' + CM_NEWNETGAME); // if (joinGameImageFileName.isNull()) // { -// QMessageBox::critical(0, i18n("Error !"), i18n("Cannot load button image\nProgram cannot continue")); +// KMessageBox::error(0, i18n("Cannot load button image\nProgram cannot continue"), i18n("Error !")); // exit(2); // } // QPixmap joinGameButtonPix(joinGameImageFileName); @@ -2452,7 +2452,7 @@ // QString openGameImageFileName = m_dirs-> findResource("appdata", m_automaton->skin() + '/' + CM_OPENGAME); // if (openGameImageFileName.isNull()) // { -// QMessageBox::critical(0, i18n("Error !"), i18n("Cannot load button image\nProgram cannot continue")); +// KMessageBox::error(0, i18n("Cannot load button image\nProgram cannot continue"), i18n("Error !")); // exit(2); // } // QPixmap openGameButtonPix(openGameImageFileName);