3 import "ExplorerWindow"
17 DummyFileSystemCacheWindow dw;// { size = { 200, 200 } };
20 class Explorer : GuiApplication
26 int c, argc = this.argc;
27 int openArgsStartAt = 0;
28 QuickPathTool searchPath { };
29 char * findWhat = null;
30 Array<String> comparedPaths = null;
32 SetLoggingMode(debug, null);
34 for(c = 1; c < argc; c++)
36 if(!strcmp(argv[c], "#"))
45 if(!strcmpi(argv[1], "go") && argc > 2)
47 else if(!strcmpi(argv[1], "find") && argc > 2)
50 if(argv[2][0] == '\"')
51 StripQuotes(argv[2], unquoted);
54 findWhat = CopyString(unquoted);
57 if(!strcmpi(argv[3], "in") && argc > 4)
60 searchPath = ""; // this should make it current dir
63 searchPath = ""; // same
65 else if(!strcmpi(argv[1], "search") && argc > 2)
67 else if(!strcmpi(argv[1], "compare") && argc > 2)
69 QuickPathTool goPath { };
73 goPath = ""; // current dir
74 comparedPaths.Add(goPath);
76 for(c = 2; c < argc; c++)
82 comparedPaths.Add(CopyString(s));
84 if(comparedPaths.count < 2)
85 PrintLn("compare requires at least 2 existing directories to work.");
87 else if(!strcmpi(argv[1], "image") && argc > 2)
89 else if(!strcmpi(argv[1], "slides") && argc > 2)
99 QuickPathTool goPath { };
100 for(c = openArgsStartAt; c < argc; c++)
102 goPath = openArgsStartAt == -1 ? "" : argv[c];
105 ExplorerWindow explorerWnd { };
106 explorerWnd.Create();
107 explorerWnd.location = goPath;//explorerWnd.GoTo(goPath, false, false);
113 ExplorerWindow explorerWnd { };
114 explorerWnd.Create();
115 //explorerWnd.SearchLocation(searchPath);
117 else if(comparedPaths && comparedPaths.count > 1)
119 // compare /s1/library/dummies /s1/library/movies /s1/oldlib/movies "/home/redj/.gvfs/d02-2tb on kimji/library/movies"
120 ExplorerWindow explorerWnd { };
121 explorerWnd.Create();
122 explorerWnd.view.columnsCompareStyle = true;
123 explorerWnd.comparedLocations = comparedPaths;
124 // delete comparedPaths;
132 char path[MAX_LOCATION];
139 GetWorkingDir(path, MAX_LOCATION);
141 StripQuotes(value, unquoted);
144 PathCat(path, unquoted);
145 if(!FileExists(path))
147 // this incomplete functionality is not quite at it's place in this class
149 char * original = CopyString(path);
150 while((len = strlen(path)))
152 StripLastDirectory(path, path);
155 // TODO: message location does not exist,
156 // this higher location exists though
163 // TODO: message location does not exist,
164 // unable to select alternate location
170 get { return path[0] ? (char*)path : null; }
172 property bool { get { return path[0] != '\0'; } }
175 define app = ((Explorer)__thisModule);