mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Show queue in sorted order
This commit is contained in:
@@ -2505,6 +2505,7 @@ proc ShowQueue { file } {
|
||||
if {[catch {set obj [::json::json2dict $line]}]} {
|
||||
continue;
|
||||
}
|
||||
set obj [lsort -command sort_q $obj]
|
||||
foreach q $obj {
|
||||
$w.t insert end "$q\n"
|
||||
}
|
||||
@@ -2512,6 +2513,18 @@ proc ShowQueue { file } {
|
||||
$w.t configure -state disabled
|
||||
}
|
||||
|
||||
proc sort_q { a b } {
|
||||
set a_ttime [dict get $a nextttime]
|
||||
set b_ttime [dict get $b nextttime]
|
||||
if {$a_ttime < $b_ttime} {
|
||||
return -1
|
||||
}
|
||||
if {$a_ttime > $b_ttime} {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# DaemonReadable
|
||||
# Arguments:
|
||||
|
||||
Reference in New Issue
Block a user