Skip to content

Commit

Permalink
Changed download handler to display custom message without red error …
Browse files Browse the repository at this point in the history
…text
  • Loading branch information
smilefx committed Nov 27, 2024
1 parent 63a36bf commit 6af1f34
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.cef.browser.CefBrowser
import org.cef.browser.CefFrame
import org.cef.browser.CefMessageRouter
import org.cef.browser.CefMessageRouter.CefMessageRouterConfig
import org.cef.callback.CefCommandLine
import org.cef.callback.CefContextMenuParams
import org.cef.callback.CefMenuModel
import org.cef.callback.CefQueryCallback
Expand Down Expand Up @@ -262,20 +263,16 @@ class MainFrame(
exitProcess(0)
}
}

override fun onBeforeTerminate(): Boolean {
println("Actually called")
return true
}
})

builder.setProgressHandler { enumProgress, fl ->
if(enumProgress == EnumProgress.DOWNLOADING || enumProgress == EnumProgress.EXTRACTING)
println("[BGW] Downloading CEF...")
if(enumProgress == EnumProgress.DOWNLOADING || enumProgress == EnumProgress.EXTRACTING) {
if (fl >= 0) print("[BGW] Downloading BGW Runtime... $fl%\r")
}
else if(enumProgress == EnumProgress.LOCATING || enumProgress == EnumProgress.INSTALL)
println("[BGW] Initializing CEF...")
else
println("[BGW] Starting CEF...")
println("[BGW] Initializing BGW Runtime...")
else if(enumProgress == EnumProgress.INITIALIZING)
println("[BGW] Starting BGW Runtime...")
}

val cefApp = builder.build()
Expand Down

0 comments on commit 6af1f34

Please sign in to comment.