Commit 7b58d2fb authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make kowidgets build

Note: KoDocumentInfoDlg is pretty broken because KPageDialog is now a
broken QDialog instead of KDialog.
parent 00cfb854
......@@ -2,7 +2,7 @@ if (SHOULD_BUILD_LIB_CALLIGRA)
add_subdirectory( version )
add_subdirectory( koplugin )
add_subdirectory( widgetutils )
# add_subdirectory( widgets )
add_subdirectory( widgets )
add_subdirectory( odf )
add_subdirectory( textlayout )
add_subdirectory( kotext )
......
......@@ -235,4 +235,6 @@ void KoColorSetWidget::resizeEvent(QResizeEvent *event)
QFrame::resizeEvent(event);
}
#include <KoColorSetWidget.moc>
//have to include this because of Q_PRIVATE_SLOT
#include "moc_KoColorSetWidget.cpp"
......@@ -33,6 +33,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kglobal.h>
#include "ui_KoCsvImportDialog.h"
......
......@@ -370,5 +370,5 @@ void KoDockWidgetTitleBar::Private::updateIcons()
}
#include <KoDockWidgetTitleBar.moc>
//have to include this because of Q_PRIVATE_SLOT
#include "moc_KoDockWidgetTitleBar.cpp"
......@@ -59,7 +59,7 @@ public:
}
KoDockWidgetTitleBar* thePublic;
KIcon openIcon, closeIcon, lockIcon, floatIcon, removeIcon; // close/open are for collapsing
QIcon openIcon, closeIcon, lockIcon, floatIcon, removeIcon; // close/open are for collapsing
QAbstractButton* closeButton;
QAbstractButton* floatButton;
QAbstractButton* collapseButton;
......
......@@ -36,6 +36,8 @@
#include <kglobal.h>
#include <kmessagebox.h>
#include <kmainwindow.h>
#include <kdialog.h>
#include <kurl.h>
#include <QLabel>
#include <QLineEdit>
......@@ -89,11 +91,12 @@ KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo)
{
d->info = docInfo;
setCaption(i18n("Document Information"));
setInitialSize(QSize(500, 500));
// TODO: KF5 port to QDialog
setWindowTitle(i18n("Document Information"));
// setInitialSize(QSize(500, 500));
setFaceType(KPageDialog::List);
setButtons(KDialog::Ok | KDialog::Cancel);
setDefaultButton(KDialog::Ok);
// setButtons(KDialog::Ok | KDialog::Cancel);
// setDefaultButton(KDialog::Ok);
d->aboutUi = new Ui::KoDocumentInfoAboutWidget();
QWidget *infodlg = new QWidget();
......@@ -135,7 +138,7 @@ KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo)
d->authorUi->setupUi(authordlg);
page = new KPageWidgetItem(authordlg, i18n("Author"));
page->setHeader(i18n("Last saved by"));
page->setIcon(koIcon("user-identity"));
7 page->setIcon(koIcon("user-identity"));
addPage(page);
d->pages.append(page);
......@@ -155,22 +158,23 @@ KoDocumentInfoDlg::~KoDocumentInfoDlg()
void KoDocumentInfoDlg::slotButtonClicked(int button)
{
emit buttonClicked(static_cast<KDialog::ButtonCode>(button));
switch (button) {
case Ok:
foreach(KPageWidgetItem* item, d->pages) {
KoPageWidgetItemAdapter *page = dynamic_cast<KoPageWidgetItemAdapter*>(item);
if (page) {
if (page->shouldDialogCloseBeVetoed()) {
return;
}
}
}
slotApply();
accept();
return;
}
KPageDialog::slotButtonClicked(button);
// TODO: KF5 port to QDialog
// emit buttonClicked(static_cast<KDialog::ButtonCode>(button));
// switch (button) {
// case Ok:
// foreach(KPageWidgetItem* item, d->pages) {
// KoPageWidgetItemAdapter *page = dynamic_cast<KoPageWidgetItemAdapter*>(item);
// if (page) {
// if (page->shouldDialogCloseBeVetoed()) {
// return;
// }
// }
// }
// slotApply();
// accept();
// return;
// }
// KPageDialog::slotButtonClicked(button);
}
bool KoDocumentInfoDlg::isDocumentSaved()
......
......@@ -20,11 +20,13 @@
#include "KoDocumentInfoPropsPage.h"
#include <QIcon>
#include "KoOdfReadStore.h"
#include "KoStore.h"
#include "KoDocumentInfo.h"
#include "KoDocumentInfoDlg.h"
#include <kurl.h>
#include <kdebug.h>
class KoDocumentInfoPropsPage::KoDocumentInfoPropsPagePrivate
......
......@@ -24,6 +24,7 @@
#include <QImageReader>
#include <QClipboard>
#include <kglobal.h>
#include <kconfiggroup.h>
#include <kmimetype.h>
#include <klocale.h>
......
......@@ -99,7 +99,7 @@ QStringList KoGlobal::_listOfLanguages()
void KoGlobal::createListOfLanguages()
{
KConfig config("all_languages", KConfig::NoGlobals, "locale");
KConfig config("all_languages", KConfig::NoGlobals);
// Note that we could also use KLocale::allLanguagesTwoAlpha
QMap<QString, bool> seenLanguages;
......
......@@ -33,6 +33,7 @@
#include <kconfiggroup.h>
#include <klocale.h>
#include <kselectaction.h>
#include <kglobal.h>
#include <QMap>
#include <QList>
......
......@@ -87,7 +87,7 @@ public:
QStringList fileNames;
foreach (const QString &extension, extensionList) {
fileNames += KGlobal::mainComponent().dirs()->findAllResources(type().toLatin1(), extension, KStandardDirs::Recursive | KStandardDirs::NoDuplicates);
fileNames += KGlobal::dirs()->findAllResources(type().toLatin1(), extension, KStandardDirs::Recursive | KStandardDirs::NoDuplicates);
}
return fileNames;
......@@ -339,7 +339,7 @@ public:
/// Returns path where to save user defined and imported resources to
virtual QString saveLocation() {
return KGlobal::mainComponent().dirs()->saveLocation(type().toLatin1());
return KGlobal::dirs()->saveLocation(type().toLatin1());
}
/**
......
......@@ -161,21 +161,21 @@ struct KoResourceServerProvider::Private
KoResourceServerProvider::KoResourceServerProvider() : d(new Private)
{
KGlobal::mainComponent().dirs()->addResourceType("ko_patterns", "data", "krita/patterns/", true);
KGlobal::mainComponent().dirs()->addResourceDir("ko_patterns", "/usr/share/create/patterns/gimp");
KGlobal::mainComponent().dirs()->addResourceDir("ko_patterns", QDir::homePath() + QString("/.create/patterns/gimp"));
KGlobal::dirs()->addResourceType("ko_patterns", "data", "krita/patterns/", true);
KGlobal::dirs()->addResourceDir("ko_patterns", "/usr/share/create/patterns/gimp");
KGlobal::dirs()->addResourceDir("ko_patterns", QDir::homePath() + QString("/.create/patterns/gimp"));
KGlobal::mainComponent().dirs()->addResourceType("ko_gradients", "data", "karbon/gradients/");
KGlobal::mainComponent().dirs()->addResourceType("ko_gradients", "data", "krita/gradients/", true);
KGlobal::mainComponent().dirs()->addResourceDir("ko_gradients", "/usr/share/create/gradients/gimp");
KGlobal::mainComponent().dirs()->addResourceDir("ko_gradients", QDir::homePath() + QString("/.create/gradients/gimp"));
KGlobal::dirs()->addResourceType("ko_gradients", "data", "karbon/gradients/");
KGlobal::dirs()->addResourceType("ko_gradients", "data", "krita/gradients/", true);
KGlobal::dirs()->addResourceDir("ko_gradients", "/usr/share/create/gradients/gimp");
KGlobal::dirs()->addResourceDir("ko_gradients", QDir::homePath() + QString("/.create/gradients/gimp"));
KGlobal::mainComponent().dirs()->addResourceType("ko_palettes", "data", "calligra/palettes/");
KGlobal::mainComponent().dirs()->addResourceType("ko_palettes", "data", "karbon/palettes/");
KGlobal::mainComponent().dirs()->addResourceType("ko_palettes", "data", "krita/palettes/", true);
KGlobal::dirs()->addResourceType("ko_palettes", "data", "calligra/palettes/");
KGlobal::dirs()->addResourceType("ko_palettes", "data", "karbon/palettes/");
KGlobal::dirs()->addResourceType("ko_palettes", "data", "krita/palettes/", true);
KGlobal::mainComponent().dirs()->addResourceDir("ko_palettes", "/usr/share/create/swatches");
KGlobal::mainComponent().dirs()->addResourceDir("ko_palettes", QDir::homePath() + QString("/.create/swatches"));
KGlobal::dirs()->addResourceDir("ko_palettes", "/usr/share/create/swatches");
KGlobal::dirs()->addResourceDir("ko_palettes", QDir::homePath() + QString("/.create/swatches"));
d->patternServer = new KoResourceServer<KoPattern>("ko_patterns", "*.pat:*.jpg:*.gif:*.png:*.tif:*.xpm:*.bmp" );
if (!QFileInfo(d->patternServer->saveLocation()).exists()) {
......
......@@ -53,5 +53,5 @@ KoRulerController::~KoRulerController()
delete d;
}
#include <KoRulerController.moc>
//have to include this because of Q_PRIVATE_SLOT
#include <moc_KoRulerController.cpp>
......@@ -287,4 +287,5 @@ void KoSliderCombo::setValue(qreal value)
emit valueChanged(value, true);
}
#include <KoSliderCombo.moc>
//have to include this because of Q_PRIVATE_SLOT
#include <moc_KoSliderCombo.cpp>
......@@ -278,4 +278,5 @@ void KoToolDocker::unsetCanvas()
setEnabled(false);
}
#include <KoToolDocker.moc>
//have to include this because of Q_PRIVATE_SLOT
#include <moc_KoToolDocker.cpp>
......@@ -38,6 +38,7 @@
#include <QButtonGroup>
#include <QComboBox>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
......
......@@ -244,5 +244,5 @@ void KoZoomController::setAspectMode(bool status)
d->action->setAspectMode(status);
}
}
#include <KoZoomController.moc>
//have to include this because of Q_PRIVATE_SLOT
#include <moc_KoZoomController.cpp>
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