From 49b7100e4a041c11579343cbbd5435d3496f187c Mon Sep 17 00:00:00 2001 From: Hombre Date: Tue, 28 Jun 2011 23:40:37 +0200 Subject: [PATCH] Porting following changsets to Default for the merge : - 7faf00bc5cbe - 6f9407b451af --- rtgui/CMakeLists.txt | 2 +- rtgui/filecatalog.cc | 10 +++++++--- rtgui/filepanel.cc | 9 +++------ rtgui/filepanel.h | 1 - rtgui/thumbnail.cc | 16 ++++++++++++++-- rtgui/thumbnail.h | 2 ++ 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index e243db17e..515118b8f 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -50,7 +50,7 @@ endif (WIN32) add_executable (rth ${EXTRA_SRC} ${BASESOURCEFILES}) -set_target_properties (rth PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS}" OUTPUT_NAME rt) +set_target_properties (rth PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS}" OUTPUT_NAME rawtherapee) #target_link_libraries (rth rtengine ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${TIFF_LIBRARIES} ${EXTRA_LIB} ${GOBJECT_LIBRARIES} ${GTHREAD_LIBRARIES} # ${GLIB2_LIBRARIES} ${GLIBMM_LIBRARIES} ${GTK_LIBRARIES} ${GTKMM_LIBRARIES} ${GIO_LIBRARIES} ${GIOMM_LIBRARIES} ${LCMS_LIBRARIES} ${IPTCDATA_LIBRARIES}) target_link_libraries (rth rtengine ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${TIFF_LIBRARIES} ${GOBJECT_LIBRARIES} ${GTHREAD_LIBRARIES} diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 1397a6a3e..92e7ac0d2 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -667,9 +667,13 @@ void FileCatalog::refreshHeight () { void FileCatalog::_openImage (std::vector tmb) { if (enabled && listener!=NULL) { - for (size_t i=0; igetFileName())==editedFiles.end()) - listener->fileSelected (tmb[i]); + bool continueToLoad=true; + for (size_t i=0; i< tmb.size() && continueToLoad; i++) { + if (editedFiles.find (tmb[i]->getFileName())==editedFiles.end()){ + listener->fileSelected (tmb[i]); + if( !options.tabbedUI ) + continueToLoad = false; + } tmb[i]->decreaseRef (); } } diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 2345f6a44..05eb75588 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -32,7 +32,6 @@ int fbinit (void* data) { FilePanel::FilePanel () : parent(NULL) { - isloading = false; dirpaned = Gtk::manage ( new Gtk::HPaned () ); dirpaned->set_position (options.dirBrowserWidth); @@ -156,11 +155,9 @@ bool FilePanel::fileSelected (Thumbnail* thm) { return false; // try to open the file - // fileCatalog->setEnabled (false); - if (isloading) - return false; + bool loading = thm->imageLoad( true ); + if( !loading ) return false; - isloading = true; ProgressConnector *ld = new ProgressConnector(); 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) ); @@ -188,7 +185,7 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnectorsetProgress(0.); parent->setProgressStr(""); - isloading = false; + thm->imageLoad( false ); return false; // MUST return false from idle function } diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 86e9111e2..da9e7d4bb 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -51,7 +51,6 @@ class FilePanel : public Gtk::HPaned, Gtk::Notebook* rightNotebook; int error; - bool isloading; public: FilePanel (); diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index f61496c45..1bd3cb8f4 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -35,7 +35,7 @@ using namespace rtengine::procparams; Thumbnail::Thumbnail (CacheManager* cm, const Glib::ustring& fname, CacheImageData* cf) : fname(fname), cfs(*cf), cachemgr(cm), ref(1), enqueueNumber(0), tpp(NULL), - pparamsValid(false), needsReProcessing(true), lastImg(NULL), + pparamsValid(false), needsReProcessing(true),imageLoading(false), lastImg(NULL), initial_(false) { cfs.load (getCacheFileName ("data")+".txt"); @@ -61,7 +61,7 @@ Thumbnail::Thumbnail (CacheManager* cm, const Glib::ustring& fname, CacheImageDa Thumbnail::Thumbnail (CacheManager* cm, const Glib::ustring& fname, const std::string& md5) : fname(fname), cachemgr(cm), ref(1), enqueueNumber(0), tpp(NULL), pparamsValid(false), - needsReProcessing(true), lastImg(NULL), + needsReProcessing(true),imageLoading(false), lastImg(NULL), initial_(true) { @@ -728,3 +728,15 @@ bool Thumbnail::openDefaultViewer(int destination) { #endif } + +bool Thumbnail::imageLoad(bool loading) +{ + Glib::Mutex::Lock lock(mutex); + bool previous = imageLoading; + if( loading && !previous ){ + imageLoading = true; + return true; + }else if( !loading ) + imageLoading = false; + return false; +} diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index 38ba2d28b..c780ade90 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -48,6 +48,7 @@ class Thumbnail { bool pparamsValid; bool pparamsSet; bool needsReProcessing; + bool imageLoading; // these are the data of the result image of the last getthumbnailimage call (for caching purposes) unsigned char* lastImg; @@ -138,6 +139,7 @@ class Thumbnail { void saveThumbnail (); bool openDefaultViewer(int destination); + bool imageLoad(bool loading); };