Changeset View
Changeset View
Standalone View
Standalone View
plugins/impex/libkra/kis_kra_saver.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
56 | #include <kis_time_range.h> | 56 | #include <kis_time_range.h> | ||
57 | #include "KisDocument.h" | 57 | #include "KisDocument.h" | ||
58 | #include <string> | 58 | #include <string> | ||
59 | #include "kis_dom_utils.h" | 59 | #include "kis_dom_utils.h" | ||
60 | #include "kis_grid_config.h" | 60 | #include "kis_grid_config.h" | ||
61 | #include "kis_guides_config.h" | 61 | #include "kis_guides_config.h" | ||
62 | #include "KisProofingConfiguration.h" | 62 | #include "KisProofingConfiguration.h" | ||
63 | 63 | | |||
64 | #include <KisMirrorAxisConfig.h> | ||||
65 | | ||||
64 | #include <QFileInfo> | 66 | #include <QFileInfo> | ||
65 | #include <QDir> | 67 | #include <QDir> | ||
66 | 68 | | |||
67 | 69 | | |||
68 | using namespace KRA; | 70 | using namespace KRA; | ||
69 | 71 | | |||
70 | struct KisKraSaver::Private | 72 | struct KisKraSaver::Private | ||
71 | { | 73 | { | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 101 | { | |||
133 | 135 | | |||
134 | saveBackgroundColor(doc, imageElement, image); | 136 | saveBackgroundColor(doc, imageElement, image); | ||
135 | saveAssistantsGlobalColor(doc, imageElement); | 137 | saveAssistantsGlobalColor(doc, imageElement); | ||
136 | saveWarningColor(doc, imageElement, image); | 138 | saveWarningColor(doc, imageElement, image); | ||
137 | saveCompositions(doc, imageElement, image); | 139 | saveCompositions(doc, imageElement, image); | ||
138 | saveAssistantsList(doc, imageElement); | 140 | saveAssistantsList(doc, imageElement); | ||
139 | saveGrid(doc, imageElement); | 141 | saveGrid(doc, imageElement); | ||
140 | saveGuides(doc, imageElement); | 142 | saveGuides(doc, imageElement); | ||
143 | saveMirrorAxis(doc, imageElement); | ||||
141 | saveAudio(doc, imageElement); | 144 | saveAudio(doc, imageElement); | ||
142 | savePalettesToXML(doc, imageElement); | 145 | savePalettesToXML(doc, imageElement); | ||
143 | 146 | | |||
144 | QDomElement animationElement = doc.createElement("animation"); | 147 | QDomElement animationElement = doc.createElement("animation"); | ||
145 | KisDomUtils::saveValue(&animationElement, "framerate", image->animationInterface()->framerate()); | 148 | KisDomUtils::saveValue(&animationElement, "framerate", image->animationInterface()->framerate()); | ||
146 | KisDomUtils::saveValue(&animationElement, "range", image->animationInterface()->fullClipRange()); | 149 | KisDomUtils::saveValue(&animationElement, "range", image->animationInterface()->fullClipRange()); | ||
147 | KisDomUtils::saveValue(&animationElement, "currentTime", image->animationInterface()->currentUITime()); | 150 | KisDomUtils::saveValue(&animationElement, "currentTime", image->animationInterface()->currentUITime()); | ||
148 | imageElement.appendChild(animationElement); | 151 | imageElement.appendChild(animationElement); | ||
▲ Show 20 Lines • Show All 328 Lines • ▼ Show 20 Line(s) | 477 | { | |||
477 | if (!guides.isDefault()) { | 480 | if (!guides.isDefault()) { | ||
478 | QDomElement guidesElement = guides.saveToXml(doc, "guides"); | 481 | QDomElement guidesElement = guides.saveToXml(doc, "guides"); | ||
479 | element.appendChild(guidesElement); | 482 | element.appendChild(guidesElement); | ||
480 | } | 483 | } | ||
481 | 484 | | |||
482 | return true; | 485 | return true; | ||
483 | } | 486 | } | ||
484 | 487 | | |||
488 | bool KisKraSaver::saveMirrorAxis(QDomDocument &doc, QDomElement &element) | ||||
489 | { | ||||
490 | KisMirrorAxisConfig mirrorAxisConfig = m_d->doc->mirrorAxisConfig(); | ||||
491 | | ||||
492 | if (!mirrorAxisConfig.isDefault()) { | ||||
493 | QDomElement mirrorAxisElement = mirrorAxisConfig.saveToXml(doc, MIRROR_AXIS); | ||||
494 | element.appendChild(mirrorAxisElement); | ||||
495 | } | ||||
496 | | ||||
497 | return true; | ||||
498 | } | ||||
499 | | ||||
485 | bool KisKraSaver::saveAudio(QDomDocument& doc, QDomElement& element) | 500 | bool KisKraSaver::saveAudio(QDomDocument& doc, QDomElement& element) | ||
486 | { | 501 | { | ||
487 | const KisImageAnimationInterface *interface = m_d->doc->image()->animationInterface(); | 502 | const KisImageAnimationInterface *interface = m_d->doc->image()->animationInterface(); | ||
488 | QString fileName = interface->audioChannelFileName(); | 503 | QString fileName = interface->audioChannelFileName(); | ||
489 | if (fileName.isEmpty()) return true; | 504 | if (fileName.isEmpty()) return true; | ||
490 | 505 | | |||
491 | if (!QFileInfo::exists(fileName)) { | 506 | if (!QFileInfo::exists(fileName)) { | ||
492 | m_d->errorMessages << i18n("Audio channel file %1 doesn't exist!", fileName); | 507 | m_d->errorMessages << i18n("Audio channel file %1 doesn't exist!", fileName); | ||
Show All 20 Lines |