Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/kis_layer_manager.cc
Context not available. | |||||
292 | } | 292 | } | ||
---|---|---|---|---|---|
293 | } | 293 | } | ||
294 | else if (glayer && !multipleLayersSelected) { | 294 | else if (glayer && !multipleLayersSelected) { | ||
295 | | ||||
296 | KisDlgGeneratorLayer dlg(glayer->name(), m_view, m_view->mainWindow()); | | |||
297 | dlg.setCaption(i18n("Fill Layer Properties")); | | |||
298 | | ||||
299 | KisFilterConfigurationSP configBefore(glayer->filter()); | 295 | KisFilterConfigurationSP configBefore(glayer->filter()); | ||
300 | Q_ASSERT(configBefore); | 296 | Q_ASSERT(configBefore); | ||
301 | QString xmlBefore = configBefore->toXML(); | 297 | QString xmlBefore = configBefore->toXML(); | ||
302 | 298 | | |||
303 | dlg.setConfiguration(configBefore.data()); | 299 | KisDlgGeneratorLayer *dlg = new KisDlgGeneratorLayer(glayer->name(), m_view, m_view->mainWindow(), glayer, configBefore); | ||
304 | dlg.resize(dlg.minimumSizeHint()); | 300 | dlg->setCaption(i18n("Fill Layer Properties")); | ||
301 | dlg->setAttribute(Qt::WA_DeleteOnClose); | ||||
305 | 302 | | |||
306 | if (dlg.exec() == QDialog::Accepted) { | 303 | dlg->setConfiguration(configBefore.data()); | ||
304 | dlg->resize(dlg->minimumSizeHint()); | ||||
307 | 305 | | |||
308 | glayer->setName(dlg.layerName()); | 306 | Qt::WindowFlags flags = dlg->windowFlags(); | ||
307 | dlg->setWindowFlags(flags | Qt::WindowStaysOnTopHint | Qt::Dialog); | ||||
308 | dlg->show(); | ||||
309 | 309 | | |||
310 | KisFilterConfigurationSP configAfter(dlg.configuration()); | | |||
311 | Q_ASSERT(configAfter); | | |||
312 | QString xmlAfter = configAfter->toXML(); | | |||
313 | | ||||
314 | if(xmlBefore != xmlAfter) { | | |||
315 | KisChangeFilterCmd *cmd | | |||
316 | = new KisChangeFilterCmd(glayer, | | |||
317 | configBefore->name(), | | |||
318 | xmlBefore, | | |||
319 | configAfter->name(), | | |||
320 | xmlAfter, | | |||
321 | true); | | |||
322 | // FIXME: check whether is needed | | |||
323 | cmd->redo(); | | |||
324 | m_view->undoAdapter()->addCommand(cmd); | | |||
325 | m_view->document()->setModified(true); | | |||
326 | } | | |||
327 | | ||||
328 | } | | |||
329 | } else if (flayer && !multipleLayersSelected){ | 310 | } else if (flayer && !multipleLayersSelected){ | ||
330 | QString basePath = QFileInfo(m_view->document()->url().toLocalFile()).absolutePath(); | 311 | QString basePath = QFileInfo(m_view->document()->url().toLocalFile()).absolutePath(); | ||
331 | QString fileNameOld = flayer->fileName(); | 312 | QString fileNameOld = flayer->fileName(); | ||
Context not available. | |||||
674 | KisImageWSP image = m_view->image(); | 655 | KisImageWSP image = m_view->image(); | ||
675 | QColor currentForeground = m_view->resourceProvider()->fgColor().toQColor(); | 656 | QColor currentForeground = m_view->resourceProvider()->fgColor().toQColor(); | ||
676 | 657 | | |||
677 | KisDlgGeneratorLayer dlg(image->nextLayerName(), m_view, m_view->mainWindow()); | 658 | | ||
659 | KisDlgGeneratorLayer dlg(image->nextLayerName(), m_view, m_view->mainWindow(), 0, 0); | ||||
678 | KisFilterConfigurationSP defaultConfig = dlg.configuration(); | 660 | KisFilterConfigurationSP defaultConfig = dlg.configuration(); | ||
679 | defaultConfig->setProperty("color", currentForeground); | 661 | defaultConfig->setProperty("color", currentForeground); | ||
680 | dlg.setConfiguration(defaultConfig); | 662 | dlg.setConfiguration(defaultConfig); | ||
Context not available. |