Commit ec76064f authored by Halla Rempt's avatar Halla Rempt

Fork KDialog into KoDialog

We have a hundred or so kdialog-based dialogs in calligra. It's not
feasible to port all of them the to the much clumsier QDialog api,
so for KoDialog and strip it of kdelibs4support dependencies.
parent 1022f8c9
......@@ -44,7 +44,7 @@
#include <QMessageBox>
#include <kmenubar.h>
#include <kxmlguifactory.h>
#include <kdialog.h>
#include <KoDialog.h>
#include <KoCanvasBase.h>
#include <KisMainWindow.h>
......@@ -289,13 +289,13 @@ void MainWindow::resetWindowTitle()
if(url.scheme() == "temp")
fileName = i18n("Untitled");
KDialog::CaptionFlags flags = KDialog::HIGCompliantCaption;
KoDialog::CaptionFlags flags = KoDialog::HIGCompliantCaption;
KisDocument* document = DocumentManager::instance()->document();
if (document && document->isModified() ) {
flags |= KDialog::ModifiedCaption;
flags |= KoDialog::ModifiedCaption;
}
setWindowTitle( KDialog::makeStandardCaption(fileName, this, flags) );
setWindowTitle( KoDialog::makeStandardCaption(fileName, this, flags) );
}
void MainWindow::switchDesktopForced()
......
......@@ -29,7 +29,7 @@
#include <recorder/kis_recorded_action_creator_factory.h>
#include <recorder/kis_recorded_action_creator.h>
#include <kdialog.h>
#include <KoDialog.h>
#include <KoIcon.h>
#include <QMessageBox>
......@@ -98,11 +98,11 @@ void KisActionsEditor::slotCreateAction(const QString& _id)
KisRecordedAction* action = 0;
if(f->requireCreator())
{
KDialog d;
d.setButtons(KDialog::Ok | KDialog::Cancel);
KoDialog d;
d.setButtons(KoDialog::Ok | KoDialog::Cancel);
KisRecordedActionCreator* creator = f->createCreator(&d);
d.setMainWidget(creator);
if(d.exec() == KDialog::Accepted)
if(d.exec() == KoDialog::Accepted)
{
action = creator->createAction();
if(!action) {
......
......@@ -22,7 +22,7 @@
#include <klocalizedstring.h>
KisActionsEditorDialog::KisActionsEditorDialog(QWidget* parent) : KDialog(parent),
KisActionsEditorDialog::KisActionsEditorDialog(QWidget* parent) : KoDialog(parent),
m_actionsEditor(new KisActionsEditor(this))
{
setMainWidget(m_actionsEditor);
......
......@@ -20,11 +20,11 @@
#ifndef _KIS_ACTIONS_EDITOR_DIALOG_H_
#define _KIS_ACTIONS_EDITOR_DIALOG_H_
#include <kdialog.h>
#include <KoDialog.h>
class KisActionsEditor;
class KisActionsEditorDialog : public KDialog
class KisActionsEditorDialog : public KoDialog
{
public:
KisActionsEditorDialog(QWidget* parent);
......
......@@ -33,7 +33,7 @@
DlgClonesArray::DlgClonesArray(KisViewManager *view, QWidget *parent)
: KDialog(parent),
: KoDialog(parent),
m_view(view),
m_applicator(0),
m_baseLayer(m_view->activeLayer())
......
......@@ -19,7 +19,7 @@
#ifndef DLG_CLONESARRAY
#define DLG_CLONESARRAY
#include <kdialog.h>
#include <KoDialog.h>
#include <kis_global.h>
#include "kis_types.h"
......@@ -39,7 +39,7 @@ public:
}
};
class DlgClonesArray: public KDialog
class DlgClonesArray: public KoDialog
{
Q_OBJECT
......
......@@ -161,7 +161,7 @@ quint32 matchColors(const QColor & c, enumAction action)
}
DlgColorRange::DlgColorRange(KisViewManager *view, QWidget *parent)
: KDialog(parent)
: KoDialog(parent)
, m_selectionCommandsAdded(0)
{
setCaption(i18n("Color Range"));
......
......@@ -22,7 +22,7 @@
#include <QCursor>
#include <kdialog.h>
#include <KoDialog.h>
#include <kis_selection.h> // For enums
#include <kis_pixel_selection.h>
......@@ -60,7 +60,7 @@ public:
* This dialog allows the user to create a selection mask based
* on a (range of) colors.
*/
class DlgColorRange: public KDialog
class DlgColorRange: public KoDialog
{
Q_OBJECT
......
......@@ -38,7 +38,7 @@
DlgColorSpaceConversion::DlgColorSpaceConversion(QWidget * parent,
const char * name)
: KDialog(parent)
: KoDialog(parent)
{
setButtons(Ok | Cancel);
setDefaultButton(Ok);
......
......@@ -22,7 +22,7 @@
#include <QButtonGroup>
#include <kdialog.h>
#include <KoDialog.h>
#include <KoID.h>
......@@ -43,7 +43,7 @@ public:
/**
* XXX
*/
class DlgColorSpaceConversion: public KDialog
class DlgColorSpaceConversion: public KoDialog
{
Q_OBJECT
......
......@@ -29,7 +29,7 @@
DlgHistogram::DlgHistogram(QWidget * parent, const char * name)
: KDialog(parent)
: KoDialog(parent)
{
setCaption(i18n("Histogram"));
setButtons(Ok | Cancel);
......
......@@ -20,7 +20,7 @@
#ifndef DLG_HISTOGRAM
#define DLG_HISTOGRAM
#include <kdialog.h>
#include <KoDialog.h>
#include "kis_types.h"
......@@ -32,7 +32,7 @@ class KisHistogramWidget;
*
* XXX: Also for complete image?
*/
class DlgHistogram: public KDialog
class DlgHistogram: public KoDialog
{
Q_OBJECT
......
......@@ -32,7 +32,7 @@
static const QString percentStr(i18n("Percent (%)"));
DlgCanvasSize::DlgCanvasSize(QWidget *parent, int width, int height, double resolution)
: KDialog(parent)
: KoDialog(parent)
, m_keepAspect(true)
, m_aspectRatio((double)width / height)
, m_resolution(resolution)
......
......@@ -21,7 +21,7 @@
#ifndef DLG_CANVASSIZE
#define DLG_CANVASSIZE
#include <kdialog.h>
#include <KoDialog.h>
#include <kicon.h>
......@@ -39,7 +39,7 @@ public:
class DlgCanvasSize: public KDialog
class DlgCanvasSize: public KoDialog
{
Q_OBJECT
......
......@@ -37,7 +37,7 @@ static const QString pixelsInchStr(i18n("Pixels/Inch"));
static const QString pixelsCentimeterStr(i18n("Pixels/Centimeter"));
DlgImageSize::DlgImageSize(QWidget *parent, int width, int height, double resolution)
: KDialog(parent)
: KoDialog(parent)
, m_aspectRatio(((double) width) / height)
, m_originalWidth(width)
, m_originalHeight(height)
......
......@@ -21,7 +21,7 @@
#ifndef DLG_IMAGESIZE
#define DLG_IMAGESIZE
#include <kdialog.h>
#include <KoDialog.h>
class KisFilterStrategy;
class WdgImageSize;
......@@ -38,7 +38,7 @@ public:
}
};
class DlgImageSize: public KDialog
class DlgImageSize: public KoDialog
{
Q_OBJECT
......
......@@ -34,7 +34,7 @@ static const QString percentStr(i18n("Percent (%)"));
DlgLayerSize::DlgLayerSize(QWidget * parent, const char * name,
int width, int height, double resolution)
: KDialog(parent)
: KoDialog(parent)
, m_aspectRatio(((double) width) / height)
, m_originalWidth(width)
, m_originalHeight(height)
......
......@@ -22,7 +22,7 @@
#ifndef DLG_LAYERSIZE
#define DLG_LAYERSIZE
#include <kdialog.h>
#include <KoDialog.h>
#include "ui_wdg_layersize.h"
......@@ -38,7 +38,7 @@ public:
class KisFilterStrategy;
class DlgLayerSize: public KDialog
class DlgLayerSize: public KoDialog
{
Q_OBJECT
......
......@@ -29,7 +29,7 @@
#include <kis_paint_device.h>
DlgImagesplit::DlgImagesplit(KisViewManager* view, QString suffix, QStringList listMimeFilter)
: KDialog(view->mainWindow())
: KoDialog(view->mainWindow())
{
m_page = new WdgImagesplit(this);
......
......@@ -21,7 +21,7 @@
#ifndef DLG_IMAGESPLIT
#define DLG_IMAGESPLIT
#include <kdialog.h>
#include <KoDialog.h>
#include <kis_types.h>
......@@ -32,7 +32,7 @@ class KisViewManager;
* This dialog allows the user to create a selection mask based
* on a (range of) colors.
*/
class DlgImagesplit: public KDialog
class DlgImagesplit: public KoDialog
{
Q_OBJECT
......
......@@ -33,7 +33,7 @@
#include <kis_config.h>
DlgLayerSplit::DlgLayerSplit()
: KDialog()
: KoDialog()
{
m_page = new WdgLayerSplit(this);
......
......@@ -19,7 +19,7 @@
#ifndef DLG_LAYERSPLIT
#define DLG_LAYERSPLIT
#include <kdialog.h>
#include <KoDialog.h>
#include <kis_types.h>
......@@ -29,7 +29,7 @@
* This dialog allows the user to create a selection mask based
* on a (range of) colors.
*/
class DlgLayerSplit: public KDialog
class DlgLayerSplit: public KoDialog
{
Q_OBJECT
......
......@@ -22,7 +22,7 @@
#include <kis_debug.h>
DlgOffsetImage::DlgOffsetImage(QWidget * parent, const char * name, QSize imageSize)
: KDialog(parent),
: KoDialog(parent),
m_offsetSize(imageSize)
{
setCaption("BUG: No sane caption is set");
......
......@@ -19,7 +19,7 @@
#ifndef DLG_OFFSETIMAGE
#define DLG_OFFSETIMAGE
#include <kdialog.h>
#include <KoDialog.h>
#include <kis_global.h>
#include "ui_wdg_offsetimage.h"
......@@ -35,7 +35,7 @@ public:
}
};
class DlgOffsetImage: public KDialog
class DlgOffsetImage: public KoDialog
{
Q_OBJECT
......
......@@ -35,7 +35,7 @@
#define ICON_SIZE 48
DlgBundleManager::DlgBundleManager(KisActionManager* actionMgr, QWidget *parent)
: KDialog(parent)
: KoDialog(parent)
, m_page(new QWidget())
, m_ui(new Ui::WdgDlgBundleManager)
, m_currentBundle(0)
......@@ -169,7 +169,7 @@ void DlgBundleManager::accept()
}
KDialog::accept();
KoDialog::accept();
}
void DlgBundleManager::addSelected()
......
......@@ -21,7 +21,7 @@
#include <QWidget>
#include <kdialog.h>
#include <KoDialog.h>
#include "kis_action_manager.h"
class ResourceBundle;
......@@ -33,7 +33,7 @@ namespace Ui
class WdgDlgBundleManager;
}
class DlgBundleManager : public KDialog
class DlgBundleManager : public KoDialog
{
Q_OBJECT
public:
......
......@@ -48,7 +48,7 @@
#define ICON_SIZE 48
DlgCreateBundle::DlgCreateBundle(ResourceBundle *bundle, QWidget *parent)
: KDialog(parent)
: KoDialog(parent)
, m_ui(new Ui::WdgDlgCreateBundle)
, m_bundle(bundle)
{
......@@ -187,7 +187,7 @@ void DlgCreateBundle::accept()
cfg.writeEntry<QString>("BundleWebsite", m_ui->editWebsite->text());
cfg.writeEntry<QString>("BundleLicense", m_ui->editLicense->text());
}
KDialog::accept();
KoDialog::accept();
}
}
}
......
......@@ -19,7 +19,7 @@
#ifndef KOBUNDLECREATIONWIDGET_H
#define KOBUNDLECREATIONWIDGET_H
#include <kdialog.h>
#include <KoDialog.h>
class ResourceBundle;
......@@ -28,7 +28,7 @@ namespace Ui
class WdgDlgCreateBundle;
}
class DlgCreateBundle : public KDialog
class DlgCreateBundle : public KoDialog
{
Q_OBJECT
......
......@@ -28,7 +28,7 @@
DlgRotateImage::DlgRotateImage(QWidget * parent,
const char * name)
: KDialog(parent)
: KoDialog(parent)
{
setCaption(i18n("Rotate Image"));
setButtons(Ok | Cancel);
......
......@@ -20,7 +20,7 @@
#ifndef DLG_ROTATEIMAGE
#define DLG_ROTATEIMAGE
#include <kdialog.h>
#include <KoDialog.h>
#include "kis_global.h"
......@@ -41,7 +41,7 @@ public:
}
};
class DlgRotateImage: public KDialog
class DlgRotateImage: public KoDialog
{
Q_OBJECT
......
......@@ -31,7 +31,7 @@ DlgSeparate::DlgSeparate(const QString & imageCS,
const QString & layerCS,
QWidget * parent,
const char * name)
: KDialog(parent)
: KoDialog(parent)
, m_imageCS(imageCS)
, m_layerCS(layerCS)
{
......
......@@ -20,7 +20,7 @@
#ifndef DLG_SEPARATE
#define DLG_SEPARATE
#include <kdialog.h>
#include <KoDialog.h>
#include <kis_channel_separator.h>
#include "ui_wdg_separations.h"
......@@ -36,7 +36,7 @@ public:
* This dialog allows the user to configure the decomposition of an image
* into layers: one layer for each color channel.
*/
class DlgSeparate: public KDialog
class DlgSeparate: public KoDialog
{
Q_OBJECT
......
......@@ -27,7 +27,7 @@
DlgShearImage::DlgShearImage(QWidget * parent,
const char * name)
: KDialog(parent)
: KoDialog(parent)
{
setCaption(i18n("Shear Image"));
setButtons(Ok | Cancel);
......
......@@ -20,7 +20,7 @@
#ifndef DLG_SHEARIMAGE
#define DLG_SHEARIMAGE
#include <kdialog.h>
#include <KoDialog.h>
#include "ui_wdg_shearimage.h"
......@@ -34,7 +34,7 @@ public:
}
};
class DlgShearImage: public KDialog
class DlgShearImage: public KoDialog
{
Q_OBJECT
......
......@@ -23,7 +23,7 @@
#include <QSlider>
#include <QApplication>
#include <kdialog.h>
#include <KoDialog.h>
#include <kpluginfactory.h>
#include <QUrl>
......@@ -68,9 +68,9 @@ KisImportExportFilter::ConversionStatus exrExport::convert(const QByteArray& fro
KisImageWSP image = input->image();
Q_CHECK_PTR(image);
KDialog dialog;
KoDialog dialog;
dialog.setWindowTitle(i18n("OpenEXR Export Options"));
dialog.setButtons(KDialog::Ok | KDialog::Cancel);
dialog.setButtons(KoDialog::Ok | KoDialog::Cancel);
Ui::ExrExportWidget widget;
QWidget *page = new QWidget(&dialog);
widget.setupUi(page);
......
......@@ -33,7 +33,7 @@
#include <KoColorSpaceRegistry.h>
#include <KoColorModelStandardIds.h>
#include <kdialog.h>
#include <KoDialog.h>
#include <kis_debug.h>
#include <KisDocument.h>
......@@ -84,9 +84,9 @@ KisImportExportFilter::ConversionStatus KisHeightMapExport::convert(const QByteA
return KisImportExportFilter::WrongFormat;
}
KDialog* kdb = new KDialog(0);
KoDialog* kdb = new KoDialog(0);
kdb->setWindowTitle(i18n("HeightMap Export Options"));
kdb->setButtons(KDialog::Ok | KDialog::Cancel);
kdb->setButtons(KoDialog::Ok | KoDialog::Cancel);
Ui::WdgOptionsHeightMap optionsHeightMap;
......