* Gui improvments * Several improvments GUI Jz algo * Change function La for lightess Jz * SH jzazbz first * enable Jz SH * Clean code * Disabled Munsell correction when Jz * Change tooltip and Cam16 Munsell * GUI for CzHz and HzHz curves * Enable curves Hz(Hz) Cz(Hz) * Improve Cz chroma * Jz100 reference refine * Change limit Jz100 * Refine link between jz100 and peak adaptation * Improve GUI * Various improvment PQ PU gamut * Change defaults settings * forgotten PL in gamutjz * Small changes and comment * Change gamujz parameter * disabled gamut Jz too slow * Jzazbz curve Jz(Hz) * reenable gamutjz * small changes * Change tooltip * Change labels tooltips * Jzazbz only on advanced mode * GUI improvments * Change tooltip * Change default values and tooltip * Added tooltip Jz * Disabled Jz gamut * Change gamma color and light - remove exposure * Gamma for exposure and DR * gamma Sharp * Gamma vibrance * gamma optimizations * Change tooltips * Optimization PQ * LA GUI for tone curve Ciecam * LA ciecam Enable curve lightness - brightness * LA ciecam GUI color curve * LA ciecam enable color curve * Change tooltip and default values * Enable Jz curve * Enable Cz(Cz) curve * Enable Cz(Jz) curve * Added Log encoding to ciecam * Improvment algorithm remapping * Reenable forgotten listener logencodchanged * Change Jz tooltips * Reenable dynamic range and exposure * First change GUI auto ciecam * 2nd fixed ciecam auto * Improve GUI maskbackground curves * Enable activspot for la ciecam * set sensitive sliders La ciecam when auto scene conditions * Change internal calculations see comments * Checcbox ForceJz to 1 * Change tool position - change order CAM model * Expander for Jzczhz * Remove unused code * GUI changes * Change labels CAM16 Jzazbz * Change slider brightness parameters * improvment SH jz * Some changes to brightness Jz * Fixed scene conditions auto * Renable forgotten change * Prepare calculation Zcam * Prepare Iz for zcam * First GUI Zcam * Improve GUI Zcam * Calculate Qz white - brightness of the reference white * Prepare for PQ - eventually * Init LUT ZCAMBrightCurveJz and ZCAMBrightCurveQz * prepare zcam achromatic variables * First zcam * Change algo step 5 zcam * Another change original algo * Another change to original algo * first colorfullness * Fixed bad behavior threshold and change c c2 surround parameters * added saturation Zcam * Change parameters surround * Enable chroma zcam * change chroma and lightness formula * disable OMP for 2nd process Zcam * Improvment zcam for some high-light images * Change parameters overflow zcam * Change parmeters high datas * another change to retrieve... * Simplify code matrix conversion xyz-jzazbz * Adjust internam parameters zcam * Change some parameters - clean code * Enable PQCam16 * Enable PQ Cam16 - disable ZCAM * remove warning compilation message * Change GUI jzczhz * Fixed bad behavior remaping jz * Remove forgotten parameter - hide Jz100 - PU adaptation- chnage tooltips * Another change to chroma parameter * Small changes * If verbose display in console Cam16 informations * If verbose display in console source saturation colorfullness * Change to La calculation for ciecam * Change GUI cam16 - jzczhz - remove cam16 and jzczhz * Disable exposure compensation to calculate La for all Ciecam and Log encoding * Change label Cam16 and jzczhz * Improve GUI Jz * Other improvment GUI Jz Cam16 * verify nan Jz and ciecam matrix to avoid crash * Enable La manual for Jz to change PU-adaptation * Improve calculation to avoid crash Jz and Cam16 matrix * Fixed crash with local contrast in cam16 * Clean code loccont * First step GUI Cie mask * GUI part 2 - Cie * Build cieMask * Gui part 3 cie * Valid llcieMask * Valid llcieMask * Pass GUI curves parameters to iplocallab.cc * 2nd pass parameters from GUI to iplocallab.cc * Init first functions modifications * Add expander to cam16 adjustments * First test mask cie * Various improvment GUI - tooltips - process * Take into account Yb cam16 for Jz - reenable warm-cool * Surround source Cam16 before Jz * Improve GUI and process * Fixed bug and bad behavior last commit * Fixed bug chroma mask - improve GUI - Relative luminance for Jz * Increase sensitivity mask chroma * Improve Jz with saturation Z - improve GUI Jzczhz * Small code improvment * Another change mask C and enable mask for Cam16 and Jz * Some changes * Enable denoise chroma mask * Small change LIM01 normchromar * Enable Zcam matrix * Improve chroma curves...mask and boudaries * take into account recursive slider in settings * Change tooltip - improvment to C curve (denoise C - best value in curves - etc.) - remove Zcam button * Change tooltips * First part GUI - local contrast wavelet Jz * Passed parameters GUI local contrast wav jz to rtengine * save config wavelet jz * first try wavelet local contrast Jz * Add tooltips * Simplify code wavelet local contrast * take into account edge wavelet performance in Wavelet Jz * Fixed overflow jz when usig botth contradt and wavelt local jz contrast * Adapt size winGdiHandles in filepanel to avoid crash in Windows multieditor * First GUI part Clarity wavelet Jz * First try wavelet Jz Cz clarity * Added tooltips * Small change to enable wavelet jz * Disabled (commented) all Zcam code * Improve behavior when SH local-contrast and Clarity are use both * Change limit PQremap jz * Clean and optimize code * Reenable mjjz * Change settings guidedfilter wavelet Jz * Fixed crash when revory based on lum mask negative * Change tooltip * Fixed ad behavior auto mean and absolute luminance * Remove warning in console * Fixed bad behavior auto Log encoding - bad behavior curves L(H) Jz * Fixed another bad behavior - reenable curves color and light L(H) C(H) * first transposition Lab Jz for curves H * Change mask boundary for Jz * Various improvment to H curves Jz * Add amountchrom to Hcurve Color and Light * Improve gray boundary curves behavior * reenable Jz curve H(H) - soft radius * Improve guidefilter Jz H curve * Threshold chroma Jz(Hz) * Enable guidedfilter chroma curve H * improve GUI curves Hz * Checkbutton chroma for curve Jz(Hz) * Change event selectspot * Clean and small optimization code * Another clean code * Change calculation Hz references for curves Hz * Clean code * Various changes to GF and GUI * Another change to Chroma for Jz(H) * Change GUI sensitive Jz100 adapdjzcie * Improve code for Jz100 * Change default value skin-protection to 0 instead of 50 * Clean code * Remove BENCHFUN for ciecam * small correction to huejz_to_huehsv2 conversion * Added missing plum parameter for jch2xyz_ciecam02float * another small change to huejz_to_huehsv2 * Improvment to huelab_to_huehsv2 and some double functions * Fixed warning hide parameters in lgtm-com * Fixed ? Missing retuen statement in lgtm-com * Change behavior Log encoding whith PQ Cam16 * Small improvment to Jz PU adaptation * Added forgoten to_one for Cz slider * Replace 0.707... by RT_SQRT1_2 - change some settings chroma * Improvment to getAutoLogloc * Fixed crash with array in getAutoLogloc * First try Jz Log encoding * Forgotten Cz * Various improvment GUI setlogscale - Jz log encoding * Change labels tooltips Jz log * Change wrong clipcz value * Change tooltip auto scene conditions * Fixed bad behavior blackevjz whiteevjz * Small improvment to LA Log encoding std * Avoid bad behavior Jz log when enable Relative luminance * Change sourcegray jz calculation * Revert last change * Clean and comment code * Review tooltips thanks to Wayne - harmonize response La log encoding and Jz Log encoding * Always force Dynamic Range evaluation in full frame mode for Jz log encoding * Remove unused code * Small optimizations sigmoid Cam16 and Jz * Comment code * Change parameters deltaE for HDR * Various improvment to Jz - La - sigmoid - log encoding * Basic support for Sony ILCE-7M4 in camconst.json * German translation Spot Removal (#6388) * Filmnegative German translation (#6389) * (Temporarily) disable `ftree-loop-vectorize` for GCC 11 because of #6384 * Added BlacEv WhiteEv to sigmoidJz * Improve GUI for BlackEv WhiteEv * Change location SigmoidJz in Iplocallab * Improvment GUI and sensitivity sliders strength sigmoid * Change labels Co-authored-by: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Co-authored-by: Anna <simonanna@gmx.net>
440 lines
15 KiB
C++
440 lines
15 KiB
C++
/*
|
|
* This file is part of RawTherapee.
|
|
*
|
|
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
|
*
|
|
* RawTherapee is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* RawTherapee is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
#include "filepanel.h"
|
|
|
|
#include "dirbrowser.h"
|
|
#include "batchtoolpanelcoord.h"
|
|
#include "editorpanel.h"
|
|
#include "rtwindow.h"
|
|
#include "inspector.h"
|
|
#include "placesbrowser.h"
|
|
#include "thumbnail.h"
|
|
|
|
#ifdef WIN32
|
|
#include "windows.h"
|
|
#endif
|
|
|
|
FilePanel::FilePanel () : parent(nullptr), error(0)
|
|
{
|
|
|
|
// Contains everything except for the batch Tool Panel and tabs (Fast Export, Inspect, etc)
|
|
dirpaned = Gtk::manage ( new Gtk::Paned () );
|
|
dirpaned->set_position (options.dirBrowserWidth);
|
|
|
|
// The directory tree
|
|
dirBrowser = Gtk::manage ( new DirBrowser () );
|
|
// Places
|
|
placesBrowser = Gtk::manage ( new PlacesBrowser () );
|
|
// Recent Folders
|
|
recentBrowser = Gtk::manage ( new RecentBrowser () );
|
|
|
|
// The whole left panel. Contains Places, Recent Folders and Folders.
|
|
placespaned = Gtk::manage ( new Gtk::Paned (Gtk::ORIENTATION_VERTICAL) );
|
|
placespaned->set_name ("PlacesPaned");
|
|
placespaned->set_size_request(250, 100);
|
|
placespaned->set_position (options.dirBrowserHeight);
|
|
|
|
Gtk::Box* obox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
|
|
obox->get_style_context()->add_class ("plainback");
|
|
obox->pack_start (*recentBrowser, Gtk::PACK_SHRINK, 4);
|
|
obox->pack_start (*dirBrowser);
|
|
|
|
placespaned->pack1 (*placesBrowser, false, true);
|
|
placespaned->pack2 (*obox, true, true);
|
|
|
|
dirpaned->pack1 (*placespaned, false, false);
|
|
|
|
tpc = new BatchToolPanelCoordinator (this);
|
|
// Location bar
|
|
fileCatalog = Gtk::manage ( new FileCatalog (tpc->coarse, tpc->getToolBar(), this) );
|
|
// Holds the location bar and thumbnails
|
|
ribbonPane = Gtk::manage ( new Gtk::Paned() );
|
|
ribbonPane->add(*fileCatalog);
|
|
ribbonPane->set_size_request(50, 150);
|
|
dirpaned->pack2 (*ribbonPane, true, true);
|
|
|
|
DirBrowser::DirSelectionSignal dirSelected = dirBrowser->dirSelected ();
|
|
dirSelected.connect (sigc::mem_fun (fileCatalog, &FileCatalog::dirSelected));
|
|
dirSelected.connect (sigc::mem_fun (recentBrowser, &RecentBrowser::dirSelected));
|
|
dirSelected.connect (sigc::mem_fun (placesBrowser, &PlacesBrowser::dirSelected));
|
|
dirSelected.connect (sigc::mem_fun (tpc, &BatchToolPanelCoordinator::dirSelected));
|
|
fileCatalog->setDirSelector (sigc::mem_fun (dirBrowser, &DirBrowser::selectDir));
|
|
placesBrowser->setDirSelector (sigc::mem_fun (dirBrowser, &DirBrowser::selectDir));
|
|
recentBrowser->setDirSelector (sigc::mem_fun (dirBrowser, &DirBrowser::selectDir));
|
|
fileCatalog->setFileSelectionListener (this);
|
|
|
|
rightBox = Gtk::manage ( new Gtk::Box () );
|
|
rightBox->set_size_request(350, 100);
|
|
rightNotebook = Gtk::manage ( new Gtk::Notebook () );
|
|
rightNotebookSwitchConn = rightNotebook->signal_switch_page().connect_notify( sigc::mem_fun(*this, &FilePanel::on_NB_switch_page) );
|
|
//Gtk::Box* taggingBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) );
|
|
|
|
history = Gtk::manage ( new History (false) );
|
|
|
|
tpc->addPParamsChangeListener (history);
|
|
history->setProfileChangeListener (tpc);
|
|
history->set_size_request(-1, 50);
|
|
|
|
Gtk::ScrolledWindow* sFilterPanel = Gtk::manage ( new Gtk::ScrolledWindow() );
|
|
filterPanel = Gtk::manage ( new FilterPanel () );
|
|
sFilterPanel->add (*filterPanel);
|
|
|
|
inspectorPanel = new Inspector();
|
|
fileCatalog->setInspector(inspectorPanel);
|
|
|
|
Gtk::ScrolledWindow* sExportPanel = Gtk::manage ( new Gtk::ScrolledWindow() );
|
|
exportPanel = Gtk::manage ( new ExportPanel () );
|
|
sExportPanel->add (*exportPanel);
|
|
sExportPanel->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
|
|
|
fileCatalog->setFilterPanel (filterPanel);
|
|
fileCatalog->setExportPanel (exportPanel);
|
|
fileCatalog->setImageAreaToolListener (tpc);
|
|
fileCatalog->fileBrowser->setBatchPParamsChangeListener (tpc);
|
|
|
|
//------------------
|
|
|
|
rightNotebook->set_tab_pos (Gtk::POS_LEFT);
|
|
|
|
Gtk::Label* devLab = Gtk::manage ( new Gtk::Label (M("MAIN_TAB_DEVELOP")) );
|
|
devLab->set_name ("LabelRightNotebook");
|
|
devLab->set_angle (90);
|
|
Gtk::Label* inspectLab = nullptr;
|
|
if (!options.inspectorWindow) {
|
|
inspectLab = Gtk::manage ( new Gtk::Label (M("MAIN_TAB_INSPECT")) );
|
|
inspectLab->set_name ("LabelRightNotebook");
|
|
inspectLab->set_angle (90);
|
|
}
|
|
Gtk::Label* filtLab = Gtk::manage ( new Gtk::Label (M("MAIN_TAB_FILTER")) );
|
|
filtLab->set_name ("LabelRightNotebook");
|
|
filtLab->set_angle (90);
|
|
//Gtk::Label* tagLab = Gtk::manage ( new Gtk::Label (M("MAIN_TAB_TAGGING")) );
|
|
//tagLab->set_angle (90);
|
|
Gtk::Label* exportLab = Gtk::manage ( new Gtk::Label (M("MAIN_TAB_EXPORT")) );
|
|
exportLab->set_name ("LabelRightNotebook");
|
|
exportLab->set_angle (90);
|
|
|
|
tpcPaned = Gtk::manage ( new Gtk::Paned (Gtk::ORIENTATION_VERTICAL) );
|
|
tpcPaned->pack1 (*tpc->toolPanelNotebook, false, true);
|
|
tpcPaned->pack2 (*history, true, false);
|
|
|
|
rightNotebook->append_page (*sFilterPanel, *filtLab);
|
|
if (!options.inspectorWindow)
|
|
rightNotebook->append_page (*inspectorPanel, *inspectLab);
|
|
rightNotebook->append_page (*tpcPaned, *devLab);
|
|
//rightNotebook->append_page (*taggingBox, *tagLab); commented out: currently the tab is empty ...
|
|
rightNotebook->append_page (*sExportPanel, *exportLab);
|
|
rightNotebook->set_name ("RightNotebook");
|
|
|
|
rightBox->pack_start (*rightNotebook);
|
|
|
|
pack1(*dirpaned, true, true);
|
|
pack2(*rightBox, false, false);
|
|
|
|
fileCatalog->setFileSelectionChangeListener (tpc);
|
|
|
|
fileCatalog->setFileSelectionListener (this);
|
|
|
|
idle_register.add(
|
|
[this]() -> bool
|
|
{
|
|
init();
|
|
return false;
|
|
}
|
|
);
|
|
|
|
show_all ();
|
|
}
|
|
|
|
FilePanel::~FilePanel ()
|
|
{
|
|
idle_register.destroy();
|
|
|
|
rightNotebookSwitchConn.disconnect();
|
|
|
|
if (inspectorPanel) {
|
|
delete inspectorPanel;
|
|
}
|
|
|
|
delete tpc;
|
|
}
|
|
|
|
void FilePanel::on_realize ()
|
|
{
|
|
Gtk::Paned::on_realize ();
|
|
tpc->closeAllTools();
|
|
}
|
|
|
|
|
|
void FilePanel::setAspect ()
|
|
{
|
|
int winW, winH;
|
|
parent->get_size(winW, winH);
|
|
placespaned->set_position(options.dirBrowserHeight);
|
|
dirpaned->set_position(options.dirBrowserWidth);
|
|
tpcPaned->set_position(options.browserToolPanelHeight);
|
|
set_position(winW - options.browserToolPanelWidth);
|
|
|
|
if (!options.browserDirPanelOpened) {
|
|
fileCatalog->toggleLeftPanel();
|
|
}
|
|
|
|
if (!options.browserToolPanelOpened) {
|
|
fileCatalog->toggleRightPanel();
|
|
}
|
|
}
|
|
|
|
void FilePanel::init ()
|
|
{
|
|
|
|
dirBrowser->fillDirTree ();
|
|
placesBrowser->refreshPlacesList ();
|
|
|
|
if (!argv1.empty() && Glib::file_test (argv1, Glib::FILE_TEST_EXISTS)) {
|
|
Glib::ustring d(argv1);
|
|
if (!Glib::file_test(d, Glib::FILE_TEST_IS_DIR)) {
|
|
d = Glib::path_get_dirname(d);
|
|
}
|
|
dirBrowser->open(d);
|
|
} else {
|
|
if (options.startupDir == STARTUPDIR_HOME) {
|
|
dirBrowser->open (PlacesBrowser::userPicturesDir ());
|
|
} else if (options.startupDir == STARTUPDIR_CURRENT) {
|
|
dirBrowser->open (argv0);
|
|
} else if (options.startupDir == STARTUPDIR_CUSTOM || options.startupDir == STARTUPDIR_LAST) {
|
|
if (options.startupPath.length() && Glib::file_test(options.startupPath, Glib::FILE_TEST_EXISTS) && Glib::file_test(options.startupPath, Glib::FILE_TEST_IS_DIR)) {
|
|
dirBrowser->open (options.startupPath);
|
|
} else {
|
|
// Fallback option if the path is empty or the folder doesn't exist
|
|
dirBrowser->open (PlacesBrowser::userPicturesDir ());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void FilePanel::on_NB_switch_page(Gtk::Widget* page, guint page_num)
|
|
{
|
|
if (page_num == 1) {
|
|
// switching the inspector "on"
|
|
fileCatalog->enableInspector();
|
|
} else {
|
|
// switching the inspector "off"
|
|
fileCatalog->disableInspector();
|
|
}
|
|
}
|
|
|
|
bool FilePanel::fileSelected (Thumbnail* thm)
|
|
{
|
|
if (!parent) {
|
|
return false;
|
|
}
|
|
|
|
// Check if it's already open BEFORE loading the file
|
|
if (options.tabbedUI && parent->selectEditorPanel(thm->getFileName())) {
|
|
return true;
|
|
}
|
|
|
|
// try to open the file
|
|
bool loading = thm->imageLoad( true );
|
|
|
|
if( !loading ) {
|
|
return false;
|
|
}
|
|
|
|
pendingLoadMutex.lock();
|
|
pendingLoad *pl = new pendingLoad();
|
|
pl->complete = false;
|
|
pl->pc = nullptr;
|
|
pl->thm = thm;
|
|
pendingLoads.push_back(pl);
|
|
pendingLoadMutex.unlock();
|
|
|
|
ProgressConnector<rtengine::InitialImage*> *ld = new ProgressConnector<rtengine::InitialImage*>();
|
|
ld->startFunc (sigc::bind(sigc::ptr_fun(&rtengine::InitialImage::load), thm->getFileName (), thm->getType() == FT_Raw, &error, parent->getProgressListener()),
|
|
sigc::bind(sigc::mem_fun(*this, &FilePanel::imageLoaded), thm, ld) );
|
|
return true;
|
|
}
|
|
|
|
bool FilePanel::addBatchQueueJobs(const std::vector<BatchQueueEntry*>& entries)
|
|
{
|
|
if (parent) {
|
|
parent->addBatchQueueJobs (entries);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> *pc )
|
|
{
|
|
|
|
pendingLoadMutex.lock();
|
|
|
|
// find our place in the array and mark the entry as complete
|
|
for (unsigned int i = 0; i < pendingLoads.size(); i++) {
|
|
if (pendingLoads[i]->thm == thm) {
|
|
pendingLoads[i]->pc = pc;
|
|
pendingLoads[i]->complete = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
// The purpose of the pendingLoads vector is to open tabs in the same order as the loads where initiated. It has no effect on single editor mode.
|
|
while (pendingLoads.size() > 0 && pendingLoads.front()->complete) {
|
|
pendingLoad *pl = pendingLoads.front();
|
|
|
|
if (pl->pc->returnValue()) {
|
|
if (options.tabbedUI) {
|
|
EditorPanel* epanel;
|
|
{
|
|
#ifdef WIN32
|
|
int winGdiHandles = GetGuiResources( GetCurrentProcess(), GR_GDIOBJECTS);
|
|
if(winGdiHandles > 0 && winGdiHandles <= 6500) //(old settings 8500) 0 means we don't have the rights to access the function, 8500 because the limit is 10000 and we need about 1500 free handles
|
|
//J.Desmis october 2021 I change 8500 to 6500..Why ? because whitout while increasing size GUI system crash in multieditor
|
|
#endif
|
|
{
|
|
GThreadLock lock; // Acquiring the GUI... not sure that it's necessary, but it shouldn't harm
|
|
epanel = Gtk::manage (new EditorPanel ());
|
|
parent->addEditorPanel (epanel, pl->thm->getFileName());
|
|
}
|
|
#ifdef WIN32
|
|
else {
|
|
Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_CANNOTLOAD") + " \"" + escapeHtmlChars(thm->getFileName()) + "\" .\n" + M("MAIN_MSG_TOOMANYOPENEDITORS") + "</b>";
|
|
Gtk::MessageDialog msgd (*parent, msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
|
|
msgd.run ();
|
|
goto MAXGDIHANDLESREACHED;
|
|
}
|
|
#endif
|
|
}
|
|
epanel->open(pl->thm, pl->pc->returnValue() );
|
|
|
|
if (!(options.multiDisplayMode > 0)) {
|
|
parent->set_title_decorated(pl->thm->getFileName());
|
|
}
|
|
} else {
|
|
{
|
|
GThreadLock lock; // Acquiring the GUI... not sure that it's necessary, but it shouldn't harm
|
|
parent->SetEditorCurrent();
|
|
}
|
|
parent->epanel->open(pl->thm, pl->pc->returnValue() );
|
|
parent->set_title_decorated(pl->thm->getFileName());
|
|
}
|
|
} else {
|
|
Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_CANNOTLOAD") + " \"" + escapeHtmlChars(thm->getFileName()) + "\" .\n</b>";
|
|
Gtk::MessageDialog msgd (*parent, msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
|
|
msgd.run ();
|
|
}
|
|
#ifdef WIN32
|
|
MAXGDIHANDLESREACHED:
|
|
#endif
|
|
delete pl->pc;
|
|
|
|
{
|
|
GThreadLock lock; // Acquiring the GUI... not sure that it's necessary, but it shouldn't harm
|
|
parent->setProgress(0.);
|
|
parent->setProgressStr("");
|
|
}
|
|
|
|
pendingLoads.erase(pendingLoads.begin());
|
|
delete pl;
|
|
}
|
|
|
|
pendingLoadMutex.unlock();
|
|
|
|
thm->imageLoad( false );
|
|
|
|
return false; // MUST return false from idle function
|
|
}
|
|
|
|
void FilePanel::saveOptions ()
|
|
{
|
|
|
|
int winW, winH;
|
|
parent->get_size(winW, winH);
|
|
options.dirBrowserWidth = dirpaned->get_position ();
|
|
options.dirBrowserHeight = placespaned->get_position ();
|
|
options.browserToolPanelWidth = winW - get_position();
|
|
options.browserToolPanelHeight = tpcPaned->get_position ();
|
|
|
|
if (options.startupDir == STARTUPDIR_LAST && !fileCatalog->lastSelectedDir().empty()) {
|
|
options.startupPath = fileCatalog->lastSelectedDir ();
|
|
}
|
|
|
|
fileCatalog->closeDir ();
|
|
}
|
|
|
|
void FilePanel::open (const Glib::ustring& d)
|
|
{
|
|
|
|
if (Glib::file_test (d, Glib::FILE_TEST_IS_DIR)) {
|
|
dirBrowser->open (d.c_str());
|
|
} else if (Glib::file_test (d, Glib::FILE_TEST_EXISTS)) {
|
|
dirBrowser->open (Glib::path_get_dirname(d), Glib::path_get_basename(d));
|
|
}
|
|
}
|
|
|
|
void FilePanel::optionsChanged ()
|
|
{
|
|
|
|
tpc->optionsChanged ();
|
|
fileCatalog->refreshThumbImages ();
|
|
}
|
|
|
|
bool FilePanel::handleShortcutKey (GdkEventKey* event)
|
|
{
|
|
|
|
if(tpc->getToolBar() && tpc->getToolBar()->handleShortcutKey(event)) {
|
|
return true;
|
|
}
|
|
|
|
if(tpc->handleShortcutKey(event)) {
|
|
return true;
|
|
}
|
|
|
|
if(fileCatalog->handleShortcutKey(event)) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool FilePanel::handleShortcutKeyRelease(GdkEventKey *event)
|
|
{
|
|
if(fileCatalog->handleShortcutKeyRelease(event)) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void FilePanel::loadingThumbs(Glib::ustring str, double rate)
|
|
{
|
|
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
|
|
|
|
if( !str.empty()) {
|
|
parent->setProgressStr(str);
|
|
}
|
|
|
|
parent->setProgress( rate );
|
|
}
|
|
|
|
void FilePanel::updateTPVScrollbar (bool hide)
|
|
{
|
|
tpc->updateTPVScrollbar (hide);
|
|
}
|