diff --git a/plugins/extensions/resourcemanager/CMakeLists.txt b/plugins/extensions/resourcemanager/CMakeLists.txt index edd81f74de..5ef049c81a 100644 --- a/plugins/extensions/resourcemanager/CMakeLists.txt +++ b/plugins/extensions/resourcemanager/CMakeLists.txt @@ -1,15 +1,17 @@ set(kritaresourcemanager_SOURCES resourcemanager.cpp dlg_create_bundle.cpp dlg_bundle_manager.cpp + dlg_embed_tags.cpp ) ki18n_wrap_ui(kritaresourcemanager_SOURCES wdgdlgcreatebundle.ui wdgdlgbundlemanager.ui + wdgdlgembedtags.ui ) add_library(kritaresourcemanager MODULE ${kritaresourcemanager_SOURCES}) target_link_libraries(kritaresourcemanager kritawidgets kritaui kritalibpaintop kritaresources kritaresourcewidgets) install(TARGETS kritaresourcemanager DESTINATION ${KRITA_PLUGIN_INSTALL_DIR}) install(FILES resourcemanager.xmlgui DESTINATION ${DATA_INSTALL_DIR}/kritaplugins) diff --git a/plugins/extensions/resourcemanager/dlg_create_bundle.cpp b/plugins/extensions/resourcemanager/dlg_create_bundle.cpp index a7663cb368..c6bfad168d 100644 --- a/plugins/extensions/resourcemanager/dlg_create_bundle.cpp +++ b/plugins/extensions/resourcemanager/dlg_create_bundle.cpp @@ -1,393 +1,416 @@ /* * Copyright (c) 2014 Victor Lafon metabolic.ewilan@hotmail.fr + * Copyright (c) 2020 Agata Cacko cacko.azh@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "dlg_create_bundle.h" #include "ui_wdgdlgcreatebundle.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include +#include #include #define ICON_SIZE 48 DlgCreateBundle::DlgCreateBundle(KoResourceBundleSP bundle, QWidget *parent) : KoDialog(parent) , m_ui(new Ui::WdgDlgCreateBundle) , m_bundle(bundle) { m_page = new QWidget(); m_ui->setupUi(m_page); setMainWidget(m_page); setFixedSize(m_page->sizeHint()); setButtons(Ok | Cancel); setDefaultButton(Ok); setButtonText(Ok, i18n("Save")); connect(m_ui->bnSelectSaveLocation, SIGNAL(clicked()), SLOT(selectSaveLocation())); KoDocumentInfo info; info.updateParameters(); if (bundle) { setCaption(i18n("Edit Resource Bundle")); #if 0 /* m_ui->lblSaveLocation->setText(QFileInfo(bundle->filename()).absolutePath()); m_ui->editBundleName->setText(bundle->name()); m_ui->editAuthor->setText(bundle->getMeta("author")); m_ui->editEmail->setText(bundle->getMeta("email")); m_ui->editLicense->setText(bundle->getMeta("license")); m_ui->editWebsite->setText(bundle->getMeta("website")); m_ui->editDescription->document()->setPlainText(bundle->getMeta("description")); m_ui->lblPreview->setPixmap(QPixmap::fromImage(bundle->image().scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation))); Q_FOREACH (const QString & resType, bundle->resourceTypes()) { if (resType == ResourceType::Gradients) { Q_FOREACH (const KoResourceSP res, bundle->resources(resType)) { if (res) { m_selectedGradients << res->filename(); } } } else if (resType == ResourceType::Patterns) { Q_FOREACH (const KoResourceSP res, bundle->resources(resType)) { if (res) { m_selectedPatterns << res->filename(); } } } else if (resType == ResourceType::Brushes) { Q_FOREACH (const KoResourceSP res, bundle->resources(resType)) { if (res) { m_selectedBrushes << res->filename(); } } } else if (resType == ResourceType::Palettes) { Q_FOREACH (const KoResourceSP res, bundle->resources(resType)) { if (res) { m_selectedPalettes << res->filename(); } } } else if (resType == ResourceType::Workspaces) { Q_FOREACH (const KoResourceSP res, bundle->resources(resType)) { if (res) { m_selectedWorkspaces << res->filename(); } } } else if (resType == ResourceType::PaintOpPresets) { Q_FOREACH (const KoResourceSP res, bundle->resources(resType)) { if (res) { m_selectedPresets << res->filename(); } } } else if (resType == ResourceType::GamutMasks) { Q_FOREACH (const KoResourceSP res, bundle->resources(resType)) { if (res) { m_selectedGamutMasks << res->filename(); } } } } */ #endif } else { setCaption(i18n("Create Resource Bundle")); KisConfig cfg(true); m_ui->editAuthor->setText(cfg.readEntry("BundleAuthorName", info.authorInfo("creator"))); m_ui->editEmail->setText(cfg.readEntry("BundleAuthorEmail", info.authorInfo("email"))); m_ui->editWebsite->setText(cfg.readEntry("BundleWebsite", "http://")); m_ui->editLicense->setText(cfg.readEntry("BundleLicense", "CC-BY-SA")); m_ui->editBundleName->setText(cfg.readEntry("BundleName", "New Bundle")); m_ui->editDescription->document()->setPlainText(cfg.readEntry("BundleDescription", "New Bundle")); m_previewImage = cfg.readEntry("BundleImage", ""); if (!m_previewImage.isEmpty()) { QImage img(m_previewImage); img = img.scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation); m_ui->lblPreview->setPixmap(QPixmap::fromImage(img)); } m_ui->lblSaveLocation->setText(cfg.readEntry("BundleExportLocation", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation))); } m_ui->bnAdd->setIcon(KisIconUtils::loadIcon("arrow-right")); connect(m_ui->bnAdd, SIGNAL(clicked()), SLOT(addSelected())); m_ui->bnRemove->setIcon(KisIconUtils::loadIcon("arrow-left")); connect(m_ui->bnRemove, SIGNAL(clicked()), SLOT(removeSelected())); m_ui->cmbResourceTypes->addItem(i18n("Brushes"), ResourceType::Brushes); m_ui->cmbResourceTypes->addItem(i18n("Brush Presets"), ResourceType::PaintOpPresets); m_ui->cmbResourceTypes->addItem(i18n("Gradients"), ResourceType::Gradients); m_ui->cmbResourceTypes->addItem(i18n("Gamut Masks"), ResourceType::GamutMasks); m_ui->cmbResourceTypes->addItem(i18n("Patterns"), ResourceType::Patterns); m_ui->cmbResourceTypes->addItem(i18n("Palettes"), ResourceType::Palettes); m_ui->cmbResourceTypes->addItem(i18n("Workspaces"), ResourceType::Workspaces); connect(m_ui->cmbResourceTypes, SIGNAL(activated(int)), SLOT(resourceTypeSelected(int))); m_ui->tableAvailable->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); m_ui->tableAvailable->setSelectionMode(QAbstractItemView::ExtendedSelection); m_ui->tableSelected->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); m_ui->tableSelected->setSelectionMode(QAbstractItemView::ExtendedSelection); connect(m_ui->bnGetPreview, SIGNAL(clicked()), SLOT(getPreviewImage())); + connect(m_ui->bnEmbedTags, SIGNAL(clicked()), SLOT(slotEmbedTags())); resourceTypeSelected(0); } DlgCreateBundle::~DlgCreateBundle() { delete m_ui; } QString DlgCreateBundle::bundleName() const { return m_ui->editBundleName->text().replace(" ", "_"); } QString DlgCreateBundle::authorName() const { return m_ui->editAuthor->text(); } QString DlgCreateBundle::email() const { return m_ui->editEmail->text(); } QString DlgCreateBundle::website() const { return m_ui->editWebsite->text(); } QString DlgCreateBundle::license() const { return m_ui->editLicense->text(); } QString DlgCreateBundle::description() const { return m_ui->editDescription->document()->toPlainText(); } QString DlgCreateBundle::saveLocation() const { return m_ui->lblSaveLocation->text(); } QString DlgCreateBundle::previewImage() const { return m_previewImage; } +QVector DlgCreateBundle::getTagsForEmbeddingInResource(QVector resourceTags) const +{ + QVector tagsToEmbed; + Q_FOREACH(KisTagSP tag, resourceTags) { + if (m_selectedTagIds.contains(tag->id())) { + tagsToEmbed << tag; + } + } + return tagsToEmbed; +} + void DlgCreateBundle::putResourcesInTheBundle() const { KisResourceModel* emptyModel = KisResourceModelProvider::resourceModel(""); Q_FOREACH(int id, m_selectedResourcesIds) { KoResourceSP res = emptyModel->resourceForId(id); KisResourceModel* resModel = KisResourceModelProvider::resourceModel(res->resourceType().first); - QVector tags = resModel->tagsForResource(id); + QVector tags = getTagsForEmbeddingInResource(resModel->tagsForResource(id)); m_bundle->addResource(res->resourceType().first, res->filename(), tags, res->md5()); } } void DlgCreateBundle::accept() { QString name = bundleName(); QString filename = m_ui->lblSaveLocation->text() + "/" + name + ".bundle"; if (name.isEmpty()) { m_ui->editBundleName->setStyleSheet(QString(" border: 1px solid red")); QMessageBox::warning(this, i18nc("@title:window", "Krita"), i18n("The resource bundle name cannot be empty.")); return; } else { QFileInfo fileInfo(filename); if (fileInfo.exists() && !m_bundle) { m_ui->editBundleName->setStyleSheet("border: 1px solid red"); QMessageBox::warning(this, i18nc("@title:window", "Krita"), i18n("A bundle with this name already exists.")); return; } else { if (!m_bundle) { saveToConfiguration(); m_bundle.reset(new KoResourceBundle(filename)); putResourcesInTheBundle(); m_bundle->save(); } KoDialog::accept(); } } } void DlgCreateBundle::saveToConfiguration() { KisConfig cfg(false); cfg.writeEntry("BundleExportLocation", saveLocation()); cfg.writeEntry("BundleAuthorName", authorName()); cfg.writeEntry("BundleAuthorEmail", email()); cfg.writeEntry("BundleWebsite", website()); cfg.writeEntry("BundleLicense", license()); cfg.writeEntry("BundleName", bundleName()); cfg.writeEntry("BundleDescription", description()); cfg.writeEntry("BundleImage", previewImage()); } +void DlgCreateBundle::slotEmbedTags() +{ + DlgEmbedTags* dlg = new DlgEmbedTags(m_selectedTagIds); + int response = dlg->exec(); + if (response == KoDialog::Accepted) { + m_selectedTagIds = dlg->selectedTagIds(); + } +} + void DlgCreateBundle::reject() { saveToConfiguration(); KoDialog::reject(); } void DlgCreateBundle::selectSaveLocation() { KoFileDialog dialog(this, KoFileDialog::OpenDirectory, "resourcebundlesavelocation"); dialog.setDefaultDir(m_ui->lblSaveLocation->text()); dialog.setCaption(i18n("Select a directory to save the bundle")); QString location = dialog.filename(); m_ui->lblSaveLocation->setText(location); } void DlgCreateBundle::addSelected() { int row = m_ui->tableAvailable->currentRow(); Q_FOREACH (QListWidgetItem *item, m_ui->tableAvailable->selectedItems()) { m_ui->tableSelected->addItem(m_ui->tableAvailable->takeItem(m_ui->tableAvailable->row(item))); m_selectedResourcesIds.append(item->data(Qt::UserRole).toInt()); } m_ui->tableAvailable->setCurrentRow(row); } void DlgCreateBundle::removeSelected() { int row = m_ui->tableSelected->currentRow(); Q_FOREACH (QListWidgetItem *item, m_ui->tableSelected->selectedItems()) { m_ui->tableAvailable->addItem(m_ui->tableSelected->takeItem(m_ui->tableSelected->row(item))); m_selectedResourcesIds.removeAll(item->data(Qt::UserRole).toInt()); } m_ui->tableSelected->setCurrentRow(row); } QPixmap imageToIcon(const QImage &img) { QPixmap pixmap(ICON_SIZE, ICON_SIZE); pixmap.fill(); QImage scaled = img.scaled(ICON_SIZE, ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation); int x = (ICON_SIZE - scaled.width()) / 2; int y = (ICON_SIZE - scaled.height()) / 2; QPainter gc(&pixmap); gc.drawImage(x, y, scaled); gc.end(); return pixmap; } void DlgCreateBundle::resourceTypeSelected(int idx) { QString resourceType = m_ui->cmbResourceTypes->itemData(idx).toString(); m_ui->tableAvailable->clear(); m_ui->tableSelected->clear(); QString standarizedResourceType = (resourceType == "presets" ? ResourceType::PaintOpPresets : resourceType); KisResourceModel* model = KisResourceModelProvider::resourceModel(standarizedResourceType); for (int i = 0; i < model->rowCount(); i++) { QModelIndex idx = model->index(i, 0); QString filename = model->data(idx, Qt::UserRole + KisResourceModel::Filename).toString(); int id = model->data(idx, Qt::UserRole + KisResourceModel::Id).toInt(); if (resourceType == ResourceType::Gradients) { if (filename == "Foreground to Transparent" || filename == "Foreground to Background") { continue; } } QImage image = (model->data(idx, Qt::UserRole + KisResourceModel::Thumbnail)).value(); QString name = model->data(idx, Qt::UserRole + KisResourceModel::Name).toString(); // Function imageToIcon(QImage()) returns a square white pixmap and a warning "QImage::scaled: Image is a null image" // while QPixmap() returns an empty pixmap. // The difference between them is relevant in case of Workspaces which has no images. // Using QPixmap() makes them appear in a dense list without icons, while imageToIcon(QImage()) // would give a list with big white rectangles and names of the workspaces. QListWidgetItem *item = new QListWidgetItem(image.isNull() ? QPixmap() : imageToIcon(image), name); item->setData(Qt::UserRole, id); if (m_selectedResourcesIds.contains(id)) { m_ui->tableSelected->addItem(item); } else { m_ui->tableAvailable->addItem(item); } } } void DlgCreateBundle::getPreviewImage() { KoFileDialog dialog(this, KoFileDialog::OpenFile, "BundlePreviewImage"); dialog.setCaption(i18n("Select file to use as bundle icon")); dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)); dialog.setMimeTypeFilters(KisImportExportManager::supportedMimeTypes(KisImportExportManager::Import)); m_previewImage = dialog.filename(); QImage img(m_previewImage); img = img.scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation); m_ui->lblPreview->setPixmap(QPixmap::fromImage(img)); } diff --git a/plugins/extensions/resourcemanager/dlg_create_bundle.h b/plugins/extensions/resourcemanager/dlg_create_bundle.h index c243bcdfa0..70e36092f5 100644 --- a/plugins/extensions/resourcemanager/dlg_create_bundle.h +++ b/plugins/extensions/resourcemanager/dlg_create_bundle.h @@ -1,91 +1,79 @@ /* * Copyright (c) 2014 Victor Lafon metabolic.ewilan@hotmail.fr + * Copyright (c) 2020 Agata Cacko cacko.azh@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KOBUNDLECREATIONWIDGET_H #define KOBUNDLECREATIONWIDGET_H #include #include namespace Ui { class WdgDlgCreateBundle; } class DlgCreateBundle : public KoDialog { Q_OBJECT public: explicit DlgCreateBundle(KoResourceBundleSP bundle = nullptr, QWidget *parent = 0); ~DlgCreateBundle() override; QString bundleName() const; QString authorName() const; QString email() const; QString website() const; QString license() const; QString description() const; QString saveLocation() const; QString previewImage() const; - QStringList selectedBrushes() const { return m_selectedBrushes; } - QStringList selectedPresets() const { return m_selectedPresets; } - QStringList selectedGradients() const { return m_selectedGradients; } - QStringList selectedPatterns() const { return m_selectedPatterns; } - QStringList selectedPalettes() const { return m_selectedPalettes; } - QStringList selectedWorkspaces() const { return m_selectedWorkspaces; } - QStringList selectedGamutMasks() const { return m_selectedGamutMasks; } - private Q_SLOTS: void accept() override; void reject() override; void selectSaveLocation(); void addSelected(); void removeSelected(); void resourceTypeSelected(int idx); void getPreviewImage(); void saveToConfiguration(); + void slotEmbedTags(); + QVector getTagsForEmbeddingInResource(QVector resourceTags) const; private: void putResourcesInTheBundle() const; QWidget *m_page; Ui::WdgDlgCreateBundle *m_ui; QList m_selectedResourcesIds; - - QStringList m_selectedBrushes; - QStringList m_selectedPresets; - QStringList m_selectedGradients; - QStringList m_selectedPatterns; - QStringList m_selectedPalettes; - QStringList m_selectedWorkspaces; - QStringList m_selectedGamutMasks; + QList m_selectedTagIds; QString m_previewImage; KoResourceBundleSP m_bundle; }; #endif // KOBUNDLECREATIONWIDGET_H diff --git a/plugins/extensions/resourcemanager/dlg_embed_tags.cpp b/plugins/extensions/resourcemanager/dlg_embed_tags.cpp new file mode 100644 index 0000000000..2380a339c3 --- /dev/null +++ b/plugins/extensions/resourcemanager/dlg_embed_tags.cpp @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2020 Agata Cacko cacko.azh@gmail.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "ui_wdgdlgembedtags.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define ICON_SIZE 48 + +DlgEmbedTags::DlgEmbedTags(QList selectedTags, QWidget *parent) + : KoDialog(parent) + , m_ui(new Ui::WdgDlgEmbedTags) +{ + m_page = new QWidget(); + m_ui->setupUi(m_page); + setMainWidget(m_page); + setFixedSize(m_page->sizeHint()); + setButtons(Ok | Cancel); + setDefaultButton(Ok); + setButtonText(Ok, i18n("Save")); + m_selectedTagIds = selectedTags; + + + KoDocumentInfo info; + info.updateParameters(); + + + m_ui->bnAdd->setIcon(KisIconUtils::loadIcon("arrow-right")); + connect(m_ui->bnAdd, SIGNAL(clicked()), SLOT(addSelected())); + + m_ui->bnRemove->setIcon(KisIconUtils::loadIcon("arrow-left")); + connect(m_ui->bnRemove, SIGNAL(clicked()), SLOT(removeSelected())); + + + m_ui->cmbResourceTypes->addItem(i18n("Brushes"), ResourceType::Brushes); + m_ui->cmbResourceTypes->addItem(i18n("Brush Presets"), ResourceType::PaintOpPresets); + m_ui->cmbResourceTypes->addItem(i18n("Gradients"), ResourceType::Gradients); + m_ui->cmbResourceTypes->addItem(i18n("Gamut Masks"), ResourceType::GamutMasks); + m_ui->cmbResourceTypes->addItem(i18n("Patterns"), ResourceType::Patterns); + m_ui->cmbResourceTypes->addItem(i18n("Palettes"), ResourceType::Palettes); + m_ui->cmbResourceTypes->addItem(i18n("Workspaces"), ResourceType::Workspaces); + + connect(m_ui->cmbResourceTypes, SIGNAL(activated(int)), SLOT(resourceTypeSelected(int))); + + m_ui->tableAvailable->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); + m_ui->tableAvailable->setSelectionMode(QAbstractItemView::ExtendedSelection); + + m_ui->tableSelected->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); + m_ui->tableSelected->setSelectionMode(QAbstractItemView::ExtendedSelection); + + resourceTypeSelected(0); +} + +DlgEmbedTags::~DlgEmbedTags() +{ + delete m_ui; +} + +QList DlgEmbedTags::selectedTagIds() +{ + return m_selectedTagIds; +} + +void DlgEmbedTags::addSelected() +{ + int row = m_ui->tableAvailable->currentRow(); + + Q_FOREACH (QListWidgetItem *item, m_ui->tableAvailable->selectedItems()) { + m_ui->tableSelected->addItem(m_ui->tableAvailable->takeItem(m_ui->tableAvailable->row(item))); + m_selectedTagIds.append(item->data(Qt::UserRole).toInt()); + } + + m_ui->tableAvailable->setCurrentRow(row); +} + +void DlgEmbedTags::removeSelected() +{ + int row = m_ui->tableSelected->currentRow(); + + Q_FOREACH (QListWidgetItem *item, m_ui->tableSelected->selectedItems()) { + m_ui->tableAvailable->addItem(m_ui->tableSelected->takeItem(m_ui->tableSelected->row(item))); + m_selectedTagIds.removeAll(item->data(Qt::UserRole).toInt()); + } + + m_ui->tableSelected->setCurrentRow(row); +} + +void DlgEmbedTags::resourceTypeSelected(int idx) +{ + QString resourceType = m_ui->cmbResourceTypes->itemData(idx).toString(); + + m_ui->tableAvailable->clear(); + m_ui->tableSelected->clear(); + + QString standarizedResourceType = (resourceType == "presets" ? ResourceType::PaintOpPresets : resourceType); + + KisTagModel* model = KisTagModelProvider::tagModel(standarizedResourceType); + + for (int i = 0; i < model->rowCount(); i++) { + + QModelIndex idx = model->index(i, 0); + QString name = model->data(idx, Qt::DisplayRole).toString(); + int id = model->data(idx, Qt::UserRole + KisTagModel::Id).toInt(); + + if (id < 0) { + // skip automated tags + continue; + } + + QListWidgetItem *item = new QListWidgetItem(QPixmap(), name); + item->setData(Qt::UserRole, id); + + if (m_selectedTagIds.contains(id)) { + m_ui->tableSelected->addItem(item); + } + else { + m_ui->tableAvailable->addItem(item); + } + } + +} + + diff --git a/plugins/extensions/resourcemanager/dlg_embed_tags.h b/plugins/extensions/resourcemanager/dlg_embed_tags.h new file mode 100644 index 0000000000..1bc8ccb1e3 --- /dev/null +++ b/plugins/extensions/resourcemanager/dlg_embed_tags.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 Agata Cacko cacko.azh@gmail.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifndef DLG_EMBED_TAGS_H +#define DLG_EMBED_TAGS_H + +#include + +#include + +namespace Ui +{ +class WdgDlgEmbedTags; +} + +class DlgEmbedTags : public KoDialog +{ + Q_OBJECT + +public: + explicit DlgEmbedTags(QList selectedTags, QWidget *parent = 0); + ~DlgEmbedTags() override; + + QList selectedTagIds(); + +private Q_SLOTS: + + void addSelected(); + void removeSelected(); + void resourceTypeSelected(int idx); + +private: + + QWidget *m_page; + Ui::WdgDlgEmbedTags *m_ui; + + QList m_selectedTagIds; +}; + +#endif // KOBUNDLECREATIONWIDGET_H diff --git a/plugins/extensions/resourcemanager/wdgdlgcreatebundle.ui b/plugins/extensions/resourcemanager/wdgdlgcreatebundle.ui index cd6ffeae41..29cd137eeb 100644 --- a/plugins/extensions/resourcemanager/wdgdlgcreatebundle.ui +++ b/plugins/extensions/resourcemanager/wdgdlgcreatebundle.ui @@ -1,480 +1,487 @@ WdgDlgCreateBundle 0 0 895 - 460 + 491 0 0 New Bundle... 1.000000000000000 15 15 15 15 20 12 12 Type: 0 0 QComboBox::InsertAlphabetically 12 0 12 0 350 2 Available Qt::Vertical 20 40 12 Qt::Vertical 20 40 ... ... Qt::Vertical 20 40 12 0 350 2 Selected Qt::Vertical 20 40 QFormLayout::AllNonFixedFieldsGrow Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 8 8 Bundle Name: Description: 16777215 120 Author: false Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Email: Website: http:// License: - - - - Save to: - - - - - - - 8 - - - 3 - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - 16777215 - 25 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - TextLabel - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - 0 - - - - - - - ... - - - - - 0 0 Icon: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 2 0 0 0 0 64 64 64 64 0 0 QFrame::StyledPanel QFrame::Sunken true 0 0 ... (256 x 256) Qt::Horizontal 40 20 + + + + Save to: + + + + + + + 8 + + + 3 + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 25 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + TextLabel + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 0 + + + + + + + ... + + + + + + + + + Embed tags... + + + diff --git a/plugins/extensions/resourcemanager/wdgdlgembedtags.ui b/plugins/extensions/resourcemanager/wdgdlgembedtags.ui new file mode 100644 index 0000000000..0b66ed63e1 --- /dev/null +++ b/plugins/extensions/resourcemanager/wdgdlgembedtags.ui @@ -0,0 +1,216 @@ + + + WdgDlgEmbedTags + + + + 0 + 0 + 895 + 491 + + + + + 0 + 0 + + + + New Bundle... + + + 1.000000000000000 + + + + 15 + + + 15 + + + 15 + + + 15 + + + 20 + + + + + 12 + + + + + 12 + + + + + Type: + + + + + + + + 0 + 0 + + + + QComboBox::InsertAlphabetically + + + + + + + + + 12 + + + + + 0 + + + 12 + + + + + + 0 + 350 + + + + 2 + + + + + + + Available + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + 12 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + ... + + + + + + + ... + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + 12 + + + + + + 0 + 350 + + + + 2 + + + + + + + Selected + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + +