Module: Yast::AddOnCreatorDialogsInclude
- Defined in:
- ../../src/include/add-on-creator/dialogs.rb
Instance Method Summary (collapse)
-
- (Object) AddFile(label, conflicts, values)
add the new readme/license file.
-
- (Object) ExpertSettingsDialog
Dialog result.
-
- (Object) ExpertSettingsDialog2
editor of COPYING, COPYING.lang, COPYRIGHT, COPYRIGHT.lang.
-
- (Object) ExpertSettingsDialog3
editor of patches, products, media files FIXME.
- - (Object) initialize_add_on_creator_dialogs(include_target)
-
- (Object) WorkflowConfigurationDialog
Dialog for configuration of an installation workflow.
Instance Method Details
- (Object) AddFile(label, conflicts, values)
add the new readme/license file
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File '../../src/include/add-on-creator/dialogs.rb', line 43 def AddFile(label, conflicts, values) conflicts = deep_copy(conflicts) values = deep_copy(values) ret = nil allowed = values == nil ? [] : Builtins.filter(values) do |v| !Builtins.contains(conflicts, v) end UI.OpenDialog( Opt(:decorated), HBox( HSpacing(1), VBox( values == nil ? TextEntry(Id(:file), label, "") : ComboBox(Id(:file), Opt(:editable), label, allowed), HBox( PushButton(Id(:ok), Opt(:default, :key_F10), Label.OKButton), PushButton(Id(:cancel), Opt(:key_F9), Label.CancelButton) ) ), HSpacing(1) ) ) UI.SetFocus(Id(:file)) while true result = UI.UserInput if result == :cancel ret = nil break end if result == :ok ret = Convert.to_string(UI.QueryWidget(Id(:file), :Value)) if Builtins.contains(conflicts, ret) # popup message Popup.Error( _( "A file with this name already exists.\nChoose a different one." ) ) ret = nil next end break end end UI.CloseDialog ret end |
- (Object) ExpertSettingsDialog
Returns dialog result
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File '../../src/include/add-on-creator/dialogs.rb', line 94 def ExpertSettingsDialog current_product = deep_copy(AddOnCreator.current_product) # dialog caption caption = _("Expert Settings") info = Ops.get_string(current_product, "info", "") license_files = Ops.get_map(current_product, "license_files", {}) readme_files = Ops.get_map(current_product, "readme_files", {}) = lambda do |active| UI.ReplaceWidget( Id(:rpfiles), ComboBox( Id(:readme_files), Opt(:notify, :hstretch), "", Builtins.maplist(readme_files) { |f, c| Item(Id(f), f, f == active) } ) ) nil end = lambda do |active| UI.ReplaceWidget( Id(:rplicenses), ComboBox( Id(:lic_files), Opt(:notify, :hstretch), "", Builtins.maplist(license_files) do |f, c| Item(Id(f), f, f == active) end ) ) nil end contents = HBox( HSpacing(), VBox( VWeight(2, MultiLineEdit(Id(:info), _("&info.txt File"), info)), # frame label VWeight( 4, Frame( _("&License Files"), HBox( HSpacing(0.4), VBox( HBox( ReplacePoint( Id(:rplicenses), ComboBox( Id(:lic_files), Opt(:notify, :hstretch), "", Builtins.maplist(license_files) { |f, c| f } ) ), PushButton(Id(:add_license), Label.AddButton), # button label PushButton(Id(:import_license), _("I&mport")), PushButton(Id(:delete_license), Label.DeleteButton) ), MultiLineEdit(Id(:license), "") ), HSpacing(0.4) ) ) ), VSpacing(0.7), # frame label VWeight( 4, Frame( _("README Files"), HBox( HSpacing(0.4), VBox( HBox( ReplacePoint( Id(:rpfiles), ComboBox( Id(:readme_files), Opt(:notify, :hstretch), "", Builtins.maplist(readme_files) { |f, c| f } ) ), PushButton(Id(:add_readme), Label.AddButton), # button label PushButton(Id(:import_readme), _("Im&port")), PushButton(Id(:delete_readme), Label.DeleteButton) ), MultiLineEdit(Id(:readme), "") ), HSpacing(0.4) ) ) ), VSpacing(0.7) ), HSpacing() ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "expert", ""), Label.BackButton, Label.NextButton ) Wizard.HideAbortButton current_readme = Convert.to_string( UI.QueryWidget(Id(:readme_files), :Value) ) if Ops.get(readme_files, current_readme, "") != "" UI.ChangeWidget( Id(:readme), :Value, Ops.get(readme_files, current_readme, "") ) end current_license = Convert.to_string( UI.QueryWidget(Id(:lic_files), :Value) ) if Ops.get(license_files, current_license, "") != "" UI.ChangeWidget( Id(:license), :Value, Ops.get(license_files, current_license, "") ) end UI.ChangeWidget(Id(:delete_readme), :Enabled, readme_files != {}) UI.ChangeWidget(Id(:delete_license), :Enabled, license_files != {}) ret = nil while true ret = UI.UserInput if ret == :add_readme new = AddFile( # textentry label _("&Name of the New README File"), Builtins.maplist(readme_files) { |f, c| f }, nil ) if new != nil Ops.set(readme_files, new, "") .call(new) ret = :readme_files UI.SetFocus(Id(:readme)) end UI.ChangeWidget(Id(:delete_readme), :Enabled, readme_files != {}) end if ret == :import_readme file = UI.AskForExistingFile( Ops.get_string(current_product, "rpm_path", ""), "", # popup for file selection dialog _("Choose the New README File") ) if file != nil imported = Convert.to_string(SCR.Read(path(".target.string"), file)) if imported != nil new = Builtins.substring( file, Ops.add(Builtins.findlastof(file, "/"), 1) ) Ops.set(readme_files, new, imported) .call(new) current_readme = nil ret = :readme_files UI.SetFocus(Id(:readme)) end end end fr = Convert.to_string(UI.QueryWidget(Id(:readme_files), :Value)) if ret == :delete_readme readme_files = Builtins.remove(readme_files, fr) .call("") ret = :readme_files fr = Convert.to_string(UI.QueryWidget(Id(:readme_files), :Value)) current_readme = nil UI.ChangeWidget(Id(:delete_readme), :Enabled, readme_files != {}) end if ret == :readme_files if fr != current_readme if current_readme != nil Ops.set( readme_files, current_readme, Convert.to_string(UI.QueryWidget(Id(:readme), :Value)) ) end current_readme = fr UI.ChangeWidget(Id(:readme), :Value, Ops.get(readme_files, fr, "")) end end if ret == :add_license new = AddFile( # textentry label _("&Language for the New License File"), Builtins.maplist(license_files) do |f, c| f == "license" ? "" : Builtins.substring(f, 8) end, AddOnCreator.GetLangCodes(true) ) if new != nil new = Ops.add("license" + (new == "" ? "" : "."), new) Ops.set(license_files, new, "") .call(new) ret = :lic_files UI.SetFocus(Id(:license)) end UI.ChangeWidget(Id(:delete_license), :Enabled, license_files != {}) end if ret == :import_license file = UI.AskForExistingFile( Ops.get_string(current_product, "rpm_path", ""), "license*", # popup for file selection dialog _("Choose the New License File") ) if file != nil imported = Convert.to_string(SCR.Read(path(".target.string"), file)) if imported != nil new = Builtins.substring( file, Ops.add(Builtins.findlastof(file, "/"), 1) ) Ops.set(license_files, new, imported) .call(new) current_license = nil ret = :lic_files UI.SetFocus(Id(:license)) end end end fl = Convert.to_string(UI.QueryWidget(Id(:lic_files), :Value)) if ret == :delete_license license_files = Builtins.remove(license_files, fl) .call("") ret = :lic_files fl = Convert.to_string(UI.QueryWidget(Id(:lic_files), :Value)) current_license = nil UI.ChangeWidget(Id(:delete_license), :Enabled, license_files != {}) end if ret == :lic_files if fl != current_license if current_license != nil Ops.set( license_files, current_license, Convert.to_string(UI.QueryWidget(Id(:license), :Value)) ) end current_license = fl UI.ChangeWidget( Id(:license), :Value, Ops.get(license_files, fl, "") ) end elsif ret == :next Ops.set( readme_files, current_readme, Convert.to_string(UI.QueryWidget(Id(:readme), :Value)) ) Ops.set( license_files, current_license, Convert.to_string(UI.QueryWidget(Id(:license), :Value)) ) # AddOnCreator::media = # (string) UI::QueryWidget (`id(`media),`Value); Ops.set( AddOnCreator.current_product, "info", UI.QueryWidget(Id(:info), :Value) ) Ops.set(AddOnCreator.current_product, "readme_files", readme_files) Ops.set(AddOnCreator.current_product, "license_files", license_files) break elsif ret == :abort || ret == :cancel if ReallyAbort() break else next end elsif ret == :back Wizard.RestoreAbortButton break end end deep_copy(ret) end |
- (Object) ExpertSettingsDialog2
editor of COPYING, COPYING.lang, COPYRIGHT, COPYRIGHT.lang
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 |
# File '../../src/include/add-on-creator/dialogs.rb', line 399 def ExpertSettingsDialog2 # dialog caption caption = _("Expert Settings, Part 2") current_product = deep_copy(AddOnCreator.current_product) = Ops.get_map(current_product, "copying_files", {}) copyright_files = Ops.get_map(current_product, "copyright_files", {}) = lambda do |active| UI.ReplaceWidget( Id(:rpfiles), ComboBox( Id(:copyright_files), Opt(:notify, :hstretch), "", Builtins.maplist(copyright_files) do |f, c| Item(Id(f), f, f == active) end ) ) UI.ChangeWidget(Id(:delete_copyright), :Enabled, copyright_files != {}) nil end = lambda do |active| UI.ReplaceWidget( Id(:rpcopyings), ComboBox( Id(:copying_files), Opt(:notify, :hstretch), "", Builtins.maplist() do |f, c| Item(Id(f), f, f == active) end ) ) UI.ChangeWidget(Id(:delete_copying), :Enabled, != {}) nil end contents = HBox( HSpacing(), VBox( # frame label Frame( _("©ING Files"), HBox( HSpacing(0.4), VBox( HBox( ReplacePoint( Id(:rpcopyings), ComboBox( Id(:copying_files), Opt(:notify, :hstretch), "", Builtins.maplist() { |f, c| f } ) ), PushButton(Id(:add_copying), Label.AddButton), # button label PushButton(Id(:import_copying), _("I&mport")), PushButton(Id(:delete_copying), Label.DeleteButton) ), MultiLineEdit(Id(:copying), "") ), HSpacing(0.4) ) ), VSpacing(0.7), # frame label Frame( _("COPY&RIGHT Files"), HBox( HSpacing(0.4), VBox( HBox( ReplacePoint( Id(:rpfiles), ComboBox( Id(:copyright_files), Opt(:notify, :hstretch), "", Builtins.maplist(copyright_files) { |f, c| f } ) ), PushButton(Id(:add_copyright), Label.AddButton), # button label PushButton(Id(:import_copyright), _("Im&port")), PushButton(Id(:delete_copyright), Label.DeleteButton) ), MultiLineEdit(Id(:copyright), "") ), HSpacing(0.4) ) ), VSpacing(0.7) ), HSpacing() ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "expert2", ""), Label.BackButton, Label.NextButton ) current_copyright = Convert.to_string( UI.QueryWidget(Id(:copyright_files), :Value) ) if Ops.get(copyright_files, current_copyright, "") != "" UI.ChangeWidget( Id(:copyright), :Value, Ops.get(copyright_files, current_copyright, "") ) end = Convert.to_string( UI.QueryWidget(Id(:copying_files), :Value) ) if Ops.get(, , "") != "" UI.ChangeWidget( Id(:copying), :Value, Ops.get(, , "") ) end UI.ChangeWidget(Id(:delete_copyright), :Enabled, copyright_files != {}) UI.ChangeWidget(Id(:delete_copying), :Enabled, != {}) ret = nil while true ret = UI.UserInput if ret == :add_copyright new = AddFile( # textentry label _("&Language for the New COPYRIGHT File"), Builtins.maplist(copyright_files) do |f, c| f == "COPYRIGHT" ? "" : Builtins.substring(f, 10) end, AddOnCreator.GetLangCodes(false) ) if new != nil new = Ops.add("COPYRIGHT" + (new == "" ? "" : "."), new) Ops.set(copyright_files, new, "") .call(new) ret = :copyright_files UI.SetFocus(Id(:copyright)) end end if ret == :import_copyright file = UI.AskForExistingFile( Ops.get_string(current_product, "rpm_path", ""), "COPYRIGHT*", # popup for file selection dialog _("Choose the New COPYRIGHT File") ) if file != nil imported = Convert.to_string(SCR.Read(path(".target.string"), file)) if imported != nil new = Builtins.substring( file, Ops.add(Builtins.findlastof(file, "/"), 1) ) Ops.set(copyright_files, new, imported) .call(new) current_copyright = nil ret = :copyright_files UI.SetFocus(Id(:copyright)) end end end cr = Convert.to_string(UI.QueryWidget(Id(:copyright_files), :Value)) if ret == :delete_copyright copyright_files = Builtins.remove(copyright_files, cr) .call("") ret = :copyright_files cr = Convert.to_string(UI.QueryWidget(Id(:copyright_files), :Value)) current_copyright = nil end if ret == :copyright_files if cr != current_copyright if current_copyright != nil Ops.set( copyright_files, current_copyright, Convert.to_string(UI.QueryWidget(Id(:copyright), :Value)) ) end current_copyright = cr UI.ChangeWidget( Id(:copyright), :Value, Ops.get(copyright_files, cr, "") ) end end if ret == :add_copying new = AddFile( # textentry label _("&Language for the New COPYING File"), Builtins.maplist() do |f, c| f == "COPYING" ? "" : Builtins.substring(f, 8) end, AddOnCreator.GetLangCodes(false) ) if new != nil new = Ops.add("COPYING" + (new == "" ? "" : "."), new) Ops.set(, new, "") .call(new) ret = :copying_files UI.SetFocus(Id(:copying)) end end if ret == :import_copying file = UI.AskForExistingFile( Ops.get_string(current_product, "rpm_path", ""), "copying*", # popup for file selection dialog _("Choose the New COPYING File") ) if file != nil imported = Convert.to_string(SCR.Read(path(".target.string"), file)) if imported != nil new = Builtins.substring( file, Ops.add(Builtins.findlastof(file, "/"), 1) ) Ops.set(, new, imported) .call(new) = nil ret = :copying_files UI.SetFocus(Id(:copying)) end end end co = Convert.to_string(UI.QueryWidget(Id(:copying_files), :Value)) if ret == :delete_copying = Builtins.remove(, co) .call("") ret = :copying_files co = Convert.to_string(UI.QueryWidget(Id(:copying_files), :Value)) = nil end if ret == :copying_files if co != if != nil Ops.set( , , Convert.to_string(UI.QueryWidget(Id(:copying), :Value)) ) end = co UI.ChangeWidget( Id(:copying), :Value, Ops.get(, co, "") ) end elsif ret == :next Ops.set( copyright_files, current_copyright, Convert.to_string(UI.QueryWidget(Id(:copyright), :Value)) ) Ops.set( , , Convert.to_string(UI.QueryWidget(Id(:copying), :Value)) ) Ops.set( AddOnCreator.current_product, "copyright_files", copyright_files ) Ops.set(AddOnCreator.current_product, "copying_files", ) Wizard.RestoreAbortButton break elsif ret == :abort || ret == :cancel if ReallyAbort() break else next end elsif ret == :back break end end deep_copy(ret) end |
- (Object) ExpertSettingsDialog3
editor of patches, products, media files FIXME
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 |
# File '../../src/include/add-on-creator/dialogs.rb', line 699 def ExpertSettingsDialog3 # dialog caption caption = _("Expert Settings, Part 3") current_product = deep_copy(AddOnCreator.current_product) products_files = Ops.get_list(current_product, "products_files", []) patches_files = Ops.get_list(current_product, "patches_files", []) media_files = Ops.get_list(current_product, "media_files", []) products = Ops.get(products_files, 0, "") patches = Ops.get(patches_files, 0, "") media = Ops.get(media_files, 0, "") contents = HBox( HSpacing(), VBox( MultiLineEdit(Id(:products), _("products"), products), Right( # button label PushButton(Id(:import_products), _("I&mport")) ), VSpacing(0.7), MultiLineEdit(Id(:patches), _("patches"), patches), Right( # button label PushButton(Id(:import_patches), _("&Import")) ), VSpacing(0.7), MultiLineEdit(Id(:media), _("media"), media), Right( # button label PushButton(Id(:import_media), _("Im&port")) ), VSpacing(0.7) ), HSpacing() ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "expert3", ""), Label.BackButton, Label.NextButton ) ret = nil while true ret = UI.UserInput if ret == :next Wizard.RestoreAbortButton break elsif ret == :abort || ret == :cancel if ReallyAbort() break else next end elsif ret == :back break end end deep_copy(ret) end |
- (Object) initialize_add_on_creator_dialogs(include_target)
32 33 34 35 36 37 38 39 40 |
# File '../../src/include/add-on-creator/dialogs.rb', line 32 def initialize_add_on_creator_dialogs(include_target) textdomain "add-on-creator" Yast.import "Label" Yast.import "Wizard" Yast.import "AddOnCreator" Yast.include include_target, "add-on-creator/helps.rb" end |
- (Object) WorkflowConfigurationDialog
Dialog for configuration of an installation workflow
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 |
# File '../../src/include/add-on-creator/dialogs.rb', line 767 def WorkflowConfigurationDialog # dialog caption caption = _("Workflow Configuration") current_product = deep_copy(AddOnCreator.current_product) workflow_path = Ops.get_string(current_product, "workflow_path", "") y2update_path = Ops.get_string(current_product, "y2update_path", "") y2update_packages = Ops.get_list(current_product, "y2update_packages", []) # helper for updating table contents update_table = lambda do UI.ChangeWidget( Id(:y2update_packages), :Items, Builtins.maplist(y2update_packages) { |p| Item(Id(p), p) } ) nil end contents = HBox( HSpacing(), VBox( HBox( TextEntry( Id(:workflow_path), # textentry label _("&Location of the File with the Workflow Description"), workflow_path ), VBox(Label(""), PushButton(Id(:browse), Label.BrowseButton)) ), VSpacing(), RadioButtonGroup( Id(:rbg), VBox( Left( RadioButton( Id(:no_additional), Opt(:notify), # radiobutton label _("&No Additional YaST Modules"), y2update_path == "" && y2update_packages == [] ) ), Left( RadioButton( Id(:y2update_rb), Opt(:notify), # radiobutton label _("&Path to y2update.tgz"), y2update_path != "" ) ), HBox( HSpacing(2), TextEntry(Id(:y2update_path), "", y2update_path), # pushbutton label PushButton(Id(:br_y2update), _("&Browse")) ), Left( RadioButton( Id(:import), Opt(:notify), # radiobutton label _("&Import the Packages"), y2update_packages != [] && y2update_path == "" ) ), HBox( HSpacing(2), VBox( Table( Id(:y2update_packages), # table header Header(_("YaST Module Package")), [] ), HBox( PushButton(Id(:add), Label.AddButton), PushButton(Id(:delete), Label.DeleteButton), HStretch() ) ) ) ) ), VSpacing(0.7) ), HSpacing() ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "workflow", ""), Label.BackButton, Label.NextButton ) Wizard.HideAbortButton update_table.call Builtins.foreach([:y2update_path, :br_y2update]) do |w_id| UI.ChangeWidget( Id(w_id), :Enabled, UI.QueryWidget(Id(:rbg), :Value) == :y2update_rb ) end Builtins.foreach([:y2update_packages, :add, :delete]) do |w_id| UI.ChangeWidget( Id(w_id), :Enabled, UI.QueryWidget(Id(:rbg), :Value) == :import ) end UI.ChangeWidget(Id(:delete), :Enabled, y2update_packages != []) ret = nil while true ret = UI.UserInput if ret == :browse file = UI.AskForExistingFile( Ops.get_string(current_product, "rpm_path", ""), "*.xml", # popup for file selection dialog _("Choose the installation.xml File") ) if file != nil #TODO check for xml format workflow_path = file UI.ChangeWidget(Id(:workflow_path), :Value, file) end elsif ret == :import || ret == :y2update_rb || ret == :no_additional Builtins.foreach([:y2update_packages, :add, :delete]) do |w_id| UI.ChangeWidget(Id(w_id), :Enabled, ret == :import) end Builtins.foreach([:y2update_path, :br_y2update]) do |w_id| UI.ChangeWidget(Id(w_id), :Enabled, ret == :y2update_rb) end end if ret == :br_y2update file = UI.AskForExistingFile( Ops.get_string(current_product, "rpm_path", ""), "y2update.tgz", # popup for file selection dialog _("Choose the Path to the y2update.tgz File") ) if file != nil #TODO check for tgz format y2update_path = file UI.ChangeWidget(Id(:y2update_path), :Value, file) end elsif ret == :add file = UI.AskForExistingFile( Ops.get_string(current_product, "rpm_path", ""), "*.rpm", # popup for file selection dialog _("Choose the YaST Module Package") ) if file != nil && !Builtins.contains(y2update_packages, file) #TODO check for rpm y2update_packages = Builtins.add(y2update_packages, file) update_table.call end UI.ChangeWidget(Id(:delete), :Enabled, y2update_packages != []) elsif ret == :delete sel = Convert.to_string( UI.QueryWidget(Id(:y2update_packages), :CurrentItem) ) y2update_packages = Builtins.filter(y2update_packages) { |p| p != sel } update_table.call UI.ChangeWidget(Id(:delete), :Enabled, y2update_packages != []) elsif ret == :next Ops.set( AddOnCreator.current_product, "y2update_packages", y2update_packages ) Ops.set( AddOnCreator.current_product, "y2update_path", Convert.to_string(UI.QueryWidget(Id(:y2update_path), :Value)) ) Ops.set( AddOnCreator.current_product, "workflow_path", Convert.to_string(UI.QueryWidget(Id(:workflow_path), :Value)) ) break elsif ret == :abort || ret == :cancel if ReallyAbort() break else next end elsif ret == :back break end end Wizard.RestoreAbortButton deep_copy(ret) end |