Commit 929a5eee authored by Yuri Chornoivan's avatar Yuri Chornoivan

Port away from kdelibs4support

parent ebcc422c
......@@ -17,7 +17,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
DBusAddons
DocTools
I18n
KDELibs4Support
KIO
TextWidgets
WidgetsAddons
......@@ -124,9 +123,14 @@ target_link_libraries(kolfprivate
Qt5::Gui
Qt5::Widgets
KF5::Crash
KF5::Completion
KF5::ConfigCore
KF5::DBusAddons
KF5::KDELibs4Support
KF5::I18n
KF5::JobWidgets
KF5::KIOCore
KF5::TextWidgets
KF5::XmlGui
KF5KDEGames
)
......
......@@ -25,7 +25,7 @@
#include "tagaro/spriteobjectitem.h"
#include <QGraphicsRectItem>
#include <KDebug>
class b2Body;
class b2World;
......
......@@ -29,6 +29,7 @@
#include <QBoxLayout>
#include <QCheckBox>
#include <QFileDialog>
#include <QGlobalStatic>
#include <QLabel>
#include <QMouseEvent>
#include <QSpinBox>
......@@ -37,6 +38,7 @@
#include <QUrl>
#include <KGameRenderer>
#include <KLineEdit>
#include <KLocalizedString>
#include <KMessageBox>
#include <KRandom>
#include <KgTheme>
......@@ -100,8 +102,8 @@ class KolfRenderer : public KGameRenderer
}
};
K_GLOBAL_STATIC(KolfRenderer, g_renderer)
K_GLOBAL_STATIC(KolfWorld, g_world)
Q_GLOBAL_STATIC(KolfRenderer, g_renderer)
Q_GLOBAL_STATIC(KolfWorld, g_world)
KGameRenderer* Kolf::renderer()
{
......
......@@ -25,25 +25,32 @@
#include "kcomboboxdialog.h"
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <KConfigGroup>
#include <KHistoryComboBox>
#include <KLocalizedString>
KComboBoxDialog::KComboBoxDialog( const QString &_text, const QStringList &_items, const QString& _value, bool showDontAskAgain, QWidget *parent )
: KDialog( parent)
: QDialog( parent)
{
setButtons(Ok);
setDefaultButton(Ok);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
auto mainLayout = new QVBoxLayout(this);
auto okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &KComboBoxDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &KComboBoxDialog::reject);
setModal(true);
showButtonSeparator(true);
QFrame *frame = new QFrame(this);
setMainWidget(frame);
QFrame *frame = new QFrame( this );
QVBoxLayout *topLayout = new QVBoxLayout( frame );
QLabel *label = new QLabel(_text, frame );
topLayout->addWidget( label, 1 );
combo = new KHistoryComboBox( frame);
combo = new KHistoryComboBox( frame );
combo->setEditable(false);
combo->addItems( _items );
topLayout->addWidget( combo, 1 );
......@@ -59,6 +66,14 @@ KComboBoxDialog::KComboBoxDialog( const QString &_text, const QStringList &_item
if ( !_value.isNull() )
combo->setCurrentItem( _value );
combo->setFocus();
QFrame* separationLine = new QFrame();
separationLine->setFrameShape(QFrame::HLine);
separationLine->setFrameShadow(QFrame::Sunken);
mainLayout->addWidget( frame );
mainLayout->addWidget( separationLine );
mainLayout->addWidget( buttonBox );
}
KComboBoxDialog::~KComboBoxDialog()
......@@ -98,7 +113,7 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption,
KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), parent );
if ( !_caption.isNull() )
dlg.setCaption( _caption );
dlg.setWindowTitle( _caption );
dlg.exec();
......@@ -122,7 +137,7 @@ QString KComboBoxDialog::getText(const QString &_caption, const QString &_text,
KConfigGroup *configGroup = 0;
KComboBoxDialog dlg(_text, QStringList(), _value, false, parent);
if ( !_caption.isNull() )
dlg.setCaption( _caption );
dlg.setWindowTitle( _caption );
KHistoryComboBox * const box = dlg.comboBox();
box->setEditable(true);
......@@ -151,5 +166,3 @@ QString KComboBoxDialog::getText(const QString &_caption, const QString &_text,
return dlg.text();
}
......@@ -25,15 +25,15 @@
#ifndef KCOMBOBOX_DIALOG_H
#define KCOMBOBOX_DIALOG_H
#include <QDialog>
#include <KConfig>
#include <KDialog>
#include <KGlobal>
#include <KSharedConfig>
class QCheckBox;
class KHistoryComboBox;
///Dialog for user to choose an item from a QStringList.
class KComboBoxDialog : public KDialog
class KComboBoxDialog : public QDialog
{
Q_OBJECT
......@@ -89,7 +89,7 @@ public:
* @param ok Variable to store whether the user hit OK
* @param parent Parent widget for the dialog
* @param configName Name of the dialog for saving the completion and history
* @parma config KConfig for saving the completion and history
* @param config KConfig for saving the completion and history
*/
static QString getText(const QString &_caption, const QString &_text,
const QString &_value = QString(),
......
......@@ -29,22 +29,21 @@
#include <KIO/CopyJob>
#include <KIO/Job>
#include <KJobWidgets>
#include <KIO/NetAccess>
#include <KLocalizedString>
#include <KMessageBox>
#include <KScoreDialog>
#include <KSelectAction>
#include <KStatusBar>
#include <KSharedConfig>
#include <KStandardAction>
#include <KStandardGameAction>
#include <KStandardGuiItem>
#include <KToggleAction>
#include <KMimeType>
#include <KGlobal>
#include <QFileDialog>
#include <QGridLayout>
#include <QMimeDatabase>
#include <QMimeType>
#include <QStandardPaths>
#include <QStatusBar>
#include <QTemporaryFile>
#include <QTimer>
#include <QUrl>
......
......@@ -16,23 +16,22 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <QFile>
#include <KLocalizedString>
#include <KDBusService>
#include <KAboutData>
#include <KCrash>
#include <KDebug>
#include <KGlobal>
#include "kolf.h"
#include <iostream>
#include <QApplication>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QCommandLineParser>
#include <QDebug>
#include <QFile>
#include <QUrl>
#include <KAboutData>
#include <KCrash>
#include <KDBusService>
#include <KLocalizedString>
using namespace std;
static const char description[] =
......
......@@ -27,11 +27,11 @@
#include <QPushButton>
#include <QStandardPaths>
#include <QUrl>
#include <KDialog>
#include <KGlobal>
#include <KLocalizedString>
#include <KMessageBox>
#include <KScoreDialog>
#include <KSeparator>
#include <KSharedConfig>
NewGameDialog::NewGameDialog(bool enableCourses)
: KPageDialog()
......
......@@ -32,7 +32,7 @@ ScoreBoard::ScoreBoard(QWidget *parent)
resizeColumnToContents(columnCount() - 1);
verticalHeader()->setResizeMode(QHeaderView::Fixed);
verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
doUpdateHeight();
}
......
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