Commit f2f183bf authored by Laurent Montel's avatar Laurent Montel 😁

Port to KF5

parent 5841a429
project(kigo)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames REQUIRED)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.3.0")
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories(${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS})
endif(NOT COMPILING_KDEGAMES)
find_package(ECM 1.3.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Qml Quick QuickWidgets Svg Test)
find_package(KF5 REQUIRED COMPONENTS
CoreAddons
Config
ItemModels
WidgetsAddons
WindowSystem
Config
DBusAddons
I18n
ConfigWidgets
TextWidgets
XmlGui
KIO
NotifyConfig
NewStuff
KDELibs4Support)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)
include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DTRANSLATION_DOMAIN="kigo")
add_subdirectory(src)
add_subdirectory(data)
......
kde4_install_icons(${ICON_INSTALL_DIR})
ecm_install_icons(ICONS hi128-apps-kigo.png hi16-apps-kigo.png hi22-apps-kigo.png hi32-apps-kigo.png hi48-apps-kigo.png hi64-apps-kigo.png DESTINATION ${ICON_INSTALL_DIR})
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kigo)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kigo)
include_directories(${KDE4_INCLUDES} ${KDEGAMES_INCLUDE_DIR})
set(kigo_SRCS
game/game.cpp
......@@ -17,17 +16,17 @@ set(kigo_SRCS
main.cpp
)
kde4_add_ui_files(kigo_SRCS
ki18n_wrap_ui(kigo_SRCS
gui/config/generalconfig.ui
gui/widgets/errorwidget.ui
gui/widgets/gamewidget.ui
gui/widgets/setupwidget.ui
)
kde4_add_kcfg_files(kigo_SRCS preferences.kcfgc)
kconfig_add_kcfg_files(kigo_SRCS preferences.kcfgc)
kde4_add_app_icon(kigo_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../data/icons/hi*-app-kigo.png")
kde4_add_executable(kigo ${kigo_SRCS})
add_executable(kigo ${kigo_SRCS})
target_link_libraries(kigo ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} kdegames kdegamesprivate ${KDE4_KNEWSTUFF3_LIBS})
target_link_libraries(kigo KF5::KIOCore KF5KDEGames KF5KDEGamesPrivate KF5::NewStuff Qt5::Svg)
install(TARGETS kigo ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES kigo.kcfg DESTINATION ${KCFG_INSTALL_DIR})
......
......@@ -21,7 +21,7 @@
#include "generalconfig.h"
#include "preferences.h"
#include "game/game.h"
#include <KUrl>
namespace Kigo {
GeneralConfig::GeneralConfig(QWidget *parent)
......
......@@ -224,7 +224,7 @@ void GameScene::updateTerritoryItems()
if (m_showTerritory) {
QPixmap stonePixmap;
int halfCellSize = m_cellSize / 2;
kDebug() << "Fetching territory from engine ...";
//qDebug() << "Fetching territory from engine ...";
stonePixmap = ThemeRenderer::self()->renderElement(ThemeRenderer::WhiteTerritory, QSize(m_cellSize, m_cellSize));
foreach (const Stone &stone, m_game->finalStates(Game::FinalWhiteTerritory)) {
......
......@@ -30,7 +30,7 @@
#include "gui/widgets/setupwidget.h"
#include "preferences.h"
#include <KAction>
#include <QAction>
#include <KActionCollection>
#include <KConfigDialog>
#include <KFileDialog>
......@@ -38,7 +38,8 @@
#include <KStandardDirs>
#include <KStandardGameAction>
#include <KToggleAction>
#include <KUrl>
#include <KIcon>
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgamethemeselector.h>
......@@ -324,7 +325,7 @@ void MainWindow::showPreferences()
KConfigDialog *dialog = new KConfigDialog(this, "settings", Preferences::self());
dialog->addPage(new GeneralConfig(), i18n("General"), "preferences-other");
dialog->addPage(new KGameThemeSelector(dialog, Preferences::self(), KGameThemeSelector::NewStuffDisableDownload), i18n("Themes"), "games-config-theme");
dialog->setHelp(QString(), "Kigo");
//QT5 dialog->setHelp(QString(), "Kigo");
connect(dialog, SIGNAL(settingsChanged(QString)), this, SLOT(applyPreferences()));
dialog->show();
}
......@@ -402,7 +403,7 @@ void MainWindow::setupActions()
// Game menu
m_newGameAction = KStandardGameAction::gameNew(this, SLOT(newGame()), actionCollection());
m_loadGameAction = KStandardGameAction::load(this, SLOT(loadGame()), actionCollection());
m_getMoreGamesAction = new KAction(KIcon( QLatin1String( "get-hot-new-stuff") ), i18nc("@action", "Get More Games..." ), this);
m_getMoreGamesAction = new QAction(KIcon( QLatin1String( "get-hot-new-stuff") ), i18nc("@action", "Get More Games..." ), this);
m_getMoreGamesAction->setShortcut(Qt::CTRL + Qt::Key_G);
m_getMoreGamesAction->setToolTip(i18nc("@action", "Get More Games..."));
connect(m_getMoreGamesAction, SIGNAL(triggered(bool)), this, SLOT(getMoreGames()));
......@@ -410,13 +411,13 @@ void MainWindow::setupActions()
m_saveAction = KStandardGameAction::save(this, SLOT(saveGame()), actionCollection());
KStandardGameAction::quit(this, SLOT(close()), actionCollection());
m_startGameAction = new KAction(KIcon( QLatin1String( "media-playback-start") ), i18nc("@action", "Start Game" ), this);
m_startGameAction = new QAction(KIcon( QLatin1String( "media-playback-start") ), i18nc("@action", "Start Game" ), this);
m_startGameAction->setShortcut(Qt::Key_S);
m_startGameAction->setToolTip(i18nc("@action", "Start Game"));
connect(m_startGameAction, SIGNAL(triggered(bool)), this, SLOT(startGame()));
actionCollection()->addAction( QLatin1String( "game_start" ), m_startGameAction);
m_finishGameAction = new KAction(KIcon( QLatin1String( "media-playback-stop") ), i18nc("@action", "Finish Game" ), this);
m_finishGameAction = new QAction(KIcon( QLatin1String( "media-playback-stop") ), i18nc("@action", "Finish Game" ), this);
m_finishGameAction->setShortcut(Qt::Key_F);
m_finishGameAction->setToolTip(i18nc("@action", "Finish Game"));
connect(m_finishGameAction, SIGNAL(triggered(bool)), this, SLOT(finishGame()));
......
......@@ -23,7 +23,7 @@
#include <KXmlGuiWindow>
class KAction;
class QAction;
class KToggleAction;
class QDockWidget;
class QUndoView;
......@@ -89,16 +89,16 @@ private:
QDockWidget *m_movesDock; ///< Move history dock widget
QDockWidget *m_errorDock; ///< Dock shown when errors occur
KAction *m_newGameAction;
KAction *m_loadGameAction;
KAction *m_getMoreGamesAction;
KAction *m_saveAction; ///< Action to save the current game
KAction *m_undoMoveAction; ///< Action to jump to the last move
KAction *m_redoMoveAction; ///< Action to jump to the next move
KAction *m_passMoveAction; ///< Action to pass current move
KAction *m_hintAction;
KAction *m_startGameAction;
KAction *m_finishGameAction;
QAction *m_newGameAction;
QAction *m_loadGameAction;
QAction *m_getMoreGamesAction;
QAction *m_saveAction; ///< Action to save the current game
QAction *m_undoMoveAction; ///< Action to jump to the last move
QAction *m_redoMoveAction; ///< Action to jump to the next move
QAction *m_passMoveAction; ///< Action to pass current move
QAction *m_hintAction;
QAction *m_startGameAction;
QAction *m_finishGameAction;
KToggleAction *m_moveNumbersAction;
};
......
......@@ -26,7 +26,7 @@
#include "gui/graphicsview/themerenderer.h"
#include <KDebug>
#include <KIcon>
namespace Kigo {
GameWidget::GameWidget(Game *game, QWidget *parent)
......
......@@ -24,7 +24,7 @@
#include "gui/graphicsview/themerenderer.h"
#include <QFile>
#include <KIcon>
namespace Kigo {
SetupWidget::SetupWidget(Game *game, QWidget *parent)
......
......@@ -20,7 +20,7 @@
#include "gui/mainwindow.h"
#include <KAboutData>
#include <K4AboutData>
#include <KCmdLineArgs>
#include <KLocale>
#include <KApplication>
......@@ -38,8 +38,8 @@ namespace Kigo { /* This is only a Doxygen stub */ }
*/
int main(int argc, char *argv[])
{
KAboutData aboutData("kigo", 0, ki18n("Kigo"), "0.5.6",
ki18n("KDE Go Board Game"), KAboutData::License_GPL_V2,
K4AboutData aboutData("kigo", 0, ki18n("Kigo"), "0.5.6",
ki18n("KDE Go Board Game"), K4AboutData::License_GPL_V2,
ki18n("Copyright (c) 2008-2010 Sascha Peilicke"));
aboutData.addAuthor(ki18n("Sascha Peilicke (saschpe)"), ki18n("Original author"),
"sasch.pe@gmx.de", "http://saschpe.wordpress.com");
......@@ -58,7 +58,6 @@ int main(int argc, char *argv[])
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
if (app.isSessionRestored()) {
RESTORE(Kigo::MainWindow)
......
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