2
if { $initialize_amsn == 1 } {
3
global statusicon mailicon systemtray_exist iconmenu
10
proc iconify_proc {} {
11
global statusicon config systemtray_exist
12
if { [focus] == "."} {
14
if { $config(closingdocks) } {
23
#bind $statusicon <Button-1> deiconify_proc
26
proc trayicon_init {} {
27
global program_dir config systemtray_exist password iconmenu
28
set ext "[file /usr/share/amsn/plugins/traydock/libtray.so]"
29
if { [file exists $ext] != 1 } {
30
msg_box "[trans traynotcompiled]"
36
if { $systemtray_exist == 0 && $config(dock) == 3} {
38
set systemtray_exist [systemtray_exist]; #a system tray exist?
41
# menu .imstatus -tearoff 0 -type normal ####### submenu in the icon menu won't work in my setup. why?
42
# .imstatus add command -label [trans online] -command "::MSN::changeStatus NLN"
43
# .imstatus add command -label [trans noactivity] -command "::MSN::changeStatus IDL"
44
# .imstatus add command -label [trans busy] -command "::MSN::changeStatus BSY"
45
# .imstatus add command -label [trans rightback] -command "::MSN::changeStatus BRB"
46
# .imstatus add command -label [trans away] -command "::MSN::changeStatus AWY"
47
# .imstatus add command -label [trans onphone] -command "::MSN::changeStatus PHN"
48
# .imstatus add command -label [trans gonelunch] -command "::MSN::changeStatus LUN"
49
# .imstatus add command -label [trans appearoff] -command "::MSN::changeStatus HDN"
50
# .imstatus add separator
51
# .imstatus add command -label "[trans changenick]..." -command cmsn_change_name
54
menu $iconmenu -tearoff 0 -type normal
55
$iconmenu add command -label "[trans offline]"
56
#$iconmenu add command -label "[trans offline]"
57
$iconmenu add separator
58
if { [string length $config(login)] > 0 } {
59
if {$password != ""} {
60
#$iconmenu add command -label "[trans login] $config(login)" -command "::MSN::connect $config(login) $password" -state normal
62
#$iconmenu add command -label "[trans login] $config(login)" -command cmsn_draw_login -state normal
65
#$iconmenu add command -label "[trans login]" -command "::MSN::connect $config(login) $password" -state disabled
67
#$iconmenu add command -label "[trans login]..." -command cmsn_draw_login
68
$iconmenu add command -label "[trans logout]" -command "::MSN::logout; save_alarms" -state disabled
69
$iconmenu add command -label "[trans changenick]..." -command cmsn_change_name -state disabled
70
$iconmenu add separator
71
$iconmenu add command -label "[trans sendmsg]..." -command "::amsn::ChooseList \"[trans sendmsg]\" online ::amsn::chatUser 1 0" -state disabled
72
$iconmenu add command -label "[trans sendmail]..." -command "::amsn::ChooseList \"[trans sendmail]\" both \"launch_mailer\" 1 0" -state disabled
73
#$iconmenu add command -label "[trans checkver]..." -command "check_version"
74
$iconmenu add separator
75
$iconmenu add command -label "[trans mystatus]" -state disabled
76
$iconmenu add command -label " [trans online]" -command "::MSN::changeStatus NLN" -state disabled
77
$iconmenu add command -label " [trans noactivity]" -command "::MSN::changeStatus IDL" -state disabled
78
$iconmenu add command -label " [trans busy]" -command "::MSN::changeStatus BSY" -state disabled
79
$iconmenu add command -label " [trans rightback]" -command "::MSN::changeStatus BRB" -state disabled
80
$iconmenu add command -label " [trans away]" -command "::MSN::changeStatus AWY" -state disabled
81
$iconmenu add command -label " [trans onphone]" -command "::MSN::changeStatus PHN" -state disabled
82
$iconmenu add command -label " [trans gonelunch]" -command "::MSN::changeStatus LUN" -state disabled
83
$iconmenu add command -label " [trans appearoff]" -command "::MSN::changeStatus HDN" -state disabled
84
$iconmenu add separator
85
$iconmenu add command -label "[trans close]" -command "close_cleanup;exit"
88
proc statusicon_proc {status} {
89
global systemtray_exist config statusicon user_info list_states user_stat iconmenu
92
if { $systemtray_exist == 1 && $statusicon == 0 && $config(dock) == 3} {
93
set pixmap "[GetSkinFile pixmaps doffline.xpm]"
94
set statusicon [newti $icon -pixmap $pixmap -tooltip offline]
95
bind $icon <Double-Button-1> iconify_proc
96
bind $icon <Button3-ButtonRelease> "tk_popup $iconmenu %X %Y"
98
set my_name [urldecode [lindex $user_info 4]]
100
if {$systemtray_exist == 1 && $statusicon != 0 && $config(dock) == 3 && $status != "REMOVE"} {
101
if { $status != "" } {
102
if { $status == "FLN" } {
103
$iconmenu entryconfigure 2 -state disabled
104
$iconmenu entryconfigure 3 -state disabled
105
$iconmenu entryconfigure 5 -state disabled
106
$iconmenu entryconfigure 6 -state disabled
107
$iconmenu entryconfigure 8 -state disabled
108
$iconmenu entryconfigure 9 -state disabled
109
$iconmenu entryconfigure 10 -state disabled
110
$iconmenu entryconfigure 11 -state disabled
111
$iconmenu entryconfigure 12 -state disabled
112
$iconmenu entryconfigure 13 -state disabled
113
$iconmenu entryconfigure 14 -state disabled
114
$iconmenu entryconfigure 15 -state disabled
115
$iconmenu entryconfigure 16 -state disabled
118
$iconmenu entryconfigure 2 -state normal
119
$iconmenu entryconfigure 3 -state normal
120
$iconmenu entryconfigure 5 -state normal
121
$iconmenu entryconfigure 6 -state normal
122
$iconmenu entryconfigure 8 -state normal
123
$iconmenu entryconfigure 9 -state normal
124
$iconmenu entryconfigure 10 -state normal
125
$iconmenu entryconfigure 11 -state normal
126
$iconmenu entryconfigure 12 -state normal
127
$iconmenu entryconfigure 13 -state normal
128
$iconmenu entryconfigure 14 -state normal
129
$iconmenu entryconfigure 15 -state normal
130
$iconmenu entryconfigure 16 -state normal
135
set pixmap "[GetSkinFile pixmaps doffline.xpm]"
136
set tooltip "[trans offline]"
140
set pixmap "[GetSkinFile pixmaps donline.xpm]"
141
set tooltip "$my_name ($config(login)): [trans online]"
145
set pixmap "[GetSkinFile pixmaps dinactive.xpm]"
146
set tooltip "$my_name ($config(login)): [trans noactivity]"
147
#$iconmenu entryconfigure 0 -label $tooltip
150
set pixmap "[GetSkinFile pixmaps dbusy.xpm]"
151
set tooltip "$my_name ($config(login)): [trans busy]"
152
#$iconmenu entryconfigure 0 -label $tooltip
155
set pixmap "[GetSkinFile pixmaps dbrb.xpm]"
156
set tooltip "$my_name ($config(login)): [trans rightback]"
157
#$iconmenu entryconfigure 0 -label $tooltip
160
set pixmap "[GetSkinFile pixmaps daway.xpm]"
161
set tooltip "$my_name ($config(login)): [trans away]"
162
#$iconmenu entryconfigure 0 -label $tooltip
165
set pixmap "[GetSkinFile pixmaps dphone.xpm]"
166
set tooltip "$my_name ($config(login)): [trans onphone]"
167
#$iconmenu entryconfigure 0 -label $tooltip
170
set pixmap "[GetSkinFile pixmaps dlunch.xpm]"
171
set tooltip "$my_name ($config(login)): [trans gonelunch]"
172
#$iconmenu entryconfigure 0 -label $tooltip
175
set pixmap "[GetSkinFile pixmaps dhidden.xpm]"
176
set tooltip "$my_name ($config(login)): [trans appearoff]"
177
#$iconmenu entryconfigure 0 -label $tooltip
184
$iconmenu entryconfigure 0 -label "$config(login)"
185
if { $pixmap != "null"} {
186
configureti $statusicon -pixmap $pixmap -tooltip $tooltip
189
} elseif {$systemtray_exist == 1 && $statusicon != 0 && $status == "REMOVE"} {
190
remove_icon $statusicon
195
proc mailicon_proc {num} {
196
global systemtray_exist mailicon config password
198
if {$systemtray_exist == 1 && $mailicon == 0 && $config(dock) == 3 && $num >0} {
199
set pixmap "[GetSkinFile pixmaps unread.gif]"
201
set msg [trans onenewmail]
202
} elseif { $num == 2 } {
203
set msg [trans twonewmail 2]
205
set msg [trans newmail $num]
207
set mailicon [newti $icon -pixmap $pixmap -tooltip $msg]
208
bind $icon <Button-1> "hotmail_login $config(login) $password"
209
} elseif {$systemtray_exist == 1 && $mailicon != 0 && $num ==0} {
210
remove_icon $mailicon
212
} elseif {$systemtray_exist == 1 && $mailicon != 0 && $config(dock) == 3 && $num >0} {
214
set msg [trans onenewmail]
215
} elseif { $num == 2 } {
216
set msg [trans twonewmail 2]
218
set msg [trans newmail $num]
220
configureti $mailicon -tooltip $msg
224
proc remove_icon {icon} {
225
global systemtray_exist config
226
if {$systemtray_exist == 1 && $icon != 0} {