Changeset 11478 for trunk

Show
Ignore:
Timestamp:
10/06/08 17:23:40 (3 months ago)
Author:
juruen@…
Message:

get ready for 0.1.1

Location:
trunk/extra/moddev
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/extra/moddev/configure.ac

    r11472 r11478  
    1 AC_INIT([emoddev], [0.1]) 
     1AC_INIT([emoddev], [0.1.1]) 
    22 
    33AC_CONFIG_AUX_DIR([config]) 
  • trunk/extra/moddev/src/ebox-moddev-model.in

    r11476 r11478  
    1919sub types 
    2020{ 
    21     return qw/Text Int Boolean Port HostIP IPAddress/; 
     21    return qw/Text Int Boolean Port HostIP IPAddress Select/; 
    2222} 
    2323 
     
    166166              modelDomain => $options->{mainClass}, 
    167167              fields    => $options->{parsedFields}, 
     168              modelType => $options->{model} 
    168169              )); 
    169170    write_file("$dir/$mainClass", ${$output}); 
     
    182183    for my $model (@{_models($dir)}) { 
    183184        $code .= ' ' x 8; 
     185        $model =~ s/\.pm//; 
    184186        $code .= "'EBox::${mainClass}::Model::$model',\n"; 
    185187    } 
     
    209211} 
    210212 
     213sub _runAutogen 
     214{ 
     215    if (-e 'autogen.sh') { 
     216        system('./autogen.sh'); 
     217    } else { 
     218        print STDERR " You will have to manually run autogen.sh within your module directory"; 
     219    } 
     220} 
     221 
    211222sub _createModel 
    212223{ 
     
    223234   _makefile($interp, \$output, $options); 
    224235   _addModelsToMainClass($interp, \$output, $options); 
    225  
     236   _runAutogen(); 
    226237} 
    227238 
  • trunk/extra/moddev/stubs/src/Model/FormModel.pm.mas

    r11476 r11478  
    5454} 
    5555 
     56% for my $field (@fields) { 
     57%   if ($field->{type} eq 'Select') { 
     58# Method: populate_<% $field->{name} %> 
     59# 
     60#   Callback function to fill out the values that can 
     61#   be picked from the <EBox::Types::Select> field <% $field->{name} %> 
     62# 
     63# Returns: 
     64#    
     65#   Array ref of hash refs containing: 
     66#     
     67# 
     68sub populate_<% $field->{name} %> 
     69{ 
     70    return [ { value => 'value1', printableValue => 'value2'}]; 
     71} 
     72%   } 
     73% } 
     74 
    5675sub _table 
    5776{ 
     
    6079    (  
    6180% for my $field (@fields) { 
     81%   if ($field->{type} eq 'Select') { 
     82        new EBox::Types::<% $field->{type} %>( 
     83            'fieldName' => '<% $field->{name} %>', 
     84            'printableName' => __('<% $field->{name} %>'), 
     85            'populate' => \&populate_<% $field->{name} %>, 
     86            'unique' => 1, 
     87            'editable' => 1 
     88        ), 
     89%   }   else { 
    6290        new EBox::Types::<% $field->{type} %>( 
    6391            'fieldName' => '<% $field->{name} %>', 
     
    6795            'editable' => 1 
    6896        ), 
     97%   } 
    6998% } 
    7099    );