26#include <QStandardPaths>
33#include "ui_wdgcolorspaceselector.h"
48 setObjectName(
"KisColorSpaceSelector");
66 d->
defaultsuffix =
" "+i18nc(
"This is appended to the color profile which is the default for the given colorspace and bit-depth",
"(Default)");
84 const QString currentProfileName =
d->
colorSpaceSelector->cmbProfile->currentUnsqueezedText();
94 profileNames.append(profile->
name());
96 std::sort(profileNames.begin(), profileNames.end());
97 Q_FOREACH (QString stringName, profileNames) {
98 if (stringName == defaultProfileName) {
118 if (depths.contains(activeDepth)) {
197 dialog.setCaption(i18n(
"Install Color Profiles"));
198 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
199 dialog.setMimeTypeFilters(
QStringList() <<
"application/vnd.iccprofile",
"application/vnd.iccprofile");
208 Q_FOREACH (
const QString &profileName, profileNames) {
209 QUrl file(profileName);
210 if (!QFile::copy(profileName, saveLocation + file.fileName())) {
211 dbgKrita <<
"Could not install profile!";
214 iccEngine->
addProfile(saveLocation + file.fileName());
225 advancedSelector.setModal(
true);
233 const auto result = (QDialog::DialogCode)advancedSelector.exec();
235 if (result == QDialog::Accepted) {
QList< QString > QStringList
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void setCurrentColorSpace(const KoColorSpace *colorSpace)
void selectionChanged(bool valid)
const KoColorSpace * currentColorSpace()
void setCurrentColorSpace(const KoColorSpace *colorSpace)
void slotDepthsComboBoxActivated()
void setCurrentColorDepth(const KoID &id)
void showDepth(bool showDepth)
KisColorSpaceSelector(QWidget *parent)
void selectionChanged(bool valid)
~KisColorSpaceSelector() override
void slotProfilesComboBoxActivated()
const KoColorSpace * currentColorSpace()
void slotOpenAdvancedSelector()
void setCurrentProfile(const QString &name)
void slotProfileValid(bool valid)
void showColorBrowserButton(bool showButton)
void setCurrentColorModel(const KoID &id)
void fillCmbDepths(const KoID &idd)
void slotModelsComboBoxActivated(const KoID &id)
static KoColorSpaceEngineRegistry * instance()
virtual KoID colorModelId() const =0
virtual KoID colorDepthId() const =0
virtual const KoColorProfile * profile() const =0
T get(const QString &id) const
static QString saveLocation(const QString &type, const QString &suffix=QString(), bool create=true)
#define koIcon(name)
Use these macros for icons without any issues.
Ui_WdgColorSpaceSelector * colorSpaceSelector
virtual const KoColorProfile * addProfile(const QString &filename)=0
QString colorSpaceId(const QString &colorModelId, const QString &colorDepthId) const
QList< KoID > colorDepthList(const KoID &colorModelId, ColorSpaceListVisibility option) const
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
static KoColorSpaceRegistry * instance()
QString defaultProfileForColorSpace(const QString &colorSpaceId) const
QList< const KoColorProfile * > profilesFor(const QString &csID) const
@ OnlyUserVisible
Only user visible color space.