Zren / plasma-applet-commandoutput

https://store.kde.org/p/1166510/
GNU General Public License v2.0
87 stars 18 forks source link

[Request] Reupdate command output on click event (independent of click run command) #13

Closed RaitaroH closed 5 years ago

RaitaroH commented 5 years ago

It will be nice if there would be a toggle for command output, such that if you click on it it will redraw itself. So for ex if it would take 10min for the command output to be rerun, on click it will skip that time. The update should be independent of #2.

Zren commented 5 years ago

Change MouseArea.onClicked from widget.performClick() to timer.triggered(). Add timer.restart() if you also want to countdown to restart.

https://github.com/Zren/plasma-applet-commandoutput/blob/master/package/contents/ui/main.qml#L106

I might add a "refresh" to the right click context menu, but I probably won't add support for manual refreshes beyond that.

RaitaroH commented 5 years ago

I ended up with:

            onClicked: {
                widget.performClick()
                timer.triggered()
                timer.restart()
            }

Works as I wanted it thank you.

Also, on line 93 I thought that adding 0 instead for minimum would make the widget basically take no space if it does not output anything. Seems that is not it.