94
94
saveGameAction = actionCollection()->addAction("savegame");
95
95
saveGameAction->setText(i18n("&Save Game"));
96
connect(saveGameAction, SIGNAL(triggered(bool) ), SLOT(saveGame()));
96
connect(saveGameAction, SIGNAL(triggered(bool)), SLOT(saveGame()));
97
97
saveGameAsAction = actionCollection()->addAction("savegameas");
98
98
saveGameAsAction->setText(i18n("&Save Game As..."));
99
connect(saveGameAsAction, SIGNAL(triggered(bool) ), SLOT(saveGameAs()));
99
connect(saveGameAsAction, SIGNAL(triggered(bool)), SLOT(saveGameAs()));
101
101
loadGameAction = KStandardGameAction::load(this, SLOT(loadGame()), actionCollection());
102
102
highScoreAction = KStandardGameAction::highscores(this, SLOT(showHighScores()), actionCollection());
157
157
useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), this);
158
158
actionCollection()->addAction("usemouse", useMouseAction);
159
connect(useMouseAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
159
connect(useMouseAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
160
160
connect(useMouseAction, SIGNAL(toggled(bool)), this, SLOT(useMouseChanged(bool)));
161
161
KConfigGroup configGroup(KGlobal::config(), "Settings");
162
162
useMouseAction->setChecked(configGroup.readEntry("useMouse", true));
164
164
useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), this);
165
165
actionCollection()->addAction("useadvancedputting", useAdvancedPuttingAction);
166
connect(useAdvancedPuttingAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
166
connect(useAdvancedPuttingAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
167
167
connect(useAdvancedPuttingAction, SIGNAL(toggled(bool)), this, SLOT(useAdvancedPuttingChanged(bool)));
168
168
useAdvancedPuttingAction->setChecked(configGroup.readEntry("useAdvancedPutting", false));
170
170
showInfoAction = new KToggleAction(KIcon( QLatin1String( "help-about")), i18n("Show &Info"), this);
171
171
actionCollection()->addAction("showinfo", showInfoAction);
172
connect(showInfoAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
172
connect(showInfoAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
173
173
showInfoAction->setShortcut(Qt::CTRL+Qt::Key_I);
174
174
connect(showInfoAction, SIGNAL(toggled(bool)), this, SLOT(showInfoChanged(bool)));
175
175
showInfoAction->setChecked(configGroup.readEntry("showInfo", true));
177
177
showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), this);
178
178
actionCollection()->addAction("showguideline", showGuideLineAction);
179
connect(showGuideLineAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
179
connect(showGuideLineAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
180
180
connect(showGuideLineAction, SIGNAL(toggled(bool)), this, SLOT(showGuideLineChanged(bool)));
181
181
showGuideLineAction->setChecked(configGroup.readEntry("showGuideLine", true));
183
183
KToggleAction *act = new KToggleAction(i18n("Enable All Dialog Boxes"), this);
184
184
actionCollection()->addAction("enableAll", act);
185
connect(act, SIGNAL(triggered(bool) ), SLOT(enableAllMessages()));
185
connect(act, SIGNAL(triggered(bool)), SLOT(enableAllMessages()));
187
187
soundAction = new KToggleAction(i18n("Play &Sounds"), this);
188
188
actionCollection()->addAction("sound", soundAction);
189
connect(soundAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
189
connect(soundAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
190
190
connect(soundAction, SIGNAL(toggled(bool)), this, SLOT(soundChanged(bool)));
191
191
soundAction->setChecked(configGroup.readEntry("sound", true));
193
193
aboutAction = actionCollection()->addAction("aboutcourse");
194
194
aboutAction->setText(i18n("&About Course"));
195
connect(aboutAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
195
connect(aboutAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
196
196
tutorialAction = actionCollection()->addAction("tutorial");
197
197
tutorialAction->setText(i18n("&Tutorial"));
198
connect(tutorialAction, SIGNAL(triggered(bool) ), SLOT(tutorial()));
198
connect(tutorialAction, SIGNAL(triggered(bool)), SLOT(tutorial()));
271
271
game->setStrict(competition);
273
273
connect(game, SIGNAL(newHole(int)), scoreboard, SLOT(newHole(int)));
274
connect(game, SIGNAL(scoreChanged(int, int, int)), scoreboard, SLOT(setScore(int, int, int)));
275
connect(game, SIGNAL(parChanged(int, int)), scoreboard, SLOT(parChanged(int, int)));
274
connect(game, SIGNAL(scoreChanged(int,int,int)), scoreboard, SLOT(setScore(int,int,int)));
275
connect(game, SIGNAL(parChanged(int,int)), scoreboard, SLOT(parChanged(int,int)));
276
276
connect(game, SIGNAL(modifiedChanged(bool)), this, SLOT(updateModified(bool)));
277
connect(game, SIGNAL(newPlayersTurn(Player *)), this, SLOT(newPlayersTurn(Player *)));
277
connect(game, SIGNAL(newPlayersTurn(Player*)), this, SLOT(newPlayersTurn(Player*)));
278
278
connect(game, SIGNAL(holesDone()), this, SLOT(gameOver()));
279
279
connect(game, SIGNAL(checkEditing()), this, SLOT(checkEditing()));
280
280
connect(game, SIGNAL(editingStarted()), this, SLOT(editingStarted()));
281
281
connect(game, SIGNAL(editingEnded()), this, SLOT(editingEnded()));
282
282
connect(game, SIGNAL(inPlayStart()), this, SLOT(inPlayStart()));
283
283
connect(game, SIGNAL(inPlayEnd()), this, SLOT(inPlayEnd()));
284
connect(game, SIGNAL(maxStrokesReached(const QString &)), this, SLOT(maxStrokesReached(const QString &)));
284
connect(game, SIGNAL(maxStrokesReached(QString)), this, SLOT(maxStrokesReached(QString)));
285
285
connect(game, SIGNAL(largestHole(int)), this, SLOT(updateHoleMenu(int)));
286
connect(game, SIGNAL(titleChanged(const QString &)), this, SLOT(titleChanged(const QString &)));
287
connect(game, SIGNAL(newStatusText(const QString &)), this, SLOT(newStatusText(const QString &)));
286
connect(game, SIGNAL(titleChanged(QString)), this, SLOT(titleChanged(QString)));
287
connect(game, SIGNAL(newStatusText(QString)), this, SLOT(newStatusText(QString)));
288
288
connect(game, SIGNAL(currentHole(int)), this, SLOT(setCurrentHole(int)));
289
connect(holeAction, SIGNAL(triggered(const QString &)), game, SLOT(switchHole(const QString &)));
289
connect(holeAction, SIGNAL(triggered(QString)), game, SLOT(switchHole(QString)));
290
290
connect(nextAction, SIGNAL(triggered(bool)), game, SLOT(nextHole()));
291
291
connect(prevAction, SIGNAL(triggered(bool)), game, SLOT(prevHole()));
292
292
connect(firstAction, SIGNAL(triggered(bool)), game, SLOT(firstHole()));
647
647
connect(editor, SIGNAL(addNewItem(QString)), game, SLOT(addNewObject(QString)));
648
648
connect(editor, SIGNAL(changed()), game, SLOT(setModified()));
649
649
connect(editor, SIGNAL(addNewItem(QString)), this, SLOT(setHoleFocus()));
650
connect(game, SIGNAL(newSelectedItem(CanvasItem *)), editor, SLOT(setItem(CanvasItem *)));
650
connect(game, SIGNAL(newSelectedItem(CanvasItem*)), editor, SLOT(setItem(CanvasItem*)));
652
652
scoreboard->hide();