Commit 2272ee8f authored by Denis Kuplyakov's avatar Denis Kuplyakov
Browse files

Merge branch 'master' into words-minorchanges-deniskup

parents 3585e39f e5d4a9d6
......@@ -215,26 +215,27 @@ calligra_define_product(FILTER_QUATTROPRO_TO_SHEETS "Sheets Quattro Pro import f
calligra_define_product(FILTER_HTML_TO_ODS "HTML to ODS filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_SHEETS_TO_HTML "Sheets HTML export filter" NEEDS SHEETS_PART)
calligra_define_product(FILTER_KSPREAD_TO_LATEX "KSpread to LaTeX filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_SHEETS_IMPORT "All Sheets import filter" WANTS FILTER_XLSX_TO_ODS FILTER_XLS_TO_SHEETS FILTER_CSV_TO_SHEETS FILTER_APPLIXSPREAD_TO_KSPREAD FILTER_DBASE_TO_KSPREAD FILTER_GNUMERIC_TO_SHEETS FILTER_OPENCALC_TO_SHEETS FILTER_QUATTROPRO_TO_SHEETS FILTER_HTML_TO_ODS)
calligra_define_product(FILTER_SHEETS_EXPORT "All Sheets export filter" WANTS FILTER_SHEETS_TO_XLS FILTER_SHEETS_TO_CSV FILTER_SHEETS_TO_GNUMERIC FILTER_SHEETS_TO_OPENCALC FILTER_SHEETS_TO_HTML FILTER_KSPREAD_TO_LATEX)
calligra_define_product(FILTER_SHEETS "All Sheets filter" WANTS FILTER_SHEETS_IMPORT FILTER_SHEETS_EXPORT)
calligra_define_product(FILTER_SHEETS_IMPORT "All Sheets import filters" WANTS FILTER_XLSX_TO_ODS FILTER_XLS_TO_SHEETS FILTER_CSV_TO_SHEETS FILTER_APPLIXSPREAD_TO_KSPREAD FILTER_DBASE_TO_KSPREAD FILTER_GNUMERIC_TO_SHEETS FILTER_OPENCALC_TO_SHEETS FILTER_QUATTROPRO_TO_SHEETS FILTER_HTML_TO_ODS)
calligra_define_product(FILTER_SHEETS_EXPORT "All Sheets export filters" WANTS FILTER_SHEETS_TO_XLS FILTER_SHEETS_TO_CSV FILTER_SHEETS_TO_GNUMERIC FILTER_SHEETS_TO_OPENCALC FILTER_SHEETS_TO_HTML FILTER_KSPREAD_TO_LATEX)
calligra_define_product(FILTER_SHEETS "All Sheets filters" WANTS FILTER_SHEETS_IMPORT FILTER_SHEETS_EXPORT)
# Flow filters
calligra_define_product(FILTER_VISIO_TO_ODG "Visio to ODG filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_WPG_TO_ODG "WPG to ODG filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_FLOW_IMPORT "All Flow import filter" WANTS FILTER_VISIO_TO_ODG FILTER_WPG_TO_ODG)
calligra_define_product(FILTER_FLOW_EXPORT "All Flow export filter" WANTS )
calligra_define_product(FILTER_FLOW "All Flow filter" WANTS FILTER_FLOW_IMPORT FILTER_FLOW_EXPORT)
calligra_define_product(FILTER_FLOW_IMPORT "All Flow import filters" WANTS FILTER_VISIO_TO_ODG FILTER_WPG_TO_ODG)
calligra_define_product(FILTER_FLOW_EXPORT "All Flow export filters" WANTS )
calligra_define_product(FILTER_FLOW "All Flow filters" WANTS FILTER_FLOW_IMPORT FILTER_FLOW_EXPORT)
# Stage filters
calligra_define_product(FILTER_KEY_TO_ODP "Apple Keynote to ODP filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_KPR_TO_OPD "KPresenter to ODP filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_PPT_TO_ODP "PPT to OPD filter" NEEDS LIB_MSO CALLIGRA_LIBS)
calligra_define_product(FILTER_PPTX_TO_ODP "PPTX to ODP filter" NEEDS LIB_KOMSOOXML LIB_KOODF2 CALLIGRA_LIBS)
calligra_define_product(FILTER_STAGE_IMPORT "All Stage import filter" WANTS FILTER_KEY_TO_ODP FILTER_KPR_TO_OPD FILTER_PPT_TO_ODP FILTER_PPTX_TO_ODP)
calligra_define_product(FILTER_STAGE_EXPORT "All Stage export filter" WANTS )
calligra_define_product(FILTER_STAGE "All Stage filter" WANTS FILTER_STAGE_IMPORT FILTER_STAGE_EXPORT)
calligra_define_product(FILTER_STAGE_IMPORT "All Stage import filters" WANTS FILTER_KEY_TO_ODP FILTER_KPR_TO_OPD FILTER_PPT_TO_ODP FILTER_PPTX_TO_ODP)
calligra_define_product(FILTER_STAGE_EXPORT "All Stage export filters" WANTS )
calligra_define_product(FILTER_STAGE "All Stage filters" WANTS FILTER_STAGE_IMPORT FILTER_STAGE_EXPORT)
# Words filters
calligra_define_product(FILTER_DOC_TO_ODT "DOC to ODT filter" NEEDS LIB_MSO LIB_KOMSOOXML CALLIGRA_LIBS)
calligra_define_product(FILTER_DOCX_TO_ODT "DOCX to ODT filter" NEEDS LIB_KOMSOOXML LIB_KOODF2 CALLIGRA_LIBS)
calligra_define_product(FILTER_ODT_TO_DOCX "ODT to DOCX filter" NEEDS LIB_KOODFREADER LIB_KOODF2 CALLIGRA_LIBS)
calligra_define_product(FILTER_WORDPERFECT_TO_ODT "Word Perfect to ODT filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_WORKS_TO_ODT "MS Works to ODT filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_APPLIXWORD_TO_ODT "Applixword to ODT filter" NEEDS CALLIGRA_LIBS)
......@@ -244,12 +245,12 @@ calligra_define_product(FILTER_RTF_TO_ODT "RTF to ODT filter" NEEDS CALLIGRA_LI
calligra_define_product(FILTER_ODT_TO_MOBI "Mobi export filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_ODT_TO_EPUB2 "ODT Epub2 export filter" NEEDS LIB_KOVECTORIMAGE CALLIGRA_LIBS)
calligra_define_product(FILTER_ODT_TO_HTML "ODT HTML export filter" NEEDS LIB_KOVECTORIMAGE CALLIGRA_LIBS)
calligra_define_product(FILTER_WORDS_IMPORT "All Words import filter" WANTS FILTER_DOC_TO_ODT FILTER_DOCX_TO_ODT FILTER_WORDPERFECT_TO_ODT FILTER_WORKS_TO_ODT FILTER_APPLIXWORD_TO_ODT FILTER_ASCII_TO_WORDS FILTER_RTF_TO_ODT)
calligra_define_product(FILTER_WORDS_EXPORT "All Words export filter" WANTS FILTER_ODT_TO_ASCII FILTER_ODT_TO_MOBI FILTER_ODT_TO_EPUB2 FILTER_ODT_TO_HTML)
calligra_define_product(FILTER_WORDS "All Words filter" WANTS FILTER_WORDS_IMPORT FILTER_WORDS_EXPORT)
calligra_define_product(FILTER_WORDS_IMPORT "All Words import filters" WANTS FILTER_DOC_TO_ODT FILTER_DOCX_TO_ODT FILTER_WORDPERFECT_TO_ODT FILTER_WORKS_TO_ODT FILTER_APPLIXWORD_TO_ODT FILTER_ASCII_TO_WORDS FILTER_RTF_TO_ODT)
calligra_define_product(FILTER_WORDS_EXPORT "All Words export filters" WANTS FILTER_ODT_TO_ASCII FILTER_ODT_TO_MOBI FILTER_ODT_TO_EPUB2 FILTER_ODT_TO_HTML FILTER_ODT_TO_DOCX)
calligra_define_product(FILTER_WORDS "All Words filters" WANTS FILTER_WORDS_IMPORT FILTER_WORDS_EXPORT)
# Plan filters
calligra_define_product(FILTER_MPXJ_IMPORT "MS Project import filter" NEEDS PLAN_APP)
calligra_define_product(FILTER_PLAN "All Plan filter" WANTS FILTER_MPXJ_IMPORT)
calligra_define_product(FILTER_PLAN "All Plan filters" WANTS FILTER_MPXJ_IMPORT)
# Karbon filters
calligra_define_product(FILTER_EPS_TO_SVG_AI "EPS to SVG/AI filter" NEEDS CALLIGRA_LIBS)
calligra_define_product(FILTER_XFIG_TO_ODG "XFig to ODG filter" NEEDS CALLIGRA_LIBS)
......@@ -261,9 +262,9 @@ calligra_define_product(FILTER_SVG_TO_KARBON "Karbon SVG import filter" NEEDS K
calligra_define_product(FILTER_KARBON_TO_WMF "Karbon WMF export filter" NEEDS KARBON_APP)
calligra_define_product(FILTER_WMF_TO_SVG "WMF to SVG filter" NEEDS LIB_KOVECTORIMAGE CALLIGRA_LIBS)
calligra_define_product(FILTER_KARBON1X_TO_KARBON "Karbon 1.x import filter" NEEDS KARBON_APP)
calligra_define_product(FILTER_KARBON_IMPORT "All Karbon import filter" WANTS FILTER_EPS_TO_SVG_AI FILTER_XFIG_TO_ODG FILTER_PDF_TO_SVG FILTER_WPG_TO_SVG FILTER_SVG_TO_KARBON FILTER_WMF_TO_SVG FILTER_KARBON1X_TO_KARBON)
calligra_define_product(FILTER_KARBON_EXPORT "All Karbon export filter" WANTS FILTER_KARBON_TO_IMAGE FILTER_KARBON_TO_SVG FILTER_KARBON_TO_WMF)
calligra_define_product(FILTER_KARBON "All Karbon filter" WANTS FILTER_KARBON_IMPORT FILTER_KARBON_EXPORT)
calligra_define_product(FILTER_KARBON_IMPORT "All Karbon import filters" WANTS FILTER_EPS_TO_SVG_AI FILTER_XFIG_TO_ODG FILTER_PDF_TO_SVG FILTER_WPG_TO_SVG FILTER_SVG_TO_KARBON FILTER_WMF_TO_SVG FILTER_KARBON1X_TO_KARBON)
calligra_define_product(FILTER_KARBON_EXPORT "All Karbon export filters" WANTS FILTER_KARBON_TO_IMAGE FILTER_KARBON_TO_SVG FILTER_KARBON_TO_WMF)
calligra_define_product(FILTER_KARBON "All Karbon filters" WANTS FILTER_KARBON_IMPORT FILTER_KARBON_EXPORT)
# meta apps
calligra_define_product(WORDS "Full Words (for Desktop)" NEEDS WORDS_APP WANTS FILTER_WORDS PLUGIN_SEMANTICITEMS)
calligra_define_product(STAGE "Full Stage (for Desktop)" NEEDS STAGE_APP WANTS FILTER_STAGE)
......
......@@ -3,8 +3,8 @@ $EXTRACTRC `find . -name \*.ui | grep -v '/tests/'` >> rc.cpp
RCFILES=`find . -name \*.rc \
| grep -v plugins/extensions/metadataeditor/editors/dublincore.rc \
| grep -v plugins/extensions/metadataeditor/editors/exif.rc \
| grep -v sketch/KritaSketch.rc \
| grep -v gemini/KritaGemini.rc
| grep -v sketch/KritaSketchWin.rc \
| grep -v gemini/KritaGeminiWin.rc
`
$EXTRACTRC $RCFILES >> rc.cpp
perl extracti18n.pl > i18ndata
......
[Desktop Entry]
Icon=template_web_design
Name=Web Design [ 2160x1440 , 72ppi RGB , 8bit ]
Name[ca]=Disseny Web [ 2160x1440 / 72ppi RGB / 8bit ]
Name[cs]=Návrh webu [ 2160x1440 , 72ppi RGB , 8bit ]
Name[de]=Web-Design [ 2160x1440 , 72ppi RGB , 8bit ]
Name[it]=Progettazione web [ 2160x1440 , 72ppi RGB , 8bit ]
Name[nl]=Webontwerp [ 2160x1440 , 72ppi RGB , 8bit ]
Name[pl]=Projekt sieciowy [ 2160x1440 , 72ppi RGB , 8bit ]
Name[pt]=Desenho na Web [ 2160x1440 , 72ppp RGB , 8-bits ]
Name[pt_BR]=Web Design [ 2160x1440 , 72ppi RGB , 8bits ]
Name[sk]=Webový dizajn [ 2160x1440 , 72ppi RGB , 8bit ]
......
......@@ -73,6 +73,7 @@
#include "sketch/DocumentManager.h"
#include "sketch/KisSketchPart.h"
#include "sketch/QmlGlobalEngine.h"
#include "sketch/Settings.h"
#ifdef Q_OS_WIN
// Slate mode/docked detection stuff
......@@ -94,6 +95,7 @@ public:
, slateMode(false)
, docked(false)
, sketchKisView(0)
, desktopKisView(0)
, desktopViewProxy(0)
, forceDesktop(false)
, forceSketch(false)
......@@ -124,6 +126,7 @@ public:
bool docked;
QString currentSketchPage;
KisView2* sketchKisView;
KisView2* desktopKisView;
DesktopViewProxy* desktopViewProxy;
bool forceDesktop;
......@@ -192,6 +195,12 @@ public:
// Initialize all Calligra directories etc.
KoGlobal::initialize();
// The default theme is not what we want for Gemini
KConfigGroup group(KGlobal::config(), "theme");
if(group.readEntry("Theme", "no-theme-is-set") == QLatin1String("no-theme-is-set")) {
group.writeEntry("Theme", "Krita-dark");
}
desktopView = new KoMainWindow(KIS_MIME_TYPE, KisFactory2::componentData());
toSketch = new KAction(desktopView);
......@@ -214,6 +223,8 @@ public:
// DesktopViewProxy connects itself up to everything appropriate on construction,
// and destroys itself again when the view is removed
desktopViewProxy = new DesktopViewProxy(q, desktopView);
connect(desktopViewProxy, SIGNAL(documentSaved()), q, SIGNAL(documentSaved()));
connect(desktopViewProxy, SIGNAL(documentSaved()), q, SLOT(resetWindowTitle()));
}
void notifySlateModeChange();
......@@ -246,6 +257,8 @@ MainWindow::MainWindow(QStringList fileNames, QWidget* parent, Qt::WindowFlags f
}
connect(DocumentManager::instance(), SIGNAL(documentChanged()), SLOT(documentChanged()));
connect(DocumentManager::instance(), SIGNAL(documentChanged()), SLOT(resetWindowTitle()));
connect(DocumentManager::instance(), SIGNAL(documentSaved()), SLOT(resetWindowTitle()));
d->initSketchView(this);
......@@ -261,6 +274,15 @@ MainWindow::MainWindow(QStringList fileNames, QWidget* parent, Qt::WindowFlags f
}
}
void MainWindow::resetWindowTitle()
{
KUrl url(DocumentManager::instance()->settingsManager()->currentFile());
QString fileName = url.fileName();
if(url.protocol() == "temp")
fileName = i18n("Untitled");
setWindowTitle(QString("%1 - %2").arg(fileName).arg(i18n("Krita Gemini")));
}
void MainWindow::switchDesktopForced()
{
if (d->slateMode)
......@@ -402,15 +424,12 @@ void MainWindow::adjustZoomOnDocumentChangedAndStuff()
{
if (d->desktopView && centralWidget() == d->desktopView) {
KisView2* view = qobject_cast<KisView2*>(d->desktopView->rootView());
qApp->processEvents();
view->zoomController()->setZoom(KoZoomMode::ZOOM_PAGE, 1.0);
qApp->processEvents();
QPoint center = view->rect().center();
view->canvasControllerWidget()->zoomRelativeToPoint(center, 0.9);
qApp->processEvents();
// We have to set the focus on the view here, otherwise the toolmanager is unaware of which
// canvas should be handled.
d->desktopView->rootView()->setFocus();
QPoint center = view->rect().center();
view->canvasControllerWidget()->zoomRelativeToPoint(center, 0.9);
qApp->processEvents();
d->toSketch->setEnabled(true);
d->switcher->setEnabled(true);
}
......@@ -435,9 +454,12 @@ void MainWindow::documentChanged()
d->initDesktopView();
d->desktopView->setRootDocument(DocumentManager::instance()->document(), DocumentManager::instance()->part(), false);
qApp->processEvents();
KisView2* view = qobject_cast<KisView2*>(d->desktopView->rootView());
view->setQtMainWindow(d->desktopView);
connect(view, SIGNAL(sigLoadingFinished()), d->centerer, SLOT(start()));
d->desktopKisView = qobject_cast<KisView2*>(d->desktopView->rootView());
d->desktopKisView->setQtMainWindow(d->desktopView);
connect(d->desktopKisView, SIGNAL(sigLoadingFinished()), d->centerer, SLOT(start()));
connect(d->desktopKisView, SIGNAL(sigSavingFinished()), this, SLOT(resetWindowTitle()));
connect(d->desktopKisView->canvasBase()->resourceManager(), SIGNAL(canvasResourceChanged(int, const QVariant&)),
this, SLOT(resourceChanged(int, const QVariant&)));
if (d->sketchKisView)
d->sketchKisView->setQtMainWindow(this);
if (!d->forceSketch && !d->slateMode)
......@@ -493,6 +515,30 @@ void MainWindow::setTemporaryFile(bool newValue)
emit temporaryFileChanged();
}
void MainWindow::resourceChanged(int key, const QVariant& v)
{
if(centralWidget() == d->sketchView)
return;
KisPaintOpPresetSP preset = v.value<KisPaintOpPresetSP>();
if(preset) {
KisPaintOpPresetSP clone = preset->clone();
clone->settings()->setNode(d->sketchKisView->resourceProvider()->currentNode());
d->sketchKisView->resourceProvider()->setPaintOpPreset(clone);
}
}
void MainWindow::resourceChangedSketch(int key, const QVariant& v)
{
if(centralWidget() == d->desktopView)
return;
KisPaintOpPresetSP preset = v.value<KisPaintOpPresetSP>();
if(preset) {
KisPaintOpPresetSP clone = preset->clone();
clone->settings()->setNode(d->desktopKisView->resourceProvider()->currentNode());
d->desktopKisView->resourceProvider()->setPaintOpPreset(clone);
}
}
QObject* MainWindow::sketchKisView() const
{
return d->sketchKisView;
......@@ -500,13 +546,19 @@ QObject* MainWindow::sketchKisView() const
void MainWindow::setSketchKisView(QObject* newView)
{
if (d->sketchKisView)
if (d->sketchKisView) {
d->sketchKisView->disconnect(this);
d->sketchKisView->canvasBase()->resourceManager()->disconnect(this);
}
if (d->sketchKisView != newView)
{
d->sketchKisView = qobject_cast<KisView2*>(newView);
connect(d->sketchKisView, SIGNAL(sigLoadingFinished()), d->centerer, SLOT(start()));
d->centerer->start();
if(d->sketchKisView) {
connect(d->sketchKisView, SIGNAL(sigLoadingFinished()), d->centerer, SLOT(start()));
connect(d->sketchKisView->canvasBase()->resourceManager(), SIGNAL(canvasResourceChanged(int, const QVariant&)),
this, SLOT(resourceChangedSketch(int, const QVariant&)));
d->centerer->start();
}
emit sketchKisViewChanged();
}
}
......@@ -553,7 +605,7 @@ bool MainWindow::Private::queryClose()
switch (res) {
case KMessageBox::Yes : {
if (temporaryFile && !desktopViewProxy->fileSaveAs())
if (DocumentManager::instance()->isTemporaryFile() && !desktopViewProxy->fileSaveAs())
return false;
if (!DocumentManager::instance()->save())
return false;
......@@ -567,7 +619,6 @@ bool MainWindow::Private::queryClose()
return false;
}
}
return true;
}
......
......@@ -66,6 +66,9 @@ public Q_SLOTS:
void switchToSketch();
void switchToDesktop(bool justLoaded = false);
void documentChanged();
void resetWindowTitle();
void resourceChanged(int key, const QVariant& v);
void resourceChangedSketch(int key, const QVariant& v);
Q_SIGNALS:
void closeRequested();
void switchedToSketch();
......@@ -73,6 +76,7 @@ Q_SIGNALS:
void currentSketchPageChanged();
void temporaryFileChanged();
void sketchKisViewChanged();
void documentSaved();
private Q_SLOTS:
void switchDesktopForced();
......
......@@ -27,11 +27,12 @@
#include <KoZoomMode.h>
#include <kis_node.h>
#include <KoPattern.h>
#include <KoGridData.h>
#include <kis_paintop_preset.h>
class KisView2;
struct ViewModeSynchronisationObject {
ViewModeSynchronisationObject() : initialized(false) { }
ViewModeSynchronisationObject() : initialized(false), gridData(0) { }
bool initialized;
......@@ -51,6 +52,8 @@ struct ViewModeSynchronisationObject {
float opacity;
bool globalAlphaLock;
QString activeToolId;
KoGridData* gridData;
};
class ViewModeSwitchEvent : public QEvent
......
......@@ -40,7 +40,10 @@
#include "MainWindow.h"
#include <sketch/DocumentManager.h>
#include <sketch/RecentFileManager.h>
#include <sketch/Settings.h>
#include <kis_doc2.h>
#include <kis_view2.h>
class DesktopViewProxy::Private
{
......@@ -91,6 +94,8 @@ DesktopViewProxy::DesktopViewProxy(MainWindow* mainWindow, KoMainWindow* parent)
connect(recent, SIGNAL(urlSelected(KUrl)), this, SLOT(slotFileOpenRecent(KUrl)));
recent->clear();
recent->loadEntries(KGlobal::config()->group("RecentFiles"));
connect(d->desktopView, SIGNAL(documentSaved()), this, SIGNAL(documentSaved()));
}
DesktopViewProxy::~DesktopViewProxy()
......@@ -119,17 +124,38 @@ void DesktopViewProxy::fileOpen()
QString filename = dialog.url();
if (filename.isEmpty()) return;
QProcess::startDetached(qApp->applicationFilePath(), QStringList() << filename);
DocumentManager::instance()->recentFileManager()->addRecent(filename);
QProcess::startDetached(qApp->applicationFilePath(), QStringList() << filename, QDir::currentPath());
}
void DesktopViewProxy::fileSave()
{
DocumentManager::instance()->save();
if(DocumentManager::instance()->isTemporaryFile()) {
if(d->desktopView->saveDocument(true)) {
DocumentManager::instance()->recentFileManager()->addRecent(DocumentManager::instance()->document()->url().toLocalFile());
DocumentManager::instance()->settingsManager()->setCurrentFile(DocumentManager::instance()->document()->url().toLocalFile());
DocumentManager::instance()->setTemporaryFile(false);
emit documentSaved();
}
} else {
DocumentManager::instance()->save();
emit documentSaved();
}
}
bool DesktopViewProxy::fileSaveAs()
{
return d->desktopView->saveDocument(true);
if(d->desktopView->saveDocument(true)) {
DocumentManager::instance()->recentFileManager()->addRecent(DocumentManager::instance()->document()->url().toLocalFile());
DocumentManager::instance()->settingsManager()->setCurrentFile(DocumentManager::instance()->document()->url().toLocalFile());
DocumentManager::instance()->setTemporaryFile(false);
emit documentSaved();
return true;
}
DocumentManager::instance()->settingsManager()->setCurrentFile(DocumentManager::instance()->document()->url().toLocalFile());
return false;
}
void DesktopViewProxy::reload()
......@@ -146,7 +172,7 @@ void DesktopViewProxy::loadExistingAsNew()
void DesktopViewProxy::slotFileOpenRecent(const KUrl& url)
{
DocumentManager::instance()->openDocument(url.toLocalFile());
QProcess::startDetached(qApp->applicationFilePath(), QStringList() << url.toLocalFile(), QDir::currentPath());
}
#include "desktopviewproxy.moc"
......@@ -44,6 +44,9 @@ public Q_SLOTS:
void loadExistingAsNew();
void slotFileOpenRecent(const KUrl &url);
Q_SIGNALS:
void documentSaved();
private:
class Private;
Private* d;
......
......@@ -15,7 +15,14 @@ StatusOfTheseToolDockers=KisRulerAssistantTool Option Widget,KisToolTransform op
[krita]
State=AAAA/wAAAAD9AAAAAwAAAAAAAABAAAAEEPwCAAAAA/sAAAAOAFQAbwBvAGwAQgBvAHgBAAAAPQAABBAAAAIMAQAABfsAAAAkAEYAbABvAHcAUwBoAGEAcABlAEIAbwB4AEQAbwBjAGsAZQByAAAAA2oAAADHAAAAAAAAAAD7AAAAKABGAGwAbwB3AFMAdABlAG4AYwBpAGwAQgBvAHgARABvAGMAawBlAHIAAAADfQAAAMcAAAAAAAAAAAAAAAEAAAErAAAEEPwCAAAAMvsAAAAaAEsAaQBzAEIAaQByAGQAZQB5AGUAQgBvAHgAAAAAAP////8AAAA/AQAABfsAAAAgAEsAaQBzAFAAYQBsAGUAdAB0AGUARABvAGMAawBlAHIAAAAAAP////8AAADFAQAABfsAAAAaAEsAbwBDAG8AbABvAHIARABvAGMAawBlAHIAAAAAAP////8AAAAAAAAAAPsAAAAwAEsAaQBzAFQAcgBpAGEAbgBnAGwAZQBDAG8AbABvAHIAUwBlAGwAZQBjAHQAbwByAAAAAAD/////AAAAAAAAAAD7AAAAIgBTAGgAYQBkAG8AdwAgAFAAcgBvAHAAZQByAHQAaQBlAHMAAAAAAP////8AAADKAAgAH/sAAAAgAFMAaABhAHAAZQAgAFAAcgBvAHAAZQByAHQAaQBlAHMAAAAAAP////8AAAAgAQAABfsAAAAaAFMAaABhAHAAZQBTAGUAbABlAGMAdABvAHIAAAAASAAAAEQAAAAAAAAAAPsAAAAkAFMAaQBtAHAAbABlACAAVABlAHgAdAAgAEUAZABpAHQAbwByAAAAAAD/////AAAAAAAAAAD8AAAAPQAAAPEAAACNAAgAQfoAAAAAAQAAAAL7AAAAIABzAGgAYQByAGUAZAB0AG8AbwBsAGQAbwBjAGsAZQByAQAAAAD/////AAAAmAEAAAX7AAAAKgBTAG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AjgEAAAUAAAACAAAAAAAAAAD8AQAAAAH7AAAAGgBUAG8AbwBsAEIAYQByAEQAbwBjAGsAZQByAAAAAAD/////AAAAnAEAAAUAAAOPAAAEEAAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAAAAAB4AQgByAHUAcwBoAGUAcwBBAG4AZABTAHQAdQBmAGYBAAAAXv////8AAAAAAAAAAA==
DockerPluginsDisabled=kritapainterlymixer
[calligra]
DockerPluginsDisabled=textdocumentinspection
FlakePluginsDisabled=formulashape,divineproportionshape,kexirelationdesignshape,vectorshape
ShapePluginsDisabled=musicshape,pictureshape,videoshape,chartshape,spreadsheetshape,pluginshape,treeshape,commentshape,stateshape,webshape
TextEditingPluginsDisabled=thesaurustool,changecase,autocorrect,spellcheck
TextInlinePluginsDisabled=textvariables,kprvariables
ToolPluginsDisabled=paragraphtool,kopabackgroundtool,calligrastagetoolanimation,basicflakesplugin
ToolsBlacklist=CreatePathTool,KoPencilTool,ConnectionTool,KarbonFilterEffectsTool,PanTool,KoZoomToolId,GuidesTool_ID
[DockWidget DefaultToolArrangeWidget]
Collapsed=false
......@@ -152,13 +159,6 @@ Collapsed=false
[KoShapeCollection]
QuickShapes=ArtisticText,TextShapeID,DivineProportionShapeID,EllipseShape,RectangleShape
[calligra]
FlakePluginsDisabled=formulashape,divineproportionshape,kexirelationdesignshape,vectorshape
ShapePluginsDisabled=musicshape,pictureshape,videoshape,chartshape,spreadsheetshape,pluginshape,treeshape,commentshape,stateshape,webshape
TextEditingPluginsDisabled=thesaurustool,changecase,autocorrect,spellcheck
TextInlinePluginsDisabled=textvariables,kprvariables
ToolPluginsDisabled=paragraphtool,kopabackgroundtool,calligrastagetoolanimation
ToolsBlacklist=CreatePathTool,ConnectionTool,KarbonFilterEffectsTool,PanTool,KoZoomToolId
[favoriteList]
favoriteBrushes=paintbrush,deformbrush,hairybrush,hatchingbrush,sketchbrush,smudge,spraybrush,
......
......@@ -26,6 +26,7 @@
#include <QImageReader>
#include <QDomDocument>
#include <QBuffer>
#include <QCryptographicHash>
#include <KoInputDevice.h>
......@@ -166,29 +167,14 @@ bool KisPaintOpPreset::save()
return false;
QString paintopid = m_d->settings->getString("paintop", "");
if (paintopid.isEmpty())
return false;
QImageWriter writer(filename(), "PNG");
QDomDocument doc;
QDomElement root = doc.createElement("Preset");
toXML(doc, root);
doc.appendChild(root);
writer.setText("version", "2.2");
writer.setText("preset", doc.toString());
QImage img;
if(m_d->image.isNull())
{
img = QImage(1,1, QImage::Format_RGB32);
} else {
img = m_d->image;
}
QFile f(filename());
f.open(QFile::WriteOnly);
return writer.write(img);
return save(&f);
}
void KisPaintOpPreset::toXML(QDomDocument& doc, QDomElement& elt) const
......@@ -243,3 +229,43 @@ void KisPaintOpPreset::setImage(QImage image)
m_d->image = image;
}
QByteArray KisPaintOpPreset::generateMD5() const
{
QByteArray ba;
QBuffer buf(&ba);
save(&buf);
if (!ba.isEmpty()) {
QCryptographicHash md5(QCryptographicHash::Md5);
md5.addData(ba);
return md5.result();
}
return ba;
}
bool KisPaintOpPreset::save(QIODevice *io) const
{
QImageWriter writer(io, "PNG");
QDomDocument doc;
QDomElement root = doc.createElement("Preset");
toXML(doc, root);
doc.appendChild(root);
writer.setText("version", "2.2");
writer.setText("preset", doc.toString());
QImage img;
if (m_d->image.isNull()) {
img = QImage(1,1, QImage::Format_RGB32);
}
else {
img = m_d->image;
}
return writer.write(img);
}
......@@ -77,8 +77,14 @@ public:
return ".kpp";
}
protected:
virtual QByteArray generateMD5() const;
private:
bool save(QIODevice *io) const;
struct Private;
Private * const m_d;
};
......
......@@ -41,7 +41,7 @@ public:
private:
friend class KisScanlineFillTest;
Q_DISABLE_COPY(KisScanlineFill);
Q_DISABLE_COPY(KisScanlineFill)
template <class T>
void processLine(KisFillInterval interval, const int rowIncrement, T &pixelPolicy);
......
......@@ -92,6 +92,7 @@ void KisFillPainter::initFillPainter()
m_sizemod = 0;
m_feather = 0;
m_useCompositioning = false;
m_threshold = 0;
}
// 'regular' filling
......@@ -122,7 +123,7 @@ void KisFillPainter::fillRect(qint32 x1, qint32 y1, qint32 w, qint32 h, const Ko
if (h < 1) return;
KisPaintDeviceSP patternLayer = new KisPaintDevice(device()->compositionSourceColorSpace(), pattern->name());
patternLayer->convertFromQImage(pattern->image(), 0);
patternLayer->convertFromQImage(pattern->pattern(), 0);
fillRect(x1, y1, w, h, patternLayer, QRect(0, 0, pattern->width(), pattern->height()));
}
......
......@@ -22,7 +22,6 @@
#include <KoColorSpace.h>
#include <KoAbstractGradient.h>
#include <KoCachedGradient.h>
#include <KoProgressUpdater.h>
#include <KoUpdater.h>
......@@ -35,6 +34,64 @@
#include "kis_random_accessor_ng.h"
#include "kis_progress_update_helper.h"
class PIGMENTCMS_EXPORT CachedGradient : public KoAbstractGradient
{
public:
explicit CachedGradient(const KoAbstractGradient *gradient, qint32 steps, const KoColorSpace *cs)
: KoAbstractGradient(gradient->filename())
{
m_subject = gradient;
m_max = steps - 1;
m_colorSpace = cs;
m_black = KoColor(cs);
KoColor tmpColor(m_colorSpace);
for(qint32 i = 0; i < steps; i++) {
m_subject->colorAt(tmpColor, qreal(i) / m_max);
m_colors << tmpColor;
}
}
virtual ~CachedGradient() {}
/**
* Creates a QGradient from the gradient.
* The resulting QGradient might differ from original gradient
*/
virtual QGradient* toQGradient() const
{
return m_subject->toQGradient();
}
/// gets the color data at position 0 <= t <= 1
const quint8 *cachedAt(qreal t) const
{
qint32 tInt = t * m_max + 0.5;
if (m_colors.size() > tInt) {
return m_colors[tInt].data();
}
else {
return m_black.data();
}
}
void setColorSpace(KoColorSpace* colorSpace) { m_colorSpace = colorSpace; }