~ubuntu-branches/ubuntu/gutsy/amsn/gutsy

« back to all changes in this revision

Viewing changes to amsn

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Karkoulis
  • Date: 2006-01-04 15:26:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104152602-ipe1yg00rl3nlklv
Tags: 0.95-1
New Upstream Release (closes: #345052, #278575).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env wish
 
1
#!/bin/bash
 
2
# \
 
3
exec wish $0
 
4
 
2
5
###
3
6
###
4
7
################################################################
40
43
############################################################
41
44
### Hide the window until it has been fully displayed
42
45
############################################################
 
46
package require Tk
43
47
wm state . withdraw
44
48
 
45
49
 
46
50
############################################################
47
51
### Some global variables
48
52
############################################################
49
 
set version "0.94"
50
 
set date "11/06/2004"
 
53
set version "0.95"
 
54
set date "12/05/2005"
51
55
set weburl "http://amsn.sourceforge.net"
52
56
set program_dir "."
53
57
set HOME ""
 
58
set HOME2 ""
54
59
set files_dir ""
55
60
 
56
61
#=======================================================================
65
70
set program_dir [file dirname [info script]]
66
71
set program [file tail [info script]]
67
72
 
 
73
 
68
74
while {[catch {file readlink [file join $program_dir $program]} program]== 0} {
69
75
        if {[file pathtype $program] == "absolute"} {
70
76
                set program_dir [file dirname $program]
104
110
   set HOME "[file join [pwd] amsn_config]"
105
111
   set files_dir "[file join [pwd] amsn_received]"
106
112
}
 
113
set HOME2 $HOME
107
114
 
108
115
############################################################
109
116
### And setup where to find optional packages
110
117
############################################################
111
118
 
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]
 
127
}
 
128
lappend auto_path [file join utils]
114
129
 
115
130
set libtls ""
116
131
 
133
148
############################################################
134
149
set initialize_amsn 1
135
150
 
 
151
 
136
152
proc reload_files { } {
137
 
    foreach glob "[info globals] xmms" {
138
 
        global $glob
139
 
    }
140
 
 
 
153
        #ensure all globals are accessible
 
154
        foreach glob [info globals] {
 
155
                global $glob
 
156
        }
 
157
        
141
158
        source ctthemes.tcl
142
159
        source progressbar.tcl  ;# Progressbar Megawidget
143
160
        source migmd5.tcl
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
156
 
        source config.tcl
157
 
        source proxy.tcl
158
173
        source abook.tcl        ;# Handle buddy address book    
159
174
        source protocol.tcl
160
 
        source ctadverts.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
 
178
        source proxy.tcl
 
179
        source msnp2p.tcl
 
180
        source msncam.tcl
 
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"} {
166
 
                source xmms.tcl
167
 
        }
 
185
 
 
186
 
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
170
189
        }
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
177
195
 
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!!!!!!!!!! :@
 
198
        source notes.tcl
 
199
 
 
200
        source guicontactlist.tcl ;# New contact list (uses canvas)
 
201
        source bugs.tcl         ;#bug reporting
180
202
 
181
203
 
182
204
}
183
205
 
184
 
proc check_imagemagick {} {
185
206
 
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
188
210
        }
189
 
 
190
 
        set found -1
191
 
 
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] } {
196
 
                        set found $path
197
 
                        break
198
 
 
 
211
}
 
212
 
 
213
 
 
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" } {
 
218
                        return $val
 
219
                } else {
 
220
                        return [lreplace $list [lindex $args 0] [lindex $args 0] [lset_r [lindex $list [lindex $args 0]] [lrange $args 1 end] $val]]
199
221
                }
200
222
        }
201
 
        if  { $found != -1  } {
202
 
                ::config::setKey convertpath "$found"
203
 
                ::config::setKey getdisppic 1
204
 
                return 1
205
 
        } else {
206
 
                #-1 means you want them enabled, but imagemagic is not installed...
207
 
                ::config::setKey getdisppic -1
208
 
                return 0
 
223
        proc lset {listName args} {
 
224
                upvar $listName list
 
225
                set list [lset_r [K $list [set list {}]] [lrange $args 0 end-1] [lindex $args end]]
209
226
        }
210
 
 
211
227
}
212
228
 
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]
218
 
#       }
219
 
#}
220
 
 
221
229
reload_files
222
230
 
223
231
set initialize_amsn 0
233
241
    set tlsinstalled 1
234
242
}
235
243
 
236
 
 
237
244
#create_dir $HOME
238
245
set log_dir "[file join ${HOME} logs]"
239
 
#create_dir $log_dir
 
246
set webcam_dir "[file join ${HOME} webcam]"
 
247
create_dir $log_dir
 
248
create_dir $webcam_dir
240
249
 
241
 
sb set ns name ns
242
 
sb set ns sock ""
243
 
sb set ns data [list]
244
 
sb set ns serv [split [::config::getKey start_ns_server] ":"]
245
 
sb set ns stat "d"
 
250
NS create ns -stat d -server [split [::config::getKey start_ns_server] ":"]
246
251
 
247
252
set family [lindex [::config::getGlobalKey basefont] 0]
248
253
set size [lindex [::config::getGlobalKey basefont] 1]
253
258
::amsn::initLook $family $size [::config::getKey backgroundcolor]
254
259
 
255
260
 
 
261
set ::auto_encoding [encoding system]
 
262
 
256
263
if { [::config::getKey encoding] != "auto" } {
257
264
  set_encoding [::config::getKey encoding]
258
265
}
278
285
degt_protocol_win
279
286
degt_ns_command_win
280
287
 
281
 
after 500 proc_ns
282
 
after 750 proc_sb
283
 
 
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 } {
287
 
                check_imagemagick
288
 
        }
289
 
}
290
 
 
291
 
 
292
 
 
 
288
#after 500 proc_ns
 
289
#after 750 proc_sb
293
290
 
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]
 
297
        }
297
298
}
298
299
 
299
300
update idletasks
303
304
}
304
305
 
305
306
if { [::config::getKey autocheckver] == 1 } {
306
 
    set new [check_version_silent]
 
307
    set new [::autoupdate::check_version_silent]
307
308
}
308
309
 
309
310