Check for new version — pop-up message, time intervals

What new features you would like to see in next QM version?

Check for new version — pop-up message, time intervals

Postby T U on Sat May 24, 2014 5:13 pm

Hi. I think it would be useful to have these options.

One reason for me is that the output pane almost always has text in it, so I don't notice. Also, QM often runs for days, so - as far as I can tell - it won't check for updates since it's not restarted.
Posts: 23
Joined: Mon Sep 09, 2013 2:40 am

Re: Check for new version — pop-up message, time intervals

Postby Gintaras on Fri May 30, 2014 5:05 am

For it QM runs function from System folder - TO_CheckForNewQmVersion. You can copy it and change the clone to do whatever. Example:

Function MY_CheckForNewQmVersion     ?

;Checks for new QM version.
;If there is new version, displays version info in QM output and adds tray icon (i).
;To run this at startup, assign trigger: QM events -> QM started.

;you can change these values
int firstCheckAfterSeconds=30
int periodHours=24
int flags=0 ;;flag 1 - debug (always behave like a new version is available; ignore firstCheckAfterSeconds; allow multiple threads)


if flags&1=0
,if(getopt(nthreads)>1) ret
,wait firstCheckAfterSeconds

,str s
,IntGetFile _s.format("" iif(flags&1 0 QMVER)) s iif(flags&1 0 2)
,err wait 60*60; continue
,if(s.len) break
,wait periodHours*60*60

IXml xml=CreateXml
IXmlNode r=xml.RootElement

str s1 s2 s3; int nv=r.AttributeValueInt("v")
s1.format("%i.%i.%i.%i" QMVER>>24 QMVER>>16&255 QMVER>>8&255 QMVER&255)
s2.format("%i.%i.%i.%i" nv>>24 nv>>16&255 nv>>8&255 nv&255)

s3.format("<><link ''''>New Quick Macros version available</link>. Your version: %s. New version: %s. Beta: %s." s1 s2 r.AttributeValue("b"))
s1=r.Value; s1.trim; if(s1.len) s3.addline(s1 1)
out s3

Tray t.AddIcon("$qm$\info.ico" "New Quick Macros version available" 0 &CFNQV_Callback)
wait -1

Function CFNQV_Callback     ?
function Tray&x message

sel message
,sel ShowMenu("1 Show QM[]2 Go to download[]-[]10 Exit")
,,case 1 shutdown -4
,,case 2 run ""
,,case 10 shutdown -7

Site Admin
Posts: 10412
Joined: Thu Dec 19, 2002 7:36 pm
Location: Lithuania

Return to Wish List

Who is online

Users browsing this forum: No registered users and 1 guest