added option 'InspectorDelay' to delay generation of inspector previews
This commit is contained in:
@@ -210,6 +210,23 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (delayconn.connected()) {
|
||||||
|
delayconn.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
next_image_path = fullPath;
|
||||||
|
if (!options.inspectorDelay) {
|
||||||
|
doSwitchImage();
|
||||||
|
} else {
|
||||||
|
delayconn = Glib::signal_timeout().connect(sigc::mem_fun(*this, &Inspector::doSwitchImage), options.inspectorDelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Inspector::doSwitchImage()
|
||||||
|
{
|
||||||
|
Glib::ustring fullPath = next_image_path;
|
||||||
|
|
||||||
// we first check the size of the list, it may have been changed in Preference
|
// we first check the size of the list, it may have been changed in Preference
|
||||||
if (images.size() > size_t(options.maxInspectorBuffers)) {
|
if (images.size() > size_t(options.maxInspectorBuffers)) {
|
||||||
// deleting the last entries
|
// deleting the last entries
|
||||||
@@ -225,7 +242,6 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
|
|||||||
if (fullPath.empty()) {
|
if (fullPath.empty()) {
|
||||||
currImage = nullptr;
|
currImage = nullptr;
|
||||||
queue_draw();
|
queue_draw();
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
@@ -264,6 +280,8 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inspector::deleteBuffers ()
|
void Inspector::deleteBuffers ()
|
||||||
|
@@ -48,9 +48,14 @@ private:
|
|||||||
double zoom;
|
double zoom;
|
||||||
bool active;
|
bool active;
|
||||||
|
|
||||||
|
sigc::connection delayconn;
|
||||||
|
Glib::ustring next_image_path;
|
||||||
|
|
||||||
bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr);
|
bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr);
|
||||||
void deleteBuffers();
|
void deleteBuffers();
|
||||||
|
|
||||||
|
bool doSwitchImage();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Inspector();
|
Inspector();
|
||||||
~Inspector();
|
~Inspector();
|
||||||
|
@@ -426,6 +426,7 @@ void Options::setDefaults ()
|
|||||||
#endif
|
#endif
|
||||||
filledProfile = false;
|
filledProfile = false;
|
||||||
maxInspectorBuffers = 2; // a rather conservative value for low specced systems...
|
maxInspectorBuffers = 2; // a rather conservative value for low specced systems...
|
||||||
|
inspectorDelay = 0;
|
||||||
serializeTiffRead = true;
|
serializeTiffRead = true;
|
||||||
|
|
||||||
FileBrowserToolbarSingleRow = false;
|
FileBrowserToolbarSingleRow = false;
|
||||||
@@ -1056,6 +1057,10 @@ void Options::readFromFile (Glib::ustring fname)
|
|||||||
maxInspectorBuffers = keyFile.get_integer ("Performance", "MaxInspectorBuffers");
|
maxInspectorBuffers = keyFile.get_integer ("Performance", "MaxInspectorBuffers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keyFile.has_key ("Performance", "InspectorDelay")) {
|
||||||
|
inspectorDelay = keyFile.get_integer("Performance", "InspectorDelay");
|
||||||
|
}
|
||||||
|
|
||||||
if (keyFile.has_key ("Performance", "PreviewDemosaicFromSidecar")) {
|
if (keyFile.has_key ("Performance", "PreviewDemosaicFromSidecar")) {
|
||||||
prevdemo = (prevdemo_t)keyFile.get_integer ("Performance", "PreviewDemosaicFromSidecar");
|
prevdemo = (prevdemo_t)keyFile.get_integer ("Performance", "PreviewDemosaicFromSidecar");
|
||||||
}
|
}
|
||||||
@@ -1847,6 +1852,7 @@ void Options::saveToFile (Glib::ustring fname)
|
|||||||
keyFile.set_integer ("Performance", "SIMPLNRAUT", rtSettings.leveldnautsimpl);
|
keyFile.set_integer ("Performance", "SIMPLNRAUT", rtSettings.leveldnautsimpl);
|
||||||
keyFile.set_integer ("Performance", "ClutCacheSize", clutCacheSize);
|
keyFile.set_integer ("Performance", "ClutCacheSize", clutCacheSize);
|
||||||
keyFile.set_integer ("Performance", "MaxInspectorBuffers", maxInspectorBuffers);
|
keyFile.set_integer ("Performance", "MaxInspectorBuffers", maxInspectorBuffers);
|
||||||
|
keyFile.set_integer ("Performance", "InspectorDelay", inspectorDelay);
|
||||||
keyFile.set_integer ("Performance", "PreviewDemosaicFromSidecar", prevdemo);
|
keyFile.set_integer ("Performance", "PreviewDemosaicFromSidecar", prevdemo);
|
||||||
keyFile.set_boolean ("Performance", "Daubechies", rtSettings.daubech);
|
keyFile.set_boolean ("Performance", "Daubechies", rtSettings.daubech);
|
||||||
keyFile.set_boolean ("Performance", "SerializeTiffRead", serializeTiffRead);
|
keyFile.set_boolean ("Performance", "SerializeTiffRead", serializeTiffRead);
|
||||||
|
@@ -275,6 +275,7 @@ public:
|
|||||||
Glib::ustring clutsDir;
|
Glib::ustring clutsDir;
|
||||||
int rgbDenoiseThreadLimit; // maximum number of threads for the denoising tool ; 0 = use the maximum available
|
int rgbDenoiseThreadLimit; // maximum number of threads for the denoising tool ; 0 = use the maximum available
|
||||||
int maxInspectorBuffers; // maximum number of buffers (i.e. images) for the Inspector feature
|
int maxInspectorBuffers; // maximum number of buffers (i.e. images) for the Inspector feature
|
||||||
|
int inspectorDelay;
|
||||||
int clutCacheSize;
|
int clutCacheSize;
|
||||||
bool filledProfile; // Used as reminder for the ProfilePanel "mode"
|
bool filledProfile; // Used as reminder for the ProfilePanel "mode"
|
||||||
prevdemo_t prevdemo; // Demosaicing method used for the <100% preview
|
prevdemo_t prevdemo; // Demosaicing method used for the <100% preview
|
||||||
|
Reference in New Issue
Block a user