40
43
############################################################
41
44
### Hide the window until it has been fully displayed
42
45
############################################################
43
47
wm state . withdraw
46
50
############################################################
47
51
### Some global variables
48
52
############################################################
51
55
set weburl "http://amsn.sourceforge.net"
52
56
set program_dir "."
56
61
#=======================================================================
104
110
set HOME "[file join [pwd] amsn_config]"
105
111
set files_dir "[file join [pwd] amsn_received]"
108
115
############################################################
109
116
### And setup where to find optional packages
110
117
############################################################
112
lappend auto_path [file join plugins]
113
119
lappend auto_path [file join ${HOME} plugins]
120
#Specific folder to check for package on platforms
121
if {![catch {tk windowingsystem} wsystem] && $wsystem == "aqua"} {
122
lappend auto_path [file join utils macosx]
123
} elseif {$tcl_platform(platform) == "windows"} {
124
lappend auto_path [file join utils windows]
125
} elseif {$tcl_platform(platform) == "unix"} {
126
lappend auto_path [file join utils linux]
128
lappend auto_path [file join utils]
151
168
source skins.tcl ;# Used for skinning purposes
152
169
source remote.tcl ;# The remote control procedures
153
170
source chatwindow.tcl ;# Abstracted Chat Window code (::ChatWindow namespace)
171
source picture.tcl ; #Tkcximage procs
154
172
source gui.tcl ;#gui.tcl must be at the beginning to make msg_box procedure available for errors
155
source plugins.tcl ;# Plugins system must be loaded before config
158
173
source abook.tcl ;# Handle buddy address book
159
174
source protocol.tcl
175
source plugins.tcl ;# Plugins system must be loaded before config
176
source pluginslog.tcl
177
source config.tcl ;# config needs to be loaded before pluginslog for translations
181
# source ctadverts.tcl
161
182
source preferences.tcl
162
183
source hotmail.tcl
163
184
source groups.tcl ;# Handle buddy groups
164
source anigif.tcl ;# Animated GIFS
165
if {$tcl_platform(platform) == "unix"} {
168
187
if {$tcl_platform(os) == "Darwin"} {
169
source [file join plugins applescript ae.tcl];#AppleEvent support
188
source [file join utils macosx applescript ae.tcl];#AppleEvent support
171
190
source alarm.tcl ;# Alarms code (Burger)
172
191
source dock.tcl ;# Docking routines
173
192
source trayicon.tcl ;# Docking routines for freedesktop system tray compliant docks
174
193
source loging.tcl ;# Euh yeh it's for loging :P
175
194
source combobox.tcl ;# The all mighty combobox is here! (B. Oakley)
176
source blocking.tcl ;# The blocking users feature
178
196
source balloon.tcl ;# For the balloons tooltip
179
source png.tcl ;# PNG Parser and zlib deflate in pure TCL (KaKaRoTo)
197
source autoupdate.tcl ;# AUTOUPDATE!!!!!!!!!! :@
200
source guicontactlist.tcl ;# New contact list (uses canvas)
201
source bugs.tcl ;#bug reporting
184
proc check_imagemagick {} {
186
if {[::config::getKey convertpath] == ""} {
187
::config::setKey convertpath "convert"
207
proc after_info { } {
208
foreach f [after info] {
209
status_log "After $f : [after info $f]\n" red
192
foreach path [list "[config::getKey convertpath]" "convert" "[file join utils convert]" ] {
193
# Check if ImageMagick is Installed, if so don't do nothing, otherwise disable display pics
194
status_log "Checking ImageMagick in $path...\n"
195
if { ![catch { exec $path } res] } {
214
if { $::tcl_version < 8.4 } {
215
proc K {a b} {return $a}
216
proc lset_r {list args val} {
217
if { [llength $args] == "0" } {
220
return [lreplace $list [lindex $args 0] [lindex $args 0] [lset_r [lindex $list [lindex $args 0]] [lrange $args 1 end] $val]]
201
if { $found != -1 } {
202
::config::setKey convertpath "$found"
203
::config::setKey getdisppic 1
206
#-1 means you want them enabled, but imagemagic is not installed...
207
::config::setKey getdisppic -1
223
proc lset {listName args} {
225
set list [lset_r [K $list [set list {}]] [lrange $args 0 end-1] [lindex $args end]]
213
#if {[package vcompare [package provide Tcl] 8.4] < 0} {
214
# proc K {a b} {return $a}
215
# proc lset {listName index val} {
216
# upvar $listName list
217
# set list [lreplace [K $list [set list {}]] $index $index $val]
223
231
set initialize_amsn 0
278
285
degt_protocol_win
279
286
degt_ns_command_win
284
#If you are on any operating system (except Darwin), test if imagemagick is there. For darwin, the verification is in "proc ::ChatWindow::Open()"
285
if {$tcl_platform(os) != "Darwin"} {
286
if { [::config::getKey getdisppic] != 0 } {
294
291
if {$version != [::config::getGlobalKey last_client_version]} {
295
292
::amsn::aboutWindow
296
293
catch {file delete [file join $HOME2 bugreport.amsn]}
294
#Force to change to Lucida Grande 12 on OS X, just one time when we switch version
295
if {![catch {tk windowingsystem} wsystem] && $wsystem == "aqua"} {
296
::config::setGlobalKey basefont [list {Lucida Grande} 12 normal]