Merged code missed in RTGUI

This commit is contained in:
Oliver Duis
2011-04-07 17:43:36 +02:00
parent d1ad6a85df
commit cf6059a243
5 changed files with 58 additions and 10 deletions

View File

@@ -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->setListener (this);
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);
else
Glib::Thread::create(sigc::mem_fun(*crop, &DetailedCrop::fullUpdate), false );
}
}
}

View File

@@ -51,6 +51,7 @@ class CropHandler : public rtengine::DetailedCropListener, public rtengine::Size
unsigned char* cropimgtrue;
int cropimg_width, cropimg_height, cix, ciy, ciw, cih, cis;
bool initial;
bool isLowUpdatePriority;
rtengine::StagedImageProcessor* ipc;
rtengine::DetailedCrop* crop;

View File

@@ -309,14 +309,18 @@ void FileBrowser::close () {
Glib::Mutex::Lock lock(entryMutex);
#endif
selected.clear ();
notifySelectionListener ();
// The listener merges parameters with old values, so delete afterwards
for (int i=0; i<fd.size(); i++)
{
delete fd[i];
}
fd.clear ();
selected.clear ();
}
notifySelectionListener ();
lastClicked = NULL;
}

View File

@@ -1079,10 +1079,31 @@ void FileCatalog::trashChanged () {
}
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
if (safe_file_test(sel, Glib::FILE_TEST_IS_DIR) && dirlistener){
dirlistener->selectDir (sel);
if (safe_file_test(BrowsePathValue, Glib::FILE_TEST_IS_DIR) && dirlistener){
dirlistener->selectDir (BrowsePathValue);
}
else
// error, likely path not found: show red arrow

View File

@@ -140,7 +140,10 @@ bool Thumbnail::isSupported () {
}
const ProcParams& Thumbnail::getProcParams () {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
if (pparamsValid)
return pparams;
@@ -161,7 +164,10 @@ const ProcParams& Thumbnail::getProcParams () {
}
void Thumbnail::loadProcParams () {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
pparamsValid = false;
if (options.paramsLoadLocation==PLL_Input) {
@@ -183,7 +189,10 @@ void Thumbnail::loadProcParams () {
}
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;
pparamsValid = false;
@@ -211,7 +220,10 @@ bool Thumbnail::hasProcParams () {
}
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)
cfs.recentlySaved = false;
@@ -523,7 +535,10 @@ void Thumbnail::updateCache () {
}
Thumbnail::~Thumbnail () {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
delete [] lastImg;
delete tpp;