More progress bar text

Answered

I'm contributing to the open source PyCharm MicroPython plugin. I'm currently working on creating more detailed progress reporting.

This part of the plugin is under a “runWithModalProgressBlocking” call, I want to use “reportProgress” for displaying more detailed information about what the plugin is doing, since uploads usually take a while.

Currently using the "reporter.sizedStep" I'm able to change the text above the blue progress indicator. In older posts related to this I saw that there were methods like “setText” or "setText2", but apparently this is obsolete now:

https://plugins.jetbrains.com/docs/intellij/background-processes.html

Is there still anyway to make the runWithModalProgressBlocking window display more than just the top centered title text, the progress bar indicator and the text above this indicator? What I'd like to achieve is putting some text under the progress indicator as well. For example values like x files of y uploaded, or x KB of y KB uploaded. Is it possible?


This is the snippet of source code I'm working on:

reportProgress(100) { reporter ->
    reporter.sizedStep(0, scriptProgressText) {
        val alreadyUploadedFiles = fileSystemWidget.synchronizeAndGetAlreadyUploadedFiles(fileToTargetPath, ignoredFiles, shouldSynchronize)

        fileToTargetPath.keys.removeAll(alreadyUploadedFiles.toSet())
    }
    
    val singleFileProgress = 100 / fileToTargetPath.keys.size

    fileToTargetPath.forEach { (file, path) ->
        reporter.sizedStep(singleFileProgress, path) {
            fileSystemWidget.upload(path, file.contentsToByteArray())
        }
    }
}
0
1 comment

Hi,

As far as I see, you should use:

reportRawProgress { reporter ->
  ...
  reporter.details("text")
  ...
}
1

Please sign in to leave a comment.