Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

Port++

parent e20f4229
project(kolf)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames 4.9.0 REQUIRED)
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)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.3.0")
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(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DTRANSLATION_DOMAIN="kolf")
add_subdirectory( sounds )
......@@ -18,8 +43,6 @@ add_subdirectory( pics )
add_subdirectory( graphics )
add_subdirectory( doc )
include_directories( ${CMAKE_SOURCE_DIR}/libkdegames/highscore )
# we have a static copy of Box2D in our source tree
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external)
......@@ -94,9 +117,9 @@ set(kolf_LIB_SRCS
${box2d_SRCS}
)
kde4_add_library(kolfprivate SHARED ${kolf_LIB_SRCS})
add_library(kolfprivate SHARED ${kolf_LIB_SRCS})
target_link_libraries(kolfprivate ${KDE4_KIO_LIBS} ${KDE4_PHONON_LIBS} kdegames )
target_link_libraries(kolfprivate KF5::KIOCore Phonon::phonon4qt5 KF5KDEGames KF5::KDELibs4Support)
set_target_properties(kolfprivate PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install(TARGETS kolfprivate ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
......@@ -107,9 +130,9 @@ install(TARGETS kolfprivate ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKI
set(kolf_SRCS main.cpp)
kde4_add_app_icon(kolf_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/hi*-app-kolf.png")
kde4_add_executable( kolf ${kolf_SRCS} )
add_executable( kolf ${kolf_SRCS} )
target_link_libraries( kolf kolfprivate ${KDE4_KDEUI_LIBS})
target_link_libraries( kolf kolfprivate )
install(TARGETS kolf ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### install files ###############
......
########### install files ###############
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kolf)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kolf)
......@@ -39,6 +39,7 @@
#include <KNumInput>
#include <KRandom>
#include <KStandardDirs>
#include <KUrl>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/Contacts/b2Contact.h>
#include <Box2D/Dynamics/b2Fixture.h>
......
......@@ -37,7 +37,9 @@
#include <KStandardGameAction>
#include <KStandardGuiItem>
#include <KToggleAction>
#include <KUrl>
#include <KMimeType>
#include <KGlobal>
#include <QGridLayout>
#include <QTimer>
......@@ -102,17 +104,17 @@ void KolfWindow::setupActions()
highScoreAction = KStandardGameAction::highscores(this, SLOT(showHighScores()), actionCollection());
// Hole
editingAction = new KToggleAction(KIcon( QLatin1String( "document-properties") ), i18n("&Edit"), this);
editingAction = new KToggleAction(QIcon::fromTheme( QLatin1String( "document-properties") ), i18n("&Edit"), this);
actionCollection()->addAction("editing", editingAction);
connect(editingAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
editingAction->setShortcut(Qt::CTRL+Qt::Key_E);
newHoleAction = actionCollection()->addAction("newhole");
newHoleAction->setIcon(KIcon( QLatin1String( "document-new" )));
newHoleAction->setIcon(QIcon::fromTheme( QLatin1String( "document-new" )));
newHoleAction->setText(i18n("&New"));
connect(newHoleAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
newHoleAction->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_N);
clearHoleAction = actionCollection()->addAction("clearhole");
clearHoleAction->setIcon(KIcon( QLatin1String( "edit-clear-locationbar-ltr" )));
clearHoleAction->setIcon(QIcon::fromTheme( QLatin1String( "edit-clear-locationbar-ltr" )));
clearHoleAction->setText(KStandardGuiItem::clear().text());
connect(clearHoleAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
clearHoleAction->setShortcut(Qt::CTRL+Qt::Key_Delete);
......@@ -123,24 +125,24 @@ void KolfWindow::setupActions()
undoShotAction = KStandardAction::undo(this, SLOT(emptySlot()), this);
actionCollection()->addAction("undoshot", undoShotAction);
undoShotAction->setText(i18n("&Undo Shot"));
//replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, SLOT(emptySlot()), actionCollection(), "replay");
//replayShotAction = new QAction(i18n("&Replay Shot"), 0, this, SLOT(emptySlot()), actionCollection(), "replay");
// Go
holeAction = new KSelectAction(i18n("Switch to Hole"), this);
actionCollection()->addAction("switchhole", holeAction);
connect(holeAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
nextAction = actionCollection()->addAction("nexthole");
nextAction->setIcon(KIcon( QLatin1String( "go-next" )));
nextAction->setIcon(QIcon::fromTheme( QLatin1String( "go-next" )));
nextAction->setText(i18n("&Next Hole"));
connect(nextAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
nextAction->setShortcuts(KStandardShortcut::shortcut(KStandardShortcut::Forward));
prevAction = actionCollection()->addAction("prevhole");
prevAction->setIcon(KIcon( QLatin1String( "go-previous" )));
prevAction->setIcon(QIcon::fromTheme( QLatin1String( "go-previous" )));
prevAction->setText(i18n("&Previous Hole"));
connect(prevAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
prevAction->setShortcuts(KStandardShortcut::shortcut(KStandardShortcut::Back));
firstAction = actionCollection()->addAction("firsthole");
firstAction->setIcon(KIcon( QLatin1String( "go-home" )));
firstAction->setIcon(QIcon::fromTheme( QLatin1String( "go-home" )));
firstAction->setText(i18n("&First Hole"));
connect(firstAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
firstAction->setShortcuts(KStandardShortcut::shortcut(KStandardShortcut::Begin));
......@@ -149,7 +151,7 @@ void KolfWindow::setupActions()
connect(lastAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
lastAction->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_End); // why not KStandardShortcut::End (Ctrl+End)?
randAction = actionCollection()->addAction("randhole");
randAction->setIcon(KIcon( QLatin1String( "go-jump" )));
randAction->setIcon(QIcon::fromTheme( QLatin1String( "go-jump" )));
randAction->setText(i18n("&Random Hole"));
connect(randAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
......@@ -167,7 +169,7 @@ void KolfWindow::setupActions()
connect(useAdvancedPuttingAction, SIGNAL(toggled(bool)), this, SLOT(useAdvancedPuttingChanged(bool)));
useAdvancedPuttingAction->setChecked(configGroup.readEntry("useAdvancedPutting", false));
showInfoAction = new KToggleAction(KIcon( QLatin1String( "help-about")), i18n("Show &Info"), this);
showInfoAction = new KToggleAction(QIcon::fromTheme( QLatin1String( "help-about")), i18n("Show &Info"), this);
actionCollection()->addAction("showinfo", showInfoAction);
connect(showInfoAction, SIGNAL(triggered(bool)), SLOT(emptySlot()));
showInfoAction->setShortcut(Qt::CTRL+Qt::Key_I);
......
......@@ -25,9 +25,9 @@
#include "game.h"
#include "itemfactory.h"
#include <KUrl>
class QGridLayout;
class KAction;
class QAction;
class KSelectAction;
class KToggleAction;
......@@ -97,11 +97,11 @@ private:
QGridLayout *layout;
ScoreBoard *scoreboard;
KToggleAction *editingAction;
KAction *newHoleAction;
KAction *resetHoleAction;
QAction *newHoleAction;
QAction *resetHoleAction;
QAction *undoShotAction;
//QAction *replayShotAction;
KAction *clearHoleAction;
QAction *clearHoleAction;
QAction *tutorialAction;
QAction *newAction;
QAction *endAction;
......@@ -113,10 +113,10 @@ private:
QAction *aboutAction;
KSelectAction *holeAction;
QAction *highScoreAction;
KAction *nextAction;
KAction *prevAction;
KAction *firstAction;
KAction *lastAction;
QAction *nextAction;
QAction *prevAction;
QAction *firstAction;
QAction *lastAction;
QAction *randAction;
KToggleAction *showInfoAction;
KToggleAction *useMouseAction;
......
......@@ -21,7 +21,7 @@
#include <kapplication.h>
#include <klocale.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <K4AboutData>
#include <kdebug.h>
#include <kurl.h>
#include <kglobal.h>
......@@ -39,7 +39,7 @@ static const char version[] = "1.10"; // = KDE 4.6 Release
int main(int argc, char **argv)
{
KAboutData aboutData( "kolf", 0, ki18n("Kolf"), version, ki18n(description), KAboutData::License_GPL, ki18n("(c) 2002-2010, Kolf developers"), KLocalizedString(), "http://games.kde.org/kolf");
K4AboutData aboutData( "kolf", 0, ki18n("Kolf"), version, ki18n(description), K4AboutData::License_GPL, ki18n("(c) 2002-2010, Kolf developers"), KLocalizedString(), "http://games.kde.org/kolf");
aboutData.addAuthor(ki18n("Stefan Majewsky"), ki18n("Current maintainer"), "majewsky@gmx.net");
aboutData.addAuthor(ki18n("Jason Katz-Brown"), ki18n("Former main author"), "jasonkb@mit.edu");
......
......@@ -20,6 +20,7 @@
#include "newgame.h"
#include "game.h"
#include <KUrl>
#include <QBoxLayout>
#include <QLabel>
#include <QListWidget>
......@@ -29,13 +30,14 @@
#include <KScoreDialog>
#include <KSeparator>
#include <KStandardDirs>
#include <KGlobal>
#include <KDialog>
NewGameDialog::NewGameDialog(bool enableCourses)
: KPageDialog()
{
setCaption(i18n("New Game"));
setButtons(Ok | Cancel);
setDefaultButton(Ok);
setWindowTitle(i18n("New Game"));
//QT5 setButtons(Ok | Cancel);
//QT5 setDefaultButton(Ok);
setMinimumSize(640,310);
connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
......@@ -53,8 +55,8 @@ NewGameDialog::NewGameDialog(bool enableCourses)
addPage(playerPage, i18n("Players"));
QVBoxLayout *bigLayout = new QVBoxLayout(playerPage);
bigLayout->setMargin( marginHint() );
bigLayout->setSpacing( spacingHint() );
//QT5 bigLayout->setMargin( marginHint() );
//QT5 bigLayout->setSpacing( spacingHint() );
addButton = new KPushButton(i18n("&New Player"), playerPage);
bigLayout->addWidget(addButton);
......@@ -95,11 +97,11 @@ NewGameDialog::NewGameDialog(bool enableCourses)
pageItem->setHeader(i18n("Course"));
addPage(pageItem);
QVBoxLayout *coursePageLayout = new QVBoxLayout(coursePage);
coursePageLayout->setMargin( marginHint() );
coursePageLayout->setSpacing( spacingHint() );
//QT5 coursePageLayout->setMargin( marginHint() );
//QT5 coursePageLayout->setSpacing( spacingHint() );
QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->setSpacing( spacingHint() );
//QT5 hlayout->setSpacing( spacingHint() );
coursePageLayout->addLayout( hlayout );
......@@ -138,7 +140,7 @@ NewGameDialog::NewGameDialog(bool enableCourses)
connect(courseList, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
QVBoxLayout *detailLayout = new QVBoxLayout;
detailLayout->setSpacing( spacingHint() );
//QT5 detailLayout->setSpacing( spacingHint() );
hlayout->addLayout( detailLayout );
name = new QLabel(coursePage);
detailLayout->addWidget(name);
......@@ -146,7 +148,7 @@ NewGameDialog::NewGameDialog(bool enableCourses)
detailLayout->addWidget(author);
QHBoxLayout *minorLayout = new QHBoxLayout;
minorLayout->setSpacing( spacingHint() );
//QT5 minorLayout->setSpacing( spacingHint() );
detailLayout->addLayout( minorLayout );
par = new QLabel(coursePage);
minorLayout->addWidget(par);
......@@ -162,7 +164,7 @@ NewGameDialog::NewGameDialog(bool enableCourses)
detailLayout->addWidget(new KSeparator(coursePage));
minorLayout = new QHBoxLayout;
minorLayout->setSpacing( spacingHint() );
//QT5 minorLayout->setSpacing( spacingHint() );
detailLayout->addLayout( minorLayout );
KPushButton *addCourseButton = new KPushButton(i18n("Add..."), coursePage);
......@@ -184,8 +186,8 @@ NewGameDialog::NewGameDialog(bool enableCourses)
addPage(pageItem);
QVBoxLayout *vlayout = new QVBoxLayout(optionsPage);
vlayout->setMargin( marginHint() );
vlayout->setSpacing( spacingHint() );
//QT5 vlayout->setMargin( marginHint() );
//QT5 vlayout->setSpacing( spacingHint() );
mode = new QCheckBox(i18n("&Strict mode"), optionsPage);
vlayout->addWidget(mode);
......@@ -225,7 +227,7 @@ void NewGameDialog::slotOk()
config->sync();
KDialog::accept();
//QT5 KDialog::accept();
}
void NewGameDialog::courseSelected(int index)
......
......@@ -5,7 +5,7 @@
########### install files ###############
kde4_install_icons( ${ICON_INSTALL_DIR} )
ecm_install_icons( ${ICON_INSTALL_DIR} )
......
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