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 Side-by-Side Diffs Ignore Whitespace Patch

regproc/pkgIndex.tcl became a regular file.


Changes to regproc/regproc.tcl.

    93     93       }
    94     94   
    95     95       #dialog before demo has expired
    96     96       proc makePitch {} {
    97     97   	variable version 
    98     98   	variable appname
    99     99   	variable appstore
          100  +	variable licensetitle
          101  +	set licensetitle "Purchase $appname"
   100    102   
   101    103   	toplevel .purchase
   102         -	wm title .purchase "Purchase $appname"
   103         -	wm resizable .purchase 0 0
   104         -
   105    104   	regproc::makeModal .purchase
          105  +	wm title .purchase $licensetitle
          106  +	wm resizable .purchase 0 0
   106    107   
   107    108   	wm withdraw .purchase
   108    109   	wm transient .purchase .
   109    110   
   110    111   	wm protocol .purchase WM_DELETE_WINDOW {}
   111    112   
   112    113   	ttk::frame .purchase.top -padding 10
................................................................................
   144    145   
   145    146       #dialog after demo has expired
   146    147       proc expiredPitch {} {
   147    148   	variable version 
   148    149   	variable appname
   149    150   	variable appstore
   150    151   	variable expired
          152  +	variable licensetitle
          153  +
          154  +	set licensetitle "Purchase $appname"
   151    155   
   152    156   	toplevel .expired
   153         -	wm title .expired "Purchase $appname"
          157  +	regproc::makeModal .expired
          158  +	wm title .expired $licensetitle
   154    159   	wm resizable .expired 0 0
   155    160   
   156         -	regproc::makeModal .expired
          161  +
   157    162   
   158    163   	wm withdraw .expired
   159    164   	wm transient .expired .
   160    165   
   161    166   	wm protocol .expired WM_DELETE_WINDOW {}
   162    167   
   163    168   	ttk::frame .expired.top -padding 10
................................................................................
   307    312   
   308    313   
   309    314   	variable serial
   310    315   	variable regwindow
   311    316   	variable appstore
   312    317   	variable expired
   313    318   	variable appname
          319  +	variable licensetitle
          320  +
          321  +	set licensetitle "License" 
   314    322   
   315    323   	toplevel .number
   316         -	wm title .number "License"
          324  +	wm title .number $licensetitle
          325  +	regproc::makeModal .number
   317    326   	wm resizable .number 0 0
   318    327   
   319    328   	wm withdraw .number
   320    329   	wm transient .number .
          330  +    
   321    331   
   322    332   	wm protocol .number WM_DELETE_WINDOW {}
   323    333   
   324    334   	ttk::frame .number.top -padding 10
   325    335   	pack .number.top -side top -fill both -expand yes
   326    336   
   327    337   	
................................................................................
   363    373   	    exit
   364    374   	} 
   365    375   
   366    376       }
   367    377   
   368    378       proc makeModal {w} {
   369    379   
          380  +	variable licensetitle
   370    381   	if {[tk windowingsystem] eq "aqua" } {
   371         -	    tk::unsupported::MacWindowStyle style $w  modal
          382  +	    destroy $w; toplevel $w;  tk::unsupported::MacWindowStyle style $w  modal; wm title $w $licensetitle
   372    383   	}
   373    384   	if {[tk windowingsystem] eq "win32"} {
   374    385   	    raise $w
   375    386   	    grab -global $w
   376    387   	}
   377    388   
   378    389       }
   379    390   
   380    391       namespace export *
   381    392   }
   382    393   

softwareupdate/pkgIndex.tcl became a regular file.


Changes to softwareupdate/softwareupdate.tcl.

    15     15       }
    16     16   
    17     17   
    18     18       variable icon
    19     19       variable appname
    20     20       variable tmpdir
    21     21       variable currentinstall
           22  +    variable versionnumber
    22     23       
    23     24       switch [tk windowingsystem] {
    24     25   	"aqua" {
    25     26   	    set tmpdir $::env(TMPDIR)
    26     27   
    27     28   	}
    28     29   	
................................................................................
    45     46       proc setAppName {name} {
    46     47   
    47     48   	variable appname
    48     49   	set appname $name
    49     50   	return $appname
    50     51   
    51     52       }
           53  +
    52     54       
    53     55   
    54     56       #check version of installed software
    55     57       proc checkVersion {app version} {
    56     58   	variable appversion
    57     59   	variable appname
    58     60   	variable currentversion
................................................................................
   122    124   	"aqua" {
   123    125   	    set approot [info nameofexecutable]
   124    126   	    set apppath [split $approot /]
   125    127   	    set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ]
   126    128   	}
   127    129   	
   128    130   	"win32" {
   129         -	    set currentinstall [file join $::env(APPDATA)  CodebyKevin $appname]
   130         -	    
          131  +	    set currentinstall [file join $::env(APPDATA) ${appname}_App]  
   131    132   	}
   132    133   	
   133    134   	"x11" {
   134    135   	    return
   135    136   	}
   136    137       }
   137    138       
   138    139       return $currentinstall
   139    140   
   140    141   }
          142  +
          143  +#prompt user to update: for Perl, which chokes on XML parsing from Tcl
          144  +proc updatePitchPerl {apptitle appnumber currentapp changelog} {
          145  +    variable appname
          146  +    variable icon
          147  +    variable changedata
          148  +    variable currentversion
          149  +    variable versionnumber
          150  +    variable changelist
          151  +
          152  +    catch {destroy .updateprogress}
          153  +
          154  +    catch {destroy .update}
          155  +
          156  +
          157  +    toplevel .update
          158  +    wm title .update "Software Update"
          159  +
          160  +    wm withdraw .update
          161  +
          162  +    frame .update.f -bg gray95
          163  +    pack .update.f -fill both -expand yes
          164  +
          165  +    frame .update.f.top -bg gray95
          166  +    pack .update.f.top -fill both -expand yes
          167  +
          168  +    label .update.f.top.i -image $icon -bg gray95 -relief flat -highlightthickness 0
          169  +    pack .update.f.top.i -side left -fill both -expand yes
          170  +
          171  +    frame .update.f.top.r -bg gray95
          172  +    pack .update.f.top.r -side right -fill both -expand yes
          173  +
          174  +    label .update.f.top.r.title -text "A new version of $apptitle is available!" -font {-weight bold} -bg gray95 -relief flat -highlightthickness 0
          175  +    pack .update.f.top.r.title -fill both -expand yes -side top
          176  +
          177  +    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
          178  +    pack .update.f.top.r.msg -fill both -expand yes -side top
          179  +
          180  +    label .update.f.top.r.release -text "Release Notes:" -font {-weight bold} -relief flat -highlightthickness 0 -bg gray95 
          181  +    pack .update.f.top.r.release -side top -fill both -expand yes
          182  +
          183  +    text .update.f.top.r.text -font TkDefaultFont
          184  +    pack .update.f.top.r.text -side top -fill both -expand yes
          185  +
          186  +    ttk::frame .update.f.top.r.bottom -padding 5
          187  +    pack .update.f.top.r.bottom -side bottom -fill both -expand yes
          188  +
          189  +    ttk::button .update.f.top.r.bottom.skip -text "Skip This Version" -command {destroy .update}
          190  +
          191  +    ttk::button .update.f.top.r.bottom.install -text "Install Update" -default active -command softwareupdate::installUpdate
          192  +    
          193  +    pack .update.f.top.r.bottom.install .update.f.top.r.bottom.skip  -side right  -fill both -expand yes
          194  +
          195  +    set changetext [split $changelog *]
          196  +
          197  +    set changetext [lrange $changetext 1 end]
          198  +
          199  +    foreach item $changetext {
          200  +	
          201  +	.update.f.top.r.text insert end "* $item\n"
          202  +
          203  +    }
          204  +
          205  +    .update.f.top.r.text configure -state disabled
          206  +
          207  +    wm resizable .update 0 0
          208  +    wm deiconify .update
          209  +    raise .update
          210  +    wm transient .update .
          211  +
          212  +}
          213  +
   141    214   
   142    215   #prompt user to update
   143    216   proc updatePitch {} {
   144    217       variable appname
   145    218       variable icon
   146    219       variable changedata
   147    220       variable currentversion
................................................................................
   250    323       wm transient .updateprogress .
   251    324   
   252    325   }
   253    326   
   254    327   #dialog if current version is installed
   255    328   proc upToDate {} {
   256    329       variable appname
   257         -    variable versionnumber
          330  +    variable currentversion
   258    331   
   259    332       catch {destroy .updateprogress}
   260    333   
   261         -    tk_messageBox  -icon info -message "You're up to date!" -detail "$appname $versionnumber is the currently the newest version available."
          334  +    tk_messageBox  -icon info -title "Up to Date" -message "You're up to date!" -detail "$appname $currentversion is the currently the newest version available."
   262    335   
   263    336   }
   264    337   
   265    338   #show progress of installation
   266    339   proc progressDialog {} {
   267    340   
   268    341       variable appname
................................................................................
   374    447   		exec $currentinstall/Contents/MacOS/$appname &
   375    448   
   376    449   		exit
   377    450   	    }
   378    451   	}
   379    452   	
   380    453   	"win32" {
   381         -	    
   382         -	    file rename -force $currentinstall/[list $appname].exe $tmpdir/[list $appname].exe~
   383         -	    file copy $tmpdir/[list $appname].exe $currentinstall/[list $appname.exe]
   384         -	    exec $currentinstall/[list $appname].exe &
   385         -	    exit
          454  +	  
          455  +	  softwareupdate::writeBatch $appname
          456  +	  eval exec [auto_execok start]  /b "" cmd /c [file join $tmpdir deleteapp.bat] &
   386    457   	}
   387    458   	
   388    459   	"x11" {
   389    460   	    tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version."
   390    461   	    return
   391    462   	}
   392    463       }
   393    464   
   394    465       catch {destroy .downloadprogress}
   395    466   
   396    467       
          468  +
          469  +}
          470  +
          471  +
          472  +proc writeBatch {appname} {
          473  +
          474  +variable tmpdir
          475  +variable currentinstall
          476  +
          477  +set script {
          478  +cd  $currentinstall 
          479  +taskkill /IM $appname.exe /F
          480  +rename $appname.exe ${appname}-tmp.exe 
          481  +cd $tmpdir
          482  +copy [file nativename [file join $tmpdir $appname.exe]] [file nativename [file join $currentinstall $appname.exe]]
          483  +cd $currentinstall
          484  +start $appname.exe
          485  +del ${appname}-tmp.exe
          486  +cd $tmpdir
          487  +::del deleteapp.bat
          488  +}
          489  +
          490  +set batchscript [subst $script]
          491  +set delscript [open [file join $tmpdir deleteapp.bat] w]
          492  +puts $delscript $batchscript
          493  +close $delscript
          494  +
   397    495   
   398    496   }
   399    497   
   400    498   namespace export *
   401    499   
   402    500   }

xplat/pkgIndex.tcl became a regular file.


Changes to xplat/xplat.tcl.

    59     59   		return "Command"
    60     60   	    }   
    61     61   	}
    62     62       }
    63     63   
    64     64       #system location for storing app data
    65     65       proc appconfig {appname} {
           66  +
           67  +	set appdir ""
    66     68   	switch [tk windowingsystem] {
    67     69   
    68     70   	    "x11" {
    69         -		return [file join $::env(HOME) "." [string tolower  "$appname"]]
           71  +		
           72  +		set appdir [file join $::env(HOME) "." [string tolower  "$appname"]]
    70     73   	    }
    71     74   	    "win32" {
    72         -		return [file join $::env(APPDATA) "$appname"]
           75  +		set appdir [file join $::env(APPDATA) "$appname"]
    73     76   	    }
    74     77   	    
    75     78   	    "aqua" {
    76         -		return [file join $::env(HOME) "Library" "Application Support" "$appname" "Preferences"]
    77         -	    }   
           79  +		set appdir [file join $::env(HOME) "Library" "Application Support" "$appname" "Preferences"]
           80  +	    }
           81  +	}
           82  +	if {![file exist $appdir]} {
           83  +	    file mkdir $appdir
    78     84   	}
           85  +	return $appdir
    79     86       }
    80     87   
    81     88       #manipulate appeareance of app icon
    82     89       proc seticon {win imgpath} {
    83     90   	switch [tk windowingsystem] {
    84     91   
    85     92   	    "x11" {