Commit e7396c38 authored by Raymond Wooninck's avatar Raymond Wooninck

Initial port to frameworks

parent b7102566
project( kshisen )
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames 4.9.0 REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
find_package(LibKMahjongg REQUIRED)
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories(${LIBKMAHJONGG_INCLUDE_DIR} ${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS})
else(NOT COMPILING_KDEGAMES)
set(LIBKMAHJONGG_LIBRARY kmahjongglib)
endif(NOT COMPILING_KDEGAMES)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.2.0")
find_package(ECM 1.0.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui Svg Qml Quick QuickWidgets)
find_package(KF5 REQUIRED COMPONENTS CoreAddons XmlGui Config KIO DNSSD NewStuff Declarative DocTools KDELibs4Support)
include(FeatureSummary)
include(GenerateExportHeader)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMMarkNonGuiExecutable)
include(KDEInstallDirs)
include(ECMInstallIcons)
include(KDECompilerSettings)
include(KDECMakeSettings)
find_package(KF5KMahjongglib REQUIRED)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(Phonon4Qt5 REQUIRED)
add_definitions(${QT_DEFINITIONS} )
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_subdirectory( src )
add_subdirectory( sounds )
......@@ -22,4 +35,18 @@ add_subdirectory( doc )
install( PROGRAMS kshisen.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
kde4_install_icons( ${ICON_INSTALL_DIR} )
ecm_install_icons( ICONS
128-apps-kshisen.png
64-apps-kshisen.png
48-apps-kshisen.png
32-apps-kshisen.png
22-apps-kshisen.png
16-apps-kshisen.png
DESTINATION ${ICON_INSTALL_DIR}
THEME hicolor )
########### Display Summary ###############
feature_summary(WHAT ALL
INCLUDE_QUIET_PACKAGES
FATAL_ON_MISSING_REQUIRED_PACKAGES)
# - Try to find the libkmahjongg library
# Once done this will define
#
# LIBKMAHJONGG_FOUND - system has the libkmahjongg library
# LIBKMAHJONGG_INCLUDE_DIR - the libkmahjongg include directory
# LIBKMAHJONGG_LIBRARY - Link this to use the libkmahjongg library
#
include(CheckLibraryExists)
if (LIBKMAHJONGG_INCLUDE_DIR AND LIBKMAHJONGG_LIBRARY)
# in cache already
set(LIBKMAHJONGG_FOUND TRUE)
else (LIBKMAHJONGG_INCLUDE_DIR AND LIBKMAHJONGG_LIBRARY)
# reset vars
set(LIBKMAHJONGG_INCLUDE_DIR)
set(LIBKMAHJONGG_LIBRARY)
find_path(LIBKMAHJONGG_INCLUDE_DIR kmahjonggtileset.h
${INCLUDE_INSTALL_DIR} ${KDE4_INCLUDE_DIR} ${GNUWIN32_DIR}/include)
set(LIBKMAHJONGG_INCLUDE_DIR ${LIBKMAHJONGG_INCLUDE_DIR})
set(CMAKE_LIBRARY_PATH ${LIB_INSTALL_DIR})
find_library(LIBKMAHJONGG_LIBRARY NAMES kmahjongglib
PATHS ${LIB_INSTALL_DIR} ${KDE4_LIB_DIR} ${GNUWIN32_DIR}/lib)
set(LIBKMAHJONGG_LIBRARY ${LIBKMAHJONGG_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBKMAHJONGG DEFAULT_MSG LIBKMAHJONGG_INCLUDE_DIR LIBKMAHJONGG_LIBRARY)
mark_as_advanced(LIBKMAHJONGG_INCLUDE_DIR LIBKMAHJONGG_LIBRARY)
endif(LIBKMAHJONGG_INCLUDE_DIR AND LIBKMAHJONGG_LIBRARY)
########### install files ###############
#
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kshisen)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kshisen)
project( kshisen )
include_directories( ${CMAKE_SOURCE_DIR}/libkmahjongg ${CMAKE_SOURCE_DIR}/libkdegames/highscore )
set( kshisen_SRCS
main.cpp
board.cpp
app.cpp
)
kde4_add_ui_files( kshisen_SRCS
qt5_wrap_ui( kshisen_SRCS
settings.ui
)
kde4_add_kcfg_files( kshisen_SRCS prefs.kcfgc )
kconfig_add_kcfg_files( kshisen_SRCS prefs.kcfgc )
kde4_add_app_icon( kshisen_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../hi*-app-kshisen.png" )
add_executable( kshisen ${kshisen_SRCS} )
kde4_add_executable( kshisen ${kshisen_SRCS} )
include_directories(${PHONON_INCLUDES})
target_link_libraries( kshisen ${KDE4_KDEUI_LIBS} kdegames ${LIBKMAHJONGG_LIBRARY} )
target_link_libraries(kshisen Qt5::Gui KF5::CoreAddons KF5::KIOWidgets KF5::DNSSD Phonon::phonon4qt5
KF5::XmlGui KF5KDEGames KF5KDEGamesPrivate KF5KMahjongglib )
install( TARGETS kshisen ${INSTALL_TARGETS_DEFAULT_ARGS} )
install( FILES kshisen.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES kshisenui.rc DESTINATION ${DATA_INSTALL_DIR}/kshisen )
install( FILES kshisenui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kshisen )
......@@ -380,12 +380,10 @@ void App::showSettingsDialog()
dialog->addPage(new Settings(0), i18n("General"), "games-config-options");
dialog->addTilesetPage();
dialog->addBackgroundPage();
dialog->setHelp(QString(), "kshisen");
//dialog->setHelp(QString(), "kshisen");
connect(dialog, SIGNAL(settingsChanged(QString)), m_board, SLOT(loadSettings()));
dialog->show();
}
#include "app.moc"
// vim: expandtab:tabstop=4:shiftwidth=4
// kate: space-indent on; indent-width 4
......@@ -238,8 +238,8 @@ signals:
public slots:
/** Does most of the newGame work.
* This slot is called from the App::invokeNewGame() signal from App and
* should call App::newGame again to do the work that cannot be done
* This slot is called from the KShisen::invokeNewGame() signal from KShisen and
* should call KShisen::newGame again to do the work that cannot be done
* from Board.
*/
void newGame();
......
......@@ -22,30 +22,51 @@
#include "commit.h"
#include "version.h"
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <KAboutData>
#include <Kdelibs4ConfigMigrator>
#include <kglobal.h>
#include <QCommandLineParser>
#include <QApplication>
#include <KLocalizedString>
#include <QCommandLineParser>
static const char description[] = I18N_NOOP("A KDE game similar to Mahjongg");
int main(int argc, char **argv)
{
KAboutData aboutData("kshisen", 0, ki18n("Shisen-Sho"),
KSHISEN_VERSION " #" KSHISEN_COMMIT, ki18n(description), KAboutData::License_GPL,
ki18n("(c) 1997, Mario Weilguni"), KLocalizedString(), "http://games.kde.org/kshisen");
aboutData.addAuthor(ki18n("Frederik Schwarzer"), ki18n("Current Maintainer"), "schwarzer@kde.org");
aboutData.addAuthor(ki18n("Dave Corrie"), ki18n("Former Maintainer"), "kde@davecorrie.com");
aboutData.addAuthor(ki18n("Mario Weilguni"), ki18n("Original Author"), "mweilguni@sime.com");
aboutData.addCredit(ki18n("Mauricio Piacentini"), ki18n("KMahjonggLib integration for KDE4"), "mauricio@tabuleiro.com");
aboutData.addCredit(ki18n("Jason Lane"), ki18n("Added 'tiles removed' counter<br/>Tile smooth-scaling and window resizing"), "jglane@btopenworld.com");
aboutData.addCredit(ki18n("Thanks also to everyone who should be listed here but is not!"));
KCmdLineArgs::init(argc, argv, &aboutData);
KApplication a;
KGlobal::locale()->insertCatalog(QLatin1String("libkdegames"));
KGlobal::locale()->insertCatalog(QLatin1String("libkmahjongg"));
KAboutData aboutData("kshisen", i18n("Shisen-Sho"),
KSHISEN_VERSION " #" KSHISEN_COMMIT, i18n(description), KAboutLicense::GPL,
i18n("(c) 1997, Mario Weilguni"));
aboutData.setHomepage("http://games.kde.org/kshisen");
aboutData.addAuthor(i18n("Frederik Schwarzer"), i18n("Current Maintainer"), "schwarzer@kde.org");
aboutData.addAuthor(i18n("Dave Corrie"), i18n("Former Maintainer"), "kde@davecorrie.com");
aboutData.addAuthor(i18n("Mario Weilguni"), i18n("Original Author"), "mweilguni@sime.com");
aboutData.addCredit(i18n("Mauricio Piacentini"), i18n("KMahjonggLib integration for KDE4"), "mauricio@tabuleiro.com");
aboutData.addCredit(i18n("Jason Lane"), i18n("Added 'tiles removed' counter<br/>Tile smooth-scaling and window resizing"), "jglane@btopenworld.com");
aboutData.addCredit(i18n("Thanks also to everyone who should be listed here but is not!"));
QApplication a(argc, argv);
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
//PORTING SCRIPT: adapt aboutdata variable if necessary
aboutData.setupCommandLine(&parser);
parser.process(a);
aboutData.processCommandLine(&parser);
//KGlobal::locale()->insertCatalog(QLatin1String("libkdegames"));
//KGlobal::locale()->insertCatalog(QLatin1String("libkmahjongg"));
// Migrate pre-existing (4.x) configuration
QStringList configFiles;
configFiles.append(QLatin1String("kshisenrc"));
configFiles.append(QLatin1String("kshisen.notifyrc"));
Kdelibs4ConfigMigrator migrate(QLatin1String("kshisen"));
migrate.setConfigFiles(configFiles);
migrate.setUiFiles(QStringList() << QLatin1String("kshisenui.rc"));
migrate.migrate();
App *app = new App();
app->show();
......
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