gmic 3.1.5
OBS-URL: https://build.opensuse.org/package/show/graphics/gmic?expand=0&rev=76
This commit is contained in:
parent
681ec0eaa0
commit
03b7ff84ee
@ -1,202 +0,0 @@
|
|||||||
diff --git a/gmic-qt/CMakeLists.txt b/gmic-qt/CMakeLists.txt
|
|
||||||
index fe92d48..8bba11e 100644
|
|
||||||
--- a/gmic-qt/CMakeLists.txt
|
|
||||||
+++ b/gmic-qt/CMakeLists.txt
|
|
||||||
@@ -29,17 +29,24 @@ else()
|
|
||||||
message("Building for target host application: " ${GMIC_QT_HOST})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../src/gmic.cpp")
|
|
||||||
- set (GMIC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../src" CACHE STRING "Define the path to the gmic headers")
|
|
||||||
+option(ENABLE_SYSTEM_GMIC "Find GMIC shared library installed on the system" ON)
|
|
||||||
+
|
|
||||||
+if (ENABLE_SYSTEM_GMIC)
|
|
||||||
+ option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC shared library" ON)
|
|
||||||
else()
|
|
||||||
+ option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC shared library" OFF)
|
|
||||||
+
|
|
||||||
+ set (GMIC_LIB_PATH "${GMIC_PATH}" CACHE STRING "Define the path to the GMIC shared library")
|
|
||||||
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../src/gmic.cpp")
|
|
||||||
+ set (GMIC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../src" CACHE STRING "Define the path to the gmic headers")
|
|
||||||
+ else()
|
|
||||||
set (GMIC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../gmic/src" CACHE STRING "Define the path to the gmic headers")
|
|
||||||
-endif()
|
|
||||||
+ endif()
|
|
||||||
|
|
||||||
-message("G'MIC path: " ${GMIC_PATH})
|
|
||||||
+ message("G'MIC path: " ${GMIC_PATH})
|
|
||||||
+endif()
|
|
||||||
|
|
||||||
-option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC shared library" OFF)
|
|
||||||
option(ENABLE_CURL "Add support for curl" ON)
|
|
||||||
-set (GMIC_LIB_PATH "${GMIC_PATH}" CACHE STRING "Define the path to the GMIC shared library")
|
|
||||||
|
|
||||||
option(ENABLE_ASAN "Enable -fsanitize=address (if debug build)" ON)
|
|
||||||
option(ENABLE_FFTW3 "Enable FFTW3 library support" ON)
|
|
||||||
@@ -61,55 +68,57 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
-#
|
|
||||||
-# Look for G'MIC repository
|
|
||||||
-#
|
|
||||||
-get_filename_component(GMIC_ABSOLUTE_PATH ${GMIC_PATH} ABSOLUTE BASEDIR ${CMAKE_SOURCE_DIR})
|
|
||||||
-if (EXISTS ${GMIC_ABSOLUTE_PATH}/gmic.cpp)
|
|
||||||
- message("Found G'MIC repository")
|
|
||||||
-else()
|
|
||||||
- get_filename_component(TARGET_CLONE_DIR ${GMIC_ABSOLUTE_PATH}/.. ABSOLUTE)
|
|
||||||
- message("")
|
|
||||||
- message("Cannot find G'MIC repository in " ${GMIC_ABSOLUTE_PATH} )
|
|
||||||
- message("")
|
|
||||||
- message("You should try:")
|
|
||||||
- message("")
|
|
||||||
- message(" git clone https://github.com/dtschump/gmic.git " ${TARGET_CLONE_DIR}/gmic )
|
|
||||||
- message("")
|
|
||||||
- message(FATAL_ERROR "\nG'MIC repository not found")
|
|
||||||
-endif()
|
|
||||||
+if (NOT ENABLE_SYSTEM_GMIC)
|
|
||||||
+ #
|
|
||||||
+ # Look for G'MIC repository
|
|
||||||
+ #
|
|
||||||
+ get_filename_component(GMIC_ABSOLUTE_PATH ${GMIC_PATH} ABSOLUTE BASEDIR ${CMAKE_SOURCE_DIR})
|
|
||||||
+ if (EXISTS ${GMIC_ABSOLUTE_PATH}/gmic.cpp)
|
|
||||||
+ message("Found G'MIC repository")
|
|
||||||
+ else()
|
|
||||||
+ get_filename_component(TARGET_CLONE_DIR ${GMIC_ABSOLUTE_PATH}/.. ABSOLUTE)
|
|
||||||
+ message("")
|
|
||||||
+ message("Cannot find G'MIC repository in " ${GMIC_ABSOLUTE_PATH} )
|
|
||||||
+ message("")
|
|
||||||
+ message("You should try:")
|
|
||||||
+ message("")
|
|
||||||
+ message(" git clone https://github.com/dtschump/gmic.git " ${TARGET_CLONE_DIR}/gmic )
|
|
||||||
+ message("")
|
|
||||||
+ message(FATAL_ERROR "\nG'MIC repository not found")
|
|
||||||
+ endif()
|
|
||||||
|
|
||||||
-#
|
|
||||||
-# Look for CImg.h and gmic_stdlib_community.h
|
|
||||||
-#
|
|
||||||
-set(GMIC_FILES CImg.h gmic_stdlib_community.h)
|
|
||||||
-foreach(F ${GMIC_FILES})
|
|
||||||
+ #
|
|
||||||
+ # Look for CImg.h and gmic_stdlib_community.h
|
|
||||||
+ #
|
|
||||||
+ set(GMIC_FILES CImg.h gmic_stdlib_community.h)
|
|
||||||
+ foreach(F ${GMIC_FILES})
|
|
||||||
if(EXISTS ${GMIC_ABSOLUTE_PATH}/${F})
|
|
||||||
- message("Found " ${GMIC_PATH}/${F})
|
|
||||||
+ message("Found " ${GMIC_PATH}/${F})
|
|
||||||
else()
|
|
||||||
- message(${F} " not found")
|
|
||||||
- execute_process(COMMAND make -C ${GMIC_ABSOLUTE_PATH} ${F})
|
|
||||||
- if(EXISTS ${GMIC_ABSOLUTE_PATH}/${F})
|
|
||||||
+ message(${F} " not found")
|
|
||||||
+ execute_process(COMMAND make -C ${GMIC_ABSOLUTE_PATH} ${F})
|
|
||||||
+ if(EXISTS ${GMIC_ABSOLUTE_PATH}/${F})
|
|
||||||
message("Found " ${GMIC_PATH}/${F})
|
|
||||||
- else()
|
|
||||||
+ else()
|
|
||||||
message(FATAL_ERROR "\nCannot obtain " ${GMIC_PATH}/${F})
|
|
||||||
- endif()
|
|
||||||
+ endif()
|
|
||||||
endif()
|
|
||||||
-endforeach()
|
|
||||||
+ endforeach()
|
|
||||||
|
|
||||||
-#
|
|
||||||
-# Ensure that gmic and CImg are the same version
|
|
||||||
-#
|
|
||||||
-file(STRINGS ${GMIC_ABSOLUTE_PATH}/CImg.h CIMG_VERSION REGEX "cimg_version ")
|
|
||||||
-string(REGEX REPLACE ".*cimg_version " "" CIMG_VERSION ${CIMG_VERSION})
|
|
||||||
-message("CImg version is [" ${CIMG_VERSION} "]")
|
|
||||||
+ #
|
|
||||||
+ # Ensure that gmic and CImg are the same version
|
|
||||||
+ #
|
|
||||||
+ file(STRINGS ${GMIC_ABSOLUTE_PATH}/CImg.h CIMG_VERSION REGEX "cimg_version ")
|
|
||||||
+ string(REGEX REPLACE ".*cimg_version " "" CIMG_VERSION ${CIMG_VERSION})
|
|
||||||
+ message("CImg version is [" ${CIMG_VERSION} "]")
|
|
||||||
|
|
||||||
-file(STRINGS ${GMIC_ABSOLUTE_PATH}/gmic.h GMIC_VERSION REGEX "gmic_version ")
|
|
||||||
-string(REGEX REPLACE ".*gmic_version " "" GMIC_VERSION ${GMIC_VERSION})
|
|
||||||
-message("G'MIC version is [" ${GMIC_VERSION} "]")
|
|
||||||
+ file(STRINGS ${GMIC_ABSOLUTE_PATH}/gmic.h GMIC_VERSION REGEX "gmic_version ")
|
|
||||||
+ string(REGEX REPLACE ".*gmic_version " "" GMIC_VERSION ${GMIC_VERSION})
|
|
||||||
+ message("G'MIC version is [" ${GMIC_VERSION} "]")
|
|
||||||
|
|
||||||
-if (NOT(${GMIC_VERSION} EQUAL ${CIMG_VERSION}))
|
|
||||||
+ if (NOT(${GMIC_VERSION} EQUAL ${CIMG_VERSION}))
|
|
||||||
message(FATAL_ERROR "\nVersion numbers of files 'gmic.h' (" ${GMIC_VERSION} ") and 'CImg.h' (" ${CIMG_VERSION} ") mismatch")
|
|
||||||
+ endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
@@ -128,6 +137,13 @@ endif()
|
|
||||||
|
|
||||||
# Required packages
|
|
||||||
|
|
||||||
+#
|
|
||||||
+# Gmic
|
|
||||||
+#
|
|
||||||
+if (ENABLE_SYSTEM_GMIC)
|
|
||||||
+ find_package(Gmic REQUIRED CONFIG)
|
|
||||||
+endif (ENABLE_SYSTEM_GMIC)
|
|
||||||
+
|
|
||||||
#
|
|
||||||
# Threads
|
|
||||||
#
|
|
||||||
@@ -360,14 +376,19 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
||||||
else()
|
|
||||||
string(REPLACE "-O2" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
|
||||||
string(REPLACE "-O3" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
|
||||||
- set_source_files_properties(${GMIC_PATH}/gmic.cpp PROPERTIES COMPILE_FLAGS "-Ofast")
|
|
||||||
+ if (NOT ENABLE_SYSTEM_GMIC)
|
|
||||||
+ set_source_files_properties(${GMIC_PATH}/gmic.cpp PROPERTIES COMPILE_FLAGS "-Ofast")
|
|
||||||
+ endif (NOT ENABLE_SYSTEM_GMIC)
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Build type not recognized (${CMAKE_BUILD_TYPE})")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
-include_directories(${CMAKE_SOURCE_DIR}/src ${GMIC_PATH})
|
|
||||||
+if (NOT ENABLE_SYSTEM_GMIC)
|
|
||||||
+ include_directories(${GMIC_PATH})
|
|
||||||
+endif (NOT ENABLE_SYSTEM_GMIC)
|
|
||||||
+include_directories(${CMAKE_SOURCE_DIR}/src)
|
|
||||||
|
|
||||||
set (gmic_qt_SRCS
|
|
||||||
|
|
||||||
@@ -443,11 +464,19 @@ set (gmic_qt_SRCS
|
|
||||||
src/Widgets/ProgressInfoWindow.h
|
|
||||||
src/Widgets/VisibleTagSelector.h
|
|
||||||
src/ZoomConstraint.h
|
|
||||||
+)
|
|
||||||
|
|
||||||
- ${GMIC_PATH}/gmic.h
|
|
||||||
- ${GMIC_PATH}/CImg.h
|
|
||||||
- ${GMIC_PATH}/gmic_stdlib_community.h
|
|
||||||
+if (NOT ENABLE_SYSTEM_GMIC)
|
|
||||||
+ set(gmic_qt_SRCS
|
|
||||||
+ ${gmic_qt_SRCS}
|
|
||||||
+ ${GMIC_PATH}/gmic.h
|
|
||||||
+ ${GMIC_PATH}/CImg.h
|
|
||||||
+ ${GMIC_PATH}/gmic_stdlib_community.h
|
|
||||||
+ )
|
|
||||||
+endif()
|
|
||||||
|
|
||||||
+set(gmic_qt_SRCS
|
|
||||||
+ ${gmic_qt_SRCS}
|
|
||||||
src/ClickableLabel.cpp
|
|
||||||
src/Common.cpp
|
|
||||||
src/OverrideCursor.cpp
|
|
||||||
@@ -540,7 +569,9 @@ if(ENABLE_DYNAMIC_LINKING)
|
|
||||||
${gmic_qt_LIBRARIES}
|
|
||||||
"gmic"
|
|
||||||
)
|
|
||||||
- link_directories(${GMIC_LIB_PATH})
|
|
||||||
+ if (NOT ENABLE_SYSTEM_GMIC)
|
|
||||||
+ link_directories(${GMIC_LIB_PATH})
|
|
||||||
+ endif()
|
|
||||||
else(ENABLE_DYNAMIC_LINKING)
|
|
||||||
set(gmic_qt_SRCS
|
|
||||||
${gmic_qt_SRCS}
|
|
13
gmic.changes
13
gmic.changes
@ -1,3 +1,16 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Aug 25 07:44:24 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
|
||||||
|
|
||||||
|
- Update to 3.1.5. No changelog.
|
||||||
|
- Drop patch, merged upstream:
|
||||||
|
* gmic-qt-make-it-work-without-gmic-cpp.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jun 29 09:03:35 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
|
||||||
|
|
||||||
|
- Update to 3.1.4. No changelog.
|
||||||
|
- Rebase krita5.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed May 11 14:24:36 UTC 2022 - Paolo Stivanin <info@paolostivanin.com>
|
Wed May 11 14:24:36 UTC 2022 - Paolo Stivanin <info@paolostivanin.com>
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
%define gmic_datadir %{_datadir}/gmic
|
%define gmic_datadir %{_datadir}/gmic
|
||||||
|
|
||||||
Name: gmic
|
Name: gmic
|
||||||
Version: 3.1.2
|
Version: 3.1.5
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: GREYC's Magick for Image Computing (denoise and others)
|
Summary: GREYC's Magick for Image Computing (denoise and others)
|
||||||
# gmic-qt is GPL-3.0-or-later, zart is CECILL-2.0, libgmic and cli program are
|
# gmic-qt is GPL-3.0-or-later, zart is CECILL-2.0, libgmic and cli program are
|
||||||
@ -50,12 +50,10 @@ Group: Productivity/Graphics/Bitmap Editors
|
|||||||
URL: https://gmic.eu
|
URL: https://gmic.eu
|
||||||
# Git URL: https://github.com/dtschump/gmic
|
# Git URL: https://github.com/dtschump/gmic
|
||||||
Source0: https://gmic.eu/files/source/gmic_%{version}.tar.gz
|
Source0: https://gmic.eu/files/source/gmic_%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM gmic-qt-make-it-work-without-gmic-cpp.patch - https://github.com/c-koi/gmic-qt/pull/134
|
|
||||||
Patch0: gmic-qt-make-it-work-without-gmic-cpp.patch
|
|
||||||
# PATCH-FIX-UPSTREAM krita.patch - Will be sent upstream soon. For now https://github.com/darix/gmic-qt/tree/krita5
|
# PATCH-FIX-UPSTREAM krita.patch - Will be sent upstream soon. For now https://github.com/darix/gmic-qt/tree/krita5
|
||||||
Patch1: krita5.patch
|
Patch0: krita5.patch
|
||||||
# PATCH-FEATURE-OPENSUSE
|
# PATCH-FEATURE-OPENSUSE
|
||||||
Patch2: 0001-Find-the-local-gmic-library.patch
|
Patch1: 0001-Find-the-local-gmic-library.patch
|
||||||
#
|
#
|
||||||
# SECTION pkg_vcmp
|
# SECTION pkg_vcmp
|
||||||
#
|
#
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:d5070c559c75161a225d74a99c19faf2485a3983139290f998cc6359bb318ba4
|
|
||||||
size 10694085
|
|
3
gmic_3.1.5.tar.gz
Normal file
3
gmic_3.1.5.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:fa77e85b3a39638008515ac525f23f0ed7a45b63c463c0ba6292c87f5e88e30d
|
||||||
|
size 10782647
|
518
krita5.patch
518
krita5.patch
@ -1,5 +1,45 @@
|
|||||||
|
Krita 5 plugin support
|
||||||
|
Origin: https://github.com/amyspark/gmic
|
||||||
|
|
||||||
|
---
|
||||||
|
gmic-qt/CMakeLists.txt | 69 +++++-
|
||||||
|
gmic-qt/gmic_krita_qt.desktop | 9 +
|
||||||
|
gmic-qt/src/DialogSettings.cpp | 33 ++-
|
||||||
|
.../src/FilterParameters/BoolParameter.cpp | 2 +
|
||||||
|
.../src/FilterParameters/FloatParameter.cpp | 3 +-
|
||||||
|
gmic-qt/src/FilterParameters/IntParameter.cpp | 2 +
|
||||||
|
.../src/FilterParameters/NoteParameter.cpp | 2 +
|
||||||
|
.../FilterParameters/SeparatorParameter.cpp | 2 +
|
||||||
|
.../src/FilterSelector/FiltersPresenter.cpp | 2 +-
|
||||||
|
gmic-qt/src/Globals.h | 19 ++
|
||||||
|
gmic-qt/src/GmicProcessor.cpp | 5 +
|
||||||
|
gmic-qt/src/GmicProcessor.h | 1 +
|
||||||
|
gmic-qt/src/GmicQt.cpp | 6 +-
|
||||||
|
gmic-qt/src/HeadlessProcessor.cpp | 7 +-
|
||||||
|
.../src/Host/KritaPlugin/gmicqttoolplugin.cpp | 233 ++++++++++++++++++
|
||||||
|
.../src/Host/KritaPlugin/gmicqttoolplugin.h | 55 +++++
|
||||||
|
.../Host/KritaPlugin/gmicqttoolplugin.json | 9 +
|
||||||
|
gmic-qt/src/Host/KritaPlugin/host.cpp | 195 +++++++++++++++
|
||||||
|
gmic-qt/src/Host/None/JpegQualityDialog.cpp | 6 +-
|
||||||
|
gmic-qt/src/LanguageSettings.cpp | 9 +-
|
||||||
|
gmic-qt/src/MainWindow.cpp | 50 +++-
|
||||||
|
gmic-qt/src/MainWindow.h | 2 +
|
||||||
|
gmic-qt/src/Settings.cpp | 8 +-
|
||||||
|
gmic-qt/src/Tags.cpp | 5 +-
|
||||||
|
gmic-qt/src/Widgets/InOutPanel.cpp | 2 +
|
||||||
|
gmic-qt/src/Widgets/InOutPanel.h | 2 +
|
||||||
|
gmic-qt/src/Widgets/ProgressInfoWindow.cpp | 4 +
|
||||||
|
gmic-qt/src/Widgets/ProgressInfoWindow.h | 2 +
|
||||||
|
gmic-qt/ui/dialogsettings.ui | 2 +-
|
||||||
|
29 files changed, 714 insertions(+), 32 deletions(-)
|
||||||
|
create mode 100644 gmic-qt/gmic_krita_qt.desktop
|
||||||
|
create mode 100644 gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp
|
||||||
|
create mode 100644 gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.h
|
||||||
|
create mode 100644 gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.json
|
||||||
|
create mode 100644 gmic-qt/src/Host/KritaPlugin/host.cpp
|
||||||
|
|
||||||
diff --git a/gmic-qt/CMakeLists.txt b/gmic-qt/CMakeLists.txt
|
diff --git a/gmic-qt/CMakeLists.txt b/gmic-qt/CMakeLists.txt
|
||||||
index 61d2b9c..3d4b109 100644
|
index 3c3fd21..dcd3564 100644
|
||||||
--- a/gmic-qt/CMakeLists.txt
|
--- a/gmic-qt/CMakeLists.txt
|
||||||
+++ b/gmic-qt/CMakeLists.txt
|
+++ b/gmic-qt/CMakeLists.txt
|
||||||
@@ -22,7 +22,7 @@ endif()
|
@@ -22,7 +22,7 @@ endif()
|
||||||
@ -11,7 +51,7 @@ index 61d2b9c..3d4b109 100644
|
|||||||
if (${GMIC_QT_HOST} STREQUAL "none")
|
if (${GMIC_QT_HOST} STREQUAL "none")
|
||||||
message("Building standalone version.")
|
message("Building standalone version.")
|
||||||
else()
|
else()
|
||||||
@@ -657,6 +657,71 @@ elseif (${GMIC_QT_HOST} STREQUAL "krita")
|
@@ -623,6 +623,71 @@ elseif (${GMIC_QT_HOST} STREQUAL "krita")
|
||||||
${gmic_qt_LIBRARIES}
|
${gmic_qt_LIBRARIES}
|
||||||
)
|
)
|
||||||
install(TARGETS gmic_krita_qt RUNTIME DESTINATION bin)
|
install(TARGETS gmic_krita_qt RUNTIME DESTINATION bin)
|
||||||
@ -83,7 +123,7 @@ index 61d2b9c..3d4b109 100644
|
|||||||
|
|
||||||
elseif (${GMIC_QT_HOST} STREQUAL "none")
|
elseif (${GMIC_QT_HOST} STREQUAL "none")
|
||||||
|
|
||||||
@@ -700,7 +765,7 @@ elseif (${GMIC_QT_HOST} STREQUAL "8bf")
|
@@ -666,7 +731,7 @@ elseif (${GMIC_QT_HOST} STREQUAL "8bf")
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
@ -108,26 +148,26 @@ index 0000000..579d427
|
|||||||
+Categories=Qt;KDE;Graphics;
|
+Categories=Qt;KDE;Graphics;
|
||||||
+StartupNotify=false
|
+StartupNotify=false
|
||||||
diff --git a/gmic-qt/src/DialogSettings.cpp b/gmic-qt/src/DialogSettings.cpp
|
diff --git a/gmic-qt/src/DialogSettings.cpp b/gmic-qt/src/DialogSettings.cpp
|
||||||
index b3d8c53..e4050b4 100644
|
index 5f49314..2bc8b9b 100644
|
||||||
--- a/gmic-qt/src/DialogSettings.cpp
|
--- a/gmic-qt/src/DialogSettings.cpp
|
||||||
+++ b/gmic-qt/src/DialogSettings.cpp
|
+++ b/gmic-qt/src/DialogSettings.cpp
|
||||||
@@ -93,11 +93,7 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
@@ -56,11 +56,7 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
||||||
#ifdef _GMIC_QT_DEBUG_
|
#ifdef _GMIC_QT_DEBUG_
|
||||||
ui->cbUpdatePeriodicity->addItem(tr("At launch (debug)"), QVariant(0));
|
ui->cbUpdatePeriodicity->addItem(tr("At launch (debug)"), QVariant(0));
|
||||||
#endif
|
#endif
|
||||||
- for (int i = 0; i < ui->cbUpdatePeriodicity->count(); ++i) {
|
- for (int i = 0; i < ui->cbUpdatePeriodicity->count(); ++i) {
|
||||||
- if (_updatePeriodicity == ui->cbUpdatePeriodicity->itemData(i).toInt()) {
|
- if (Settings::updatePeriodicity() == ui->cbUpdatePeriodicity->itemData(i).toInt()) {
|
||||||
- ui->cbUpdatePeriodicity->setCurrentIndex(i);
|
- ui->cbUpdatePeriodicity->setCurrentIndex(i);
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
+ ui->cbUpdatePeriodicity->setCurrentIndex(ui->cbUpdatePeriodicity->findData(_updatePeriodicity));
|
+ ui->cbUpdatePeriodicity->setCurrentIndex(ui->cbUpdatePeriodicity->findData(Settings::updatePeriodicity()));
|
||||||
|
|
||||||
ui->outputMessages->setToolTip(tr("Output messages"));
|
ui->outputMessages->setToolTip(tr("Output messages"));
|
||||||
ui->outputMessages->addItem(tr("Quiet (default)"), (int)OutputMessageMode::Quiet);
|
ui->outputMessages->addItem(tr("Quiet (default)"), (int)OutputMessageMode::Quiet);
|
||||||
@@ -118,9 +114,12 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
@@ -81,9 +77,12 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
||||||
|
|
||||||
ui->rbLeftPreview->setChecked(_previewPosition == MainWindow::PreviewPosition::Left);
|
ui->rbLeftPreview->setChecked(Settings::previewPosition() == MainWindow::PreviewPosition::Left);
|
||||||
ui->rbRightPreview->setChecked(_previewPosition == MainWindow::PreviewPosition::Right);
|
ui->rbRightPreview->setChecked(Settings::previewPosition() == MainWindow::PreviewPosition::Right);
|
||||||
- const bool savedDarkTheme = QSettings().value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool();
|
- const bool savedDarkTheme = QSettings().value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool();
|
||||||
+ const bool savedDarkTheme = GMIC_SETTINGS_INLINE.value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool();
|
+ const bool savedDarkTheme = GMIC_SETTINGS_INLINE.value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool();
|
||||||
ui->rbDarkTheme->setChecked(savedDarkTheme);
|
ui->rbDarkTheme->setChecked(savedDarkTheme);
|
||||||
@ -135,61 +175,52 @@ index b3d8c53..e4050b4 100644
|
|||||||
+#ifdef _GMIC_QT_DISABLE_THEMING_
|
+#ifdef _GMIC_QT_DISABLE_THEMING_
|
||||||
+ ui->groupBoxTheme->setEnabled(false);
|
+ ui->groupBoxTheme->setEnabled(false);
|
||||||
+#endif
|
+#endif
|
||||||
ui->cbNativeColorDialogs->setChecked(_nativeColorDialogs);
|
ui->cbNativeColorDialogs->setChecked(Settings::nativeColorDialogs());
|
||||||
ui->cbNativeColorDialogs->setToolTip(tr("Check to use Native/OS color dialog, uncheck to use Qt's"));
|
ui->cbNativeColorDialogs->setToolTip(tr("Check to use Native/OS color dialog, uncheck to use Qt's"));
|
||||||
ui->cbShowLogos->setChecked(_logosAreVisible);
|
ui->cbShowLogos->setChecked(Settings::visibleLogos());
|
||||||
@@ -130,9 +129,17 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
@@ -93,22 +92,41 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
||||||
|
|
||||||
connect(ui->pbOk, SIGNAL(clicked()), this, SLOT(onOk()));
|
connect(ui->pbOk, &QPushButton::clicked, this, &DialogSettings::onOk);
|
||||||
connect(ui->rbLeftPreview, SIGNAL(toggled(bool)), this, SLOT(onRadioLeftPreviewToggled(bool)));
|
connect(ui->rbLeftPreview, &QRadioButton::toggled, this, &DialogSettings::onRadioLeftPreviewToggled);
|
||||||
+#ifdef _GMIC_QT_DISABLE_UPDATES_
|
+#ifdef _GMIC_QT_DISABLE_UPDATES_
|
||||||
+ ui->pbUpdate->setEnabled(false);
|
+ ui->pbUpdate->setEnabled(false);
|
||||||
+#else
|
+#else
|
||||||
connect(ui->pbUpdate, SIGNAL(clicked(bool)), this, SLOT(onUpdateClicked()));
|
connect(ui->pbUpdate, &QPushButton::clicked, this, &DialogSettings::onUpdateClicked);
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
+#ifdef _GMIC_QT_DISABLE_UPDATES_
|
+#ifdef _GMIC_QT_DISABLE_UPDATES_
|
||||||
+ ui->cbUpdatePeriodicity->setEnabled(false);
|
+ ui->cbUpdatePeriodicity->setEnabled(false);
|
||||||
+#else
|
+#else
|
||||||
connect(ui->cbUpdatePeriodicity, SIGNAL(currentIndexChanged(int)), this, SLOT(onUpdatePeriodicityChanged(int)));
|
connect(ui->cbUpdatePeriodicity, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DialogSettings::onUpdatePeriodicityChanged);
|
||||||
+#endif
|
+#endif
|
||||||
|
connect(ui->labelPreviewLeft, &ClickableLabel::clicked, ui->rbLeftPreview, &QRadioButton::click);
|
||||||
connect(ui->labelPreviewLeft, SIGNAL(clicked()), ui->rbLeftPreview, SLOT(click()));
|
connect(ui->labelPreviewRight, &ClickableLabel::clicked, ui->rbRightPreview, &QRadioButton::click);
|
||||||
connect(ui->labelPreviewRight, SIGNAL(clicked()), ui->rbRightPreview, SLOT(click()));
|
connect(ui->cbNativeColorDialogs, &QCheckBox::toggled, this, &DialogSettings::onColorDialogsToggled);
|
||||||
@@ -141,7 +148,9 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
connect(Updater::getInstance(), &Updater::updateIsDone, this, &DialogSettings::enableUpdateButton);
|
||||||
|
|
||||||
connect(Updater::getInstance(), SIGNAL(updateIsDone(int)), this, SLOT(enableUpdateButton()));
|
|
||||||
|
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
connect(ui->rbDarkTheme, SIGNAL(toggled(bool)), this, SLOT(onDarkThemeToggled(bool)));
|
connect(ui->rbDarkTheme, &QRadioButton::toggled, this, &DialogSettings::onDarkThemeToggled);
|
||||||
+#endif
|
+#endif
|
||||||
|
connect(ui->cbShowLogos, &QCheckBox::toggled, this, &DialogSettings::onVisibleLogosToggled);
|
||||||
connect(ui->cbShowLogos, SIGNAL(toggled(bool)), this, SLOT(onLogosVisibleToggled(bool)));
|
connect(ui->cbPreviewZoom, &QCheckBox::toggled, this, &DialogSettings::onPreviewZoomToggled);
|
||||||
|
connect(ui->sbPreviewTimeout, QOverload<int>::of(&QSpinBox::valueChanged), this, &DialogSettings::onPreviewTimeoutChange);
|
||||||
@@ -151,12 +160,21 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
connect(ui->outputMessages, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DialogSettings::onOutputMessageModeChanged);
|
||||||
|
|
||||||
connect(ui->outputMessages, SIGNAL(currentIndexChanged(int)), this, SLOT(onOutputMessageModeChanged(int)));
|
|
||||||
|
|
||||||
+#ifdef _GMIC_QT_DISABLE_UPDATES_
|
+#ifdef _GMIC_QT_DISABLE_UPDATES_
|
||||||
+ ui->cbNotifyFailedUpdate->setEnabled(false);
|
+ ui->cbNotifyFailedUpdate->setEnabled(false);
|
||||||
+#else
|
+#else
|
||||||
connect(ui->cbNotifyFailedUpdate, SIGNAL(toggled(bool)), this, SLOT(onNotifyStartupUpdateFailedToggle(bool)));
|
connect(ui->cbNotifyFailedUpdate, &QCheckBox::toggled, this, &DialogSettings::onNotifyStartupUpdateFailedToggle);
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
+#ifdef _GMIC_QT_DISABLE_TRANSLATION_
|
+#ifdef _GMIC_QT_DISABLE_TRANSLATION_
|
||||||
+ ui->languageSelector->setEnabled(false);
|
+ ui->languageSelector->setEnabled(false);
|
||||||
+#else
|
+#else
|
||||||
ui->languageSelector->selectLanguage(_languageCode);
|
ui->languageSelector->selectLanguage(Settings::languageCode());
|
||||||
ui->languageSelector->enableFilterTranslation(_filterTranslationEnabled);
|
ui->languageSelector->enableFilterTranslation(Settings::filterTranslationEnabled());
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
- if (_darkThemeEnabled) {
|
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
+ if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
QPalette p = ui->cbNativeColorDialogs->palette();
|
QPalette p = ui->cbNativeColorDialogs->palette();
|
||||||
p.setColor(QPalette::Text, DialogSettings::CheckBoxTextColor);
|
p.setColor(QPalette::Text, Settings::CheckBoxTextColor);
|
||||||
p.setColor(QPalette::Base, DialogSettings::CheckBoxBaseColor);
|
@@ -123,6 +141,7 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
||||||
@@ -170,6 +188,7 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D
|
|
||||||
ui->cbShowLogos->setPalette(p);
|
ui->cbShowLogos->setPalette(p);
|
||||||
ui->cbNotifyFailedUpdate->setPalette(p);
|
ui->cbNotifyFailedUpdate->setPalette(p);
|
||||||
}
|
}
|
||||||
@ -197,55 +228,28 @@ index b3d8c53..e4050b4 100644
|
|||||||
ui->pbOk->setFocus();
|
ui->pbOk->setFocus();
|
||||||
ui->tabWidget->setCurrentIndex(0);
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
@@ -181,7 +200,7 @@ DialogSettings::~DialogSettings()
|
@@ -139,7 +158,7 @@ void DialogSettings::onOk()
|
||||||
|
|
||||||
void DialogSettings::loadSettings(UserInterfaceMode userInterfaceMode)
|
|
||||||
{
|
|
||||||
- QSettings settings;
|
|
||||||
+ GMIC_SETTINGS(settings);
|
|
||||||
if (settings.value("Config/PreviewPosition", "Left").toString() == "Left") {
|
|
||||||
_previewPosition = MainWindow::PreviewPosition::Left;
|
|
||||||
} else {
|
|
||||||
@@ -271,11 +290,13 @@ void DialogSettings::onOk()
|
|
||||||
|
|
||||||
void DialogSettings::done(int r)
|
void DialogSettings::done(int r)
|
||||||
{
|
{
|
||||||
- QSettings settings;
|
- QSettings settings;
|
||||||
+ GMIC_SETTINGS(settings);
|
+ GMIC_SETTINGS(settings);
|
||||||
saveSettings(settings);
|
Settings::save(settings);
|
||||||
settings.setValue(DARK_THEME_KEY, ui->rbDarkTheme->isChecked());
|
|
||||||
+#ifndef _GMIC_QT_DISABLE_TRANSLATION_
|
|
||||||
settings.setValue(LANGUAGE_CODE_KEY, ui->languageSelector->selectedLanguageCode());
|
|
||||||
settings.setValue(ENABLE_FILTER_TRANSLATION, ui->languageSelector->translateFiltersEnabled());
|
|
||||||
+#endif
|
|
||||||
QDialog::done(r);
|
QDialog::done(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,7 +371,11 @@ void DialogSettings::onColorDialogsToggled(bool on)
|
|
||||||
|
|
||||||
bool DialogSettings::darkThemeEnabled()
|
|
||||||
{
|
|
||||||
+#ifdef _GMIC_QT_DISABLE_THEMING_
|
|
||||||
+ return GmicQtHost::DarkThemeIsDefault;
|
|
||||||
+#else
|
|
||||||
return _darkThemeEnabled;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
QString DialogSettings::languageCode()
|
|
||||||
diff --git a/gmic-qt/src/FilterParameters/BoolParameter.cpp b/gmic-qt/src/FilterParameters/BoolParameter.cpp
|
diff --git a/gmic-qt/src/FilterParameters/BoolParameter.cpp b/gmic-qt/src/FilterParameters/BoolParameter.cpp
|
||||||
index 7f24464..3ba8313 100644
|
index c9b6fbe..43e897e 100644
|
||||||
--- a/gmic-qt/src/FilterParameters/BoolParameter.cpp
|
--- a/gmic-qt/src/FilterParameters/BoolParameter.cpp
|
||||||
+++ b/gmic-qt/src/FilterParameters/BoolParameter.cpp
|
+++ b/gmic-qt/src/FilterParameters/BoolParameter.cpp
|
||||||
@@ -59,12 +59,14 @@ bool BoolParameter::addTo(QWidget * widget, int row)
|
@@ -57,12 +57,14 @@ bool BoolParameter::addTo(QWidget * widget, int row)
|
||||||
delete _label;
|
delete _checkBox;
|
||||||
_checkBox = new QCheckBox(_name, widget);
|
_checkBox = new QCheckBox(_name, widget);
|
||||||
_checkBox->setChecked(_value);
|
_checkBox->setChecked(_value);
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
QPalette p = _checkBox->palette();
|
QPalette p = _checkBox->palette();
|
||||||
p.setColor(QPalette::Text, DialogSettings::CheckBoxTextColor);
|
p.setColor(QPalette::Text, Settings::CheckBoxTextColor);
|
||||||
p.setColor(QPalette::Base, DialogSettings::CheckBoxBaseColor);
|
p.setColor(QPalette::Base, Settings::CheckBoxBaseColor);
|
||||||
_checkBox->setPalette(p);
|
_checkBox->setPalette(p);
|
||||||
}
|
}
|
||||||
+#endif
|
+#endif
|
||||||
@ -253,7 +257,7 @@ index 7f24464..3ba8313 100644
|
|||||||
connectCheckBox();
|
connectCheckBox();
|
||||||
return true;
|
return true;
|
||||||
diff --git a/gmic-qt/src/FilterParameters/FloatParameter.cpp b/gmic-qt/src/FilterParameters/FloatParameter.cpp
|
diff --git a/gmic-qt/src/FilterParameters/FloatParameter.cpp b/gmic-qt/src/FilterParameters/FloatParameter.cpp
|
||||||
index c47fc9c..67a0a3e 100644
|
index 01a01c6..d9524e4 100644
|
||||||
--- a/gmic-qt/src/FilterParameters/FloatParameter.cpp
|
--- a/gmic-qt/src/FilterParameters/FloatParameter.cpp
|
||||||
+++ b/gmic-qt/src/FilterParameters/FloatParameter.cpp
|
+++ b/gmic-qt/src/FilterParameters/FloatParameter.cpp
|
||||||
@@ -72,13 +72,14 @@ bool FloatParameter::addTo(QWidget * widget, int row)
|
@@ -72,13 +72,14 @@ bool FloatParameter::addTo(QWidget * widget, int row)
|
||||||
@ -261,7 +265,7 @@ index c47fc9c..67a0a3e 100644
|
|||||||
_slider->setRange(0, SLIDER_MAX_RANGE);
|
_slider->setRange(0, SLIDER_MAX_RANGE);
|
||||||
_slider->setValue(static_cast<int>(SLIDER_MAX_RANGE * (_value - _min) / (_max - _min)));
|
_slider->setValue(static_cast<int>(SLIDER_MAX_RANGE * (_value - _min) / (_max - _min)));
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
QPalette p = _slider->palette();
|
QPalette p = _slider->palette();
|
||||||
p.setColor(QPalette::Button, QColor(100, 100, 100));
|
p.setColor(QPalette::Button, QColor(100, 100, 100));
|
||||||
p.setColor(QPalette::Highlight, QColor(130, 130, 130));
|
p.setColor(QPalette::Highlight, QColor(130, 130, 130));
|
||||||
@ -273,7 +277,7 @@ index c47fc9c..67a0a3e 100644
|
|||||||
_spinBox->setSingleStep(double(_max - _min) / 100.0);
|
_spinBox->setSingleStep(double(_max - _min) / 100.0);
|
||||||
_spinBox->setValue((double)_value);
|
_spinBox->setValue((double)_value);
|
||||||
diff --git a/gmic-qt/src/FilterParameters/IntParameter.cpp b/gmic-qt/src/FilterParameters/IntParameter.cpp
|
diff --git a/gmic-qt/src/FilterParameters/IntParameter.cpp b/gmic-qt/src/FilterParameters/IntParameter.cpp
|
||||||
index 0a32a65..b12058d 100644
|
index 0bdcba7..2a657c0 100644
|
||||||
--- a/gmic-qt/src/FilterParameters/IntParameter.cpp
|
--- a/gmic-qt/src/FilterParameters/IntParameter.cpp
|
||||||
+++ b/gmic-qt/src/FilterParameters/IntParameter.cpp
|
+++ b/gmic-qt/src/FilterParameters/IntParameter.cpp
|
||||||
@@ -80,12 +80,14 @@ bool IntParameter::addTo(QWidget * widget, int row)
|
@@ -80,12 +80,14 @@ bool IntParameter::addTo(QWidget * widget, int row)
|
||||||
@ -281,7 +285,7 @@ index 0a32a65..b12058d 100644
|
|||||||
_spinBox = new CustomSpinBox(widget, _min, _max);
|
_spinBox = new CustomSpinBox(widget, _min, _max);
|
||||||
_spinBox->setValue(_value);
|
_spinBox->setValue(_value);
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
QPalette p = _slider->palette();
|
QPalette p = _slider->palette();
|
||||||
p.setColor(QPalette::Button, QColor(100, 100, 100));
|
p.setColor(QPalette::Button, QColor(100, 100, 100));
|
||||||
p.setColor(QPalette::Highlight, QColor(130, 130, 130));
|
p.setColor(QPalette::Highlight, QColor(130, 130, 130));
|
||||||
@ -289,31 +293,29 @@ index 0a32a65..b12058d 100644
|
|||||||
}
|
}
|
||||||
+#endif
|
+#endif
|
||||||
_grid->addWidget(_label = new QLabel(_name, widget), row, 0, 1, 1);
|
_grid->addWidget(_label = new QLabel(_name, widget), row, 0, 1, 1);
|
||||||
|
setTextSelectable(_label);
|
||||||
_grid->addWidget(_slider, row, 1, 1, 1);
|
_grid->addWidget(_slider, row, 1, 1, 1);
|
||||||
_grid->addWidget(_spinBox, row, 2, 1, 1);
|
|
||||||
diff --git a/gmic-qt/src/FilterParameters/NoteParameter.cpp b/gmic-qt/src/FilterParameters/NoteParameter.cpp
|
diff --git a/gmic-qt/src/FilterParameters/NoteParameter.cpp b/gmic-qt/src/FilterParameters/NoteParameter.cpp
|
||||||
index 3b71c19..24e7b58 100644
|
index 7ba97f1..b45c58d 100644
|
||||||
--- a/gmic-qt/src/FilterParameters/NoteParameter.cpp
|
--- a/gmic-qt/src/FilterParameters/NoteParameter.cpp
|
||||||
+++ b/gmic-qt/src/FilterParameters/NoteParameter.cpp
|
+++ b/gmic-qt/src/FilterParameters/NoteParameter.cpp
|
||||||
@@ -87,14 +87,14 @@ bool NoteParameter::initFromText(const QString & /* filterName */, const char *
|
@@ -89,12 +89,14 @@ bool NoteParameter::initFromText(const QString & /* filterName */, const char *
|
||||||
_text = list[1].trimmed(); // Notes are never translated
|
|
||||||
_text.remove(QRegExp("^\"")).remove(QRegExp("\"$")).replace(QString("\\\""), "\"");
|
_text.remove(QRegExp("^\"")).remove(QRegExp("\"$")).replace(QString("\\\""), "\"");
|
||||||
_text.replace(QString("\\n"), "<br/>");
|
_text.replace(QString("\\n"), "<br/>");
|
||||||
-
|
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
_text.replace(QRegExp("color\\s*=\\s*\"purple\""), QString("color=\"#ff00ff\""));
|
_text.replace(QRegExp("color\\s*=\\s*\"purple\""), QString("color=\"#ff00ff\""));
|
||||||
_text.replace(QRegExp("foreground\\s*=\\s*\"purple\""), QString("foreground=\"#ff00ff\""));
|
_text.replace(QRegExp("foreground\\s*=\\s*\"purple\""), QString("foreground=\"#ff00ff\""));
|
||||||
_text.replace(QRegExp("color\\s*=\\s*\"blue\""), QString("color=\"#9b9bff\""));
|
_text.replace(QRegExp("color\\s*=\\s*\"blue\""), QString("color=\"#9b9bff\""));
|
||||||
_text.replace(QRegExp("foreground\\s*=\\s*\"blue\""), QString("foreground=\"#9b9bff\""));
|
_text.replace(QRegExp("foreground\\s*=\\s*\"blue\""), QString("foreground=\"#9b9bff\""));
|
||||||
}
|
}
|
||||||
-
|
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
_text.replace(QRegExp("color\\s*=\\s*\""), QString("style=\"color:"));
|
_text.replace(QRegExp("color\\s*=\\s*\""), QString("style=\"color:"));
|
||||||
_text.replace(QRegExp("foreground\\s*=\\s*\""), QString("style=\"color:"));
|
_text.replace(QRegExp("foreground\\s*=\\s*\""), QString("style=\"color:"));
|
||||||
_text = HtmlTranslator::fromUtf8Escapes(_text);
|
|
||||||
diff --git a/gmic-qt/src/FilterParameters/SeparatorParameter.cpp b/gmic-qt/src/FilterParameters/SeparatorParameter.cpp
|
diff --git a/gmic-qt/src/FilterParameters/SeparatorParameter.cpp b/gmic-qt/src/FilterParameters/SeparatorParameter.cpp
|
||||||
index 0bacffb..623b5d9 100644
|
index fad7b0a..7f6d317 100644
|
||||||
--- a/gmic-qt/src/FilterParameters/SeparatorParameter.cpp
|
--- a/gmic-qt/src/FilterParameters/SeparatorParameter.cpp
|
||||||
+++ b/gmic-qt/src/FilterParameters/SeparatorParameter.cpp
|
+++ b/gmic-qt/src/FilterParameters/SeparatorParameter.cpp
|
||||||
@@ -58,9 +58,11 @@ bool SeparatorParameter::addTo(QWidget * widget, int row)
|
@@ -58,9 +58,11 @@ bool SeparatorParameter::addTo(QWidget * widget, int row)
|
||||||
@ -321,7 +323,7 @@ index 0bacffb..623b5d9 100644
|
|||||||
_frame->setFrameShape(QFrame::HLine);
|
_frame->setFrameShape(QFrame::HLine);
|
||||||
_frame->setFrameShadow(QFrame::Sunken);
|
_frame->setFrameShadow(QFrame::Sunken);
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
_frame->setStyleSheet("QFrame{ border-top: 0px none #a0a0a0; border-bottom: 2px solid rgb(160,160,160);}");
|
_frame->setStyleSheet("QFrame{ border-top: 0px none #a0a0a0; border-bottom: 2px solid rgb(160,160,160);}");
|
||||||
}
|
}
|
||||||
+#endif
|
+#endif
|
||||||
@ -329,10 +331,10 @@ index 0bacffb..623b5d9 100644
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
diff --git a/gmic-qt/src/FilterSelector/FiltersPresenter.cpp b/gmic-qt/src/FilterSelector/FiltersPresenter.cpp
|
diff --git a/gmic-qt/src/FilterSelector/FiltersPresenter.cpp b/gmic-qt/src/FilterSelector/FiltersPresenter.cpp
|
||||||
index 5406eb1..2481bc2 100644
|
index 7ea2564..0719e17 100644
|
||||||
--- a/gmic-qt/src/FilterSelector/FiltersPresenter.cpp
|
--- a/gmic-qt/src/FilterSelector/FiltersPresenter.cpp
|
||||||
+++ b/gmic-qt/src/FilterSelector/FiltersPresenter.cpp
|
+++ b/gmic-qt/src/FilterSelector/FiltersPresenter.cpp
|
||||||
@@ -416,7 +416,7 @@ void FiltersPresenter::expandFaveFolder()
|
@@ -417,7 +417,7 @@ void FiltersPresenter::expandFaveFolder()
|
||||||
void FiltersPresenter::expandPreviousSessionExpandedFolders()
|
void FiltersPresenter::expandPreviousSessionExpandedFolders()
|
||||||
{
|
{
|
||||||
if (_filtersView) {
|
if (_filtersView) {
|
||||||
@ -377,11 +379,39 @@ index 9d38982..782a732 100644
|
|||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
#endif // GMIC_QT_GLOBALS_H
|
#endif // GMIC_QT_GLOBALS_H
|
||||||
|
diff --git a/gmic-qt/src/GmicProcessor.cpp b/gmic-qt/src/GmicProcessor.cpp
|
||||||
|
index b3c177d..a288193 100644
|
||||||
|
--- a/gmic-qt/src/GmicProcessor.cpp
|
||||||
|
+++ b/gmic-qt/src/GmicProcessor.cpp
|
||||||
|
@@ -192,6 +192,11 @@ bool GmicProcessor::isIdle() const
|
||||||
|
return !_filterThread;
|
||||||
|
}
|
||||||
|
|
||||||
|
+bool GmicProcessor::isInputImagesEmpty() const
|
||||||
|
+{
|
||||||
|
+ return _gmicImages->is_empty();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int GmicProcessor::duration() const
|
||||||
|
{
|
||||||
|
if (_filterThread) {
|
||||||
|
diff --git a/gmic-qt/src/GmicProcessor.h b/gmic-qt/src/GmicProcessor.h
|
||||||
|
index caf4c2f..55f8a2a 100644
|
||||||
|
--- a/gmic-qt/src/GmicProcessor.h
|
||||||
|
+++ b/gmic-qt/src/GmicProcessor.h
|
||||||
|
@@ -92,6 +92,7 @@ public:
|
||||||
|
|
||||||
|
bool isProcessing() const;
|
||||||
|
bool isIdle() const;
|
||||||
|
+ bool isInputImagesEmpty() const;
|
||||||
|
bool hasUnfinishedAbortedThreads() const;
|
||||||
|
|
||||||
|
const cimg_library::CImg<float> & previewImage() const;
|
||||||
diff --git a/gmic-qt/src/GmicQt.cpp b/gmic-qt/src/GmicQt.cpp
|
diff --git a/gmic-qt/src/GmicQt.cpp b/gmic-qt/src/GmicQt.cpp
|
||||||
index e836072..ddf2d40 100644
|
index 646aac1..ab889fa 100644
|
||||||
--- a/gmic-qt/src/GmicQt.cpp
|
--- a/gmic-qt/src/GmicQt.cpp
|
||||||
+++ b/gmic-qt/src/GmicQt.cpp
|
+++ b/gmic-qt/src/GmicQt.cpp
|
||||||
@@ -87,7 +87,7 @@ RunParameters lastAppliedFilterRunParameters(ReturnedRunParametersFlag flag)
|
@@ -90,7 +90,7 @@ RunParameters lastAppliedFilterRunParameters(ReturnedRunParametersFlag flag)
|
||||||
{
|
{
|
||||||
configureApplication();
|
configureApplication();
|
||||||
RunParameters parameters;
|
RunParameters parameters;
|
||||||
@ -390,7 +420,7 @@ index e836072..ddf2d40 100644
|
|||||||
const QString path = settings.value(QString("LastExecution/host_%1/FilterPath").arg(GmicQtHost::ApplicationShortname)).toString();
|
const QString path = settings.value(QString("LastExecution/host_%1/FilterPath").arg(GmicQtHost::ApplicationShortname)).toString();
|
||||||
parameters.filterPath = path.toStdString();
|
parameters.filterPath = path.toStdString();
|
||||||
QString args = settings.value(QString("LastExecution/host_%1/Arguments").arg(GmicQtHost::ApplicationShortname)).toString();
|
QString args = settings.value(QString("LastExecution/host_%1/Arguments").arg(GmicQtHost::ApplicationShortname)).toString();
|
||||||
@@ -197,7 +197,7 @@ int run(UserInterfaceMode interfaceMode, //
|
@@ -200,7 +200,7 @@ int run(UserInterfaceMode interfaceMode, //
|
||||||
LanguageSettings::installTranslators();
|
LanguageSettings::installTranslators();
|
||||||
MainWindow mainWindow;
|
MainWindow mainWindow;
|
||||||
mainWindow.setPluginParameters(parameters);
|
mainWindow.setPluginParameters(parameters);
|
||||||
@ -399,7 +429,7 @@ index e836072..ddf2d40 100644
|
|||||||
mainWindow.showMaximized();
|
mainWindow.showMaximized();
|
||||||
} else {
|
} else {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
@@ -545,10 +545,12 @@ namespace
|
@@ -548,10 +548,12 @@ namespace
|
||||||
|
|
||||||
void configureApplication()
|
void configureApplication()
|
||||||
{
|
{
|
||||||
@ -413,7 +443,7 @@ index e836072..ddf2d40 100644
|
|||||||
|
|
||||||
void disableModes(const std::list<GmicQt::InputMode> & disabledInputModes, //
|
void disableModes(const std::list<GmicQt::InputMode> & disabledInputModes, //
|
||||||
diff --git a/gmic-qt/src/HeadlessProcessor.cpp b/gmic-qt/src/HeadlessProcessor.cpp
|
diff --git a/gmic-qt/src/HeadlessProcessor.cpp b/gmic-qt/src/HeadlessProcessor.cpp
|
||||||
index 446d1a8..3fadf4a 100644
|
index 0f88b32..c7ed61b 100644
|
||||||
--- a/gmic-qt/src/HeadlessProcessor.cpp
|
--- a/gmic-qt/src/HeadlessProcessor.cpp
|
||||||
+++ b/gmic-qt/src/HeadlessProcessor.cpp
|
+++ b/gmic-qt/src/HeadlessProcessor.cpp
|
||||||
@@ -27,6 +27,7 @@
|
@@ -27,6 +27,7 @@
|
||||||
@ -422,9 +452,9 @@ index 446d1a8..3fadf4a 100644
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
+#include "Globals.h"
|
+#include "Globals.h"
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "DialogSettings.h"
|
|
||||||
#include "FilterParameters/FilterParametersWidget.h"
|
#include "FilterParameters/FilterParametersWidget.h"
|
||||||
@@ -71,7 +72,7 @@ HeadlessProcessor::~HeadlessProcessor()
|
#include "FilterSelector/FiltersPresenter.h"
|
||||||
|
@@ -74,7 +75,7 @@ HeadlessProcessor::~HeadlessProcessor()
|
||||||
|
|
||||||
bool HeadlessProcessor::setPluginParameters(const RunParameters & parameters)
|
bool HeadlessProcessor::setPluginParameters(const RunParameters & parameters)
|
||||||
{
|
{
|
||||||
@ -433,7 +463,7 @@ index 446d1a8..3fadf4a 100644
|
|||||||
_path = QString::fromStdString(parameters.filterPath);
|
_path = QString::fromStdString(parameters.filterPath);
|
||||||
_inputMode = (parameters.inputMode == InputMode::Unspecified) ? DefaultInputMode : parameters.inputMode;
|
_inputMode = (parameters.inputMode == InputMode::Unspecified) ? DefaultInputMode : parameters.inputMode;
|
||||||
_outputMode = (parameters.outputMode == OutputMode::Unspecified) ? DefaultOutputMode : parameters.outputMode;
|
_outputMode = (parameters.outputMode == OutputMode::Unspecified) ? DefaultOutputMode : parameters.outputMode;
|
||||||
@@ -238,7 +239,7 @@ void HeadlessProcessor::onProcessingFinished()
|
@@ -239,7 +240,7 @@ void HeadlessProcessor::onProcessingFinished()
|
||||||
GmicQtHost::outputImages(images, _filterThread->imageNames(), _outputMode);
|
GmicQtHost::outputImages(images, _filterThread->imageNames(), _outputMode);
|
||||||
_processingCompletedProperly = true;
|
_processingCompletedProperly = true;
|
||||||
}
|
}
|
||||||
@ -442,7 +472,7 @@ index 446d1a8..3fadf4a 100644
|
|||||||
if (!status.isEmpty() && !_hash.isEmpty()) {
|
if (!status.isEmpty() && !_hash.isEmpty()) {
|
||||||
ParametersCache::setValues(_hash, status);
|
ParametersCache::setValues(_hash, status);
|
||||||
ParametersCache::save();
|
ParametersCache::save();
|
||||||
@@ -271,7 +272,9 @@ void HeadlessProcessor::endApplication(const QString & errorMessage)
|
@@ -272,7 +273,9 @@ void HeadlessProcessor::endApplication(const QString & errorMessage)
|
||||||
if (!errorMessage.isEmpty()) {
|
if (!errorMessage.isEmpty()) {
|
||||||
Logger::error(errorMessage);
|
Logger::error(errorMessage);
|
||||||
}
|
}
|
||||||
@ -454,16 +484,16 @@ index 446d1a8..3fadf4a 100644
|
|||||||
} // namespace GmicQt
|
} // namespace GmicQt
|
||||||
diff --git a/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp
|
diff --git a/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..6ef6a4e
|
index 0000000..849ca44
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp
|
+++ b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp
|
||||||
@@ -0,0 +1,204 @@
|
@@ -0,0 +1,233 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This file is part of G'MIC-Qt, a generic plug-in for raster graphics
|
+ * This file is part of G'MIC-Qt, a generic plug-in for raster graphics
|
||||||
+ * editors, offering hundreds of filters thanks to the underlying G'MIC
|
+ * editors, offering hundreds of filters thanks to the underlying G'MIC
|
||||||
+ * image processing framework.
|
+ * image processing framework.
|
||||||
+ *
|
+ *
|
||||||
+ * Copyright (C) 2020-2021 L. E. Segovia <amy@amyspark.me>
|
+ * Copyright (C) 2020-2022 L. E. Segovia <amy@amyspark.me>
|
||||||
+ *
|
+ *
|
||||||
+ * Description: Krita painting suite plugin for G'Mic-Qt.
|
+ * Description: Krita painting suite plugin for G'Mic-Qt.
|
||||||
+ *
|
+ *
|
||||||
@ -483,6 +513,9 @@ index 0000000..6ef6a4e
|
|||||||
+ */
|
+ */
|
||||||
+
|
+
|
||||||
+#include <QApplication>
|
+#include <QApplication>
|
||||||
|
+#include <QDir>
|
||||||
|
+#include <QFile>
|
||||||
|
+#include <QFileInfo>
|
||||||
+#include <QEventLoop>
|
+#include <QEventLoop>
|
||||||
+#include <QPointer>
|
+#include <QPointer>
|
||||||
+#include <QSettings>
|
+#include <QSettings>
|
||||||
@ -497,7 +530,7 @@ index 0000000..6ef6a4e
|
|||||||
+#include <unistd.h>
|
+#include <unistd.h>
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
+#include "DialogSettings.h"
|
+#include "Settings.h"
|
||||||
+#include "GmicQt.h"
|
+#include "GmicQt.h"
|
||||||
+#include "Globals.h"
|
+#include "Globals.h"
|
||||||
+#include "HeadlessProcessor.h"
|
+#include "HeadlessProcessor.h"
|
||||||
@ -507,6 +540,7 @@ index 0000000..6ef6a4e
|
|||||||
+#include "MainWindow.h"
|
+#include "MainWindow.h"
|
||||||
+#include "Widgets/InOutPanel.h"
|
+#include "Widgets/InOutPanel.h"
|
||||||
+#include "Widgets/ProgressInfoWindow.h"
|
+#include "Widgets/ProgressInfoWindow.h"
|
||||||
|
+#include "Utils.h"
|
||||||
+#include "gmicqttoolplugin.h"
|
+#include "gmicqttoolplugin.h"
|
||||||
+
|
+
|
||||||
+#include "kpluginfactory.h"
|
+#include "kpluginfactory.h"
|
||||||
@ -518,6 +552,28 @@ index 0000000..6ef6a4e
|
|||||||
+KritaGmicPlugin::KritaGmicPlugin(QObject *parent, const QVariantList &)
|
+KritaGmicPlugin::KritaGmicPlugin(QObject *parent, const QVariantList &)
|
||||||
+ : QObject(parent)
|
+ : QObject(parent)
|
||||||
+{
|
+{
|
||||||
|
+#ifdef Q_OS_WIN
|
||||||
|
+ // Workaround for deploying basic CLUTs
|
||||||
|
+ // See https://krita-artists.org/t/unknown-filename-gmic-qt/37813
|
||||||
|
+ {
|
||||||
|
+ const auto srcPath = QDir(QCoreApplication::applicationDirPath().append(QStringLiteral("/../share/gmic/"))).absolutePath();
|
||||||
|
+ const auto dstPath = GmicQt::gmicConfigPath(true);
|
||||||
|
+ const std::list<QString> files = {"/gmic_cluts.gmz", "/gmic_denoise_cnn.gmz"};
|
||||||
|
+
|
||||||
|
+ for (const auto file: files) {
|
||||||
|
+ const auto src = srcPath + file;
|
||||||
|
+ const auto dst = dstPath + file;
|
||||||
|
+ if (QFileInfo(src).exists() && !QFileInfo(dst).exists()) {
|
||||||
|
+ qWarning() << src << dst;
|
||||||
|
+ QFile::copy(src, dst);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!qEnvironmentVariableIsSet("GMIC_SYSTEM_PATH")) {
|
||||||
|
+ qputenv("GMIC_SYSTEM_PATH", QString(srcPath).replace(L'/', L'\\').toLocal8Bit());
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+int KritaGmicPlugin::launch(std::shared_ptr<KisImageInterface> i, bool headless)
|
+int KritaGmicPlugin::launch(std::shared_ptr<KisImageInterface> i, bool headless)
|
||||||
@ -592,8 +648,8 @@ index 0000000..6ef6a4e
|
|||||||
+ GmicQt::InOutPanel::disableOutputMode(mode);
|
+ GmicQt::InOutPanel::disableOutputMode(mode);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ DialogSettings::loadSettings(GmicQt::UserInterfaceMode::ProgressDialog);
|
+ Settings::load(GmicQt::UserInterfaceMode::ProgressDialog);
|
||||||
+ Logger::setMode(DialogSettings::outputMessageMode());
|
+ Logger::setMode(Settings::outputMessageMode());
|
||||||
+ LanguageSettings::installTranslators();
|
+ LanguageSettings::installTranslators();
|
||||||
+
|
+
|
||||||
+ HeadlessProcessor processor(nullptr);
|
+ HeadlessProcessor processor(nullptr);
|
||||||
@ -625,14 +681,17 @@ index 0000000..6ef6a4e
|
|||||||
+ GmicQt::InOutPanel::disableOutputMode(mode);
|
+ GmicQt::InOutPanel::disableOutputMode(mode);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ DialogSettings::loadSettings(GmicQt::UserInterfaceMode::Full);
|
+ Settings::load(GmicQt::UserInterfaceMode::Full);
|
||||||
+ Logger::setMode(DialogSettings::outputMessageMode());
|
+ Logger::setMode(Settings::outputMessageMode());
|
||||||
+ LanguageSettings::installTranslators();
|
+ LanguageSettings::installTranslators();
|
||||||
+
|
+
|
||||||
+ QPointer<MainWindow> mainWindow(new MainWindow());
|
+ QPointer<MainWindow> mainWindow(new MainWindow(qApp->activeWindow()));
|
||||||
+ mainWindow->setPluginParameters(parameters);
|
+ mainWindow->setPluginParameters(parameters);
|
||||||
+ // We want a non modal dialog here.
|
+#ifdef Q_OS_MACOS
|
||||||
+ mainWindow->setWindowFlags(Qt::Tool | Qt::Dialog);
|
+ mainWindow->setWindowFlags(Qt::Tool | Qt::Dialog);
|
||||||
|
+#else
|
||||||
|
+ mainWindow->setWindowFlags(Qt::Dialog);
|
||||||
|
+#endif
|
||||||
+ mainWindow->setWindowModality(Qt::ApplicationModal);
|
+ mainWindow->setWindowModality(Qt::ApplicationModal);
|
||||||
+ // Make it destroy itself on close (signaling the event loop)
|
+ // Make it destroy itself on close (signaling the event loop)
|
||||||
+ mainWindow->setAttribute(Qt::WA_DeleteOnClose);
|
+ mainWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
@ -740,13 +799,13 @@ index 0000000..4639d5e
|
|||||||
+}
|
+}
|
||||||
diff --git a/gmic-qt/src/Host/KritaPlugin/host.cpp b/gmic-qt/src/Host/KritaPlugin/host.cpp
|
diff --git a/gmic-qt/src/Host/KritaPlugin/host.cpp b/gmic-qt/src/Host/KritaPlugin/host.cpp
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..1f244f6
|
index 0000000..fcfa12b
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/gmic-qt/src/Host/KritaPlugin/host.cpp
|
+++ b/gmic-qt/src/Host/KritaPlugin/host.cpp
|
||||||
@@ -0,0 +1,187 @@
|
@@ -0,0 +1,195 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright (C) 2017 Boudewijn Rempt <boud@valdyas.org>
|
+ * Copyright (C) 2017 Boudewijn Rempt <boud@valdyas.org>
|
||||||
+ * Copyright (C) 2020-2021 L. E. Segovia <amy@amyspark.me>
|
+ * Copyright (C) 2020-2022 L. E. Segovia <amy@amyspark.me>
|
||||||
+ *
|
+ *
|
||||||
+ * This library is free software; you can redistribute it and/or
|
+ * This library is free software; you can redistribute it and/or
|
||||||
+ * modify it under the terms of the GNU Library General Public
|
+ * modify it under the terms of the GNU Library General Public
|
||||||
@ -779,6 +838,9 @@ index 0000000..1f244f6
|
|||||||
+
|
+
|
||||||
+#include "GmicQt.h"
|
+#include "GmicQt.h"
|
||||||
+#include "Host/GmicQtHost.h"
|
+#include "Host/GmicQtHost.h"
|
||||||
|
+#ifndef gmic_core
|
||||||
|
+#include "CImg.h"
|
||||||
|
+#endif
|
||||||
+#include "gmic.h"
|
+#include "gmic.h"
|
||||||
+#include "kis_qmic_interface.h"
|
+#include "kis_qmic_interface.h"
|
||||||
+
|
+
|
||||||
@ -807,7 +869,11 @@ index 0000000..1f244f6
|
|||||||
+
|
+
|
||||||
+void getLayersExtent(int *width, int *height, GmicQt::InputMode mode)
|
+void getLayersExtent(int *width, int *height, GmicQt::InputMode mode)
|
||||||
+{
|
+{
|
||||||
|
+#if defined(KRITA_QMIC_INTERFACE_VERSION) && KRITA_QMIC_INTERFACE_VERSION >= 0x05010001
|
||||||
|
+ const auto size = iface->gmic_qt_get_image_size(static_cast<int>(mode));
|
||||||
|
+#else
|
||||||
+ const auto size = iface->gmic_qt_get_image_size();
|
+ const auto size = iface->gmic_qt_get_image_size();
|
||||||
|
+#endif
|
||||||
+ *width = size.width();
|
+ *width = size.width();
|
||||||
+ *height = size.height();
|
+ *height = size.height();
|
||||||
+
|
+
|
||||||
@ -852,8 +918,8 @@ index 0000000..1f244f6
|
|||||||
+ // Get the layers as prepared by Krita in G'Mic format
|
+ // Get the layers as prepared by Krita in G'Mic format
|
||||||
+ for (int i = 0; i < imagesList.length(); ++i) {
|
+ for (int i = 0; i < imagesList.length(); ++i) {
|
||||||
+ const auto &layer = imagesList[i];
|
+ const auto &layer = imagesList[i];
|
||||||
+ QByteArray ba = layer->m_layerName.toUtf8().toHex();
|
+ const auto ba = layer->m_layerName.toUtf8();
|
||||||
+ gmic_image<char>::string(ba.constData()).move_to(imageNames[i]);
|
+ gmic_image<char>::string(ba.data()).move_to(imageNames[i]);
|
||||||
+
|
+
|
||||||
+ // Fill images from the shared memory areas
|
+ // Fill images from the shared memory areas
|
||||||
+
|
+
|
||||||
@ -899,7 +965,7 @@ index 0000000..1f244f6
|
|||||||
+
|
+
|
||||||
+ gmic_image<float> gimg = images.at(i);
|
+ gmic_image<float> gimg = images.at(i);
|
||||||
+
|
+
|
||||||
+ QString layerName((const char *)imageNames[i]);
|
+ const auto layerName = QString::fromUtf8(imageNames[i].data());
|
||||||
+
|
+
|
||||||
+ KisQMicImageSP m = KisQMicImageSP::create(
|
+ KisQMicImageSP m = KisQMicImageSP::create(
|
||||||
+ layerName, gimg._width, gimg._height, gimg._spectrum);
|
+ layerName, gimg._width, gimg._height, gimg._spectrum);
|
||||||
@ -908,9 +974,10 @@ index 0000000..1f244f6
|
|||||||
+ {
|
+ {
|
||||||
+ QMutexLocker lock(&m->m_mutex);
|
+ QMutexLocker lock(&m->m_mutex);
|
||||||
+
|
+
|
||||||
+ const size_t length =
|
+ const auto slice = gimg.get_slice(0);
|
||||||
+ gimg._width * gimg._height * gimg._spectrum * sizeof(float);
|
+
|
||||||
+ std::memcpy(m->m_data, gimg._data, length);
|
+ const auto length = slice._width * slice._height * slice._spectrum * sizeof(float);
|
||||||
|
+ std::memcpy(m->m_data, slice._data, length);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ layers << m;
|
+ layers << m;
|
||||||
@ -932,18 +999,19 @@ index 0000000..1f244f6
|
|||||||
+
|
+
|
||||||
+} // namespace GmicQtHost
|
+} // namespace GmicQtHost
|
||||||
diff --git a/gmic-qt/src/Host/None/JpegQualityDialog.cpp b/gmic-qt/src/Host/None/JpegQualityDialog.cpp
|
diff --git a/gmic-qt/src/Host/None/JpegQualityDialog.cpp b/gmic-qt/src/Host/None/JpegQualityDialog.cpp
|
||||||
index b351994..3ea120d 100644
|
index b351994..d92386d 100644
|
||||||
--- a/gmic-qt/src/Host/None/JpegQualityDialog.cpp
|
--- a/gmic-qt/src/Host/None/JpegQualityDialog.cpp
|
||||||
+++ b/gmic-qt/src/Host/None/JpegQualityDialog.cpp
|
+++ b/gmic-qt/src/Host/None/JpegQualityDialog.cpp
|
||||||
@@ -1,6 +1,7 @@
|
@@ -1,6 +1,8 @@
|
||||||
#include "JpegQualityDialog.h"
|
#include "JpegQualityDialog.h"
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include "ui_jpegqualitydialog.h"
|
#include "ui_jpegqualitydialog.h"
|
||||||
+#include "Globals.h"
|
+#include "Globals.h"
|
||||||
|
+
|
||||||
int JpegQualityDialog::_permanentQuality = -1;
|
int JpegQualityDialog::_permanentQuality = -1;
|
||||||
int JpegQualityDialog::_selectedQuality = -1;
|
int JpegQualityDialog::_selectedQuality = -1;
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ JpegQualityDialog::JpegQualityDialog(QWidget * parent) : QDialog(parent), ui(new
|
@@ -14,7 +16,7 @@ JpegQualityDialog::JpegQualityDialog(QWidget * parent) : QDialog(parent), ui(new
|
||||||
ui->spinBox->setRange(0, 100);
|
ui->spinBox->setRange(0, 100);
|
||||||
|
|
||||||
if (_selectedQuality == -1) {
|
if (_selectedQuality == -1) {
|
||||||
@ -952,7 +1020,7 @@ index b351994..3ea120d 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui->slider->setValue(_selectedQuality);
|
ui->slider->setValue(_selectedQuality);
|
||||||
@@ -24,7 +25,7 @@ JpegQualityDialog::JpegQualityDialog(QWidget * parent) : QDialog(parent), ui(new
|
@@ -24,7 +26,7 @@ JpegQualityDialog::JpegQualityDialog(QWidget * parent) : QDialog(parent), ui(new
|
||||||
connect(ui->spinBox, QOverload<int>::of(&QSpinBox::valueChanged), ui->slider, &QSlider::setValue);
|
connect(ui->spinBox, QOverload<int>::of(&QSpinBox::valueChanged), ui->slider, &QSlider::setValue);
|
||||||
connect(ui->pbOk, &QPushButton::clicked, [this]() {
|
connect(ui->pbOk, &QPushButton::clicked, [this]() {
|
||||||
_selectedQuality = ui->spinBox->value();
|
_selectedQuality = ui->spinBox->value();
|
||||||
@ -962,7 +1030,7 @@ index b351994..3ea120d 100644
|
|||||||
connect(ui->pbOk, &QPushButton::clicked, this, &QDialog::accept);
|
connect(ui->pbOk, &QPushButton::clicked, this, &QDialog::accept);
|
||||||
connect(ui->pbCancel, &QPushButton::clicked, this, &QDialog::reject);
|
connect(ui->pbCancel, &QPushButton::clicked, this, &QDialog::reject);
|
||||||
diff --git a/gmic-qt/src/LanguageSettings.cpp b/gmic-qt/src/LanguageSettings.cpp
|
diff --git a/gmic-qt/src/LanguageSettings.cpp b/gmic-qt/src/LanguageSettings.cpp
|
||||||
index e18f31f..8c6f8f2 100644
|
index 6da4d84..05d8b4b 100644
|
||||||
--- a/gmic-qt/src/LanguageSettings.cpp
|
--- a/gmic-qt/src/LanguageSettings.cpp
|
||||||
+++ b/gmic-qt/src/LanguageSettings.cpp
|
+++ b/gmic-qt/src/LanguageSettings.cpp
|
||||||
@@ -23,6 +23,7 @@
|
@@ -23,6 +23,7 @@
|
||||||
@ -996,10 +1064,10 @@ index e18f31f..8c6f8f2 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/gmic-qt/src/MainWindow.cpp b/gmic-qt/src/MainWindow.cpp
|
diff --git a/gmic-qt/src/MainWindow.cpp b/gmic-qt/src/MainWindow.cpp
|
||||||
index d89aa7e..56b4bec 100644
|
index f0e0b66..713b162 100644
|
||||||
--- a/gmic-qt/src/MainWindow.cpp
|
--- a/gmic-qt/src/MainWindow.cpp
|
||||||
+++ b/gmic-qt/src/MainWindow.cpp
|
+++ b/gmic-qt/src/MainWindow.cpp
|
||||||
@@ -184,8 +184,12 @@ MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent), ui(new Ui::MainW
|
@@ -190,8 +190,12 @@ MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent), ui(new Ui::MainW
|
||||||
updateShortcutF5->setContext(Qt::ApplicationShortcut);
|
updateShortcutF5->setContext(Qt::ApplicationShortcut);
|
||||||
QShortcut * updateShortcutCtrlR = new QShortcut(QKeySequence("Ctrl+R"), this);
|
QShortcut * updateShortcutCtrlR = new QShortcut(QKeySequence("Ctrl+R"), this);
|
||||||
updateShortcutCtrlR->setContext(Qt::ApplicationShortcut);
|
updateShortcutCtrlR->setContext(Qt::ApplicationShortcut);
|
||||||
@ -1012,7 +1080,7 @@ index d89aa7e..56b4bec 100644
|
|||||||
ui->tbUpdateFilters->setToolTip(updateText);
|
ui->tbUpdateFilters->setToolTip(updateText);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,6 +277,7 @@ void MainWindow::setIcons()
|
@@ -279,6 +283,7 @@ void MainWindow::setIcons()
|
||||||
ui->tbExpandCollapse->setIcon(_expandIcon);
|
ui->tbExpandCollapse->setIcon(_expandIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1020,15 +1088,15 @@ index d89aa7e..56b4bec 100644
|
|||||||
void MainWindow::setDarkTheme()
|
void MainWindow::setDarkTheme()
|
||||||
{
|
{
|
||||||
// SHOW(QStyleFactory::keys());
|
// SHOW(QStyleFactory::keys());
|
||||||
@@ -325,6 +330,7 @@ void MainWindow::setDarkTheme()
|
@@ -331,6 +336,7 @@ void MainWindow::setDarkTheme()
|
||||||
ui->vSplitterLine->setStyleSheet("QFrame{ border-top: 0px none #a0a0a0; border-bottom: 1px solid rgb(160,160,160);}");
|
ui->vSplitterLine->setStyleSheet("QFrame{ border-top: 0px none #a0a0a0; border-bottom: 1px solid rgb(160,160,160);}");
|
||||||
DialogSettings::UnselectedFilterTextColor = DialogSettings::UnselectedFilterTextColor.darker(150);
|
Settings::UnselectedFilterTextColor = Settings::UnselectedFilterTextColor.darker(150);
|
||||||
}
|
}
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
void MainWindow::setPluginParameters(const RunParameters & parameters)
|
void MainWindow::setPluginParameters(const RunParameters & parameters)
|
||||||
{
|
{
|
||||||
@@ -379,7 +385,7 @@ void MainWindow::buildFiltersTree()
|
@@ -385,7 +391,7 @@ void MainWindow::buildFiltersTree()
|
||||||
_filtersPresenter->importGmicGTKFaves();
|
_filtersPresenter->importGmicGTKFaves();
|
||||||
_filtersPresenter->saveFaves();
|
_filtersPresenter->saveFaves();
|
||||||
_gtkFavesShouldBeImported = false;
|
_gtkFavesShouldBeImported = false;
|
||||||
@ -1037,7 +1105,7 @@ index d89aa7e..56b4bec 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
_filtersPresenter->toggleSelectionMode(withVisibility);
|
_filtersPresenter->toggleSelectionMode(withVisibility);
|
||||||
@@ -478,7 +484,7 @@ void MainWindow::onStartupFiltersUpdateFinished(int status)
|
@@ -495,7 +501,7 @@ void MainWindow::onStartupFiltersUpdateFinished(int status)
|
||||||
} else if (status == (int)Updater::UpdateStatus::NotNecessary) {
|
} else if (status == (int)Updater::UpdateStatus::NotNecessary) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1046,7 +1114,7 @@ index d89aa7e..56b4bec 100644
|
|||||||
_gtkFavesShouldBeImported = false;
|
_gtkFavesShouldBeImported = false;
|
||||||
} else {
|
} else {
|
||||||
_gtkFavesShouldBeImported = askUserForGTKFavesImport();
|
_gtkFavesShouldBeImported = askUserForGTKFavesImport();
|
||||||
@@ -495,7 +501,7 @@ void MainWindow::onStartupFiltersUpdateFinished(int status)
|
@@ -512,7 +518,7 @@ void MainWindow::onStartupFiltersUpdateFinished(int status)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve and select previously selected filter
|
// Retrieve and select previously selected filter
|
||||||
@ -1055,7 +1123,7 @@ index d89aa7e..56b4bec 100644
|
|||||||
if (_newSession || !_lastExecutionOK) {
|
if (_newSession || !_lastExecutionOK) {
|
||||||
hash.clear();
|
hash.clear();
|
||||||
}
|
}
|
||||||
@@ -560,7 +566,9 @@ void MainWindow::onEscapeKeyPressed()
|
@@ -577,7 +583,9 @@ void MainWindow::onEscapeKeyPressed()
|
||||||
} else {
|
} else {
|
||||||
_processor.cancel();
|
_processor.cancel();
|
||||||
ui->previewWidget->displayOriginalImage();
|
ui->previewWidget->displayOriginalImage();
|
||||||
@ -1065,7 +1133,7 @@ index d89aa7e..56b4bec 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -672,7 +680,9 @@ void MainWindow::onPreviewUpdateRequested(bool synchronous)
|
@@ -677,7 +685,9 @@ void MainWindow::onPreviewUpdateRequested(bool synchronous)
|
||||||
ui->previewWidget->displayOriginalImage();
|
ui->previewWidget->displayOriginalImage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1075,7 +1143,7 @@ index d89aa7e..56b4bec 100644
|
|||||||
|
|
||||||
const FiltersPresenter::Filter currentFilter = _filtersPresenter->currentFilter();
|
const FiltersPresenter::Filter currentFilter = _filtersPresenter->currentFilter();
|
||||||
GmicProcessor::FilterContext context;
|
GmicProcessor::FilterContext context;
|
||||||
@@ -736,7 +746,9 @@ void MainWindow::onPreviewImageAvailable()
|
@@ -740,7 +750,9 @@ void MainWindow::onPreviewImageAvailable()
|
||||||
}
|
}
|
||||||
ui->previewWidget->setPreviewImage(_processor.previewImage());
|
ui->previewWidget->setPreviewImage(_processor.previewImage());
|
||||||
ui->previewWidget->enableRightClick();
|
ui->previewWidget->enableRightClick();
|
||||||
@ -1085,8 +1153,18 @@ index d89aa7e..56b4bec 100644
|
|||||||
if (_pendingActionAfterCurrentProcessing == ProcessingAction::Close) {
|
if (_pendingActionAfterCurrentProcessing == ProcessingAction::Close) {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
@@ -746,7 +758,9 @@ void MainWindow::onPreviewError(const QString & message)
|
@@ -748,9 +760,19 @@ void MainWindow::onPreviewImageAvailable()
|
||||||
|
|
||||||
|
void MainWindow::onPreviewError(const QString & message)
|
||||||
{
|
{
|
||||||
|
+ // if Krita is too busy generating the images, restart the
|
||||||
|
+ // the preview process
|
||||||
|
+ if (_processor.isInputImagesEmpty()) {
|
||||||
|
+ CroppedImageListProxy::clear();
|
||||||
|
+ QTimer::singleShot(1000, ui->previewWidget, SLOT(sendUpdateRequest()));
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
ui->previewWidget->setPreviewErrorMessage(message);
|
ui->previewWidget->setPreviewErrorMessage(message);
|
||||||
ui->previewWidget->enableRightClick();
|
ui->previewWidget->enableRightClick();
|
||||||
+#ifndef _GMIC_QT_DISABLE_UPDATES_
|
+#ifndef _GMIC_QT_DISABLE_UPDATES_
|
||||||
@ -1095,56 +1173,8 @@ index d89aa7e..56b4bec 100644
|
|||||||
if (_pendingActionAfterCurrentProcessing == ProcessingAction::Close) {
|
if (_pendingActionAfterCurrentProcessing == ProcessingAction::Close) {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
@@ -973,7 +987,7 @@ void MainWindow::saveCurrentParameters()
|
@@ -831,12 +853,16 @@ void MainWindow::onVeryFirstShowEvent()
|
||||||
|
Updater::setOutputMessageMode(Settings::outputMessageMode());
|
||||||
void MainWindow::saveSettings()
|
|
||||||
{
|
|
||||||
- QSettings settings;
|
|
||||||
+ GMIC_SETTINGS(settings);
|
|
||||||
|
|
||||||
_filtersPresenter->saveSettings(settings);
|
|
||||||
|
|
||||||
@@ -1014,7 +1028,7 @@ void MainWindow::saveSettings()
|
|
||||||
|
|
||||||
void MainWindow::loadSettings()
|
|
||||||
{
|
|
||||||
- QSettings settings;
|
|
||||||
+ GMIC_SETTINGS(settings);
|
|
||||||
_filtersPresenter->loadSettings(settings);
|
|
||||||
|
|
||||||
_lastExecutionOK = settings.value("LastExecution/ExitedNormally", true).toBool();
|
|
||||||
@@ -1030,9 +1044,11 @@ void MainWindow::loadSettings()
|
|
||||||
if (settings.value("Config/PreviewPosition", "Left").toString() == "Left") {
|
|
||||||
setPreviewPosition(PreviewPosition::Left);
|
|
||||||
}
|
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
|
||||||
setDarkTheme();
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
if (!DialogSettings::logosAreVisible()) {
|
|
||||||
ui->logosLabel->hide();
|
|
||||||
}
|
|
||||||
@@ -1072,7 +1088,7 @@ void MainWindow::loadSettings()
|
|
||||||
ui->splitter->setSizes(sizes);
|
|
||||||
}
|
|
||||||
|
|
||||||
- ui->cbInternetUpdate->setChecked(settings.value("Config/RefreshInternetUpdate", true).toBool());
|
|
||||||
+ ui->cbInternetUpdate->setChecked(settings.value(REFRESH_USING_INTERNET_KEY, INTERNET_DEFAULT_REFRESH_UPDATE).toBool());
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::setPreviewPosition(MainWindow::PreviewPosition position)
|
|
||||||
@@ -1134,7 +1150,7 @@ void MainWindow::setPreviewPosition(MainWindow::PreviewPosition position)
|
|
||||||
void MainWindow::adjustVerticalSplitter()
|
|
||||||
{
|
|
||||||
QList<int> sizes;
|
|
||||||
- QSettings settings;
|
|
||||||
+ GMIC_SETTINGS(settings);
|
|
||||||
sizes.push_back(settings.value(QString("Config/ParamsVerticalSplitterSizeTop"), -1).toInt());
|
|
||||||
sizes.push_back(settings.value(QString("Config/ParamsVerticalSplitterSizeBottom"), -1).toInt());
|
|
||||||
const int splitterHeight = ui->verticalSplitter->height();
|
|
||||||
@@ -1255,12 +1271,16 @@ void MainWindow::showEvent(QShowEvent * event)
|
|
||||||
Updater::setOutputMessageMode(DialogSettings::outputMessageMode());
|
|
||||||
int ageLimit;
|
int ageLimit;
|
||||||
{
|
{
|
||||||
- QSettings settings;
|
- QSettings settings;
|
||||||
@ -1161,16 +1191,64 @@ index d89aa7e..56b4bec 100644
|
|||||||
+ Updater::getInstance()->startUpdate(ageLimit, 60, useNetwork);
|
+ Updater::getInstance()->startUpdate(ageLimit, 60, useNetwork);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::resizeEvent(QResizeEvent * e)
|
void MainWindow::setZoomConstraint()
|
||||||
@@ -1277,17 +1297,19 @@ bool MainWindow::askUserForGTKFavesImport()
|
@@ -997,7 +1023,7 @@ void MainWindow::saveCurrentParameters()
|
||||||
|
|
||||||
|
void MainWindow::saveSettings()
|
||||||
|
{
|
||||||
|
- QSettings settings;
|
||||||
|
+ GMIC_SETTINGS(settings);
|
||||||
|
|
||||||
|
_filtersPresenter->saveSettings(settings);
|
||||||
|
|
||||||
|
@@ -1039,7 +1065,7 @@ void MainWindow::saveSettings()
|
||||||
|
|
||||||
|
void MainWindow::loadSettings()
|
||||||
|
{
|
||||||
|
- QSettings settings;
|
||||||
|
+ GMIC_SETTINGS(settings);
|
||||||
|
_filtersPresenter->loadSettings(settings);
|
||||||
|
|
||||||
|
_lastExecutionOK = settings.value("LastExecution/ExitedNormally", true).toBool();
|
||||||
|
@@ -1055,9 +1081,11 @@ void MainWindow::loadSettings()
|
||||||
|
if (settings.value("Config/PreviewPosition", "Left").toString() == "Left") {
|
||||||
|
setPreviewPosition(PreviewPosition::Left);
|
||||||
|
}
|
||||||
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
|
if (Settings::darkThemeEnabled()) {
|
||||||
|
setDarkTheme();
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
if (!Settings::visibleLogos()) {
|
||||||
|
ui->logosLabel->hide();
|
||||||
|
}
|
||||||
|
@@ -1101,7 +1129,7 @@ void MainWindow::loadSettings()
|
||||||
|
ui->splitter->setSizes(sizes);
|
||||||
|
}
|
||||||
|
|
||||||
|
- ui->cbInternetUpdate->setChecked(settings.value("Config/RefreshInternetUpdate", true).toBool());
|
||||||
|
+ ui->cbInternetUpdate->setChecked(settings.value(REFRESH_USING_INTERNET_KEY, INTERNET_DEFAULT_REFRESH_UPDATE).toBool());
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::setPreviewPosition(MainWindow::PreviewPosition position)
|
||||||
|
@@ -1163,7 +1191,7 @@ void MainWindow::setPreviewPosition(MainWindow::PreviewPosition position)
|
||||||
|
void MainWindow::adjustVerticalSplitter()
|
||||||
|
{
|
||||||
|
QList<int> sizes;
|
||||||
|
- QSettings settings;
|
||||||
|
+ GMIC_SETTINGS(settings);
|
||||||
|
sizes.push_back(settings.value(QString("Config/ParamsVerticalSplitterSizeTop"), -1).toInt());
|
||||||
|
sizes.push_back(settings.value(QString("Config/ParamsVerticalSplitterSizeBottom"), -1).toInt());
|
||||||
|
const int splitterHeight = ui->verticalSplitter->height();
|
||||||
|
@@ -1292,17 +1320,19 @@ bool MainWindow::askUserForGTKFavesImport()
|
||||||
QMessageBox::Yes | QMessageBox::No, this);
|
QMessageBox::Yes | QMessageBox::No, this);
|
||||||
messageBox.setDefaultButton(QMessageBox::Yes);
|
messageBox.setDefaultButton(QMessageBox::Yes);
|
||||||
QCheckBox * cb = new QCheckBox(tr("Don't ask again"));
|
QCheckBox * cb = new QCheckBox(tr("Don't ask again"));
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
QPalette p = cb->palette();
|
QPalette p = cb->palette();
|
||||||
p.setColor(QPalette::Text, DialogSettings::CheckBoxTextColor);
|
p.setColor(QPalette::Text, Settings::CheckBoxTextColor);
|
||||||
p.setColor(QPalette::Base, DialogSettings::CheckBoxBaseColor);
|
p.setColor(QPalette::Base, Settings::CheckBoxBaseColor);
|
||||||
cb->setPalette(p);
|
cb->setPalette(p);
|
||||||
}
|
}
|
||||||
+#endif
|
+#endif
|
||||||
@ -1184,7 +1262,7 @@ index d89aa7e..56b4bec 100644
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
diff --git a/gmic-qt/src/MainWindow.h b/gmic-qt/src/MainWindow.h
|
diff --git a/gmic-qt/src/MainWindow.h b/gmic-qt/src/MainWindow.h
|
||||||
index a72f762..3819510 100644
|
index 8e5bc09..abd9727 100644
|
||||||
--- a/gmic-qt/src/MainWindow.h
|
--- a/gmic-qt/src/MainWindow.h
|
||||||
+++ b/gmic-qt/src/MainWindow.h
|
+++ b/gmic-qt/src/MainWindow.h
|
||||||
@@ -71,7 +71,9 @@ public:
|
@@ -71,7 +71,9 @@ public:
|
||||||
@ -1197,8 +1275,44 @@ index a72f762..3819510 100644
|
|||||||
void setPluginParameters(const RunParameters & parameters);
|
void setPluginParameters(const RunParameters & parameters);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
diff --git a/gmic-qt/src/Settings.cpp b/gmic-qt/src/Settings.cpp
|
||||||
|
index 4ca42ef..72461e9 100644
|
||||||
|
--- a/gmic-qt/src/Settings.cpp
|
||||||
|
+++ b/gmic-qt/src/Settings.cpp
|
||||||
|
@@ -66,7 +66,7 @@ QString Settings::NegativeSign('-');
|
||||||
|
|
||||||
|
void Settings::load(UserInterfaceMode userInterfaceMode)
|
||||||
|
{
|
||||||
|
- QSettings settings;
|
||||||
|
+ GMIC_SETTINGS(settings);
|
||||||
|
_visibleLogos = settings.value("LogosAreVisible", true).toBool();
|
||||||
|
_darkThemeEnabled = settings.value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool();
|
||||||
|
_languageCode = settings.value(LANGUAGE_CODE_KEY, QString()).toString();
|
||||||
|
@@ -107,7 +107,11 @@ void Settings::setVisibleLogos(bool on)
|
||||||
|
|
||||||
|
bool Settings::darkThemeEnabled()
|
||||||
|
{
|
||||||
|
+#ifdef _GMIC_QT_DISABLE_THEMING_
|
||||||
|
+ return GmicQtHost::DarkThemeIsDefault;
|
||||||
|
+#else
|
||||||
|
return _darkThemeEnabled;
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::setDarkThemeEnabled(bool on)
|
||||||
|
@@ -210,8 +214,10 @@ void Settings::save(QSettings & settings)
|
||||||
|
removeObsoleteKeys(settings);
|
||||||
|
settings.setValue("LogosAreVisible", _visibleLogos);
|
||||||
|
settings.setValue(DARK_THEME_KEY, _darkThemeEnabled);
|
||||||
|
+#ifndef _GMIC_QT_DISABLE_TRANSLATION_
|
||||||
|
settings.setValue(LANGUAGE_CODE_KEY, _languageCode);
|
||||||
|
settings.setValue(ENABLE_FILTER_TRANSLATION, _filterTranslationEnabled);
|
||||||
|
+#endif
|
||||||
|
settings.setValue("Config/PreviewPosition", (_previewPosition == MainWindow::PreviewPosition::Left) ? "Left" : "Right");
|
||||||
|
|
||||||
|
settings.setValue("Config/NativeColorDialogs", _nativeColorDialogs);
|
||||||
diff --git a/gmic-qt/src/Tags.cpp b/gmic-qt/src/Tags.cpp
|
diff --git a/gmic-qt/src/Tags.cpp b/gmic-qt/src/Tags.cpp
|
||||||
index 4092ccc..d33e460 100644
|
index fae4d99..6b721ce 100644
|
||||||
--- a/gmic-qt/src/Tags.cpp
|
--- a/gmic-qt/src/Tags.cpp
|
||||||
+++ b/gmic-qt/src/Tags.cpp
|
+++ b/gmic-qt/src/Tags.cpp
|
||||||
@@ -148,7 +148,10 @@ QAction * TagAssets::action(QObject * parent, TagColor color, IconMark mark)
|
@@ -148,7 +148,10 @@ QAction * TagAssets::action(QObject * parent, TagColor color, IconMark mark)
|
||||||
@ -1214,10 +1328,10 @@ index 4092ccc..d33e460 100644
|
|||||||
|
|
||||||
QString TagAssets::colorName(TagColor color)
|
QString TagAssets::colorName(TagColor color)
|
||||||
diff --git a/gmic-qt/src/Widgets/InOutPanel.cpp b/gmic-qt/src/Widgets/InOutPanel.cpp
|
diff --git a/gmic-qt/src/Widgets/InOutPanel.cpp b/gmic-qt/src/Widgets/InOutPanel.cpp
|
||||||
index a388052..67bdcd1 100644
|
index 6d77179..4fc20cd 100644
|
||||||
--- a/gmic-qt/src/Widgets/InOutPanel.cpp
|
--- a/gmic-qt/src/Widgets/InOutPanel.cpp
|
||||||
+++ b/gmic-qt/src/Widgets/InOutPanel.cpp
|
+++ b/gmic-qt/src/Widgets/InOutPanel.cpp
|
||||||
@@ -158,10 +158,12 @@ void InOutPanel::onResetButtonClicked()
|
@@ -157,10 +157,12 @@ void InOutPanel::onResetButtonClicked()
|
||||||
setState(InputOutputState::Default, true);
|
setState(InputOutputState::Default, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1245,22 +1359,22 @@ index 381bc64..7939d3a 100644
|
|||||||
private:
|
private:
|
||||||
static void setDefaultInputMode();
|
static void setDefaultInputMode();
|
||||||
diff --git a/gmic-qt/src/Widgets/ProgressInfoWindow.cpp b/gmic-qt/src/Widgets/ProgressInfoWindow.cpp
|
diff --git a/gmic-qt/src/Widgets/ProgressInfoWindow.cpp b/gmic-qt/src/Widgets/ProgressInfoWindow.cpp
|
||||||
index 5095528..cb8f35f 100644
|
index 1cb8437..8d27f9f 100644
|
||||||
--- a/gmic-qt/src/Widgets/ProgressInfoWindow.cpp
|
--- a/gmic-qt/src/Widgets/ProgressInfoWindow.cpp
|
||||||
+++ b/gmic-qt/src/Widgets/ProgressInfoWindow.cpp
|
+++ b/gmic-qt/src/Widgets/ProgressInfoWindow.cpp
|
||||||
@@ -59,9 +59,11 @@ ProgressInfoWindow::ProgressInfoWindow(HeadlessProcessor * processor) : QMainWin
|
@@ -62,9 +62,11 @@ ProgressInfoWindow::ProgressInfoWindow(HeadlessProcessor * processor) : QMainWin
|
||||||
connect(processor, &HeadlessProcessor::done, this, &ProgressInfoWindow::onProcessingFinished);
|
connect(processor, &HeadlessProcessor::done, this, &ProgressInfoWindow::onProcessingFinished);
|
||||||
_isShown = false;
|
_isShown = false;
|
||||||
|
|
||||||
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
+#ifndef _GMIC_QT_DISABLE_THEMING_
|
||||||
if (DialogSettings::darkThemeEnabled()) {
|
if (Settings::darkThemeEnabled()) {
|
||||||
setDarkTheme();
|
setDarkTheme();
|
||||||
}
|
}
|
||||||
+#endif
|
+#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressInfoWindow::~ProgressInfoWindow()
|
ProgressInfoWindow::~ProgressInfoWindow()
|
||||||
@@ -85,6 +87,7 @@ void ProgressInfoWindow::closeEvent(QCloseEvent * event)
|
@@ -88,6 +90,7 @@ void ProgressInfoWindow::closeEvent(QCloseEvent * event)
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1268,7 +1382,7 @@ index 5095528..cb8f35f 100644
|
|||||||
void ProgressInfoWindow::setDarkTheme()
|
void ProgressInfoWindow::setDarkTheme()
|
||||||
{
|
{
|
||||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||||
@@ -107,6 +110,7 @@ void ProgressInfoWindow::setDarkTheme()
|
@@ -110,6 +113,7 @@ void ProgressInfoWindow::setDarkTheme()
|
||||||
p.setColor(QPalette::Disabled, QPalette::WindowText, QColor(110, 110, 110));
|
p.setColor(QPalette::Disabled, QPalette::WindowText, QColor(110, 110, 110));
|
||||||
qApp->setPalette(p);
|
qApp->setPalette(p);
|
||||||
}
|
}
|
||||||
@ -1304,5 +1418,5 @@ index 8345152..17d8bb8 100644
|
|||||||
<string>Theme</string>
|
<string>Theme</string>
|
||||||
</property>
|
</property>
|
||||||
--
|
--
|
||||||
2.36.0
|
2.37.2
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user