Changeset 704
- Timestamp:
- 07/25/07 11:37:05 (1 year ago)
- Files:
-
- other/dps/trunk/dsss.conf (modified) (1 diff)
- other/dps/trunk/dsssps/components.d (modified) (3 diffs)
- other/dps/trunk/dsssps/dps.d (modified) (4 diffs)
- other/dps/trunk/dsssps/prefs.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
other/dps/trunk/dsss.conf
r700 r704 3 3 [dsssps/dps.d] 4 4 target=dps 5 6 [foo]other/dps/trunk/dsssps/components.d
r703 r704 1 1 module dsssps.components; 2 2 3 import tango.io.Console; 3 4 import tango.io.File; 5 import tango.io.FileSystem; 4 6 5 7 import tango.sys.Environment; … … 127 129 } 128 130 131 /// Top component 129 132 class CompTop : Component { 130 133 override void popupMenu(wxTreeCtrl tree, wxEvent e) … … 177 180 } 178 181 } 182 183 /// Component for subdirectories, can build or open as a project 184 class CompSubdir : Component { 185 this(char[] name) 186 { 187 this.name = name.dup; 188 } 189 190 char[] fname() 191 { 192 return name.dup; 193 } 194 195 override void popupMenu(wxTreeCtrl tree, wxEvent e) 196 { 197 // Create a menu on-the-fly with "build" and "edit dsss.conf" 198 wxMenu topMenu = new wxMenu(); 199 200 topMenu.Append(++floatingIds, "Build"); 201 dpsApp.EVT_MENU(floatingIds, &OnBuild); 202 203 topMenu.Append(++floatingIds, "Build Verbose"); 204 dpsApp.EVT_MENU(floatingIds, &OnBuildVerbose); 205 206 topMenu.Append(++floatingIds, "Clean"); 207 dpsApp.EVT_MENU(floatingIds, &OnClean); 208 209 topMenu.Append(++floatingIds, "Open as project"); 210 dpsApp.EVT_MENU(floatingIds, &OnOpen); 211 212 // Then display it 213 tree.PopupMenu(topMenu, (cast(wxTreeEvent) e).point); 214 } 215 216 /// Callback for building 217 void OnBuild(Object s, wxEvent e) 218 { 219 // FIXME 220 (new DPSProcessWindow("dsss build " ~ name)).Show(true); 221 } 222 223 /// Callback for building verbose 224 void OnBuildVerbose(Object s, wxEvent e) 225 { 226 // FIXME 227 (new DPSProcessWindow("dsss build -v " ~ name)).Show(true); 228 } 229 230 /// Callback for cleaning 231 void OnClean(Object s, wxEvent e) 232 { 233 // FIXME 234 (new DPSProcessWindow("dsss distclean " ~ name)).Show(true); 235 } 236 237 /// Callback for opening 238 void OnOpen(Object s, wxEvent e) 239 { 240 // chdir to it, then run DPS 241 char[] origdir = FileSystem.getDirectory(); 242 try { 243 Cout("DIR: ")(name).newline; 244 FileSystem.setDirectory(name); 245 Cout("DPS: ")(dpsBinPath).newline; 246 (new Process(dpsBinPath, Environment.get())).execute(); 247 } catch (Exception e) {} // ignore failures (FIXME) 248 FileSystem.setDirectory(origdir); 249 } 250 251 private: 252 char[] name; 253 } other/dps/trunk/dsssps/dps.d
r702 r704 25 25 import dsssps.components; 26 26 import dsssps.prefs; 27 28 char[] binPath;29 27 30 28 /** … … 78 76 // recurse to load the subdir 79 77 comp = tree.AppendItem(top, 80 sect ~ " [subdir]", 0); 81 82 char[] origwd = FileSystem.getDirectory(); 83 try { 84 FileSystem.setDirectory(sect); 85 DSSSConf sdconf = readConfig([]); 86 loadDSSSConf(tree, comp, sdconf); 87 } catch (Exception e) { 88 // failures ignored, will just be a smaller tree 89 } 90 FileSystem.setDirectory(origwd); 78 sect ~ " [subdir]", 0, -1, new CompSubdir(sect)); 91 79 92 80 } else if (conf.settings[sect]["type"] == "binary") { … … 171 159 // get some images for the tree 172 160 wxImageList il = new wxImageList(); 173 il.Add(new wxBitmap( binPath~ "/folder.png", BitmapType.wxBITMAP_TYPE_PNG));174 il.Add(new wxBitmap( binPath~ "/text-x-generic.png", BitmapType.wxBITMAP_TYPE_PNG));161 il.Add(new wxBitmap(dpsBinDir ~ "/folder.png", BitmapType.wxBITMAP_TYPE_PNG)); 162 il.Add(new wxBitmap(dpsBinDir ~ "/text-x-generic.png", BitmapType.wxBITMAP_TYPE_PNG)); 175 163 176 164 // now set up the tree … … 239 227 int main(char[][] args) 240 228 { 241 binPath = Environment.exePath(args[0]).path();242 229 loadPrefs(args[0]); 243 230 dpsApp = new DPSApp(); other/dps/trunk/dsssps/prefs.d
r700 r704 2 2 3 3 import tango.io.FileConst; 4 import tango.io.FilePath; 4 5 5 6 import tango.sys.Environment; … … 8 9 9 10 char[] prefFile = ".dpsrc"; 11 12 /// The path to DPS itself 13 char[] dpsBinPath; 14 15 /// And the directory in which DPS resides 16 char[] dpsBinDir; 10 17 11 18 /// DSSS directory … … 25 32 { 26 33 char[] defDir; 34 35 FilePath dbp = Environment.exePath(argvz); 36 dpsBinPath = dbp.toUtf8().dup; 37 dpsBinDir = dbp.path().dup; 27 38 28 39 // figure out the proper preference file
