Commit 462b9a10 authored by Laurent Montel's avatar Laurent Montel 😁

kdelibs4support--

parent 4151641f
......@@ -46,7 +46,7 @@
#include <ktogglefullscreenaction.h>
#include <kstandardaction.h>
#include <kstandardgameaction.h>
#include <kicon.h>
#include <QIcon>
#include <KMenu>
#include <KCmdLineArgs>
#include <KAboutData>
......@@ -115,9 +115,6 @@ KGoldrunner::KGoldrunner()
/************************* SET UP THE USER INTERFACE ************************/
/******************************************************************************/
// Get catalog for translation.
KGlobal::locale()->insertCatalog ( QLatin1String( "libkdegames" ));
// Tell the KMainWindow that the KGrCanvas object is the main widget.
setCentralWidget (view);
......@@ -315,14 +312,14 @@ void KGoldrunner::setupActions()
i18n ("&Create Level"),
i18n ("Create level."),
i18n ("Create a completely new level."));
ed->setIcon (KIcon ( QLatin1String( "document-new" )));
ed->setIcon (QIcon::fromTheme( QLatin1String( "document-new" )));
ed->setIconText (i18n ("Create"));
ed = editAction ("edit_any", EDIT_ANY,
i18n ("&Edit Level..."),
i18n ("Edit level..."),
i18n ("Edit any level..."));
ed->setIcon (KIcon ( QLatin1String( "document-open" )));
ed->setIcon (QIcon::fromTheme( QLatin1String( "document-open" )));
ed->setIconText (i18n ("Edit"));
// Save Edits...
......@@ -334,7 +331,7 @@ void KGoldrunner::setupActions()
i18n ("&Save Edits..."),
i18n ("Save edits..."),
i18n ("Save your level after editing..."));
saveEdits->setIcon (KIcon ( QLatin1String( "document-save" )));
saveEdits->setIcon (QIcon::fromTheme( QLatin1String( "document-save" )));
saveEdits->setIconText (i18n ("Save"));
saveEdits->setEnabled (false); // Nothing to save, yet.
......@@ -554,7 +551,7 @@ void KGoldrunner::setupActions()
// stepping through the animation, toggling a debug patch or log messages
// on or off during gameplay and printing the states of runners or tiles.
KConfigGroup debugGroup (KGlobal::config(), "Debugging");
KConfigGroup debugGroup (KSharedConfig::openConfig(), "Debugging");
bool addDebuggingShortcuts = debugGroup.readEntry
("DebuggingShortcuts", false); // Get debug option.
if (! addDebuggingShortcuts)
......@@ -807,7 +804,7 @@ void KGoldrunner::setEditMenu (bool on_off)
void KGoldrunner::setEditIcon (const QString & actionName, const char iconType)
{
((KToggleAction *) (actionCollection()->action (actionName)))->
setIcon (KIcon (renderer->getPixmap (iconType)));
setIcon (QIcon(renderer->getPixmap (iconType)));
}
/******************************************************************************/
......@@ -954,7 +951,7 @@ void KGoldrunner::setupEditToolbarActions()
i18n ("Edit level name or hint"),
i18n ("Edit text for the name or hint "
"of a level"));
ed->setIcon (KIcon ( QLatin1String( "games-hint" )));
ed->setIcon (QIcon::fromTheme( QLatin1String( "games-hint" )));
ed->setIconText (i18n ("Name/Hint"));
KToggleAction * free = editToolbarAction ("freebg", FREE,
......
......@@ -28,6 +28,7 @@
#include <QButtonGroup>
#include <KGlobalSettings>
#include <QFontDatabase>
/*******************************************************************************
*************** DIALOG BOX TO CREATE/EDIT A LEVEL NAME AND HINT ****************
......@@ -245,7 +246,7 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames,
"Day Date Time "), dad);
lgList = new QListWidget (dad);
QFont f = KGlobalSettings::fixedFont(); // KDE version.
QFont f = QFontDatabase::systemFont(QFontDatabase::FixedFont); // KDE version.
f.setFixedPitch (true);
lgList-> setFont (f);
f.setBold (true);
......
......@@ -46,7 +46,7 @@
#include <QDateTime>
#include <KRandomSequence>
#include <KPushButton>
#include <QPushButton>
#include <KStandardGuiItem>
#include <KStandardDirs>
#include <KApplication>
......@@ -72,6 +72,7 @@
#include <QHeaderView>
#include <QTreeWidgetItem>
#include <QDir>
#include <KGuiItem>
#endif
......@@ -329,7 +330,7 @@ void KGrGame::editActions (const int action)
level = lev;
kDebug() << "Saving to KConfigGroup";
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
gameGroup.writeEntry ("GamePrefix", prefix);
gameGroup.writeEntry ("Level_" + prefix, level);
gameGroup.sync(); // Ensure that the entry goes to disk.
......@@ -367,7 +368,7 @@ void KGrGame::editToolbarActions (const int action)
void KGrGame::settings (const int action)
{
// TODO - Bad - Configure Keys does not pause a demo. IDW
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
bool onOff = false;
switch (action) {
case PLAY_SOUNDS:
......@@ -429,7 +430,7 @@ void KGrGame::initGame()
// Get the most recent collection and level that was played by this user.
// If he/she has never played before, set it to Tutorial, level 1.
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
QString prevGamePrefix = gameGroup.readEntry ("GamePrefix", "tute");
int prevLevel = gameGroup.readEntry ("Level_" + prevGamePrefix, 1);
......@@ -623,7 +624,7 @@ void KGrGame::startInstantReplay()
void KGrGame::replayLastLevel()
{
// Replay the last game and level completed by the player.
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
QString lastPrefix = gameGroup.readEntry ("LastGamePrefix", "");
int lastLevel = gameGroup.readEntry ("LastLevel", -1);
......@@ -867,7 +868,7 @@ bool KGrGame::playLevel (const Owner fileOwner, const QString & prefix,
// If we are starting a new level, save it in the player's config file.
if (newLevel && (level != 0)) { // But do not save the "ENDE" level.
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
gameGroup.writeEntry ("GamePrefix", prefix);
gameGroup.writeEntry ("Level_" + prefix, level);
gameGroup.sync(); // Ensure that the entry goes to disk.
......@@ -1151,7 +1152,7 @@ bool KGrGame::inEditMode()
void KGrGame::toggleSoundsOnOff (const int action)
{
const char * setting = (action == PLAY_SOUNDS) ? "Sound" : "StepSounds";
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
bool soundOnOff = gameGroup.readEntry (setting, false);
soundOnOff = (! soundOnOff);
gameGroup.writeEntry (setting, soundOnOff);
......@@ -1645,7 +1646,8 @@ void KGrGame::checkHighScore()
"in the KGoldrunner Hall of Fame.</html>"),
hsn);
QLineEdit * hsnUser = new QLineEdit (hsn);
QPushButton * OK = new KPushButton (KStandardGuiItem::ok(), hsn);
QPushButton * OK = new QPushButton(hsn);
KGuiItem::assign(OK,KStandardGuiItem::ok());
mainLayout-> addWidget (hsnMessage);
mainLayout-> addWidget (hsnUser);
......@@ -1873,7 +1875,8 @@ void KGrGame::showHighScores()
QSpacerItem * spacerItem = new QSpacerItem (40, 20, QSizePolicy::Expanding,
QSizePolicy::Minimum);
hboxLayout1->addItem (spacerItem);
QPushButton * OK = new KPushButton (KStandardGuiItem::close(), hs);
QPushButton * OK = new QPushButton(hs);
KGuiItem::assign(OK,KStandardGuiItem::close());
OK-> setShortcut (Qt::Key_Return);
OK-> setMaximumWidth (100);
hboxLayout1->addWidget (OK);
......@@ -2073,7 +2076,7 @@ void KGrGame::saveRecording()
configGroup.sync(); // Ensure that the entry goes to disk.
// Save the game and level, for use in the REPLAY_LAST action.
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
gameGroup.writeEntry ("LastGamePrefix", prefix);
gameGroup.writeEntry ("LastLevel", level);
gameGroup.sync(); // Ensure that the entry goes to disk.
......
......@@ -424,7 +424,7 @@ void KGrSLDialog::slGame()
display->setMaximum (1);
}
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
int lev = 1;
// Set a default level number for the selected game.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment