12#include <KConfigGroup>
13#include <KSharedConfig>
16 const QString &windowTitle)
18 , m_windowTitle(windowTitle)
23 const QString &toolId)
151 KConfigGroup cfg = KSharedConfig::openConfig()->group(
"KisToolSelectBase");
152 cfg.writeEntry(
"selectionMode",
static_cast<int>(mode));
158 KConfigGroup cfg = KSharedConfig::openConfig()->group(
"KisToolSelectBase");
159 cfg.writeEntry(
"selectionAction",
static_cast<int>(
action));
166 cfg.writeEntry(
"moveSelectedContent",
value);
172 cfg.writeEntry(
"antiAliasSelection",
value);
178 cfg.writeEntry(
"growSelection",
value);
184 cfg.writeEntry(
"stopGrowingAtDarkestPixel",
value);
190 cfg.writeEntry(
"featherSelection",
value);
202 ?
"sampleColorLabeledLayers"
203 :
"sampleCurrentLayer"));
209 if (colorLabels.isEmpty()) {
212 QString colorLabelsStr = QString::number(colorLabels.first());
213 for (
int i = 1; i < colorLabels.size(); ++i) {
214 colorLabelsStr +=
"," + QString::number(colorLabels[i]);
218 cfg.writeEntry(
"colorLabels", colorLabelsStr);
257 KConfigGroup cfg = KSharedConfig::openConfig()->group(
"KisToolSelectBase");
279 KConfigGroup cfgToolSpecific =
282 cfgToolSpecific.readEntry(
"moveSelectedContent",
false);
284 cfgToolSpecific.readEntry(
"antiAliasSelection",
true);
285 const int growSelection = cfgToolSpecific.readEntry(
"growSelection", 0);
287 cfgToolSpecific.readEntry(
"stopGrowingAtDarkestPixel",
false);
289 cfgToolSpecific.readEntry(
"featherSelection", 0);
290 const QString referenceLayersStr =
291 cfgToolSpecific.readEntry(
"sampleLayersMode",
"sampleCurrentLayer");
294 cfgToolSpecific.readEntry<QString>(
"colorLabels",
"")
295 .split(
',', Qt::SkipEmptyParts);
298 referenceLayersStr ==
"sampleAllLayers"
300 : (referenceLayersStr ==
"sampleColorLabeledLayers"
304 for (
const QString &colorLabelStr : colorLabelsStr) {
306 const int colorLabel = colorLabelStr.toInt(&ok);
308 colorLabels << colorLabel;
float value(const T *src, size_t ch)
int growSelection() const
void setMode(SelectionMode newMode)
void setGrowSelection(int newGrowSelection)
void setAntiAliasSelection(bool newAntiAliasSelection)
void actionChanged(SelectionAction action)
void antiAliasSelectionChanged(bool antiAliasSelection)
void setAction(SelectionAction newAction)
void setMoveSelectedContent(bool newMoveSelectedContent)
SelectionMode mode() const
void setSelectedColorLabels(const QList< int > &newSelectedColorLabels)
void featherSelectionChanged(int featherSelection)
void setReferenceLayers(ReferenceLayers newReferenceLayers)
bool stopGrowingAtDarkestPixel() const
void selectedColorLabelsChanged()
void setFeatherSelection(int newFeatherSelection)
QList< int > selectedColorLabels() const
bool antiAliasSelection() const
ReferenceLayers referenceLayers() const
void referenceLayersChanged(ReferenceLayers referenceLayers)
void stopGrowingAtDarkestPixelChanged(bool stopGrowingAtDarkestPixel)
void growSelectionChanged(int growSelection)
bool moveSelectedContent() const
void setStopGrowingAtDarkestPixel(bool newStopGrowingAtDarkestPixel)
SelectionAction action() const
void modeChanged(SelectionMode mode)
int featherSelection() const
void moveSelectedContentChanged(bool moveSelectedContent)