diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fbd95e9..17af6f8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,8 @@ add_definitions(-DCYAN_VERSION="${PROJECT_VERSION}") add_definitions(-DCYAN_GIT="$ENV{GIT}") set(MAGICK_PKG_CONFIG "Magick++" CACHE STRING "ImageMagick pkg-config name") -set(SOURCES src/main.cpp src/cyan.cpp src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/openlayerdialog.cpp src/FXX.cpp res/cyan.qrc docs/docs.qrc) -set(HEADERS src/cyan.h src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/openlayerdialog.h src/FXX.h) +set(SOURCES src/main.cpp src/cyan.cpp src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/FXX.cpp res/cyan.qrc docs/docs.qrc) +set(HEADERS src/cyan.h src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/FXX.h) set(RESOURCE_FILES res/cyan.qrc docs/docs.qrc) set(RESOURCE_FOLDER res) diff --git a/cyan.pro b/cyan.pro index e34c5e2b..6e3c51f9 100644 --- a/cyan.pro +++ b/cyan.pro @@ -37,14 +37,12 @@ SOURCES += \ src/FXX.cpp \ src/imageview.cpp \ src/profiledialog.cpp \ - src/openlayerdialog.cpp \ src/helpdialog.cpp HEADERS += \ src/cyan.h \ src/FXX.h \ src/imageview.h \ src/profiledialog.h \ - src/openlayerdialog.h \ src/helpdialog.h RESOURCES += \ res/cyan.qrc \ diff --git a/docs/ChangeLog b/docs/ChangeLog.md similarity index 87% rename from docs/ChangeLog rename to docs/ChangeLog.md index 486f6682..eaa18196 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog.md @@ -1,3 +1,9 @@ +## 1.3.0 - TBA + + * Enhanced layer support + * UI changes + * Better GIMP detection + ## 1.2.2 - 20191103 * Added support for output compression quality diff --git a/docs/docs.qrc b/docs/docs.qrc index fad7c7bb..9dffbb54 100644 --- a/docs/docs.qrc +++ b/docs/docs.qrc @@ -3,7 +3,7 @@ images/cyan-promo-04.png images/cyan-promo-05.png cyan.html - ChangeLog + ChangeLog.md images/cyan-usage-02.png images/cyan-usage-05.png images/cyan-usage-06.png diff --git a/src/cyan.cpp b/src/cyan.cpp index a32a9285..c50af505 100644 --- a/src/cyan.cpp +++ b/src/cyan.cpp @@ -593,7 +593,7 @@ void Cyan::writeConfig() void Cyan::aboutCyan() { QString html, changelog, style, license; - QFile changelogFile(":/docs/ChangeLog"); + QFile changelogFile(":/docs/ChangeLog.md"); if (changelogFile.open(QIODevice::ReadOnly)) { QByteArray data = changelogFile.readAll(); changelog.append(data); @@ -1066,11 +1066,12 @@ void Cyan::handlePSDConverted(bool success, const QString &filename) QMessageBox::information(this, tr("Export PSD success"), tr("PSD was saved to %1").arg(filename)); - } else { + } else if (!success) { QMessageBox::warning(this, tr("Failed to export PSD"), tr("Unable to save PSD file %1").arg(filename)); } + if (!lockedSaveFileName.isEmpty()) { QTimer::singleShot(0, qApp, SLOT(quit())); } } void Cyan::updateImage() @@ -1351,42 +1352,19 @@ void Cyan::bitDepthChanged(int index) void Cyan::gimpPlugin() { - QStringList versions,folders; + QStringList versions,folders,gimps; versions << "2.4" << "2.6" << "2.7" << "2.8" << "2.9" << "2.10" << "3.0"; + gimps << ".gimp-" << ".config/GIMP-AppImage/" << ".config/GIMP/" << "AppData/Roaming/GIMP/" << "Library/Application Support/GIMP/"; foreach (QString version, versions) { - bool hasDir = false; - QDir gimpDir; - QString gimpPath; - gimpPath.append(QDir::homePath()); - gimpPath.append(QDir::separator()); -#ifndef Q_OS_MAC - //gimpPath.append(QString(".gimp-%1").arg(version)); - gimpPath.append(QString(".config/GIMP-AppImage/%1").arg(version)); - if (gimpDir.exists(gimpPath)) { hasDir = true; } - if (!hasDir) { - gimpPath = QString("%1/.config/GIMP/%2").arg(QDir::homePath()).arg(version); - if (gimpDir.exists(gimpPath)) { hasDir = true; } - } - if (!hasDir) { - gimpPath = QString("%1/AppData/Roaming/GIMP/%2/").arg(QDir::homePath()).arg(version); - if (gimpDir.exists(gimpPath)) { hasDir = true; } - } -#else - gimpPath.append("Library/Application Support/GIMP/"+version); - if (gimpDir.exists(gimpPath)) { - hasDir = true; - } -#endif - if (hasDir) { - gimpPath.append(QDir::separator()); - gimpPath.append("plug-ins"); - if (!gimpDir.exists(gimpPath)) { - gimpDir.mkdir(gimpPath); + foreach (QString gimp, gimps) { + QString configPath = QString("%1/%2%3/plug-ins") + .arg(QDir::homePath()) + .arg(gimp) + .arg(version); + if (QFile::exists(configPath)) { + folders << QString("%1/cyan.py").arg(configPath); + qDebug() << "found GIMP folder" << configPath; } - QString result = gimpPath; - result.append(QDir::separator()); - result.append("cyan.py"); - folders << result; } }