Class: Yast::PackageCallbacksClass
- Inherits:
-
Module
- Object
- Module
- Yast::PackageCallbacksClass
- Includes:
- Logger
- Defined in:
- ../../src/modules/PackageCallbacks.rb
Overview
Provides the default Callbacks for Pkg::
Constant Summary
- CLEAR_PROGRESS_TEXT =
text to clean progress bar in command line
"\b" * 10 + " " * 10 + "\b" * 10
- MAX_POPUP_TEXT_SIZE =
max. length of the text in the repository popup window
60
- RETRY_TIMEOUT =
base in seconds for automatic retry after a timeout, it will be logarithmic increased upto RETRY_MAX_TIMEOUT
30
- RETRY_ATTEMPTS =
number of automatic retries
100
- RETRY_MAX_TIMEOUT =
max. retry timeout (15 minutes)
15 * 60
- TICK_LABELS =
symbols for ticking in cmd line
["/", "-", "\\", "|"]
Instance Method Summary (collapse)
- - (Object) AskAbortRefresh
- - (Object) Authentication(url, msg, username, password)
- - (Object) ClearDownloadCallbacks
- - (Object) ClearScriptCallbacks
- - (Object) CloseDownloadProgressPopup
- - (Object) CloseSourcePopup
- - (Object) DestDownload
-
- (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) 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) FinishDeltaProvide
- - (Object) FormatPatchName(patch_name, patch_version, patch_arch)
- - (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) 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) ProblemDeltaApply(descr)
- - (Object) ProblemDeltaDownload(descr)
-
- (Object) ProcessDone
Hander for ProcessDone callback - the process has been finished.
-
- (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) 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
============================================================================= constructor and callback init =============================================================================.
- - (Object) ResetDownloadCallbacks
- - (Object) ResetScanDBCallbacks
- - (Object) RestorePatchCallbacks
- - (Object) RestorePreviousProgressCallbacks
- - (Object) RestoreProcessCallbacks
- - (Object) RestoreProgressReportCallbacks
- - (Object) RestoreProvideCallbacks
- - (Object) RestoreSourceCreateCallbacks
- - (Object) RestoreSourceReportCallbacks
- - (Object) ScriptFinish
- - (Object) ScriptProblem(description)
- - (Object) ScriptProgress(ping, output)
- - (Object) ScriptStart(patch_name, patch_version, patch_arch, script_path)
- - (Object) SetConvertDBCallbacks
- - (Object) SetDownloadCallbacks
- - (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) 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) 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)
Instance Method Details
- (Object) AskAbortRefresh
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 1659 |
# File '../../src/modules/PackageCallbacks.rb', line 1619 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)
2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 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 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 |
# File '../../src/modules/PackageCallbacks.rb', line 2191 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.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) ClearDownloadCallbacks
1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 |
# File '../../src/modules/PackageCallbacks.rb', line 1861 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
2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 |
# File '../../src/modules/PackageCallbacks.rb', line 2505 def ClearScriptCallbacks Pkg.CallbackScriptStart(nil) Pkg.CallbackScriptProgress(nil) Pkg.CallbackScriptProblem(nil) Pkg.CallbackScriptFinish(nil) Pkg.CallbackMessage(nil) nil end |
- (Object) CloseDownloadProgressPopup
1666 1667 1668 1669 1670 |
# File '../../src/modules/PackageCallbacks.rb', line 1666 def CloseDownloadProgressPopup UI.CloseDialog if IsDownloadProgressPopup() nil end |
- (Object) CloseSourcePopup
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 |
# File '../../src/modules/PackageCallbacks.rb', line 1000 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
1704 1705 1706 1707 1708 |
# File '../../src/modules/PackageCallbacks.rb', line 1704 def DestDownload CloseDownloadProgressPopup() if !full_screen nil end |
- (Object) DoneDownload(error_value, error_text)
just log the status, errors are handled in MediaChange callback
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 |
# File '../../src/modules/PackageCallbacks.rb', line 1815 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 !)
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 |
# File '../../src/modules/PackageCallbacks.rb', line 409 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( if @_deleting_package # error popup during package installation, %1 is the name of the package _("Removal of package %1 failed.") else # error popup during package installation, %1 is the name of the package _("Installation of package %1 failed.") end, @_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), layout_popup(, , true) ) UI.ReplaceWidget(Id(:info), RichText(Opt(:plainText), reason)) else UI.OpenDialog( Opt(:decorated), layout_popup(, , false) ) UI.ReplaceWidget(Id(:info), Empty()) end r = nil loop do r = UI.UserInput if r == :show @showLongInfo = show_log_info(, ) if @showLongInfo UI.ReplaceWidget(Id(:info), RichText(Opt(:plainText), reason)) else UI.ReplaceWidget(Id(:info), Empty()) end end break if r == :abort || r == :retry || r == :ignore end 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
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File '../../src/modules/PackageCallbacks.rb', line 198 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_PROGRESS_TEXT) 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.IgnoreButton) ) if @showLongInfo UI.OpenDialog( Opt(:decorated), layout_popup(, , true) ) UI.ReplaceWidget( Id(:info), RichText( Opt(:plainText), Ops.add(Builtins.sformat(_("Error: %1:"), error), reason) ) ) else UI.OpenDialog( Opt(:decorated), layout_popup(, , false) ) UI.ReplaceWidget(Id(:info), Empty()) end r = nil loop do r = UI.UserInput if r == :show @showLongInfo = show_log_info(, ) 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 break if r == :abort || r == :retry || r == :ignore end 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
2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 |
# File '../../src/modules/PackageCallbacks.rb', line 2169 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 !full_screen Builtins.y2error("The toplevel dialog is not a scan DB popup!") end end nil end |
- (Object) EnableAsterixPackage(f)
nasty hack for inst_do_net_test client. Remove it when client disappear
Enable or disable StartPackage, ProgressPackage and DonePackage callbacks, but only the progress bar and not the final error message. Returns old value.
345 346 347 348 349 |
# File '../../src/modules/PackageCallbacks.rb', line 345 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
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 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 |
# File '../../src/modules/PackageCallbacks.rb', line 2078 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), layout_popup(, , false) ) r = nil loop do r = UI.UserInput if r == :show show_details = show_log_info(, ) 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 break if r == :abort || r == :retry || r == :ignore end 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) FinishDeltaProvide
1439 1440 1441 1442 1443 1444 1445 1446 |
# File '../../src/modules/PackageCallbacks.rb', line 1439 def FinishDeltaProvide if @_provide_popup UI.CloseDialog @_provide_popup = false end nil end |
- (Object) FormatPatchName(patch_name, patch_version, patch_arch)
1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 |
# File '../../src/modules/PackageCallbacks.rb', line 1462 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) InitDownload(task)
1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 |
# File '../../src/modules/PackageCallbacks.rb', line 1672 def InitDownload(task) if !Mode.commandline if !full_screen && !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
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 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 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 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 |
# File '../../src/modules/PackageCallbacks.rb', line 2763 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
1661 1662 1663 1664 |
# File '../../src/modules/PackageCallbacks.rb', line 1661 def IsDownloadProgressPopup !Mode.commandline && UI.WidgetExists(Id(:download_progress_popup_window)) && UI.WidgetExists(Id(:progress)) end |
- (Object) IsProgressPopup
is the top level progress popup?
2265 2266 2267 2268 |
# File '../../src/modules/PackageCallbacks.rb', line 2265 def IsProgressPopup UI.WidgetExists(Id(:progress_widget)) && UI.WidgetExists(Id(:callback_progress_popup)) end |
- (Object) IsSourcePopup
is the top level window source popup?
987 988 989 |
# File '../../src/modules/PackageCallbacks.rb', line 987 def IsSourcePopup UI.WidgetExists(Id(:progress)) && UI.WidgetExists(Id(:label_source_popup)) end |
- (Object) main
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 |
# File '../../src/modules/PackageCallbacks.rb', line 48 def main Yast.import "Pkg" Yast.import "UI" textdomain "base" 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 "Icon" Yast.import "Report" Yast.import "Wizard" Yast.import "Progress" Yast.import "FileUtils" Yast.import "SignatureCheckCallbacks" @_provide_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 = "\b\b\b\b\b\b\b\b\b\b" @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 = File.join(Directory.vardir, "/package_callbacks.conf") @config = nil # auto ejecting is in progress @doing_eject = false # current values for retry functionality @retry_url = "" @current_retry_timeout = RETRY_TIMEOUT @current_retry_attempt = 0 #============================================================================= # MEDIA CHANGE #============================================================================= @detected_cd_devices = [] # reference counter 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_progress = false @val_progress = false @current_tick = 0 # ProgressStart/End events may be nested, remember the types of progresses @progress_stack = [] @last_stage = 0 @opened_wizard = [] Builtins.y2milestone("PackageCallbacks constructor") InitPackageCallbacks() 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
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 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 |
# File '../../src/modules/PackageCallbacks.rb', line 540 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_scheme = Ops.get_string(URL.Parse(url), "scheme", "").downcase # true if it makes sense to offer an eject button (for cd/dvd only ...) is_disc = ["cd", "dvd"].include?(url_scheme) # do automatic eject if is_disc && autoeject && !@doing_eject Builtins.y2milestone("Automatically ejecting the medium...") @doing_eject = true return "E" 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 = if is_disc # 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) else # 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) end else wanted_label = if is_disc # 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) else # 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 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 !is_disc # 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 # -------------------------------------- # build up button box = ButtonBox( PushButton(Id(:retry), Opt(:default, :okButton), Label.RetryButton) ) if current == -1 # wrong media id, offer "Ignore" .params << PushButton(Id(:ignore), Opt(:customButton), Label.IgnoreButton) end .params << 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 .params << PushButton(Id(:skip), Opt(:customButton), _("&Skip")) if is_disc if !@doing_eject @detected_cd_devices = cd_devices(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 .params << PushButton(Id(:eject), Opt(:customButton), _("&Eject")) end = VBox( Left( CheckBox( Id(:auto_eject), _("A&utomatically Eject CD or DVD Medium"), autoeject ) ), ) 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 = if @current_retry_attempt < 10 RETRY_TIMEOUT * (1 << @current_retry_attempt) else RETRY_MAX_TIMEOUT end 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), retry_label(@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", layout_popup(, , true) ) if @showLongInfo UI.OpenDialog( Opt(:decorated), layout_popup(, , 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), layout_popup(, , false) ) UI.ReplaceWidget(Id(:info), Empty()) end # notification UI.Beep r = nil eject_device = "" loop do r = doing_auto_retry ? UI.TimeoutUserInput(1000) : UI.UserInput # timout in autoretry mode? if doing_auto_retry if r == :timeout # decrease timeout counter @current_retry_timeout -= 1 if @current_retry_timeout == 0 Builtins.y2milestone("The time is out, doing automatic retry...") # do the retry r = :retry @current_retry_attempt += 1 else # popup string - refresh the displayed counter UI.ChangeWidget( Id(:auto_retry), :Label, retry_label(@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 = show_log_info(, ) 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 r.is_a?(::String) && r.start_with?("/dev/") Builtins.y2milestone("Eject request for %1", r) eject_device = r r = :eject end break if [:cancel, :retry, :eject, :skip, :ignore, :url].include?(r) end # check and save the autoeject configuration if needed remember_autoeject if is_disc Builtins.y2milestone("MediaChange %1", r) UI.CloseDialog if @_provide_popup UI.CloseDialog @_provide_popup = false end case r when :ignore then "I" when :skip then "S" when :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 "C" when :eject @doing_eject = true return "E" if eject_device == "" # 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 Builtins.y2milestone("Device %1 has index %2", eject_device, dindex) return "E#{dindex}" else Builtins.y2warning( "Device %1 not found in the list, using default", eject_device ) return "E" end when :url Builtins.y2milestone("Redirecting to: %1", URL.HidePassword(url)) url else "" end end |
- (Object) Message(patch_name, patch_version, patch_arch, message)
1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 |
# File '../../src/modules/PackageCallbacks.rb', line 1604 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
2258 2259 2260 2261 2262 |
# File '../../src/modules/PackageCallbacks.rb', line 2258 def NextTick @current_tick = (@current_tick + 1) % TICK_LABELS nil end |
- (Object) NotifyConvertDB
1992 1993 1994 |
# File '../../src/modules/PackageCallbacks.rb', line 1992 def NotifyConvertDB nil end |
- (Object) NotifyRebuildDB
1922 1923 1924 |
# File '../../src/modules/PackageCallbacks.rb', line 1922 def NotifyRebuildDB nil end |
- (Object) OpenSourcePopup
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 |
# File '../../src/modules/PackageCallbacks.rb', line 934 def OpenSourcePopup if @_source_open == 0 UI.OpenDialog( VBox( HSpacing(MAX_POPUP_TEXT_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) ProblemDeltaApply(descr)
1455 1456 1457 1458 1459 1460 |
# File '../../src/modules/PackageCallbacks.rb', line 1455 def ProblemDeltaApply(descr) FinishDeltaProvide() # close popup Builtins.y2milestone("Failed to apply delta RPM: %1", descr) nil end |
- (Object) ProblemDeltaDownload(descr)
1448 1449 1450 1451 1452 1453 |
# File '../../src/modules/PackageCallbacks.rb', line 1448 def ProblemDeltaDownload(descr) FinishDeltaProvide() # close popup Builtins.y2milestone("Failed to download delta RPM: %1", descr) nil end |
- (Object) ProcessDone
Hander for ProcessDone callback - the process has been finished
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 |
# File '../../src/modules/PackageCallbacks.rb', line 2464 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) ProcessNextStage
Hander for ProcessNextStage callback - the current stage has been finished
2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 |
# File '../../src/modules/PackageCallbacks.rb', line 2451 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
2440 2441 2442 2443 2444 2445 2446 2447 2448 |
# File '../../src/modules/PackageCallbacks.rb', line 2440 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
2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 |
# File '../../src/modules/PackageCallbacks.rb', line 2398 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 + number of stages as the max value, # Progress module counts stages as extra steps Progress.New(task, "", 100 + stages.size, 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) ProgressConvertDB(percent, _file)
1970 1971 1972 1973 1974 |
# File '../../src/modules/PackageCallbacks.rb', line 1970 def ProgressConvertDB(percent, _file) UI.ChangeWidget(Id(:progress), :Value, percent) nil end |
- (Object) ProgressDeltaApply(percent)
redirect ProgressDeltaApply callback (a different signature is required)
187 188 189 190 191 |
# File '../../src/modules/PackageCallbacks.rb', line 187 def ProgressDeltaApply(percent) ProgressProvide(percent) nil end |
- (Object) ProgressDownload(percent, bps_avg, bps_current)
1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 |
# File '../../src/modules/PackageCallbacks.rb', line 1741 def ProgressDownload(percent, bps_avg, bps_current) if @autorefreshing && @autorefreshing_aborted Builtins.y2milestone("Refresh aborted") return false end if Mode.commandline CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + "#{percent}%") if percent == 100 # sleep for a wile Builtins.sleep(200) # remove the progress CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT) # 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 = if textmode Ops.add("%1 - ", @download_file) else Ops.add(@download_file, " - %1") end # 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 full_screen 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)
2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 |
# File '../../src/modules/PackageCallbacks.rb', line 2323 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 full_screen 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.
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
# File '../../src/modules/PackageCallbacks.rb', line 387 def ProgressPackage(percent) if @_package_popup UI.ChangeWidget(Id(:progress), :Value, percent) return UI.PollInput != :abort elsif Mode.commandline CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + "#{percent}%") if percent == 100 # sleep for a wile Builtins.sleep(200) # remove the progress CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT) end end true end |
- (Object) ProgressProgress(id, val_raw, val_percent)
2355 2356 2357 2358 2359 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 |
# File '../../src/modules/PackageCallbacks.rb', line 2355 def ProgressProgress(id, val_raw, val_percent) Builtins.y2debug("ProgressProgress: %1, %2%% ", id, val_percent) if Mode.commandline if @tick_progress tick_label = TICK_LABELS[@current_tick] CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + tick_label) NextTick() else CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + "#{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 full_screen # fullscreen callbacks Progress.SubprogressValue(val_percent) end end true end |
- (Object) ProgressProvide(percent)
during file providal
173 174 175 176 177 178 179 180 181 182 183 184 |
# File '../../src/modules/PackageCallbacks.rb', line 173 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(CLEAR_PROGRESS_TEXT + "#{percent}%") end true end |
- (Object) ProgressRebuildDB(percent)
1900 1901 1902 1903 1904 |
# File '../../src/modules/PackageCallbacks.rb', line 1900 def ProgressRebuildDB(percent) UI.ChangeWidget(Id(:progress), :Value, percent) nil end |
- (Object) ProgressScanDb(value)
Callback for RPM DB scan progress
2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 |
# File '../../src/modules/PackageCallbacks.rb', line 2057 def ProgressScanDb(value) if Mode.commandline CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + "#{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 full_screen Progress.Step(value) end end # continue true end |
- (Object) ProgressStart(id, task, in_percent, is_alive, _min, _max, _val_raw, val_percent)
2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 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 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 |
# File '../../src/modules/PackageCallbacks.rb', line 2270 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 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 full_screen Progress.SubprogressType(subprogress_type, 100) Progress.SubprogressTitle(task) else UI.OpenDialog( HBox( HSpacing(1), VBox( VSpacing(0.5), HSpacing(Id(:callback_progress_popup), MAX_POPUP_TEXT_SIZE), if in_percent ProgressBar(Id(:progress_widget), task, 100, val_percent) else BusyIndicator(Id(:progress_widget), task, 3000) end, VSpacing(0.2), ButtonBox( PushButton(Id(:abort), Opt(:cancelButton), Label.AbortButton) ), VSpacing(0.5) ), HSpacing(1) ) ) end end nil end |
- (Object) RefreshDone
1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 |
# File '../../src/modules/PackageCallbacks.rb', line 1848 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
1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 |
# File '../../src/modules/PackageCallbacks.rb', line 1833 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
=============================================================================
constructor and callback init
2865 2866 2867 |
# File '../../src/modules/PackageCallbacks.rb', line 2865 def RegisterEmptyProgressCallbacks ::Packages::DummyCallbacks.register end |
- (Object) ResetDownloadCallbacks
2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 |
# File '../../src/modules/PackageCallbacks.rb', line 2580 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
2550 2551 2552 2553 2554 2555 2556 2557 |
# File '../../src/modules/PackageCallbacks.rb', line 2550 def ResetScanDBCallbacks Pkg.CallbackStartScanDb(nil) Pkg.CallbackProgressScanDb(nil) Pkg.CallbackErrorScanDb(nil) Pkg.CallbackDoneScanDb(nil) nil end |
- (Object) RestorePatchCallbacks
2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 |
# File '../../src/modules/PackageCallbacks.rb', line 2889 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) nil end |
- (Object) RestorePreviousProgressCallbacks
2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 |
# File '../../src/modules/PackageCallbacks.rb', line 2933 def RestorePreviousProgressCallbacks RestoreProcessCallbacks() RestoreProvideCallbacks() RestorePatchCallbacks() RestoreSourceCreateCallbacks() RestoreSourceReportCallbacks() RestoreProgressReportCallbacks() ClearScriptCallbacks() ResetScanDBCallbacks() ResetDownloadCallbacks() nil end |
- (Object) RestoreProcessCallbacks
2869 2870 2871 2872 2873 2874 2875 2876 |
# File '../../src/modules/PackageCallbacks.rb', line 2869 def RestoreProcessCallbacks Pkg.CallbackProcessStart(nil) Pkg.CallbackProcessProgress(nil) Pkg.CallbackProcessNextStage(nil) Pkg.CallbackProcessDone(nil) nil end |
- (Object) RestoreProgressReportCallbacks
2925 2926 2927 2928 2929 2930 2931 |
# File '../../src/modules/PackageCallbacks.rb', line 2925 def RestoreProgressReportCallbacks Pkg.CallbackProgressReportStart(nil) Pkg.CallbackProgressReportProgress(nil) Pkg.CallbackProgressReportEnd(nil) nil end |
- (Object) RestoreProvideCallbacks
2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 |
# File '../../src/modules/PackageCallbacks.rb', line 2878 def RestoreProvideCallbacks Pkg.CallbackStartProvide(nil) Pkg.CallbackProgressProvide(nil) Pkg.CallbackDoneProvide(nil) Pkg.CallbackStartPackage(nil) Pkg.CallbackProgressPackage(nil) Pkg.CallbackDonePackage(nil) nil end |
- (Object) RestoreSourceCreateCallbacks
2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 |
# File '../../src/modules/PackageCallbacks.rb', line 2903 def RestoreSourceCreateCallbacks Pkg.CallbackSourceCreateStart(nil) Pkg.CallbackSourceCreateProgress(nil) Pkg.CallbackSourceCreateError(nil) Pkg.CallbackSourceCreateEnd(nil) Pkg.CallbackSourceCreateInit(nil) Pkg.CallbackSourceCreateDestroy(nil) nil end |
- (Object) RestoreSourceReportCallbacks
2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 |
# File '../../src/modules/PackageCallbacks.rb', line 2914 def RestoreSourceReportCallbacks Pkg.CallbackSourceReportStart(nil) Pkg.CallbackSourceReportProgress(nil) Pkg.CallbackSourceReportError(nil) Pkg.CallbackSourceReportEnd(nil) Pkg.CallbackSourceReportInit(nil) Pkg.CallbackSourceReportDestroy(nil) nil end |
- (Object) ScriptFinish
1596 1597 1598 1599 1600 1601 1602 |
# File '../../src/modules/PackageCallbacks.rb', line 1596 def ScriptFinish Builtins.y2milestone("ScriptFinish") UI.CloseDialog if @_script_popup nil end |
- (Object) ScriptProblem(description)
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 |
# File '../../src/modules/PackageCallbacks.rb', line 1563 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)
1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 |
# File '../../src/modules/PackageCallbacks.rb', line 1543 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)
1481 1482 1483 1484 1485 1486 1487 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 |
# File '../../src/modules/PackageCallbacks.rb', line 1481 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( if patch_full_name != "" HBox( # label, patch name follows Label(Opt(:boldFont), _("Patch: ")), Label(patch_full_name), HStretch() ) else Empty() end, 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) SetConvertDBCallbacks
1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 |
# File '../../src/modules/PackageCallbacks.rb', line 1996 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
2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 |
# File '../../src/modules/PackageCallbacks.rb', line 2559 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) SetHeaderSourcePopup(text)
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 |
# File '../../src/modules/PackageCallbacks.rb', line 951 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_POPUP_TEXT_SIZE, ui_adjustment) ) text = (text, Ops.subtract(MAX_POPUP_TEXT_SIZE, ui_adjustment)) end UI.ChangeWidget(:label_source_popup, :Value, text) Builtins.y2milestone("SourcePopup: new header: %1", text) nil end |
- (Object) SetLabelSourcePopup(text)
968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 |
# File '../../src/modules/PackageCallbacks.rb', line 968 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_POPUP_TEXT_SIZE, ui_adjustment) ) text = (text, Ops.add(MAX_POPUP_TEXT_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
2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 |
# File '../../src/modules/PackageCallbacks.rb', line 2491 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
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 2707 2708 2709 2710 |
# File '../../src/modules/PackageCallbacks.rb', line 2682 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(:FinishDeltaProvide), "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(:FinishDeltaProvide), "void ()") ) nil end |
- (Object) SetProcessCallbacks
2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 |
# File '../../src/modules/PackageCallbacks.rb', line 2640 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
2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 |
# File '../../src/modules/PackageCallbacks.rb', line 2742 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
2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 |
# File '../../src/modules/PackageCallbacks.rb', line 2656 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
1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 |
# File '../../src/modules/PackageCallbacks.rb', line 1926 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
2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 |
# File '../../src/modules/PackageCallbacks.rb', line 2535 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
2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 |
# File '../../src/modules/PackageCallbacks.rb', line 2516 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
2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 |
# File '../../src/modules/PackageCallbacks.rb', line 2592 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
2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 |
# File '../../src/modules/PackageCallbacks.rb', line 2616 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
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 |
# File '../../src/modules/PackageCallbacks.rb', line 2712 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) SourceChange(source, medianr)
dummy repository change callback, see SlideShowCallbacks for the real one
927 928 929 930 931 932 |
# File '../../src/modules/PackageCallbacks.rb', line 927 def SourceChange(source, medianr) Builtins.y2milestone("SourceChange (%1, %2)", source, medianr) @_current_source = source nil end |
- (Object) SourceCreateDestroy
1027 1028 1029 1030 1031 1032 1033 |
# File '../../src/modules/PackageCallbacks.rb', line 1027 def SourceCreateDestroy Builtins.y2milestone("SourceCreateDestroy") CloseSourcePopup() nil end |
- (Object) SourceCreateEnd(url, error, description)
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 |
# File '../../src/modules/PackageCallbacks.rb', line 1126 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)
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 |
# File '../../src/modules/PackageCallbacks.rb', line 1063 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
1019 1020 1021 1022 1023 1024 1025 |
# File '../../src/modules/PackageCallbacks.rb', line 1019 def SourceCreateInit Builtins.y2milestone("SourceCreateInit") OpenSourcePopup() nil end |
- (Object) SourceCreateProgress(percent)
1056 1057 1058 1059 1060 1061 |
# File '../../src/modules/PackageCallbacks.rb', line 1056 def SourceCreateProgress(percent) ret = SourcePopupSetProgress(percent) Builtins.y2milestone("SourceCreateProgress(%1) = %2", percent, ret) ret end |
- (Object) SourceCreateStart(url)
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 |
# File '../../src/modules/PackageCallbacks.rb', line 1035 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)
991 992 993 994 995 996 997 998 |
# File '../../src/modules/PackageCallbacks.rb', line 991 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)
1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 |
# File '../../src/modules/PackageCallbacks.rb', line 1255 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)
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 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 |
# File '../../src/modules/PackageCallbacks.rb', line 1190 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)
1166 1167 1168 1169 1170 1171 1172 1173 1174 |
# File '../../src/modules/PackageCallbacks.rb', line 1166 def SourceProbeFailed(url, type) Builtins.y2milestone( "Repository %1 is not %2 repository", URL.HidePassword(url), type ) nil end |
- (Object) SourceProbeProgress(_url, value)
1186 1187 1188 |
# File '../../src/modules/PackageCallbacks.rb', line 1186 def SourceProbeProgress(_url, value) SourcePopupSetProgress(value) end |
- (Object) SourceProbeStart(url)
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 |
# File '../../src/modules/PackageCallbacks.rb', line 1140 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)
1176 1177 1178 1179 1180 1181 1182 1183 1184 |
# File '../../src/modules/PackageCallbacks.rb', line 1176 def SourceProbeSucceeded(url, type) Builtins.y2milestone( "Repository %1 is type %2", URL.HidePassword(url), type ) nil end |
- (Object) SourceReportDestroy
1383 1384 1385 1386 1387 1388 |
# File '../../src/modules/PackageCallbacks.rb', line 1383 def SourceReportDestroy Builtins.y2milestone("Source report destroy") CloseSourcePopup() nil end |
- (Object) SourceReportEnd(src_id, url, task, error, description)
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 |
# File '../../src/modules/PackageCallbacks.rb', line 1360 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)
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 |
# File '../../src/modules/PackageCallbacks.rb', line 1299 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
1376 1377 1378 1379 1380 1381 |
# File '../../src/modules/PackageCallbacks.rb', line 1376 def SourceReportInit Builtins.y2milestone("Source report init") OpenSourcePopup() nil end |
- (Object) SourceReportProgress(value)
1292 1293 1294 1295 1296 1297 |
# File '../../src/modules/PackageCallbacks.rb', line 1292 def SourceReportProgress(value) ret = SourcePopupSetProgress(value) Builtins.y2debug("SourceReportProgress(%1) = %2", value, ret) ret end |
- (Object) SourceReportStart(source_id, url, task)
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 |
# File '../../src/modules/PackageCallbacks.rb', line 1269 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)
1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 |
# File '../../src/modules/PackageCallbacks.rb', line 1939 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
1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 |
# File '../../src/modules/PackageCallbacks.rb', line 1415 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
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 |
# File '../../src/modules/PackageCallbacks.rb', line 1392 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 = progress_box(_("Downloading Delta RPM package"), name, sz) UI.OpenDialog(providebox) @_provide_popup = true end nil end |
- (Object) StartDownload(url, localfile)
1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 |
# File '../../src/modules/PackageCallbacks.rb', line 1710 def StartDownload(url, localfile) Builtins.y2milestone( "Downloading %1 to %2", URL.HidePassword(url), localfile ) # reformat the URL url_report = URL.FormatURL(URL.Parse(URL.HidePassword(url)), MAX_POPUP_TEXT_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 full_screen Progress.SubprogressType(:progress, 100) Progress.SubprogressTitle() end end nil end |
- (Object) StartPackage(name, _location, _summary, installsize, is_delete)
At start of package install.
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File '../../src/modules/PackageCallbacks.rb', line 352 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( if is_delete _("Uninstalling package %1 (%2)...") else _("Installing package %1 (%2)...") end, @_package_name, sz ) ) else packagebox = progress_box( is_delete ? _("Uninstalling Package") : _("Installing Package"), @_package_name, sz ) UI.OpenDialog(Opt(:decorated), packagebox) @_package_popup = true end nil end |
- (Object) StartProvide(name, archivesize, remote)
at start of file providal
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File '../../src/modules/PackageCallbacks.rb', line 143 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 full_screen Progress.SubprogressType(:progress, 100) Progress.SubprogressTitle( Builtins.sformat(_("Downloading package %1 (%2)..."), name, sz) ) else # popup heading providebox = progress_box(_("Downloading Package"), name, sz) UI.OpenDialog(providebox) @_provide_popup = true end end end nil end |
- (Object) StartRebuildDB
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 |
# File '../../src/modules/PackageCallbacks.rb', line 1873 def StartRebuildDB # heading of popup heading = _("Checking Package Database") # message in a progress popup = _( "Rebuilding 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), "", 100), HSpacing(2)), VSpacing(1) ) ) ) UI.ChangeWidget(Id(:progress), :Value, 0) nil end |
- (Object) StartScanDb
Callback for start RPM DB scan event
2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 |
# File '../../src/modules/PackageCallbacks.rb', line 2012 def StartScanDb Builtins.y2milestone("Scanning RPM DB...") if Mode.commandline # progress message (command line mode) CommandLine.PrintVerbose(_("Reading RPM database...")) else if !full_screen 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)
1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 |
# File '../../src/modules/PackageCallbacks.rb', line 1976 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)
1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 |
# File '../../src/modules/PackageCallbacks.rb', line 1906 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 |