~ubuntu-branches/ubuntu/quantal/kdegames/quantal

« back to all changes in this revision

Viewing changes to kolf/kolf.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:50 UTC
  • mfrom: (1.3.14)
  • Revision ID: package-import@ubuntu.com-20111215141750-6tj6brf4azhrt915
Tags: 4:4.7.90-0ubuntu1
new upstream beta release

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
 
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()));
100
100
 
101
101
        loadGameAction = KStandardGameAction::load(this, SLOT(loadGame()), actionCollection());
102
102
        highScoreAction = KStandardGameAction::highscores(this, SLOT(showHighScores()), actionCollection());
104
104
        // Hole
105
105
        editingAction = new KToggleAction(KIcon( QLatin1String( "document-properties") ), i18n("&Edit"), this);
106
106
        actionCollection()->addAction("editing", editingAction);
107
 
        connect(editingAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
 
107
        connect(editingAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
108
108
        editingAction->setShortcut(Qt::CTRL+Qt::Key_E);
109
109
        newHoleAction = actionCollection()->addAction("newhole");
110
110
        newHoleAction->setIcon(KIcon( QLatin1String( "document-new" )));
118
118
        clearHoleAction->setShortcut(Qt::CTRL+Qt::Key_Delete);
119
119
        resetHoleAction = actionCollection()->addAction("resethole");
120
120
        resetHoleAction->setText(i18n("&Reset"));
121
 
        connect(resetHoleAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
 
121
        connect(resetHoleAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
122
122
        resetHoleAction->setShortcut(Qt::CTRL+Qt::Key_R);
123
123
        undoShotAction = KStandardAction::undo(this, SLOT(emptySlot()), this);
124
124
        actionCollection()->addAction("undoshot", undoShotAction);
146
146
        firstAction->setShortcuts(KStandardShortcut::shortcut(KStandardShortcut::Begin));
147
147
        lastAction = actionCollection()->addAction("lasthole");
148
148
        lastAction->setText(i18n("&Last Hole"));
149
 
        connect(lastAction, SIGNAL(triggered(bool) ), SLOT(emptySlot()));
 
149
        connect(lastAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
150
150
        lastAction->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_End); // why not KStandardShortcut::End (Ctrl+End)?
151
151
        randAction = actionCollection()->addAction("randhole");
152
152
        randAction->setIcon(KIcon( QLatin1String( "go-jump" )));
156
156
        // Settings
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));
163
163
 
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));
169
169
 
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));
176
176
 
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));
182
182
 
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()));
186
186
 
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));
192
192
 
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()));
199
199
 
200
200
        setupGUI();
201
201
}
271
271
        game->setStrict(competition);
272
272
 
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*)));
651
651
 
652
652
        scoreboard->hide();
653
653