2
###AppMain.tcl is an exact copy of the file aMSN
3
###This is necessary on Mac OS X to have the excute file named "Appmain.tcl" with TCl-TK
4
###Added by Germinator2000 (Jerome Gagnon-Voyer) ask on Mailing list amsn-dev for others questions
5
################################################################
7
### Alvaro's Messenger - amsn ###############
9
### http://amsn.sourceforge.net ###############
10
### amsn-users@lists.sourceforge.net ###############
12
################################################################
13
### airadier at users.sourceforge.net (airadier) ###############
14
### Universidad de Zaragoza ###############
15
### http://aim.homelinux.com ###############
16
################################################################
17
### grimaldo@panama.iaehv.nl (LordOfScripts) ###############
18
### http://www.coralys.com/linux/ ###############
19
################################################################
20
### Original ccmsn ###############
21
### http://msn.CompuCreations.com/ ###############
22
### Dave Mifsud <dave at CompuCreations dot com> ###############
23
################################################################
26
### This program is free software; you can redistribute it and/or modify
27
### it under the terms of the GNU General Public License as published by
28
### the Free Software Foundation; version 2 of the License
30
### This program is distributed in the hope that it will be useful,
31
### but WITHOUT ANY WARRANTY; without even the implied warranty of
32
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33
### GNU General Public License for more details.
35
### You should have received a copy of the GNU General Public License
36
### along with this program; if not, write to the Free Software
37
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
42
############################################################
43
### Some global variables
44
############################################################
45
set version "0.90beta"
47
set weburl "http://amsn.sourceforge.net"
52
#=======================================================================
55
############################################################
56
### Look if we are launched from a link
57
### and set the correct working dir
58
############################################################
60
#Fixed by Tomasz Nguyen
4
#Set variable program_dir
61
5
set program_dir [file dirname [info script]]
62
6
set program [file tail [info script]]
77
############################################################
78
### Setup other important directory paths
79
### depending on the platform
80
############################################################
82
if {$tcl_platform(platform) == "unix"} {
83
set HOME "[file join $env(HOME) .amsn]"
84
set files_dir "[file join $env(HOME) amsn_received]"
85
} elseif {$tcl_platform(platform) == "windows"} {
86
if {[info exists env(USERPROFILE)]} {
87
set HOME "[file join $env(USERPROFILE) amsn]"
88
set files_dir "[file join $env(USERPROFILE) amsn_received]"
90
set HOME "[file join [pwd] amsn_config]"
91
set files_dir "[file join [pwd] amsn_received]"
94
set HOME "[file join [pwd] amsn_config]"
95
set files_dir "[file join [pwd] amsn_received]"
98
############################################################
99
### And setup where to find optional packages
100
############################################################
102
lappend auto_path "[file join $program_dir plugins]"
103
lappend auto_path "[file join ${HOME} plugins]"
108
catch { source [file join $HOME tlsconfig.tcl] }
110
if { $libtls != "" && [lsearch $auto_path $libtls] == -1 } {
111
lappend auto_path $libtls
114
#TODO: Move this from here ??
115
#///////////////////////////////////////////////////////////////////////
116
#Notebook Pages (Buddies,News,Calendar,etc.)
119
#///////////////////////////////////////////////////////////////////////
122
############################################################
123
#### Load program modules
124
############################################################
125
set initialize_amsn 1
129
proc reload_files { } {
130
foreach glob "[info globals] xmms" {
134
source [file join $program_dir ctthemes.tcl]
135
source [file join $program_dir notebook.tcl] ;# Notebook Megawidget
136
#source [file join $program_dir notebook1.tcl] ;# Notebook Megawidget
137
source [file join $program_dir rnotebook.tcl] ;# Notebook Megawidget
138
source [file join $program_dir progressbar.tcl] ;# Progressbar Megawidget
139
source [file join $program_dir dkffont.tcl] ;# Font selection megawidget
140
source [file join $program_dir migmd5.tcl]
141
source [file join $program_dir des.tcl] ;# DES encryption
142
source [file join $program_dir sxml.tcl] ;# Simple XML parser
143
source [file join $program_dir lang.tcl]
144
source [file join $program_dir automsg.tcl]
145
source [file join $program_dir smileys.tcl]
146
source [file join $program_dir skins.tcl] ;# Used for skinning purposes
147
source [file join $program_dir config.tcl]
148
source [file join $program_dir proxy.tcl]
149
source [file join $program_dir protocol.tcl]
150
source [file join $program_dir ctadverts.tcl]
151
source [file join $program_dir ctdegt.tcl]
152
source [file join $program_dir hotmail.tcl]
153
source [file join $program_dir groups.tcl] ;# Handle buddy groups
154
source [file join $program_dir abook.tcl] ;# Handle buddy address book
155
source [file join $program_dir anigif.tcl] ;# Animated GIFS
156
if {$tcl_platform(platform) == "unix"} {
157
source [file join $program_dir xmms.tcl]
159
source [file join $program_dir gui.tcl]
160
source [file join $program_dir alarm.tcl] ;# Alarms code (Burger)
161
source [file join $program_dir dock.tcl] ;# Docking routines
162
source [file join $program_dir trayicon.tcl] ;# Docking routines for freedesktop system tray compliant docks
163
source [file join $program_dir loging.tcl] ;# Euh yeh it's for loging :P
164
source [file join $program_dir combobox.tcl] ;# The all mighty combobox is here! (B. Oakley)
165
source [file join $program_dir blocking.tcl] ;# The blocking users feature
166
source [file join $program_dir remote.tcl ] ;# The remote control procedures
167
source [file join $program_dir plugins.tcl] ;# Plugins system
168
source [file join $program_dir balloon.tcl] ;# For the balloons tooltip
169
source [file join $program_dir png.tcl] ;# PNG Parser and zlib deflate in pure TCL (KaKaRoTo)
174
proc check_imagemagick {} {
177
# Check if ImageMagick is Installed, if so dont do nothing, otherwise disable display pics
178
status_log "Checking ImageMagick...\n"
179
if { [catch { exec convert } res] } {
180
if {$config(getdisppic) == 1 } {
181
msg_box "[trans installconvert]"
182
status_log "ImageMagick not installed got error $res\n Disabling display pictures\n"
184
#-1 means you want them enabled, but imagemagic is not installed...
185
set config(getdisppic) -1
187
set config(getdisppic) 1
191
proc check_imagemagick2 {} {
194
# Check if ImageMagick is Installed, if so dont do nothing, otherwise disable display pics
195
status_log "Checking ImageMagick...\n"
196
if { [catch { exec /usr/local/bin/convert } res] } {
197
if {$config(getdisppic) == 1 } {
198
msg_box "[trans installconvert]"
199
status_log "ImageMagick not installed got error $res\n Disabling display pictures\n"
201
#-1 means you want them enabled, but imagemagic is not installed...
202
set config(getdisppic) -1
204
set config(getdisppic) 1
210
set initialize_amsn 0
211
#///////////////////////////////////////////////////////////////////////
213
if { [catch {package require tls}] } {
214
# Either tls is not installed, or $auto_path does not point to it.
215
# Should now never happen; the check for the presence of tls is made
217
# status_log "Could not find the package tls on this system.\n"
225
set log_dir "[file join ${HOME} logs]"
230
sb set ns data [list]
231
sb set ns serv [split $config(start_ns_server) ":"]
234
set family [lindex $config(basefont) 0]
235
set size [lindex $config(basefont) 1]
239
if { $family == "" } { set family "Helvetica"}
240
if { $size == "" } { set size "11"}
241
::amsn::initLook $family $size $config(backgroundcolor)
244
if { $config(encoding) != "auto" } {
245
set_encoding $config(encoding)
248
if { $config(receiveddir) != "" } {
249
set res [create_dir $config(receiveddir)]
251
set files_dir $config(receiveddir)
253
create_dir $files_dir
256
set config(receiveddir) $files_dir
257
create_dir $files_dir
262
bind all <KeyPress> "set idletime 0"
273
if {$tcl_platform(os) == "Darwin"} {
274
if { $config(getdisppic) != 0 } {
278
if { $config(getdisppic) != 0 } {
286
if {$version != $config(last_client_version)} {
291
if { $config(autoconnect) == 1 } {
292
::MSN::connect $config(login) password
295
if { $config(autocheckver) == 1 } {
296
set new [check_version_silent]
303
if {$config(startontray)} {
304
if {$config(dock)!=0} {
19
#Source the main file, amsn
20
source [file join $program_dir amsn]
b'\\ No newline at end of file'