cbklib

Check-in [7360c31fb1]
Login

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

Overview
Comment:Updates of various libs
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7360c31fb11e97b78a527fdd1a7d775376706b69
User & Date: admin 2015-10-09 02:06:50
Context
2015-10-13
10:52
Final tweaks of registration, xplat check-in: 7dd496bd2c user: admin tags: trunk
2015-10-09
02:06
Updates of various libs check-in: 7360c31fb1 user: admin tags: trunk
2015-09-20
05:07
Minor updates check-in: a75134832a user: admin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

regproc/pkgIndex.tcl became a regular file.

Changes to regproc/regproc.tcl.

93
94
95
96
97
98
99


100
101

102
103
104
105
106
107
108
109
110
111
112
...
144
145
146
147
148
149
150

151


152

153
154
155
156

157
158
159
160
161
162
163
...
307
308
309
310
311
312
313

314


315
316

317
318
319
320

321
322
323
324
325
326
327
...
363
364
365
366
367
368
369

370
371
372
373
374
375
376
377
378
379
380
381
382
    }

    #dialog before demo has expired
    proc makePitch {} {
	variable version 
	variable appname
	variable appstore



	toplevel .purchase

	wm title .purchase "Purchase $appname"
	wm resizable .purchase 0 0

	regproc::makeModal .purchase

	wm withdraw .purchase
	wm transient .purchase .

	wm protocol .purchase WM_DELETE_WINDOW {}

	ttk::frame .purchase.top -padding 10
................................................................................

    #dialog after demo has expired
    proc expiredPitch {} {
	variable version 
	variable appname
	variable appstore
	variable expired




	toplevel .expired

	wm title .expired "Purchase $appname"
	wm resizable .expired 0 0

	regproc::makeModal .expired


	wm withdraw .expired
	wm transient .expired .

	wm protocol .expired WM_DELETE_WINDOW {}

	ttk::frame .expired.top -padding 10
................................................................................


	variable serial
	variable regwindow
	variable appstore
	variable expired
	variable appname




	toplevel .number
	wm title .number "License"

	wm resizable .number 0 0

	wm withdraw .number
	wm transient .number .


	wm protocol .number WM_DELETE_WINDOW {}

	ttk::frame .number.top -padding 10
	pack .number.top -side top -fill both -expand yes

	
................................................................................
	    exit
	} 

    }

    proc makeModal {w} {


	if {[tk windowingsystem] eq "aqua" } {
	    tk::unsupported::MacWindowStyle style $w  modal
	}
	if {[tk windowingsystem] eq "win32"} {
	    raise $w
	    grab -global $w
	}

    }

    namespace export *
}








>
>


>
|

<
<







 







>

>
>

>
|


<
>







 







>

>
>

|
>




>







 







>

|











93
94
95
96
97
98
99
100
101
102
103
104
105
106


107
108
109
110
111
112
113
...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
168
...
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
...
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
    }

    #dialog before demo has expired
    proc makePitch {} {
	variable version 
	variable appname
	variable appstore
	variable licensetitle
	set licensetitle "Purchase $appname"

	toplevel .purchase
	regproc::makeModal .purchase
	wm title .purchase $licensetitle
	wm resizable .purchase 0 0



	wm withdraw .purchase
	wm transient .purchase .

	wm protocol .purchase WM_DELETE_WINDOW {}

	ttk::frame .purchase.top -padding 10
................................................................................

    #dialog after demo has expired
    proc expiredPitch {} {
	variable version 
	variable appname
	variable appstore
	variable expired
	variable licensetitle

	set licensetitle "Purchase $appname"

	toplevel .expired
	regproc::makeModal .expired
	wm title .expired $licensetitle
	wm resizable .expired 0 0




	wm withdraw .expired
	wm transient .expired .

	wm protocol .expired WM_DELETE_WINDOW {}

	ttk::frame .expired.top -padding 10
................................................................................


	variable serial
	variable regwindow
	variable appstore
	variable expired
	variable appname
	variable licensetitle

	set licensetitle "License" 

	toplevel .number
	wm title .number $licensetitle
	regproc::makeModal .number
	wm resizable .number 0 0

	wm withdraw .number
	wm transient .number .
    

	wm protocol .number WM_DELETE_WINDOW {}

	ttk::frame .number.top -padding 10
	pack .number.top -side top -fill both -expand yes

	
................................................................................
	    exit
	} 

    }

    proc makeModal {w} {

	variable licensetitle
	if {[tk windowingsystem] eq "aqua" } {
	    destroy $w; toplevel $w;  tk::unsupported::MacWindowStyle style $w  modal; wm title $w $licensetitle
	}
	if {[tk windowingsystem] eq "win32"} {
	    raise $w
	    grab -global $w
	}

    }

    namespace export *
}

softwareupdate/pkgIndex.tcl became a regular file.

Changes to softwareupdate/softwareupdate.tcl.

15
16
17
18
19
20
21

22
23
24
25
26
27
28
..
45
46
47
48
49
50
51

52
53
54
55
56
57
58
...
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140








































































141
142
143
144
145
146
147
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
...
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396



























397
398
399
400
401
402
    }


    variable icon
    variable appname
    variable tmpdir
    variable currentinstall

    
    switch [tk windowingsystem] {
	"aqua" {
	    set tmpdir $::env(TMPDIR)

	}
	
................................................................................
    proc setAppName {name} {

	variable appname
	set appname $name
	return $appname

    }

    

    #check version of installed software
    proc checkVersion {app version} {
	variable appversion
	variable appname
	variable currentversion
................................................................................
	"aqua" {
	    set approot [info nameofexecutable]
	    set apppath [split $approot /]
	    set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ]
	}
	
	"win32" {
	    set currentinstall [file join $::env(APPDATA)  CodebyKevin $appname]
	    
	}
	
	"x11" {
	    return
	}
    }
    
    return $currentinstall

}









































































#prompt user to update
proc updatePitch {} {
    variable appname
    variable icon
    variable changedata
    variable currentversion
................................................................................
    wm transient .updateprogress .

}

#dialog if current version is installed
proc upToDate {} {
    variable appname
    variable versionnumber

    catch {destroy .updateprogress}

    tk_messageBox  -icon info -message "You're up to date!" -detail "$appname $versionnumber is the currently the newest version available."

}

#show progress of installation
proc progressDialog {} {

    variable appname
................................................................................
		exec $currentinstall/Contents/MacOS/$appname &

		exit
	    }
	}
	
	"win32" {
	    
	    file rename -force $currentinstall/[list $appname].exe $tmpdir/[list $appname].exe~
	    file copy $tmpdir/[list $appname].exe $currentinstall/[list $appname.exe]
	    exec $currentinstall/[list $appname].exe &
	    exit
	}
	
	"x11" {
	    tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
	    return
	}
    }

    catch {destroy .downloadprogress}

    




























}

namespace export *

}







>







 







>







 







|
<










>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|



|







 







|
|
|
<
<











>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
...
124
125
126
127
128
129
130
131

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
...
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
...
447
448
449
450
451
452
453
454
455
456


457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
    }


    variable icon
    variable appname
    variable tmpdir
    variable currentinstall
    variable versionnumber
    
    switch [tk windowingsystem] {
	"aqua" {
	    set tmpdir $::env(TMPDIR)

	}
	
................................................................................
    proc setAppName {name} {

	variable appname
	set appname $name
	return $appname

    }

    

    #check version of installed software
    proc checkVersion {app version} {
	variable appversion
	variable appname
	variable currentversion
................................................................................
	"aqua" {
	    set approot [info nameofexecutable]
	    set apppath [split $approot /]
	    set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ]
	}
	
	"win32" {
	    set currentinstall [file join $::env(APPDATA) ${appname}_App]  

	}
	
	"x11" {
	    return
	}
    }
    
    return $currentinstall

}

#prompt user to update: for Perl, which chokes on XML parsing from Tcl
proc updatePitchPerl {apptitle appnumber currentapp changelog} {
    variable appname
    variable icon
    variable changedata
    variable currentversion
    variable versionnumber
    variable changelist

    catch {destroy .updateprogress}

    catch {destroy .update}


    toplevel .update
    wm title .update "Software Update"

    wm withdraw .update

    frame .update.f -bg gray95
    pack .update.f -fill both -expand yes

    frame .update.f.top -bg gray95
    pack .update.f.top -fill both -expand yes

    label .update.f.top.i -image $icon -bg gray95 -relief flat -highlightthickness 0
    pack .update.f.top.i -side left -fill both -expand yes

    frame .update.f.top.r -bg gray95
    pack .update.f.top.r -side right -fill both -expand yes

    label .update.f.top.r.title -text "A new version of $apptitle is available!" -font {-weight bold} -bg gray95 -relief flat -highlightthickness 0
    pack .update.f.top.r.title -fill both -expand yes -side top

    label .update.f.top.r.msg -text "$apptitle $appnumber is available--you have $currentapp. Would you like to download it now?" -bg gray95 -relief flat -highlightthickness 0
    pack .update.f.top.r.msg -fill both -expand yes -side top

    label .update.f.top.r.release -text "Release Notes:" -font {-weight bold} -relief flat -highlightthickness 0 -bg gray95 
    pack .update.f.top.r.release -side top -fill both -expand yes

    text .update.f.top.r.text -font TkDefaultFont
    pack .update.f.top.r.text -side top -fill both -expand yes

    ttk::frame .update.f.top.r.bottom -padding 5
    pack .update.f.top.r.bottom -side bottom -fill both -expand yes

    ttk::button .update.f.top.r.bottom.skip -text "Skip This Version" -command {destroy .update}

    ttk::button .update.f.top.r.bottom.install -text "Install Update" -default active -command softwareupdate::installUpdate
    
    pack .update.f.top.r.bottom.install .update.f.top.r.bottom.skip  -side right  -fill both -expand yes

    set changetext [split $changelog *]

    set changetext [lrange $changetext 1 end]

    foreach item $changetext {
	
	.update.f.top.r.text insert end "* $item\n"

    }

    .update.f.top.r.text configure -state disabled

    wm resizable .update 0 0
    wm deiconify .update
    raise .update
    wm transient .update .

}


#prompt user to update
proc updatePitch {} {
    variable appname
    variable icon
    variable changedata
    variable currentversion
................................................................................
    wm transient .updateprogress .

}

#dialog if current version is installed
proc upToDate {} {
    variable appname
    variable currentversion

    catch {destroy .updateprogress}

    tk_messageBox  -icon info -title "Up to Date" -message "You're up to date!" -detail "$appname $currentversion is the currently the newest version available."

}

#show progress of installation
proc progressDialog {} {

    variable appname
................................................................................
		exec $currentinstall/Contents/MacOS/$appname &

		exit
	    }
	}
	
	"win32" {
	  
	  softwareupdate::writeBatch $appname
	  eval exec [auto_execok start]  /b "" cmd /c [file join $tmpdir deleteapp.bat] &


	}
	
	"x11" {
	    tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
	    return
	}
    }

    catch {destroy .downloadprogress}

    

}


proc writeBatch {appname} {

variable tmpdir
variable currentinstall

set script {
cd  $currentinstall 
taskkill /IM $appname.exe /F
rename $appname.exe ${appname}-tmp.exe 
cd $tmpdir
copy [file nativename [file join $tmpdir $appname.exe]] [file nativename [file join $currentinstall $appname.exe]]
cd $currentinstall
start $appname.exe
del ${appname}-tmp.exe
cd $tmpdir
::del deleteapp.bat
}

set batchscript [subst $script]
set delscript [open [file join $tmpdir deleteapp.bat] w]
puts $delscript $batchscript
close $delscript


}

namespace export *

}

xplat/pkgIndex.tcl became a regular file.

Changes to xplat/xplat.tcl.

59
60
61
62
63
64
65


66
67
68

69
70
71
72
73
74
75
76
77
78




79
80
81
82
83
84
85
		return "Command"
	    }   
	}
    }

    #system location for storing app data
    proc appconfig {appname} {


	switch [tk windowingsystem] {

	    "x11" {

		return [file join $::env(HOME) "." [string tolower  "$appname"]]
	    }
	    "win32" {
		return [file join $::env(APPDATA) "$appname"]
	    }
	    
	    "aqua" {
		return [file join $::env(HOME) "Library" "Application Support" "$appname" "Preferences"]
	    }   
	}




    }

    #manipulate appeareance of app icon
    proc seticon {win imgpath} {
	switch [tk windowingsystem] {

	    "x11" {







>
>



>
|


|



|
|

>
>
>
>







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
		return "Command"
	    }   
	}
    }

    #system location for storing app data
    proc appconfig {appname} {

	set appdir ""
	switch [tk windowingsystem] {

	    "x11" {
		
		set appdir [file join $::env(HOME) "." [string tolower  "$appname"]]
	    }
	    "win32" {
		set appdir [file join $::env(APPDATA) "$appname"]
	    }
	    
	    "aqua" {
		set appdir [file join $::env(HOME) "Library" "Application Support" "$appname" "Preferences"]
	    }
	}
	if {![file exist $appdir]} {
	    file mkdir $appdir
	}
	return $appdir
    }

    #manipulate appeareance of app icon
    proc seticon {win imgpath} {
	switch [tk windowingsystem] {

	    "x11" {