Changeset 703

Show
Ignore:
Timestamp:
07/25/07 03:10:09 (1 year ago)
Author:
Gregor
Message:

Fleshed out "new file" dialog.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • other/dps/trunk/dsssps/components.d

    r702 r703  
    11module dsssps.components; 
    22 
    3 import tango.io.Console; 
    43import tango.io.File; 
    54 
     
    9998 
    10099        // now edit it 
     100        dpsApp.loadTopDSSSConf(); 
    101101        super.activate(tree, e); 
    102102    } 
  • other/dps/trunk/dsssps/newfile.d

    r702 r703  
    11module dsssps.newfile; 
    22 
    3 import tango.io.Console; 
     3import tango.io.File; 
    44 
    55import wx.wx; 
     
    3030    void OnCreate(Object s, wxEvent e) 
    3131    { 
    32         Cout("Create ")(tctl.Value()).newline; 
     32        char[] name = tctl.Value().dup; 
     33 
     34        // generate the module name 
     35        char[] mod = name.dup; 
     36        foreach (i, c; mod) { 
     37            if (c == '/') { 
     38                mod[i] = '.'; 
     39            } else if (c == '.') { 
     40                // end 
     41                mod = mod[0..i]; 
     42                break; 
     43            } 
     44        } 
     45 
     46        // then fill out the basic file 
     47        (new File(name)).write("module " ~ mod ~ ";\n"); 
     48 
     49        // now edit it 
     50        dpsApp.loadTopDSSSConf(); 
     51        (new DPSProcessRun(editor ~ " " ~ name, &(dpsApp.loadTopDSSSConf))).Show(false); 
     52 
     53        // and get rid of this window 
    3354        Destroy(); 
    3455    }