« lib/App/SeismicUnixGui/misc/conditions4flows.pm
↑ Summary
lib/App/SeismicUnixGui/configs/big_streams/Project_config.pm »
| 1 | package App::SeismicUnixGui::misc::project_selector; | ||
| 2 | |||
| 3 | =head1 DOCUMENTATION | ||
| 4 | |||
| 5 | |||
| 6 | =head2 SYNOPSIS | ||
| 7 | |||
| 8 | PERL PERL PROGRAM NAME: project_selector | ||
| 9 | AUTHOR: Juan Lorenzo | ||
| 10 | DATE: May 3, 2018 | ||
| 11 | VERSION: 1.0.1 | ||
| 12 | |||
| 13 | DESCRIPTION Package containing methods | ||
| 14 | and objects for managing the | ||
| 15 | project on which user works | ||
| 16 | |||
| 17 | |||
| 18 | BASED ON: | ||
| 19 | |||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | =head2 USE | ||
| 24 | |||
| 25 | =head3 NOTES | ||
| 26 | |||
| 27 | =head4 Examples | ||
| 28 | |||
| 29 | =head3 | ||
| 30 | |||
| 31 | =head2 CHANGES and their DATES | ||
| 32 | |||
| 33 | =cut | ||
| 34 | |||
| 35 | use Moose; | ||
| 36 | our $VERSION = '1.0.1'; | ||
| 37 | use Tk; | ||
| 38 | |||
| 39 | use aliased 'App::SeismicUnixGui::misc::param_widgets'; | ||
| 40 | use aliased 'App::SeismicUnixGui::misc::L_SU_local_user_constants'; | ||
| 41 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 42 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 43 | use aliased 'App::SeismicUnixGui::messages::message_director'; | ||
| 44 | use aliased 'App::SeismicUnixGui::misc::config_superflows'; | ||
| 45 | use aliased 'App::SeismicUnixGui::misc::manage_dirs_by'; | ||
| 46 | |||
| 47 | my $param_widgets = param_widgets->new(); | ||
| 48 | |||
| 49 | =head2 Instantiate | ||
| 50 | new modules | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | my $Project = Project_config->new(); | ||
| 55 | my $user_constants = L_SU_local_user_constants->new(); | ||
| 56 | my $get = L_SU_global_constants->new(); | ||
| 57 | |||
| 58 | my $false = 0; | ||
| 59 | my $true = 1; | ||
| 60 | |||
| 61 | =head2 private hash | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | my $project_selector = { | ||
| 66 | _create_new => $false, | ||
| 67 | _create_new_button_w => '', | ||
| 68 | _active_project => '', | ||
| 69 | _first_idx => 0, | ||
| 70 | _labels_aref => '', | ||
| 71 | _length => '', | ||
| 72 | _labels_w_aref => '', | ||
| 73 | _message_box_w => '', | ||
| 74 | _current_program_name => '', | ||
| 75 | _values_aref => '', | ||
| 76 | _values_w_aref => '', | ||
| 77 | _check_buttons_w_aref => '', | ||
| 78 | _max_index => '', | ||
| 79 | _project_names_aref => '', | ||
| 80 | _PROJECT_HOMES_aref => '', | ||
| 81 | _mw => '', | ||
| 82 | _param_widgets_pkg => '', | ||
| 83 | _widget => '', | ||
| 84 | }; | ||
| 85 | |||
| 86 | =head2 define | ||
| 87 | |||
| 88 | lcoal variables | ||
| 89 | |||
| 90 | =cut | ||
| 91 | |||
| 92 | =head2 sub _continue | ||
| 93 | |||
| 94 | =cut | ||
| 95 | |||
| 96 | sub _continue { | ||
| 97 | my ($self) = @_; | ||
| 98 | |||
| 99 | # print("project_selector, _continue\n"); | ||
| 100 | my $mw = $project_selector->{_mw}; | ||
| 101 | $mw->destroy() if Tk::Exists($mw); | ||
| 102 | exit(1); | ||
| 103 | } | ||
| 104 | |||
| 105 | =head2 sub _cancel | ||
| 106 | |||
| 107 | =cut | ||
| 108 | |||
| 109 | sub _cancel { | ||
| 110 | my ($self) = @_; | ||
| 111 | |||
| 112 | # print("project_selector, _cancel\n"); | ||
| 113 | my $mw = $project_selector->{_mw}; | ||
| 114 | $mw->destroy() if Tk::Exists($mw); | ||
| 115 | exit(1); | ||
| 116 | } | ||
| 117 | |||
| 118 | =head2 sub cancel | ||
| 119 | |||
| 120 | =cut | ||
| 121 | |||
| 122 | sub cancel { | ||
| 123 | my ( $self, $value ) = @_; | ||
| 124 | if ($value) { | ||
| 125 | _cancel(); | ||
| 126 | |||
| 127 | # print("project_select,cancel,value: $value\n"); | ||
| 128 | } | ||
| 129 | else { | ||
| 130 | print("project_select,cancel,error, value: $value\n"); | ||
| 131 | } | ||
| 132 | return (); | ||
| 133 | } | ||
| 134 | |||
| 135 | =head2 sub _create_new | ||
| 136 | |||
| 137 | derives from L_SU.pl | ||
| 138 | The following widget references MUST exist already | ||
| 139 | These references are set in the main that calls this package: | ||
| 140 | |||
| 141 | $project_selector ->set_check_buttons_w_aref($L_SU_project_selector->{_check_buttons_w_aref}); | ||
| 142 | $project_selector ->set_labels_w_aref($L_SU_project_selector->{_labels_w_aref}); | ||
| 143 | $project_selector ->set_values_w_aref($L_SU_project_selector->{_values_w_aref}); | ||
| 144 | |||
| 145 | The current subroutine must set the length, and the first index | ||
| 146 | so it is best to keep it at the end of the package after "set_length and set_fist_index" | ||
| 147 | |||
| 148 | =cut | ||
| 149 | |||
| 150 | sub _create_new { | ||
| 151 | my ($self) = @_; | ||
| 152 | |||
| 153 | my $config_superflows = config_superflows->new(); | ||
| 154 | |||
| 155 | if ( length( $project_selector->{_current_program_name} ) | ||
| 156 | and length( $project_selector->{_param_widgets_pkg} ) ) | ||
| 157 | { | ||
| 158 | |||
| 159 | my $name = $project_selector->{_current_program_name}; | ||
| 160 | my $param_widgets_pkg = $project_selector->{_param_widgets_pkg}; | ||
| 161 | |||
| 162 | # print("project_selector,_create_new, name =$name (is Project by default)\n"); | ||
| 163 | |||
| 164 | =pod private hash | ||
| 165 | |||
| 166 | =cut | ||
| 167 | |||
| 168 | my $message_box_w = _get_message_box_w(); | ||
| 169 | my $message_director = message_director->new(); | ||
| 170 | |||
| 171 | $message_box_w->delete( "1.0", 'end' ); | ||
| 172 | |||
| 173 | my $project = { | ||
| 174 | _prog_name_sref => \$name, | ||
| 175 | _names_aref => '', | ||
| 176 | _values_aref => '', | ||
| 177 | _check_buttons_settings_aref => '', | ||
| 178 | _is_superflow => $true, # needed for param_widgets.pm | ||
| 179 | _superflow_first_idx => '', | ||
| 180 | _superflow_length => '', | ||
| 181 | }; | ||
| 182 | |||
| 183 | _set_length(); | ||
| 184 | _set_first_idx(); | ||
| 185 | |||
| 186 | # first clean the current gui parameter and values in the window | ||
| 187 | my $length = $project_selector->{_length}; | ||
| 188 | $param_widgets_pkg->set_first_idx; | ||
| 189 | $param_widgets_pkg->set_length($length); | ||
| 190 | $param_widgets_pkg->gui_full_clear; | ||
| 191 | |||
| 192 | # get values names and checkbuttons from a | ||
| 193 | # default the Project.config file | ||
| 194 | |||
| 195 | $config_superflows->set_program_name( $project->{_prog_name_sref} ) | ||
| 196 | ; # really sref | ||
| 197 | # parameter names from superflow configuration file | ||
| 198 | $project->{_names_aref} = $config_superflows->get_names(); | ||
| 199 | |||
| 200 | # parameter values from superflow configuration file | ||
| 201 | $project->{_values_aref} = $config_superflows->get_values(); | ||
| 202 | |||
| 203 | # print( | ||
| 204 | # "project_selector,_create_new,values=@{$project->{_values_aref}}\n" | ||
| 205 | # ); | ||
| 206 | |||
| 207 | $project->{_check_buttons_settings_aref} = | ||
| 208 | $config_superflows->get_check_buttons_settings(); | ||
| 209 | |||
| 210 | # print( | ||
| 211 | #"project_selector,_create_new,chkb=@{$project->{_check_buttons_settings_aref}}\n" | ||
| 212 | # ); | ||
| 213 | |||
| 214 | $project->{_superflow_first_idx} = $config_superflows->first_idx(); | ||
| 215 | $project->{_superflow_length} = $config_superflows->length(); | ||
| 216 | |||
| 217 | # assign the new parameter names and values to the widgets in the gui | ||
| 218 | $param_widgets_pkg->range($project); | ||
| 219 | $param_widgets_pkg->set_labels( $project->{_names_aref} ); | ||
| 220 | $param_widgets_pkg->set_values( $project->{_values_aref} ); | ||
| 221 | $param_widgets_pkg->set_check_buttons( | ||
| 222 | $project->{_check_buttons_settings_aref} ); | ||
| 223 | |||
| 224 | # update the length | ||
| 225 | $param_widgets_pkg->set_length( $project->{_superflows_length} ); | ||
| 226 | $param_widgets_pkg->redisplay_labels(); | ||
| 227 | $param_widgets_pkg->redisplay_values(); | ||
| 228 | $param_widgets_pkg->redisplay_check_buttons(); | ||
| 229 | |||
| 230 | } | ||
| 231 | else { | ||
| 232 | print("project_select,_create_new, variables are missing n"); | ||
| 233 | } | ||
| 234 | return (); | ||
| 235 | } | ||
| 236 | |||
| 237 | =head2 sub _get_labels_from_gui | ||
| 238 | |||
| 239 | Extract labels from the user screen | ||
| 240 | The user may have modified the labels | ||
| 241 | TODO not working | ||
| 242 | |||
| 243 | =cut | ||
| 244 | |||
| 245 | sub _get_labels_from_gui { | ||
| 246 | |||
| 247 | my ($self) = @_; | ||
| 248 | my $result = (); | ||
| 249 | |||
| 250 | $project_selector->{_max_index} = $Project->get_max_index(); | ||
| 251 | |||
| 252 | if ( length $project_selector->{_labels_w_aref} | ||
| 253 | and length $project_selector->{_max_index} ) | ||
| 254 | { | ||
| 255 | |||
| 256 | my @labels_w = @{ $project_selector->{_labels_w_aref} }; | ||
| 257 | my $length = $project_selector->{_max_index} + 1; | ||
| 258 | my @labels; | ||
| 259 | |||
| 260 | for ( my $i = 0 ; $i < $length ; $i++ ) { | ||
| 261 | |||
| 262 | $labels[$i] = $labels_w[$i]->get(); | ||
| 263 | } | ||
| 264 | |||
| 265 | print("project_selector, _get_labels_from_gui, @labels\n"); | ||
| 266 | |||
| 267 | if ( scalar @labels ) { # not 0! | ||
| 268 | |||
| 269 | $project_selector->{_labels_aref} = \@labels; | ||
| 270 | $result = $project_selector->{_labels_aref}; | ||
| 271 | |||
| 272 | } | ||
| 273 | else { | ||
| 274 | print("project_selector, _get_labels_from_gui, labels missing\n"); | ||
| 275 | |||
| 276 | } | ||
| 277 | |||
| 278 | } | ||
| 279 | else { | ||
| 280 | print("project_selector, _get_labels_from_gui, missing items\n"); | ||
| 281 | print("label widgets:, $project_selector->{_labels_w_aref}\n"); | ||
| 282 | print("max_index:, $project_selector->{_max_index}\n"); | ||
| 283 | } | ||
| 284 | |||
| 285 | return ($result); | ||
| 286 | } | ||
| 287 | |||
| 288 | =head2 _get_message_box_w | ||
| 289 | |||
| 290 | =cut | ||
| 291 | |||
| 292 | sub _get_message_box_w { | ||
| 293 | my ($self) = @_; | ||
| 294 | |||
| 295 | if ( $project_selector->{_message_box_w} ) { | ||
| 296 | |||
| 297 | return ( $project_selector->{_message_box_w} ); | ||
| 298 | |||
| 299 | } | ||
| 300 | else { | ||
| 301 | print("project_select,_get_message_box_w missing \n"); | ||
| 302 | } | ||
| 303 | |||
| 304 | } | ||
| 305 | |||
| 306 | =head2 sub _get_project_names_aref | ||
| 307 | Find simple Project names rom configuration path for user | ||
| 308 | |||
| 309 | =cut | ||
| 310 | |||
| 311 | sub _get_project_names_aref { | ||
| 312 | |||
| 313 | my ($self) = @_; | ||
| 314 | |||
| 315 | my @ls_ref; | ||
| 316 | my $ls_ref = $user_constants->get_project_names; | ||
| 317 | |||
| 318 | # print("project_selector, project names: @$ls_ref\n"); | ||
| 319 | my $length = scalar @$ls_ref; | ||
| 320 | return ($ls_ref); | ||
| 321 | } | ||
| 322 | |||
| 323 | =head2 sub _get_values_from_gui | ||
| 324 | |||
| 325 | Extract labels from the user screen | ||
| 326 | The user may have modified the labels | ||
| 327 | |||
| 328 | =cut | ||
| 329 | |||
| 330 | sub _get_values_from_gui { | ||
| 331 | |||
| 332 | my ($self) = @_; | ||
| 333 | my $result = (); | ||
| 334 | |||
| 335 | $project_selector->{_max_index} = $Project->get_max_index(); | ||
| 336 | |||
| 337 | if ( length $project_selector->{_values_w_aref} | ||
| 338 | and length $project_selector->{_max_index} ) | ||
| 339 | { | ||
| 340 | |||
| 341 | my @values_w = @{ $project_selector->{_values_w_aref} }; | ||
| 342 | my $length = $project_selector->{_max_index} + 1; | ||
| 343 | my @values; | ||
| 344 | |||
| 345 | for ( my $i = 0 ; $i < $length ; $i++ ) { | ||
| 346 | |||
| 347 | $values[$i] = $values_w[$i]->get(); | ||
| 348 | } | ||
| 349 | |||
| 350 | # print("project_selector, _get_values_from_gui, @values\n"); | ||
| 351 | |||
| 352 | if ( scalar @values ) { # not 0! | ||
| 353 | |||
| 354 | $project_selector->{_values_aref} = \@values; | ||
| 355 | $result = $project_selector->{_values_aref}; | ||
| 356 | |||
| 357 | } | ||
| 358 | else { | ||
| 359 | print("project_selector, _get_values_from_gui, values missing\n"); | ||
| 360 | |||
| 361 | } | ||
| 362 | |||
| 363 | } | ||
| 364 | else { | ||
| 365 | print("project_selector, _get_values_from_gui, missing items\n"); | ||
| 366 | print("label widgets:, $project_selector->{_values_w_aref}\n"); | ||
| 367 | print("max_index:, $project_selector->{_max_index}\n"); | ||
| 368 | } | ||
| 369 | |||
| 370 | return ($result); | ||
| 371 | } | ||
| 372 | |||
| 373 | =head2 sub _ok | ||
| 374 | |||
| 375 | Save a configuration file and a project | ||
| 376 | Create all the directories | ||
| 377 | |||
| 378 | For the case that a project that already exists | ||
| 379 | chosen: | ||
| 380 | |||
| 381 | raise alarm if more than one project is checked | ||
| 382 | overwrite the current project configuration file | ||
| 383 | with the one belonging to the newly selected | ||
| 384 | active project | ||
| 385 | |||
| 386 | For the case that a new project is created: | ||
| 387 | create a new folder: | ||
| 388 | /home/username/configuration/New Project/ | ||
| 389 | and make a copy of the Project.config inside: | ||
| 390 | /home/username/configuration/New Project/Project.config | ||
| 391 | Also copy the Project.config to the active directory as: | ||
| 392 | /home/username/configuration/active/Project.config | ||
| 393 | |||
| 394 | TODO: Run the new configuration file so that the directories | ||
| 395 | are created | ||
| 396 | |||
| 397 | |||
| 398 | =cut | ||
| 399 | |||
| 400 | sub _ok { | ||
| 401 | my ($self) = @_; | ||
| 402 | |||
| 403 | # expect messaging | ||
| 404 | my $message_director = message_director->new(); | ||
| 405 | my $message_box_w = _get_message_box_w(); | ||
| 406 | my $global_libs = $get->global_libs(); | ||
| 407 | my $run_name = $get->var->{_project_selector}; | ||
| 408 | |||
| 409 | # 1. CASES when an existing project is selected | ||
| 410 | # active_project default is true | ||
| 411 | if ( $project_selector->{_active_project} ) { | ||
| 412 | |||
| 413 | # extra security | ||
| 414 | # print( | ||
| 415 | # "CASE 1. project_select,_ok, active project already exists-Good\n"); | ||
| 416 | |||
| 417 | my $param_widgets_pkg = $project_selector->{_param_widgets_pkg}; | ||
| 418 | my $length_check_buttons_on = | ||
| 419 | $param_widgets_pkg->get_length_check_buttons_on(); | ||
| 420 | |||
| 421 | # print( | ||
| 422 | #"project_selector,_ok, length_check_buttons_on: $length_check_buttons_on\n" | ||
| 423 | # ); | ||
| 424 | |||
| 425 | # CASE 1.A More than one button is selected | ||
| 426 | if ( $length_check_buttons_on > 1 ) { # possible mistake by user | ||
| 427 | |||
| 428 | # print( | ||
| 429 | #"CASE 1A: project_selector,_ok, >1 length_check_buttons_on: $length_check_buttons_on\n" | ||
| 430 | # ); | ||
| 431 | # print( | ||
| 432 | #"project_selector,_ok, length_check_buttons_on: $length_check_buttons_on\n" | ||
| 433 | # ); | ||
| 434 | $message_box_w->delete( "1.0", 'end' ); | ||
| 435 | my $message = $message_director->project_selector(0) | ||
| 436 | ; # only one button can be chosen | ||
| 437 | $message_box_w->insert( 'end', $message ); | ||
| 438 | |||
| 439 | } | ||
| 440 | |||
| 441 | # CASE 1.B no buttons are selected ('on') | ||
| 442 | elsif ( $length_check_buttons_on == 0 ) | ||
| 443 | { # implies that no projects exist | ||
| 444 | |||
| 445 | my $list_ref = $user_constants->get_project_names(); | ||
| 446 | my $length = scalar @$list_ref; | ||
| 447 | |||
| 448 | if ( $length == 0 ) { | ||
| 449 | |||
| 450 | # i.e. no project names exist is confirmed | ||
| 451 | # print( | ||
| 452 | #"CASE 1.B :project_selector,_ok, length_project names $length\n" | ||
| 453 | # ); | ||
| 454 | |||
| 455 | $message_box_w->delete( "1.0", 'end' ); | ||
| 456 | my $message = $message_director->project_selector(2); | ||
| 457 | ; # Create New or select old project | ||
| 458 | $message_box_w->insert( 'end', $message ); | ||
| 459 | |||
| 460 | } | ||
| 461 | } | ||
| 462 | |||
| 463 | # CASE 1.C an existing project is chosen | ||
| 464 | elsif ( $length_check_buttons_on == 1 ) { | ||
| 465 | |||
| 466 | # print( | ||
| 467 | # "CASE 1.C: project_selector,_ok, length_check_buttons_on: $length_check_buttons_on\n" | ||
| 468 | # ); | ||
| 469 | use File::Copy; | ||
| 470 | my $CONFIGURATION = $user_constants->get_CONFIGURATION; | ||
| 471 | my $ACTIVE_PROJECT = $user_constants->get_ACTIVE_PROJECT; | ||
| 472 | my $active_indices_aref = | ||
| 473 | $param_widgets_pkg->get_index_check_buttons_on(); | ||
| 474 | |||
| 475 | # # print(" project_selector,_ok,active_index: @$active_indices_aref\n"); | ||
| 476 | |||
| 477 | my @active_indices = @$active_indices_aref; | ||
| 478 | my $active_index = $active_indices[0]; | ||
| 479 | |||
| 480 | # print(" project_selector,_ok,active_index: $active_index\n"); | ||
| 481 | # print(" project_selector,_ok,message widget: $message_box_w\n"); | ||
| 482 | |||
| 483 | # get the label of the active index | ||
| 484 | my @labels = @{ $param_widgets_pkg->get_labels_aref() }; | ||
| 485 | my $new_active_Project_name = $labels[$active_index]; | ||
| 486 | |||
| 487 | # print(" project_selector,_ok,active label/project name is: $labels[$active_index]\n"); | ||
| 488 | |||
| 489 | # copy the .Project.config file to the active directory | ||
| 490 | my $from = | ||
| 491 | $CONFIGURATION . '/' | ||
| 492 | . $new_active_Project_name | ||
| 493 | . '/Project.config'; | ||
| 494 | my $to = $ACTIVE_PROJECT . '/Project.config'; | ||
| 495 | |||
| 496 | copy( $from, $to ); | ||
| 497 | |||
| 498 | # Instruction to create the new directories runs in system | ||
| 499 | # print("project_selector,_ok,create new Project and its directories \n"); | ||
| 500 | # print("project_selector,_ok,copy FROM:$from TO:$to \n"); | ||
| 501 | |||
| 502 | # print("project_selector,_ok, sh $global_libs->{_script}$run_name \n"); | ||
| 503 | # system("sh $global_libs->{_script}$run_name"); | ||
| 504 | |||
| 505 | # print("project_selector,_ok,copying new active project configuration file \n FROM:$from TO:$to"); | ||
| 506 | # kill LSU_project_selector exit with 1 | ||
| 507 | _continue(); | ||
| 508 | |||
| 509 | } | ||
| 510 | else { | ||
| 511 | print( | ||
| 512 | "project_selector,_ok,length_check_buttons_on, unexpected $length_check_buttons_on\n" | ||
| 513 | ); | ||
| 514 | } | ||
| 515 | } | ||
| 516 | |||
| 517 | # CASES 2 and 3 for NEWLY created Project Configuration File and New Project | ||
| 518 | elsif ( $project_selector->{_create_new} ) { | ||
| 519 | |||
| 520 | use File::Copy; | ||
| 521 | |||
| 522 | # print("CASES 2 A,B,C project_select,_ok, New project creation \n"); | ||
| 523 | |||
| 524 | # save the new .Project configure to | ||
| 525 | # /home/username/configuration/active | ||
| 526 | |||
| 527 | my $config_superflows = config_superflows->new(); | ||
| 528 | my $param_widgets_pkg = $project_selector->{_param_widgets_pkg}; | ||
| 529 | |||
| 530 | my $project = { | ||
| 531 | _names_aref => '', | ||
| 532 | _values_aref => '', | ||
| 533 | _check_buttons_aref => '', | ||
| 534 | _prog_name_sref => '', | ||
| 535 | }; | ||
| 536 | |||
| 537 | # from an existant project, default or active | ||
| 538 | $project->{_names_aref} = $param_widgets_pkg->get_labels_aref(); | ||
| 539 | $project->{_values_aref} = $param_widgets_pkg->get_values_aref(); | ||
| 540 | |||
| 541 | my $default_name = $project_selector->{_current_program_name}; | ||
| 542 | $project->{_prog_name_sref} = \$default_name; | ||
| 543 | |||
| 544 | # get a possible new project name defined by the user | ||
| 545 | # TODO, next line not working | ||
| 546 | # my $labels_aref = _get_labels_from_gui(); | ||
| 547 | |||
| 548 | my $values_aref = _get_values_from_gui(); | ||
| 549 | $project->{_values_aref} = $values_aref; | ||
| 550 | |||
| 551 | # get the new project name to create, from the GUI | ||
| 552 | my @values = @$values_aref; | ||
| 553 | my $pathNProject = $values[1]; | ||
| 554 | my @parts = split( '/', $pathNProject ); | ||
| 555 | my $new_project_name = $parts[3]; | ||
| 556 | |||
| 557 | # print("project_selector,_ok, pathNProject=$pathNProject\n"); | ||
| 558 | # print("project_selector,_ok, labels @{$project->{_labels_aref}}\n"); | ||
| 559 | # print("project_selector,_ok, values @{$project->{_values_aref}}\n"); | ||
| 560 | |||
| 561 | # saves the configuration file ONLY to | ||
| 562 | # ./L_SU/configuration/active/Project.config | ||
| 563 | $config_superflows->save($project); | ||
| 564 | |||
| 565 | # only after previous save | ||
| 566 | my $active_project_name = $user_constants->get_active_project_name(); | ||
| 567 | |||
| 568 | # print( | ||
| 569 | # "project_selector,_ok, active_project_name $active_project_name \n" | ||
| 570 | # ); | ||
| 571 | my $CONFIGURATION = $user_constants->get_CONFIGURATION(); | ||
| 572 | my $DEFAULT_PROJECT = $CONFIGURATION . '/' . $active_project_name; | ||
| 573 | my $ACTIVE_PROJECT = $user_constants->get_ACTIVE_PROJECT(); | ||
| 574 | |||
| 575 | # creates new directory plus its own configuration file | ||
| 576 | # make sure project does not already exist | ||
| 577 | $user_constants->set_PROJECT_name($active_project_name); | ||
| 578 | my $DEFAULT_PROJECT_exists = $user_constants->get_PROJECT_exists(); | ||
| 579 | |||
| 580 | if ( not $DEFAULT_PROJECT_exists ) { | ||
| 581 | |||
| 582 | # CASE 2.A First-time creation of | ||
| 583 | # a project for user. | ||
| 584 | # No prior projects exist | ||
| 585 | # if new project does not already exist | ||
| 586 | # it is ok to create a new configuration directory and | ||
| 587 | # file for the new project | ||
| 588 | |||
| 589 | manage_dirs_by->make_dir($DEFAULT_PROJECT); | ||
| 590 | |||
| 591 | # update active project to lates changed Entry widget values in the project_selector GUI | ||
| 592 | my $FROM_project_config = | ||
| 593 | $ACTIVE_PROJECT . '/' . $default_name . '.config'; | ||
| 594 | $user_constants->set_user_configuration_Project_config(); | ||
| 595 | |||
| 596 | my $TO_project_config = | ||
| 597 | $DEFAULT_PROJECT . '/' . $default_name . '.config'; | ||
| 598 | |||
| 599 | # print( | ||
| 600 | #"project_selector,_ok, CASE 2A of new project copying from $FROM_project_config to $TO_project_config\n" | ||
| 601 | # ); | ||
| 602 | copy( $FROM_project_config, $TO_project_config ); | ||
| 603 | |||
| 604 | # Instruction to create the new directories runs in system | ||
| 605 | # print("project_selector,_ok,create new Project and its directories \n"); | ||
| 606 | system("sh $global_libs->{_script}$run_name"); | ||
| 607 | |||
| 608 | # kill windows but exit with 1 | ||
| 609 | _continue(); | ||
| 610 | |||
| 611 | } | ||
| 612 | elsif ( $DEFAULT_PROJECT_exists | ||
| 613 | and $project->{_prog_name_sref} ne $new_project_name ) | ||
| 614 | { | ||
| 615 | |||
| 616 | # But old default project.config exists | ||
| 617 | manage_dirs_by->make_dir($DEFAULT_PROJECT); | ||
| 618 | |||
| 619 | # Also update active project to latest | ||
| 620 | # changed Entry widget values in the project_selector GUI | ||
| 621 | |||
| 622 | my $FROM_project_config = | ||
| 623 | $ACTIVE_PROJECT . '/' . $default_name . '.config'; | ||
| 624 | $user_constants->set_user_configuration_Project_config(); | ||
| 625 | |||
| 626 | # Note the new project name | ||
| 627 | my $TO_project_config = | ||
| 628 | $DEFAULT_PROJECT . '/' . $new_project_name . '.config'; | ||
| 629 | |||
| 630 | # print( | ||
| 631 | #"project_selector,_ok, CASE 2B of new project copying from $FROM_project_config to $TO_project_config\n" | ||
| 632 | # ); | ||
| 633 | copy( $FROM_project_config, $TO_project_config ); | ||
| 634 | |||
| 635 | # Instruction to create the new directories runs in system | ||
| 636 | # print("project_selector,_ok,create new Project and its directories \n"); | ||
| 637 | system("sh $global_libs->{_script}$run_name"); | ||
| 638 | |||
| 639 | # kill windows but exit with 1 | ||
| 640 | _continue(); | ||
| 641 | |||
| 642 | print("project_selector,_ok, kill windows but exit with 1 \n"); | ||
| 643 | |||
| 644 | } | ||
| 645 | else { | ||
| 646 | # CASE 2C new project seems to already exist | ||
| 647 | |||
| 648 | $message_box_w->delete( "1.0", 'end' ); | ||
| 649 | my $message = | ||
| 650 | $message_director->project_selector(1); # project already exists | ||
| 651 | $message_box_w->insert( 'end', $message ); | ||
| 652 | |||
| 653 | print( | ||
| 654 | "project_selector,_ok, CASE 2C A project with that name exists already. Try again \n" | ||
| 655 | ); | ||
| 656 | } | ||
| 657 | } | ||
| 658 | else { | ||
| 659 | print( | ||
| 660 | "project_selector,_ok, CASE 3 project with that name exists already. NADA \n" | ||
| 661 | ); | ||
| 662 | |||
| 663 | # kill windows but exit with 1 | ||
| 664 | # _continue(); | ||
| 665 | # | ||
| 666 | # print("project_selector,_ok, kill windows but exit with 1 \n"); | ||
| 667 | |||
| 668 | } | ||
| 669 | |||
| 670 | return (); | ||
| 671 | } | ||
| 672 | |||
| 673 | =head2 sub _set_gui | ||
| 674 | |||
| 675 | show project | ||
| 676 | names, and their paths | ||
| 677 | taken from user configuration file | ||
| 678 | $param_widgets_pkg must previously exist | ||
| 679 | |||
| 680 | Using default labels and values from | ||
| 681 | a previous ("default")Project configuration | ||
| 682 | If there is an active project the "default" | ||
| 683 | is the active one. | ||
| 684 | |||
| 685 | =cut | ||
| 686 | |||
| 687 | sub _set_gui { | ||
| 688 | my ($self) = @_; | ||
| 689 | |||
| 690 | # print("project_selector,_set_gui\n"); | ||
| 691 | _set_length(); | ||
| 692 | _set_project_names_aref(); | ||
| 693 | _set_PROJECT_HOMES_aref(); | ||
| 694 | |||
| 695 | my $param_widgets_pkg = $project_selector->{_param_widgets_pkg}; | ||
| 696 | |||
| 697 | # print(" project_selector,param_widgets_pkg: $param_widgets_pkg\n"); | ||
| 698 | |||
| 699 | if ($param_widgets_pkg) { | ||
| 700 | my $project_names_aref = $project_selector->{_project_names_aref}; | ||
| 701 | my $PROJECT_HOMES_aref = $project_selector->{_PROJECT_HOMES_aref}; | ||
| 702 | |||
| 703 | $param_widgets_pkg->set_labels($project_names_aref); | ||
| 704 | $param_widgets_pkg->redisplay_labels(); | ||
| 705 | |||
| 706 | # print("labels are @{$project_names_aref}\n"); # only part of array is full | ||
| 707 | |||
| 708 | $param_widgets_pkg->set_values($PROJECT_HOMES_aref); | ||
| 709 | $param_widgets_pkg->redisplay_values(); | ||
| 710 | |||
| 711 | # print("project_selector,PROJECT HOMES are @$PROJECT_HOMES_aref\n");# only part of array is full | ||
| 712 | |||
| 713 | if ( $project_selector->{_length} == 0 ) { # no project name | ||
| 714 | my @check_buttons = ('off'); | ||
| 715 | $param_widgets_pkg->set_check_buttons( \@check_buttons ); | ||
| 716 | $param_widgets_pkg->redisplay_check_buttons; | ||
| 717 | |||
| 718 | } | ||
| 719 | elsif ( $project_selector->{_length} == 1 ) { # only one project name | ||
| 720 | my @check_buttons = ('on'); | ||
| 721 | $param_widgets_pkg->set_check_buttons( \@check_buttons ); | ||
| 722 | $param_widgets_pkg->redisplay_check_buttons; | ||
| 723 | |||
| 724 | } | ||
| 725 | elsif ( $project_selector->{_length} > 1 ) | ||
| 726 | { # more than one project name | ||
| 727 | |||
| 728 | my $length = $project_selector->{_length}; | ||
| 729 | my @check_buttons; | ||
| 730 | |||
| 731 | # find out which is the most recently active by interpreting | ||
| 732 | # second line of L_SU/configuration/active/Project.config | ||
| 733 | |||
| 734 | my $active_project_name = | ||
| 735 | $user_constants->get_active_project_name(); | ||
| 736 | |||
| 737 | # print("project_selector,_set_gui,active_project_name = $active_project_name\n"); | ||
| 738 | |||
| 739 | # TODO turn on the currently active project | ||
| 740 | # turn off all buttons | ||
| 741 | |||
| 742 | for ( my $i = 0 ; $i < $length ; $i++ ) { | ||
| 743 | $check_buttons[$i] = 'off'; | ||
| 744 | } | ||
| 745 | |||
| 746 | # turn on button with matching label -- extra security | ||
| 747 | my $default_labels_aref = $param_widgets_pkg->get_labels_aref(); | ||
| 748 | my @default_labels = @$default_labels_aref; | ||
| 749 | |||
| 750 | for ( my $i = 0 ; $i < $length ; $i++ ) { | ||
| 751 | |||
| 752 | if ( $default_labels[$i] eq $active_project_name ) { | ||
| 753 | $check_buttons[$i] = 'on'; | ||
| 754 | |||
| 755 | # print("project_selector,_set_gui i=$i,active project match chkn ON \n"); | ||
| 756 | |||
| 757 | } | ||
| 758 | else { | ||
| 759 | $check_buttons[$i] = 'off'; | ||
| 760 | |||
| 761 | # print("project_selector,_set_gui,i=$i, NO active project match chkn OFF \n"); | ||
| 762 | } | ||
| 763 | } | ||
| 764 | |||
| 765 | # print("project_selector,_set_gui,default_labels: @$default_labels_aref n"); # most default_label spaces are empty | ||
| 766 | |||
| 767 | $param_widgets_pkg->set_check_buttons( \@check_buttons ); | ||
| 768 | $param_widgets_pkg->redisplay_check_buttons; | ||
| 769 | |||
| 770 | } | ||
| 771 | else { | ||
| 772 | print("project_selector, _set_gui, lost logic\n"); | ||
| 773 | return (); | ||
| 774 | } | ||
| 775 | |||
| 776 | } | ||
| 777 | else { | ||
| 778 | print( | ||
| 779 | "project_selector,_set_gui, param_widgets_pkg must be first created\n" | ||
| 780 | ); | ||
| 781 | return (); | ||
| 782 | } | ||
| 783 | } | ||
| 784 | |||
| 785 | sub _set_start_of_create_new { | ||
| 786 | my ($self) = @_; | ||
| 787 | |||
| 788 | $project_selector->{_create_new} = 1; | ||
| 789 | $project_selector->{_active_project} = 0; | ||
| 790 | |||
| 791 | my $create_new_button_w = $project_selector->{_create_new_button_w}; | ||
| 792 | $create_new_button_w->configure( -state => 'disable' ); | ||
| 793 | |||
| 794 | return (); | ||
| 795 | |||
| 796 | } | ||
| 797 | |||
| 798 | =head2 sub _set_length | ||
| 799 | |||
| 800 | From HOME directory and configuration path for user | ||
| 801 | estimate the number of projects available | ||
| 802 | |||
| 803 | =cut | ||
| 804 | |||
| 805 | sub _set_first_idx { | ||
| 806 | |||
| 807 | my ($self) = @_; | ||
| 808 | $project_selector->{_first_idx} = 0; | ||
| 809 | |||
| 810 | # print("project_selector, _set_first_idx: $project_selector->{_first_idx}\n"); | ||
| 811 | return (); | ||
| 812 | } | ||
| 813 | |||
| 814 | =head2 sub _set_length | ||
| 815 | |||
| 816 | From HOME directory and configuration path for user | ||
| 817 | estimate the number of projects available | ||
| 818 | |||
| 819 | =cut | ||
| 820 | |||
| 821 | sub _set_length { | ||
| 822 | |||
| 823 | my ($self) = @_; | ||
| 824 | |||
| 825 | my @ls_ref; | ||
| 826 | my $ls_ref = $user_constants->get_project_names; | ||
| 827 | |||
| 828 | # print("project_selector, _set_length project names: @$ls_ref\n"); | ||
| 829 | my $length = scalar @$ls_ref; | ||
| 830 | $project_selector->{_length} = $length; | ||
| 831 | |||
| 832 | # print("project_selector, _set_length no. projects: $length\n"); | ||
| 833 | |||
| 834 | return (); | ||
| 835 | } | ||
| 836 | |||
| 837 | =head2 sub _set_PROJECT_HOMES_aref | ||
| 838 | |||
| 839 | Find out HOME directory from configuration | ||
| 840 | directories of user | ||
| 841 | |||
| 842 | =cut | ||
| 843 | |||
| 844 | sub _set_PROJECT_HOMES_aref { | ||
| 845 | |||
| 846 | my ($self) = @_; | ||
| 847 | |||
| 848 | my @ls_aref; | ||
| 849 | my $ls_aref = $user_constants->get_PROJECT_HOMES_aref; | ||
| 850 | |||
| 851 | # print("project_selector, _set_PROJECT_HOMES: @$ls_aref\n"); | ||
| 852 | $project_selector->{_PROJECT_HOMES_aref} = $ls_aref; | ||
| 853 | return (); | ||
| 854 | } | ||
| 855 | |||
| 856 | =head2 sub create_new | ||
| 857 | |||
| 858 | new current settings | ||
| 859 | |||
| 860 | =cut | ||
| 861 | |||
| 862 | sub create_new { | ||
| 863 | my ( $self, $value ) = @_; | ||
| 864 | |||
| 865 | # print("project_selector,create_new,value: $value\n"); | ||
| 866 | |||
| 867 | if ($value) { | ||
| 868 | _create_new(); | ||
| 869 | _set_start_of_create_new(); | ||
| 870 | |||
| 871 | } | ||
| 872 | else { | ||
| 873 | # print("project_selector,save,error, value: $value\n"); | ||
| 874 | } | ||
| 875 | return (); | ||
| 876 | } | ||
| 877 | |||
| 878 | =head2 sub ok | ||
| 879 | |||
| 880 | continue | ||
| 881 | |||
| 882 | =cut | ||
| 883 | |||
| 884 | sub ok { | ||
| 885 | my ( $self, $value ) = @_; | ||
| 886 | |||
| 887 | # print("project_selector,ok,value: $value\n"); | ||
| 888 | |||
| 889 | if ($value) { | ||
| 890 | |||
| 891 | # print("project_selector,ok,value: $value\n"); | ||
| 892 | _ok(); | ||
| 893 | |||
| 894 | } | ||
| 895 | else { | ||
| 896 | print("project_selector,ok,error, value: $value\n"); | ||
| 897 | } | ||
| 898 | |||
| 899 | return (); | ||
| 900 | } | ||
| 901 | |||
| 902 | =head2 sub set_check_buttons_w_aref | ||
| 903 | |||
| 904 | |||
| 905 | =cut | ||
| 906 | |||
| 907 | sub set_check_buttons_w_aref { | ||
| 908 | my ( $self, $check_buttons_w_aref ) = @_; | ||
| 909 | |||
| 910 | if ($check_buttons_w_aref) { | ||
| 911 | |||
| 912 | $project_selector->{_check_buttons_w_aref} = my $check_buttons_w_aref; | ||
| 913 | |||
| 914 | } | ||
| 915 | else { | ||
| 916 | print( | ||
| 917 | "project_selector, set_check_buttons_w_aref,missing check_buttons_w_aref \n" | ||
| 918 | ); | ||
| 919 | } | ||
| 920 | return (); | ||
| 921 | } | ||
| 922 | |||
| 923 | =head2 sub set_create_new_button_w | ||
| 924 | |||
| 925 | |||
| 926 | =cut | ||
| 927 | |||
| 928 | sub set_create_new_button_w { | ||
| 929 | |||
| 930 | my ( $self, $create_new_button_w ) = @_; | ||
| 931 | |||
| 932 | if ($create_new_button_w) { | ||
| 933 | |||
| 934 | $project_selector->{_create_new_button_w} = $create_new_button_w; | ||
| 935 | |||
| 936 | } | ||
| 937 | else { | ||
| 938 | print("project_selector, set_,missing create_new_button_w \n"); | ||
| 939 | } | ||
| 940 | return (); | ||
| 941 | } | ||
| 942 | |||
| 943 | =head2 sub set_gui | ||
| 944 | |||
| 945 | Always carried out when main LSU_project_selector begins | ||
| 946 | |||
| 947 | =cut | ||
| 948 | |||
| 949 | sub set_gui { | ||
| 950 | my ($self) = @_; | ||
| 951 | |||
| 952 | # print("project_selector, set_gui\n"); | ||
| 953 | _set_gui(); | ||
| 954 | return (); | ||
| 955 | } | ||
| 956 | |||
| 957 | =head2 sub set_hash_ref | ||
| 958 | |||
| 959 | Transfer hash of variables from the main program | ||
| 960 | #$L_SU_project_selector->{_labels_w_aref} = $param_widgets -> get_labels_w_aref(); | ||
| 961 | #$L_SU_project_selector->{_check_buttons_w_aref} = $param_widgets -> get_check_buttons_w_aref(); | ||
| 962 | #print($hash-ref->{_}); | ||
| 963 | |||
| 964 | =cut | ||
| 965 | |||
| 966 | sub set_hash_ref { | ||
| 967 | |||
| 968 | my ( $self, $hash_ref ) = @_; | ||
| 969 | |||
| 970 | if ( length $hash_ref ) { | ||
| 971 | |||
| 972 | $project_selector = $hash_ref; | ||
| 973 | |||
| 974 | } | ||
| 975 | else { | ||
| 976 | print("project_selector,set_hash_ref, no hash-ref detecred\n"); | ||
| 977 | } | ||
| 978 | return (); | ||
| 979 | } | ||
| 980 | |||
| 981 | =head2 sub set_labels_frame | ||
| 982 | |||
| 983 | a widget reference | ||
| 984 | |||
| 985 | =cut | ||
| 986 | |||
| 987 | sub set_labels_frame { | ||
| 988 | my ( $self, $label ) = @_; | ||
| 989 | |||
| 990 | print("my label-$label\n"); | ||
| 991 | |||
| 992 | } | ||
| 993 | |||
| 994 | =head2 set_labels_w_aref | ||
| 995 | |||
| 996 | =cut | ||
| 997 | |||
| 998 | sub set_labels_w_aref { | ||
| 999 | my ( $self, $labels_w_aref ) = @_; | ||
| 1000 | |||
| 1001 | if ( length $labels_w_aref ) { | ||
| 1002 | |||
| 1003 | $project_selector->{_labels_w_aref} = my $labels_w_aref; | ||
| 1004 | print( | ||
| 1005 | "project_selector,set_labels_w_aref: $project_selector->{_labels_w_aref} \n" | ||
| 1006 | ); | ||
| 1007 | } | ||
| 1008 | else { | ||
| 1009 | print("project_selector,set_labels_w_aref, missing labels_w_aref \n"); | ||
| 1010 | } | ||
| 1011 | return (); | ||
| 1012 | } | ||
| 1013 | |||
| 1014 | =head2 sub set_length | ||
| 1015 | |||
| 1016 | Find out HOME directory and configuration path for user | ||
| 1017 | |||
| 1018 | =cut | ||
| 1019 | |||
| 1020 | sub set_length { | ||
| 1021 | |||
| 1022 | my ($self) = @_; | ||
| 1023 | |||
| 1024 | my @ls_ref; | ||
| 1025 | my $ls_ref = $user_constants->get_project_names; | ||
| 1026 | |||
| 1027 | # print("project_selector, project names: @$ls_ref\n"); | ||
| 1028 | my $length = scalar @$ls_ref; | ||
| 1029 | $project_selector->{_length} = $length; | ||
| 1030 | |||
| 1031 | # print("project_selector, no. projects: $length\n"); | ||
| 1032 | |||
| 1033 | return (); | ||
| 1034 | } | ||
| 1035 | |||
| 1036 | =head2 set_message_box_w | ||
| 1037 | |||
| 1038 | =cut | ||
| 1039 | |||
| 1040 | sub set_message_box_w { | ||
| 1041 | my ( $self, $widget_ref ) = @_; | ||
| 1042 | |||
| 1043 | if ($widget_ref) { | ||
| 1044 | |||
| 1045 | $project_selector->{_message_box_w} = $widget_ref; | ||
| 1046 | |||
| 1047 | } | ||
| 1048 | else { | ||
| 1049 | print("project_selector, set_message_box_w, no message box widget\n"); | ||
| 1050 | } | ||
| 1051 | |||
| 1052 | return (); | ||
| 1053 | } | ||
| 1054 | |||
| 1055 | =head2 sub set_mw | ||
| 1056 | |||
| 1057 | main window widget | ||
| 1058 | |||
| 1059 | =cut | ||
| 1060 | |||
| 1061 | sub set_mw { | ||
| 1062 | my ( $self, $mw ) = @_; | ||
| 1063 | |||
| 1064 | if ($mw) { | ||
| 1065 | |||
| 1066 | $project_selector->{_mw} = my $mw; | ||
| 1067 | |||
| 1068 | } | ||
| 1069 | else { | ||
| 1070 | # print("project_selector, set_mw,missing check_buttons_w_aref \n"); | ||
| 1071 | } | ||
| 1072 | return (); | ||
| 1073 | } | ||
| 1074 | |||
| 1075 | =head2 sub set_param_widgets_pkg | ||
| 1076 | |||
| 1077 | get project names from | ||
| 1078 | user configuration directory | ||
| 1079 | |||
| 1080 | =cut | ||
| 1081 | |||
| 1082 | sub set_param_widgets_pkg { | ||
| 1083 | my ( $self, $pkg_ref ) = @_; | ||
| 1084 | |||
| 1085 | if ( length $pkg_ref ) { | ||
| 1086 | |||
| 1087 | $project_selector->{_param_widgets_pkg} = $pkg_ref; | ||
| 1088 | |||
| 1089 | # print("project_selector, set_param_widgets_pkg: $project_selector->{_param_widgets_pkg}\n"); | ||
| 1090 | |||
| 1091 | } | ||
| 1092 | else { | ||
| 1093 | print("project_selector, no package reference\n"); | ||
| 1094 | } | ||
| 1095 | return (); | ||
| 1096 | } | ||
| 1097 | |||
| 1098 | =head2 sub set_current_program_name | ||
| 1099 | |||
| 1100 | set project names from | ||
| 1101 | user configuration directory | ||
| 1102 | |||
| 1103 | =cut | ||
| 1104 | |||
| 1105 | sub set_current_program_name { | ||
| 1106 | my ( $self, $current_program_name ) = @_; | ||
| 1107 | |||
| 1108 | if ( length($current_program_name) | ||
| 1109 | and length( $project_selector->{_param_widgets_pkg} ) ) | ||
| 1110 | { | ||
| 1111 | |||
| 1112 | $project_selector->{_current_program_name} = $current_program_name; | ||
| 1113 | ( $project_selector->{_param_widgets_pkg} ) | ||
| 1114 | ->set_current_program_name($current_program_name); | ||
| 1115 | |||
| 1116 | # print("project_selector, set_current_program_name: $current_program_name\n"); | ||
| 1117 | |||
| 1118 | } | ||
| 1119 | else { | ||
| 1120 | print( | ||
| 1121 | "project_selector, set_current_program_name: missing name or package \n" | ||
| 1122 | ); | ||
| 1123 | } | ||
| 1124 | return (); | ||
| 1125 | } | ||
| 1126 | |||
| 1127 | =head2 sub _set_project_names_aref | ||
| 1128 | |||
| 1129 | gset project names from | ||
| 1130 | user configuration directory | ||
| 1131 | |||
| 1132 | =cut | ||
| 1133 | |||
| 1134 | sub _set_project_names_aref { | ||
| 1135 | my ($self) = @_; | ||
| 1136 | |||
| 1137 | my $project_names_aref = _get_project_names_aref(); | ||
| 1138 | $project_selector->{_project_names_aref} = $project_names_aref; | ||
| 1139 | |||
| 1140 | # print("project_selector, _set_project_names_aref: @{$project_names_aref}\n"); | ||
| 1141 | return (); | ||
| 1142 | } | ||
| 1143 | |||
| 1144 | #=head2 set_values_w_aref | ||
| 1145 | # | ||
| 1146 | #=cut | ||
| 1147 | |||
| 1148 | #sub set_values_w_aref { | ||
| 1149 | # my ( $self, $values_w_aref ) = @_; | ||
| 1150 | # | ||
| 1151 | # if ($values_w_aref) { | ||
| 1152 | # | ||
| 1153 | # my $project_selector->{_values_w_aref} = $values_w_aref; | ||
| 1154 | # | ||
| 1155 | # } | ||
| 1156 | # else { | ||
| 1157 | # print("project_selector,set_values_w_aref, missing values_w_aref \n"); | ||
| 1158 | # } | ||
| 1159 | # return (); | ||
| 1160 | #} | ||
| 1161 | |||
| 1162 | #=head2 sub set_value_w_aref | ||
| 1163 | # | ||
| 1164 | # | ||
| 1165 | #=cut | ||
| 1166 | # | ||
| 1167 | #sub set_value_w_aref{ | ||
| 1168 | # my ( $self, $widget ) = @_; | ||
| 1169 | # | ||
| 1170 | # if ( length($widget) ) { | ||
| 1171 | # | ||
| 1172 | # $project_selector->{_value_w_aref} = $widget; | ||
| 1173 | # | ||
| 1174 | # print("project_selector, set_value_w_aref=$widget\n"); | ||
| 1175 | # | ||
| 1176 | # } | ||
| 1177 | # else { | ||
| 1178 | # print("project_selector, set_widget,missing widget \n"); | ||
| 1179 | # } | ||
| 1180 | # return (); | ||
| 1181 | #} | ||
| 1182 | |||
| 1183 | 1; |