Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically disable Auto-Fill when enabling LCP Disortion Correction, #1791 #3318

Merged
merged 2 commits into from Jun 3, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions rtgui/lensgeom.cc
Expand Up @@ -113,3 +113,19 @@ void LensGeometry::setBatchMode (bool batchMode)
ToolPanel::setBatchMode (batchMode);
removeIfThere (this, autoCrop);
}

void LensGeometry::disableAutoFillIfActive ()
{

if (!batchMode) {
if (fill->get_active()) {
fillConn.block (true);
Copy link
Owner Author

@Beep6581 Beep6581 May 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to prevent the mutex issue, I changed this part to:

            disableListener();
            fillConn.block (true);
            fill->set_active(false);
            fillConn.block (false);
            enableListener();
            if (listener) {
                listener->panelChanged (EvTransAutoFill, M("GENERAL_DISABLED"));
            }

But the mutex problem is still there.

fill->set_active(false);
if (listener) {
listener->panelChanged (EvTransAutoFill, M("GENERAL_DISABLED"));
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line causes the release build to hang when opening a file, and the debug build prints:
MyMutex already locked!
If I comment out this line, no problem. But we need feedback via history so the user knows what's happening.

}
fillConn.block (false);
}
}

}
1 change: 1 addition & 0 deletions rtgui/lensgeom.h
Expand Up @@ -53,6 +53,7 @@ class LensGeometry : public ToolParamBlock, public FoldableToolPanel
{
rlistener = l;
}
void disableAutoFillIfActive ();
};

#endif
10 changes: 10 additions & 0 deletions rtgui/lensprofile.cc
Expand Up @@ -142,6 +142,10 @@ void LensProfilePanel::write( rtengine::procparams::ProcParams* pp, ParamsEdited

void LensProfilePanel::onLCPFileChanged()
{

// Disable Auto-Fill when enabling LCP Distortion Correction, #1791
lensgeomLcpFill->disableAutoFillIfActive();

lcpFileChanged = true;
updateDisabled(lcpStore->isValidLCPFileName(fcbLCPFile->get_filename()));

Expand All @@ -164,6 +168,12 @@ void LensProfilePanel::onLCPFileReset()

void LensProfilePanel::onUseDistChanged()
{

// Disable Auto-Fill when enabling LCP Distortion Correction, #1791
if (ckbUseDist->get_active()) {
lensgeomLcpFill->disableAutoFillIfActive();
}

useDistChanged = true;

if (listener) {
Expand Down
3 changes: 3 additions & 0 deletions rtgui/lensprofile.h
Expand Up @@ -22,6 +22,7 @@
#include <gtkmm.h>
#include "toolpanel.h"
#include "guiutils.h"
#include "lensgeom.h"

class LensProfilePanel : public ToolParamBlock, public FoldableToolPanel
{
Expand All @@ -38,6 +39,7 @@ class LensProfilePanel : public ToolParamBlock, public FoldableToolPanel
void updateDisabled(bool enable);
bool allowFocusDep;
bool isRaw;
LensGeometry *lensgeomLcpFill;

public:

Expand All @@ -52,6 +54,7 @@ class LensProfilePanel : public ToolParamBlock, public FoldableToolPanel
void onUseDistChanged();
void onUseVignChanged();
void onUseCAChanged();
void setLensGeomRef( LensGeometry *foo) { lensgeomLcpFill = foo ;};
};

#endif
1 change: 1 addition & 0 deletions rtgui/toolpanelcoord.cc
Expand Up @@ -53,6 +53,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(nullptr), editDataProvider(n
colortoning = Gtk::manage (new ColorToning ());
lensgeom = Gtk::manage (new LensGeometry ());
lensProf = Gtk::manage (new LensProfilePanel ());
lensProf->setLensGeomRef(lensgeom);
distortion = Gtk::manage (new Distortion ());
rotate = Gtk::manage (new Rotate ());
vibrance = Gtk::manage (new Vibrance ());
Expand Down