Class: Yast::PackageCallbacksClass
- Inherits:
-
Module
- Object
- Module
- Yast::PackageCallbacksClass
- Includes:
- Logger
- Defined in:
- ../../src/modules/PackageCallbacks.rb
Instance Method Summary (collapse)
- - (Object) AskAbortRefresh
- - (Object) Authentication(url, msg, username, password)
- - (Object) CDdevices(preferred)
-
- (Object) CheckAndSaveAutoEject
check and save the autoeject configuration if needed.
- - (Object) ClearDownloadCallbacks
- - (Object) ClearScriptCallbacks
- - (Object) CloseDownloadProgressPopup
- - (Object) CloseSourcePopup
- - (Object) DestDownload
- - (Object) display_width
-
- (Object) DoneDownload(error_value, error_text)
just log the status, errors are handled in MediaChange callback.
-
- (Object) DonePackage(error, reason)
After package install.
-
- (Object) DoneProvide(error, reason, name)
during file providal * // return “I” for ignore // return “R” for retry // return “C” for abort.
-
- (Object) DoneScanDb(error, description)
Callback for finish RPM DB scan event.
- - (Object) DummyBooleanInteger(param1)
- - (Object) DummyDoneDownload(error_value, error_text)
- - (Object) DummyDonePackage(error, reason)
- - (Object) DummyDoneProvide(error, reason, name)
- - (Object) DummyMessage(patch_name, patch_version, patch_arch, message)
-
- (Object) DummyProcessStart(param1, param2, param3)
============================================================================= constructor and callback init =============================================================================.
- - (Object) DummyProgressDownload(percent, bps_avg, bps_current)
- - (Object) DummyProgressProgress(id, val_raw, val_percent)
- - (Object) DummyProgressStart(id, task, in_percent, is_alive, min, max, val_raw, val_percent)
- - (Object) DummyScriptProgress(ping, output)
- - (Object) DummyScriptStart(patch_name, patch_version, patch_arch, script_path)
- - (Object) DummySourceCreateEnd(url, error, description)
- - (Object) DummySourceCreateError(url, error, description)
- - (Object) DummySourceReportEnd(src_id, url, task, error, description)
- - (Object) DummySourceReportError(source_id, url, error, description)
- - (Object) DummySourceReportStart(source_id, url, task)
- - (Object) DummyStartDownload(url, localfile)
- - (Object) DummyStartPackage(name, location, summary, installsize, is_delete)
- - (Object) DummyStartProvide(param1, param2, param3)
- - (Object) DummyStringIntegerString(param1, param2)
- - (Object) DummyStringString(param1)
- - (Object) DummyVoid
- - (Object) DummyVoidInteger(param1)
- - (Object) DummyVoidIntegerString(param1, param2)
- - (Object) DummyVoidString(param1)
- - (Object) DummyVoidStringInteger(param1, param2)
-
- (Object) EnableAsterixPackage(f)
Enable or disable StartPackage, ProgressPackage and DonePackage callbacks, but only the progress bar and not the final error message.
-
- (Object) ErrorScanDb(error, description)
Callback for error handling during RPM DB scan.
- - (Object) FinishPatchDeltaProvide
- - (Object) FormatPatchName(patch_name, patch_version, patch_arch)
- - (Object) FullScreen
- - (Object) GetConfig(key)
- - (Object) InitDownload(task)
-
- (Object) InitPackageCallbacks
Register package manager callbacks.
- - (Object) IsDownloadProgressPopup
-
- (Object) IsProgressPopup
is the top level progress popup?.
-
- (Object) IsSourcePopup
is the top level window source popup?.
-
- (Object) LayoutPopup(message, button_box, vertical_size, info_on)
creates layout for ChangeMediumPopup.
-
- (Object) LoadConfig
functions related to the persistent storage.
- - (Object) main
-
- (Object) MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device)
————————————————————————-.
- - (Object) Message(patch_name, patch_version, patch_arch, message)
- - (Object) NextTick
- - (Object) NotifyConvertDB
- - (Object) NotifyRebuildDB
- - (Object) OpenSourcePopup
-
- (Object) PackageCallbacks
constructor.
- - (Object) ProblemDeltaApply(descr)
- - (Object) ProblemDeltaDownload(descr)
- - (Object) ProblemPatchDownload(descr)
-
- (Object) ProcessDone
Hander for ProcessDone callback - the process has been finished.
- - (Object) ProcessMessage(msg, max_len)
-
- (Object) ProcessNextStage
Hander for ProcessNextStage callback - the current stage has been finished.
-
- (Object) ProcessProgress(percent)
Hander for ProcessProgress callback - report total progress.
-
- (Object) ProcessStart(task, stages, help)
Hanler for ProcessStart callback - handle start of a package manager process.
-
- (Object) ProgressBox(heading, name, sz)
————————————————————————– defaults.
- - (Object) ProgressConvertDB(percent, file)
-
- (Object) ProgressDeltaApply(percent)
redirect ProgressDeltaApply callback (a different signature is required).
- - (Object) ProgressDownload(percent, bps_avg, bps_current)
- - (Object) ProgressEnd(id)
-
- (Object) ProgressPackage(percent)
During package install.
- - (Object) ProgressProgress(id, val_raw, val_percent)
-
- (Object) ProgressProvide(percent)
during file providal.
- - (Object) ProgressRebuildDB(percent)
-
- (Object) ProgressScanDb(value)
Callback for RPM DB scan progress.
- - (Object) ProgressStart(id, task, in_percent, is_alive, min, max, val_raw, val_percent)
- - (Object) RefreshDone
- - (Object) RefreshStarted
- - (Object) RegisterEmptyProgressCallbacks
- - (Object) ResetDownloadCallbacks
- - (Object) ResetScanDBCallbacks
- - (Object) RestorePatchCallbacks
- - (Object) RestorePreviousProgressCallbacks
- - (Object) RestoreProcessCallbacks
- - (Object) RestoreProgressReportCallbacks
- - (Object) RestoreProvideCallbacks
- - (Object) RestoreSourceCreateCallbacks
- - (Object) RestoreSourceReportCallbacks
- - (Object) RetryLabel(timeout)
- - (Object) SaveConfig
- - (Object) ScriptFinish
- - (Object) ScriptProblem(description)
- - (Object) ScriptProgress(ping, output)
- - (Object) ScriptStart(patch_name, patch_version, patch_arch, script_path)
- - (Object) SetConfig(key, value)
- - (Object) SetConvertDBCallbacks
- - (Object) SetDownloadCallbacks
- - (Object) SetDummyDownloadCallbacks
- - (Object) SetDummyPatchCallbacks
- - (Object) SetDummyProcessCallbacks
- - (Object) SetDummyProgressReportCallbacks
- - (Object) SetDummyProvideCallbacks
- - (Object) SetDummyScanDBCallbacks
- - (Object) SetDummyScriptCallbacks
- - (Object) SetDummySourceCreateCallbacks
- - (Object) SetDummySourceReportCallbacks
- - (Object) SetHeaderSourcePopup(text)
- - (Object) SetLabelSourcePopup(text)
-
- (Object) SetMediaCallbacks
Register callbacks for media change.
- - (Object) SetPatchCallbacks
- - (Object) SetProcessCallbacks
- - (Object) SetProgressReportCallbacks
- - (Object) SetProvideCallbacks
- - (Object) SetRebuildDBCallbacks
- - (Object) SetScanDBCallbacks
- - (Object) SetScriptCallbacks
- - (Object) SetSourceCreateCallbacks
- - (Object) SetSourceProbeCallbacks
- - (Object) SetSourceReportCallbacks
- - (Object) ShowLogInfo(message, buttonbox)
-
- (Object) SourceChange(source, medianr)
dummy repository change callback, see SlideShowCallbacks for the real one.
- - (Object) SourceCreateDestroy
- - (Object) SourceCreateEnd(url, error, description)
- - (Object) SourceCreateError(url, error, description)
- - (Object) SourceCreateInit
- - (Object) SourceCreateProgress(percent)
- - (Object) SourceCreateStart(url)
- - (Object) SourcePopupSetProgress(value)
- - (Object) SourceProbeEnd(url, error, description)
- - (Object) SourceProbeError(url, error, description)
- - (Object) SourceProbeFailed(url, type)
- - (Object) SourceProbeProgress(url, value)
- - (Object) SourceProbeStart(url)
- - (Object) SourceProbeSucceeded(url, type)
- - (Object) SourceReportDestroy
- - (Object) SourceReportEnd(src_id, url, task, error, description)
- - (Object) SourceReportError(source_id, url, error, description)
- - (Object) SourceReportInit
- - (Object) SourceReportProgress(value)
- - (Object) SourceReportStart(source_id, url, task)
- - (Object) StartConvertDB(unused1)
-
- (Object) StartDeltaApply(name)
at start of delta application.
-
- (Object) StartDeltaProvide(name, archivesize)
at start of delta providal.
- - (Object) StartDownload(url, localfile)
-
- (Object) StartPackage(name, location, summary, installsize, is_delete)
At start of package install.
-
- (Object) StartPatchProvide(name, archivesize)
at start of patch providal.
-
- (Object) StartProvide(name, archivesize, remote)
at start of file providal.
- - (Object) StartRebuildDB
-
- (Object) StartScanDb
Callback for start RPM DB scan event.
- - (Object) StopConvertDB(error_value, error_text)
- - (Object) StopRebuildDB(error_value, error_text)
- - (Object) textmode
Instance Method Details
- (Object) AskAbortRefresh
1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 |
# File '../../src/modules/PackageCallbacks.rb', line 1948 def AskAbortRefresh UI.OpenDialog( MarginBox( 1, 0.5, VBox( # a popup question with "Continue", "Skip" and "Abort" buttons Label( _( "The repositories are being refreshed.\n" + "Continue with refreshing?\n" + "\n" + "Note: If the refresh is skipped some packages\n" + "might be missing or out of date." ) ), ButtonBox( PushButton( Id(:continue), Opt(:default, :okButton), Label.ContinueButton ), # push button label PushButton(Id(:skip), Opt(:cancelButton), _("&Skip Refresh")) ) ) ) ) UI.SetFocus(Id(:continue)) ui = Convert.to_symbol(UI.UserInput) UI.CloseDialog ui = :continue if ui == :close Builtins.y2milestone("User request: %1", ui) ui end |
- (Object) Authentication(url, msg, username, password)
2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 |
# File '../../src/modules/PackageCallbacks.rb', line 2541 def Authentication(url, msg, username, password) # FIXME after SLE12 release # The following 'if' block is a workaround for bnc#895719 that should be # extracted to a proper private method (not sure if it will work as # expected being a callback) and adapted to use normal _() instead of # dgettext() url_query = URI(url).query if url_query url_params = Hash[URI.decode_www_form(url_query)] if url_params.has_key?("credentials") # Seems to be the url of a registration server, so add the tip to msg tip = Builtins.dgettext("registration", "Check that this system is known to the registration server.") msg = "#{tip}\n#{msg}" end end popup = VBox( HSpacing(50), # enforce width VSpacing(0.1), # heading in a popup window Heading(_("User Authentication")), VSpacing(0.1), HBox( HSpacing(0.1), RichText( Opt(:plainText), Builtins.sformat(_("URL: %1\n\n%2"), url, msg) ), HSpacing(0.1) ), VSpacing(0.1), HBox( HSpacing(1), VBox( # textentry label InputField(Id(:username), Opt(:hstretch), _("&User Name"), username), VSpacing(0.1), # textentry label Password(Id(:password), Opt(:hstretch), _("&Password"), password) ), HSpacing(1) ), VSpacing(0.5), ButtonBox( PushButton(Id(:cont), Opt(:default, :okButton), Label.ContinueButton), PushButton(Id(:cancel), Opt(:cancelButton), Label.CancelButton) ), VSpacing(0.5) ) UI.OpenDialog(Opt(:decorated), popup) ui = Convert.to_symbol(UI.UserInput) username = Convert.to_string(UI.QueryWidget(Id(:username), :Value)) password = Convert.to_string(UI.QueryWidget(Id(:password), :Value)) UI.CloseDialog { "username" => username, "password" => password, "continue" => ui == :cont } end |
- (Object) CDdevices(preferred)
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 |
# File '../../src/modules/PackageCallbacks.rb', line 690 def CDdevices(preferred) cds = Convert.convert( SCR.Read(path(".probe.cdrom")), :from => "any", :to => "list <map>" ) ret = [] Builtins.foreach(cds) do |cd| dev = Ops.get_string(cd, "dev_name", "") model = Ops.get_string(cd, "model", "") deflt = preferred == dev if dev != nil && dev != "" && model != nil ret = Builtins.add( ret, Item( Id(dev), Ops.add( Ops.add(deflt ? "\u27A4 " : "", model), Builtins.sformat(" (%1)", dev) ) ) ) end end if cds != nil Builtins.y2milestone("Detected CD devices: %1", ret) deep_copy(ret) end |
- (Object) CheckAndSaveAutoEject
check and save the autoeject configuration if needed
722 723 724 725 726 727 728 729 730 731 732 733 734 |
# File '../../src/modules/PackageCallbacks.rb', line 722 def CheckAndSaveAutoEject autoeject = Convert.to_boolean(UI.QueryWidget(Id(:auto_eject), :Value)) current = Convert.to_boolean(GetConfig("automatic_eject")) current = false if current == nil if autoeject != current SetConfig("automatic_eject", autoeject) SaveConfig() end nil end |
- (Object) ClearDownloadCallbacks
2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 |
# File '../../src/modules/PackageCallbacks.rb', line 2193 def ClearDownloadCallbacks Pkg.CallbackInitDownload(nil) Pkg.CallbackStartDownload(nil) Pkg.CallbackProgressDownload(nil) Pkg.CallbackDoneDownload(nil) Pkg.CallbackDestDownload(nil) Pkg.CallbackStartRefresh(nil) Pkg.CallbackDoneRefresh(nil) nil end |
- (Object) ClearScriptCallbacks
2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 |
# File '../../src/modules/PackageCallbacks.rb', line 2860 def ClearScriptCallbacks Pkg.CallbackScriptStart(nil) Pkg.CallbackScriptProgress(nil) Pkg.CallbackScriptProblem(nil) Pkg.CallbackScriptFinish(nil) Pkg.CallbackMessage(nil) nil end |
- (Object) CloseDownloadProgressPopup
1995 1996 1997 1998 1999 |
# File '../../src/modules/PackageCallbacks.rb', line 1995 def CloseDownloadProgressPopup UI.CloseDialog if IsDownloadProgressPopup() nil end |
- (Object) CloseSourcePopup
1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 |
# File '../../src/modules/PackageCallbacks.rb', line 1293 def CloseSourcePopup if !IsSourcePopup() Builtins.y2error( "The toplevel dialog is not a repository popup dialog!" ) return end @_source_open = Ops.subtract(@_source_open, 1) if @_source_open == 0 Builtins.y2milestone("Closing repository progress popup") UI.CloseDialog end Builtins.y2milestone("CloseSourcePopup: _source_open: %1", @_source_open) nil end |
- (Object) DestDownload
2033 2034 2035 2036 2037 |
# File '../../src/modules/PackageCallbacks.rb', line 2033 def DestDownload CloseDownloadProgressPopup() if !FullScreen() nil end |
- (Object) display_width
151 152 153 |
# File '../../src/modules/PackageCallbacks.rb', line 151 def display_width Mode.commandline ? 0 : Ops.get_integer(UI.GetDisplayInfo, "Width", 0) end |
- (Object) DoneDownload(error_value, error_text)
just log the status, errors are handled in MediaChange callback
2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 |
# File '../../src/modules/PackageCallbacks.rb', line 2147 def DoneDownload(error_value, error_text) if error_value == 0 Builtins.y2milestone("Download finished") else if @autorefreshing && @autorefreshing_aborted Builtins.y2milestone("Refresh aborted") else Builtins.y2warning( "Download failed: error %1: %2", error_value, error_text ) end end nil end |
- (Object) DonePackage(error, reason)
After package install.
return “I” for ignore return “R” for retry return “C” for abort (not implemented !)
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 |
# File '../../src/modules/PackageCallbacks.rb', line 573 def DonePackage(error, reason) # remove invalid characters (bnc#876459) if !reason.valid_encoding? reason.encode!('UTF-16', :undef => :replace, :invalid => :replace, :replace => "?") reason.encode!('UTF-8') log.warn "Invalid byte sequence found, fixed text: #{reason}" end UI.CloseDialog if @_package_popup @_package_popup = false if error != 0 Builtins.y2milestone( "DonePackage(error: %1, reason: '%2')", error, reason ) = Builtins.sformat( @_deleting_package ? # error popup during package installation, %1 is the name of the package _("Removal of package %1 failed.") : # error popup during package installation, %1 is the name of the package _("Installation of package %1 failed."), @_package_name ) if Mode.commandline CommandLine.Print() CommandLine.Print(reason) # ask user in the interactive mode if CommandLine.Interactive CommandLine.Print("") # command line mode - ask user whether installation of the failed package should be retried CommandLine.Print(_("Retry installation of the package?")) if CommandLine.YesNo # return Retry return "R" end # command line mode - ask user whether the installation should be aborted CommandLine.Print(_("Abort the installation?")) if CommandLine.YesNo # return Abort return "C" end # otherwise return Ignore (default) return "I" end else = ButtonBox( PushButton(Id(:abort), Opt(:cancelButton), Label.AbortButton), PushButton(Id(:retry), Opt(:customButton), Label.RetryButton), PushButton(Id(:ignore), Opt(:okButton), Label.IgnoreButton) ) if @showLongInfo UI.OpenDialog( Opt(:decorated), LayoutPopup(, , 10, true) ) UI.ReplaceWidget(Id(:info), RichText(Opt(:plainText), reason)) else UI.OpenDialog( Opt(:decorated), LayoutPopup(, , @vsize_no_details, false) ) UI.ReplaceWidget(Id(:info), Empty()) end r = nil begin r = UI.UserInput if r == :show @showLongInfo = ShowLogInfo(, ) if @showLongInfo UI.ReplaceWidget(Id(:info), RichText(Opt(:plainText), reason)) else UI.ReplaceWidget(Id(:info), Empty()) end end end until r == :abort || r == :retry || r == :ignore Builtins.y2milestone("DonePackage %1", r) UI.CloseDialog if r == :ignore # TODO: add "Don't show again" checkbox # a warning popup displayed after pressing [Ignore] after a package installation error Popup.Warning( _( "Ignoring a package failure may result in a broken system.\nThe system should be later verified by running the Software Management module." ) ) end return "C" if r == :abort return "R" if r == :retry end # default: ignore else # no error, there is additional info (rpm output), see bnc#456446 Builtins.y2milestone("Additional RPM otput: %1", reason) CommandLine.Print(reason) if Mode.commandline end "I" end |
- (Object) DoneProvide(error, reason, name)
during file providal * // return “I” for ignore // return “R” for retry // return “C” for abort
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 396 397 398 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 |
# File '../../src/modules/PackageCallbacks.rb', line 358 def DoneProvide(error, reason, name) Builtins.y2milestone("DoneProvide: %1, %2, %3", error, reason, name) if @_provide_popup UI.CloseDialog @_provide_popup = false end if Mode.commandline # remove the progress CommandLine.PrintVerboseNoCR(@clear_string) end if @provide_aborted @provide_aborted = false return "C" end # INVALID if error == 3 # error message, %1 is a package name = Builtins.sformat( _("Package %1 is broken, integrity check has failed."), name ) if Mode.commandline CommandLine.Print() # ask user in the interactive mode if CommandLine.Interactive CommandLine.Print("") # command line mode - ask user whether installation of the failed package should be retried CommandLine.Print(_("Retry installation of the package?")) if CommandLine.YesNo # return Retry return "R" end # command line mode - ask user whether the installation should be aborted CommandLine.Print(_("Abort the installation?")) if CommandLine.YesNo # return Abort return "C" end # otherwise return Ignore (default) return "I" end return "I" end = ButtonBox( PushButton(Id(:abort), Opt(:cancelButton, :key_F9), Label.AbortButton), PushButton(Id(:retry), Opt(:customButton), Label.RetryButton), PushButton(Id(:ignore), Opt(:okButton), Label.SkipButton) ) if @showLongInfo UI.OpenDialog( Opt(:decorated), LayoutPopup(, , 10, true) ) UI.ReplaceWidget( Id(:info), RichText( Opt(:plainText), Ops.add(Builtins.sformat(_("Error: %1:"), error), reason) ) ) else UI.OpenDialog( Opt(:decorated), LayoutPopup(, , @vsize_no_details, false) ) UI.ReplaceWidget(Id(:info), Empty()) end r = nil begin r = UI.UserInput if r == :show @showLongInfo = ShowLogInfo(, ) if @showLongInfo error_symbol = "ERROR" if error == 1 error_symbol = "NOT_FOUND" elsif error == 2 error_symbol = "IO" elsif error == 3 error_symbol = "INVALID" end UI.ReplaceWidget( Id(:info), RichText( Opt(:plainText), Ops.add( # error message, %1 is code of the error, # detail string is appended to the end Builtins.sformat(_("Error: %1:"), error_symbol), reason ) ) ) else UI.ReplaceWidget(Id(:info), Empty()) end end end until r == :abort || r == :retry || r == :ignore Builtins.y2milestone("DoneProvide %1", r) UI.CloseDialog return "C" if r == :abort return "R" if r == :retry if r == :ignore # don't show the warning when a refresh fails if !@autorefreshing # TODO: add "Don't show again" checkbox # a warning popup displayed after pressing [Ignore] after a download error Popup.Warning( _( "Ignoring a download failure may result in a broken system.\nVerify the system later by running the Software Management module.\n" ) ) end return "I" end Builtins.y2error("Unknown user input: %1", r) end "I" end |
- (Object) DoneScanDb(error, description)
Callback for finish RPM DB scan event
2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 |
# File '../../src/modules/PackageCallbacks.rb', line 2518 def DoneScanDb(error, description) Builtins.y2milestone( "RPM DB scan finished: error: %1, reason: '%2'", error, description ) if Mode.commandline # status message (command line mode) CommandLine.PrintVerbose(_("RPM database read")) else if @_scan_popup && UI.WidgetExists(Id(:label_scanDB_popup)) UI.CloseDialog @_scan_popup = false elsif !FullScreen() Builtins.y2error("The toplevel dialog is not a scan DB popup!") end end nil end |
- (Object) DummyBooleanInteger(param1)
3240 3241 3242 3243 |
# File '../../src/modules/PackageCallbacks.rb', line 3240 def DummyBooleanInteger(param1) Builtins.y2debug("Empty generic boolean(integer)->true callback") true end |
- (Object) DummyDoneDownload(error_value, error_text)
3557 3558 3559 3560 3561 |
# File '../../src/modules/PackageCallbacks.rb', line 3557 def DummyDoneDownload(error_value, error_text) Builtins.y2debug("Empty DoneDownload callback") nil end |
- (Object) DummyDonePackage(error, reason)
3290 3291 3292 3293 |
# File '../../src/modules/PackageCallbacks.rb', line 3290 def DummyDonePackage(error, reason) Builtins.y2debug("Empty DonePackage callback, returning 'I'") "I" end |
- (Object) DummyDoneProvide(error, reason, name)
3279 3280 3281 3282 |
# File '../../src/modules/PackageCallbacks.rb', line 3279 def DummyDoneProvide(error, reason, name) Builtins.y2debug("Empty DoneProvide callback, returning 'I'") "I" end |
- (Object) DummyMessage(patch_name, patch_version, patch_arch, message)
3503 3504 3505 3506 |
# File '../../src/modules/PackageCallbacks.rb', line 3503 def DummyMessage(patch_name, patch_version, patch_arch, ) Builtins.y2debug("Empty Message callback") true # continue end |
- (Object) DummyProcessStart(param1, param2, param3)
=============================================================================
constructor and callback init
3233 3234 3235 3236 3237 3238 |
# File '../../src/modules/PackageCallbacks.rb', line 3233 def DummyProcessStart(param1, param2, param3) param2 = deep_copy(param2) Builtins.y2debug("Empty ProcessStart callback") nil end |
- (Object) DummyProgressDownload(percent, bps_avg, bps_current)
3553 3554 3555 3556 |
# File '../../src/modules/PackageCallbacks.rb', line 3553 def DummyProgressDownload(percent, bps_avg, bps_current) Builtins.y2debug("Empty ProgressDownload callback, returning true") true end |
- (Object) DummyProgressProgress(id, val_raw, val_percent)
3469 3470 3471 3472 |
# File '../../src/modules/PackageCallbacks.rb', line 3469 def DummyProgressProgress(id, val_raw, val_percent) Builtins.y2debug("Empty ProgressProgress callback, returning true") true end |
- (Object) DummyProgressStart(id, task, in_percent, is_alive, min, max, val_raw, val_percent)
3464 3465 3466 3467 3468 |
# File '../../src/modules/PackageCallbacks.rb', line 3464 def DummyProgressStart(id, task, in_percent, is_alive, min, max, val_raw, val_percent) Builtins.y2debug("Empty ProgressStart callback") nil end |
- (Object) DummyScriptProgress(ping, output)
3499 3500 3501 3502 |
# File '../../src/modules/PackageCallbacks.rb', line 3499 def DummyScriptProgress(ping, output) Builtins.y2debug("Empty ScriptProgress callback, returning true") true end |
- (Object) DummyScriptStart(patch_name, patch_version, patch_arch, script_path)
3494 3495 3496 3497 3498 |
# File '../../src/modules/PackageCallbacks.rb', line 3494 def DummyScriptStart(patch_name, patch_version, patch_arch, script_path) Builtins.y2debug("Empty ScriptStart callback") nil end |
- (Object) DummySourceCreateEnd(url, error, description)
3392 3393 3394 3395 3396 |
# File '../../src/modules/PackageCallbacks.rb', line 3392 def DummySourceCreateEnd(url, error, description) Builtins.y2debug("Empty SourceCreateEnd callback") nil end |
- (Object) DummySourceCreateError(url, error, description)
3387 3388 3389 3390 |
# File '../../src/modules/PackageCallbacks.rb', line 3387 def DummySourceCreateError(url, error, description) Builtins.y2debug("Empty SourceCreateError callback, returning `ABORT") :ABORT end |
- (Object) DummySourceReportEnd(src_id, url, task, error, description)
3429 3430 3431 3432 3433 |
# File '../../src/modules/PackageCallbacks.rb', line 3429 def DummySourceReportEnd(src_id, url, task, error, description) Builtins.y2debug("Empty SourceReportEnd callback") nil end |
- (Object) DummySourceReportError(source_id, url, error, description)
3425 3426 3427 3428 |
# File '../../src/modules/PackageCallbacks.rb', line 3425 def DummySourceReportError(source_id, url, error, description) Builtins.y2debug("Empty SourceReportError callback, returning `ABORT") :ABORT end |
- (Object) DummySourceReportStart(source_id, url, task)
3420 3421 3422 3423 3424 |
# File '../../src/modules/PackageCallbacks.rb', line 3420 def DummySourceReportStart(source_id, url, task) Builtins.y2debug("Empty SourceReportStart callback") nil end |
- (Object) DummyStartDownload(url, localfile)
3548 3549 3550 3551 3552 |
# File '../../src/modules/PackageCallbacks.rb', line 3548 def DummyStartDownload(url, localfile) Builtins.y2debug("Empty StartDownload callback") nil end |
- (Object) DummyStartPackage(name, location, summary, installsize, is_delete)
3284 3285 3286 3287 3288 |
# File '../../src/modules/PackageCallbacks.rb', line 3284 def DummyStartPackage(name, location, summary, installsize, is_delete) Builtins.y2debug("Empty StartPackage callback") nil end |
- (Object) DummyStartProvide(param1, param2, param3)
3273 3274 3275 3276 3277 |
# File '../../src/modules/PackageCallbacks.rb', line 3273 def DummyStartProvide(param1, param2, param3) Builtins.y2debug("Empty StartProvide callback") nil end |
- (Object) DummyStringIntegerString(param1, param2)
3345 3346 3347 3348 |
# File '../../src/modules/PackageCallbacks.rb', line 3345 def DummyStringIntegerString(param1, param2) Builtins.y2debug("Empty generic string(integer, string) callback") "" end |
- (Object) DummyStringString(param1)
3245 3246 3247 3248 |
# File '../../src/modules/PackageCallbacks.rb', line 3245 def DummyStringString(param1) Builtins.y2debug("Empty generic string(string)->\"\" callback") "" end |
- (Object) DummyVoid
3250 3251 3252 3253 3254 |
# File '../../src/modules/PackageCallbacks.rb', line 3250 def DummyVoid Builtins.y2debug("Empty generic void() callback") nil end |
- (Object) DummyVoidInteger(param1)
3327 3328 3329 3330 3331 |
# File '../../src/modules/PackageCallbacks.rb', line 3327 def DummyVoidInteger(param1) Builtins.y2debug("Empty generic void(integer) callback") nil end |
- (Object) DummyVoidIntegerString(param1, param2)
3333 3334 3335 3336 3337 |
# File '../../src/modules/PackageCallbacks.rb', line 3333 def DummyVoidIntegerString(param1, param2) Builtins.y2debug("Empty generic void(integer, string) callback") nil end |
- (Object) DummyVoidString(param1)
3321 3322 3323 3324 3325 |
# File '../../src/modules/PackageCallbacks.rb', line 3321 def DummyVoidString(param1) Builtins.y2debug("Empty generic void(string) callback") nil end |
- (Object) DummyVoidStringInteger(param1, param2)
3339 3340 3341 3342 3343 |
# File '../../src/modules/PackageCallbacks.rb', line 3339 def DummyVoidStringInteger(param1, param2) Builtins.y2debug("Empty generic void(string, integer) callback") nil end |
- (Object) EnableAsterixPackage(f)
Enable or disable StartPackage, ProgressPackage and DonePackage callbacks, but only the progress bar and not the final error message. Returns old value.
505 506 507 508 509 |
# File '../../src/modules/PackageCallbacks.rb', line 505 def EnableAsterixPackage(f) ret = @enable_asterix_package @enable_asterix_package = f ret end |
- (Object) ErrorScanDb(error, description)
Callback for error handling during RPM DB scan
2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 |
# File '../../src/modules/PackageCallbacks.rb', line 2428 def ErrorScanDb(error, description) Builtins.y2error( "ErrorScanDb callback: error: %1, description: %2", error, description ) # error message, could not read RPM database = _("Initialization of the target failed.") if Mode.commandline CommandLine.Print() CommandLine.Print(description) # ask user in the interactive mode if CommandLine.Interactive CommandLine.Print("") # command line mode - ask user whether target initializatin can be restarted CommandLine.Print(_("Retry?")) if CommandLine.YesNo # return Retry return "R" end end # return Cancel return "C" end show_details = false = ButtonBox( PushButton(Id(:abort), Opt(:cancelButton), Label.AbortButton), PushButton(Id(:retry), Opt(:customButton), Label.RetryButton), PushButton(Id(:ignore), Opt(:okButton), Label.IgnoreButton) ) UI.OpenDialog( Opt(:decorated), LayoutPopup(, , @vsize_no_details, false) ) r = nil begin r = UI.UserInput if r == :show show_details = ShowLogInfo(, ) if show_details error_symbol = "UNKNOWN" if error == 0 error_symbol = "NO_ERROR" elsif error == 1 error_symbol = "FAILED" end UI.ReplaceWidget( Id(:info), RichText( Opt(:plainText), Ops.add( # error message, %1 is code of the error, # detail string is appended to the end Builtins.sformat(_("Error: %1:"), error_symbol), description ) ) ) else UI.ReplaceWidget(Id(:info), Empty()) end end end until r == :abort || r == :retry || r == :ignore Builtins.y2milestone("ErrorScanDb: user input: %1", r) UI.CloseDialog return "C" if r == :abort return "R" if r == :retry return "I" if r == :ignore Builtins.y2error("Unknown user input: %1", r) "C" end |
- (Object) FinishPatchDeltaProvide
1762 1763 1764 1765 1766 1767 1768 1769 |
# File '../../src/modules/PackageCallbacks.rb', line 1762 def FinishPatchDeltaProvide if @_provide_popup UI.CloseDialog @_provide_popup = false end nil end |
- (Object) FormatPatchName(patch_name, patch_version, patch_arch)
1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 |
# File '../../src/modules/PackageCallbacks.rb', line 1793 def FormatPatchName(patch_name, patch_version, patch_arch) patch_full_name = patch_name != nil && patch_name != "" ? patch_name : "" if patch_full_name != "" if patch_version != nil && patch_version != "" patch_full_name = Ops.add( Ops.add(patch_full_name, "-"), patch_version ) end if patch_arch != nil && patch_arch != "" patch_full_name = Ops.add(Ops.add(patch_full_name, "."), patch_arch) end end patch_full_name end |
- (Object) FullScreen
221 222 223 224 225 226 227 |
# File '../../src/modules/PackageCallbacks.rb', line 221 def FullScreen return false if Mode.commandline ret = UI.WidgetExists(:progress_replace_point) Builtins.y2debug("Running in fullscreen mode: %1", ret) ret end |
- (Object) GetConfig(key)
175 176 177 178 179 |
# File '../../src/modules/PackageCallbacks.rb', line 175 def GetConfig(key) LoadConfig() if @config == nil Ops.get(@config, key) end |
- (Object) InitDownload(task)
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 |
# File '../../src/modules/PackageCallbacks.rb', line 2001 def InitDownload(task) if !Mode.commandline if !FullScreen() && !IsDownloadProgressPopup() # heading of popup heading = _("Downloading") UI.OpenDialog( Opt(:decorated), VBox( Heading(Id(:download_progress_popup_window), heading), VBox( HSpacing(60), HBox( HSpacing(1), ProgressBar(Id(:progress), task, 100), HSpacing(1) ), VSpacing(0.5), ButtonBox( PushButton(Id(:abort), Opt(:cancelButton), Label.AbortButton) ), VSpacing(0.5) ) ) ) UI.ChangeWidget(Id(:progress), :Value, 0) end end nil end |
- (Object) InitPackageCallbacks
Register package manager callbacks
3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 |
# File '../../src/modules/PackageCallbacks.rb', line 3131 def InitPackageCallbacks SetProcessCallbacks() SetProvideCallbacks() SetPatchCallbacks() SetSourceCreateCallbacks() SetSourceProbeCallbacks() SetSourceReportCallbacks() SetProgressReportCallbacks() # authentication callback Pkg.CallbackAuthentication( fun_ref( method(:Authentication), "map <string, any> (string, string, string, string)" ) ) # @see bugzilla #183821 # Do not register these callbacks in case of AutoInstallation # And for AutoUpgrade neither (bnc#820166) if !(Mode.autoinst || Mode.autoupgrade) # Signature-related callbacks Pkg.CallbackAcceptUnsignedFile( fun_ref( SignatureCheckCallbacks.method(:AcceptUnsignedFile), "boolean (string, integer)" ) ) Pkg.CallbackAcceptUnknownGpgKey( fun_ref( SignatureCheckCallbacks.method(:AcceptUnknownGpgKey), "boolean (string, string, integer)" ) ) # During installation untrusted repositories are disabled to avoid # asking again gpg_callback = Stage.initial ? :import_gpg_key_or_disable : :ImportGpgKey Pkg.CallbackImportGpgKey( fun_ref( SignatureCheckCallbacks.method(gpg_callback), "boolean (map <string, any>, integer)" ) ) Pkg.CallbackAcceptVerificationFailed( fun_ref( SignatureCheckCallbacks.method(:AcceptVerificationFailed), "boolean (string, map <string, any>, integer)" ) ) Pkg.CallbackTrustedKeyAdded( fun_ref( SignatureCheckCallbacks.method(:TrustedKeyAdded), "void (map <string, any>)" ) ) Pkg.CallbackTrustedKeyRemoved( fun_ref( SignatureCheckCallbacks.method(:TrustedKeyRemoved), "void (map <string, any>)" ) ) Pkg.CallbackAcceptFileWithoutChecksum( fun_ref( SignatureCheckCallbacks.method(:AcceptFileWithoutChecksum), "boolean (string)" ) ) Pkg.CallbackAcceptWrongDigest( fun_ref( SignatureCheckCallbacks.method(:AcceptWrongDigest), "boolean (string, string, string)" ) ) Pkg.CallbackAcceptUnknownDigest( fun_ref( SignatureCheckCallbacks.method(:AcceptUnknownDigest), "boolean (string, string)" ) ) end SetMediaCallbacks() SetScriptCallbacks() SetScanDBCallbacks() SetDownloadCallbacks() nil end |
- (Object) IsDownloadProgressPopup
1990 1991 1992 1993 |
# File '../../src/modules/PackageCallbacks.rb', line 1990 def IsDownloadProgressPopup !Mode.commandline && UI.WidgetExists(Id(:download_progress_popup_window)) && UI.WidgetExists(Id(:progress)) end |
- (Object) IsProgressPopup
is the top level progress popup?
2619 2620 2621 2622 |
# File '../../src/modules/PackageCallbacks.rb', line 2619 def IsProgressPopup UI.WidgetExists(Id(:progress_widget)) && UI.WidgetExists(Id(:callback_progress_popup)) end |
- (Object) IsSourcePopup
is the top level window source popup?
1280 1281 1282 |
# File '../../src/modules/PackageCallbacks.rb', line 1280 def IsSourcePopup UI.WidgetExists(Id(:progress)) && UI.WidgetExists(Id(:label_source_popup)) end |
- (Object) LayoutPopup(message, button_box, vertical_size, info_on)
creates layout for ChangeMediumPopup
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 |
# File '../../src/modules/PackageCallbacks.rb', line 295 def LayoutPopup(, , vertical_size, info_on) = deep_copy() dialog_layout = VBox( HSpacing(50), # enforce width VSpacing(0.1), HBox( # maybe more icon types could be used # "info, "warning", "error" Icon.Image("warning", { "margin_right" => 2 }), Left(Label()) ), VSpacing(0.1), HBox( HSpacing(0.6), Left( CheckBox( Id(:show), Opt(:notify), # check box _("Show &details"), info_on ) ) ), VSpacing(0.4), HBox( VSpacing(vertical_size), HSpacing(0.1), ReplacePoint(Id(:info), Empty()), HSpacing(0.1) ), HBox(HSpacing(0.1), , HSpacing(0.1)), VSpacing(0.2) ) deep_copy(dialog_layout) end |
- (Object) LoadConfig
functions related to the persistent storage
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File '../../src/modules/PackageCallbacks.rb', line 156 def LoadConfig if FileUtils.Exists(@conf_file) && FileUtils.IsFile(@conf_file) Builtins.y2milestone("Reading config file %1", @conf_file) read_conf = Convert.to_map(SCR.Read(path(".target.ycp"), @conf_file)) @config = read_conf != nil ? read_conf : {} Builtins.y2milestone("Current config: %1", @config) else Builtins.y2milestone( "No configuration found (file %1 is missing)", @conf_file ) end @config = {} if @config == nil nil end |
- (Object) main
41 42 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 92 93 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 |
# File '../../src/modules/PackageCallbacks.rb', line 41 def main Yast.import "Pkg" Yast.import "UI" textdomain "base" Yast.import "Installation" Yast.import "Directory" Yast.import "Label" Yast.import "Mode" Yast.import "Stage" Yast.import "Popup" Yast.import "URL" Yast.import "CommandLine" Yast.import "String" Yast.import "Report" Yast.import "Icon" Yast.import "Wizard" Yast.import "Progress" Yast.import "FileUtils" Yast.import "SignatureCheckCallbacks" @_provide_popup = false @_source_popup = false @_package_popup = false @_script_popup = false @_scan_popup = false @_package_name = "" @_package_size = 0 @_deleting_package = false @_current_source = 1 # make showLongInfo module-global so it gets remembered (cf. #14018) @showLongInfo = false # used to en-/disable StartPackage, ProgressPackage and DonePackage @enable_asterix_package = true @provide_aborted = false @source_aborted = false @back_string = "" @clear_string = Ops.add(Ops.add(@back_string, " "), @back_string) # max. length of the text in the repository popup window @max_size = 60 @autorefreshing = false @autorefreshing_aborted = false # Location of the persistent storage @conf_file = Ops.add(Directory.vardir, "/package_callbacks.conf") @config = nil # auto ejecting is in progress @doing_eject = false # seconds for automatic retry after a timeout @retry_timeout = 30 # number of automatic retries @retry_attempts = 100 # max. retry timeout (15 minutes) @retry_max_timeout = 15 * 60 # current values for retry functionality @retry_url = "" @current_retry_timeout = @retry_timeout @current_retry_attempt = 0 @vsize_no_details = 1 #============================================================================= # MEDIA CHANGE #============================================================================= @detected_cd_devices = [] # reference couter to the open popup window @_source_open = 0 @download_file = "" # TODO: use the ID in the prgress popup callbacks, # then callbacks may be nested... @tick_labels = ["/", "-", "\\", "|"] @tick_progress = false @val_progress = false @current_tick = 0 @progress_task = "" # ProgressStart/End events may be nested, remember the types of progresses @progress_stack = [] @last_stage = 0 @opened_wizard = [] PackageCallbacks() end |
- (Object) MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device)
media change callback
if current == -1, show “Ignore”
return “” for ok, retry return “E” for eject media return “I” for ignore bad media return “S” for skip this media return “C” for cancel (not implemented !) return url to change media URL
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 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 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 |
# File '../../src/modules/PackageCallbacks.rb', line 752 def MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device) devices = deep_copy(devices) if @autorefreshing && @autorefreshing_aborted Builtins.y2milestone("Refresh aborted") return "C" end Builtins.y2milestone( "MediaChange error: err'%1', url'%2', prd'%3', cur'%4'/'%5', wan'%6'/'%7', devs: %8, curr_dev: %9", Ops.add(Ops.add(error_code, ":"), error), URL.HidePassword(url), product, current, current_label, wanted, wanted_label, devices, current_device ) url_tokens = URL.Parse(url) url_scheme = Ops.get_string(url_tokens, "scheme", "") url_scheme = Builtins.tolower(url_scheme) # true if it makes sense to offer an eject button (for cd/dvd only ...) = url_scheme == "cd" || url_scheme == "dvd" # do automatic eject if && Convert.to_boolean(GetConfig("automatic_eject")) == true if !@doing_eject Builtins.y2milestone("Automatically ejecting the medium...") @doing_eject = true return "E" end end if Builtins.issubstring(error, "ERROR(InstSrc:E_bad_id)") error = # error report _( "<p>The repository at the specified URL now provides a different media ID.\n" + "If the URL is correct, this indicates that the repository content has changed. To \n" + "continue using this repository, start <b>Installation Repositories</b> from \n" + "the YaST control center and refresh the repository.</p>\n" ) end if wanted_label == "" # use only product name for network repository # there is no medium 1, 2, ... if double_sided # media is double sided, we want the user to insert the 'Side A' of the media # the complete string will be "<product> <media> <number>, <side>" # e.g. "'SuSE Linux 9.0' DVD 1, Side A" side = _("Side A") if Ops.bitwise_and(wanted, 1) == 0 # media is double sided, we want the user to insert the 'Side B' of the media side = _("Side B") end wanted = Ops.shift_right(Ops.add(wanted, 1), 1) wanted_label = url_scheme == "cd" || url_scheme == "dvd" ? # label for a repository - %1 product name (e.g. "openSUSE 10.2"), %2 medium number (e.g. 2) # %3 side (e.g. "Side A") Builtins.sformat("%1 (Disc %2, %3)", product, wanted, side) : # label for a repository - %1 product name (e.g. "openSUSE 10.2"), %2 medium number (e.g. 2) # %3 side (e.g. "Side A") Builtins.sformat("%1 (Medium %2, %3)", product, wanted, side) else wanted_label = Builtins.tolower(url_scheme) == "cd" || Builtins.tolower(url_scheme) == "dvd" ? # label for a repository - %1 product name (e.g. openSUSE 10.2), %2 medium number (e.g. 2) Builtins.sformat(_("%1 (Disc %2)"), product, wanted) : # label for a repository - %1 product name (e.g. openSUSE 10.2), %2 medium number (e.g. 2) Builtins.sformat(_("%1 (Medium %2)"), product, wanted) end end # prompt to insert product (%1 == "SuSE Linux version 9.2 CD 2") = Builtins.sformat(_("Insert\n'%1'"), wanted_label) # with network repository it doesn't make sense to ask for disk if url_scheme == "dir" # report error while accessing local directory with product (%1 = URL, %2 = "SuSE Linux ...") = Builtins.sformat( _( "Cannot access installation media\n" + "%1\n" + "%2.\n" + "Check whether the directory is accessible." ), URL.HidePassword(url), wanted_label ) elsif url_scheme != "cd" && url_scheme != "dvd" # report error while accessing network media of product (%1 = URL, %2 = "SuSE Linux ...") = Builtins.sformat( _( "Cannot access installation media \n" + "%1\n" + "%2.\n" + "Check whether the server is accessible." ), URL.HidePassword(url), wanted_label ) end # currently unused media_prompt = _("The correct repository medium could not be mounted.") # -------------------------------------- # build up button box = ButtonBox( PushButton(Id(:retry), Opt(:default, :okButton), Label.RetryButton) ) if current == -1 # wrong media id, offer "Ignore" = Builtins.add( , PushButton(Id(:ignore), Opt(:customButton), Label.IgnoreButton) ) end = Builtins.add( , PushButton( Id(:cancel), Opt(:cancelButton), @autorefreshing ? _("Skip Autorefresh") : Label.AbortButton ) ) # push button label during media change popup, user can skip # this media (CD) so no packages from this media will be installed = Builtins.add( , PushButton(Id(:skip), Opt(:customButton), _("&Skip")) ) if if !@doing_eject @detected_cd_devices = CDdevices(Ops.get(devices, current_device, "")) end # detect the CD/DVD devices if the ejecting is not in progress, # the CD detection closes the ejected tray! cds = deep_copy(@detected_cd_devices) # display a menu button if there are more CD devices if Ops.greater_than(Builtins.size(cds), 1) # menu button label - used for more then one device = HBox(, MenuButton(_("&Eject"), cds)) else # push button label - in the media change popup, user can eject the CD/DVD = Builtins.add( , PushButton(Id(:eject), Opt(:customButton), _("&Eject")) ) end auto_eject = Convert.to_boolean(GetConfig("automatic_eject")) auto_eject = false if auto_eject == nil = VBox( Left( CheckBox( Id(:auto_eject), _("A&utomatically Eject CD or DVD Medium"), auto_eject ) ), ) end @doing_eject = false # Autoretry code doing_auto_retry = false if error_code == "IO_SOFT" || Builtins.contains( ["ftp", "sftp", "http", "https", "nfs", "smb"], url_scheme ) # this a different file, reset the retry counter if @retry_url != url @retry_url = url @current_retry_attempt = 0 end # is the maximum retry count reached? if Ops.less_than(@current_retry_attempt, @retry_attempts) # reset the counter, use logarithmic back-off with maximum limit @current_retry_timeout = Ops.less_than(@current_retry_attempt, 10) ? Ops.multiply( @retry_timeout, Ops.shift_left(1, @current_retry_attempt) ) : @retry_max_timeout if Ops.greater_than(@current_retry_timeout, @retry_max_timeout) @current_retry_timeout = @retry_max_timeout end = VBox( # failed download will be automatically retried after the timeout, %1 = formatted time (MM:SS format) Left(Label(Id(:auto_retry), RetryLabel(@current_retry_timeout))), ) doing_auto_retry = true else Builtins.y2warning( "Max. autoretry count (%1) reached, giving up...", @retry_attempts ) end end Builtins.y2milestone("Autoretry: %1", doing_auto_retry) if doing_auto_retry Builtins.y2milestone("Autoretry attempt: %1", @current_retry_attempt) end if Mode.commandline CommandLine.Print() CommandLine.Print(error) # ask user in the interactive mode if CommandLine.Interactive CommandLine.Print("") # command line mode - ask user whether installation of the failed package should be retried CommandLine.Print(_("Retry the installation?")) if CommandLine.YesNo # return Retry return "" end # command line mode - ask user whether the installation should be aborted CommandLine.Print(_("Skip the medium?")) if CommandLine.YesNo # return Skip return "S" end # otherwise ignore the medium CommandLine.Print(_("Ignoring the bad medium...")) return "I" end return "S" end Builtins.y2debug( "Opening Dialog: %1", LayoutPopup(, , 10, true) ) if @showLongInfo UI.OpenDialog( Opt(:decorated), LayoutPopup(, , 10, true) ) # TextEntry label UI.ReplaceWidget( Id(:info), VBox( InputField(Id(:url), Opt(:hstretch), _("&URL")), RichText(Opt(:plainText), error) ) ) UI.ChangeWidget(Id(:url), :Value, url) else UI.OpenDialog( Opt(:decorated), LayoutPopup(, , @vsize_no_details, false) ) UI.ReplaceWidget(Id(:info), Empty()) end # notification UI.Beep r = nil eject_device = "" begin if doing_auto_retry r = UI.TimeoutUserInput(1000) else r = UI.UserInput end # timout in autoretry mode? if doing_auto_retry if r == :timeout # decrease timeout counter @current_retry_timeout = Ops.subtract(@current_retry_timeout, 1) if @current_retry_timeout == 0 Builtins.y2milestone("The time is out, doing automatic retry...") # do the retry r = :retry # decrease attempt counter @current_retry_attempt = Ops.add(@current_retry_attempt, 1) else # popup string - refresh the displayed counter UI.ChangeWidget( Id(:auto_retry), :Label, RetryLabel(@current_retry_timeout) ) end else # user has pressed a button, reset the retry counter in the next timeout Builtins.y2milestone("User input: %1, resetting autoretry url", r) @retry_url = "" end end if r == :show @showLongInfo = ShowLogInfo(, ) if @showLongInfo # TextEntry label UI.ReplaceWidget( Id(:info), VBox( TextEntry(Id(:url), _("&URL")), RichText(Opt(:plainText), error) ) ) UI.ChangeWidget(Id(:url), :Value, url) else UI.ReplaceWidget(Id(:info), Empty()) end elsif r == :retry || r == :url if @showLongInfo # id(`url) must exist newurl = Convert.to_string(UI.QueryWidget(Id(:url), :Value)) if newurl != url url = newurl r = :url end end elsif Ops.is_string?(r) && Builtins.regexpmatch(Convert.to_string(r), "^/dev/") Builtins.y2milestone("Eject request for %1", r) eject_device = Convert.to_string(r) r = :eject end end until r == :cancel || r == :retry || r == :eject || r == :skip || r == :ignore || r == :url # remember the state of autoeject option if # check and save the autoeject configuration if needed CheckAndSaveAutoEject() end Builtins.y2milestone("MediaChange %1", r) UI.CloseDialog if @_provide_popup UI.CloseDialog @_provide_popup = false end if r == :cancel # abort during autorefresh should abort complete autorefresh, not only the failed repo if @autorefreshing @autorefreshing_aborted = true Pkg.SkipRefresh else @provide_aborted = true end return "C" end return "I" if r == :ignore return "S" if r == :skip if r == :eject @doing_eject = true if eject_device == "" return "E" else # get the index in the list dindex = -1 found = Builtins.find(devices) do |d| dindex = Ops.add(dindex, 1) d == eject_device end if found != nil Builtins.y2milestone("Device %1 has index %2", eject_device, dindex) return Ops.add("E", Builtins.tostring(dindex)) else Builtins.y2warning( "Device %1 not found in the list, using default", eject_device ) return "E" end end end if r == :url Builtins.y2milestone("Redirecting to: %1", URL.HidePassword(url)) return url end "" end |
- (Object) Message(patch_name, patch_version, patch_arch, message)
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 |
# File '../../src/modules/PackageCallbacks.rb', line 1933 def Message(patch_name, patch_version, patch_arch, ) patch_full_name = FormatPatchName(patch_name, patch_version, patch_arch) Builtins.y2milestone("Message (%1): %2", patch_full_name, ) if patch_full_name != "" # label, %1 is patch name with version and architecture patch_full_name = Builtins.sformat(_("Patch: %1\n\n"), patch_full_name) end ret = Popup.ContinueCancel(Ops.add(patch_full_name, )) Builtins.y2milestone("User input: %1", ret) ret end |
- (Object) NextTick
2609 2610 2611 2612 2613 2614 2615 2616 |
# File '../../src/modules/PackageCallbacks.rb', line 2609 def NextTick @current_tick = Ops.add(@current_tick, 1) if Ops.greater_or_equal(@current_tick, Builtins.size(@tick_labels)) @current_tick = 0 end nil end |
- (Object) NotifyConvertDB
2337 2338 2339 |
# File '../../src/modules/PackageCallbacks.rb', line 2337 def NotifyConvertDB nil end |
- (Object) NotifyRebuildDB
2261 2262 2263 |
# File '../../src/modules/PackageCallbacks.rb', line 2261 def NotifyRebuildDB nil end |
- (Object) OpenSourcePopup
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 |
# File '../../src/modules/PackageCallbacks.rb', line 1227 def OpenSourcePopup if @_source_open == 0 UI.OpenDialog( VBox( HSpacing(@max_size), Heading(Id(:label_source_popup), Opt(:hstretch), " "), ProgressBar(Id(:progress), " ", 100, 0) ) ) end @_source_open = Ops.add(@_source_open, 1) Builtins.y2milestone("OpenSourcePopup: _source_open: %1", @_source_open) nil end |
- (Object) PackageCallbacks
constructor
3703 3704 3705 3706 3707 3708 |
# File '../../src/modules/PackageCallbacks.rb', line 3703 def PackageCallbacks Builtins.y2milestone("PackageCallbacks constructor") InitPackageCallbacks() nil end |
- (Object) ProblemDeltaApply(descr)
1778 1779 1780 1781 1782 1783 |
# File '../../src/modules/PackageCallbacks.rb', line 1778 def ProblemDeltaApply(descr) FinishPatchDeltaProvide() # close popup Builtins.y2milestone("Failed to apply delta RPM: %1", descr) nil end |
- (Object) ProblemDeltaDownload(descr)
1771 1772 1773 1774 1775 1776 |
# File '../../src/modules/PackageCallbacks.rb', line 1771 def ProblemDeltaDownload(descr) FinishPatchDeltaProvide() # close popup Builtins.y2milestone("Failed to download delta RPM: %1", descr) nil end |
- (Object) ProblemPatchDownload(descr)
1785 1786 1787 1788 1789 1790 |
# File '../../src/modules/PackageCallbacks.rb', line 1785 def ProblemPatchDownload(descr) FinishPatchDeltaProvide() # close popup Builtins.y2milestone("Failed to download patch RPM: %1", descr) nil end |
- (Object) ProcessDone
Hander for ProcessDone callback - the process has been finished
2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 |
# File '../../src/modules/PackageCallbacks.rb', line 2818 def ProcessDone Builtins.y2milestone("Process: Finished") return if Mode.commandline idx = Ops.subtract(Builtins.size(@opened_wizard), 1) close = Ops.get(@opened_wizard, idx, false) @opened_wizard = Builtins.remove(@opened_wizard, idx) Builtins.y2milestone( "Close Wizard window: %1, new stack: %2", close, @opened_wizard ) # set 100% Progress.Finish if close Builtins.y2milestone("Closing Wizard window...") Wizard.CloseDialog end nil end |
- (Object) ProcessMessage(msg, max_len)
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 |
# File '../../src/modules/PackageCallbacks.rb', line 1184 def ProcessMessage(msg, max_len) words = Builtins.splitstring(msg, " ") Builtins.y2debug("words: %1", words) words = Builtins.maplist(words) do |w| parsed = URL.Parse(w) req_size = Ops.subtract( max_len, Ops.subtract(Builtins.size(msg), Builtins.size(w)) ) # is it a valid URL? if Builtins.contains( ["ftp", "http", "nfs", "file", "dir", "iso", "smb", "disk"], Ops.get_string(parsed, "scheme", "") ) # reformat the URL w = URL.FormatURL(parsed, max_len) else if Builtins.substring(w, 0, 1) == "/" parts = Builtins.splitstring(w, "/") if Ops.greater_or_equal(Builtins.size(parts), 3) w = String.FormatFilename(w, req_size) end end end w end ret = Builtins.mergestring(words, " ") if ret != msg Builtins.y2milestone( "URL conversion: '%1' converted to '%2'", URL.HidePassword(msg), URL.HidePassword(ret) ) end ret end |
- (Object) ProcessNextStage
Hander for ProcessNextStage callback - the current stage has been finished
2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 |
# File '../../src/modules/PackageCallbacks.rb', line 2805 def ProcessNextStage Builtins.y2milestone("Setting stage: %1", @last_stage) return if Mode.commandline Progress.Stage(@last_stage, "", -1) @last_stage = Ops.add(@last_stage, 1) nil end |
- (Object) ProcessProgress(percent)
Hander for ProcessProgress callback - report total progress
2794 2795 2796 2797 2798 2799 2800 2801 2802 |
# File '../../src/modules/PackageCallbacks.rb', line 2794 def ProcessProgress(percent) Builtins.y2debug("Process: %1%%", percent) return true if Mode.commandline Progress.Step(percent) true end |
- (Object) ProcessStart(task, stages, help)
Hanler for ProcessStart callback - handle start of a package manager process
2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 |
# File '../../src/modules/PackageCallbacks.rb', line 2753 def ProcessStart(task, stages, help) stages = deep_copy(stages) Builtins.y2milestone( "Process: Start: task: %1, stages: %2, help: %3", task, stages, help ) Builtins.y2milestone( "Progress: status: %1, isrunning: %2", Progress.status, Progress.IsRunning ) return if Mode.commandline opened = false if Progress.status if !Progress.IsRunning Builtins.y2milestone("Opening Wizard window...") Wizard.CreateDialog Wizard.SetDesktopIcon("sw_single") opened = true end # set 100% as max value Progress.New(task, "", 100, stages, [], help) Progress.Title(task) @last_stage = 0 end @opened_wizard = Builtins.add(@opened_wizard, opened) Builtins.y2milestone("Wizard stack: %1", @opened_wizard) nil end |
- (Object) ProgressBox(heading, name, sz)
————————————————————————– defaults
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File '../../src/modules/PackageCallbacks.rb', line 199 def ProgressBox(heading, name, sz) progressbox = VBox( HSpacing(40), # popup heading Heading(heading), Left( HBox( VBox( Left(Label(Opt(:boldFont), _("Package: "))), Left(Label(Opt(:boldFont), _("Size: "))) ), VBox(Left(Label(name)), Left(Label(sz))) ) ), ProgressBar(Id(:progress), " ", 100, 0), ButtonBox( PushButton(Id(:abort), Opt(:key_F9, :cancelButton), Label.AbortButton) ) ) deep_copy(progressbox) end |
- (Object) ProgressConvertDB(percent, file)
2313 2314 2315 2316 2317 |
# File '../../src/modules/PackageCallbacks.rb', line 2313 def ProgressConvertDB(percent, file) UI.ChangeWidget(Id(:progress), :Value, percent) nil end |
- (Object) ProgressDeltaApply(percent)
redirect ProgressDeltaApply callback (a different signature is required)
286 287 288 289 290 |
# File '../../src/modules/PackageCallbacks.rb', line 286 def ProgressDeltaApply(percent) ProgressProvide(percent) nil end |
- (Object) ProgressDownload(percent, bps_avg, bps_current)
2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 |
# File '../../src/modules/PackageCallbacks.rb', line 2073 def ProgressDownload(percent, bps_avg, bps_current) if @autorefreshing && @autorefreshing_aborted Builtins.y2milestone("Refresh aborted") return false end if Mode.commandline CommandLine.PrintVerboseNoCR( Ops.add(@clear_string, Builtins.sformat("%1%%", percent)) ) if percent == 100 # sleep for a wile Builtins.sleep(200) # remove the progress CommandLine.PrintVerboseNoCR(@clear_string) # print newline when reached 100% end else msg_rate = "" if Ops.greater_than(bps_current, 0) # do not show the average download rate if the space is limited bps_avg = -1 if textmode && Ops.less_than(display_width, 100) format = textmode ? Ops.add("%1 - ", @download_file) : Ops.add(@download_file, " - %1") # progress bar label, %1 is URL with optional download rate msg_rate = Builtins.sformat( _("Downloading: %1"), String.FormatRateMessage(format, bps_avg, bps_current) ) end if FullScreen() Progress.SubprogressValue(percent) if Ops.greater_than(Builtins.size(msg_rate), 0) Progress.SubprogressTitle(msg_rate) end else UI.ChangeWidget(Id(:progress), :Value, percent) if Ops.greater_than(Builtins.size(msg_rate), 0) UI.ChangeWidget(Id(:progress), :Label, msg_rate) end end download_aborted = UI.PollInput == :abort if download_aborted && @autorefreshing # display "Continue", "Skip Refresh" dialog answer = AskAbortRefresh() if answer == :continue download_aborted = false elsif answer == :skip download_aborted = true @autorefreshing_aborted = true Pkg.SkipRefresh else Builtins.y2error("Unknown input value: %1", answer) end end return !download_aborted end true end |
- (Object) ProgressEnd(id)
2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 |
# File '../../src/modules/PackageCallbacks.rb', line 2676 def ProgressEnd(id) Builtins.y2milestone("ProgressFinish: %1", id) # remove the last element from the progress stack @progress_stack = Builtins.remove( @progress_stack, Ops.subtract(Builtins.size(@progress_stack), 1) ) if !Mode.commandline && IsProgressPopup() UI.CloseDialog if Builtins.size(@progress_stack) == 0 elsif FullScreen() if Ops.greater_than(Builtins.size(@progress_stack), 0) progress_type = Ops.get_symbol( @progress_stack, [Ops.subtract(Builtins.size(@progress_stack), 1), "type"], :none ) task = Ops.get_string( @progress_stack, [Ops.subtract(Builtins.size(@progress_stack), 1), "task"], "" ) Progress.SubprogressType(progress_type, 100) Progress.SubprogressTitle(task) end end nil end |
- (Object) ProgressPackage(percent)
During package install.
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
# File '../../src/modules/PackageCallbacks.rb', line 548 def ProgressPackage(percent) if @_package_popup UI.ChangeWidget(Id(:progress), :Value, percent) return UI.PollInput != :abort elsif Mode.commandline CommandLine.PrintVerboseNoCR( Ops.add(@clear_string, Builtins.sformat("%1%%", percent)) ) if percent == 100 # sleep for a wile Builtins.sleep(200) # remove the progress CommandLine.PrintVerboseNoCR(@clear_string) end end true end |
- (Object) ProgressProgress(id, val_raw, val_percent)
2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 |
# File '../../src/modules/PackageCallbacks.rb', line 2708 def ProgressProgress(id, val_raw, val_percent) Builtins.y2debug("ProgressProgress: %1, %2%% ", id, val_percent) if Mode.commandline if @tick_progress tick_label = Ops.get(@tick_labels, @current_tick, "/") CommandLine.PrintVerboseNoCR(Ops.add(@clear_string, tick_label)) NextTick() else CommandLine.PrintVerboseNoCR( Ops.add(@clear_string, Builtins.sformat("%1%%", val_percent)) ) end else if IsProgressPopup() if @tick_progress || @val_progress UI.ChangeWidget(Id(:progress_widget), :Alive, true) else UI.ChangeWidget(Id(:progress_widget), :Value, val_percent) end # aborted ? input = UI.PollInput if input == :abort Builtins.y2warning( "Callback %1 has been aborted at %2%% (raw: %3)", id, val_percent, val_raw ) return false end elsif FullScreen() # fullscreen callbacks Progress.SubprogressValue(val_percent) end end true end |
- (Object) ProgressProvide(percent)
during file providal
270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File '../../src/modules/PackageCallbacks.rb', line 270 def ProgressProvide(percent) Builtins.y2milestone("ProgressProvide: %1", percent) if @_provide_popup UI.ChangeWidget(Id(:progress), :Value, percent) @provide_aborted = UI.PollInput == :abort return !@provide_aborted elsif Mode.commandline # there is no popup window, but command line mode is set CommandLine.PrintVerboseNoCR( Ops.add(@clear_string, Builtins.sformat("%1%%", percent)) ) end true end |
- (Object) ProgressRebuildDB(percent)
2237 2238 2239 2240 2241 |
# File '../../src/modules/PackageCallbacks.rb', line 2237 def ProgressRebuildDB(percent) UI.ChangeWidget(Id(:progress), :Value, percent) nil end |
- (Object) ProgressScanDb(value)
Callback for RPM DB scan progress
2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 |
# File '../../src/modules/PackageCallbacks.rb', line 2405 def ProgressScanDb(value) if Mode.commandline CommandLine.PrintVerboseNoCR( Ops.add(@clear_string, Builtins.sformat("%1%%", value)) ) else if @_scan_popup && UI.WidgetExists(Id(:label_scanDB_popup)) UI.ChangeWidget(Id(:progress), :Value, value) cont = UI.PollInput != :abort Builtins.y2warning("Scan DB aborted") if !cont return cont elsif FullScreen() Progress.Step(value) end end # continue true end |
- (Object) ProgressStart(id, task, in_percent, is_alive, min, max, val_raw, val_percent)
2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 |
# File '../../src/modules/PackageCallbacks.rb', line 2624 def ProgressStart(id, task, in_percent, is_alive, min, max, val_raw, val_percent) Builtins.y2milestone("ProgressStart: %1", id) @tick_progress = is_alive @val_progress = !in_percent && !is_alive @current_tick = 0 @progress_task = task if Mode.commandline CommandLine.Print(task) else subprogress_type = @tick_progress ? :tick : :progress @progress_stack = Builtins.add( @progress_stack, { "type" => subprogress_type, "task" => task } ) if IsProgressPopup() && Ops.less_or_equal(Builtins.size(@progress_stack), 1) # huh, the popup is already there? Builtins.y2warning("Progress popup already opened...") UI.CloseDialog end if FullScreen() Progress.SubprogressType(subprogress_type, 100) Progress.SubprogressTitle(task) else UI.OpenDialog( HBox( HSpacing(1), VBox( VSpacing(0.5), HSpacing(Id(:callback_progress_popup), @max_size), in_percent ? ProgressBar(Id(:progress_widget), task, 100, val_percent) : BusyIndicator(Id(:progress_widget), task, 3000), VSpacing(0.2), ButtonBox( PushButton(Id(:abort), Opt(:cancelButton), Label.AbortButton) ), VSpacing(0.5) ), HSpacing(1) ) ) end end nil end |
- (Object) RefreshDone
2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 |
# File '../../src/modules/PackageCallbacks.rb', line 2180 def RefreshDone if !Mode.commandline && UI.WidgetExists(Id(:abort)) UI.ChangeWidget(Id(:abort), :Label, Label.AbortButton) UI.RecalcLayout end Builtins.y2milestone("Autorefresh done") @autorefreshing = false @autorefreshing_aborted = false nil end |
- (Object) RefreshStarted
2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 |
# File '../../src/modules/PackageCallbacks.rb', line 2165 def RefreshStarted Builtins.y2milestone("Autorefreshing repositories...") if !Mode.commandline && UI.WidgetExists(Id(:abort)) # push button label UI.ChangeWidget(Id(:abort), :Label, _("Skip Autorefresh")) UI.RecalcLayout end @autorefreshing = true @autorefreshing_aborted = false nil end |
- (Object) RegisterEmptyProgressCallbacks
3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 |
# File '../../src/modules/PackageCallbacks.rb', line 3587 def RegisterEmptyProgressCallbacks SetDummyProcessCallbacks() SetDummyProvideCallbacks() SetDummyPatchCallbacks() SetDummySourceCreateCallbacks() SetDummySourceReportCallbacks() SetDummyProgressReportCallbacks() SetDummyScriptCallbacks() SetDummyScanDBCallbacks() SetDummyDownloadCallbacks() nil end |
- (Object) ResetDownloadCallbacks
2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 |
# File '../../src/modules/PackageCallbacks.rb', line 2935 def ResetDownloadCallbacks Pkg.CallbackInitDownload(nil) Pkg.CallbackStartDownload(nil) Pkg.CallbackProgressDownload(nil) Pkg.CallbackDoneDownload(nil) Pkg.CallbackDestDownload(nil) Pkg.CallbackStartRefresh(nil) Pkg.CallbackDoneRefresh(nil) nil end |
- (Object) ResetScanDBCallbacks
2905 2906 2907 2908 2909 2910 2911 2912 |
# File '../../src/modules/PackageCallbacks.rb', line 2905 def ResetScanDBCallbacks Pkg.CallbackStartScanDb(nil) Pkg.CallbackProgressScanDb(nil) Pkg.CallbackErrorScanDb(nil) Pkg.CallbackDoneScanDb(nil) nil end |
- (Object) RestorePatchCallbacks
3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 |
# File '../../src/modules/PackageCallbacks.rb', line 3629 def RestorePatchCallbacks Pkg.CallbackStartDeltaDownload(nil) Pkg.CallbackProgressDeltaDownload(nil) Pkg.CallbackProblemDeltaDownload(nil) Pkg.CallbackFinishDeltaDownload(nil) Pkg.CallbackStartDeltaApply(nil) Pkg.CallbackProgressDeltaApply(nil) Pkg.CallbackProblemDeltaApply(nil) Pkg.CallbackFinishDeltaApply(nil) Pkg.CallbackStartPatchDownload(nil) Pkg.CallbackProgressPatchDownload(nil) Pkg.CallbackProblemPatchDownload(nil) Pkg.CallbackFinishPatchDownload(nil) nil end |
- (Object) RestorePreviousProgressCallbacks
3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 |
# File '../../src/modules/PackageCallbacks.rb', line 3679 def RestorePreviousProgressCallbacks RestoreProcessCallbacks() RestoreProvideCallbacks() RestorePatchCallbacks() RestoreSourceCreateCallbacks() RestoreSourceReportCallbacks() RestoreProgressReportCallbacks() ClearScriptCallbacks() ResetScanDBCallbacks() ResetDownloadCallbacks() nil end |
- (Object) RestoreProcessCallbacks
3609 3610 3611 3612 3613 3614 3615 3616 |
# File '../../src/modules/PackageCallbacks.rb', line 3609 def RestoreProcessCallbacks Pkg.CallbackProcessStart(nil) Pkg.CallbackProcessProgress(nil) Pkg.CallbackProcessNextStage(nil) Pkg.CallbackProcessDone(nil) nil end |
- (Object) RestoreProgressReportCallbacks
3670 3671 3672 3673 3674 3675 3676 |
# File '../../src/modules/PackageCallbacks.rb', line 3670 def RestoreProgressReportCallbacks Pkg.CallbackProgressReportStart(nil) Pkg.CallbackProgressReportProgress(nil) Pkg.CallbackProgressReportEnd(nil) nil end |
- (Object) RestoreProvideCallbacks
3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 |
# File '../../src/modules/PackageCallbacks.rb', line 3618 def RestoreProvideCallbacks Pkg.CallbackStartProvide(nil) Pkg.CallbackProgressProvide(nil) Pkg.CallbackDoneProvide(nil) Pkg.CallbackStartPackage(nil) Pkg.CallbackProgressPackage(nil) Pkg.CallbackDonePackage(nil) nil end |
- (Object) RestoreSourceCreateCallbacks
3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 |
# File '../../src/modules/PackageCallbacks.rb', line 3648 def RestoreSourceCreateCallbacks Pkg.CallbackSourceCreateStart(nil) Pkg.CallbackSourceCreateProgress(nil) Pkg.CallbackSourceCreateError(nil) Pkg.CallbackSourceCreateEnd(nil) Pkg.CallbackSourceCreateInit(nil) Pkg.CallbackSourceCreateDestroy(nil) nil end |
- (Object) RestoreSourceReportCallbacks
3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 |
# File '../../src/modules/PackageCallbacks.rb', line 3659 def RestoreSourceReportCallbacks Pkg.CallbackSourceReportStart(nil) Pkg.CallbackSourceReportProgress(nil) Pkg.CallbackSourceReportError(nil) Pkg.CallbackSourceReportEnd(nil) Pkg.CallbackSourceReportInit(nil) Pkg.CallbackSourceReportDestroy(nil) nil end |
- (Object) RetryLabel(timeout)
229 230 231 232 233 234 |
# File '../../src/modules/PackageCallbacks.rb', line 229 def RetryLabel(timeout) Builtins.sformat( _("Remaining time to automatic retry: %1"), String.FormatTime(timeout) ) end |
- (Object) SaveConfig
191 192 193 194 |
# File '../../src/modules/PackageCallbacks.rb', line 191 def SaveConfig Builtins.y2milestone("Saving the current config to %1", @conf_file) SCR.Write(path(".target.ycp"), @conf_file, @config) end |
- (Object) ScriptFinish
1925 1926 1927 1928 1929 1930 1931 |
# File '../../src/modules/PackageCallbacks.rb', line 1925 def ScriptFinish Builtins.y2milestone("ScriptFinish") UI.CloseDialog if @_script_popup nil end |
- (Object) ScriptProblem(description)
1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 |
# File '../../src/modules/PackageCallbacks.rb', line 1892 def ScriptProblem(description) Builtins.y2warning("ScriptProblem: %1", description) ui = Popup.AnyQuestion3( "", #symbol focus description, Label.RetryButton, #yes_button_message Label.AbortButton, # no_button_message Label.IgnoreButton, #retry_button_message :retry ) Builtins.y2milestone("Problem result: %1", ui) # Abort is the default ret = "A" if ui == :retry # ignore ret = "I" elsif ui == :yes # retry ret = "R" elsif ui == :no # abort ret = "A" else Builtins.y2warning("Unknown result: %1, aborting", ui) end ret end |
- (Object) ScriptProgress(ping, output)
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 |
# File '../../src/modules/PackageCallbacks.rb', line 1872 def ScriptProgress(ping, output) Builtins.y2milestone("ScriptProgress: ping:%1, output: %2", ping, output) if @_script_popup if ping # TODO: refresh progress indicator Builtins.y2debug("-ping-") end if output != nil && output != "" # add the output to the log widget UI.ChangeWidget(Id(:log), :Value, output) end input = UI.PollInput return false if input == :abort || input == :close end true end |
- (Object) ScriptStart(patch_name, patch_version, patch_arch, script_path)
1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 |
# File '../../src/modules/PackageCallbacks.rb', line 1812 def ScriptStart(patch_name, patch_version, patch_arch, script_path) patch_full_name = FormatPatchName(patch_name, patch_version, patch_arch) Builtins.y2milestone( "ScriptStart callback: patch: %1, script: %2", patch_full_name, script_path ) if Mode.commandline CommandLine.PrintVerbose( Builtins.sformat( _("Starting script %1 (patch %2)..."), script_path, patch_full_name ) ) else progressbox = VBox( HSpacing(60), # popup heading Heading(_("Running Script")), VBox( patch_full_name != "" ? HBox( # label, patch name follows Label(Opt(:boldFont), _("Patch: ")), Label(patch_full_name), HStretch() ) : Empty(), HBox( # label, script name follows Label(Opt(:boldFont), _("Script: ")), Label(script_path), HStretch() ) ), # label LogView(Id(:log), _("Output of the Script"), 10, 0), ButtonBox( PushButton( Id(:abort), Opt(:default, :key_F9, :cancelButton), Label.AbortButton ) ) ) UI.CloseDialog if @_script_popup UI.OpenDialog(progressbox) UI.SetFocus(Id(:abort)) @_script_popup = true end nil end |
- (Object) SetConfig(key, value)
181 182 183 184 185 186 187 188 189 |
# File '../../src/modules/PackageCallbacks.rb', line 181 def SetConfig(key, value) value = deep_copy(value) LoadConfig() if @config == nil Builtins.y2milestone("Config: setting %1 to %2", key, value) Ops.set(@config, key, value) nil end |
- (Object) SetConvertDBCallbacks
2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 |
# File '../../src/modules/PackageCallbacks.rb', line 2342 def SetConvertDBCallbacks Pkg.CallbackStartConvertDb( fun_ref(method(:StartConvertDB), "void (string)") ) Pkg.CallbackProgressConvertDb( fun_ref(method(:ProgressConvertDB), "void (integer, string)") ) Pkg.CallbackStopConvertDb( fun_ref(method(:StopConvertDB), "void (integer, string)") ) Pkg.CallbackNotifyConvertDb(fun_ref(method(:NotifyConvertDB), "void ()")) nil end |
- (Object) SetDownloadCallbacks
2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 |
# File '../../src/modules/PackageCallbacks.rb', line 2914 def SetDownloadCallbacks Pkg.CallbackInitDownload(fun_ref(method(:InitDownload), "void (string)")) Pkg.CallbackStartDownload( fun_ref(method(:StartDownload), "void (string, string)") ) Pkg.CallbackProgressDownload( fun_ref( method(:ProgressDownload), "boolean (integer, integer, integer)" ) ) Pkg.CallbackDoneDownload( fun_ref(method(:DoneDownload), "void (integer, string)") ) Pkg.CallbackDestDownload(fun_ref(method(:DestDownload), "void ()")) Pkg.CallbackStartRefresh(fun_ref(method(:RefreshStarted), "void ()")) Pkg.CallbackDoneRefresh(fun_ref(method(:RefreshDone), "void ()")) nil end |
- (Object) SetDummyDownloadCallbacks
3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 |
# File '../../src/modules/PackageCallbacks.rb', line 3563 def SetDummyDownloadCallbacks Pkg.CallbackInitDownload( fun_ref(method(:DummyVoidString), "void (string)") ) Pkg.CallbackStartDownload( fun_ref(method(:DummyStartDownload), "void (string, string)") ) Pkg.CallbackProgressDownload( fun_ref( method(:DummyProgressDownload), "boolean (integer, integer, integer)" ) ) Pkg.CallbackDoneDownload( fun_ref(method(:DummyDoneDownload), "void (integer, string)") ) Pkg.CallbackDestDownload(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackStartRefresh(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackDoneRefresh(fun_ref(method(:DummyVoid), "void ()")) nil end |
- (Object) SetDummyPatchCallbacks
3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 |
# File '../../src/modules/PackageCallbacks.rb', line 3350 def SetDummyPatchCallbacks Pkg.CallbackStartDeltaDownload( fun_ref(method(:DummyVoidStringInteger), "void (string, integer)") ) Pkg.CallbackProgressDeltaDownload( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackProblemDeltaDownload( fun_ref(method(:DummyVoidString), "void (string)") ) Pkg.CallbackFinishDeltaDownload(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackStartDeltaApply( fun_ref(method(:DummyVoidString), "void (string)") ) Pkg.CallbackProgressDeltaApply( fun_ref(method(:DummyVoidInteger), "void (integer)") ) Pkg.CallbackProblemDeltaApply( fun_ref(method(:DummyVoidString), "void (string)") ) Pkg.CallbackFinishDeltaApply(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackStartPatchDownload( fun_ref(method(:DummyVoidStringInteger), "void (string, integer)") ) Pkg.CallbackProgressPatchDownload( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackProblemPatchDownload( fun_ref(method(:DummyVoidString), "void (string)") ) Pkg.CallbackFinishPatchDownload(fun_ref(method(:DummyVoid), "void ()")) nil end |
- (Object) SetDummyProcessCallbacks
3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 |
# File '../../src/modules/PackageCallbacks.rb', line 3256 def SetDummyProcessCallbacks Pkg.CallbackProcessStart( fun_ref( method(:DummyProcessStart), "void (string, list <string>, string)" ) ) Pkg.CallbackProcessProgress( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackProcessNextStage(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackProcessDone(fun_ref(method(:DummyVoid), "void ()")) nil end |
- (Object) SetDummyProgressReportCallbacks
3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 |
# File '../../src/modules/PackageCallbacks.rb', line 3474 def SetDummyProgressReportCallbacks Pkg.CallbackProgressReportStart( fun_ref( method(:DummyProgressStart), "void (integer, string, boolean, boolean, integer, integer, integer, integer)" ) ) Pkg.CallbackProgressReportProgress( fun_ref( method(:DummyProgressProgress), "boolean (integer, integer, integer)" ) ) Pkg.CallbackProgressReportEnd( fun_ref(method(:DummyVoidInteger), "void (integer)") ) nil end |
- (Object) SetDummyProvideCallbacks
3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 |
# File '../../src/modules/PackageCallbacks.rb', line 3295 def SetDummyProvideCallbacks Pkg.CallbackStartProvide( fun_ref(method(:DummyStartProvide), "void (string, integer, boolean)") ) Pkg.CallbackProgressProvide( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackDoneProvide( fun_ref(method(:DummyDoneProvide), "string (integer, string, string)") ) Pkg.CallbackStartPackage( fun_ref( method(:DummyStartPackage), "void (string, string, string, integer, boolean)" ) ) Pkg.CallbackProgressPackage( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackDonePackage( fun_ref(method(:DummyDonePackage), "string (integer, string)") ) nil end |
- (Object) SetDummyScanDBCallbacks
3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 |
# File '../../src/modules/PackageCallbacks.rb', line 3533 def SetDummyScanDBCallbacks Pkg.CallbackStartScanDb(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackProgressScanDb( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackErrorScanDb( fun_ref(method(:DummyStringIntegerString), "string (integer, string)") ) Pkg.CallbackDoneScanDb( fun_ref(method(:DummyVoidIntegerString), "void (integer, string)") ) nil end |
- (Object) SetDummyScriptCallbacks
3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 |
# File '../../src/modules/PackageCallbacks.rb', line 3508 def SetDummyScriptCallbacks Pkg.CallbackScriptStart( fun_ref( method(:DummyScriptStart), "void (string, string, string, string)" ) ) Pkg.CallbackScriptProgress( fun_ref(method(:DummyScriptProgress), "boolean (boolean, string)") ) Pkg.CallbackScriptProblem( fun_ref(method(:DummyStringString), "string (string)") ) Pkg.CallbackScriptFinish(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackMessage( fun_ref( method(:DummyMessage), "boolean (string, string, string, string)" ) ) nil end |
- (Object) SetDummySourceCreateCallbacks
3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 |
# File '../../src/modules/PackageCallbacks.rb', line 3398 def SetDummySourceCreateCallbacks Pkg.CallbackSourceCreateStart( fun_ref(method(:DummyVoidString), "void (string)") ) Pkg.CallbackSourceCreateProgress( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackSourceCreateError( fun_ref( method(:DummySourceCreateError), "symbol (string, symbol, string)" ) ) Pkg.CallbackSourceCreateEnd( fun_ref(method(:DummySourceCreateEnd), "void (string, symbol, string)") ) Pkg.CallbackSourceCreateInit(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackSourceCreateDestroy(fun_ref(method(:DummyVoid), "void ()")) nil end |
- (Object) SetDummySourceReportCallbacks
3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 |
# File '../../src/modules/PackageCallbacks.rb', line 3435 def SetDummySourceReportCallbacks # source report callbacks Pkg.CallbackSourceReportStart( fun_ref( method(:DummySourceReportStart), "void (integer, string, string)" ) ) Pkg.CallbackSourceReportProgress( fun_ref(method(:DummyBooleanInteger), "boolean (integer)") ) Pkg.CallbackSourceReportError( fun_ref( method(:DummySourceReportError), "symbol (integer, string, symbol, string)" ) ) Pkg.CallbackSourceReportEnd( fun_ref( method(:DummySourceReportEnd), "void (integer, string, string, symbol, string)" ) ) Pkg.CallbackSourceReportInit(fun_ref(method(:DummyVoid), "void ()")) Pkg.CallbackSourceReportDestroy(fun_ref(method(:DummyVoid), "void ()")) nil end |
- (Object) SetHeaderSourcePopup(text)
1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 |
# File '../../src/modules/PackageCallbacks.rb', line 1244 def SetHeaderSourcePopup(text) # Qt UI uses bold font, the string must be shortened even more ui_adjustment = textmode ? 0 : 5 if Ops.greater_than( Builtins.size(text), Ops.subtract(@max_size, ui_adjustment) ) text = ProcessMessage(text, Ops.subtract(@max_size, ui_adjustment)) end UI.ChangeWidget(:label_source_popup, :Value, text) Builtins.y2milestone("SourcePopup: new header: %1", text) nil end |
- (Object) SetLabelSourcePopup(text)
1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 |
# File '../../src/modules/PackageCallbacks.rb', line 1261 def SetLabelSourcePopup(text) # Qt uses proportional font, the string might be longer ui_adjustment = textmode ? 0 : 6 if Ops.greater_than( Builtins.size(text), Ops.add(@max_size, ui_adjustment) ) text = ProcessMessage(text, Ops.add(@max_size, ui_adjustment)) end # refresh the label in the popup UI.ChangeWidget(:progress, :Label, text) Builtins.y2milestone("SourcePopup: new label: %1", text) nil end |
- (Object) SetMediaCallbacks
Register callbacks for media change
2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 |
# File '../../src/modules/PackageCallbacks.rb', line 2845 def SetMediaCallbacks Pkg.CallbackMediaChange( fun_ref( method(:MediaChange), "string (string, string, string, string, integer, string, integer, string, boolean, list <string>, integer)" ) ) Pkg.CallbackSourceChange( fun_ref(method(:SourceChange), "void (integer, integer)") ) nil end |
- (Object) SetPatchCallbacks
3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 |
# File '../../src/modules/PackageCallbacks.rb', line 3037 def SetPatchCallbacks Pkg.CallbackStartDeltaDownload( fun_ref(method(:StartDeltaProvide), "void (string, integer)") ) Pkg.CallbackProgressDeltaDownload( fun_ref(method(:ProgressProvide), "boolean (integer)") ) Pkg.CallbackProblemDeltaDownload( fun_ref(method(:ProblemDeltaDownload), "void (string)") ) Pkg.CallbackFinishDeltaDownload( fun_ref(method(:FinishPatchDeltaProvide), "void ()") ) Pkg.CallbackStartDeltaApply( fun_ref(method(:StartDeltaApply), "void (string)") ) Pkg.CallbackProgressDeltaApply( fun_ref(method(:ProgressDeltaApply), "void (integer)") ) Pkg.CallbackProblemDeltaApply( fun_ref(method(:ProblemDeltaApply), "void (string)") ) Pkg.CallbackFinishDeltaApply( fun_ref(method(:FinishPatchDeltaProvide), "void ()") ) Pkg.CallbackStartPatchDownload( fun_ref(method(:StartPatchProvide), "void (string, integer)") ) Pkg.CallbackProgressPatchDownload( fun_ref(method(:ProgressProvide), "boolean (integer)") ) Pkg.CallbackProblemPatchDownload( fun_ref(method(:ProblemPatchDownload), "void (string)") ) Pkg.CallbackFinishPatchDownload( fun_ref(method(:FinishPatchDeltaProvide), "void ()") ) nil end |
- (Object) SetProcessCallbacks
2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 |
# File '../../src/modules/PackageCallbacks.rb', line 2995 def SetProcessCallbacks # register process callbacks (total progress) Pkg.CallbackProcessStart( fun_ref(method(:ProcessStart), "void (string, list <string>, string)") ) Pkg.CallbackProcessProgress( fun_ref(method(:ProcessProgress), "boolean (integer)") ) Pkg.CallbackProcessNextStage( fun_ref(method(:ProcessNextStage), "void ()") ) Pkg.CallbackProcessDone(fun_ref(method(:ProcessDone), "void ()")) nil end |
- (Object) SetProgressReportCallbacks
3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 |
# File '../../src/modules/PackageCallbacks.rb', line 3110 def SetProgressReportCallbacks Pkg.CallbackProgressReportStart( fun_ref( method(:ProgressStart), "void (integer, string, boolean, boolean, integer, integer, integer, integer)" ) ) Pkg.CallbackProgressReportProgress( fun_ref( method(:ProgressProgress), "boolean (integer, integer, integer)" ) ) Pkg.CallbackProgressReportEnd( fun_ref(method(:ProgressEnd), "void (integer)") ) nil end |
- (Object) SetProvideCallbacks
3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 |
# File '../../src/modules/PackageCallbacks.rb', line 3011 def SetProvideCallbacks Pkg.CallbackStartProvide( fun_ref(method(:StartProvide), "void (string, integer, boolean)") ) Pkg.CallbackProgressProvide( fun_ref(method(:ProgressProvide), "boolean (integer)") ) Pkg.CallbackDoneProvide( fun_ref(method(:DoneProvide), "string (integer, string, string)") ) Pkg.CallbackStartPackage( fun_ref( method(:StartPackage), "void (string, string, string, integer, boolean)" ) ) Pkg.CallbackProgressPackage( fun_ref(method(:ProgressPackage), "boolean (integer)") ) Pkg.CallbackDonePackage( fun_ref(method(:DonePackage), "string (integer, string)") ) nil end |
- (Object) SetRebuildDBCallbacks
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 |
# File '../../src/modules/PackageCallbacks.rb', line 2266 def SetRebuildDBCallbacks Pkg.CallbackStartRebuildDb(fun_ref(method(:StartRebuildDB), "void ()")) Pkg.CallbackProgressRebuildDb( fun_ref(method(:ProgressRebuildDB), "void (integer)") ) Pkg.CallbackStopRebuildDb( fun_ref(method(:StopRebuildDB), "void (integer, string)") ) Pkg.CallbackNotifyRebuildDb(fun_ref(method(:NotifyRebuildDB), "void ()")) nil end |
- (Object) SetScanDBCallbacks
2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 |
# File '../../src/modules/PackageCallbacks.rb', line 2890 def SetScanDBCallbacks Pkg.CallbackStartScanDb(fun_ref(method(:StartScanDb), "void ()")) Pkg.CallbackProgressScanDb( fun_ref(method(:ProgressScanDb), "boolean (integer)") ) Pkg.CallbackErrorScanDb( fun_ref(method(:ErrorScanDb), "string (integer, string)") ) Pkg.CallbackDoneScanDb( fun_ref(method(:DoneScanDb), "void (integer, string)") ) nil end |
- (Object) SetScriptCallbacks
2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 |
# File '../../src/modules/PackageCallbacks.rb', line 2871 def SetScriptCallbacks Pkg.CallbackScriptStart( fun_ref(method(:ScriptStart), "void (string, string, string, string)") ) Pkg.CallbackScriptProgress( fun_ref(method(:ScriptProgress), "boolean (boolean, string)") ) Pkg.CallbackScriptProblem( fun_ref(method(:ScriptProblem), "string (string)") ) Pkg.CallbackScriptFinish(fun_ref(method(:ScriptFinish), "void ()")) Pkg.CallbackMessage( fun_ref(method(:Message), "boolean (string, string, string, string)") ) nil end |
- (Object) SetSourceCreateCallbacks
2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 |
# File '../../src/modules/PackageCallbacks.rb', line 2947 def SetSourceCreateCallbacks # source create callbacks Pkg.CallbackSourceCreateStart( fun_ref(method(:SourceCreateStart), "void (string)") ) Pkg.CallbackSourceCreateProgress( fun_ref(method(:SourceCreateProgress), "boolean (integer)") ) Pkg.CallbackSourceCreateError( fun_ref(method(:SourceCreateError), "symbol (string, symbol, string)") ) Pkg.CallbackSourceCreateEnd( fun_ref(method(:SourceCreateEnd), "void (string, symbol, string)") ) Pkg.CallbackSourceCreateInit( fun_ref(method(:SourceCreateInit), "void ()") ) Pkg.CallbackSourceCreateDestroy( fun_ref(method(:SourceCreateDestroy), "void ()") ) nil end |
- (Object) SetSourceProbeCallbacks
2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 |
# File '../../src/modules/PackageCallbacks.rb', line 2971 def SetSourceProbeCallbacks # source probing callbacks Pkg.CallbackSourceProbeStart( fun_ref(method(:SourceProbeStart), "void (string)") ) Pkg.CallbackSourceProbeFailed( fun_ref(method(:SourceProbeFailed), "void (string, string)") ) Pkg.CallbackSourceProbeSucceeded( fun_ref(method(:SourceProbeSucceeded), "void (string, string)") ) Pkg.CallbackSourceProbeProgress( fun_ref(method(:SourceProbeProgress), "boolean (string, integer)") ) Pkg.CallbackSourceProbeError( fun_ref(method(:SourceProbeError), "symbol (string, symbol, string)") ) Pkg.CallbackSourceProbeEnd( fun_ref(method(:SourceProbeEnd), "void (string, symbol, string)") ) nil end |
- (Object) SetSourceReportCallbacks
3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 |
# File '../../src/modules/PackageCallbacks.rb', line 3080 def SetSourceReportCallbacks # source report callbacks Pkg.CallbackSourceReportStart( fun_ref(method(:SourceReportStart), "void (integer, string, string)") ) Pkg.CallbackSourceReportProgress( fun_ref(method(:SourceReportProgress), "boolean (integer)") ) Pkg.CallbackSourceReportError( fun_ref( method(:SourceReportError), "symbol (integer, string, symbol, string)" ) ) Pkg.CallbackSourceReportEnd( fun_ref( method(:SourceReportEnd), "void (integer, string, string, symbol, string)" ) ) Pkg.CallbackSourceReportInit( fun_ref(method(:SourceReportInit), "void ()") ) Pkg.CallbackSourceReportDestroy( fun_ref(method(:SourceReportDestroy), "void ()") ) nil end |
- (Object) ShowLogInfo(message, buttonbox)
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File '../../src/modules/PackageCallbacks.rb', line 332 def ShowLogInfo(, ) = deep_copy() if UI.QueryWidget(Id(:show), :Value) == true UI.CloseDialog UI.OpenDialog( Opt(:decorated), LayoutPopup(, , 10, true) ) return true else UI.CloseDialog UI.OpenDialog( Opt(:decorated), LayoutPopup(, , @vsize_no_details, false) ) UI.ReplaceWidget(Id(:info), Empty()) end false end |
- (Object) SourceChange(source, medianr)
dummy repository change callback, see SlideShowCallbacks for the real one
1176 1177 1178 1179 1180 1181 |
# File '../../src/modules/PackageCallbacks.rb', line 1176 def SourceChange(source, medianr) Builtins.y2milestone("SourceChange (%1, %2)", source, medianr) @_current_source = source nil end |
- (Object) SourceCreateDestroy
1321 1322 1323 1324 1325 1326 1327 |
# File '../../src/modules/PackageCallbacks.rb', line 1321 def SourceCreateDestroy Builtins.y2milestone("SourceCreateDestroy") CloseSourcePopup() nil end |
- (Object) SourceCreateEnd(url, error, description)
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 |
# File '../../src/modules/PackageCallbacks.rb', line 1420 def SourceCreateEnd(url, error, description) # set 100% progress SourcePopupSetProgress(100) Builtins.y2milestone( "Source create end: error: url: %1, error: %2, description: %3", URL.HidePassword(url), error, description ) nil end |
- (Object) SourceCreateError(url, error, description)
1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 |
# File '../../src/modules/PackageCallbacks.rb', line 1357 def SourceCreateError(url, error, description) Builtins.y2milestone( "Source create: error: url: %1, error: %2, description: %3", URL.HidePassword(url), error, description ) # error message - a label followed by a richtext with details = _("An error occurred while creating the repository.") if error == :NOT_FOUND # error message - a label followed by a richtext with details = _("Unable to retrieve the remote repository description.") elsif error == :IO # error message - a label followed by a richtext with details = _("An error occurred while retrieving the new metadata.") elsif error == :INVALID # error message - a label followed by a richtext with details = _("The repository is not valid.") elsif error == :REJECTED # error message - a label followed by a richtext with details = _("The repository metadata is invalid.") end if Mode.commandline CommandLine.Print() CommandLine.Print(URL.HidePassword(url)) CommandLine.Print(description) # ask user in the interactive mode if CommandLine.Interactive CommandLine.Print("") # command line mode - ask user whether the repository refreshment should be retried CommandLine.Print(_("Retry?")) if CommandLine.YesNo # return Retry return :RETRY end end return :ABORT end detail = Builtins.sformat("%1<br>%2", url, description) UI.OpenDialog( VBox( Label(), RichText(detail), ButtonBox( PushButton(Id(:RETRY), Opt(:okButton), Label.RetryButton), PushButton(Id(:ABORT), Opt(:cancelButton), Label.AbortButton) ) ) ) ret = Convert.to_symbol(UI.UserInput) UI.CloseDialog Builtins.y2milestone("Source create error: Returning %1", ret) ret end |
- (Object) SourceCreateInit
1313 1314 1315 1316 1317 1318 1319 |
# File '../../src/modules/PackageCallbacks.rb', line 1313 def SourceCreateInit Builtins.y2milestone("SourceCreateInit") OpenSourcePopup() nil end |
- (Object) SourceCreateProgress(percent)
1350 1351 1352 1353 1354 1355 |
# File '../../src/modules/PackageCallbacks.rb', line 1350 def SourceCreateProgress(percent) ret = SourcePopupSetProgress(percent) Builtins.y2milestone("SourceCreateProgress(%1) = %2", percent, ret) ret end |
- (Object) SourceCreateStart(url)
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 |
# File '../../src/modules/PackageCallbacks.rb', line 1329 def SourceCreateStart(url) Builtins.y2milestone("SourceCreateStart: %1", url) # popup label (%1 is repository URL) msg = Builtins.sformat(_("Creating Repository %1"), url) if Mode.commandline CommandLine.Print(msg) else Builtins.y2milestone("_source_open: %1", @_source_open) if @_source_open == 1 SetHeaderSourcePopup(msg) else SetLabelSourcePopup(msg) end end nil end |
- (Object) SourcePopupSetProgress(value)
1284 1285 1286 1287 1288 1289 1290 1291 |
# File '../../src/modules/PackageCallbacks.rb', line 1284 def SourcePopupSetProgress(value) if Ops.greater_than(@_source_open, 0) && IsSourcePopup() UI.ChangeWidget(Id(:progress), :Value, value) input = UI.PollInput return false if input == :abort end true end |
- (Object) SourceProbeEnd(url, error, description)
1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 |
# File '../../src/modules/PackageCallbacks.rb', line 1553 def SourceProbeEnd(url, error, description) CloseSourcePopup() CloseSourcePopup() Builtins.y2milestone( "Source probe end: error: url: %1, error: %2, description: %3", URL.HidePassword(url), error, description ) nil end |
- (Object) SourceProbeError(url, error, description)
1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 |
# File '../../src/modules/PackageCallbacks.rb', line 1488 def SourceProbeError(url, error, description) Builtins.y2milestone( "Source probe: error: url: %1, error: %2, description: %3", URL.HidePassword(url), error, description ) # error message - a label followed by a richtext with details = _("Error occurred while probing the repository.") if error == :NOT_FOUND # error message - a label followed by a richtext with details = _("Unable to retrieve the remote repository description.") elsif error == :IO # error message - a label followed by a richtext with details = _("An error occurred while retrieving the new metadata.") elsif error == :INVALID # error message - a label followed by a richtext with details = _("The repository is not valid.") elsif error == :NO_ERROR # error message - a label followed by a richtext with details = _("Repository probing details.") elsif error == :REJECTED # error message - a label followed by a richtext with details = _("Repository metadata is invalid.") end if Mode.commandline CommandLine.Print() CommandLine.Print(URL.HidePassword(url)) CommandLine.Print(description) # ask user in the interactive mode if CommandLine.Interactive CommandLine.Print("") # command line mode - ask user whether the repository refreshment should be retried CommandLine.Print(_("Retry?")) if CommandLine.YesNo # return Retry return :RETRY end end return :ABORT end detail = Builtins.sformat("%1<br>%2", url, description) UI.OpenDialog( VBox( Label(), RichText(detail), ButtonBox( PushButton(Id(:RETRY), Opt(:okButton), Label.RetryButton), PushButton(Id(:ABORT), Opt(:cancelButton), Label.AbortButton) ) ) ) ret = Convert.to_symbol(UI.UserInput) UI.CloseDialog Builtins.y2milestone("Source probe error: Returning %1", ret) ret end |
- (Object) SourceProbeFailed(url, type)
1463 1464 1465 1466 1467 1468 1469 1470 1471 |
# File '../../src/modules/PackageCallbacks.rb', line 1463 def SourceProbeFailed(url, type) Builtins.y2milestone( "Repository %1 is not %2 repository", URL.HidePassword(url), type ) nil end |
- (Object) SourceProbeProgress(url, value)
1484 1485 1486 |
# File '../../src/modules/PackageCallbacks.rb', line 1484 def SourceProbeProgress(url, value) SourcePopupSetProgress(value) end |
- (Object) SourceProbeStart(url)
1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 |
# File '../../src/modules/PackageCallbacks.rb', line 1436 def SourceProbeStart(url) Builtins.y2milestone("SourceProbeStart: %1", URL.HidePassword(url)) # popup label (%1 is repository URL) msg = Builtins.sformat(_("Probing Repository %1"), URL.HidePassword(url)) if Mode.commandline CommandLine.Print(msg) else OpenSourcePopup() msg2 = Builtins.sformat( _("Probing Repository %1"), URL.HidePassword(url) ) if @_source_open == 1 SetHeaderSourcePopup(msg2) else SetLabelSourcePopup(msg2) end end nil end |
- (Object) SourceProbeSucceeded(url, type)
1473 1474 1475 1476 1477 1478 1479 1480 1481 |
# File '../../src/modules/PackageCallbacks.rb', line 1473 def SourceProbeSucceeded(url, type) Builtins.y2milestone( "Repository %1 is type %2", URL.HidePassword(url), type ) nil end |
- (Object) SourceReportDestroy
1683 1684 1685 1686 1687 1688 |
# File '../../src/modules/PackageCallbacks.rb', line 1683 def SourceReportDestroy Builtins.y2milestone("Source report destroy") CloseSourcePopup() nil end |
- (Object) SourceReportEnd(src_id, url, task, error, description)
1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 |
# File '../../src/modules/PackageCallbacks.rb', line 1660 def SourceReportEnd(src_id, url, task, error, description) Builtins.y2milestone( "Source report end: src: %1, url: %2, task: %3, error: %4, description: %5", src_id, URL.HidePassword(url), task, error, description ) # set 100% progress SourcePopupSetProgress(100) nil end |
- (Object) SourceReportError(source_id, url, error, description)
1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 |
# File '../../src/modules/PackageCallbacks.rb', line 1599 def SourceReportError(source_id, url, error, description) Builtins.y2milestone( "Source report: error: id: %1, url: %2, error: %3, description: %4", source_id, URL.HidePassword(url), error, description ) # error message - a label followed by a richtext with details = Builtins.sformat(_("Repository %1"), url) if error == :NOT_FOUND # error message - a label followed by a richtext with details = _("Unable to retrieve the remote repository description.") elsif error == :IO # error message - a label followed by a richtext with details = _("An error occurred while retrieving the new metadata.") elsif error == :INVALID # error message - a label followed by a richtext with details = _("The repository is not valid.") end if Mode.commandline CommandLine.Print() CommandLine.Print(url) CommandLine.Print(description) # ask user in the interactive mode if CommandLine.Interactive CommandLine.Print("") # command line mode - ask user whether the repository refreshment should be retried CommandLine.Print(_("Retry?")) if CommandLine.YesNo # return Retry return :RETRY end end return :ABORT end detail = Builtins.sformat("%1<br>%2", url, description) UI.OpenDialog( VBox( Label(), RichText(detail), HBox( PushButton(Id(:RETRY), Opt(:okButton), Label.RetryButton), PushButton(Id(:ABORT), Opt(:cancelButton), Label.AbortButton) ) ) ) ret = Convert.to_symbol(UI.UserInput) UI.CloseDialog Builtins.y2milestone("Source report error: Returning %1", ret) ret end |
- (Object) SourceReportInit
1676 1677 1678 1679 1680 1681 |
# File '../../src/modules/PackageCallbacks.rb', line 1676 def SourceReportInit Builtins.y2milestone("Source report init") OpenSourcePopup() nil end |
- (Object) SourceReportProgress(value)
1591 1592 1593 1594 1595 1596 |
# File '../../src/modules/PackageCallbacks.rb', line 1591 def SourceReportProgress(value) ret = SourcePopupSetProgress(value) Builtins.y2debug("SourceReportProgress(%1) = %2", value, ret) ret end |
- (Object) SourceReportStart(source_id, url, task)
1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 |
# File '../../src/modules/PackageCallbacks.rb', line 1568 def SourceReportStart(source_id, url, task) Builtins.y2milestone( "Source report start: src: %1, URL: %2, task: %3", source_id, URL.HidePassword(url), task ) if Mode.commandline CommandLine.Print(task) else Builtins.y2milestone("_source_open: %1", @_source_open) if @_source_open == 1 SetHeaderSourcePopup(task) else SetLabelSourcePopup(task) end end nil end |
- (Object) StartConvertDB(unused1)
2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 |
# File '../../src/modules/PackageCallbacks.rb', line 2281 def StartConvertDB(unused1) # heading of popup heading = _("Checking Package Database") # message in a progress popup = _( "Converting package database. This process can take some time." ) UI.OpenDialog( Opt(:decorated), VBox( Heading(heading), VBox( Label(), HSpacing(60), HBox( HSpacing(2), ProgressBar(Id(:progress), _("Status"), 100), HSpacing(2) ), VSpacing(1) ) ) ) UI.ChangeWidget(Id(:progress), :Value, 0) nil end |
- (Object) StartDeltaApply(name)
at start of delta application
1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 |
# File '../../src/modules/PackageCallbacks.rb', line 1715 def StartDeltaApply(name) if Mode.commandline CommandLine.PrintVerbose( Builtins.sformat(_("Applying delta RPM package %1..."), name) ) else # popup heading progressbox = VBox( HSpacing(40), # popup heading Heading(_("Applying delta RPM package")), Left( HBox(Left(Label(Opt(:boldFont), _("Package: "))), Left(Label(name))) ), ProgressBar(Id(:progress), "", 100, 0) ) UI.CloseDialog if @_provide_popup UI.OpenDialog(progressbox) @_provide_popup = true end nil end |
- (Object) StartDeltaProvide(name, archivesize)
at start of delta providal
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 |
# File '../../src/modules/PackageCallbacks.rb', line 1692 def StartDeltaProvide(name, archivesize) sz = String.FormatSizeWithPrecision(archivesize, 2, false) if Mode.commandline CommandLine.PrintVerbose( Builtins.sformat( _("Downloading delta RPM package %1 (%2)..."), name, sz ) ) else UI.CloseDialog if @_provide_popup # popup heading providebox = ProgressBox(_("Downloading Delta RPM package"), name, sz) UI.OpenDialog(providebox) @_provide_popup = true end nil end |
- (Object) StartDownload(url, localfile)
2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 |
# File '../../src/modules/PackageCallbacks.rb', line 2039 def StartDownload(url, localfile) Builtins.y2milestone( "Downloading %1 to %2", URL.HidePassword(url), localfile ) # heading of popup heading = _("Downloading") # reformat the URL url_report = URL.FormatURL(URL.Parse(URL.HidePassword(url)), @max_size) # remember the URL @download_file = url_report # message in a progress popup = Builtins.sformat(_("Downloading: %1"), url_report) if Mode.commandline CommandLine.PrintVerbose() else if IsDownloadProgressPopup() # change the label UI.ChangeWidget(Id(:progress), :Label, ) UI.ChangeWidget(Id(:progress), :Value, 0) elsif FullScreen() Progress.SubprogressType(:progress, 100) Progress.SubprogressTitle() end end nil end |
- (Object) StartPackage(name, location, summary, installsize, is_delete)
At start of package install.
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 |
# File '../../src/modules/PackageCallbacks.rb', line 514 def StartPackage(name, location, summary, installsize, is_delete) return if !@enable_asterix_package @_package_name = name @_package_size = installsize @_deleting_package = is_delete sz = String.FormatSizeWithPrecision(installsize, 2, false) if Mode.commandline CommandLine.PrintVerbose( Builtins.sformat( is_delete ? _("Uninstalling package %1 (%2)...") : _("Installing package %1 (%2)..."), @_package_name, sz ) ) else packagebox = ProgressBox( is_delete ? _("Uninstalling Package") : _("Installing Package"), @_package_name, sz ) UI.OpenDialog(Opt(:decorated), packagebox) @_package_popup = true end nil end |
- (Object) StartPatchProvide(name, archivesize)
at start of patch providal
1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 |
# File '../../src/modules/PackageCallbacks.rb', line 1741 def StartPatchProvide(name, archivesize) sz = String.FormatSizeWithPrecision(archivesize, 2, false) if Mode.commandline CommandLine.PrintVerbose( Builtins.sformat( _("Downloading patch RPM package %1 (%2)..."), name, sz ) ) else UI.CloseDialog if @_provide_popup # popup heading providebox = ProgressBox(_("Downloading Patch RPM Package"), name, sz) UI.OpenDialog(providebox) @_provide_popup = true end nil end |
- (Object) StartProvide(name, archivesize, remote)
at start of file providal
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 |
# File '../../src/modules/PackageCallbacks.rb', line 238 def StartProvide(name, archivesize, remote) Builtins.y2milestone("StartProvide: name: %1, remote: %2", name, remote) if remote sz = String.FormatSizeWithPrecision(archivesize, 2, false) if Mode.commandline CommandLine.PrintVerbose( Builtins.sformat(_("Downloading package %1 (%2)..."), name, sz) ) else UI.CloseDialog if @_provide_popup if FullScreen() Progress.SubprogressType(:progress, 100) Progress.SubprogressTitle( Builtins.sformat(_("Downloading package %1 (%2)..."), name, sz) ) else # popup heading providebox = ProgressBox(_("Downloading Package"), name, sz) UI.OpenDialog(providebox) @_provide_popup = true end end end nil end |
- (Object) StartRebuildDB
2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 |
# File '../../src/modules/PackageCallbacks.rb', line 2206 def StartRebuildDB # heading of popup heading = _("Checking Package Database") # message in a progress popup = _( "Rebuilding package database. This process can take some time." ) # progress bar label progress_label = _("Status") UI.OpenDialog( Opt(:decorated), VBox( Heading(heading), VBox( Label(), HSpacing(60), HBox(HSpacing(2), ProgressBar(Id(:progress), "", 100), HSpacing(2)), VSpacing(1) ) ) ) UI.ChangeWidget(Id(:progress), :Value, 0) nil end |
- (Object) StartScanDb
Callback for start RPM DB scan event
2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 |
# File '../../src/modules/PackageCallbacks.rb', line 2360 def StartScanDb Builtins.y2milestone("Scanning RPM DB...") if Mode.commandline # progress message (command line mode) CommandLine.PrintVerbose(_("Reading RPM database...")) else if !FullScreen() UI.OpenDialog( VBox( HSpacing(60), # popup heading Heading( Id(:label_scanDB_popup), Opt(:hstretch), _("Reading Installed Packages") ), HBox( # progress bar label ProgressBar( Id(:progress), _("Scanning RPM database..."), 100, 0 ), # TODO: allow Abort # , # `VBox( # `Label(""), # `PushButton(`id(`abort), Label::AbortButton()) # ) HSpacing(1) ) ) ) @_scan_popup = true else Progress.Title(_("Scanning RPM database...")) end end nil end |
- (Object) StopConvertDB(error_value, error_text)
2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 |
# File '../../src/modules/PackageCallbacks.rb', line 2320 def StopConvertDB(error_value, error_text) if error_value != 0 # error message, %1 is the cause for the error Popup.Error( Builtins.sformat( _("Conversion of package database failed:\n%1"), error_text ) ) end UI.CloseDialog nil end |
- (Object) StopRebuildDB(error_value, error_text)
2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 |
# File '../../src/modules/PackageCallbacks.rb', line 2244 def StopRebuildDB(error_value, error_text) if error_value != 0 # error message, %1 is the cause for the error Popup.Error( Builtins.sformat( _("Rebuilding of package database failed:\n%1"), error_text ) ) end UI.CloseDialog nil end |
- (Object) textmode
145 146 147 148 149 |
# File '../../src/modules/PackageCallbacks.rb', line 145 def textmode Mode.commandline ? true : Ops.get_boolean(UI.GetDisplayInfo, "TextMode", false) end |