50 : m_changingProfile(false)
52 QGridLayout *layout =
new QGridLayout(
this);
53 layout->setContentsMargins(0, 0, 0, 0);
70 QGridLayout *detailsLayout =
new QGridLayout();
71 detailsLayout->setContentsMargins(0, 0, 0, 0);
72 detailsLayout->setVerticalSpacing(0);
74 m_usePath =
new QCheckBox(i18n(
"&Follow selected path"),
this);
75 detailsLayout->addWidget(
m_usePath, 0, 0, 1, 4);
77 m_usePressure =
new QCheckBox(i18n(
"Use tablet &pressure"),
this);
80 QLabel *widthLabel =
new QLabel(i18n(
"Width:"),
this);
81 widthLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
85 detailsLayout->addWidget(widthLabel, 2, 2);
88 QLabel *thinningLabel =
new QLabel(i18n(
"Thinning:"),
this);
89 thinningLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
94 detailsLayout->addWidget(thinningLabel, 2, 0);
97 m_useAngle =
new QCheckBox(i18n(
"Use tablet &angle"),
this);
98 detailsLayout->addWidget(
m_useAngle, 3, 0, 1, 4);
100 QLabel *angleLabel =
new QLabel(i18n(
"Angle:"),
this);
101 angleLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
108 detailsLayout->addWidget(angleLabel, 4, 0);
111 QLabel *fixationLabel =
new QLabel(i18n(
"Fixation:"),
this);
112 fixationLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
117 detailsLayout->addWidget(fixationLabel, 5, 0);
120 QLabel *capsLabel =
new QLabel(i18n(
"Caps:"),
this);
121 capsLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
126 detailsLayout->addWidget(capsLabel, 5, 2);
127 detailsLayout->addWidget(
m_capsBox, 5, 3);
129 QLabel *massLabel =
new QLabel(i18n(
"Mass:"),
this);
130 massLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
135 detailsLayout->addWidget(massLabel, 6, 0);
136 detailsLayout->addWidget(
m_massBox, 6, 1);
138 QLabel *dragLabel =
new QLabel(i18n(
"Drag:"),
this);
139 dragLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
144 detailsLayout->addWidget(dragLabel, 6, 2);
145 detailsLayout->addWidget(
m_dragBox, 6, 3);
147 layout->addLayout(detailsLayout, 1, 0, 1, 3);
148 layout->setRowStretch(2, 1);
208 name = QInputDialog::getText(
this,
209 i18n(
"Profile name"),
210 i18n(
"Please insert the name by which "
211 "you want to save this profile:"),
212 QLineEdit::Normal, QString(), &ok);
217 if (name.isEmpty() || name == i18n(
"Current")) {
218 QMessageBox::warning(
this,
219 i18n(
"The name you entered is invalid."),
220 i18nc(
"invalid profile name",
"Invalid name."));
226 int ret = QMessageBox::warning(
this,
227 i18nc(
"@title:window",
"Krita"),
228 i18n(
"A profile with that name already exists.\n"
229 "Do you want to overwrite it?"),
230 QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes);
232 if (ret == QMessageBox::Yes) {
402 KConfigGroup profileGroup(&config,
"Profile" + QString::number(i));
404 if (!profileGroup.hasKey(
"name")) {
410 profile->
name = profileGroup.readEntry(
"name", QString());
411 profile->
usePath = profileGroup.readEntry(
"usePath",
false);
412 profile->
usePressure = profileGroup.readEntry(
"usePressure",
false);
413 profile->
useAngle = profileGroup.readEntry(
"useAngle",
false);
414 profile->
width = profileGroup.readEntry(
"width", 30.0);
415 profile->
thinning = profileGroup.readEntry(
"thinning", 0.2);
416 profile->
angle = profileGroup.readEntry(
"angle", 30);
417 profile->
fixation = profileGroup.readEntry(
"fixation", 0.0);
418 profile->
caps = profileGroup.readEntry(
"caps", 0.0);
419 profile->
mass = profileGroup.readEntry(
"mass", 3.0);
420 profile->
drag = profileGroup.readEntry(
"drag", 0.7);
427 ProfileMap::const_iterator it =
m_profiles.constBegin();
428 ProfileMap::const_iterator lastIt =
m_profiles.constEnd();
429 for (; it != lastIt; ++it) {