summaryrefslogtreecommitdiffstats
path: root/kolf/kolf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kolf/kolf.cpp')
-rw-r--r--kolf/kolf.cpp156
1 files changed, 78 insertions, 78 deletions
diff --git a/kolf/kolf.cpp b/kolf/kolf.cpp
index 7151a197..856a023a 100644
--- a/kolf/kolf.cpp
+++ b/kolf/kolf.cpp
@@ -79,75 +79,75 @@ Kolf::~Kolf()
void Kolf::initGUI()
{
- newAction = KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection());
+ newAction = KStdGameAction::gameNew(this, TQ_SLOT(newGame()), actionCollection());
newAction->setText(newAction->text() + TQString("..."));
- endAction = KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection());
- printAction = KStdGameAction::print(this, TQT_SLOT(print()), actionCollection());
+ endAction = KStdGameAction::end(this, TQ_SLOT(closeGame()), actionCollection());
+ printAction = KStdGameAction::print(this, TQ_SLOT(print()), actionCollection());
- (void) KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection());
- saveAction = KStdAction::save(this, TQT_SLOT(save()), actionCollection(), "game_save");
+ (void) KStdGameAction::quit(this, TQ_SLOT(close()), actionCollection());
+ saveAction = KStdAction::save(this, TQ_SLOT(save()), actionCollection(), "game_save");
saveAction->setText(i18n("Save &Course"));
- saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection(), "game_save_as");
+ saveAsAction = KStdAction::saveAs(this, TQ_SLOT(saveAs()), actionCollection(), "game_save_as");
saveAsAction->setText(i18n("Save &Course As..."));
- saveGameAction = new TDEAction(i18n("&Save Game"), 0, this, TQT_SLOT(saveGame()), actionCollection(), "savegame");
- saveGameAsAction = new TDEAction(i18n("&Save Game As..."), 0, this, TQT_SLOT(saveGameAs()), actionCollection(), "savegameas");
+ saveGameAction = new TDEAction(i18n("&Save Game"), 0, this, TQ_SLOT(saveGame()), actionCollection(), "savegame");
+ saveGameAsAction = new TDEAction(i18n("&Save Game As..."), 0, this, TQ_SLOT(saveGameAs()), actionCollection(), "savegameas");
- loadGameAction = KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection());
+ loadGameAction = KStdGameAction::load(this, TQ_SLOT(loadGame()), actionCollection());
loadGameAction->setText(i18n("Load Saved Game..."));
- highScoreAction = KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection());
+ highScoreAction = KStdGameAction::highscores(this, TQ_SLOT(showHighScores()), actionCollection());
- editingAction = new TDEToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, TQT_SLOT(emptySlot()), actionCollection(), "editing");
- newHoleAction = new TDEAction(i18n("&New"), "document-new", CTRL+SHIFT+Key_N, this, TQT_SLOT(emptySlot()), actionCollection(), "newhole");
- clearHoleAction = new TDEAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, TQT_SLOT(emptySlot()), actionCollection(), "clearhole");
- resetHoleAction = new TDEAction(i18n("&Reset"), CTRL+Key_R, this, TQT_SLOT(emptySlot()), actionCollection(), "resethole");
- undoShotAction = KStdAction::undo(this, TQT_SLOT(emptySlot()), actionCollection(), "undoshot");
+ editingAction = new TDEToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, TQ_SLOT(emptySlot()), actionCollection(), "editing");
+ newHoleAction = new TDEAction(i18n("&New"), "document-new", CTRL+SHIFT+Key_N, this, TQ_SLOT(emptySlot()), actionCollection(), "newhole");
+ clearHoleAction = new TDEAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, TQ_SLOT(emptySlot()), actionCollection(), "clearhole");
+ resetHoleAction = new TDEAction(i18n("&Reset"), CTRL+Key_R, this, TQ_SLOT(emptySlot()), actionCollection(), "resethole");
+ undoShotAction = KStdAction::undo(this, TQ_SLOT(emptySlot()), actionCollection(), "undoshot");
undoShotAction->setText(i18n("&Undo Shot"));
- //replayShotAction = new TDEAction(i18n("&Replay Shot"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "replay");
+ //replayShotAction = new TDEAction(i18n("&Replay Shot"), 0, this, TQ_SLOT(emptySlot()), actionCollection(), "replay");
- holeAction = new TDEListAction(i18n("Switch to Hole"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "switchhole");
- nextAction = new TDEAction(i18n("&Next Hole"), "forward", TDEStdAccel::shortcut(TDEStdAccel::Forward), this, TQT_SLOT(emptySlot()), actionCollection(), "nexthole");
- prevAction = new TDEAction(i18n("&Previous Hole"), "back", TDEStdAccel::shortcut(TDEStdAccel::Back), this, TQT_SLOT(emptySlot()), actionCollection(), "prevhole");
- firstAction = new TDEAction(i18n("&First Hole"), "go-home", TDEStdAccel::shortcut(TDEStdAccel::Home), this, TQT_SLOT(emptySlot()), actionCollection(), "firsthole");
- lastAction = new TDEAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, TQT_SLOT(emptySlot()), actionCollection(), "lasthole");
- randAction = new TDEAction(i18n("&Random Hole"), "goto", 0, this, TQT_SLOT(emptySlot()), actionCollection(), "randhole");
+ holeAction = new TDEListAction(i18n("Switch to Hole"), 0, this, TQ_SLOT(emptySlot()), actionCollection(), "switchhole");
+ nextAction = new TDEAction(i18n("&Next Hole"), "forward", TDEStdAccel::shortcut(TDEStdAccel::Forward), this, TQ_SLOT(emptySlot()), actionCollection(), "nexthole");
+ prevAction = new TDEAction(i18n("&Previous Hole"), "back", TDEStdAccel::shortcut(TDEStdAccel::Back), this, TQ_SLOT(emptySlot()), actionCollection(), "prevhole");
+ firstAction = new TDEAction(i18n("&First Hole"), "go-home", TDEStdAccel::shortcut(TDEStdAccel::Home), this, TQ_SLOT(emptySlot()), actionCollection(), "firsthole");
+ lastAction = new TDEAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, TQ_SLOT(emptySlot()), actionCollection(), "lasthole");
+ randAction = new TDEAction(i18n("&Random Hole"), "goto", 0, this, TQ_SLOT(emptySlot()), actionCollection(), "randhole");
- useMouseAction = new TDEToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "usemouse");
+ useMouseAction = new TDEToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, TQ_SLOT(emptySlot()), actionCollection(), "usemouse");
useMouseAction->setCheckedState(i18n("Disable &Mouse for Moving Putter"));
- connect(useMouseAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useMouseChanged(bool)));
+ connect(useMouseAction, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(useMouseChanged(bool)));
TDEConfig *config = kapp->config();
config->setGroup("Settings");
useMouseAction->setChecked(config->readBoolEntry("useMouse", true));
- useAdvancedPuttingAction = new TDEToggleAction(i18n("Enable &Advanced Putting"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting");
+ useAdvancedPuttingAction = new TDEToggleAction(i18n("Enable &Advanced Putting"), 0, this, TQ_SLOT(emptySlot()), actionCollection(), "useadvancedputting");
useAdvancedPuttingAction->setCheckedState(i18n("Disable &Advanced Putting"));
- connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useAdvancedPuttingChanged(bool)));
+ connect(useAdvancedPuttingAction, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(useAdvancedPuttingChanged(bool)));
useAdvancedPuttingAction->setChecked(config->readBoolEntry("useAdvancedPutting", false));
- showInfoAction = new TDEToggleAction(i18n("Show &Info"), "application-vnd.tde.info", CTRL+Key_I, this, TQT_SLOT(emptySlot()), actionCollection(), "showinfo");
+ showInfoAction = new TDEToggleAction(i18n("Show &Info"), "application-vnd.tde.info", CTRL+Key_I, this, TQ_SLOT(emptySlot()), actionCollection(), "showinfo");
showInfoAction->setCheckedState(i18n("Hide &Info"));
- connect(showInfoAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showInfoChanged(bool)));
+ connect(showInfoAction, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(showInfoChanged(bool)));
showInfoAction->setChecked(config->readBoolEntry("showInfo", false));
- showGuideLineAction = new TDEToggleAction(i18n("Show Putter &Guideline"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "showguideline");
+ showGuideLineAction = new TDEToggleAction(i18n("Show Putter &Guideline"), 0, this, TQ_SLOT(emptySlot()), actionCollection(), "showguideline");
showGuideLineAction->setCheckedState(i18n("Hide Putter &Guideline"));
- connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showGuideLineChanged(bool)));
+ connect(showGuideLineAction, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(showGuideLineChanged(bool)));
showGuideLineAction->setChecked(config->readBoolEntry("showGuideLine", true));
- TDEToggleAction *act=new TDEToggleAction(i18n("Enable All Dialog Boxes"), 0, this, TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll");
+ TDEToggleAction *act=new TDEToggleAction(i18n("Enable All Dialog Boxes"), 0, this, TQ_SLOT(enableAllMessages()), actionCollection(), "enableAll");
act->setCheckedState(i18n("Disable All Dialog Boxes"));
- soundAction = new TDEToggleAction(i18n("Play &Sounds"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "audio-x-generic");
- connect(soundAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(soundChanged(bool)));
+ soundAction = new TDEToggleAction(i18n("Play &Sounds"), 0, this, TQ_SLOT(emptySlot()), actionCollection(), "audio-x-generic");
+ connect(soundAction, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(soundChanged(bool)));
soundAction->setChecked(config->readBoolEntry("sound", true));
- (void) new TDEAction(i18n("&Reload Plugins"), 0, this, TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins");
- (void) new TDEAction(i18n("Show &Plugins"), 0, this, TQT_SLOT(showPlugins()), actionCollection(), "showplugins");
+ (void) new TDEAction(i18n("&Reload Plugins"), 0, this, TQ_SLOT(initPlugins()), actionCollection(), "reloadplugins");
+ (void) new TDEAction(i18n("Show &Plugins"), 0, this, TQ_SLOT(showPlugins()), actionCollection(), "showplugins");
- aboutAction = new TDEAction(i18n("&About Course"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse");
- tutorialAction = new TDEAction(i18n("&Tutorial"), 0, this, TQT_SLOT(tutorial()), actionCollection(), "tutorial");
+ aboutAction = new TDEAction(i18n("&About Course"), 0, this, TQ_SLOT(emptySlot()), actionCollection(), "aboutcourse");
+ tutorialAction = new TDEAction(i18n("&Tutorial"), 0, this, TQ_SLOT(tutorial()), actionCollection(), "tutorial");
statusBar();
setupGUI();
@@ -223,40 +223,40 @@ void Kolf::startNewGame()
game = new KolfGame(obj, &players, filename, dummy);
game->setStrict(competition);
- connect(game, TQT_SIGNAL(newHole(int)), scoreboard, TQT_SLOT(newHole(int)));
- connect(game, TQT_SIGNAL(scoreChanged(int, int, int)), scoreboard, TQT_SLOT(setScore(int, int, int)));
- connect(game, TQT_SIGNAL(parChanged(int, int)), scoreboard, TQT_SLOT(parChanged(int, int)));
- connect(game, TQT_SIGNAL(modifiedChanged(bool)), this, TQT_SLOT(updateModified(bool)));
- connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), this, TQT_SLOT(newPlayersTurn(Player *)));
- connect(game, TQT_SIGNAL(holesDone()), this, TQT_SLOT(gameOver()));
- connect(game, TQT_SIGNAL(checkEditing()), this, TQT_SLOT(checkEditing()));
- connect(game, TQT_SIGNAL(editingStarted()), this, TQT_SLOT(editingStarted()));
- connect(game, TQT_SIGNAL(editingEnded()), this, TQT_SLOT(editingEnded()));
- connect(game, TQT_SIGNAL(inPlayStart()), this, TQT_SLOT(inPlayStart()));
- connect(game, TQT_SIGNAL(inPlayEnd()), this, TQT_SLOT(inPlayEnd()));
- connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), this, TQT_SLOT(maxStrokesReached(const TQString &)));
- connect(game, TQT_SIGNAL(largestHole(int)), this, TQT_SLOT(updateHoleMenu(int)));
- connect(game, TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(titleChanged(const TQString &)));
- connect(game, TQT_SIGNAL(newStatusText(const TQString &)), this, TQT_SLOT(newStatusText(const TQString &)));
- connect(game, TQT_SIGNAL(currentHole(int)), this, TQT_SLOT(setCurrentHole(int)));
- connect(holeAction, TQT_SIGNAL(activated(const TQString &)), game, TQT_SLOT(switchHole(const TQString &)));
- connect(nextAction, TQT_SIGNAL(activated()), game, TQT_SLOT(nextHole()));
- connect(prevAction, TQT_SIGNAL(activated()), game, TQT_SLOT(prevHole()));
- connect(firstAction, TQT_SIGNAL(activated()), game, TQT_SLOT(firstHole()));
- connect(lastAction, TQT_SIGNAL(activated()), game, TQT_SLOT(lastHole()));
- connect(randAction, TQT_SIGNAL(activated()), game, TQT_SLOT(randHole()));
- connect(editingAction, TQT_SIGNAL(activated()), game, TQT_SLOT(toggleEditMode()));
- connect(newHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(addNewHole()));
- connect(clearHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(clearHole()));
- connect(resetHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(resetHole()));
- connect(undoShotAction, TQT_SIGNAL(activated()), game, TQT_SLOT(undoShot()));
- //connect(replayShotAction, TQT_SIGNAL(activated()), game, TQT_SLOT(replay()));
- connect(aboutAction, TQT_SIGNAL(activated()), game, TQT_SLOT(showInfoDlg()));
- connect(useMouseAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setUseMouse(bool)));
- connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setUseAdvancedPutting(bool)));
- connect(soundAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setSound(bool)));
- connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setShowGuideLine(bool)));
- connect(showInfoAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setShowInfo(bool)));
+ connect(game, TQ_SIGNAL(newHole(int)), scoreboard, TQ_SLOT(newHole(int)));
+ connect(game, TQ_SIGNAL(scoreChanged(int, int, int)), scoreboard, TQ_SLOT(setScore(int, int, int)));
+ connect(game, TQ_SIGNAL(parChanged(int, int)), scoreboard, TQ_SLOT(parChanged(int, int)));
+ connect(game, TQ_SIGNAL(modifiedChanged(bool)), this, TQ_SLOT(updateModified(bool)));
+ connect(game, TQ_SIGNAL(newPlayersTurn(Player *)), this, TQ_SLOT(newPlayersTurn(Player *)));
+ connect(game, TQ_SIGNAL(holesDone()), this, TQ_SLOT(gameOver()));
+ connect(game, TQ_SIGNAL(checkEditing()), this, TQ_SLOT(checkEditing()));
+ connect(game, TQ_SIGNAL(editingStarted()), this, TQ_SLOT(editingStarted()));
+ connect(game, TQ_SIGNAL(editingEnded()), this, TQ_SLOT(editingEnded()));
+ connect(game, TQ_SIGNAL(inPlayStart()), this, TQ_SLOT(inPlayStart()));
+ connect(game, TQ_SIGNAL(inPlayEnd()), this, TQ_SLOT(inPlayEnd()));
+ connect(game, TQ_SIGNAL(maxStrokesReached(const TQString &)), this, TQ_SLOT(maxStrokesReached(const TQString &)));
+ connect(game, TQ_SIGNAL(largestHole(int)), this, TQ_SLOT(updateHoleMenu(int)));
+ connect(game, TQ_SIGNAL(titleChanged(const TQString &)), this, TQ_SLOT(titleChanged(const TQString &)));
+ connect(game, TQ_SIGNAL(newStatusText(const TQString &)), this, TQ_SLOT(newStatusText(const TQString &)));
+ connect(game, TQ_SIGNAL(currentHole(int)), this, TQ_SLOT(setCurrentHole(int)));
+ connect(holeAction, TQ_SIGNAL(activated(const TQString &)), game, TQ_SLOT(switchHole(const TQString &)));
+ connect(nextAction, TQ_SIGNAL(activated()), game, TQ_SLOT(nextHole()));
+ connect(prevAction, TQ_SIGNAL(activated()), game, TQ_SLOT(prevHole()));
+ connect(firstAction, TQ_SIGNAL(activated()), game, TQ_SLOT(firstHole()));
+ connect(lastAction, TQ_SIGNAL(activated()), game, TQ_SLOT(lastHole()));
+ connect(randAction, TQ_SIGNAL(activated()), game, TQ_SLOT(randHole()));
+ connect(editingAction, TQ_SIGNAL(activated()), game, TQ_SLOT(toggleEditMode()));
+ connect(newHoleAction, TQ_SIGNAL(activated()), game, TQ_SLOT(addNewHole()));
+ connect(clearHoleAction, TQ_SIGNAL(activated()), game, TQ_SLOT(clearHole()));
+ connect(resetHoleAction, TQ_SIGNAL(activated()), game, TQ_SLOT(resetHole()));
+ connect(undoShotAction, TQ_SIGNAL(activated()), game, TQ_SLOT(undoShot()));
+ //connect(replayShotAction, TQ_SIGNAL(activated()), game, TQ_SLOT(replay()));
+ connect(aboutAction, TQ_SIGNAL(activated()), game, TQ_SLOT(showInfoDlg()));
+ connect(useMouseAction, TQ_SIGNAL(toggled(bool)), game, TQ_SLOT(setUseMouse(bool)));
+ connect(useAdvancedPuttingAction, TQ_SIGNAL(toggled(bool)), game, TQ_SLOT(setUseAdvancedPutting(bool)));
+ connect(soundAction, TQ_SIGNAL(toggled(bool)), game, TQ_SLOT(setSound(bool)));
+ connect(showGuideLineAction, TQ_SIGNAL(toggled(bool)), game, TQ_SLOT(setShowGuideLine(bool)));
+ connect(showInfoAction, TQ_SIGNAL(toggled(bool)), game, TQ_SLOT(setShowInfo(bool)));
game->setUseMouse(useMouseAction->isChecked());
game->setUseAdvancedPutting(useAdvancedPuttingAction->isChecked());
@@ -356,7 +356,7 @@ void Kolf::closeGame()
titleChanged(TQString());
updateModified(false);
- TQTimer::singleShot(100, this, TQT_SLOT(createSpacer()));
+ TQTimer::singleShot(100, this, TQ_SLOT(createSpacer()));
}
void Kolf::createSpacer()
@@ -463,7 +463,7 @@ void Kolf::gameOver()
scoreDialog->show();
}
- TQTimer::singleShot(700, this, TQT_SLOT(closeGame()));
+ TQTimer::singleShot(700, this, TQ_SLOT(closeGame()));
}
void Kolf::showHighScores()
@@ -564,7 +564,7 @@ void Kolf::openURL(KURL url)
return;
}
- TQTimer::singleShot(10, this, TQT_SLOT(startNewGame()));
+ TQTimer::singleShot(10, this, TQ_SLOT(startNewGame()));
}
else
closeGame();
@@ -594,10 +594,10 @@ void Kolf::editingStarted()
{
delete editor;
editor = new Editor(obj, dummy, "Editor");
- connect(editor, TQT_SIGNAL(addNewItem(Object *)), game, TQT_SLOT(addNewObject(Object *)));
- connect(editor, TQT_SIGNAL(changed()), game, TQT_SLOT(setModified()));
- connect(editor, TQT_SIGNAL(addNewItem(Object *)), this, TQT_SLOT(setHoleFocus()));
- connect(game, TQT_SIGNAL(newSelectedItem(CanvasItem *)), editor, TQT_SLOT(setItem(CanvasItem *)));
+ connect(editor, TQ_SIGNAL(addNewItem(Object *)), game, TQ_SLOT(addNewObject(Object *)));
+ connect(editor, TQ_SIGNAL(changed()), game, TQ_SLOT(setModified()));
+ connect(editor, TQ_SIGNAL(addNewItem(Object *)), this, TQ_SLOT(setHoleFocus()));
+ connect(game, TQ_SIGNAL(newSelectedItem(CanvasItem *)), editor, TQ_SLOT(setItem(CanvasItem *)));
scoreboard->hide();