Changeset 714
- Timestamp:
- 07/27/07 02:18:48 (1 year ago)
- Files:
-
- other/dps/trunk/dsss.conf (modified) (1 diff)
- other/dps/trunk/dsssps/components.d (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
other/dps/trunk/dsss.conf
r704 r714 3 3 [dsssps/dps.d] 4 4 target=dps 5 other/dps/trunk/dsssps/components.d
r712 r714 15 15 import dsssps.prefs; 16 16 import dsssps.process; 17 import dsssps.sconf; 17 18 18 19 class Component : wxTreeItemData { … … 70 71 "dsss distclean" ~ buildName); 71 72 dpsApp.aui.Update(); 73 } 74 } 75 76 /// A template set of functions for sections 77 template TCompSect() { 78 char[] sectName; 79 80 /// Menu and setup for sections 81 void sectMenu(char[] ssn, wxMenu topMenu) 82 { 83 sectName = ssn.dup; 84 85 topMenu.Append(++floatingIds, "Move Up"); 86 dpsApp.EVT_MENU(floatingIds, &OnMoveUp); 87 88 topMenu.Append(++floatingIds, "Move Down"); 89 dpsApp.EVT_MENU(floatingIds, &OnMoveDown); 90 } 91 92 /// Move this section up 93 void OnMoveUp(Object s, wxEvent e) 94 { 95 DSSSConfS dcs = readDSSSConfSimple("dsss.conf"); 96 int i; 97 for (i = 0; 98 i < dcs.sections.length && 99 dcs.sections[i] != sectName; 100 i++) {} 101 if (i == 0 || i == dcs.sections.length) return; 102 103 char[][] newS = 104 dcs.sections[0..(i-1)] ~ 105 [sectName] ~ 106 dcs.sections[(i-1)..i] ~ 107 dcs.sections[(i+1)..$]; 108 dcs.sections = newS; 109 110 writeDSSSConfSimple("dsss.conf", dcs); 111 dpsApp.loadTopDSSSConf(); 112 } 113 114 /// Move this section down 115 void OnMoveDown(Object s, wxEvent e) 116 { 117 DSSSConfS dcs = readDSSSConfSimple("dsss.conf"); 118 int i; 119 for (i = 0; 120 i < dcs.sections.length && 121 dcs.sections[i] != sectName; 122 i++) {} 123 if (i >= dcs.sections.length - 1) return; 124 125 char[][] newS = 126 dcs.sections[0..i] ~ 127 dcs.sections[(i+1)..(i+2)] ~ 128 [sectName] ~ 129 dcs.sections[(i+2)..$]; 130 dcs.sections = newS; 131 132 writeDSSSConfSimple("dsss.conf", dcs); 133 dpsApp.loadTopDSSSConf(); 72 134 } 73 135 } … … 102 164 103 165 mixin TCompBuild; 166 mixin TCompSect; 104 167 105 168 override void popupMenu(wxTreeCtrl tree, wxEvent e) … … 108 171 wxMenu topMenu = new wxMenu(); 109 172 110 // Set up the build options173 // Set up the menus 111 174 buildMenu(" " ~ name, topMenu); 175 sectMenu(name, topMenu); 112 176 113 177 // And display it … … 124 188 125 189 mixin TCompBuild; 190 mixin TCompSect; 126 191 127 192 override void popupMenu(wxTreeCtrl tree, wxEvent e) … … 130 195 wxMenu topMenu = new wxMenu(); 131 196 132 // Set up the build options197 // Set up the menus 133 198 buildMenu(" " ~ name, topMenu); 199 sectMenu(name, topMenu); 134 200 135 201 // And display it … … 305 371 char[] origdir = FileSystem.getDirectory(); 306 372 try { 307 Cout("DIR: ")(name).newline;308 373 FileSystem.setDirectory(name); 309 Cout("DPS: ")(dpsBinPath).newline;310 374 (new Process(dpsBinPath, Environment.get())).execute(); 311 375 } catch (Exception e) {} // ignore failures (FIXME)
