Class List Method List File List

# Class: Yast::OnlineUpdateCallbacksClass

Inherits:
  Module
  - Object
  - Module
  - Yast::OnlineUpdateCallbacksClass
  show all
Defined in:
  ../../src/modules/OnlineUpdateCallbacks.rb

## Instance Method Summary (collapse)

- - (Object) DoneDownload(error_value, error_text)
- - (Object) DonePackage(error, reason)

  callback for 'package installed' action.

- - (Object) DoneProvide(error, reason, name)

  callback for 'package provided' action.

- - (Object) FinishLine(line)

  Callback for finishing an action in the log.

- - (Object) FinishPatchDeltaProvide

  finish of download/application of delta or patch download.

- - (Object) main
- - (Object) Message(patch_name, patch_version, patch_arch, message)

  display a message.

- - (Object) MessageCallback(patchname, patchsummary, message)
- - (Object) PatchProgressCallback(num)

  Callback for patch (resp. delta rpm) progress widget.

- - (Object) ProblemDeltaApply(description)

  callback for problem during aplying delta.

- - (Object) ProblemDeltaDownload(description)

  callback for problem during downloading delta.

- - (Object) ProblemPatchDownload(description)

  callback for problem during aplying delta.

- - (Object) ProgressDeltaApply(num)

  progress of applying delta (cannot be aborted).

- - (Boolean) ProgressDeltaDownload(num)

  callback for delta download progress.

- - (Object) ProgressDownloadCallback(percent, bps_avg, bps_current)
- - (Object) ProgressLog(text)

  add a text to the installation progress log.

- - (Boolean) ProgressPatchDownload(num)

  callback for path download progress.

- - (Object) RefreshAllSources

  Refresh all sources with autorefresh enabled.

- - (Object) RefreshSources(sources)

  Refresh sources given by argument.

- - (Object) RegisterOnlineUpdateCallbacks

  Constructor.

- - (Object) ScriptFinish

  the script has finished.

- - (Object) ScriptProblem(description)

  an error has occurred.

- - (Object) ScriptProgress(ping, output)

  print output of the script.

- - (Object) ScriptStart(patch_name, patch_version, patch_arch, script_path)

  a script has been started.

- - (Object) StartDeltaApply(name)

  callback for start of applying delta rpm.

- - (Object) StartDeltaDownload(name, download_size)

  callback for start of delta download.

- - (Object) StartDownload(url, localfile)
- - (Object) StartPackage(pkg_name, name, summary, installsize, is_delete)

  Callback for starting installation of a package.

- - (Object) StartPatchDownload(name, download_size)

  callback for start of downloading patch.

- - (Object) StartProvide(name, archivesize, remote)

  Callback for starting download of a package.

## Instance Method Details

### - (`Object`) DoneDownload(error_value, error_text)

    215
    216
    217
    218
    219
    220
    221
    222
    223
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 215

    def DoneDownload(error_value, error_text)
      Builtins.y2debug("DoneDownload %1, %2", error_value, error_text)
      PackageCallbacks.DoneDownload(error_value, error_text)
      # if (last_callback != "FinishPatchDeltaProvide")
      #     FinishLine (false);
      # last_callback   = "DoneDownload";

      nil
    end

### - (`Object`) DonePackage(error, reason)

callback for 'package installed' action

return “” for ignore return "R" for retry return "C" for abort (not implemented !)

    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 184

    def DonePackage(error, reason)
      ret = PackageCallbacks.DonePackage(error, reason)
      if ret == "I"
        FinishLine(true)
        @total_progress = Ops.add(@total_progress, 1)
        if UI.WidgetExists(Id(:you_total_progress))
          UI.ChangeWidget(Id(:you_total_progress), :Value, @total_progress)
        end
      end
      @last_callback = "DonePackage"
      ret
    end

### - (`Object`) DoneProvide(error, reason, name)

callback for 'package provided' action

return “” for ignore return "R" for retry return "C" for abort (not implemented !)

    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 202

    def DoneProvide(error, reason, name)
      ret = PackageCallbacks.DoneProvide(error, reason, name)
      if ret == "I"
        FinishLine(false) if @last_callback != "FinishPatchDeltaProvide"
        @total_progress = Ops.add(@total_progress, 1)
        if UI.WidgetExists(Id(:you_total_progress))
          UI.ChangeWidget(Id(:you_total_progress), :Value, @total_progress)
        end
      end
      @last_callback = "DoneProvide"
      ret
    end

### - (`Object`) FinishLine(line)

Callback for finishing an action in the log

Parameters:

- line (`Boolean`) —

  true if we are adding to the end of line

    172
    173
    174
    175
    176
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 172

    def FinishLine(line)
      # progress log item (=previous action finished correctly)
      ProgressLog(Ops.add(Ops.add(line ? @indent : "", _("OK")), "\n"))
      true
    end

### - (`Object`) FinishPatchDeltaProvide

finish of download/application of delta or patch download

    375
    376
    377
    378
    379
    380
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 375

    def FinishPatchDeltaProvide
      FinishLine(false) if @last_callback != "DoneDownload"
      @last_callback = "FinishPatchDeltaProvide"

      nil
    end

### - (`Object`) main

    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 31

    def main
      Yast.import "Pkg"
      Yast.import "UI"

      textdomain "online-update"

      Yast.import "OnlineUpdateDialogs"
      Yast.import "PackageCallbacks"
      Yast.import "Popup"
      Yast.import "Report"

      @total_progress = 0

      # if user aborted the installation
      @aborted = false

      # last callback called
      @last_callback = ""

      # indentation of subtasks progress reports
      @indent = "  "
    end

### - (`Object`) Message(patch_name, patch_version, patch_arch, message)

display a message

    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 471

    def Message(patch_name, patch_version, patch_arch, message)
      patch_full_name = PackageCallbacks.FormatPatchName(
        patch_name,
        patch_version,
        patch_arch
      )
      Builtins.y2milestone("Message (%1): %2", patch_full_name, message)

      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

      # use richtext, the message might be too long for standard popup
      Popup.LongMessage(Ops.add(patch_full_name, message))
      @last_callback = "Message"

      true # = continue, TODO: use Continue/Cancel dialog
    end

### - (`Object`) MessageCallback(patchname, patchsummary, message)

    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 82

    def MessageCallback(patchname, patchsummary, message)
      @last_callback = "MessageCallback"

      # handle all messages as post (OK only)
      patches = [
        {
          "name"            => patchname,
          "summary"         => patchsummary,
          "postinformation" => message
        }
      ]

      OnlineUpdateDialogs.MessagePopup(patches, false)

      nil
    end

### - (`Object`) PatchProgressCallback(num)

Callback for patch (resp. delta rpm) progress widget.

Parameters:

- num (`Fixnum`) —

  position of progress widget (0 to 100)

    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 56

    def PatchProgressCallback(num)
      # do not save this one - we need to store Start/Done pairs
      # last_callback	= "PatchProgressCallback";

      Builtins.y2debug("PatchProgressCallback %1", num)
      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(Id(:you_patch_progress), :Value, num)
      end

      return false if @aborted

      ret = Convert.to_symbol(UI.PollInput)

      if (ret == :abort || ret == :cancel) &&
          OnlineUpdateDialogs.ConfirmAbortUpdate(:incomplete)
        @aborted = true
        return false
      end
      true
    end

### - (`Object`) ProblemDeltaApply(description)

callback for problem during aplying delta

    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 309

    def ProblemDeltaApply(description)
      Builtins.y2debug("ProblemDeltaAply: %1", description)
      ProgressLog(
        Ops.add(
          Ops.add(
            Ops.add("\n", @indent),
            # progress log item (previous action failed(%1 is reason)
            Builtins.sformat(_("Failed to apply delta RPM: %1"), description)
          ),
          "\n"
        )
      )
      @last_callback = "ProblemDeltaApply"

      nil
    end

### - (`Object`) ProblemDeltaDownload(description)

callback for problem during downloading delta

    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 258

    def ProblemDeltaDownload(description)
      Builtins.y2debug("ProblemDeltaDownload: %1", description)
      ProgressLog(
        Ops.add(
          Ops.add(
            Ops.add("\n", @indent),
            # progress log item (previous action failed(%1 is reason)
            Builtins.sformat(_("Failed to download delta RPM: %1"), description)
          ),
          "\n"
        )
      )
      @last_callback = "ProblemDeltaDownload"

      nil
    end

### - (`Object`) ProblemPatchDownload(description)

callback for problem during aplying delta

    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 357

    def ProblemPatchDownload(description)
      Builtins.y2debug("ProblemPatchDownload: %1", description)
      ProgressLog(
        Ops.add(
          Ops.add(
            Ops.add("\n", @indent),
            # progress log item (previous action failed(%1 is reason)
            Builtins.sformat(_("Failed to download patch RPM: %1"), description)
          ),
          "\n"
        )
      )
      @last_callback = "ProblemPatchDownload"

      nil
    end

### - (`Object`) ProgressDeltaApply(num)

progress of applying delta (cannot be aborted)

    298
    299
    300
    301
    302
    303
    304
    305
    306
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 298

    def ProgressDeltaApply(num)
      Builtins.y2debug("ProgressDeltaApply: %1", num)
      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(Id(:you_patch_progress), :Value, num)
      end
      @last_callback = "ProgressDeltaApply"

      nil
    end

### - (`Boolean`) ProgressDeltaDownload(num)

callback for delta download progress

Returns:

- (`Boolean`) —

  abort the download?

    250
    251
    252
    253
    254
    255
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 250

    def ProgressDeltaDownload(num)
      Builtins.y2debug("ProgressDeltaDownload %1", num)
      ret = PatchProgressCallback(num)
      @last_callback = "ProgressDeltaDownload"
      ret
    end

### - (`Object`) ProgressDownloadCallback(percent, bps_avg, bps_current)

    77
    78
    79
    80
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 77

    def ProgressDownloadCallback(percent, bps_avg, bps_current)
      Builtins.y2debug("ProgressDownloadCallback %1%%", percent)
      PatchProgressCallback(percent)
    end

### - (`Object`) ProgressLog(text)

add a text to the installation progress log

    100
    101
    102
    103
    104
    105
    106
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 100

    def ProgressLog(text)
      Builtins.y2debug("ProgressLog %1", text)

      UI.ChangeWidget(Id(:log), :LastLine, text) if UI.WidgetExists(Id(:log))

      nil
    end

### - (`Boolean`) ProgressPatchDownload(num)

callback for path download progress

Returns:

- (`Boolean`) —

  abort the download?

    348
    349
    350
    351
    352
    353
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 348

    def ProgressPatchDownload(num)
      Builtins.y2debug("ProgressPatchDownload %1", num)
      ret = PatchProgressCallback(num)
      @last_callback = "ProgressPatchDownload"
      ret
    end

### - (`Object`) RefreshAllSources

Refresh all sources with autorefresh enabled. This function is a temporary solution for bug #154990

    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
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 607

    def RefreshAllSources
      Builtins.y2milestone("Refreshing all sources...")
      mgr_ok = Pkg.SourceStartManager(true)
      if !mgr_ok
        # error popoup (detailed info follows)
        Report.LongWarning(
          Ops.add(
            _("There was an error in the repository initialization.") + "\n",
            Pkg.LastError
          )
        )
      end

      all_sources = Pkg.SourceEditGet

      # There are no sources, nothing to refresh
      if all_sources == nil || Ops.less_than(Builtins.size(all_sources), 1)
        Builtins.y2warning("No sources defined, nothing to refresh...")
        return
      end
      Builtins.foreach(all_sources) do |one_source|
        source_id = Ops.get_integer(one_source, "SrcId")
        source_autorefresh = Ops.get_boolean(one_source, "autorefresh", true)
        source_enabled = Ops.get_boolean(one_source, "enabled", true)
        if source_id != nil && source_autorefresh == true &&
            source_enabled == true
          Builtins.y2milestone("Refreshing source: %1", source_id)
          Pkg.SourceRefreshNow(source_id)
        end
      end
      Builtins.y2milestone("... refreshing done")

      nil
    end

### - (`Object`) RefreshSources(sources)

Refresh sources given by argument

    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 643

    def RefreshSources(sources)
      sources = deep_copy(sources)
      Builtins.y2milestone("Refreshing sources...")
      Builtins.foreach(sources) do |one_source|
        source_id = Ops.get_integer(one_source, "SrcId")
        source_autorefresh = Ops.get_boolean(one_source, "autorefresh", true)
        source_enabled = Ops.get_boolean(one_source, "enabled", true)
        if source_id != nil && source_autorefresh == true &&
            source_enabled == true
          Builtins.y2milestone("Refreshing source: %1", source_id)
          Pkg.SourceRefreshNow(source_id)
        end
      end
      Builtins.y2milestone("... refreshing done")

      nil
    end

### - (`Object`) RegisterOnlineUpdateCallbacks

Constructor

    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 494

    def RegisterOnlineUpdateCallbacks
      Builtins.y2milestone("OnlineUpdateCallbacks constructor")

      Pkg.CallbackStartProvide(
        fun_ref(method(:StartProvide), "void (string, integer, boolean)")
      )
      Pkg.CallbackProgressProvide(
        fun_ref(method(:PatchProgressCallback), "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(:PatchProgressCallback), "boolean (integer)")
      )
      Pkg.CallbackDonePackage(
        fun_ref(method(:DonePackage), "string (integer, string)")
      )

      Pkg.CallbackResolvableReport(
        fun_ref(method(:MessageCallback), "void (string, string, string)")
      )

      Pkg.CallbackStartDownload(
        fun_ref(method(:StartDownload), "void (string, string)")
      )
      Pkg.CallbackProgressDownload(
        fun_ref(
          method(:ProgressDownloadCallback),
          "boolean (integer, integer, integer)"
        )
      )
      Pkg.CallbackDoneDownload(
        fun_ref(method(:DoneDownload), "void (integer, string)")
      )

      Pkg.CallbackMediaChange(
        fun_ref(
          PackageCallbacks.method(:MediaChange),
          "string (string, string, string, string, integer, string, integer, string, boolean, list <string>, integer)"
        )
      )

      # delta download
      Pkg.CallbackStartDeltaDownload(
        fun_ref(method(:StartDeltaDownload), "void (string, integer)")
      )
      Pkg.CallbackProgressDeltaDownload(
        fun_ref(method(:ProgressDeltaDownload), "boolean (integer)")
      )
      Pkg.CallbackProblemDeltaDownload(
        fun_ref(method(:ProblemDeltaDownload), "void (string)")
      )
      Pkg.CallbackFinishDeltaDownload(
        fun_ref(method(:FinishPatchDeltaProvide), "void ()")
      )

      # delta application
      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 ()")
      )

      # patch download
      Pkg.CallbackStartPatchDownload(
        fun_ref(method(:StartPatchDownload), "void (string, integer)")
      )
      Pkg.CallbackProgressPatchDownload(
        fun_ref(method(:ProgressPatchDownload), "boolean (integer)")
      )
      Pkg.CallbackProblemPatchDownload(
        fun_ref(method(:ProblemPatchDownload), "void (string)")
      )
      Pkg.CallbackFinishPatchDownload(
        fun_ref(method(:FinishPatchDeltaProvide), "void ()")
      )

      # script callbacks
      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`) ScriptFinish

the script has finished

    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 452

    def ScriptFinish
      Builtins.y2milestone("ScriptFinish")

      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(Id(:you_patch_progress), :Value, 100)
      end

      FinishLine(true)
      @total_progress = Ops.add(@total_progress, 1)
      if UI.WidgetExists(Id(:you_total_progress))
        UI.ChangeWidget(Id(:you_total_progress), :Value, @total_progress)
      end

      @last_callback = "ScriptFinish"

      nil
    end

### - (`Object`) ScriptProblem(description)

an error has occurred

    441
    442
    443
    444
    445
    446
    447
    448
    449
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 441

    def ScriptProblem(description)
      Builtins.y2milestone("ScriptProblem: %1", description)

      # FIXME: use rather LongError here?
      Popup.Error(description)
      @last_callback = "ScriptProblem"

      "A" # = Abort, TODO: support also Ignore and Retry
    end

### - (`Object`) ScriptProgress(ping, output)

print output of the script

    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 420

    def ScriptProgress(ping, output)
      Builtins.y2milestone("ScriptProgress: ping:%1, output: %2", ping, output)

      if output != nil && output != ""
        # add the output to the log widget
        ProgressLog(output)
      end

      @last_callback = "ScriptProgress"

      input = UI.PollInput

      if input == :abort || input == :close
        Builtins.y2milestone("Aborting the script (input: %1)", input)
        return false
      else
        return true
      end
    end

### - (`Object`) ScriptStart(patch_name, patch_version, patch_arch, script_path)

a script has been started

    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
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 386

    def ScriptStart(patch_name, patch_version, patch_arch, script_path)
      Builtins.y2milestone(
        "ScriptStart: patch_name:%1, patch_version:%2, patch_arch:%3, script:%4",
        patch_name,
        patch_version,
        patch_arch,
        script_path
      )
      patch_full_name = PackageCallbacks.FormatPatchName(
        patch_name,
        patch_version,
        patch_arch
      )

      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(
          Id(:you_patch_progress),
          :Label,
          # progress bar label
          _("Script Execution Progress")
        )
        UI.ChangeWidget(Id(:you_patch_progress), :Value, 0)
      end

      # log entry, %1 is name of the patch which contains the script
      log_line = Builtins.sformat(_("Starting script %1"), patch_full_name)

      ProgressLog(Ops.add("\n", log_line))
      @last_callback = "ScriptStart"

      nil
    end

### - (`Object`) StartDeltaApply(name)

callback for start of applying delta rpm

    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 276

    def StartDeltaApply(name)
      # Progress log item (%1 is name of delta RPM).
      # Leave the space at the end, some other text may follow.
      ProgressLog(
        Ops.add(@indent, Builtins.sformat(_("Applying delta RPM: %1 "), name))
      )
      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(
          Id(:you_patch_progress),
          :Label,
          # progress bar label
          _("Delta RPM Application Progress")
        )
        UI.ChangeWidget(Id(:you_patch_progress), :Value, 0)
      end
      @last_callback = "StartDeltaApply"

      nil
    end

### - (`Object`) StartDeltaDownload(name, download_size)

callback for start of delta download

    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 226

    def StartDeltaDownload(name, download_size)
      # progress log item (%1 is name of delta RPM
      if @last_callback == "StartProvide" || @last_callback == "StartDownload"
        ProgressLog(Ops.add("\n", @indent))
      end

      # Progress log. Leave the space at the end, some other text may follow
      ProgressLog(Builtins.sformat(_("Downloading delta RPM %1 "), name))
      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(
          Id(:you_patch_progress),
          :Label,
          # progress bar label
          _("Delta RPM Download Progress")
        )
        UI.ChangeWidget(Id(:you_patch_progress), :Value, 0)
      end
      @last_callback = "StartDeltaDownload"

      nil
    end

### - (`Object`) StartDownload(url, localfile)

    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 126

    def StartDownload(url, localfile)
      # // reformat the URL
      # string url_report = URL::FormatURL(URL::Parse(url), max_size);
      #
      # FIXME new text to ProgressLog?
      # // progress log item (%1 is name of file)
      # string message = sformat (_("Downloading: %1"), url_report);
      # ProgressLog (message);
      # // + progress to 0?
      @last_callback = "StartDownload"

      nil
    end

### - (`Object`) StartPackage(pkg_name, name, summary, installsize, is_delete)

Callback for starting installation of a package.

    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 143

    def StartPackage(pkg_name, name, summary, installsize, is_delete)
      p_name = name != "" ? name : pkg_name
      # progress log action (what is being done with the package)
      action = is_delete ? _("Removing") : _("Installing")
      # progress log item: %1 is action ("Removing" ot "Installing"),
      #  %2 is name of package, %3 is summary
      text = Builtins.sformat("%1 %2: \"%3\"", action, p_name, summary)
      if summary == ""
        # alternative progress log item: only action and package name
        text = Builtins.sformat("%1 %2", action, p_name)
      end

      ProgressLog(text)
      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(
          Id(:you_patch_progress),
          :Label,
          # progress bar label
          _("Package Installation Progress")
        )
        UI.ChangeWidget(Id(:you_patch_progress), :Value, 0)
      end
      @last_callback = "StartPackage"

      nil
    end

### - (`Object`) StartPatchDownload(name, download_size)

callback for start of downloading patch

    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 327

    def StartPatchDownload(name, download_size)
      # progress log item (%1 is name of delta RPM)
      ProgressLog(Ops.add("\n", @indent)) if @last_callback == "StartProvide"
      # Progress log; lave the space at the end, some other text may follow.
      ProgressLog(Builtins.sformat(_("Downloading patch RPM %1 "), name))
      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(
          Id(:you_patch_progress),
          :Label,
          # progress bar label
          _("Patch RPM Download Progress")
        )
        UI.ChangeWidget(Id(:you_patch_progress), :Value, 0)
      end
      @last_callback = "StartPatchDownload"

      nil
    end

### - (`Object`) StartProvide(name, archivesize, remote)

Callback for starting download of a package.

    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    # File '../../src/modules/OnlineUpdateCallbacks.rb', line 109

    def StartProvide(name, archivesize, remote)
      # progress log item (%1 is name of package)
      ProgressLog(Builtins.sformat(_("Retrieving %1..."), name))
      if UI.WidgetExists(Id(:you_patch_progress))
        UI.ChangeWidget(
          Id(:you_patch_progress),
          :Label,
          # progress bar label
          _("Package Download Progress")
        )
        UI.ChangeWidget(Id(:you_patch_progress), :Value, 0)
      end
      @last_callback = "StartProvide"

      nil
    end