#include "DialogFactory.h"
#include "DispatchResult.h"
#include "FileDialog.h"
+#include "FindAndReplace.h"
#include "FontLoader.h"
#include "GuiApplication.h"
#include "GuiClickableLabel.h"
}
+bool GuiView::hasVisibleWorkArea(GuiWorkArea * wa) const
+{
+ for (int i = 0; i < d.splitter_->count(); ++i)
+ if (d.tabWorkArea(i)->currentWorkArea() == wa)
+ return true;
+
+ FindAndReplace * fr = static_cast<FindAndReplace*>(find("findreplaceadv", false));
+ return fr->isVisible() && fr->hasWorkArea(wa);
+}
+
+
LayoutBox * GuiView::getLayoutDialog() const
{
return d.layout_;
}
-Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
+Dialog * GuiView::find(string const & name, bool hide_it) const
{
if (!isValidName(name))
return nullptr;
it->second->hideView();
return it->second.get();
}
+ return nullptr;
+}
+
+
+Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
+{
+ Dialog * dialog = find(name, hide_it);
+ if (dialog != nullptr)
+ return dialog;
- Dialog * dialog = build(name);
+ dialog = build(name);
d.dialogs_[name].reset(dialog);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
// Force a uniform style for group boxes