X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=ede;a=blobdiff_plain;f=explorer%2Fsrc%2FExplorerWindow.ec;h=c5573728b79bcfc7a02b460f24753cea346d43fc;hp=a2968e9adc0f77f2cdbb459f6a8d79e0c620c49b;hb=6873f3a9950231d117b4ba693783e015f1abe7c5;hpb=24b868250f4615a32c8c92ab337f5867523d12c9 diff --git a/explorer/src/ExplorerWindow.ec b/explorer/src/ExplorerWindow.ec index a2968e9..c557372 100644 --- a/explorer/src/ExplorerWindow.ec +++ b/explorer/src/ExplorerWindow.ec @@ -129,7 +129,7 @@ class ExplorerWindow : Window { char * home = getenv("HOME"); if(home && home[0] && FileExists(home).isDirectory) - view.path = home; + GoToLocation(home, false, false); break; } case goUp: @@ -142,7 +142,7 @@ class ExplorerWindow : Window newPath[0] = '/'; newPath[1] = 0; } - view.path = newPath; + GoToLocation(newPath, false, false); delete newPath; break; } @@ -234,7 +234,7 @@ class ExplorerWindow : Window bool NotifyModified(PathBox pathBox) { - view.path = pathBox.path; + GoToLocation(pathBox.path, false, false); return true; } }; @@ -326,7 +326,7 @@ class ExplorerWindow : Window { char p[MAX_LOCATION]; node.GetPath(p); - view.path = node.path; + GoToLocation(node.path, false, true); return true; } }; @@ -472,34 +472,13 @@ class ExplorerWindow : Window lastViewId = viewId; }*/ - /*void GoToLocation(char * location) + void GoToLocation(char * location, bool viewIsAtLocation, bool treeIsAtLocation) { - int c; - char * temp; - char step[MAX_LOCATION]; - - StringArray steps { growingFactor = 4 }; - ExplorerFileBranch last = null; - - temp = CopyString(location); - while(strlen(temp)) - { - GetLastDirectory(temp, step); - StripLastDirectory(temp, temp); - steps.Add(CopyString(step)); - } - - for(c = steps._count - 1; c >= 0; c--) - { - last = tree.Find(steps._[c], last); - if(!last) - break; - tree.Select(last); - } - - delete temp; - delete steps; - }*/ + if(!viewIsAtLocation) + view.path = location; + if(tree.visible && !treeIsAtLocation) + tree.SelectLocation(location); + } /*void SearchLocation(char * location) {