Powershell GUI fronted (WPF) to run categorized console scripts

⌈⌋ branch:  ClickyColoury


Check-in [e076d85d3d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1:e076d85d3d8ced1f4ad53afa26dfab95ebe62d1d
Date: 2018-05-16 18:08:49
User: mario
Comment:Swirly arrow indicator for Window title - when scripts are running.
Tags And Properties
  • branch=trunk inherited from [7e2f1fd24a]
  • sym-trunk inherited from [7e2f1fd24a]
Context
2018-05-16
18:09
[e419d52757] Cancel button = currently just hangs both runspaces. (user: mario, tags: trunk)
18:08
[e076d85d3d] Swirly arrow indicator for Window title - when scripts are running. (user: mario, tags: trunk)
18:07
[85c87f27b5] New plugin manager to install contrib/ scripts. (user: mario, tags: trunk)
Changes

Added contrib/ActivityIndicator3000.ps1.







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# encoding: utf-8
# api: clicky
# type: init-gui
# version: 0.2
# title: ActivityIndicator3000
# description: adapts title while scripts are running
# category: ui
# state: buggy
# hidden: 1
# nomenu: 1
#
# Starts timer in Start-Win (init-gui hook). This keeps it running
# continuosly. But task only really comes into action when $GUI.tasks[]
# queue contains a script.
# Then rewrites the window title with swirly arrows while active.
#

$GUI.act = @{
    timer = [System.Windows.Threading.DispatcherTimer]::new("Background")
    step = -1
    arrows = "⇘⇩⇙⇐⇖⇑⇗⇒"
}
$GUI.act.timer.Interval = 2500
$GUI.act.timer.Add_Tick({
    if ($GUI.tasks -and ($_title = $GUI.tasks[0].title)) {
        $GUI.act.step = ($GUI.act.step + 1) % $GUI.act.arrows.length;
        $GUI.w.title = $GUI.act.arrows[$GUI.act.step] + " $($cfg.main.title) → $_title"
    }
    elseif ($GUI.act.step -ge 0) {
        $GUI.w.title = "➱ $($cfg.main.title)"
        $GUI.act.step = -1
    }
})
$GUI.act.timer.Start()