]> git.mxchange.org Git - flightgear.git/commitdiff
- display of SGPropertyNode flags can now be toggled per <property-list>
authormfranz <mfranz>
Sat, 3 Jun 2006 11:20:19 +0000 (11:20 +0000)
committermfranz <mfranz>
Sat, 3 Jun 2006 11:20:19 +0000 (11:20 +0000)
  widget (Ctrl-click on "." entry), so we don't need a global property
  for this
- s/dotFiles/_dot_files/ for consistency reasons

src/GUI/property_list.cxx
src/GUI/property_list.hxx

index cce5415983579f0c68d1cbb07f8dcc39bdabbf4b..c1f7d29b0198b1792ec0b7fa8fcdadd0c9b0da25 100644 (file)
@@ -104,10 +104,10 @@ PropertyList::PropertyList(int minx, int miny, int maxx, int maxy, SGPropertyNod
     puList(minx, miny, maxx, maxy, short(0), 20),
     GUI_ID(FGCLASS_PROPERTYLIST),
     _curr(start),
-    _flags(fgGetNode("/sim/gui/dialogs/property-browser/show-flags", true)),
     _return(0),
     _entries(0),
-    _num_entries(0)
+    _num_entries(0),
+    _flags(false)
 
 {
     _list_box->setUserData(this);
@@ -147,7 +147,7 @@ void PropertyList::handle_select(puObject *list_box)
     if (selected >= 0 && selected < prop_list->_num_entries) {
         const char *src = prop_list->_entries[selected];
 
-        if (prop_list->dotFiles && (selected < 2)) {
+        if (prop_list->_dot_files && (selected < 2)) {
             if (!strcmp(src, ".")) {
                 if (mod_ctrl)
                     prop_list->toggleFlags();
@@ -169,7 +169,7 @@ void PropertyList::handle_select(puObject *list_box)
 
         // we know we're dealing with a regular entry, so convert
         // it to an index into children[]
-        if (prop_list->dotFiles)
+        if (prop_list->_dot_files)
             selected -= 2;
 
         SGPropertyNode_ptr child = prop_list->_children[selected].node;
@@ -207,7 +207,7 @@ void PropertyList::update(bool restore_pos)
     if (!_curr->getParent()) {
         _entries = new char*[_num_entries + 1];
         pi = 0;
-        dotFiles = false;
+        _dot_files = false;
 
     } else {
         _num_entries += 2;    // for . and ..
@@ -220,7 +220,7 @@ void PropertyList::update(bool restore_pos)
         strcpy(_entries[1], "..");
 
         pi = 2;
-        dotFiles = true;
+        _dot_files = true;
     }
 
     int i;
@@ -271,7 +271,7 @@ void PropertyList::updateTextForEntry(int index)
 
     stdString line = name + " = '" + value + "' (" + type;
 
-    if (_flags->getBoolValue()) {
+    if (_flags) {
         stdString ext;
         if (!node->getAttribute(SGPropertyNode::READ))
             ext += 'r';
@@ -296,7 +296,7 @@ void PropertyList::updateTextForEntry(int index)
     if (line.size() >= PUSTRING_MAX)
         line.resize(PUSTRING_MAX - 1);
 
-    if (dotFiles)
+    if (_dot_files)
         index += 2;
 
     delete[] _entries[index];
index 56c61881ea3122538773cd9c8e8000254093bd1c..b7b522debff33aedd10a86621745b19b46f9d380 100644 (file)
@@ -39,7 +39,7 @@ public:
     void setCurrent(SGPropertyNode *p);
     SGPropertyNode *getCurrent() const { return _curr; }
     void publish(SGPropertyNode *p) { _return = p; invokeCallback(); }
-    void toggleFlags() { _flags->setBoolValue(!_flags->getBoolValue()); }
+    void toggleFlags() { _flags = !_flags; }
 
     // overridden plib pui methods
     virtual char *getListStringValue() { return (char *)(_return ? _return->getPath(true) : ""); }
@@ -60,7 +60,6 @@ private:
     static int nodeNameCompare(const void *, const void *);
 
     SGPropertyNode_ptr _curr;
-    SGPropertyNode_ptr _flags;
     SGPropertyNode_ptr _return;
 
     char **_entries;
@@ -81,7 +80,8 @@ private:
     NodeData *_children;
     int _num_children;
 
-    bool dotFiles;      // . and .. pseudo-dirs currently shown?
+    bool _dot_files;      // . and .. pseudo-dirs currently shown?
+    bool _flags;          // show SGPropertyNode flags
 };