10#include <QProcessEnvironment>
12#include <QStandardPaths>
14#include <QTableWidget>
37 , m_tagSelectionWidget(widget)
38 , m_editable(editable)
42 connect(widget, SIGNAL(sigCreateNewTag(QString)),
this, SLOT(
slotCreateNewTag(QString)));
65 if (resourceIds.count() == 0) {
101 if (tagsp.isNull()) {
105 }
else if (!tagsp->active()) {
106 QMessageBox question = QMessageBox(QMessageBox::Question,
107 i18nc(
"Dialog title",
"Overwrite tag?"),
108 i18nc(
"Question to the user in a dialog about creating a tag",
109 "A tag with this unique name already exists. Do you want to replace it?")
112 i18nc(
"Option in a dialog to discard the previously existing tag and creating a new one in its place",
113 "Replace (overwrite) tag"),
114 QMessageBox::DestructiveRole
117 i18nc(
"Option in a dialog to undelete (reactivate) existing tag with its old assigned resources",
118 "Restore previous tag"),
119 QMessageBox::AcceptRole);
120 question.addButton(QMessageBox::Cancel);
122 QMessageBox::ButtonRole response = question.buttonRole(question.clickedButton());
123 if (response == QMessageBox::DestructiveRole) {
126 }
else if (response == QMessageBox::AcceptRole) {
147 QMap<QString, int> tagsCounts;
148 for (
int i = 0; i <
m_tagModel->rowCount(); i++) {
155 if (!tagsCounts.contains(tagUrl)) {
156 tagsCounts.insert(tagUrl, 0);
167 tagsCounts[tag->url()] += 1;
173 for (
int i = 0; i <
m_tagModel->rowCount(); i++) {
181 KoID tag(tagUrl, tagName);
184 }
else if (tagsCounts[tagUrl] > 0) {
197 , m_tagSelectionWidget(widget)
198 , m_editable(editable)
216 Q_FOREACH(
KoID tag, tagList) {
218 selectedTags << tagSP->id();
264 typedef QPair<QString, QString> resourceTypePair;
283 for (
int i = 0; i < model->rowCount(); i++) {
284 QModelIndex idx = model->index(i, 0);
287 if (tag.isNull() || tag->id() < 0) {
291 KoID custom =
KoID(tag->url(), tag->name());
295 notSelected << custom;
298 notSelected << custom;
KisTagSP tagForUrl(const QString &url) const override
Retrieve a tag by url.
The KisTagResourceModel class makes it possible to retrieve the resources for certain tags or the tag...
#define KIS_ASSERT_RECOVER_RETURN(cond)
const QString LayerStyles
const QString SeExprScripts
const QString PaintOpPresets