Skip to content

Commit

Permalink
fix: adjust progress points in the startup splash screen
Browse files Browse the repository at this point in the history
MainFrame initialization takes noticeable time
  • Loading branch information
vlsi committed May 25, 2023
1 parent d74c5aa commit 088fede
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/core/src/main/java/org/apache/jmeter/JMeterGuiLauncher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,34 @@ public object JMeterGuiLauncher {
private suspend fun startGuiInternal(testFile: String?) {
setupLaF()
val splash = SplashScreen()
splash.showScreen()
yield()
suspend fun setProgress(progress: Int) {
splash.setProgress(progress)
// Allow UI updates
yield()
}
splash.showScreen()
setProgress(10)
setProgress(1)
JMeterUtils.applyHiDPIOnFonts()
setProgress(20)
log.debug("Configure PluginManager")
setProgress(30)
log.debug("Setup tree")
setProgress(5)
val treeModel = JMeterTreeModel()
val treeLis = JMeterTreeListener(treeModel)
val instance = ActionRouter.getInstance()
setProgress(40)
setProgress(10)
withContext(Dispatchers.Default) {
log.debug("populate command map")
instance.populateCommandMap()
}
setProgress(60)
setProgress(20)
treeLis.setActionHandler(instance)
log.debug("init instance")
setProgress(70)
GuiPackage.initInstance(treeLis, treeModel)
setProgress(80)
log.debug("constructing main frame")
val main = MainFrame(treeModel, treeLis)
setProgress(90)
setProgress(56)
ComponentUtil.centerComponentInWindow(main, 80)
setProgress(82)
main.setLocationRelativeTo(splash)
main.isVisible = true
main.toFront()
Expand All @@ -127,7 +125,7 @@ public object JMeterGuiLauncher {
jTree.selectionPath = path
FocusRequester.requestFocus(jTree)
}
setProgress(100)
setProgress(93)
splash.close()
}

Expand Down

0 comments on commit 088fede

Please sign in to comment.