Commit 117bce14 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Revert "fix spello"

I'm totally not sure what happened here... I only wanted to
fix one spelling error in a comment.

This reverts commit d057cd1b22d01afe90a7b1596cc9bbe9ed629a2e.
parent b08dab37
......@@ -8,6 +8,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS_KRITADEVS "-O2 -g" CACHE STRING "" FORCE)
endif(CMAKE_COMPILER_IS_GNUCXX)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif(MSVC)
include(CheckFunctionExists)
macro_optional_find_package(GLEW)
......
......@@ -923,7 +923,7 @@ KisLayerSP KisImage::mergeDown(KisLayerSP layer, const KisMetaData::MergeStrateg
}
else {
lock();
KisPaintDeviceSP mergedDevice = new KisPaintDevice(*prevLayer->projection());
mergedDevice = new KisPaintDevice(*prevLayer->projection());
unlock();
KisPainter gc(mergedDevice);
......@@ -933,9 +933,9 @@ KisLayerSP KisImage::mergeDown(KisLayerSP layer, const KisMetaData::MergeStrateg
gc.bitBlt(layerProjectionExtent.topLeft(), layer->projection(), layerProjectionExtent);
}
KisPaintLayerSP mergedLayer = new KisPaintLayer(this, layer->name(), layer->opacity(), mergedDevice);
KisPaintLayerSP mergedLayer = new KisPaintLayer(this, layer->name(), OPACITY_OPAQUE_U8, mergedDevice);
Q_CHECK_PTR(mergedLayer);
mergedLayer->setCompositeOp(layer->compositeOp()->id());
mergedLayer->setCompositeOp(COMPOSITE_OVER);
mergedLayer->setChannelFlags(layer->channelFlags());
// Merge meta data
......
......@@ -63,7 +63,7 @@ KoFilter::ConversionStatus exrExport::convert(const QByteArray& from, const QByt
return KoFilter::NotImplemented;
KDialog dialog;
dialog.setWindowTitle(i18n("TIFF Export Options"));
dialog.setWindowTitle(i18n("OpenEXR Export Options"));
dialog.setButtons(KDialog::Ok | KDialog::Cancel);
Ui::ExrExportWidget widget;
QWidget *page = new QWidget(&dialog);
......
......@@ -59,6 +59,8 @@
#include <kis_transform_visitor.h>
#include <kis_undo_adapter.h>
#include <kis_painter.h>
#include <metadata/kis_meta_data_store.h>
#include <metadata/kis_meta_data_merge_strategy_registry.h>
#include "kis_config.h"
#include "kis_cursor.h"
......@@ -83,6 +85,7 @@
#include "kis_node_commands_adapter.h"
#include "kis_node_manager.h"
KisLayerManager::KisLayerManager(KisView2 * view, KisDoc2 * doc)
: m_view(view)
, m_doc(doc)
......@@ -146,7 +149,7 @@ void KisLayerManager::setup(KActionCollection * actionCollection)
m_rasterizeLayer = new KAction(i18n("Rasterize Layer"), this);
actionCollection->addAction("rasterize_layer", m_rasterizeLayer);
connect(m_rasterizeLayer, SIGNAL(triggered()), this, SLOT(rasterizeLayer()));
m_layerSaveAs = new KAction(KIcon("document-save"), i18n("Save Layer as Image..."), this);
actionCollection->addAction("save_layer_as_image", m_layerSaveAs);
connect(m_layerSaveAs, SIGNAL(triggered()), this, SLOT(saveLayerAsImage()));
......@@ -572,7 +575,7 @@ void KisLayerManager::layerBack()
void KisLayerManager::mirrorLayerX()
{
KisLayerSP layer = activeLayer();
if (layer->inherits("KisShapeLayer")) {
m_view->image()->undoAdapter()->beginMacro(i18n("Mirror Layer X"));
......@@ -599,7 +602,7 @@ void KisLayerManager::mirrorLayerX()
void KisLayerManager::mirrorLayerY()
{
KisLayerSP layer = activeLayer();
if (layer->inherits("KisShapeLayer")) {
m_view->image()->undoAdapter()->beginMacro(i18n("Mirror Layer Y"));
......@@ -721,10 +724,18 @@ void KisLayerManager::mergeLayer()
KisLayerSP layer = activeLayer();
if (!layer) return;
const KisMetaData::MergeStrategy* strategy = KisMetaDataMergeStrategyChooserWidget::showDialog(m_view);
if (!strategy) return;
if (layer->metaData()->isEmpty() && layer->prevSibling() && dynamic_cast<KisLayer*>(layer->prevSibling().data())->metaData()->isEmpty()) {
const KisMetaData::MergeStrategy* strategy = KisMetaData::MergeStrategyRegistry::instance()->get("Drop");
image->mergeDown(layer, strategy);
}
else {
const KisMetaData::MergeStrategy* strategy = KisMetaDataMergeStrategyChooserWidget::showDialog(m_view);
if (!strategy) return;
image->mergeDown(layer, strategy);
}
KisLayerSP newLayer = image->mergeDown(layer, strategy);
m_view->updateGUI();
}
......@@ -750,15 +761,15 @@ void KisLayerManager::rasterizeLayer()
KisLayerSP layer = activeLayer();
if (!layer) return;
KisPaintLayerSP paintLayer = new KisPaintLayer(image, layer->name(), layer->opacity());
KisPainter gc(paintLayer->paintDevice());
QRect rc = layer->projection()->exactBounds();
gc.bitBlt(rc.topLeft(), layer->projection(), rc);
m_commandsAdapter->beginMacro(i18n("Rasterize Layer"));
m_commandsAdapter->addNode(paintLayer.data(), layer->parent().data(), layer.data());
int childCount = layer->childCount();
for (int i = 0; i < childCount; i++) {
m_commandsAdapter->moveNode(layer->firstChild(), paintLayer, paintLayer->lastChild());
......
......@@ -330,7 +330,6 @@ KisView2::KisView2(KisDoc2 * doc, QWidget * parent)
actionCollection()->addAction("view_show_just_the_canvas", tAction);
connect(tAction, SIGNAL(toggled(bool)), this, SLOT(showJustTheCanvas(bool)));
//Workaround, by default has the same shortcut as mirrorCanvas
KAction* action = dynamic_cast<KAction*>(actionCollection()->action("format_italic"));
if (action) {
......@@ -494,6 +493,9 @@ void KisView2::dropEvent(QDropEvent *event)
QAction *openInNewDocument = new KAction(i18n("Open in New Document"), &popup);
QAction *openInNewDocuments = new KAction(i18n("Open in New Documents"), &popup);
// XXX: translate after 2.4
QAction *replaceCurrentDocument = new KAction("Replace Current Document", &popup);
QAction *cancel = new KAction(i18n("Cancel"), &popup);
if (urls.count() == 1) {
......@@ -501,6 +503,7 @@ void KisView2::dropEvent(QDropEvent *event)
popup.addAction(insertAsNewLayer);
}
popup.addAction(openInNewDocument);
popup.addAction(replaceCurrentDocument);
} else {
if (!image().isNull()) {
popup.addAction(insertAsNewLayers);
......@@ -518,6 +521,15 @@ void KisView2::dropEvent(QDropEvent *event)
if (action == insertAsNewLayer || action == insertAsNewLayers) {
m_d->imageManager->importImage(KUrl(url));
}
else if (action == replaceCurrentDocument) {
if (m_d->doc->isModified()) {
m_d->doc->save();
}
if (shell() != 0) {
shell()->openDocument(url);
}
shell()->close();
} else {
Q_ASSERT(action == openInNewDocument || action == openInNewDocuments);
......@@ -1237,4 +1249,5 @@ void KisView2::showJustTheCanvas(bool toggled)
}
}
#include "kis_view2.moc"
......@@ -213,7 +213,7 @@ QString KoShapeSavingContext::imageHref(KoImageData * image)
QString KoShapeSavingContext::imageHref(QImage &image)
{
// TODO this can be optimized to recognize images which have the same content
// TODO this can be optimized to recocnice images which have the same content
// Also this can use quite a lot of memeory as the qimage are all kept until
// the they are saved to the store in memory
QString href = QString("Pictures/image%1.png").arg(++d->imageId);
......
......@@ -132,6 +132,7 @@ public:
readOnly = false;
dockWidgetMenu = 0;
dockerManager = 0;
deferredClosingEvent = 0;
}
~KoMainWindowPrivate() {
qDeleteAll(toolbarList);
......@@ -210,6 +211,8 @@ public:
QList<QDockWidget *> dockWidgets;
QList<QDockWidget *> hiddenDockwidgets; // List of dockers hiddent by the call to hideDocker
QCloseEvent *deferredClosingEvent;
};
KoMainWindow::KoMainWindow(const KComponentData &componentData)
......@@ -739,6 +742,10 @@ void KoMainWindow::slotSaveCompleted()
disconnect(pDoc, SIGNAL(completed()), this, SLOT(slotSaveCompleted()));
disconnect(pDoc, SIGNAL(canceled(const QString &)),
this, SLOT(slotSaveCanceled(const QString &)));
if (d->deferredClosingEvent) {
KParts::MainWindow::closeEvent(d->deferredClosingEvent);
}
}
// returns true if we should save, false otherwise.
......@@ -1042,6 +1049,7 @@ void KoMainWindow::closeEvent(QCloseEvent *e)
return;
}
if (queryClose()) {
d->deferredClosingEvent = e;
if (d->docToOpen) {
// The open pane is visible
d->docToOpen->deleteOpenPane(true);
......@@ -1057,9 +1065,9 @@ void KoMainWindow::closeEvent(QCloseEvent *e)
foreach(QDockWidget* dockWidget, d->dockWidgetsMap)
dockWidget->setVisible(d->dockWidgetVisibilityMap.value(dockWidget));
}
KParts::MainWindow::closeEvent(e);
} else
} else {
e->setAccepted(false);
}
}
void KoMainWindow::saveWindowSettings()
......@@ -1140,7 +1148,7 @@ bool KoMainWindow::queryClose()
switch (res) {
case KMessageBox::Yes : {
bool isNative = (d->rootDoc->outputMimeType() == d->rootDoc->nativeFormatMimeType());
if (! saveDocument(!isNative))
if (!saveDocument(!isNative))
return false;
break;
}
......
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