[Paraview] Showing FileName property on the GUI

Takuya OSHIMA oshima at eng.niigata-u.ac.jp
Tue Sep 7 22:18:23 EDT 2010


Hi,

Before a commit on yesterday

commit 35f842cbf94964f567158fa5ebfde62249c354f0
Author: Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
Date:   Tue Sep 7 09:41:35 2010 -0400

    Adding support for a hint to specify the default "FileName" property.

the show hint to FileName property had been respected, i.e. if I write
in the SM-XML
  <Hints>
    <Property name="FileName" show="1"/>
  </Hints>
the property appeared on the GUI reader panel even if it was the first
file property (and I could see that there had been an explicit logic
to check propertiesToShow). However after the commit it is no longer
effective. Can the previous behavior be retrieved, by e. g. the
following modification?

Takuya

Takuya OSHIMA, Ph.D.
Faculty of Engineering, Niigata University
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN

diff --git a/Qt/Components/pqNamedWidgets.cxx b/Qt/Components/pqNamedWidgets.cxx
index 12c53d1..7fb0f6c 100644
--- a/Qt/Components/pqNamedWidgets.cxx
+++ b/Qt/Components/pqNamedWidgets.cxx
@@ -699,13 +699,6 @@ static void processHints(QGridLayout* panelLayout,
     propertiesToHide.push_back(pname);
     }
 
-  // Skip the filename property.
-  QString filenameProperty = pqObjectBuilder::getFileNamePropertyName(smProxy);
-  if (!filenameProperty.isEmpty())
-    {
-    propertiesToHide.push_back(filenameProperty);
-    }
-
   // Get the hints for this proxy.
   // The hints may contain stuff about property groupping/layout
   // etc etc.
@@ -855,6 +848,14 @@ void pqNamedWidgets::createWidgets(QGridLayout* panelLayout, vtkSMProxy* pxy)
   QStringList propertiesToHide;
   QStringList propertiesToShow;
   processHints(panelLayout, pxy, propertiesToHide, propertiesToShow);
+
+  // Skip the filename property if it is not a property to show.
+  QString filenameProperty = pqObjectBuilder::getFileNamePropertyName(pxy);
+  if (!filenameProperty.isEmpty() && !propertiesToShow.contains(filenameProperty))
+    {
+    propertiesToHide.push_back(filenameProperty);
+    }
+
   rowCount = panelLayout->rowCount();
   for(iter->Begin(); !iter->IsAtEnd(); iter->Next())
     {


More information about the ParaView mailing list