Commit a61301ff authored by T.J. Corona's avatar T.J. Corona

Hide advance level options for new resource menu selection

parent d946d341
## Hide advanced items in operation view for "New Resource" menu option
Currently, creation operators all fallow the pattern of optionally creating
an entity within an extant resource. Since this functionality doesn't make
sense for a "New Resource" menu option, we flag the input items involved
with that choice as advanced and disable the advanced items when the
operation is launched via the "New Resource" menu option. Since the
choice of filtering by advance level is persistent for the operation, we
unset the flag after the operation window returns.
......@@ -79,6 +79,18 @@ void pqNewResourceReaction::newResource()
// Create an operation view for the operation.
smtk::view::ViewPtr view = uiManager->findOrCreateOperationView();
// Currently, creation operators all fallow the pattern of optionally creating
// an entity within an extant resource. Since this functionality doesn't make
// sense for a "New Resource" menu option, we flag the input items involved
// with that choice as advanced and disable the advanced items here. Since the
// choice of filtering by advance level is persistent for the operation, we
// unset the flag after the operation window returns.
std::string originalFilterByAdvanceLevel;
if (view->details().attribute("FilterByAdvanceLevel", originalFilterByAdvanceLevel))
{
view->details().setAttribute("FilterByAdvanceLevel", "false");
}
smtk::extension::qtOperationView* opView = dynamic_cast<smtk::extension::qtOperationView*>(
uiManager->setSMTKView(view, createDialog.data()));
......@@ -114,6 +126,13 @@ void pqNewResourceReaction::newResource()
pqSMTKRenderResourceBehavior::instance()->renderPipelineSource(src);
}
// Restore the original choice for filtering by advance level so it will be
// present when the operation is called from another code path.
if (view->details().attribute("FilterByAdvanceLevel"))
{
view->details().setAttribute("FilterByAdvanceLevel", originalFilterByAdvanceLevel);
}
}
namespace
......
......@@ -122,4 +122,14 @@
</ItemDefinitions>
</AttDef>
</Definitions>
<Views>
<View Type="Operation" Title="Model - Create Uniform Grid"
FilterByAdvanceLevel="true" UseSelectionManager="true">
<InstancedAttributes>
<Att Type="createUniformGrid"/>
</InstancedAttributes>
</View>
</Views>
</SMTK_AttributeResource>
......@@ -6,7 +6,10 @@
<BriefDescription>
Edit a simulation domain that is a uniform grid
</BriefDescription>
<AssociationsDef Name="input" Label="Input" NumberOfRequiredValues="0" MaximumNumberOfValues="1" Extensible="true">
<AssociationsDef Name="input" Label="Input"
NumberOfRequiredValues="0"
MaximumNumberOfValues="1" Extensible="true"
AdvanceLevel="1">
<Accepts>
<!-- We create a new volume if a model is provided or
edit an existing volume if a volume is provided. -->
......
......@@ -12,7 +12,8 @@
<!-- A polygon model can be created within an existing
resource (or an existing resource's session) if one is
provided. Otherwise, a new resource is created -->
<AssociationsDef NumberOfRequiredValues="0" Extensible="true" MaxNumberOfValues="1">
<AssociationsDef NumberOfRequiredValues="0" Extensible="true"
MaxNumberOfValues="1" AdvanceLevel="1">
<Accepts><Resource Name="smtk::session::polygon::Resource" Filter="model"/></Accepts>
</AssociationsDef>
......@@ -172,4 +173,14 @@
</ItemDefinitions>
</AttDef>
</Definitions>
<Views>
<View Type="Operation" Title="Model - Create"
FilterByAdvanceLevel="true" UseSelectionManager="true">
<InstancedAttributes>
<Att Type="create model"/>
</InstancedAttributes>
</View>
</Views>
</SMTK_AttributeResource>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment