merged with dev
This commit is contained in:
43
.travis.yml
Normal file
43
.travis.yml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
language: cpp
|
||||||
|
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
|
||||||
|
#branches:
|
||||||
|
# only:
|
||||||
|
# - master
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
irc:
|
||||||
|
channels:
|
||||||
|
- "chat.freenode.net#rawtherapee"
|
||||||
|
skip_join: true
|
||||||
|
template:
|
||||||
|
- "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}"
|
||||||
|
email:
|
||||||
|
on_success: change
|
||||||
|
on_failure: always
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- OMP_NUM_THREADS=4
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||||
|
- sudo apt-get -qq update
|
||||||
|
- sudo apt-get install gcc-6.2 g++-6.2
|
||||||
|
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6.2 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6.2
|
||||||
|
- sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk3-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk-3-dev libgtkmm-3.0-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
- cmake -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" -DWITH_LTO="OFF" -DPROC_TARGET_NUMBER="2" ..
|
||||||
|
|
||||||
|
script: make
|
BIN
rtdata/dcpprofiles/FUJIFILM X100S.dcp
Normal file
BIN
rtdata/dcpprofiles/FUJIFILM X100S.dcp
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
|||||||
This file is part of RawTherapee.
|
This file is part of RawTherapee.
|
||||||
|
|
||||||
Copyright (c) 2016-2017 TooWaBoo
|
Copyright (c) 2016-2017 TooWaBoo
|
||||||
Version 2.47 - requires RT 5.0
|
Version 2.49 - requires RT 5.0
|
||||||
|
|
||||||
RawTherapee is free software: you can redistribute it and/or modify
|
RawTherapee is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ToolPanelNotebook {
|
#ToolPanelNotebook {
|
||||||
min-width: 24em;
|
min-width: 24.08334em;
|
||||||
}
|
}
|
||||||
#HistoryPanel {
|
#HistoryPanel {
|
||||||
min-width: 18em;
|
min-width: 18em;
|
||||||
@@ -795,7 +795,7 @@ window.csd:not(.fullscreen) #MainNotebook > header.top {
|
|||||||
padding: 0 0.33334em;
|
padding: 0 0.33334em;
|
||||||
}
|
}
|
||||||
#ToolPanelNotebook > header tab + tab {
|
#ToolPanelNotebook > header tab + tab {
|
||||||
margin-left: 0.25em;
|
margin-left: 0.33333em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ToolPanelNotebook > header tab image{
|
#ToolPanelNotebook > header tab image{
|
||||||
@@ -901,6 +901,11 @@ window.csd:not(.fullscreen) #MainNotebook > header.top {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#MetaPanelNotebook combobox button {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
#MetaPanelNotebook combobox + button,
|
#MetaPanelNotebook combobox + button,
|
||||||
#MetaPanelNotebook combobox + button + button {
|
#MetaPanelNotebook combobox + button + button {
|
||||||
margin-left: 0.16667em;
|
margin-left: 0.16667em;
|
||||||
@@ -1096,6 +1101,9 @@ window.csd:not(.fullscreen) #MainNotebook > header.top {
|
|||||||
border-color: @bg-dark-grey;
|
border-color: @bg-dark-grey;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
#ThresholdAdjuster {
|
||||||
|
margin: 0.08334em 0 0.16667em 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ToolPanelNotebook scrolledwindow viewport.frame {
|
#ToolPanelNotebook scrolledwindow viewport.frame {
|
||||||
padding: 0 0.56em;
|
padding: 0 0.56em;
|
||||||
@@ -1349,13 +1357,14 @@ button.MiddleH {
|
|||||||
}
|
}
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
/* Base format for Toolbox and dialogs */
|
/* Button base format for Toolbox and dialogs */
|
||||||
dialog button,
|
dialog button,
|
||||||
#MyExpander button,
|
#MyExpander button,
|
||||||
#BatchQueueButtonsMainContainer button {
|
#BatchQueueButtonsMainContainer button {
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding: 0 0.375em;
|
padding: 0 0.375em;
|
||||||
|
margin: 0.08334em 0;
|
||||||
}
|
}
|
||||||
combobox .combo,
|
combobox .combo,
|
||||||
dialog combobox .combo,
|
dialog combobox .combo,
|
||||||
@@ -1384,7 +1393,7 @@ dialog combobox .combo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
buttonbox:not(.dialog-action-area) button{
|
buttonbox:not(.dialog-action-area) button{
|
||||||
margin: 0.16667em 0 0.33334em 0.16667em;
|
margin: 0.08334em 0 0.33334em 0.16667em;
|
||||||
}
|
}
|
||||||
#PrefNotebook buttonbox:not(.dialog-action-area) {
|
#PrefNotebook buttonbox:not(.dialog-action-area) {
|
||||||
margin-right: -5px;
|
margin-right: -5px;
|
||||||
@@ -1408,13 +1417,6 @@ buttonbox:not(.dialog-action-area) button{
|
|||||||
}
|
}
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
/* Add extra top and bottom space to buttons in toolbox & Preferences*/
|
|
||||||
#PrefNotebook stack > box:nth-child(5) combobox,
|
|
||||||
#MyExpander button.flat,
|
|
||||||
#MyExpander button {
|
|
||||||
margin-top: 0.08334em;
|
|
||||||
margin-bottom: 0.08334em;
|
|
||||||
}
|
|
||||||
/**/
|
/**/
|
||||||
#MyExpander button.text-button label {
|
#MyExpander button.text-button label {
|
||||||
margin: 0;/* x */
|
margin: 0;/* x */
|
||||||
@@ -1469,6 +1471,7 @@ window .view button {
|
|||||||
min-height: 2em;
|
min-height: 2em;
|
||||||
min-width: 1.33334em;
|
min-width: 1.33334em;
|
||||||
padding: 0 0.33334em;
|
padding: 0 0.33334em;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
dialog .view button.text-button label,
|
dialog .view button.text-button label,
|
||||||
window .view button.text-button label {
|
window .view button.text-button label {
|
||||||
@@ -1504,6 +1507,7 @@ window .view header button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pathbarbox button:last-child {
|
#pathbarbox button:last-child {
|
||||||
|
min-height: 2em;
|
||||||
min-width: 2em;
|
min-width: 2em;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -1535,7 +1539,7 @@ popover button.text-button {
|
|||||||
border: 0.08334em solid @border-color;
|
border: 0.08334em solid @border-color;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
margin: 0;
|
margin: 0.083334em 0;
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
padding: 0 0.66667em;
|
padding: 0 0.66667em;
|
||||||
}
|
}
|
||||||
@@ -1625,17 +1629,14 @@ headerbar button.titlebutton.close:active{
|
|||||||
/*** end ***************************************************************************************/
|
/*** end ***************************************************************************************/
|
||||||
|
|
||||||
/*** Ckeckbox & Radio **************************************************************************/
|
/*** Ckeckbox & Radio **************************************************************************/
|
||||||
checkbox {
|
checkbox,
|
||||||
padding:0;
|
|
||||||
margin:0;
|
|
||||||
min-height: 2em;
|
|
||||||
}
|
|
||||||
checkbutton,
|
checkbutton,
|
||||||
radiobutton {
|
radiobutton {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 2em;
|
min-height: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
check,
|
check,
|
||||||
radio {
|
radio {
|
||||||
border: calc(0.083334em + 0.18px) solid shade(@text-color, .9);
|
border: calc(0.083334em + 0.18px) solid shade(@text-color, .9);
|
||||||
@@ -1678,16 +1679,6 @@ frame > checkbutton check{
|
|||||||
min-height: 1.4em;
|
min-height: 1.4em;
|
||||||
margin-left: 0.5em;
|
margin-left: 0.5em;
|
||||||
}
|
}
|
||||||
#PrefNotebook checkbutton {
|
|
||||||
min-height: 1.16667em;
|
|
||||||
}
|
|
||||||
#PrefNotebook stack > box:nth-child(4) checkbutton,
|
|
||||||
#PrefNotebook stack > box:nth-child(5) checkbutton {
|
|
||||||
min-height: 1.83334em;
|
|
||||||
}
|
|
||||||
#PrefNotebook radiobutton {
|
|
||||||
min-height: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#MyExpander button + checkbutton:last-child {
|
#MyExpander button + checkbutton:last-child {
|
||||||
margin-left: 0.33334em;
|
margin-left: 0.33334em;
|
||||||
@@ -1698,7 +1689,7 @@ frame > checkbutton check{
|
|||||||
/*** Entry & Spinbutton ************************************************************************/
|
/*** Entry & Spinbutton ************************************************************************/
|
||||||
#MyExpander entry,
|
#MyExpander entry,
|
||||||
entry {
|
entry {
|
||||||
margin: 0;
|
margin: 0.08334em 0;
|
||||||
padding: 0 0.33334em;
|
padding: 0 0.33334em;
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -1709,7 +1700,7 @@ entry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
spinbutton {
|
spinbutton {
|
||||||
margin: 0;
|
margin: 0.08334em 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
This file is part of RawTherapee.
|
This file is part of RawTherapee.
|
||||||
|
|
||||||
Copyright (c) 2016-2017 TooWaBoo
|
Copyright (c) 2016-2017 TooWaBoo
|
||||||
Version 2.47 - requires RT 5.0
|
Version 2.49 - requires RT 5.0
|
||||||
|
|
||||||
RawTherapee is free software: you can redistribute it and/or modify
|
RawTherapee is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ToolPanelNotebook {
|
#ToolPanelNotebook {
|
||||||
min-width: 24em;
|
min-width: 24.08334em;
|
||||||
}
|
}
|
||||||
#HistoryPanel {
|
#HistoryPanel {
|
||||||
min-width: 18em;
|
min-width: 18em;
|
||||||
@@ -795,7 +795,7 @@ window.csd:not(.fullscreen) #MainNotebook > header.top {
|
|||||||
padding: 0 0.33334em;
|
padding: 0 0.33334em;
|
||||||
}
|
}
|
||||||
#ToolPanelNotebook > header tab + tab {
|
#ToolPanelNotebook > header tab + tab {
|
||||||
margin-left: 0.25em;
|
margin-left: 0.33333em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ToolPanelNotebook > header tab image{
|
#ToolPanelNotebook > header tab image{
|
||||||
@@ -901,6 +901,11 @@ window.csd:not(.fullscreen) #MainNotebook > header.top {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#MetaPanelNotebook combobox button {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
#MetaPanelNotebook combobox + button,
|
#MetaPanelNotebook combobox + button,
|
||||||
#MetaPanelNotebook combobox + button + button {
|
#MetaPanelNotebook combobox + button + button {
|
||||||
margin-left: 0.16667em;
|
margin-left: 0.16667em;
|
||||||
@@ -1096,6 +1101,9 @@ window.csd:not(.fullscreen) #MainNotebook > header.top {
|
|||||||
border-color: @bg-dark-grey;
|
border-color: @bg-dark-grey;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
#ThresholdAdjuster {
|
||||||
|
margin: 0.08334em 0 0.16667em 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ToolPanelNotebook scrolledwindow viewport.frame {
|
#ToolPanelNotebook scrolledwindow viewport.frame {
|
||||||
padding: 0 0.56em;
|
padding: 0 0.56em;
|
||||||
@@ -1349,13 +1357,14 @@ button.MiddleH {
|
|||||||
}
|
}
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
/* Base format for Toolbox and dialogs */
|
/* Button base format for Toolbox and dialogs */
|
||||||
dialog button,
|
dialog button,
|
||||||
#MyExpander button,
|
#MyExpander button,
|
||||||
#BatchQueueButtonsMainContainer button {
|
#BatchQueueButtonsMainContainer button {
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding: 0 0.375em;
|
padding: 0 0.375em;
|
||||||
|
margin: 0.08334em 0;
|
||||||
}
|
}
|
||||||
combobox .combo,
|
combobox .combo,
|
||||||
dialog combobox .combo,
|
dialog combobox .combo,
|
||||||
@@ -1384,7 +1393,7 @@ dialog combobox .combo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
buttonbox:not(.dialog-action-area) button{
|
buttonbox:not(.dialog-action-area) button{
|
||||||
margin: 0.16667em 0 0.33334em 0.16667em;
|
margin: 0.08334em 0 0.33334em 0.16667em;
|
||||||
}
|
}
|
||||||
#PrefNotebook buttonbox:not(.dialog-action-area) {
|
#PrefNotebook buttonbox:not(.dialog-action-area) {
|
||||||
margin-right: -5px;
|
margin-right: -5px;
|
||||||
@@ -1408,13 +1417,6 @@ buttonbox:not(.dialog-action-area) button{
|
|||||||
}
|
}
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
/* Add extra top and bottom space to buttons in toolbox & Preferences*/
|
|
||||||
#PrefNotebook stack > box:nth-child(5) combobox,
|
|
||||||
#MyExpander button.flat,
|
|
||||||
#MyExpander button {
|
|
||||||
margin-top: 0.08334em;
|
|
||||||
margin-bottom: 0.08334em;
|
|
||||||
}
|
|
||||||
/**/
|
/**/
|
||||||
#MyExpander button.text-button label {
|
#MyExpander button.text-button label {
|
||||||
margin: 0;/* x */
|
margin: 0;/* x */
|
||||||
@@ -1469,6 +1471,7 @@ window .view button {
|
|||||||
min-height: 2em;
|
min-height: 2em;
|
||||||
min-width: 1.33334em;
|
min-width: 1.33334em;
|
||||||
padding: 0 0.33334em;
|
padding: 0 0.33334em;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
dialog .view button.text-button label,
|
dialog .view button.text-button label,
|
||||||
window .view button.text-button label {
|
window .view button.text-button label {
|
||||||
@@ -1504,6 +1507,7 @@ window .view header button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pathbarbox button:last-child {
|
#pathbarbox button:last-child {
|
||||||
|
min-height: 2em;
|
||||||
min-width: 2em;
|
min-width: 2em;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -1535,7 +1539,7 @@ popover button.text-button {
|
|||||||
border: 0.08334em solid @border-color;
|
border: 0.08334em solid @border-color;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
margin: 0;
|
margin: 0.083334em 0;
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
padding: 0 0.66667em;
|
padding: 0 0.66667em;
|
||||||
}
|
}
|
||||||
@@ -1625,17 +1629,14 @@ headerbar button.titlebutton.close:active{
|
|||||||
/*** end ***************************************************************************************/
|
/*** end ***************************************************************************************/
|
||||||
|
|
||||||
/*** Ckeckbox & Radio **************************************************************************/
|
/*** Ckeckbox & Radio **************************************************************************/
|
||||||
checkbox {
|
checkbox,
|
||||||
padding:0;
|
|
||||||
margin:0;
|
|
||||||
min-height: 2em;
|
|
||||||
}
|
|
||||||
checkbutton,
|
checkbutton,
|
||||||
radiobutton {
|
radiobutton {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 2em;
|
min-height: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
check,
|
check,
|
||||||
radio {
|
radio {
|
||||||
border: calc(0.083334em + 0.18px) solid shade(@text-color, .9);
|
border: calc(0.083334em + 0.18px) solid shade(@text-color, .9);
|
||||||
@@ -1678,16 +1679,6 @@ frame > checkbutton check{
|
|||||||
min-height: 1.4em;
|
min-height: 1.4em;
|
||||||
margin-left: 0.5em;
|
margin-left: 0.5em;
|
||||||
}
|
}
|
||||||
#PrefNotebook checkbutton {
|
|
||||||
min-height: 1.16667em;
|
|
||||||
}
|
|
||||||
#PrefNotebook stack > box:nth-child(4) checkbutton,
|
|
||||||
#PrefNotebook stack > box:nth-child(5) checkbutton {
|
|
||||||
min-height: 1.83334em;
|
|
||||||
}
|
|
||||||
#PrefNotebook radiobutton {
|
|
||||||
min-height: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#MyExpander button + checkbutton:last-child {
|
#MyExpander button + checkbutton:last-child {
|
||||||
margin-left: 0.33334em;
|
margin-left: 0.33334em;
|
||||||
@@ -1698,7 +1689,7 @@ frame > checkbutton check{
|
|||||||
/*** Entry & Spinbutton ************************************************************************/
|
/*** Entry & Spinbutton ************************************************************************/
|
||||||
#MyExpander entry,
|
#MyExpander entry,
|
||||||
entry {
|
entry {
|
||||||
margin: 0;
|
margin: 0.08334em 0;
|
||||||
padding: 0 0.33334em;
|
padding: 0 0.33334em;
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -1709,7 +1700,7 @@ entry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
spinbutton {
|
spinbutton {
|
||||||
margin: 0;
|
margin: 0.08334em 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
min-height: 1.66667em;
|
min-height: 1.66667em;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
@@ -42,10 +42,20 @@
|
|||||||
// Special name for the Dynamic profile
|
// Special name for the Dynamic profile
|
||||||
#define DEFPROFILE_DYNAMIC "Dynamic"
|
#define DEFPROFILE_DYNAMIC "Dynamic"
|
||||||
|
|
||||||
class SaveFormat
|
struct SaveFormat
|
||||||
{
|
{
|
||||||
|
SaveFormat() :
|
||||||
|
format("jpg"),
|
||||||
|
pngBits(8),
|
||||||
|
pngCompression(6),
|
||||||
|
jpegQuality(90),
|
||||||
|
jpegSubSamp(2),
|
||||||
|
tiffBits(8),
|
||||||
|
tiffUncompressed(true),
|
||||||
|
saveParams(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
|
||||||
Glib::ustring format;
|
Glib::ustring format;
|
||||||
int pngBits;
|
int pngBits;
|
||||||
int pngCompression;
|
int pngCompression;
|
||||||
@@ -54,7 +64,6 @@ public:
|
|||||||
int tiffBits;
|
int tiffBits;
|
||||||
bool tiffUncompressed;
|
bool tiffUncompressed;
|
||||||
bool saveParams;
|
bool saveParams;
|
||||||
SaveFormat () : format("jpg"), pngBits(8), pngCompression(6), jpegQuality(90), jpegSubSamp(2), tiffBits(8), tiffUncompressed(true), saveParams(true) {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ThFileType {FT_Invalid = -1, FT_None = 0, FT_Raw = 1, FT_Jpeg = 2, FT_Tiff = 3, FT_Png = 4, FT_Custom = 5, FT_Tiff16 = 6, FT_Png16 = 7, FT_Custom16 = 8};
|
enum ThFileType {FT_Invalid = -1, FT_None = 0, FT_Raw = 1, FT_Jpeg = 2, FT_Tiff = 3, FT_Png = 4, FT_Custom = 5, FT_Tiff16 = 6, FT_Png16 = 7, FT_Custom16 = 8};
|
||||||
|
@@ -21,6 +21,8 @@
|
|||||||
#include "guiutils.h"
|
#include "guiutils.h"
|
||||||
#include "rtimage.h"
|
#include "rtimage.h"
|
||||||
|
|
||||||
|
#include "../rtengine/utils.h"
|
||||||
|
|
||||||
extern Options options;
|
extern Options options;
|
||||||
|
|
||||||
SaveAsDialog::SaveAsDialog (const Glib::ustring &initialDir, Gtk::Window* parent)
|
SaveAsDialog::SaveAsDialog (const Glib::ustring &initialDir, Gtk::Window* parent)
|
||||||
@@ -217,41 +219,57 @@ SaveFormat SaveAsDialog::getFormat ()
|
|||||||
|
|
||||||
void SaveAsDialog::okPressed ()
|
void SaveAsDialog::okPressed ()
|
||||||
{
|
{
|
||||||
|
|
||||||
fname = fchooser->get_filename();
|
fname = fchooser->get_filename();
|
||||||
|
|
||||||
// checking if the filename field is empty. The user have to click Cancel if he don't want to specify a filename
|
|
||||||
// NB: There seem to be a bug in Gtkmm2.22 / FileChooserWidget : if you suppress the filename entry and
|
// NB: There seem to be a bug in Gtkmm2.22 / FileChooserWidget : if you suppress the filename entry and
|
||||||
// click on a folder in the list, the filename field is empty but get_filename will return the folder's path :/
|
// click on a folder in the list, the filename field is empty but get_filename will return the folder's path :/
|
||||||
if (!fname.length() || Glib::file_test (fname, Glib::FILE_TEST_IS_DIR)) {
|
if (Glib::file_test(fname, Glib::FILE_TEST_IS_DIR)) {
|
||||||
Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_EMPTYFILENAME") + "</b>";
|
fname = fchooser->get_current_name();
|
||||||
Gtk::MessageDialog msgd (*this, msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true);
|
}
|
||||||
msgd.run ();
|
|
||||||
|
// Checking if the filename field is empty. The user have to click Cancel if he don't want to specify a filename
|
||||||
|
if (fname.empty()) {
|
||||||
|
Gtk::MessageDialog(
|
||||||
|
*this,
|
||||||
|
Glib::ustring("<b>")
|
||||||
|
+ M("MAIN_MSG_EMPTYFILENAME")
|
||||||
|
+ "</b>",
|
||||||
|
true,
|
||||||
|
Gtk::MESSAGE_WARNING,
|
||||||
|
Gtk::BUTTONS_OK,
|
||||||
|
true
|
||||||
|
).run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolve extension ambiguities
|
if (getExtension(fname).empty()) {
|
||||||
SaveFormat sf = formatOpts->getFormat ();
|
// Extension is either empty or unfamiliar
|
||||||
Glib::ustring extLower = getExtension (fname).lowercase ();
|
fname += '.' + formatOpts->getFormat().format;
|
||||||
bool extIsEmpty = (extLower == "");
|
} else if (
|
||||||
bool extIsJpeg = (extLower == "jpg" || extLower == "jpeg" || extLower == "jpe");
|
!rtengine::hasJpegExtension(fname)
|
||||||
bool extIsTiff = (extLower == "tif" || extLower == "tiff");
|
&& !rtengine::hasTiffExtension(fname)
|
||||||
bool extIsPng = (extLower == "png");
|
&& !rtengine::hasPngExtension(fname)
|
||||||
|
) {
|
||||||
|
// Create dialog to warn user that the filename may have two extensions on the end
|
||||||
|
Gtk::MessageDialog msgd(
|
||||||
|
*this,
|
||||||
|
Glib::ustring("<b>")
|
||||||
|
+ M("GENERAL_WARNING")
|
||||||
|
+ ": "
|
||||||
|
+ M("SAVEDLG_WARNFILENAME")
|
||||||
|
+ " \""
|
||||||
|
+ Glib::path_get_basename (fname)
|
||||||
|
+ '.'
|
||||||
|
+ formatOpts->getFormat().format
|
||||||
|
+ "\"</b>",
|
||||||
|
true,
|
||||||
|
Gtk::MESSAGE_WARNING,
|
||||||
|
Gtk::BUTTONS_OK_CANCEL,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
if (extIsEmpty || !(extIsJpeg || extIsTiff || extIsPng)) {
|
if (msgd.run() == Gtk::RESPONSE_OK) {
|
||||||
// extension is either empty or unfamiliar.
|
fname += "." + formatOpts->getFormat().format;
|
||||||
fname += Glib::ustring (".") + sf.format;
|
|
||||||
} else if ( !(sf.format == "jpg" && extIsJpeg)
|
|
||||||
&& !(sf.format == "tif" && extIsTiff)
|
|
||||||
&& !(sf.format == "png" && extIsPng ) ) {
|
|
||||||
// create dialog to warn user that the filename may have two extensions on the end.
|
|
||||||
Glib::ustring msg_ = Glib::ustring ("<b>") + M("GENERAL_WARNING") + ": "
|
|
||||||
+ M("SAVEDLG_WARNFILENAME") + " \"" + Glib::path_get_basename (fname)
|
|
||||||
+ "." + sf.format + "\"</b>";
|
|
||||||
Gtk::MessageDialog msgd (*this, msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK_CANCEL, true);
|
|
||||||
|
|
||||||
if (msgd.run () == Gtk::RESPONSE_OK) {
|
|
||||||
fname += Glib::ustring (".") + sf.format;
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user