Merged code missed in RTGUI
This commit is contained in:
@@ -284,7 +284,14 @@ void CropHandler::update () {
|
|||||||
// crop->setWindow (cropX, cropY, cropW, cropH, zoom>=1000 ? 1 : zoom); --> we use the "getWindow" hook instead of setting the size before
|
// crop->setWindow (cropX, cropY, cropW, cropH, zoom>=1000 ? 1 : zoom); --> we use the "getWindow" hook instead of setting the size before
|
||||||
crop->setListener (this);
|
crop->setListener (this);
|
||||||
cropPixbuf.clear ();
|
cropPixbuf.clear ();
|
||||||
|
|
||||||
|
// To save threads, try to mark "needUpdate" without a thread first
|
||||||
|
if (crop->tryUpdate()) {
|
||||||
|
if (isLowUpdatePriority)
|
||||||
Glib::Thread::create(sigc::mem_fun(*crop, &DetailedCrop::fullUpdate), 0, false, true, Glib::THREAD_PRIORITY_LOW);
|
Glib::Thread::create(sigc::mem_fun(*crop, &DetailedCrop::fullUpdate), 0, false, true, Glib::THREAD_PRIORITY_LOW);
|
||||||
|
else
|
||||||
|
Glib::Thread::create(sigc::mem_fun(*crop, &DetailedCrop::fullUpdate), false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,6 +51,7 @@ class CropHandler : public rtengine::DetailedCropListener, public rtengine::Size
|
|||||||
unsigned char* cropimgtrue;
|
unsigned char* cropimgtrue;
|
||||||
int cropimg_width, cropimg_height, cix, ciy, ciw, cih, cis;
|
int cropimg_width, cropimg_height, cix, ciy, ciw, cih, cis;
|
||||||
bool initial;
|
bool initial;
|
||||||
|
bool isLowUpdatePriority;
|
||||||
|
|
||||||
rtengine::StagedImageProcessor* ipc;
|
rtengine::StagedImageProcessor* ipc;
|
||||||
rtengine::DetailedCrop* crop;
|
rtengine::DetailedCrop* crop;
|
||||||
|
@@ -309,14 +309,18 @@ void FileBrowser::close () {
|
|||||||
Glib::Mutex::Lock lock(entryMutex);
|
Glib::Mutex::Lock lock(entryMutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
selected.clear ();
|
||||||
|
notifySelectionListener ();
|
||||||
|
|
||||||
|
// The listener merges parameters with old values, so delete afterwards
|
||||||
for (int i=0; i<fd.size(); i++)
|
for (int i=0; i<fd.size(); i++)
|
||||||
{
|
{
|
||||||
delete fd[i];
|
delete fd[i];
|
||||||
}
|
}
|
||||||
fd.clear ();
|
fd.clear ();
|
||||||
selected.clear ();
|
|
||||||
}
|
}
|
||||||
notifySelectionListener ();
|
|
||||||
lastClicked = NULL;
|
lastClicked = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1079,10 +1079,31 @@ void FileCatalog::trashChanged () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FileCatalog::buttonBrowsePathPressed () {
|
void FileCatalog::buttonBrowsePathPressed () {
|
||||||
Glib::ustring sel = BrowsePath->get_text();
|
Glib::ustring BrowsePathValue = BrowsePath->get_text();
|
||||||
|
Glib::ustring DecodedPathPrefix="";
|
||||||
|
Glib::ustring FirstChar;
|
||||||
|
|
||||||
|
// handle shortcuts in the BrowsePath -- START
|
||||||
|
// read the 1-st character from the path
|
||||||
|
FirstChar = BrowsePathValue.substr (0,1);
|
||||||
|
|
||||||
|
if (FirstChar=="~"){ // home directory
|
||||||
|
DecodedPathPrefix = Glib::get_home_dir();
|
||||||
|
}
|
||||||
|
else if (FirstChar=="!"){ // user's pictures directory
|
||||||
|
//DecodedPathPrefix = g_get_user_special_dir(G_USER_DIRECTORY_PICTURES);
|
||||||
|
DecodedPathPrefix = Glib::get_user_special_dir (G_USER_DIRECTORY_PICTURES);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DecodedPathPrefix!=""){
|
||||||
|
BrowsePathValue = Glib::ustring::compose ("%1%2",DecodedPathPrefix,BrowsePathValue.substr (1,BrowsePath->get_text_length()-1));
|
||||||
|
BrowsePath->set_text(BrowsePathValue);
|
||||||
|
}
|
||||||
|
// handle shortcuts in the BrowsePath -- END
|
||||||
|
|
||||||
// validate the path
|
// validate the path
|
||||||
if (safe_file_test(sel, Glib::FILE_TEST_IS_DIR) && dirlistener){
|
if (safe_file_test(BrowsePathValue, Glib::FILE_TEST_IS_DIR) && dirlistener){
|
||||||
dirlistener->selectDir (sel);
|
dirlistener->selectDir (BrowsePathValue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// error, likely path not found: show red arrow
|
// error, likely path not found: show red arrow
|
||||||
|
@@ -140,7 +140,10 @@ bool Thumbnail::isSupported () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ProcParams& Thumbnail::getProcParams () {
|
const ProcParams& Thumbnail::getProcParams () {
|
||||||
//Glib::Mutex::Lock lock(mutex);
|
// TODO: Check for Linux
|
||||||
|
#ifdef WIN32
|
||||||
|
Glib::Mutex::Lock lock(mutex);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (pparamsValid)
|
if (pparamsValid)
|
||||||
return pparams;
|
return pparams;
|
||||||
@@ -161,7 +164,10 @@ const ProcParams& Thumbnail::getProcParams () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Thumbnail::loadProcParams () {
|
void Thumbnail::loadProcParams () {
|
||||||
//Glib::Mutex::Lock lock(mutex);
|
// TODO: Check for Linux
|
||||||
|
#ifdef WIN32
|
||||||
|
Glib::Mutex::Lock lock(mutex);
|
||||||
|
#endif
|
||||||
|
|
||||||
pparamsValid = false;
|
pparamsValid = false;
|
||||||
if (options.paramsLoadLocation==PLL_Input) {
|
if (options.paramsLoadLocation==PLL_Input) {
|
||||||
@@ -183,7 +189,10 @@ void Thumbnail::loadProcParams () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Thumbnail::clearProcParams (int whoClearedIt) {
|
void Thumbnail::clearProcParams (int whoClearedIt) {
|
||||||
//Glib::Mutex::Lock lock(mutex);
|
// TODO: Check for Linux
|
||||||
|
#ifdef WIN32
|
||||||
|
Glib::Mutex::Lock lock(mutex);
|
||||||
|
#endif
|
||||||
|
|
||||||
cfs.recentlySaved = false;
|
cfs.recentlySaved = false;
|
||||||
pparamsValid = false;
|
pparamsValid = false;
|
||||||
@@ -211,7 +220,10 @@ bool Thumbnail::hasProcParams () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Thumbnail::setProcParams (const ProcParams& pp, int whoChangedIt, bool updateCacheNow) {
|
void Thumbnail::setProcParams (const ProcParams& pp, int whoChangedIt, bool updateCacheNow) {
|
||||||
//Glib::Mutex::Lock lock(mutex);
|
// TODO: Check for Linux
|
||||||
|
#ifdef WIN32
|
||||||
|
Glib::Mutex::Lock lock(mutex);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (pparams!=pp)
|
if (pparams!=pp)
|
||||||
cfs.recentlySaved = false;
|
cfs.recentlySaved = false;
|
||||||
@@ -523,7 +535,10 @@ void Thumbnail::updateCache () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Thumbnail::~Thumbnail () {
|
Thumbnail::~Thumbnail () {
|
||||||
//Glib::Mutex::Lock lock(mutex);
|
// TODO: Check for Linux
|
||||||
|
#ifdef WIN32
|
||||||
|
Glib::Mutex::Lock lock(mutex);
|
||||||
|
#endif
|
||||||
|
|
||||||
delete [] lastImg;
|
delete [] lastImg;
|
||||||
delete tpp;
|
delete tpp;
|
||||||
|
Reference in New Issue
Block a user