Changeset View
Changeset View
Standalone View
Standalone View
src/window/mainwindow.cpp
Show All 24 Lines | |||||
25 | #include "settings.h" | 25 | #include "settings.h" | ||
26 | #include <QAction> | 26 | #include <QAction> | ||
27 | #include <KActionCollection> | 27 | #include <KActionCollection> | ||
28 | #include <KLocalizedString> | 28 | #include <KLocalizedString> | ||
29 | #include <KStandardAction> | 29 | #include <KStandardAction> | ||
30 | #include <KToggleAction> | 30 | #include <KToggleAction> | ||
31 | #include <KMessageBox> | 31 | #include <KMessageBox> | ||
32 | 32 | | |||
33 | #define RUN_IN_BUILDDIR | ||||
34 | | ||||
33 | Palapeli::MainWindow::MainWindow(const QString &path) | 35 | Palapeli::MainWindow::MainWindow(const QString &path) | ||
34 | : m_game(new Palapeli::GamePlay(this)) | 36 | : m_game(new Palapeli::GamePlay(this)) | ||
35 | { | 37 | { | ||
36 | setupActions(); | 38 | setupActions(); | ||
37 | //setup GUI | 39 | //setup GUI | ||
38 | KXmlGuiWindow::StandardWindowOptions guiOptions = KXmlGuiWindow::Default; | 40 | KXmlGuiWindow::StandardWindowOptions guiOptions = KXmlGuiWindow::Default; | ||
39 | guiOptions &= ~KXmlGuiWindow::StatusBar; //no statusbar | 41 | guiOptions &= ~KXmlGuiWindow::StatusBar; //no statusbar | ||
42 | #ifdef RUN_IN_BUILDDIR | ||||
43 | setupGUI(QSize(500, 500), guiOptions, QLatin1String("/home/chehrlic/kde/palapeli/src/palapeliui.rc")); | ||||
44 | #else | ||||
40 | setupGUI(QSize(500, 500), guiOptions); | 45 | setupGUI(QSize(500, 500), guiOptions); | ||
46 | #endif | ||||
41 | m_game->init(); | 47 | m_game->init(); | ||
42 | //start a puzzle if a puzzle URL has been given | 48 | //start a puzzle if a puzzle URL has been given | ||
49 | if (!path.isEmpty()) | ||||
43 | m_game->playPuzzleFile(path); | 50 | m_game->playPuzzleFile(path); | ||
44 | } | 51 | } | ||
45 | 52 | | |||
46 | bool Palapeli::MainWindow::queryClose() | 53 | bool Palapeli::MainWindow::queryClose() | ||
47 | { | 54 | { | ||
48 | // Terminate cleanly if the user Quits when playing a puzzle. | 55 | // Terminate cleanly if the user Quits when playing a puzzle. | ||
49 | m_game->shutdown(); | 56 | m_game->shutdown(); | ||
50 | return true; | 57 | return true; | ||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |